Skip to content

Commit 82cce6f

Browse files
committed
APL-CORE: July 2021 Release of APL 1.7 compilant core engine (1.7.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
1 parent 54b75a8 commit 82cce6f

File tree

475 files changed

+28740
-11569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

475 files changed

+28740
-11569
lines changed

CHANGELOG.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## [1.7.0]
4+
5+
This release adds support for version 1.7 of the APL specification.
6+
7+
## Added
8+
9+
- Added new position sticky for children containers
10+
- Support specifying layout direction for components as well as the entire document
11+
- Support for document level language
12+
- Extended swipe away gesture to support forward and backward directions
13+
- Added support for \<span\> text markup
14+
- Added start*, end* and padding variants to override left* and right* variants depending on layoutDirection
15+
- Data-binding definitions now support Array and Maps
16+
- Alpha feature: Improved extension message builder API
17+
- Alpha feature: Extension client now supports modification of non-defined LiveMap members
18+
- Alpha feature: APL Audio Player Extension. The Audio Player Extension extends APL capabilities providing a custom audio player extension
19+
20+
## Changed
21+
22+
- Data grammar now translates to byte code
23+
- Performance improvements during the inflation process
24+
- Component properties shadowColor, shadowHorizonalOffset, shadowRadius and shadowVerticalOffset are now also styled and dynamic
25+
- Pager navigation and pageDirection properties are now also dynamic
26+
- Updated reported APL version to 1.7
27+
- Other bug fixes
28+
- Build improvements
29+
330
## [1.6.2]
431

532
### Changed
@@ -26,7 +53,7 @@ This release adds support for version 1.6 of the APL specification.
2653
- Reinflation support for viewport size and orientation changes
2754
- Add handlePageMove property to Pager to allow custom transitions
2855
- Add pageDirection to support vertical pagers
29-
- Added support for <nobr> text markup
56+
- Added support for \<nobr\> text markup
3057
- New Math functions: Math.int and Math.float
3158
- New API to expose visible children of a component
3259
- Support bound values in layouts

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License").
44
# You may not use this file except in compliance with the License.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License").
44
# You may not use this file except in compliance with the License.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ For more info on installing and configuring Docker, see:
228228
https://www.docker.com/get-started
229229

230230
# Global configuration
231-
## Telemetry
232-
In order to compile core telemetry support use TELEMETRY cmake parameter:
231+
## Tracing
232+
In order to compile core tracing support use TRACING cmake parameter:
233233
```
234-
$ cmake -DTELEMETRY=ON
234+
$ cmake -DTRACING=ON
235235
```
236236

237237
## Memory debugging

apl-dev-env.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License").
44
# You may not use this file except in compliance with the License.
@@ -244,10 +244,12 @@ function apl-config-android { # Run cmake for Android
244244
mkdir -p android-build
245245
cd android-build
246246
echo "Running $CMAKE"
247-
$CMAKE -DANDROID_ABI="x86" \
247+
$CMAKE -DCMAKE_BUILD_TYPE=Release \
248+
-DANDROID_ABI="armeabi-v7a" \
248249
-DANDROID_PLATFORM=android-24 \
249250
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE \
250-
-DAPL_JNI=ON ..
251+
-DAPL_JNI=ON \
252+
-DBUILD_TESTS=ON ..
251253
)
252254
}
253255

@@ -290,7 +292,7 @@ function apl-config-wasm { # Run cmake in the wasm build
290292
cd $APL_DIR
291293
mkdir -p wasm-build
292294
cd wasm-build
293-
emcmake cmake -DEMSCRIPTEN=ON -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DEMSCRIPTEN_SOURCEMAPS=ON -DBUILD_TESTS=OFF ..
295+
emcmake cmake -DEMSCRIPTEN=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_SOURCEMAPS=ON ..
294296
)
295297
}
296298

aplcore/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ add_subdirectory(src/extension)
7171
add_subdirectory(src/focus)
7272
add_subdirectory(src/graphic)
7373
add_subdirectory(src/livedata)
74+
add_subdirectory(src/media)
7475
add_subdirectory(src/primitives)
7576
add_subdirectory(src/scaling)
7677
add_subdirectory(src/time)

aplcore/include/apl/action/arrayaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/action/documentaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/action/extensioneventaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/action/openurlaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/action/scrolltoaction.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ScrollToAction : public AnimatedScrollAction {
4444
*/
4545
static std::shared_ptr<ScrollToAction> make(const TimersPtr& timers,
4646
const std::shared_ptr<CoreCommand>& command,
47-
const ComponentPtr& target = nullptr);
47+
const CoreComponentPtr& target = nullptr);
4848
/**
4949
* Called from SpeakItem during line highlight mode.
5050
* @param timers Timer reference.
@@ -56,7 +56,7 @@ class ScrollToAction : public AnimatedScrollAction {
5656
static std::shared_ptr<ScrollToAction> make(const TimersPtr& timers,
5757
const std::shared_ptr<CoreCommand>& command,
5858
const Rect& subBounds,
59-
const ComponentPtr& target = nullptr);
59+
const CoreComponentPtr& target = nullptr);
6060

6161

6262
/**
@@ -72,7 +72,7 @@ class ScrollToAction : public AnimatedScrollAction {
7272
const CommandScrollAlign& align,
7373
const Rect& subBounds,
7474
const ContextPtr& context,
75-
const ComponentPtr& target = nullptr);
75+
const CoreComponentPtr& target = nullptr);
7676

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

8888
ScrollToAction(const TimersPtr& timers,
8989
const CommandScrollAlign& align,
9090
const Rect& subBounds,
9191
const ContextPtr& context,
9292
bool scrollToSubBounds,
93-
const ComponentPtr& target,
93+
const CoreComponentPtr& target,
9494
const CoreComponentPtr& scrollableParent,
9595
apl_duration_t duration);
9696

@@ -100,7 +100,7 @@ class ScrollToAction : public AnimatedScrollAction {
100100
const Rect& subBounds,
101101
const ContextPtr& context,
102102
bool scrollToSubBounds,
103-
const ComponentPtr& target = nullptr,
103+
const CoreComponentPtr& target = nullptr,
104104
apl_duration_t duration = 0,
105105
bool useSnap = false);
106106

@@ -112,7 +112,7 @@ class ScrollToAction : public AnimatedScrollAction {
112112
CommandScrollAlign mAlign;
113113
Rect mSubBounds;
114114
bool mScrollToSubBounds;
115-
ComponentPtr mTarget;
115+
CoreComponentPtr mTarget;
116116
};
117117

118118

aplcore/include/apl/action/sequentialaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/action/setpageaction.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class SetPageAction : public ResourceHoldingAction {
3737

3838
SetPageAction(const TimersPtr& timers,
3939
const std::shared_ptr<CoreCommand>& command,
40-
const ComponentPtr& target);
40+
const CoreComponentPtr& target);
4141

4242
private:
4343
void start();
4444

4545
private:
4646
std::shared_ptr<CoreCommand> mCommand;
47-
ComponentPtr mTarget;
47+
CoreComponentPtr mTarget;
4848
};
4949

5050
} // namespace apl

aplcore/include/apl/action/speaklistaction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/apl.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -49,6 +49,8 @@
4949
#include "apl/graphic/graphicpattern.h"
5050
#include "apl/livedata/livearray.h"
5151
#include "apl/livedata/livemap.h"
52+
#include "apl/media/mediamanager.h"
53+
#include "apl/media/mediaobject.h"
5254
#include "apl/primitives/accessibilityaction.h"
5355
#include "apl/primitives/dimension.h"
5456
#include "apl/primitives/filter.h"
@@ -62,7 +64,6 @@
6264
#include "apl/utils/localemethods.h"
6365
#include "apl/utils/log.h"
6466
#include "apl/utils/session.h"
65-
#include "apl/utils/telemetry.h"
6667

6768
#ifdef ALEXAEXTENSIONS
6869
#include "apl/extension/extensionmediator.h"

aplcore/include/apl/colorgrammar/colorfunctions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/colorgrammar/colorgrammar.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

aplcore/include/apl/common.h

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class GraphicPattern;
6565
class LiveArray;
6666
class LiveMap;
6767
class LiveObject;
68+
class MediaManager;
69+
class MediaObject;
6870
class Package;
6971
class RootConfig;
7072
class RootContext;
@@ -93,6 +95,8 @@ using GraphicPatternPtr = std::shared_ptr<GraphicPattern>;
9395
using LiveArrayPtr = std::shared_ptr<LiveArray>;
9496
using LiveMapPtr = std::shared_ptr<LiveMap>;
9597
using LiveObjectPtr = std::shared_ptr<LiveObject>;
98+
using MediaManagerPtr = std::shared_ptr<MediaManager>;
99+
using MediaObjectPtr = std::shared_ptr<MediaObject>;
96100
using PackagePtr = std::shared_ptr<Package>;
97101
using RootConfigPtr = std::shared_ptr<RootConfig>;
98102
using RootContextPtr = std::shared_ptr<RootContext>;

aplcore/include/apl/component/actionablecomponent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ActionableComponent : public CoreComponent {
7171
const ComponentPropDefSet& propDefSet() const override;
7272
void release() override;
7373

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

7777
bool processGestures(const PointerEvent& event, apl_time_t timestamp) override;

aplcore/include/apl/component/component.h

+23-3
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ class Component : public Counter<Component>,
338338
/**
339339
* Call this to ensure that the component has a layout. This method must be used by
340340
* children of a sequence to before retrieving the layout bounds.
341-
* @deprecated This method still works but not required to be used.
341+
* @deprecated Should not be used. No-op.
342342
*/
343-
virtual void ensureLayout(bool useDirtyFlag = false) = 0;
343+
virtual void ensureLayout(bool useDirtyFlag = false) {}
344344

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

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

385+
/**
386+
* @return true if component like Pager or Scrollable can move forward.
387+
*/
388+
virtual bool allowForward() const { return false; }
389+
390+
/**
391+
* @return true if component like Pager or Scrollable can move backwards.
392+
*/
393+
virtual bool allowBackwards() const { return false; }
394+
385395
/**
386396
* The component hierarchy signature is a unique text string that represents the type
387397
* of this component and all of the components below it in the hierarchy. This signature
@@ -471,6 +481,16 @@ class Component : public Counter<Component>,
471481
*/
472482
ComponentPtr inflateChildAt(const rapidjson::Value& component, size_t index);
473483

484+
/**
485+
* @return true if component could be focused with input focus.
486+
*/
487+
virtual bool isFocusable() const { return false; }
488+
489+
/**
490+
* @return true if component should participate be reported to the accessibility system.
491+
*/
492+
virtual bool isAccessible() const { return false; }
493+
474494
protected:
475495
Component(const ContextPtr& context, const std::string& id);
476496

aplcore/include/apl/component/componentpropdef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)