Skip to content

Commit

Permalink
APL-CORE: July 2021 Release of APL 1.7 compilant core engine (1.7.0)
Browse files Browse the repository at this point in the history
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
durjo-amz committed Jul 21, 2021
1 parent 54b75a8 commit 82cce6f
Show file tree
Hide file tree
Showing 475 changed files with 28,740 additions and 11,569 deletions.
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## [1.7.0]

This release adds support for version 1.7 of the APL specification.

## Added

- Added new position sticky for children containers
- Support specifying layout direction for components as well as the entire document
- Support for document level language
- Extended swipe away gesture to support forward and backward directions
- Added support for \<span\> text markup
- Added start*, end* and padding variants to override left* and right* variants depending on layoutDirection
- Data-binding definitions now support Array and Maps
- Alpha feature: Improved extension message builder API
- Alpha feature: Extension client now supports modification of non-defined LiveMap members
- Alpha feature: APL Audio Player Extension. The Audio Player Extension extends APL capabilities providing a custom audio player extension

## Changed

- Data grammar now translates to byte code
- Performance improvements during the inflation process
- Component properties shadowColor, shadowHorizonalOffset, shadowRadius and shadowVerticalOffset are now also styled and dynamic
- Pager navigation and pageDirection properties are now also dynamic
- Updated reported APL version to 1.7
- Other bug fixes
- Build improvements

## [1.6.2]

### Changed
Expand All @@ -26,7 +53,7 @@ This release adds support for version 1.6 of the APL specification.
- Reinflation support for viewport size and orientation changes
- Add handlePageMove property to Pager to allow custom transitions
- Add pageDirection to support vertical pagers
- Added support for <nobr> text markup
- Added support for \<nobr\> text markup
- New Math functions: Math.int and Math.float
- New API to expose visible children of a component
- Support bound values in layouts
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ For more info on installing and configuring Docker, see:
https://www.docker.com/get-started

# Global configuration
## Telemetry
In order to compile core telemetry support use TELEMETRY cmake parameter:
## Tracing
In order to compile core tracing support use TRACING cmake parameter:
```
$ cmake -DTELEMETRY=ON
$ cmake -DTRACING=ON
```

## Memory debugging
Expand Down
10 changes: 6 additions & 4 deletions apl-dev-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -244,10 +244,12 @@ function apl-config-android { # Run cmake for Android
mkdir -p android-build
cd android-build
echo "Running $CMAKE"
$CMAKE -DANDROID_ABI="x86" \
$CMAKE -DCMAKE_BUILD_TYPE=Release \
-DANDROID_ABI="armeabi-v7a" \
-DANDROID_PLATFORM=android-24 \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE \
-DAPL_JNI=ON ..
-DAPL_JNI=ON \
-DBUILD_TESTS=ON ..
)
}

Expand Down Expand Up @@ -290,7 +292,7 @@ function apl-config-wasm { # Run cmake in the wasm build
cd $APL_DIR
mkdir -p wasm-build
cd wasm-build
emcmake cmake -DEMSCRIPTEN=ON -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DEMSCRIPTEN_SOURCEMAPS=ON -DBUILD_TESTS=OFF ..
emcmake cmake -DEMSCRIPTEN=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_SOURCEMAPS=ON ..
)
}

Expand Down
1 change: 1 addition & 0 deletions aplcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ add_subdirectory(src/extension)
add_subdirectory(src/focus)
add_subdirectory(src/graphic)
add_subdirectory(src/livedata)
add_subdirectory(src/media)
add_subdirectory(src/primitives)
add_subdirectory(src/scaling)
add_subdirectory(src/time)
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/arrayaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/documentaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/extensioneventaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/openurlaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
14 changes: 7 additions & 7 deletions aplcore/include/apl/action/scrolltoaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ScrollToAction : public AnimatedScrollAction {
*/
static std::shared_ptr<ScrollToAction> make(const TimersPtr& timers,
const std::shared_ptr<CoreCommand>& command,
const ComponentPtr& target = nullptr);
const CoreComponentPtr& target = nullptr);
/**
* Called from SpeakItem during line highlight mode.
* @param timers Timer reference.
Expand All @@ -56,7 +56,7 @@ class ScrollToAction : public AnimatedScrollAction {
static std::shared_ptr<ScrollToAction> make(const TimersPtr& timers,
const std::shared_ptr<CoreCommand>& command,
const Rect& subBounds,
const ComponentPtr& target = nullptr);
const CoreComponentPtr& target = nullptr);


/**
Expand All @@ -72,7 +72,7 @@ class ScrollToAction : public AnimatedScrollAction {
const CommandScrollAlign& align,
const Rect& subBounds,
const ContextPtr& context,
const ComponentPtr& target = nullptr);
const CoreComponentPtr& target = nullptr);

/**
* Called in order to bring child into view, utilizing snap setting if exists.
Expand All @@ -82,15 +82,15 @@ class ScrollToAction : public AnimatedScrollAction {
* @return
*/
static std::shared_ptr<ScrollToAction> makeUsingSnap(const TimersPtr& timers,
const ComponentPtr& target,
const CoreComponentPtr& target,
apl_duration_t duration);

ScrollToAction(const TimersPtr& timers,
const CommandScrollAlign& align,
const Rect& subBounds,
const ContextPtr& context,
bool scrollToSubBounds,
const ComponentPtr& target,
const CoreComponentPtr& target,
const CoreComponentPtr& scrollableParent,
apl_duration_t duration);

Expand All @@ -100,7 +100,7 @@ class ScrollToAction : public AnimatedScrollAction {
const Rect& subBounds,
const ContextPtr& context,
bool scrollToSubBounds,
const ComponentPtr& target = nullptr,
const CoreComponentPtr& target = nullptr,
apl_duration_t duration = 0,
bool useSnap = false);

Expand All @@ -112,7 +112,7 @@ class ScrollToAction : public AnimatedScrollAction {
CommandScrollAlign mAlign;
Rect mSubBounds;
bool mScrollToSubBounds;
ComponentPtr mTarget;
CoreComponentPtr mTarget;
};


Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/sequentialaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions aplcore/include/apl/action/setpageaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class SetPageAction : public ResourceHoldingAction {

SetPageAction(const TimersPtr& timers,
const std::shared_ptr<CoreCommand>& command,
const ComponentPtr& target);
const CoreComponentPtr& target);

private:
void start();

private:
std::shared_ptr<CoreCommand> mCommand;
ComponentPtr mTarget;
CoreComponentPtr mTarget;
};

} // namespace apl
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/action/speaklistaction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions aplcore/include/apl/apl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,6 +49,8 @@
#include "apl/graphic/graphicpattern.h"
#include "apl/livedata/livearray.h"
#include "apl/livedata/livemap.h"
#include "apl/media/mediamanager.h"
#include "apl/media/mediaobject.h"
#include "apl/primitives/accessibilityaction.h"
#include "apl/primitives/dimension.h"
#include "apl/primitives/filter.h"
Expand All @@ -62,7 +64,6 @@
#include "apl/utils/localemethods.h"
#include "apl/utils/log.h"
#include "apl/utils/session.h"
#include "apl/utils/telemetry.h"

#ifdef ALEXAEXTENSIONS
#include "apl/extension/extensionmediator.h"
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/colorgrammar/colorfunctions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/colorgrammar/colorgrammar.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
4 changes: 4 additions & 0 deletions aplcore/include/apl/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class GraphicPattern;
class LiveArray;
class LiveMap;
class LiveObject;
class MediaManager;
class MediaObject;
class Package;
class RootConfig;
class RootContext;
Expand Down Expand Up @@ -93,6 +95,8 @@ using GraphicPatternPtr = std::shared_ptr<GraphicPattern>;
using LiveArrayPtr = std::shared_ptr<LiveArray>;
using LiveMapPtr = std::shared_ptr<LiveMap>;
using LiveObjectPtr = std::shared_ptr<LiveObject>;
using MediaManagerPtr = std::shared_ptr<MediaManager>;
using MediaObjectPtr = std::shared_ptr<MediaObject>;
using PackagePtr = std::shared_ptr<Package>;
using RootConfigPtr = std::shared_ptr<RootConfig>;
using RootContextPtr = std::shared_ptr<RootContext>;
Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/component/actionablecomponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ActionableComponent : public CoreComponent {
const ComponentPropDefSet& propDefSet() const override;
void release() override;

ActionableComponent(const ContextPtr& context, Properties&& properties, const std::string& path) :
ActionableComponent(const ContextPtr& context, Properties&& properties, const Path& path) :
CoreComponent(context, std::move(properties), path), mGesturesDisabled(false) {}

bool processGestures(const PointerEvent& event, apl_time_t timestamp) override;
Expand Down
26 changes: 23 additions & 3 deletions aplcore/include/apl/component/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ class Component : public Counter<Component>,
/**
* Call this to ensure that the component has a layout. This method must be used by
* children of a sequence to before retrieving the layout bounds.
* @deprecated This method still works but not required to be used.
* @deprecated Should not be used. No-op.
*/
virtual void ensureLayout(bool useDirtyFlag = false) = 0;
virtual void ensureLayout(bool useDirtyFlag = false) {}

/**
* The bounds of this component within an ancestor.
Expand Down Expand Up @@ -370,7 +370,7 @@ class Component : public Counter<Component>,
* @param point The requested point.
* @return A valid point to scroll to.
*/
virtual Point trimScroll(const Point& point) const { return Point(); }
virtual Point trimScroll(const Point& point) { return Point(); }

/**
* @return The valid directions that can be paged from the current page. This depends on the navigation setting.
Expand All @@ -382,6 +382,16 @@ class Component : public Counter<Component>,
*/
virtual int pagePosition() const { return 0; }

/**
* @return true if component like Pager or Scrollable can move forward.
*/
virtual bool allowForward() const { return false; }

/**
* @return true if component like Pager or Scrollable can move backwards.
*/
virtual bool allowBackwards() const { return false; }

/**
* The component hierarchy signature is a unique text string that represents the type
* of this component and all of the components below it in the hierarchy. This signature
Expand Down Expand Up @@ -471,6 +481,16 @@ class Component : public Counter<Component>,
*/
ComponentPtr inflateChildAt(const rapidjson::Value& component, size_t index);

/**
* @return true if component could be focused with input focus.
*/
virtual bool isFocusable() const { return false; }

/**
* @return true if component should participate be reported to the accessibility system.
*/
virtual bool isAccessible() const { return false; }

protected:
Component(const ContextPtr& context, const std::string& id);

Expand Down
2 changes: 1 addition & 1 deletion aplcore/include/apl/component/componentpropdef.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 82cce6f

Please sign in to comment.