diff --git a/frameworks/core/common/container.h b/frameworks/core/common/container.h index b1414f44278a18bb630286ee18257a0b3c948e76..c639ea0684b7c1865a2d6b449978efcd2bebd6aa 100755 --- a/frameworks/core/common/container.h +++ b/frameworks/core/common/container.h @@ -40,6 +40,7 @@ #include "core/components_ng/pattern/navigator/navigator_event_hub.h" #include "core/event/pointer_event.h" #include "core/pipeline/pipeline_base.h" +#include "core/common/container_consts.h" namespace OHOS::Ace { @@ -53,24 +54,6 @@ using CardViewPositionCallBack = std::function; using StopDragCallback = std::function; -enum ContainerType { - STAGE_CONTAINER = 1, - FA_CONTAINER, - PA_SERVICE_CONTAINER, - PA_DATA_CONTAINER, - PA_FORM_CONTAINER, - FA_SUBWINDOW_CONTAINER, - COMPONENT_SUBWINDOW_CONTAINER = 10, - PLUGIN_SUBCONTAINER = 20, -}; - -constexpr int32_t INSTANCE_ID_UNDEFINED = -1; -constexpr int32_t INSTANCE_ID_PLATFORM = -2; -constexpr int32_t CONTAINER_ID_DIVIDE_SIZE = 100000; -constexpr int32_t MIN_PLUGIN_SUBCONTAINER_ID = PLUGIN_SUBCONTAINER * CONTAINER_ID_DIVIDE_SIZE; -constexpr int32_t MIN_SUBCONTAINER_ID = COMPONENT_SUBWINDOW_CONTAINER * CONTAINER_ID_DIVIDE_SIZE; -constexpr int32_t MIN_PA_SERVICE_ID = PA_SERVICE_CONTAINER * CONTAINER_ID_DIVIDE_SIZE; - class ACE_FORCE_EXPORT Container : public virtual AceType { DECLARE_ACE_TYPE(Container, AceType); diff --git a/frameworks/core/common/container_consts.h b/frameworks/core/common/container_consts.h new file mode 100755 index 0000000000000000000000000000000000000000..473cf608240c8c1ac8e097d69fc2bfaadf66a632 --- /dev/null +++ b/frameworks/core/common/container_consts.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_CONTAINER_CONSTS_H +#define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_CONTAINER_CONSTS_H + +#include + +namespace OHOS::Ace { +enum ContainerType { + STAGE_CONTAINER = 1, + FA_CONTAINER, + PA_SERVICE_CONTAINER, + PA_DATA_CONTAINER, + PA_FORM_CONTAINER, + FA_SUBWINDOW_CONTAINER, + COMPONENT_SUBWINDOW_CONTAINER = 10, + PLUGIN_SUBCONTAINER = 20, +}; + +constexpr int32_t INSTANCE_ID_UNDEFINED = -1; +constexpr int32_t INSTANCE_ID_PLATFORM = -2; +constexpr int32_t CONTAINER_ID_DIVIDE_SIZE = 100000; +constexpr int32_t MIN_PLUGIN_SUBCONTAINER_ID = PLUGIN_SUBCONTAINER * CONTAINER_ID_DIVIDE_SIZE; +constexpr int32_t MIN_SUBCONTAINER_ID = COMPONENT_SUBWINDOW_CONTAINER * CONTAINER_ID_DIVIDE_SIZE; +constexpr int32_t MIN_PA_SERVICE_ID = PA_SERVICE_CONTAINER * CONTAINER_ID_DIVIDE_SIZE; +} // namespace OHOS::Ace + +#endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_CONTAINER_CONSTS_H diff --git a/frameworks/core/common/container_scope.cpp b/frameworks/core/common/container_scope.cpp index 614154538269292b212d83955dff088241091687..5aec2206a40767e7c2d5e294b400672428dea2e0 100644 --- a/frameworks/core/common/container_scope.cpp +++ b/frameworks/core/common/container_scope.cpp @@ -14,7 +14,7 @@ */ #include "core/common/container_scope.h" -#include "core/common/container.h" +#include "core/common/container_consts.h" #include "base/utils/utils.h" namespace OHOS::Ace { diff --git a/frameworks/core/common/hdc_register.cpp b/frameworks/core/common/hdc_register.cpp index 362693e5f604576838141b28ceb363ad7c33c168..9e4eb380282c9e6ff59fd853fef825969159c3ab 100644 --- a/frameworks/core/common/hdc_register.cpp +++ b/frameworks/core/common/hdc_register.cpp @@ -22,14 +22,13 @@ #include "base/log/log.h" #include "base/utils/utils.h" #include "core/common/ace_application_info.h" +#include "core/common/container_consts.h" namespace OHOS::Ace { namespace { using StartRegister = void (*)( const std::string& processName, const std::string& pkgName, bool debugApp, const Callback& callbac); using StopRegister = void (*)(); -// defined in container.h -constexpr int32_t CONTAINER_ID_DIVIDE_SIZE = 100000; } // namespace HdcRegister::HdcRegister(): registerHandler_(nullptr)