|
libscratchcpp
A library for C++ based Scratch project players
|
The main namespace of the library. More...
Namespaces | |
| namespace | test |
Classes | |
| class | Asset |
| The Asset class represents a Scratch asset, for example a Costume or a Sound. More... | |
| class | Block |
| The Block class represents a Scratch block. More... | |
| class | BlockPrototype |
| The BlockPrototype class represents the prototype of a custom block. More... | |
| class | Broadcast |
| The Broadcast class represents a Scratch broadcast. More... | |
| class | Comment |
| The Comment class represents a comment in the code area. More... | |
| class | Compiler |
| The Compiler class provides API for compiling Scratch scripts. More... | |
| class | CompilerConstant |
| The CompilerConstant class represents a constant value in compiled code. More... | |
| class | CompilerContext |
| The CompilerContext represents a context for a specific target which is used with the Compiler class. More... | |
| class | CompilerLocalVariable |
| The CompilerLocalVariable class represents a statically typed local variable in compiled code. More... | |
| class | CompilerValue |
| The CompilerValue class represents a local value in compiled code. More... | |
| class | Costume |
| The Costume class represents a Scratch costume. More... | |
| class | Drawable |
| The Drawable class is the base class of rendered elements (stage, sprites, text bubbles). More... | |
| class | Entity |
| The Entity class is the base class of everything that is identified by an ID (Target, Variable, List, etc.). More... | |
| class | ExecutableCode |
| The ExecutableCode class represents the code of a compiled Scratch script. More... | |
| class | ExecutionContext |
| The ExecutionContext represents the execution context of a target (can be a clone) with variables, lists, etc. More... | |
| class | Field |
| The Field class represents a Scratch block field. More... | |
| class | IEngine |
| The IEngine interface provides an API for running Scratch projects. More... | |
| class | IExtension |
| The IExtension class is an interface for extensions. More... | |
| class | IGraphicsEffect |
| The IGraphicsEffects class is an interface for custom graphics effects. More... | |
| class | IMonitorHandler |
| class | Input |
| The Input class represents a Scratch block input. More... | |
| class | InputValue |
| The InputValue class provides methods for the value of an Input. More... | |
| class | IRandomGenerator |
| The IRandomGenerator interface represents a random number generator that can be received e. g. from an ExecutionContext. More... | |
| class | ISpriteHandler |
| The ISpriteHandler class provides a sprite interface for Scratch project players. More... | |
| class | IStackTimer |
| The IStackTimer interface represents a timer that can be used by blocks. More... | |
| class | IStageHandler |
| The IStageHandler class provides a stage interface for Scratch project players. More... | |
| class | ITimer |
| The ITimer interface represents a timer of a Scratch project. More... | |
| class | KeyEvent |
| The KeyEvent class represents a Scratch key event. More... | |
| class | List |
| The List class represents a Scratch list. More... | |
| class | Monitor |
| The Monitor class represents a stage monitor. More... | |
| class | Project |
| The Project class provides API for reading and running Scratch projects. More... | |
| class | Promise |
| The Promise class represents the eventual completion of an asynchronous operation. More... | |
| class | Rect |
| class | ScratchConfiguration |
| The ScratchConfiguration class provides methods for adding custom extensions. More... | |
| class | Script |
| The Script class represents a compiled Scratch script. More... | |
| class | Sound |
| The Sound class represents a Scratch sound. More... | |
| class | Sprite |
| The Sprite class represents a Scratch sprite. More... | |
| class | Stage |
| The Stage class is the project stage. More... | |
| struct | StringPtr |
| The StringPtr struct holds a string data pointer and string size. More... | |
| class | Target |
| The Target class is the Stage or a Sprite. More... | |
| class | TextBubble |
| The TextBubble class represents a text bubble created using say or think block. More... | |
| class | Thread |
| The Thread class represents a running Scratch script. More... | |
| class | Value |
| The Value class represents a Scratch value. More... | |
| struct | ValueData |
| The ValueData struct holds the data of Value. It's used in compiled Scratch code for better performance. More... | |
| class | Variable |
| The Variable class represents a Scratch variable. More... | |
Typedefs | |
| using | BlockComp = CompilerValue *(*)(Compiler *) |
| using | MonitorNameFunc = const std::string &(*)(Block *) |
| using | MonitorChangeFunc = void (*)(Block *, const Value &newValue) |
| using | HatPredicateCompileFunc = CompilerValue *(*)(Compiler *vm) |
| using | Rgb = unsigned int |
Functions | |
| constexpr bool | enable_enum_bitmask (Compiler::StaticType) |
| template<typename T> | |
| constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > | operator| (const T lhs, const T rhs) |
| template<typename T> | |
| constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > | operator|= (T &lhs, const T rhs) |
| template<typename T> | |
| constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > | operator& (const T lhs, const T rhs) |
| template<typename T> | |
| constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > | operator&= (T &lhs, const T rhs) |
| template<typename T> | |
| constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > | operator~ (const T value) |
| LIBSCRATCHCPP_EXPORT void | string_alloc (StringPtr *str, size_t size) |
| LIBSCRATCHCPP_EXPORT void | string_assign (StringPtr *str, const StringPtr *another) |
| LIBSCRATCHCPP_EXPORT void | string_assign_cstring (StringPtr *str, const char *another) |
| LIBSCRATCHCPP_EXPORT int | string_compare_raw_case_sensitive (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2) |
| LIBSCRATCHCPP_EXPORT int | string_compare_case_sensitive (const StringPtr *str1, const StringPtr *str2) |
| LIBSCRATCHCPP_EXPORT int | string_compare_raw_case_insensitive (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2) |
| LIBSCRATCHCPP_EXPORT int | string_compare_case_insensitive (const StringPtr *str1, const StringPtr *str2) |
| LIBSCRATCHCPP_EXPORT bool | string_contains_raw_case_sensitive (const char16_t *str, const char16_t *substr) |
| LIBSCRATCHCPP_EXPORT bool | string_contains_case_sensitive (const StringPtr *str, const StringPtr *substr) |
| LIBSCRATCHCPP_EXPORT bool | string_contains_raw_case_insensitive (const char16_t *str, const char16_t *substr) |
| LIBSCRATCHCPP_EXPORT bool | string_contains_case_insensitive (const StringPtr *str, const StringPtr *substr) |
| LIBSCRATCHCPP_EXPORT StringPtr * | string_pool_new () |
| LIBSCRATCHCPP_EXPORT void | string_pool_free (StringPtr *str) |
| constexpr int | red (Rgb rgb) |
| constexpr int | green (Rgb rgb) |
| constexpr int | blue (Rgb rgb) |
| constexpr int | alpha (Rgb rgb) |
| constexpr Rgb | rgb (int r, int g, int b) |
| constexpr Rgb | rgba (int r, int g, int b, int a) |
| void | value_free (ValueData *v) |
| void | value_init (ValueData *v) |
| void | value_assign_double (ValueData *v, double numberValue) |
| void | value_assign_bool (ValueData *v, bool boolValue) |
| void | value_assign_string (ValueData *v, const std::string &stringValue) |
| void | value_assign_cstring (ValueData *v, const char *stringValue) |
| void | value_assign_stringPtr (ValueData *v, const StringPtr *stringValue) |
| void | value_assign_pointer (ValueData *v, const void *pointerValue) |
| void | value_assign_copy (ValueData *v, const ValueData *another) |
| bool | value_isInfinity (const ValueData *v) |
| bool | value_isNegativeInfinity (const ValueData *v) |
| bool | value_isNaN (const ValueData *v) |
| bool | value_isNumber (const ValueData *v) |
| bool | value_isValidNumber (const ValueData *v) |
| bool | value_isInt (const ValueData *v) |
| bool | value_isBool (const ValueData *v) |
| bool | value_isString (const ValueData *v) |
| bool | value_isPointer (const ValueData *v) |
| long | value_toLong (const ValueData *v) |
| int | value_toInt (const ValueData *v) |
| double | value_toDouble (const ValueData *v) |
| bool | value_toBool (const ValueData *v) |
| void | value_toString (const ValueData *v, std::string *dst) |
| void | value_toStringPtr (const ValueData *v, StringPtr *dst) |
| void | value_toUtf16 (const ValueData *v, std::u16string *dst) |
| Rgb | value_toRgba (const ValueData *v) |
| const void * | value_toPointer (const ValueData *v) |
| bool | value_doubleIsInt (double v) |
| void | value_doubleToStringPtr (double v, StringPtr *dst) |
| const StringPtr * | value_boolToStringPtr (bool v) |
| double | value_stringToDouble (const StringPtr *s) |
| double | value_stringToDoubleWithCheck (const StringPtr *s, bool *ok) |
| bool | value_stringToBool (const StringPtr *s) |
| void | value_add (const ValueData *v1, const ValueData *v2, ValueData *dst) |
| void | value_subtract (const ValueData *v1, const ValueData *v2, ValueData *dst) |
| void | value_multiply (const ValueData *v1, const ValueData *v2, ValueData *dst) |
| void | value_divide (const ValueData *v1, const ValueData *v2, ValueData *dst) |
| void | value_mod (const ValueData *v1, const ValueData *v2, ValueData *dst) |
| bool | value_equals (const ValueData *v1, const ValueData *v2) |
| bool | value_greater (const ValueData *v1, const ValueData *v2) |
| bool | value_lower (const ValueData *v1, const ValueData *v2) |
| void | list_clear (List *list) |
| void | list_remove (List *list, size_t index) |
| ValueData * | list_append_empty (List *list) |
| ValueData * | list_insert_empty (List *list, size_t index) |
| ValueData * | list_get_item (List *list, size_t index) |
| ValueData * | list_data (List *list) |
| ValueData *const * | list_data_ptr (List *list) |
| size_t * | list_size_ptr (List *list) |
| const size_t * | list_alloc_size_ptr (List *list) |
| size_t | list_size (List *list) |
| void | list_to_string (List *list, StringPtr *dst) |
| int | string_compare_raw_case_sensitive_inline (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2) |
| int | string_compare_raw_case_insensitive_inline (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2) |
| bool | string_contains_raw_case_sensitive_inline (const char16_t *str, const char16_t *substr) |
| bool | string_contains_raw_case_insensitive_inline (const char16_t *str, const char16_t *substr) |
The main namespace of the library.
| using libscratchcpp::BlockComp = CompilerValue *(*)(Compiler *) |
BlockComp is a function pointer for functions which are used to compile blocks.
| using libscratchcpp::HatPredicateCompileFunc = CompilerValue *(*)(Compiler *vm) |
HatPredicateCompileFunc is a function pointer for functions which are used to compile edge-activated hat predicates.
| using libscratchcpp::MonitorChangeFunc = void (*)(Block *, const Value &newValue) |
MonitorChangeFunc is a function pointer for functions which are used to change monitor values.
| using libscratchcpp::MonitorNameFunc = const std::string &(*)(Block *) |
MonitorNameFunc is a function pointer for functions which are used to get monitor names.
| using libscratchcpp::Rgb = unsigned int |
A typedef for unsigned int. Holds the RGBA values.
|
inlineconstexpr |
Returns the alpha component of the quadruplet rgb.
|
inlineconstexpr |
Returns the blue component of the quadruplet rgb.
|
constexpr |
|
inlineconstexpr |
Returns the green component of the quadruplet rgb.
| const size_t * libscratchcpp::list_alloc_size_ptr | ( | List * | list | ) |
| void libscratchcpp::list_clear | ( | List * | list | ) |
| void libscratchcpp::list_remove | ( | List * | list, |
| size_t | index ) |
| size_t libscratchcpp::list_size | ( | List * | list | ) |
| size_t * libscratchcpp::list_size_ptr | ( | List * | list | ) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
inlineconstexpr |
Returns the red component of the quadruplet rgb.
|
inlineconstexpr |
Creates an RGB triplet from the given color components.
|
inlineconstexpr |
Creates an RGBA quadruplet from the given color components.
| void libscratchcpp::string_alloc | ( | StringPtr * | str, |
| size_t | size ) |
Ensures at least the given size is allocated on str.
Assigns the given string to str.
| void libscratchcpp::string_assign_cstring | ( | StringPtr * | str, |
| const char * | another ) |
Assigns the given string to str.
| int libscratchcpp::string_compare_case_insensitive | ( | const StringPtr * | str1, |
| const StringPtr * | str2 ) |
| int libscratchcpp::string_compare_raw_case_insensitive | ( | const char16_t * | str1, |
| size_t | n1, | ||
| const char16_t * | str2, | ||
| size_t | n2 ) |
|
inline |
| int libscratchcpp::string_compare_raw_case_sensitive | ( | const char16_t * | str1, |
| size_t | n1, | ||
| const char16_t * | str2, | ||
| size_t | n2 ) |
|
inline |
| bool libscratchcpp::string_contains_case_insensitive | ( | const StringPtr * | str, |
| const StringPtr * | substr ) |
Returns true if the string contains the given substring (case insensitive).
| bool libscratchcpp::string_contains_case_sensitive | ( | const StringPtr * | str, |
| const StringPtr * | substr ) |
Returns true if the string contains the given substring (case sensitive).
| bool libscratchcpp::string_contains_raw_case_insensitive | ( | const char16_t * | str, |
| const char16_t * | substr ) |
Returns true if the string contains the given substring (case insensitive).
|
inline |
| bool libscratchcpp::string_contains_raw_case_sensitive | ( | const char16_t * | str, |
| const char16_t * | substr ) |
Returns true if the string contains the given substring (case sensitive).
|
inline |
| void libscratchcpp::string_pool_free | ( | StringPtr * | str | ) |
Invalidates the given StringPtr so that it can be used for new strings later.
| StringPtr * libscratchcpp::string_pool_new | ( | ) |
Use this instead of dynamically allocating StringPtr.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_add | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2, | ||
| ValueData * | dst ) |
Adds the given values and writes the result to dst.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_bool | ( | ValueData * | v, |
| bool | boolValue ) |
Assigns boolean to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_copy | ( | ValueData * | v, |
| const libscratchcpp::ValueData * | another ) |
Assigns another value to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_cstring | ( | ValueData * | v, |
| const char * | stringValue ) |
Assigns C string to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_double | ( | ValueData * | v, |
| double | numberValue ) |
Assigns number of type 'double' to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_pointer | ( | ValueData * | v, |
| const void * | pointerValue ) |
Assigns pointer to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_string | ( | ValueData * | v, |
| const std::string & | stringValue ) |
Assigns string to the given value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_stringPtr | ( | ValueData * | v, |
| const StringPtr * | stringValue ) |
Assigns string to the given value.
| LIBSCRATCHCPP_EXPORT const StringPtr * libscratchcpp::value_boolToStringPtr | ( | bool | v | ) |
Converts the given boolean to string.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_divide | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2, | ||
| ValueData * | dst ) |
Divides the given values and writes the result to dst.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_doubleIsInt | ( | double | v | ) |
Returns true if the given number represents a round integer.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_doubleToStringPtr | ( | double | v, |
| StringPtr * | dst ) |
Converts the given number to string and stores the result in dst.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_equals | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2 ) |
Returns true if the given values are equal.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_free | ( | ValueData * | v | ) |
Frees memory used by the given value if it's a string.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_greater | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2 ) |
Returns true if the first value is greater than the second value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_init | ( | ValueData * | v | ) |
Initializes the given value.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isBool | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is a boolean.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isInfinity | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is Infinity.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isInt | ( | const ValueData * | v | ) |
Returns true if the given value represents a round integer.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNaN | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is NaN.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNegativeInfinity | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is -Infinity.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNumber | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is a number.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isPointer | ( | const ValueData * | v | ) |
Returns true if the given value is a pointer.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isString | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is a string.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isValidNumber | ( | const libscratchcpp::ValueData * | v | ) |
Returns true if the given value is a number or can be converted to a number.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_lower | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2 ) |
Returns true if the first value is lower than the second value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_mod | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2, | ||
| ValueData * | dst ) |
Calculates the modulo the given values and writes the result to dst.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_multiply | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2, | ||
| ValueData * | dst ) |
Multiplies the given values and writes the result to dst.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_stringToBool | ( | const StringPtr * | s | ) |
Converts the given string to boolean.
| LIBSCRATCHCPP_EXPORT double libscratchcpp::value_stringToDouble | ( | const StringPtr * | s | ) |
Converts the given string to double.
| LIBSCRATCHCPP_EXPORT double libscratchcpp::value_stringToDoubleWithCheck | ( | const StringPtr * | s, |
| bool * | ok ) |
Converts the given string to double.
| [out] | ok | Whether the conversion was successful. |
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_subtract | ( | const libscratchcpp::ValueData * | v1, |
| const libscratchcpp::ValueData * | v2, | ||
| ValueData * | dst ) |
Subtracts the given values and writes the result to dst.
| LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_toBool | ( | const libscratchcpp::ValueData * | v | ) |
Returns the boolean representation of the given value.
| LIBSCRATCHCPP_EXPORT double libscratchcpp::value_toDouble | ( | const libscratchcpp::ValueData * | v | ) |
Returns the double representation of the given value.
| LIBSCRATCHCPP_EXPORT int libscratchcpp::value_toInt | ( | const libscratchcpp::ValueData * | v | ) |
Returns the int representation of the given value.
| LIBSCRATCHCPP_EXPORT long libscratchcpp::value_toLong | ( | const libscratchcpp::ValueData * | v | ) |
Returns the long representation of the given value.
| LIBSCRATCHCPP_EXPORT const void * libscratchcpp::value_toPointer | ( | const ValueData * | v | ) |
Returns the pointer stored in the given value or nullptr if it isn't a pointer.
| LIBSCRATCHCPP_EXPORT Rgb libscratchcpp::value_toRgba | ( | const ValueData * | v | ) |
Returns the RGBA quadruplet from the given color value.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toString | ( | const ValueData * | v, |
| std::string * | dst ) |
Writes the string representation of the given value to dst.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toStringPtr | ( | const ValueData * | v, |
| StringPtr * | dst ) |
Writes the string representation of the given value to dst.
| LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toUtf16 | ( | const libscratchcpp::ValueData * | v, |
| std::u16string * | dst ) |
Writes the UTF-16 representation of the given value to dst.