Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy/JsonGenerator warning fixes #319

Merged
merged 6 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions definitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ find_package(${NAMESPACE}PrivilegedRequest QUIET)
set(Target ${NAMESPACE}${PROJECT_NAME})

separate_arguments(JSONRPC_PATTERNS)
list(TRANSFORM JSONRPC_PATTERNS PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/../jsonrpc/")
list(TRANSFORM JSONRPC_PATTERNS PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/")
file(GLOB JSON_FILE ${JSONRPC_PATTERNS})

separate_arguments(INTERFACES_PATTERNS)
list(TRANSFORM INTERFACES_PATTERNS PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/")
list(TRANSFORM INTERFACES_PATTERNS PREPEND "${CMAKE_SOURCE_DIR}/interfaces/")
file(GLOB INTERFACE_FILE ${INTERFACES_PATTERNS})

set(PUBLIC_HEADERS "definitions.h" "ValuePoint.h")
Expand Down
1 change: 0 additions & 1 deletion interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ endif()

separate_arguments(INTERFACES_PATTERNS)
file(GLOB INTERFACES_HEADERS ${INTERFACES_PATTERNS})

ProxyStubGenerator(INPUT "${INTERFACES_HEADERS}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})

file(GLOB JSON_HEADERS json/*.h)
Expand Down
10 changes: 5 additions & 5 deletions interfaces/IAVSClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace WPEFramework {
namespace Exchange {

// @json @uncompliant:collapsed
// @json 1.0.0 @uncompliant:collapsed
struct EXTERNAL IAVSController : virtual public Core::IUnknown {
enum { ID = ID_AVSCONTROLLER };

Expand All @@ -39,21 +39,21 @@ namespace Exchange {
SPEAKING
};

/// @brief notifies about dialogue state changes
/// @param state The new state (e.g. SPEAKING)
/// @brief Notifies about dialogue state changes
/// @param state: The new state (e.g. SPEAKING)
virtual void DialogueStateChange(const dialoguestate state) = 0;
};

virtual void Register(INotification* sink) = 0;
virtual void Unregister(const INotification* sink) = 0;

/// @brief Mutes the audio output of AVS
/// @param mute Mute or umute (e.g. true)
/// @param mute: Mute or umute (e.g. true)
/// @retval ERROR_GENERAL when there is a fatal error or authorisation is not possible
virtual uint32_t Mute(const bool muted) = 0;

/// @brief Starts or stops the voice recording, skipping keyword detection
/// @param start Start or stop voice recording (e.g. true)
/// @param start: Start or stop voice recording (e.g. true)
/// @retval ERROR_GENERAL when there is a fatal error or authorisation is not possible
virtual uint32_t Record(const bool started) = 0;
};
Expand Down
6 changes: 3 additions & 3 deletions interfaces/IAmazonPrime.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace WPEFramework {
namespace Exchange {

// @json @uncompliant:collapsed
// @json 1.0.0 @uncompliant:collapsed
struct EXTERNAL IAmazonPrime : virtual public Core::IUnknown {

enum { ID = ID_AMAZONPRIME };
Expand All @@ -33,15 +33,15 @@ namespace Exchange {
enum { ID = ID_AMAZONPRIME_NOTIFICATION };

// @brief Receive a message from the generic message bus
// @param messsage the message that was received.
// @param messsage: The message that was received.
virtual void Receive(const string& message) = 0;
};

virtual void Register(IAmazonPrime::INotification* ignition) = 0;
virtual void Unregister(IAmazonPrime::INotification* ignition) = 0;

// @brief Send a message over the message bus to ignition
// @param messsage the message to send according the amazon spec found
// @param messsage: The message to send according the amazon spec found
// in the parter portal.
virtual uint32_t Send(const string& message) = 0;
};
Expand Down
12 changes: 6 additions & 6 deletions interfaces/IApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace WPEFramework {
namespace Exchange {

// @json @uncompliant:collapsed
// @json 1.0.0 @uncompliant:collapsed
struct EXTERNAL IApplication : virtual public Core::IUnknown {

enum { ID = ID_APPLICATION };
Expand All @@ -37,7 +37,7 @@ namespace Exchange {
~INotification() override = default;

/* @brief Application visibility changes */
/* @param hidden Denotes if application is currently hidden */
/* @param hidden: Denotes if application is currently hidden */
virtual void VisibilityChange(const bool hidden) = 0;
};

Expand Down Expand Up @@ -82,17 +82,17 @@ namespace Exchange {
virtual void Unregister(INotification* sink) = 0;

// @brief Resets application data
// @param type Type of reset to perform
// @param type: Type of reset to perform
virtual uint32_t Reset(const resettype type) = 0;

// @property
// @brief Application-specific identification string
// @param id Identifier string
// @param id: Identifier string
virtual uint32_t Identifier(string& id /* @out */) const = 0;

// @property
// @brief URI of the associated application-specific content
// @param link Content URI (e.g. https://youtube.com)
// @param link: Content URI (e.g. https://youtube.com)
virtual uint32_t ContentLink(const string& link) = 0;

// @property
Expand All @@ -107,7 +107,7 @@ namespace Exchange {

// @property
// @brief Current application user interface language
// @param language Language string as per RFC5646 (e.g. en)
// @param language: Language string as per RFC5646 (e.g. en)
virtual uint32_t Language(string& language /* @out */) const = 0;
virtual uint32_t Language(const string&) = 0;
};
Expand Down
26 changes: 14 additions & 12 deletions interfaces/IBluetoothAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ namespace Exchange {
};

struct CodecProperties {
audiocodec Codec /* @brief Audio codec used */ ;
string /* @opaque */ Settings /* @brief Codec-specific audio quality preset, compression profile, etc */ ;
audiocodec Codec /* @brief Audio codec used */;
string /* @opaque */ Settings /* @brief Codec-specific audio quality preset, compression profile, etc */;
};

struct DRMProperties {
drmscheme DRM /* @brief Content protection scheme used */ ;
string /* @opaque */ Settings /* @brief DRM-specific content protection level, encoding rules, etc */ ;
drmscheme DRM /* @brief Content protection scheme used */;
string /* @opaque */ Settings /* @brief DRM-specific content protection level, encoding rules, etc */;
};

struct StreamProperties {
uint32_t SampleRate /* @brief Sample rate in Hz (e.g. 44100) */ ;
uint32_t BitRate /* @brief Target bitrate in bits per second (eg. 320000) */ ;
uint8_t Channels /* @brief Number of audio channels (e.g. 2) */ ;
uint8_t Resolution /* @brief Sampling resolution in bits per sample (e.g. 16) */ ;
bool IsResampled /* @brief Indicates if the source stream is being resampled by the stack to match sink capabilities */ ;
uint32_t SampleRate /* @brief Sample rate in Hz (e.g. 44100) */;
uint32_t BitRate /* @brief Target bitrate in bits per second (eg. 320000) */;
uint8_t Channels /* @brief Number of audio channels (e.g. 2) */;
uint8_t Resolution /* @brief Sampling resolution in bits per sample (e.g. 16) */;
bool IsResampled /* @brief Indicates if the source stream is being resampled by the stack to match sink capabilities */;
};

struct EXTERNAL IStream : virtual public Core::IUnknown {
Expand Down Expand Up @@ -117,13 +117,14 @@ namespace Exchange {
enum { ID = ID_BLUETOOTHAUDIO_SINK_CALLBACK };

// @brief Signals audio sink state change
// @param state: Changed BluetoothAudio State
virtual void StateChanged(const IBluetoothAudio::state state) = 0;
};

virtual Core::hresult Callback(ICallback* callback) = 0;

// @brief Assigns a Bluetooth sink device for audio playback
// @param address Address of the bluetooth device to assign
// @param address: Address of the bluetooth device to assign
// @retval ERROR_BAD_REQUEST Device address value is invalid
// @retval ERROR_ALREADY_CONNECTED A sink device is already assigned
virtual Core::hresult Assign(const string& address) = 0;
Expand All @@ -148,7 +149,7 @@ namespace Exchange {

// @property
// @brief Latency of the audio sink device
// @param latency Audio latency in milliseconds (e.g. 20)
// @param latency: Audio latency in milliseconds (e.g. 20)
// @retval ERROR_BAD_REQUEST Latency value is invalid
virtual Core::hresult Latency(const int16_t latency) = 0;
virtual Core::hresult Latency(int16_t& latency /* @out */) const = 0;
Expand All @@ -174,7 +175,7 @@ namespace Exchange {
virtual Core::hresult DRM(DRMProperties& properties /* @out */) const = 0;

// @property
// @brief v of the currently transmitted audio stream
// @brief Properties of the currently transmitted audio stream
// @retval ERROR_ILLEGAL_STATE The sink device currently is not connected or not yet configured
virtual Core::hresult Stream(StreamProperties& properties /* @out */) const = 0;
};
Expand Down Expand Up @@ -210,6 +211,7 @@ namespace Exchange {
enum { ID = ID_BLUETOOTHAUDIO_SOURCE_CALLBACK };

// @brief Signals audio source state change
// @param state: Changed BluetoothAudio State
virtual void StateChanged(const IBluetoothAudio::state state) = 0;
};

Expand Down
55 changes: 29 additions & 26 deletions interfaces/IBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Exchange {
virtual void Hide(const bool hidden) = 0;
};

// @json @uncompliant:extended // NOTE: extended format is deprecated!! Do not just copy this line!
// @json 1.0.0 @uncompliant:extended // NOTE: extended format is deprecated!! Do not just copy this line!
struct EXTERNAL IWebBrowser : virtual public Core::IUnknown {
enum { ID = ID_WEB_BROWSER };

Expand Down Expand Up @@ -83,10 +83,10 @@ namespace Exchange {
virtual void LoadFailed(const string& URL) = 0;
// @brief Signals a URL change in the browser
// @param URL The URL that has been loaded or requested (e.g. https://example.com)
// @param loaded loaded (true) or not (false)
// @param loaded Loaded (true) or not (false)
virtual void URLChange(const string& URL, const bool loaded) = 0;
// @brief Signals a visibility change of the browser
// @param hidden hidden (true) or visible (false)
// @param hidden Hidden (true) or Visible (false)
virtual void VisibilityChange(const bool hidden) = 0;
// @brief Notifies that the web page requests to close its window
virtual void PageClosure() = 0;
Expand All @@ -99,19 +99,19 @@ namespace Exchange {

// @property
// @brief Page loaded in the browser
// @param url Loaded URL (e.g. https://example.com)
// @param url: Loaded URL (e.g. https://example.com)
virtual uint32_t URL(string& url /* @out */) const = 0;
virtual uint32_t URL(const string& url) = 0;

// @property
// @brief Browser window visibility state
// @param visible Visiblity state (e.g. )
// @param visible: Visiblity state (e.g. )
virtual uint32_t Visibility(VisibilityType& visible /* @out */) const = 0;
virtual uint32_t Visibility(const VisibilityType visible) = 0;

// @property
// @brief Current framerate the browser is rendering at
// @param fps Current FPS
// @param fps: Current FPS
virtual uint32_t FPS(uint8_t& fps /* @out */) const = 0;

/* @json:omit */
Expand All @@ -121,37 +121,37 @@ namespace Exchange {

// @property
// @brief UserAgent string used by the browser
// @param useragent UserAgent value (e.g. Mozilla/5.0 (Linux; x86_64 GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1 WP)
// @param useragent: UserAgent value (e.g. Mozilla/5.0 (Linux; x86_64 GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1 WP)
virtual uint32_t UserAgent(string& useragent /* @out */) const = 0;
virtual uint32_t UserAgent(const string& useragent) = 0;

// @property
// @brief Controls the local storage availability
// @param state enabled or disabled
// @param state: Enabled or Disabled
virtual uint32_t LocalStorageEnabled(bool& enabled /* @out */) const = 0;
virtual uint32_t LocalStorageEnabled(const bool enabled) = 0;

// @property
// @brief HTTP cookies accept policy
// @param policy HTTP Cookie Accept Policy Type (e.g. always)
// @param policy: HTTP Cookie Accept Policy Type (e.g. always)
virtual uint32_t HTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyType& policy /* @out */) const = 0;
virtual uint32_t HTTPCookieAcceptPolicy(const HTTPCookieAcceptPolicyType policy) = 0;

// @property
// @brief Response for legacy $badger.
// @param payload base64 encoded JSON string response to be delivered to $badger.callback
// @param payload: Base64 encoded JSON string response to be delivered to $badger.callback
virtual uint32_t BridgeReply(const string& payload) = 0;

// @property
// @brief Send legacy $badger event.
// @param payload base64 encoded JSON string response to be delivered to window.$badger.event
// @param payload: Base64 encoded JSON string response to be delivered to window.$badger.event
virtual uint32_t BridgeEvent(const string& payload) = 0;

// @brief Initiate garbage collection
virtual uint32_t CollectGarbage() = 0;
};

// @json @uncompliant:extended
// @json 1.0.0 @uncompliant:extended
struct EXTERNAL IBrowserResources : virtual public Core::IUnknown {

enum { ID = ID_BROWSER_RESOURCES };
Expand All @@ -160,72 +160,73 @@ namespace Exchange {

// @property
// @brief Headers to send on all requests that the browser makes
// @param header Header Name
// @param header: Header Name
// @json:omit
virtual uint32_t Headers(IStringIterator*& header /* @out */) const = 0;
// @json:omit
virtual uint32_t Headers(IStringIterator* const header) = 0;

// @property
// @brief User scripts used by the browser
// @param uris JSON array containing URIs pointing to user scripts, supported protocols: file://
// @param uris: JSON array containing URIs pointing to user scripts, supported protocols: file://
virtual uint32_t UserScripts(IStringIterator*& uris /* @out */) const = 0;
virtual uint32_t UserScripts(IStringIterator* const uris) = 0;

// @property
// @brief User style sheets used by the browser
// @param uris JSON array containing URIs pointing to user style sheets, supported protocols: file://
// @param uris: JSON array containing URIs pointing to user style sheets, supported protocols: file://
virtual uint32_t UserStyleSheets(IStringIterator*& uris /* @out */) const = 0;
virtual uint32_t UserStyleSheets(IStringIterator* const uris) = 0;
};

// @json @uncompliant:extended
// @json 1.0.0 @uncompliant:extended
struct EXTERNAL IBrowserSecurity : virtual public Core::IUnknown {

enum { ID = ID_BROWSER_SECURITY };

// @property
// @brief Security profile for secure connections
// @param profile Security profile for secure connections (e.g. compatible)
// @param profile: Security profile for secure connections (e.g. compatible)
virtual uint32_t SecurityProfile(string& profile /* @out */) const = 0;
virtual uint32_t SecurityProfile(const string& profile) = 0;

enum MixedContentPolicyType : uint8_t {
ALLOWED = 0 /* @text:allowed */,
BLOCKED = 1 /* @text:blocked */
BLOCKED = 1 /* @text:blocked */
};

// @property
// @brief Mixed content policy
// @param policy Mixed content policy type
// @param policy: Mixed content policy type
virtual uint32_t MixedContentPolicy(MixedContentPolicyType& policy /* @out */) const = 0;
virtual uint32_t MixedContentPolicy(const MixedContentPolicyType policy) = 0;
};

/* @json @uncompliant:extended */
/* @json 1.0.0 @uncompliant:extended */
struct EXTERNAL IBrowserScripting : virtual public Core::IUnknown {
enum { ID = ID_BROWSER_SCRIPTING };

// @brief Run javascript in main frame.
// @param script Utf8 encoded JS code string.
// @param script: Utf8 encoded JS code string.
virtual uint32_t RunJavaScript(const string& script) = 0;

// @brief Add user script to be executed at document start.
// @param script Utf8 encoded JS code string.
// @param script: Utf8 encoded JS code string.
// @param topFrameOnly: Enable only top frame
virtual uint32_t AddUserScript(const string& script, const bool topFrameOnly) = 0;

// @brief Remove all user scripts.
virtual uint32_t RemoveAllUserScripts() = 0;
};

/* @json @uncompliant:extended */
/* @json 1.0.0 @uncompliant:extended */
struct EXTERNAL IBrowserCookieJar : virtual public Core::IUnknown {
enum { ID = ID_BROWSER_COOKIEJAR };

struct Config {
uint32_t version; /* Version of payload format */
uint32_t checksum; /* The checksum of the string used for payload creation */
string payload; /* Base64 string representation of compressed and encrypted cookies */
uint32_t version /* @brief Version of payload format */;
uint32_t checksum /* @brief The checksum of the string used for payload creation */;
string payload /* @brief Base64 string representation of compressed and encrypted cookies */;
};

/* @event */
Expand All @@ -240,6 +241,8 @@ namespace Exchange {
virtual void Unregister(INotification* sink) = 0;

// @property
// @brief Get/Set CookieJar config details
// @param cookieJarInfo: Config info CookieJar
virtual uint32_t CookieJar(Config& cookieJarInfo /* @out */) const = 0;
virtual uint32_t CookieJar(const Config& cookieJarInfo) = 0;
};
Expand Down
Loading