forward declaration instead of mock

Signed-off-by: liuyangyang <liuyangyang58@huawei.com>
Change-Id: I062db826706211e0e1cdcc4d86a01e7f101886f9
This commit is contained in:
liuyangyang 2022-08-30 15:50:32 +08:00
parent 3029cd7301
commit acfba5bee3
5 changed files with 26 additions and 47 deletions

View File

@ -14,19 +14,16 @@
import("//build/ohos.gni")
config("previewer_window_config") {
visibility = [ ":*" ]
include_dirs = [
"//foundation/window/window_manager/previewer/include",
"//foundation/window/window_manager/previewer/mock",
"//foundation/window/window_manager/interfaces/innerkits/wm",
"//foundation/window/window_manager/interfaces/innerkits/dm",
"//foundation/window/window_manager/wm/include",
"//foundation/window/window_manager/utils/include",
"../../../../commonlibrary/c_utils/base/include",
"//foundation/window/window_manager/previewer/include",
]
}
ohos_shared_library("previewer_window") {
public_configs = [ ":previewer_window_config" ]
configs = [ ":previewer_window_config" ]
libs = []
@ -46,12 +43,12 @@ ohos_shared_library("previewer_window") {
]
include_dirs = [
"mock", # mock目录
"include",
"../utils/include",
"../wm/include",
"mock",
"../interfaces/innerkits/wm",
"../interfaces/innerkits/dm",
"../wm/include",
"../utils/include",
"../../../../commonlibrary/c_utils/base/include",
]
@ -68,15 +65,12 @@ ohos_shared_library("previewer_window") {
config("previewer_window_napi_config") {
visibility = [ ":*" ]
include_dirs = [
"//foundation/window/window_manager/interfaces/kits/napi/window_runtime/window_napi",
"//foundation/window/window_manager/interfaces/innerkits/wm",
"//foundation/window/window_manager/wm/include",
"//foundation/window/window_manager/utils/include",
]
include_dirs = [ "//foundation/window/window_manager/interfaces/kits/napi/window_runtime/window_napi" ]
}
ohos_shared_library("previewer_window_napi") {
public_configs = [ ":previewer_window_napi_config" ]
libs = []
sources = [
@ -94,11 +88,17 @@ ohos_shared_library("previewer_window_napi") {
include_dirs = [
".", # 避免冲突的mock目录
"include",
"mock",
"mock/ui",
"mock/transaction",
"../interfaces/kits/napi/window_runtime/window_napi",
"../wm/include",
"../utils/include",
"../interfaces/innerkits/wm",
"../interfaces/innerkits/dm",
"../interfaces/kits/napi/window_runtime/window_stage_napi",
"../../../ability/ability_runtime/interfaces/inner_api/runtime/include",
"../../../../commonlibrary/c_utils/base/include",
]
deps = [

View File

@ -18,12 +18,15 @@
#include <map>
#include <ability_context.h>
#include <ui_content.h>
#include "window.h"
#include "window_property.h"
namespace OHOS::AbilityRuntime {
class Context;
}
namespace OHOS {
namespace Rosen {
union ColorParam {

View File

@ -1,28 +0,0 @@
/*
* 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_ABILITY_RUNTIME_NATIVE_ABILITY_CONTEXT_H
#define OHOS_ABILITY_RUNTIME_NATIVE_ABILITY_CONTEXT_H
#include <map>
#include "context_container.h"
namespace OHOS {
namespace AppExecFwk {
class AbilityContext : public ContextContainer {
};
} // namespace AppExecFwk
} // namespace OHOS
#endif // OHOS_ABILITY_RUNTIME_NATIVE_ABILITY_CONTEXT_H

View File

@ -20,6 +20,10 @@
#include <string>
namespace OHOS {
namespace AbilityRuntime {
class Context;
}
namespace AppExecFwk {
class Configuration;
class Ability;

View File

@ -55,7 +55,7 @@ std::string WindowScene::GenerateMainWindowName(const std::shared_ptr<AbilityRun
if (context == nullptr) {
return MAIN_WINDOW_ID + std::to_string(count++);
} else {
std::string windowName = context->GetBundleName() + std::to_string(count++);
std::string windowName = "MainWinodw" + std::to_string(count++);
std::size_t pos = windowName.find_last_of('.');
return (pos == std::string::npos) ? windowName : windowName.substr(pos + 1); // skip '.'
}