Skip to content

Commit

Permalink
APL-CORE: February 2023 Release of APL 2023.1 compliant core engine (…
Browse files Browse the repository at this point in the history
…2023.1.0)

For more details on this release refer to CHANGELOG.md

To learn about APL see: https://developer.amazon.com/docs/alexa-presentation-language/understand-apl.html
  • Loading branch information
sasirajah committed Feb 7, 2023
1 parent ee4363d commit 0442a24
Show file tree
Hide file tree
Showing 234 changed files with 7,564 additions and 2,050 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,17 @@
# Changelog

## [2023.1]

### Added

- Three Porter-Duff operations to the Blend filter
- Selector syntax for choosing the target of a command
- TextTrack property for closed captions

### Changed

- Bug fixes.

## [2022.2.1]

### Changed
Expand Down
25 changes: 24 additions & 1 deletion README.md
Expand Up @@ -182,8 +182,31 @@ following:
apl-check-core
```

Mac Note: The CMake build generates the file `CMakeCache.txt` which contains paths to the system SDKROOT and build tools.
New installations of XCode or Mac Command Line tools often modify the "Active Developer Directory" changing the location
of the SDK. This may result in build failures. Most often this issue can be characterized by a failure to find the
`SYSROOT` path.
An example of the path from `CMakeCache.txt` may look like:
`CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk`
The "Active Developer Directory" can be identified as follows:
```shell
> xcode-select -p
/Library/Developer/CommandLineTools
```


To resolve, any of the following options are possible
- To use the `SYSROOT` derived from the new "Active Developer Directory":
Delete the build folder and regenerate the build. A "clean" build is not sufficient for `CmakeCache.txt`
to be recreated.
- To modify the "Active Developer Directory" to the desired SDK and tools paths
Use `xcode-select` to set the new path or reset to the default.
- To specify the explicit location of the SDK and tools rather than use the "Active Developer Directory"
Modify the `CMakeCache.txt` SDK and tool paths. This option is not recommended, as it must be repeated any time the
build folder is absent.

# Building APL Core + Tests (Windows)
To build `apl.lib` and tests in in a Windows or UWP environment, do the
To build `apl.lib` and tests in a Windows or UWP environment, do the
following:

```
Expand Down
6 changes: 3 additions & 3 deletions aplcore/CMakeLists.txt
Expand Up @@ -83,12 +83,12 @@ add_subdirectory(src/livedata)
add_subdirectory(src/media)
add_subdirectory(src/primitives)
add_subdirectory(src/scaling)
if(ENABLE_SCENEGRAPH)
add_subdirectory(src/scenegraph)
endif(ENABLE_SCENEGRAPH)
add_subdirectory(src/time)
add_subdirectory(src/touch)
add_subdirectory(src/utils)
if(ENABLE_SCENEGRAPH)
add_subdirectory(src/scenegraph)
endif(ENABLE_SCENEGRAPH)

set(
PUBLIC_HEADER_LIST
Expand Down
4 changes: 2 additions & 2 deletions aplcore/include/apl/action/arrayaction.h
Expand Up @@ -17,8 +17,8 @@
#define _APL_ACTION_ARRAY_ACTION_H

#include "apl/action/action.h"
#include "apl/command/command.h"
#include "apl/command/arraycommand.h"
#include "apl/command/command.h"

namespace apl {

Expand All @@ -41,7 +41,7 @@ class ArrayAction : public Action {
const std::shared_ptr<const ArrayCommand> mCommand;
const bool mFastMode;

int mNextIndex;
size_t mNextIndex;

CommandPtr mCurrentCommand;
ActionPtr mCurrentAction;
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/sequentialaction.h
Expand Up @@ -43,7 +43,7 @@ class SequentialAction : public Action {
bool mFastMode;
bool mStateFinally;

int mNextIndex;
size_t mNextIndex;
int mRepeatCounter;

CommandPtr mCurrentCommand;
Expand Down
16 changes: 9 additions & 7 deletions aplcore/include/apl/animation/easingapproximation.h
Expand Up @@ -29,7 +29,7 @@ class EasingApproximation : public EasingSegment::Data,

public:
/**
* Create an easing curve approximation.
* Create an easing curve approximation or return an equivalent one from cache if possible.
* @param dof The number of entries in the start, tout, tin, and end arrays
* @param start An array of starting values
* @param tout An array of tangent-out values (relative to the start value)
Expand All @@ -38,12 +38,12 @@ class EasingApproximation : public EasingSegment::Data,
* @param blockCount The total number of subsegments to create.
* @return A pointer to the easing approximation.
*/
static std::shared_ptr<EasingApproximation> create(int dof,
const float *start,
const float *tout,
const float *tin,
const float *end,
int blockCount);
static std::shared_ptr<EasingApproximation> getOrCreate(int dof,
const float *start,
const float *tout,
const float *tin,
const float *end,
int blockCount);

// Private constructor - use the "create" method instead.
EasingApproximation(int dof,
Expand All @@ -53,6 +53,8 @@ class EasingApproximation : public EasingSegment::Data,
mData(std::move(data)),
mCumulative(std::move(cumulative)) {}

~EasingApproximation();

/**
* Calculate a position along the easing curve.
* @param percentage The percentage of the length of the path.
Expand Down
1 change: 0 additions & 1 deletion aplcore/include/apl/animation/easinggrammar.h
Expand Up @@ -18,7 +18,6 @@

#include "apl/animation/coreeasing.h"
#include "apl/datagrammar/grammarpolyfill.h"
#include "apl/utils/log.h"
#include "apl/utils/stringfunctions.h"

namespace apl {
Expand Down
11 changes: 5 additions & 6 deletions aplcore/include/apl/apl.h
Expand Up @@ -24,14 +24,13 @@

#include "rapidjson/document.h"

#include "apl/apl_config.h"
#include "apl/buildTimeConstants.h"
#include "apl/common.h"

#include "apl/action/action.h"
#include "apl/audio/audioplayer.h"
#include "apl/audio/audioplayerfactory.h"
#include "apl/audio/speechmark.h"
#include "apl/buildTimeConstants.h"
#include "apl/component/component.h"
#include "apl/component/textmeasurement.h"
#include "apl/content/configurationchange.h"
Expand Down Expand Up @@ -69,6 +68,10 @@
#include "apl/primitives/styledtext.h"
#include "apl/primitives/transform2d.h"
#include "apl/scaling/metricstransform.h"
#include "apl/touch/pointerevent.h"
#include "apl/utils/localemethods.h"
#include "apl/utils/log.h"
#include "apl/utils/session.h"
#ifdef SCENEGRAPH
#include "apl/scenegraph/accessibility.h"
#include "apl/scenegraph/edittextconfig.h"
Expand All @@ -87,10 +90,6 @@
#include "apl/scenegraph/textmeasurement.h"
#include "apl/scenegraph/textproperties.h"
#endif // SCENEGRAPH
#include "apl/touch/pointerevent.h"
#include "apl/utils/localemethods.h"
#include "apl/utils/log.h"
#include "apl/utils/session.h"

#ifdef ALEXAEXTENSIONS
#include "apl/extension/extensionmediator.h"
Expand Down
4 changes: 3 additions & 1 deletion aplcore/include/apl/audio/audioplayer.h
Expand Up @@ -21,9 +21,11 @@
#include <vector>

#include "apl/common.h"

#include "apl/audio/audiostate.h"
#include "apl/audio/speechmark.h"
#include "apl/media/mediaplayer.h"
#include "apl/engine/event.h"
#include "apl/media/mediatrack.h"

namespace apl {

Expand Down
7 changes: 4 additions & 3 deletions aplcore/include/apl/command/corecommand.h
Expand Up @@ -17,12 +17,12 @@
#define _APL_COMMAND_CORE_COMMAND_H

#include "apl/command/command.h"
#include "apl/utils/bimap.h"
#include "apl/primitives/objectbag.h"
#include "apl/engine/context.h"
#include "apl/component/corecomponent.h"
#include "apl/engine/context.h"
#include "apl/engine/event.h"
#include "apl/engine/propdef.h"
#include "apl/primitives/objectbag.h"
#include "apl/utils/bimap.h"

namespace apl {

Expand Down Expand Up @@ -115,6 +115,7 @@ class CoreCommand : public Command {
std::string mTargetId;
rapidjson::Document mFrozenEventContext;
bool mFrozen = false;
bool mMissingTargetId = false;
};

} // namespace apl
Expand Down
17 changes: 10 additions & 7 deletions aplcore/include/apl/common.h
Expand Up @@ -20,6 +20,8 @@
#include <memory>
#include <set>

#include "apl/apl_config.h"

namespace apl {

/**
Expand Down Expand Up @@ -57,13 +59,14 @@ class CoreComponent;
class DataSource;
class DataSourceProvider;
class Easing;
class EventManager;
class ExtensionClient;
class ExtensionCommandDefinition;
class ExtensionComponent;
class ExtensionMediator;
class Graphic;
class GraphicContent;
class GraphicElement;
class Graphic;
class GraphicPattern;
class LiveArray;
class LiveMap;
Expand All @@ -84,26 +87,26 @@ class Timers;
class UIDObject;

using ActionPtr = std::shared_ptr<Action>;
using AudioPlayerPtr = std::shared_ptr<AudioPlayer>;
using AudioPlayerFactoryPtr = std::shared_ptr<AudioPlayerFactory>;
using AudioPlayerPtr = std::shared_ptr<AudioPlayer>;
using CommandPtr = std::shared_ptr<Command>;
using ConstCommandPtr = std::shared_ptr<const Command>;
using ComponentPtr = std::shared_ptr<Component>;
using ConstCommandPtr = std::shared_ptr<const Command>;
using ConstContextPtr = std::shared_ptr<const Context>;
using ContentPtr = std::shared_ptr<Content>;
using ContextPtr = std::shared_ptr<Context>;
using ConstContextPtr = std::shared_ptr<const Context>;
using CoreComponentPtr = std::shared_ptr<CoreComponent>;
using DataSourcePtr = std::shared_ptr<DataSource>;
using DataSourceProviderPtr = std::shared_ptr<DataSourceProvider>;
using DataSourcePtr = std::shared_ptr<DataSource>;
using EasingPtr = std::shared_ptr<Easing>;
using ExtensionClientPtr = std::shared_ptr<ExtensionClient>;
using ExtensionCommandDefinitionPtr = std::shared_ptr<ExtensionCommandDefinition>;
using ExtensionComponentPtr = std::shared_ptr<ExtensionComponent>;
using ExtensionMediatorPtr = std::shared_ptr<ExtensionMediator>;
using GraphicContentPtr = std::shared_ptr<GraphicContent>;
using GraphicElementPtr = std::shared_ptr<GraphicElement>;
using GraphicPtr = std::shared_ptr<Graphic>;
using GraphicPatternPtr = std::shared_ptr<GraphicPattern>;
using GraphicPtr = std::shared_ptr<Graphic>;
using LiveArrayPtr = std::shared_ptr<LiveArray>;
using LiveMapPtr = std::shared_ptr<LiveMap>;
using LiveObjectPtr = std::shared_ptr<LiveObject>;
Expand All @@ -122,8 +125,8 @@ using TextMeasurementPtr = std::shared_ptr<TextMeasurement>;
using TimersPtr = std::shared_ptr<Timers>;

// Convenience templates for creating sets of weak and strong pointers
template<class T> using WeakPtrSet = std::set<std::weak_ptr<T>, std::owner_less<std::weak_ptr<T>>>;
template<class T> using SharedPtrSet = std::set<std::shared_ptr<T>, std::owner_less<std::shared_ptr<T>>>;
template<class T> using WeakPtrSet = std::set<std::weak_ptr<T>, std::owner_less<std::weak_ptr<T>>>;

} // namespace apl

Expand Down
13 changes: 7 additions & 6 deletions aplcore/include/apl/component/component.h
Expand Up @@ -21,16 +21,17 @@
#include <set>

#include "apl/common.h"
#include "componentproperties.h"
#include "apl/utils/counter.h"

#include "apl/component/componentproperties.h"
#include "apl/engine/propertymap.h"
#include "apl/engine/state.h"
#include "apl/engine/uidobject.h"
#include "apl/primitives/rect.h"
#include "apl/engine/state.h"
#include "apl/utils/counter.h"
#include "apl/utils/deprecated.h"
#include "apl/utils/noncopyable.h"
#include "apl/utils/visitor.h"
#include "apl/utils/userdata.h"
#include "apl/utils/visitor.h"

namespace apl {

Expand Down Expand Up @@ -295,8 +296,8 @@ class Component : public UIDObject,
* @param error Error message used when the state is kResourceError
*/
virtual void updateResourceState(const ExtensionComponentResourceState& state,
int errorCode = 0,
const std::string& error = "");
int errorCode = 0,
const std::string& error = "");

/*
* @return The number of children displayed.
Expand Down
4 changes: 3 additions & 1 deletion aplcore/include/apl/component/componentpropdef.h
Expand Up @@ -16,9 +16,11 @@
#ifndef _APL_COMPONENT_PROP_DEF_H
#define _APL_COMPONENT_PROP_DEF_H

#include "component.h"
#include "apl/component/component.h"
#include "apl/engine/propdef.h"

#include <yoga/YGNode.h>

namespace apl {

using Trigger = void (*)(Component&);
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/component/containercomponent.h
Expand Up @@ -16,7 +16,7 @@
#ifndef _APL_CONTAINER_COMPONENT_H
#define _APL_CONTAINER_COMPONENT_H

#include "corecomponent.h"
#include "apl/component/corecomponent.h"

namespace apl {

Expand Down
20 changes: 11 additions & 9 deletions aplcore/include/apl/component/corecomponent.h
Expand Up @@ -18,22 +18,24 @@

#include <climits>
#include <stack>

#include <yoga/YGNode.h>

#include "apl/apl_config.h"
#ifdef SCENEGRAPH
#include "apl/scenegraph/common.h"
#endif // SCENEGRAPH

#include "apl/component/component.h"
#include "apl/component/textmeasurement.h"
#include "apl/engine/properties.h"
#include "apl/engine/context.h"
#include "apl/engine/properties.h"
#include "apl/engine/recalculatetarget.h"
#include "apl/focus/focusdirection.h"
#include "apl/primitives/keyboard.h"
#include "apl/primitives/size.h"
#include "apl/primitives/transform2d.h"

#ifdef SCENEGRAPH
#include "apl/scenegraph/common.h"
#endif // SCENEGRAPH

namespace apl {

class ComponentPropDef;
Expand Down Expand Up @@ -644,10 +646,10 @@ class CoreComponent : public Component,
bool isDisplayable() const;

/**
* Calculate real opacity of component.
* @param parentRealOpacity parent component real opacity.
* @return component cumulative opacity.
*/
* Calculate real opacity of component.
* @param parentRealOpacity parent component real opacity.
* @return component cumulative opacity.
*/
float calculateRealOpacity(float parentRealOpacity) const;

/**
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/component/edittextcomponent.h
Expand Up @@ -21,8 +21,8 @@
#include "apl/apl_config.h"
#include "apl/component/actionablecomponent.h"
#ifdef SCENEGRAPH
#include "apl/scenegraph/textproperties.h"
#include "apl/scenegraph/edittext.h"
#include "apl/scenegraph/textproperties.h"
#include "apl/utils/principal_ptr.h"
#endif // SCENEGRAPH

Expand Down

0 comments on commit 0442a24

Please sign in to comment.