diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2023-03-03 12:13:24 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2023-03-08 13:34:11 +0200 |
commit | 8b057267c4180e5648b6636f4b5b1de07f627977 (patch) | |
tree | 9dd68e6a5e5a4142c6658d00fe180eb8e4ec7673 | |
parent | df7c14cabeb91f3e98395b6a7b461b408eb91d81 (diff) |
window-management-rpc: Client for testing out grpc proxy
This test client for trying/testing out the RPC API with the compositor.
It implements floating and fullscreen functionality. Further patches
would include split and remoting.
Bug-AGL: SPEC-4673
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I960eac1f60c359629343efef03f4fab586d7c3af
-rw-r--r-- | LICENSE | 54 | ||||
-rw-r--r-- | meson.build | 30 | ||||
-rw-r--r-- | src/AglShellGrpcClient.cpp | 123 | ||||
-rw-r--r-- | src/AglShellGrpcClient.h | 105 | ||||
-rw-r--r-- | src/agl_shell.proto | 80 | ||||
-rw-r--r-- | src/main.cpp | 123 | ||||
-rw-r--r-- | src/meson.build | 68 | ||||
-rw-r--r-- | src/qml/Main.qml | 15 | ||||
-rw-r--r-- | src/qml/images/AGL_HMI_Blue_Background_NoCar-01.png | bin | 0 -> 949053 bytes | |||
-rw-r--r-- | src/qml/images/images.qrc | 5 | ||||
-rw-r--r-- | src/qml/qml.qrc | 5 |
11 files changed, 608 insertions, 0 deletions
@@ -0,0 +1,54 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of this License; and + You must cause any modified files to carry prominent notices stating that You changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..beb933d --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +# +# Copyright 2023 Collabora, Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +project ( + 'c', 'cpp', + version: '0.0.1', + default_options: [ + 'warning_level=3', + 'c_std=c2x', + 'cpp_std=c++20' + ], + meson_version: '>= 0.60', + license: 'MIT/Expat', +) + +qt5 = import('qt5') +subdir('src') diff --git a/src/AglShellGrpcClient.cpp b/src/AglShellGrpcClient.cpp new file mode 100644 index 0000000..73aad71 --- /dev/null +++ b/src/AglShellGrpcClient.cpp @@ -0,0 +1,123 @@ +//include stuff here +#include <cstdio> + +#include <mutex> +#include <condition_variable> +#include <grpc/grpc.h> +#include <grpcpp/grpcpp.h> +#include <grpcpp/server.h> +#include <grpcpp/server_builder.h> +#include <grpcpp/server_context.h> + +#include <grpcpp/ext/proto_server_reflection_plugin.h> +#include <grpcpp/health_check_service_interface.h> + +#include "AglShellGrpcClient.h" +#include "agl_shell.grpc.pb.h" + +namespace { + const char kDefaultGrpcServiceAddress[] = "127.0.0.1:14005"; +} + +GrpcClient::GrpcClient() +{ + auto channel = grpc::CreateChannel(kDefaultGrpcServiceAddress, + grpc::InsecureChannelCredentials()); + + // init the stub here + m_stub = agl_shell_ipc::AglShellManagerService::NewStub(channel); + reader = new Reader(m_stub.get()); +} + + +bool +GrpcClient::ActivateApp(const std::string& app_id, const std::string& output_name) +{ + agl_shell_ipc::ActivateRequest request; + + request.set_app_id(app_id); + request.set_output_name(output_name); + + grpc::ClientContext context; + ::agl_shell_ipc::ActivateResponse reply; + + grpc::Status status = m_stub->ActivateApp(&context, request, &reply); + return status.ok(); +} + +bool +GrpcClient::DeactivateApp(const std::string& app_id) +{ + agl_shell_ipc::DeactivateRequest request; + + request.set_app_id(app_id); + + grpc::ClientContext context; + ::agl_shell_ipc::DeactivateResponse reply; + + grpc::Status status = m_stub->DeactivateApp(&context, request, &reply); + return status.ok(); +} + +bool +GrpcClient::SetAppFloat(const std::string& app_id, int32_t x_pos, int32_t y_pos) +{ + agl_shell_ipc::FloatRequest request; + + request.set_app_id(app_id); + request.set_x_pos(x_pos); + request.set_y_pos(y_pos); + + grpc::ClientContext context; + ::agl_shell_ipc::FloatResponse reply; + + grpc::Status status = m_stub->SetAppFloat(&context, request, &reply); + return status.ok(); +} + +bool +GrpcClient::SetAppFullscreen(const std::string& app_id) +{ + agl_shell_ipc::FullscreenRequest request; + + request.set_app_id(app_id); + + grpc::ClientContext context; + ::agl_shell_ipc::FullscreenResponse reply; + + grpc::Status status = m_stub->SetAppFullscreen(&context, request, &reply); + return status.ok(); +} + +grpc::Status +GrpcClient::Wait(void) +{ + return reader->Await(); +} + +void +GrpcClient::AppStatusState(Callback callback) +{ + reader->AppStatusState(callback); +} + +std::vector<std::string> +GrpcClient::GetOutputs() +{ + grpc::ClientContext context; + std::vector<std::string> v; + + ::agl_shell_ipc::OutputRequest request; + ::agl_shell_ipc::ListOutputResponse response; + + grpc::Status status = m_stub->GetOutputs(&context, request, &response); + if (!status.ok()) + return std::vector<std::string>(); + + for (int i = 0; i < response.outputs_size(); i++) { + ::agl_shell_ipc::OutputResponse rresponse = response.outputs(i); + v.push_back(rresponse.name()); + } + + return v; +} diff --git a/src/AglShellGrpcClient.h b/src/AglShellGrpcClient.h new file mode 100644 index 0000000..a50369a --- /dev/null +++ b/src/AglShellGrpcClient.h @@ -0,0 +1,105 @@ +#pragma once +#include <cstdio> + +#include <mutex> +#include <condition_variable> +#include <grpc/grpc.h> +#include <grpcpp/grpcpp.h> +#include <grpcpp/server.h> +#include <grpcpp/server_builder.h> +#include <grpcpp/server_context.h> + +#include <grpcpp/ext/proto_server_reflection_plugin.h> +#include <grpcpp/health_check_service_interface.h> + +#include "agl_shell.grpc.pb.h" + +typedef void (*Callback)(agl_shell_ipc::AppStateResponse app_response); + +class Reader : public grpc::ClientReadReactor<::agl_shell_ipc::AppStateResponse> { +public: + Reader(agl_shell_ipc::AglShellManagerService::Stub *stub) + : m_stub(stub) + { + } + + void AppStatusState(Callback callback) + { + ::agl_shell_ipc::AppStateRequest request; + + // set up the callback + m_callback = callback; + m_stub->async()->AppStatusState(&m_context, &request, this); + + StartRead(&m_app_state); + StartCall(); + } + + void OnReadDone(bool ok) override + { + if (ok) { + m_callback(m_app_state); + + // blocks in StartRead() if the server doesn't send + // antyhing + StartRead(&m_app_state); + } + } + + void SetDone() + { + fprintf(stderr, "%s()\n", __func__); + std::unique_lock<std::mutex> l(m_mutex); + m_done = true; + } + + void OnDone(const grpc::Status& s) override + { + fprintf(stderr, "%s()\n", __func__); + std::unique_lock<std::mutex> l(m_mutex); + + m_status = s; + + fprintf(stderr, "%s() done\n", __func__); + m_cv.notify_one(); + } + + grpc::Status Await() + { + std::unique_lock<std::mutex> l(m_mutex); + + m_cv.wait(l, [this] { return m_done; }); + + return std::move(m_status); + } +private: + grpc::ClientContext m_context; + ::agl_shell_ipc::AppStateResponse m_app_state; + agl_shell_ipc::AglShellManagerService::Stub *m_stub; + + Callback m_callback; + + + std::mutex m_mutex; + std::condition_variable m_cv; + grpc::Status m_status; + bool m_done = false; +}; + +class GrpcClient { +public: + GrpcClient(); + bool ActivateApp(const std::string& app_id, const std::string& output_name); + bool DeactivateApp(const std::string& app_id); + bool SetAppFloat(const std::string& app_id, int32_t x_pos, int32_t y_pos); + bool SetAppFullscreen(const std::string& app_id); + std::vector<std::string> GetOutputs(); + void GetAppState(); + void AppStatusState(Callback callback); + grpc::Status Wait(); + +private: + Reader *reader; + std::unique_ptr<agl_shell_ipc::AglShellManagerService::Stub> m_stub; +}; + diff --git a/src/agl_shell.proto b/src/agl_shell.proto new file mode 100644 index 0000000..200d43e --- /dev/null +++ b/src/agl_shell.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; +// using empty Response suitable better for forward compat +//import "google/protobuf/empty.proto"; +package agl_shell_ipc; + +service AglShellManagerService { + rpc ActivateApp(ActivateRequest) returns (ActivateResponse) {} + rpc DeactivateApp(DeactivateRequest) returns (DeactivateResponse) {} + rpc SetAppSplit(SplitRequest) returns (SplitResponse) {} + rpc SetAppFloat(FloatRequest) returns (FloatResponse) {} + rpc SetAppFullscreen(FullscreenRequest) returns (FullscreenResponse) {} + rpc AppStatusState(AppStateRequest) returns (stream AppStateResponse) {} + rpc GetOutputs(OutputRequest) returns (ListOutputResponse) {} + rpc SetAppNormal(NormalRequest) returns (NormalResponse) {} +} + +message ActivateRequest { + string app_id = 1; + string output_name = 2; +} + +message ActivateResponse { +}; + +message DeactivateRequest { + string app_id = 1; +} + +message DeactivateResponse { +} + +message SplitRequest { + string app_id = 1; + int32 tile_orientation = 2; +} + +message SplitResponse { +} + +message FloatRequest { + string app_id = 1; + int32 x_pos = 2; + int32 y_pos = 3; +} + +message FloatResponse { +} + +message AppStateRequest { +} + +message AppStateResponse { + int32 state = 1; + string app_id = 2; +} + +message OutputRequest { +}; + +message OutputResponse { + string name = 1; +}; + +message ListOutputResponse { + repeated OutputResponse outputs = 1; +}; + +message NormalRequest { + string app_id = 1; +}; + +message NormalResponse { +}; + +message FullscreenRequest { + string app_id = 1; +}; + +message FullscreenResponse { +}; diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..b2a5b4d --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Collabora, Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include <QGuiApplication> +#include <QCommandLineParser> +#include <QtCore/QUrlQuery> +#include <QtCore/QObject> +#include <QObject> +#include <QQmlEngine> +#include <QtGui/QGuiApplication> +#include <QtQml/QQmlApplicationEngine> +#include <QtQml/QQmlContext> +#include <QtQml/QQmlComponent> +#include <QtQml/qqml.h> +#include <QQuickWindow> +#include <QTimer> + +#include "AglShellGrpcClient.h" + +const QString myname = QString("window-management-client-rpc"); + +enum mode { + NONE = 0, + FLOAT = 1, + FULLSCREEN = 2, + FULLSCREEN_QT = 3, // rather than use rpc, use Qt API + REMOTE = 4, +}; + +static QWindow * +create_window(QQmlComponent *comp) +{ + QObject *obj = comp->create(); + obj->setParent(nullptr); + + QWindow *win = qobject_cast<QWindow *>(obj); + + return win; +} + +int main(int argc, char *argv[]) +{ + enum mode mmode = NONE; + + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine; + + // necessary to identify correctly by app_id + app.setDesktopFileName(myname); + + QQmlComponent main_comp(&engine, QUrl("qrc:/Main.qml")); + + if (argc >= 2) { + if (strcmp(argv[1], "float") == 0) + mmode = FLOAT; + else if (strcmp(argv[1], "full") == 0) + mmode = FULLSCREEN; + else if (strcmp(argv[1], "remote") == 0) + mmode = REMOTE; + else if (strcmp(argv[1], "full_qt") == 0) + mmode = FULLSCREEN_QT; + else + assert(!"Invalid mode"); + + if (mmode != FLOAT && mmode != FULLSCREEN && mmode != REMOTE) { + fprintf(stderr, "Will not use rpc\n"); + goto skip; + } + + // start grpc connection + GrpcClient *client = new GrpcClient(); + + // note that these are setting up the window state by using + // another communication channel (rpc), and need to happen + // before the client does the initial commit (without a buffer + // attached) + switch (mmode) { + case FLOAT: + fprintf(stderr, "Setting the application as float\n"); + client->SetAppFloat(myname.toStdString(), 40, 300); + break; + case FULLSCREEN: + fprintf(stderr, "Setting the application as fullscreen\n"); + client->SetAppFullscreen(myname.toStdString()); + break; + case REMOTE: + fprintf(stderr, "Setting the application as remote\n"); + break; + default: + break; + } + } + +skip: + // this would allow call any of the QWindow methods + QWindow *win = create_window(&main_comp); + + // alternatively do the load directly + //engine.load(QUrl(QStringLiteral("qrc:/Main.qml"))); + + return app.exec(); +} diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..a3a816b --- /dev/null +++ b/src/meson.build @@ -0,0 +1,68 @@ +pkgconfig = import('pkgconfig') +cpp = meson.get_compiler('cpp') + +qt5_dep = dependency('qt5', modules: ['Qml', 'Quick', 'Gui']) +dep_qtappfw = [ + dependency('qtappfw-weather'), +] + +grpcpp_reflection_dep = cpp.find_library('grpc++_reflection') +protoc = find_program('protoc') +grpc_cpp = find_program('grpc_cpp_plugin') + +protoc_gen = generator(protoc, \ + output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/', + '--cpp_out=@BUILD_DIR@', + '@INPUT@']) + +generated_protoc_sources = protoc_gen.process('agl_shell.proto') + +grpc_gen = generator(protoc, \ + output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/', + '--grpc_out=@BUILD_DIR@', + '--plugin=protoc-gen-grpc=' + grpc_cpp.path(), + '@INPUT@']) +generated_grpc_sources = grpc_gen.process('agl_shell.proto') + +grpc_deps = [ + dependency('protobuf'), + dependency('grpc'), + dependency('grpc++'), + grpcpp_reflection_dep, +] + +window_mgnt_dep = [ + qt5_dep, + dep_qtappfw, + grpc_deps, +] + +window_mgnt_resources = [ + 'qml/images/images.qrc', + 'qml/qml.qrc' +] + +resource_files = qt5.compile_resources(sources: window_mgnt_resources) + +window_mgnt_src_headers = [ + 'AglShellGrpcClient.h', +] + +moc_files = qt5.compile_moc(headers: window_mgnt_src_headers, + dependencies: qt5_dep) +window_mgnt_src = [ + 'AglShellGrpcClient.cpp', + 'main.cpp', + generated_protoc_sources, + generated_grpc_sources, +] + +prefix_path = get_option('prefix') +binplugin_dir = join_paths(prefix_path, get_option('bindir')) + +executable('window-management-rpc', window_mgnt_src, resource_files, moc_files, + dependencies : window_mgnt_dep, + install_rpath: binplugin_dir, + install: true) diff --git a/src/qml/Main.qml b/src/qml/Main.qml new file mode 100644 index 0000000..151f3b8 --- /dev/null +++ b/src/qml/Main.qml @@ -0,0 +1,15 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 + +Window { + id: background + width: 800 + height: 600 + flags: Qt.FramelessWindowHint + visible: true + + Image { + anchors.fill: parent + source: './images/AGL_HMI_Blue_Background_NoCar-01.png' + } +} diff --git a/src/qml/images/AGL_HMI_Blue_Background_NoCar-01.png b/src/qml/images/AGL_HMI_Blue_Background_NoCar-01.png Binary files differnew file mode 100644 index 0000000..357c204 --- /dev/null +++ b/src/qml/images/AGL_HMI_Blue_Background_NoCar-01.png diff --git a/src/qml/images/images.qrc b/src/qml/images/images.qrc new file mode 100644 index 0000000..78d9b77 --- /dev/null +++ b/src/qml/images/images.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/images"> + <file>AGL_HMI_Blue_Background_NoCar-01.png</file> + </qresource> +</RCC> diff --git a/src/qml/qml.qrc b/src/qml/qml.qrc new file mode 100644 index 0000000..f907b18 --- /dev/null +++ b/src/qml/qml.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>Main.qml</file> + </qresource> +</RCC> |