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