Description:adapter mmi

Match-id-3961d6c91dbb70a8d53faebf050d640b50ce7b13
This commit is contained in:
xxxx
2022-08-31 20:43:27 +08:00
parent 7a17f2b7cc
commit 06cdc7bc6e
11 changed files with 124 additions and 82 deletions
+100
View File
@@ -0,0 +1,100 @@
/*
* Copyright (c) 2022 Huawei Device Co., 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.
*/
#ifndef OHOS_I_DINPUT_CONTEXT_H
#define OHOS_I_DINPUT_CONTEXT_H
#include <cstdint>
#include <string>
#include "constants_dinput.h"
namespace OHOS {
namespace DistributedHardware {
namespace DistributedInput {
struct LocalAbsInfo {
int32_t absXMin = 0;
int32_t absXMax = 0;
int32_t absYMin = 0;
int32_t absYMax = 0;
int32_t absPressureMin = 0;
int32_t absPressureMax = 0;
int32_t absMtTouchMajorMin = 0;
int32_t absMtTouchMajorMax = 0;
int32_t absMtTouchMinorMin = 0;
int32_t absMtTouchMinorMax = 0;
int32_t absMtOrientationMin = 0;
int32_t absMtOrientationMax = 0;
int32_t absMtPositionXMin = 0;
int32_t absMtPositionXMax = 0;
int32_t absMtPositionYMin = 0;
int32_t absMtPositionYMax = 0;
int32_t absMtBlobIdMin = 0;
int32_t absMtBlobIdMax = 0;
int32_t absMtTrackingIdMin = 0;
int32_t absMtTrackingIdMax = 0;
int32_t absMtPressureMin = 0;
int32_t absMtPressureMax = 0;
InputDevice deviceInfo;
};
struct LocalTouchScreenInfo {
uint32_t sinkShowWidth = 0;
uint32_t sinkShowHeight = 0;
uint32_t sinkPhyWidth = 0;
uint32_t sinkPhyHeight = 0;
LocalAbsInfo localAbsInfo;
};
struct TransformInfo {
uint32_t sinkWinPhyX = 0; // projection area X coordinate in touch coordinate
uint32_t sinkWinPhyY = 0; // projection area Y coordinate in touch coordinate
uint32_t sinkProjPhyWidth = 0; // projection area width in touch coordinate
uint32_t sinkProjPhyHeight = 0; // projection area height in touch coordinate
double coeffWidth = 0.0; // sink width transform source coefficient
double coeffHeight = 0.0; // sink height transform source coefficient
};
struct SrcScreenInfo {
std::string devId = ""; // source device id
std::string uuid = ""; // source device uuid
int32_t sessionId = 0; // source device session id
uint64_t sourceWinId = 0; // source projection window id
uint32_t sourceWinWidth = 0; // source projection window width
uint32_t sourceWinHeight = 0; // source projection window height
std::string sourcePhyId = ""; // source virtual screen driver id
uint32_t sourcePhyFd = 0; // source virtual screen driver fd
uint32_t sourcePhyWidth = 0; // source virtual screen driver width
uint32_t sourcePhyHeight = 0; // source virtual screen driver height
};
struct SinkScreenInfo {
uint32_t sinkShowWidth = 0; // sink show width
uint32_t sinkShowHeight = 0; // sink show height
uint32_t sinkPhyWidth = 0; // sink touch screen width
uint32_t sinkPhyHeight = 0; // sink touch screen height
uint64_t sinkShowWinId = 0; // sink show window id
uint32_t sinkWinShowX = 0; // sink show window x coordinate
uint32_t sinkWinShowY = 0; // sink show window y coordinate
uint32_t sinkProjShowWidth = 0; // sink show window width
uint32_t sinkProjShowHeight = 0; // sink show window height
SrcScreenInfo srcScreenInfo;
TransformInfo transformInfo;
};
} // namespace DistributedInput
} // namespace DistributedHardware
} // namespace OHOS
#endif // OHOS_I_DINPUT_CONTEXT_H
@@ -22,7 +22,7 @@
#include "iremote_object.h"
#include "constants_dinput.h"
#include "dinput_context.h"
#include "i_dinput_context.h"
#include "i_distributed_sink_input.h"
#include "i_get_sink_screen_infos_call_back.h"
#include "i_sharing_dhid_listener.h"
+15 -11
View File
@@ -15,25 +15,29 @@ import("//build/ohos.gni")
import(
"//foundation/distributedhardware/distributed_input/distributedinput.gni")
ohos_shared_library("libdinput_sdk") {
config("input_sdk_public_config") {
include_dirs = [
"${common_path}/include",
"${frameworks_path}/include",
"${fwk_common_path}/log/include",
"${fwk_common_path}/utils/include",
"${fwk_interfaces_path}/include",
"${fwk_interfaces_path}/include/ipc",
"${fwk_utils_path}/include",
"${fwk_utils_path}/include/log",
"${innerkits_path}/include",
"${innerkits_path}/src",
"${ipc_path}/include",
"${ipc_path}/src",
"${frameworks_path}/include",
"//commonlibrary/c_utils/base/include",
"//utils/system/safwk/native/include",
"${common_path}/include",
"${fwk_common_path}/log/include",
"${fwk_common_path}/utils/include",
"${fwk_utils_path}/include/log",
"${fwk_utils_path}/include",
"${utils_path}/include",
"//commonlibrary/c_utils/base/include",
"//third_party/json/include",
"${fwk_interfaces_path}/include",
"${fwk_interfaces_path}/include/ipc",
"//utils/native/base/include",
"//utils/system/safwk/native/include",
]
}
ohos_shared_library("libdinput_sdk") {
public_configs = [":input_sdk_public_config"]
sources = [
"${common_path}/include/white_list_util.cpp",
@@ -45,6 +45,7 @@ ohos_unittest("distributed_input_inner_test") {
"${utils_path}/include",
"${fwk_interfaces_path}/include",
"${fwk_interfaces_path}/include/ipc",
"${frameworks_path}/include",
]
sources = [
@@ -16,6 +16,7 @@
#include "distributed_input_inner_test.h"
#include "system_ability_definition.h"
#include "dinput_context.h"
#include "dinput_errcode.h"
using namespace testing::ext;
@@ -19,6 +19,7 @@
#include "nlohmann/json.hpp"
#include "constants_dinput.h"
#include "dinput_context.h"
#include "dinput_errcode.h"
#include "white_list_util.h"
@@ -19,6 +19,7 @@
#include <atomic>
#include <iostream>
#include <mutex>
#include <set>
#include <string>
#include "event_handler.h"
@@ -35,6 +35,7 @@
#include "distributed_input_sink_switch.h"
#include "distributed_input_sink_transport.h"
#include "dinput_context.h"
#include "dinput_errcode.h"
#include "dinput_sa_process_state.h"
#include "dinput_utils_tool.h"
+1
View File
@@ -31,6 +31,7 @@ ohos_shared_library("libdinput_utils") {
"${low_latency_path}/include",
"${dfx_utils_path}/include",
"//commonlibrary/c_utils/base/include",
"${frameworks_path}/include",
]
sources = [
+1 -70
View File
@@ -33,81 +33,12 @@
#include "iservice_registry.h"
#include "system_ability_definition.h"
#include "i_dinput_context.h"
#include "input_hub.h"
namespace OHOS {
namespace DistributedHardware {
namespace DistributedInput {
struct LocalAbsInfo {
int32_t absXMin = 0;
int32_t absXMax = 0;
int32_t absYMin = 0;
int32_t absYMax = 0;
int32_t absPressureMin = 0;
int32_t absPressureMax = 0;
int32_t absMtTouchMajorMin = 0;
int32_t absMtTouchMajorMax = 0;
int32_t absMtTouchMinorMin = 0;
int32_t absMtTouchMinorMax = 0;
int32_t absMtOrientationMin = 0;
int32_t absMtOrientationMax = 0;
int32_t absMtPositionXMin = 0;
int32_t absMtPositionXMax = 0;
int32_t absMtPositionYMin = 0;
int32_t absMtPositionYMax = 0;
int32_t absMtBlobIdMin = 0;
int32_t absMtBlobIdMax = 0;
int32_t absMtTrackingIdMin = 0;
int32_t absMtTrackingIdMax = 0;
int32_t absMtPressureMin = 0;
int32_t absMtPressureMax = 0;
InputDevice deviceInfo;
};
struct LocalTouchScreenInfo {
uint32_t sinkShowWidth = 0;
uint32_t sinkShowHeight = 0;
uint32_t sinkPhyWidth = 0;
uint32_t sinkPhyHeight = 0;
LocalAbsInfo localAbsInfo;
};
struct SrcScreenInfo {
std::string devId = ""; // source device id
std::string uuid = ""; // source device uuid
int32_t sessionId = 0; // source device session id
uint64_t sourceWinId = 0; // source projection window id
uint32_t sourceWinWidth = 0; // source projection window width
uint32_t sourceWinHeight = 0; // source projection window height
std::string sourcePhyId = ""; // source virtual screen driver id
uint32_t sourcePhyFd = 0; // source virtual screen driver fd
uint32_t sourcePhyWidth = 0; // source virtual screen driver width
uint32_t sourcePhyHeight = 0; // source virtual screen driver height
};
struct TransformInfo {
uint32_t sinkWinPhyX = 0; // projection area X coordinate in touch coordinate
uint32_t sinkWinPhyY = 0; // projection area Y coordinate in touch coordinate
uint32_t sinkProjPhyWidth = 0; // projection area width in touch coordinate
uint32_t sinkProjPhyHeight = 0; // projection area height in touch coordinate
double coeffWidth = 0.0; // sink width transform source coefficient
double coeffHeight = 0.0; // sink height transform source coefficient
};
struct SinkScreenInfo {
uint32_t sinkShowWidth = 0; // sink show width
uint32_t sinkShowHeight = 0; // sink show height
uint32_t sinkPhyWidth = 0; // sink touch screen width
uint32_t sinkPhyHeight = 0; // sink touch screen height
uint64_t sinkShowWinId = 0; // sink show window id
uint32_t sinkWinShowX = 0; // sink show window x coordinate
uint32_t sinkWinShowY = 0; // sink show window y coordinate
uint32_t sinkProjShowWidth = 0; // sink show window width
uint32_t sinkProjShowHeight = 0; // sink show window height
SrcScreenInfo srcScreenInfo;
TransformInfo transformInfo;
};
class DInputContext {
DECLARE_SINGLE_INSTANCE_BASE(DInputContext);
public:
+1
View File
@@ -37,6 +37,7 @@ ohos_unittest("distributed_input_utils_test") {
"${fwk_interfaces_path}/include",
"${fwk_interfaces_path}/include/ipc",
"//commonlibrary/c_utils/base/include",
"${frameworks_path}/include",
]
sources = [ "dinput_context_test.cpp" ]