1 /* 2 * Copyright (c) 2021 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 FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ANIMATION_SERVER_H 17 #define FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ANIMATION_SERVER_H 18 19 #include <atomic> 20 #include <functional> 21 #include <unistd.h> 22 23 #include <promise.h> 24 #include <raw_parser.h> 25 #include <vsync_helper.h> 26 #include <window_manager.h> 27 #include <window_manager_service_client.h> 28 29 #include "animation_service_stub.h" 30 #include "animation_module.h" 31 32 namespace OHOS { 33 class AnimationServer : public AnimationServiceStub { 34 public: 35 GSError Init(); 36 37 GSError StartRotationAnimation(int32_t did, int32_t degree) override; 38 GSError SplitModeCreateBackground() override; 39 GSError SplitModeCreateMiddleLine() override; 40 GSError CreateLaunchPage(const std::string &filename) override; 41 GSError CancelLaunchPage() override; 42 43 void OnSplitStatusChange(SplitStatus status); 44 45 private: 46 void SplitWindowUpdate(); 47 void SplitWindowDraw(uint32_t *vaddr, uint32_t width, uint32_t height, uint32_t count); 48 49 void LaunchPageWindowUpdate(); 50 51 std::shared_ptr<AppExecFwk::EventHandler> handler = nullptr; 52 AnimationModule animationModule; 53 54 sptr<Window> splitWindow = nullptr; 55 bool haveMiddleLine = false; 56 bool midlineDown = false; 57 int32_t midlineY = -100; 58 sptr<Window> launchPageWindow = nullptr; 59 RawParser resource; 60 sptr<IRemoteObject> token = new IPCObjectStub(u"animation_server"); 61 }; 62 } // namespace OHOS 63 64 #endif // FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ANIMATION_SERVER_H 65