Skip to content

Commit 959e118

Browse files
committed
APL-CORE: July 2020 Release of APL 1.4 compliant core engine (1.4.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 ad533cc commit 959e118

File tree

415 files changed

+35530
-9687
lines changed

Some content is hidden

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

415 files changed

+35530
-9687
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## [1.4.0]
4+
5+
This release adds support for version 1.4 of the APL specification.
6+
7+
### Added
8+
9+
- New components: EditText and GridSequence
10+
- New AVG features (e.g. text support) and improvements
11+
- Tick handlers
12+
- onDown, onMove, and onUp event handlers to touchable components (e.g VectorGraphic and TouchWrapper)
13+
- Gesture support
14+
- Named sequencers for commands in order to control which commands can execute in parallel
15+
- Transcendental math functions
16+
- Misc updates to component properties
17+
18+
### Changed
19+
20+
- Updated reported APL version to 1.4
21+
- Bug fixes
22+
- Build improvements
23+
324
## [1.3.3]
425

526
This release is a bug fix release of apl-core-library

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
# permissions and limitations under the License.
1313

1414
cmake_minimum_required(VERSION 3.5)
15-
project(APLCoreEngine)
15+
16+
project(APLCoreEngine
17+
VERSION 1.0.0
18+
LANGUAGES CXX)
19+
1620
set(CMAKE_CXX_STANDARD 11)
1721
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1822

NOTICE.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APL Core Library
2-
Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33

44
The APL Core Library is licensed under the Apache
55
License, Version 2.0 (the "License").
@@ -29,8 +29,6 @@ Copyright (c) 2007-2019 Dr. Colin Hirsch and Daniel Frey.
2929

3030
- Yoga - Copyright (c) Facebook, Inc. and its affiliates.
3131

32-
- Templatized C++ Command Line Parser Library - Copyright (c), Michael E. Smoot.
33-
3432
- C++ test framework from Google Test - Copyright 2008, Google Inc.
3533

3634
- Extension for writing and using C++ mock classes from Google Mock -

apl-dev-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function apl-check-core { # Run make for the core build with -Werror
120120
function apl-test-core { # Run unit tests in the core build
121121
(
122122
apl-switch-to-build-directory build $@ && \
123-
$CMAKE -DBUILD_TESTS=ON -DCOVERAGE=OFF .. && \
123+
$CMAKE -DBUILD_TESTS=ON -DCOVERAGE=OFF .. && \
124124
make -j$APL_BUILD_PROCS && \
125125
unit/unittest
126126
)

apl-viewhost-code-check.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Find the use of properties that have "kPropIn" set but are being
4+
# used in a view host. Properties marked as kPropIn are provided by,
5+
# and set by the document. kPropIn properties are intended for
6+
# APLCoreEngine use only. These properties are used to derive kPropOut
7+
# properties which can be safely consumed by the view host.
8+
#
9+
# This scripts expects that you start in a view host git repository
10+
# and the APLCoreEngine repository is next to it.
11+
12+
INPUT_ONLY_PROPS=$(cd ../APLCoreEngine && \
13+
git grep -E '\{.*kPropIn[^O]' | \
14+
cut -d ',' -f 1 | \
15+
grep -o -E '(k\w+)' | \
16+
sort | \
17+
uniq | \
18+
paste -d '|' -s - -)
19+
20+
git grep -E "${INPUT_ONLY_PROPS}"
21+

aplcore/CMakeLists.txt

+61-115
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,74 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License").
4+
# You may not use this file except in compliance with the License.
5+
# A copy of the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is distributed
10+
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11+
# express or implied. See the License for the specific language governing
12+
# permissions and limitations under the License.
13+
114
set(CMAKE_CXX_STANDARD 11)
215

316
# Set template depth to support pegtl on older versions of clang.
417
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
518
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
619
endif()
720

8-
add_library(apl STATIC
9-
src/action/action.cpp
10-
src/action/animateitemaction.cpp
11-
src/action/autopageaction.cpp
12-
src/action/arrayaction.cpp
13-
src/action/extensioneventaction.cpp
14-
src/action/documentaction.cpp
15-
src/action/openurlaction.cpp
16-
src/action/scrolltoaction.cpp
17-
src/action/sequentialaction.cpp
18-
src/action/setpageaction.cpp
19-
src/action/speakitemaction.cpp
20-
src/action/speaklistaction.cpp
21-
src/animation/animatedproperty.cpp
22-
src/animation/easing.cpp
23-
src/command/arraycommand.cpp
24-
src/command/commandfactory.cpp
25-
src/command/commandproperties.cpp
26-
src/command/corecommand.cpp
27-
src/command/extensioneventcommand.cpp
28-
src/command/documentcommand.cpp
29-
src/component/actionablecomponent.cpp
30-
src/component/component.cpp
31-
src/component/componentproperties.cpp
32-
src/component/containercomponent.cpp
33-
src/component/corecomponent.cpp
34-
src/component/framecomponent.cpp
35-
src/component/imagecomponent.cpp
36-
src/component/pagercomponent.cpp
37-
src/component/scrollablecomponent.cpp
38-
src/component/scrollviewcomponent.cpp
39-
src/component/sequencecomponent.cpp
40-
src/component/textcomponent.cpp
41-
src/component/textmeasurement.cpp
42-
src/component/touchwrappercomponent.cpp
43-
src/component/vectorgraphiccomponent.cpp
44-
src/component/videocomponent.cpp
45-
src/component/yogaproperties.cpp
46-
src/content/aplversion.cpp
47-
src/content/content.cpp
48-
src/content/directive.cpp
49-
src/content/importrequest.cpp
50-
src/content/jsondata.cpp
51-
src/content/metrics.cpp
52-
src/content/package.cpp
53-
src/content/rootconfig.cpp
54-
src/content/viewport.cpp
55-
src/datagrammar/boundsymbol.cpp
56-
src/datagrammar/functions.cpp
57-
src/datagrammar/node.cpp
58-
src/datasource/datasource.cpp
59-
src/datasource/dynamicindexlistdatasourceprovider.cpp
60-
src/datasource/offsetindexdatasourceconnection.cpp
61-
src/engine/arrayify.cpp
62-
src/engine/binding.cpp
63-
src/engine/builder.cpp
64-
src/engine/context.cpp
65-
src/engine/componentdependant.cpp
66-
src/engine/contextdependant.cpp
67-
src/engine/contextobject.cpp
68-
src/engine/dependant.cpp
69-
src/engine/evaluate.cpp
70-
src/engine/event.cpp
71-
src/engine/extensionmanager.cpp
72-
src/engine/focusmanager.cpp
73-
src/engine/hovermanager.cpp
74-
src/engine/info.cpp
75-
src/engine/keyboardmanager.cpp
76-
src/engine/parameterarray.cpp
77-
src/engine/propdef.cpp
78-
src/engine/properties.cpp
79-
src/engine/resources.cpp
80-
src/engine/rootcontext.cpp
81-
src/engine/rootcontextdata.cpp
82-
src/engine/state.cpp
83-
src/engine/styleinstance.cpp
84-
src/engine/styledefinition.cpp
85-
src/engine/styles.cpp
86-
src/livedata/livearrayobject.cpp
87-
src/livedata/livedataobject.cpp
88-
src/livedata/livedatamanager.cpp
89-
src/livedata/layoutrebuilder.cpp
90-
src/livedata/livearray.cpp
91-
src/livedata/livemap.cpp
92-
src/livedata/livemapobject.cpp
93-
src/graphic/graphic.cpp
94-
src/graphic/graphiccontent.cpp
95-
src/graphic/graphicdependant.cpp
96-
src/graphic/graphicelement.cpp
97-
src/graphic/graphicproperties.cpp
98-
src/primitives/color.cpp
99-
src/primitives/dimension.cpp
100-
src/primitives/filter.cpp
101-
src/primitives/functions.cpp
102-
src/primitives/gradient.cpp
103-
src/primitives/keyboard.cpp
104-
src/primitives/mediasource.cpp
105-
src/primitives/radii.cpp
106-
src/primitives/rect.cpp
107-
src/primitives/symbolreferencemap.cpp
108-
src/primitives/styledtext.cpp
109-
src/primitives/timefunctions.cpp
110-
src/primitives/timegrammar.cpp
111-
src/primitives/transform.cpp
112-
src/primitives/transform2d.cpp
113-
src/primitives/object.cpp
114-
src/scaling/metricstransform.cpp
115-
src/scaling/scalingcalculator.cpp
116-
src/time/sequencer.cpp
117-
src/utils/log.cpp
118-
src/utils/path.cpp
119-
src/utils/session.cpp
120-
src/utils/telemetry.cpp)
21+
include(target_sources_local.cmake)
22+
23+
# Check for the presence of GIT
24+
# Code from: https://gist.github.com/rkitover
25+
find_package(Git)
26+
if (GIT_FOUND)
27+
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --dirty
28+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
29+
RESULT_VARIABLE res
30+
OUTPUT_VARIABLE CORE_REPOSITORY_VERSION
31+
OUTPUT_STRIP_TRAILING_WHITESPACE
32+
ERROR_QUIET)
33+
if (res)
34+
message(VERBOSE "Git repository not found in directory ${CMAKE_CURRENT_SOURCE_DIR}, not setting version info")
35+
set(CORE_REPOSITORY_VERSION "unknown")
36+
endif()
37+
else()
38+
message(VERBOSE "Git program not found (${GIT_FOUND}), not setting version info")
39+
SET(CORE_REPOSITORY_VERSION "unknown")
40+
endif()
41+
42+
message(STATUS "Core Repository Version ${CORE_REPOSITORY_VERSION}")
43+
configure_file(buildTimeConstants.cpp.in buildTimeConstants.cpp @ONLY)
44+
45+
add_library(apl STATIC ${CMAKE_CURRENT_BINARY_DIR}/buildTimeConstants.cpp)
46+
47+
add_subdirectory(src/action)
48+
add_subdirectory(src/animation)
49+
add_subdirectory(src/command)
50+
add_subdirectory(src/component)
51+
add_subdirectory(src/content)
52+
add_subdirectory(src/datagrammar)
53+
add_subdirectory(src/datasource)
54+
add_subdirectory(src/engine)
55+
add_subdirectory(src/extension)
56+
add_subdirectory(src/graphic)
57+
add_subdirectory(src/livedata)
58+
add_subdirectory(src/primitives)
59+
add_subdirectory(src/scaling)
60+
add_subdirectory(src/time)
61+
add_subdirectory(src/touch)
62+
add_subdirectory(src/utils)
63+
64+
set(PUBLIC_HEADER_LIST
65+
include/apl/apl.h
66+
include/apl/dynamicdata.h)
12167

12268
set_target_properties(apl PROPERTIES
12369
VERSION "${PROJECT_VERSION}"
12470
SOVERSION 1
125-
PUBLIC_HEADER include/apl/apl.h)
71+
PUBLIC_HEADER "${PUBLIC_HEADER_LIST}")
12672

12773
configure_file(apl.pc.in apl.pc @ONLY)
12874
target_include_directories(apl PRIVATE include)
@@ -167,4 +113,4 @@ target_link_libraries(
167113
# Links the target library to the log library included in the NDK.
168114
${log-lib})
169115

170-
endif(ANDROID)
116+
endif(ANDROID)

aplcore/buildTimeConstants.cpp.in

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0/
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
namespace apl {
17+
18+
const char *sCoreRepositoryVersion = "@CORE_REPOSITORY_VERSION@";
19+
20+
} // namespace apl

aplcore/include/apl/action/action.h

+7-6
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.
@@ -47,7 +47,7 @@ union ActionResolveArg {
4747
/**
4848
* Common base class of action contracts.
4949
*/
50-
class Action : public std::enable_shared_from_this<Action>, private Counter<Action>, public UserData {
50+
class Action : public std::enable_shared_from_this<Action>, private Counter<Action>, public UserData<Action> {
5151

5252
public:
5353
/**
@@ -100,7 +100,7 @@ class Action : public std::enable_shared_from_this<Action>, private Counter<Acti
100100

101101
public:
102102
Action(const TimersPtr& timers, TerminateFunc terminate = nullptr);
103-
~Action();
103+
virtual ~Action();
104104

105105
Action& operator=(const Action&) = delete;
106106
Action(const Action&) = delete;
@@ -145,9 +145,7 @@ class Action : public std::enable_shared_from_this<Action>, private Counter<Acti
145145
*/
146146
void addTerminateCallback(TerminateFunc terminateFunc);
147147

148-
/*
149-
* Convenience methods to introspect current state
150-
*/
148+
// Convenience methods to introspect current state
151149

152150
/**
153151
* @return True if this action is still pending and has not resolved or terminated.
@@ -177,6 +175,9 @@ class Action : public std::enable_shared_from_this<Action>, private Counter<Acti
177175

178176
friend streamer& operator<<(streamer&, Action&);
179177

178+
protected:
179+
virtual void onFinish() {}
180+
180181
private:
181182
void doResolve();
182183

aplcore/include/apl/action/animateitemaction.h

+7-11
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.
@@ -16,26 +16,22 @@
1616
#ifndef _APL_ANIMATE_ITEM_ACTION_H
1717
#define _APL_ANIMATE_ITEM_ACTION_H
1818

19-
#include "apl/action/action.h"
20-
#include "apl/animation/animatedproperty.h"
19+
#include "apl/action/resourceholdingaction.h"
20+
#include "apl/animation/easing.h"
2121

2222
namespace apl {
2323

24+
class AnimatedProperty;
2425
class CoreCommand;
2526

2627
/**
2728
* Handle running an AnimateItem command
2829
*/
29-
class AnimateItemAction : public Action {
30+
class AnimateItemAction : public ResourceHoldingAction {
3031
public:
3132
static std::shared_ptr<AnimateItemAction> make(const TimersPtr& timers,
3233
const std::shared_ptr<CoreCommand>& command,
33-
bool fastMode)
34-
{
35-
auto ptr = std::make_shared<AnimateItemAction>(timers, command, fastMode);
36-
ptr->start();
37-
return ptr;
38-
}
34+
bool fastMode);
3935

4036
AnimateItemAction(const TimersPtr& timers,
4137
const std::shared_ptr<CoreCommand>& command,
@@ -56,7 +52,7 @@ class AnimateItemAction : public Action {
5652
const int mRepeatCount;
5753
const int mRepeatMode;
5854
const bool mFastMode;
59-
Easing mEasing;
55+
std::shared_ptr<Easing> mEasing;
6056
};
6157

6258

0 commit comments

Comments
 (0)