1e0dac50fSopenharmony_ci/* 2e0dac50fSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License. 5e0dac50fSopenharmony_ci * You may obtain a copy of the License at 6e0dac50fSopenharmony_ci * 7e0dac50fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e0dac50fSopenharmony_ci * 9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and 13e0dac50fSopenharmony_ci * limitations under the License. 14e0dac50fSopenharmony_ci */ 15e0dac50fSopenharmony_ci 16e0dac50fSopenharmony_ci#ifndef OHOS_ROSEN_STARTING_WINDOW_H 17e0dac50fSopenharmony_ci#define OHOS_ROSEN_STARTING_WINDOW_H 18e0dac50fSopenharmony_ci 19e0dac50fSopenharmony_ci#include <refbase.h> 20e0dac50fSopenharmony_ci#include "pixel_map.h" 21e0dac50fSopenharmony_ci#include "animation_config.h" 22e0dac50fSopenharmony_ci#include "surface_draw.h" 23e0dac50fSopenharmony_ci#include "wm_common.h" 24e0dac50fSopenharmony_ci#include "window_node.h" 25e0dac50fSopenharmony_ci#include "window_root.h" 26e0dac50fSopenharmony_ci#include "window_transition_info.h" 27e0dac50fSopenharmony_ci 28e0dac50fSopenharmony_cinamespace OHOS { 29e0dac50fSopenharmony_cinamespace Rosen { 30e0dac50fSopenharmony_ci 31e0dac50fSopenharmony_ciclass StartingWindow : public RefBase { 32e0dac50fSopenharmony_cipublic: 33e0dac50fSopenharmony_ci StartingWindow() = delete; 34e0dac50fSopenharmony_ci ~StartingWindow() = default; 35e0dac50fSopenharmony_ci 36e0dac50fSopenharmony_ci static sptr<WindowNode> CreateWindowNode(const sptr<WindowTransitionInfo>& info, uint32_t winId); 37e0dac50fSopenharmony_ci static void HandleClientWindowCreate(sptr<WindowNode>& node, sptr<IWindow>& window, 38e0dac50fSopenharmony_ci uint32_t& windowId, const std::shared_ptr<RSSurfaceNode>& surfaceNode, sptr<WindowProperty>& property, 39e0dac50fSopenharmony_ci int32_t pid, int32_t uid); 40e0dac50fSopenharmony_ci static WMError DrawStartingWindow(sptr<WindowNode>& node, std::shared_ptr<Media::PixelMap> pixelMap, 41e0dac50fSopenharmony_ci uint32_t bkgColor, bool isColdStart); 42e0dac50fSopenharmony_ci static void AddNodeOnRSTree(sptr<WindowNode>& node, bool isMultiDisplay); 43e0dac50fSopenharmony_ci static void ReleaseStartWinSurfaceNode(sptr<WindowNode>& node); 44e0dac50fSopenharmony_ci static void SetDefaultWindowMode(WindowMode defaultMode); 45e0dac50fSopenharmony_ci static void SetAnimationConfig(AnimationConfig config); 46e0dac50fSopenharmony_ci static bool transAnimateEnable_; 47e0dac50fSopenharmony_ci static WindowUIType windowUIType_; 48e0dac50fSopenharmony_ci 49e0dac50fSopenharmony_ciprivate: 50e0dac50fSopenharmony_ci static WMError CreateLeashAndStartingSurfaceNode(sptr<WindowNode>& node); 51e0dac50fSopenharmony_ci static WMError SetStartingWindowAnimation(wptr<WindowNode> weak); 52e0dac50fSopenharmony_ci static void ChangePropertyByApiVersion(const sptr<WindowTransitionInfo>& info, 53e0dac50fSopenharmony_ci const Orientation orientation, sptr<WindowProperty>& property); 54e0dac50fSopenharmony_ci static std::recursive_mutex mutex_; 55e0dac50fSopenharmony_ci static WindowMode defaultMode_; 56e0dac50fSopenharmony_ci static AnimationConfig animationConfig_; 57e0dac50fSopenharmony_ci static bool IsWindowFollowParent(WindowType type); 58e0dac50fSopenharmony_ci static sptr<WindowProperty> InitializeWindowProperty(const sptr<WindowTransitionInfo>& info, uint32_t winId); 59e0dac50fSopenharmony_ci static void UpdateRSTree(sptr<WindowNode>& node, bool isMultiDisplay); 60e0dac50fSopenharmony_ci}; 61e0dac50fSopenharmony_ci} // Rosen 62e0dac50fSopenharmony_ci} // OHOS 63e0dac50fSopenharmony_ci#endif // OHOS_ROSEN_STARTING_WINDOW_H 64