Lines Matching refs:OHOS

43 using namespace OHOS;
44 using namespace OHOS::Ace;
51 class PreviewerListener : public OHOS::Rosen::IWindowSystemBarEnableListener {
53 OHOS::Rosen::WMError OnSetSpecificBarProperty(OHOS::Rosen::WindowType type,
54 const OHOS::Rosen::SystemBarProperty& property)
57 return OHOS::Rosen::WMError::WM_OK;
62 OHOS::sptr<PreviewerListener> listener = nullptr;
68 windowModel = std::make_shared<OHOS::Previewer::PreviewerWindowModel>();
86 OHOS::AppExecFwk::EventHandler::SetMainThreadId(std::this_thread::get_id());
91 OHOS::AppExecFwk::EventHandler::Run();
135 OHOS::AppExecFwk::EventHandler::PostTask([this]() {
161 void JsAppImpl::SetJsAppArgs(OHOS::Ace::Platform::AceRunArgs& args)
169 OHOS::Rosen::FoldStatus::FOLDED ? screenInfo.foldWidth : screenInfo.orignalResolutionWidth);
171 OHOS::Rosen::FoldStatus::FOLDED ? screenInfo.foldHeight : screenInfo.orignalResolutionHeight);
187 OHOS::Rosen::FoldStatus::FOLDED ? screenInfo.foldWidth : screenInfo.orignalResolutionWidth);
205 OHOS::Ide::StageContext::GetInstance().SetLoaderJsonPath(commandInfo.loaderJsonPath);
206 OHOS::Ide::StageContext::GetInstance().SetHosSdkPath(commandInfo.containerSdkPath);
207 OHOS::Ide::StageContext::GetInstance().GetModulePathMapFromLoaderJson();
208 OHOS::Previewer::PreviewerDisplay::GetInstance().SetFoldable(screenInfo.foldable);
209 OHOS::Previewer::PreviewerDisplay::GetInstance().SetFoldStatus(ConvertFoldStatus(screenInfo.foldStatus));
235 auto data = OHOS::Ide::StageContext::GetInstance().GetModuleBuffer(inputPath);
253 OHOS::Rosen::WMError errCode;
254 OHOS::sptr<OHOS::Rosen::WindowOption> sp = nullptr;
255 auto window = OHOS::Rosen::Window::Create("previewer", sp, nullptr, errCode);
256 window->RegisterSystemBarEnableListener(sptr<OHOS::Rosen::IWindowSystemBarEnableListener>(listener));
269 OHOS::Previewer::PreviewerWindow::GetInstance().SetWindowParams(*windowModel);
271 OHOS::AbilityRuntime::Options options;
273 simulator = OHOS::AbilityRuntime::Simulator::Create(options);
306 OHOS::Rosen::Window* window = OHOS::Previewer::PreviewerWindow::GetInstance().GetWindowObject();
311 window->RegisterSystemBarEnableListener(sptr<OHOS::Rosen::IWindowSystemBarEnableListener>(listener));
317 void JsAppImpl::SetSimulatorParams(OHOS::AbilityRuntime::Options& options)
324 std::optional<std::vector<uint8_t>> ctx = OHOS::Ide::StageContext::GetInstance().ReadFileContents(path);
334 void JsAppImpl::SetSimulatorCommonParams(OHOS::AbilityRuntime::Options& options)
356 OHOS::AbilityRuntime::DeviceConfig deviceCfg;
357 deviceCfg.deviceType = SetDevice<OHOS::AbilityRuntime::DeviceType>(aceRunArgs.deviceConfig.deviceType);
358 deviceCfg.orientation = SetOrientation<OHOS::AbilityRuntime::DeviceOrientation>(
360 deviceCfg.colorMode = SetColorMode<OHOS::AbilityRuntime::ColorMode>(aceRunArgs.deviceConfig.colorMode);
375 std::shared_ptr<AppExecFwk::Configuration> JsAppImpl::UpdateConfiguration(OHOS::Ace::Platform::AceRunArgs& args)
378 configuration->AddItem(OHOS::AAFwk::GlobalConfigurationKey::SYSTEM_LANGUAGE,
384 configuration->AddItem(OHOS::AAFwk::GlobalConfigurationKey::SYSTEM_COLORMODE, colorMode);
389 configuration->AddItem(OHOS::AppExecFwk::ConfigurationInner::APPLICATION_DIRECTION, direction);
391 configuration->AddItem(OHOS::AppExecFwk::ConfigurationInner::APPLICATION_DENSITYDPI, density);
404 windowModel->deviceType = SetDevice<OHOS::Previewer::DeviceType>(aceRunArgs.deviceConfig.deviceType);
405 windowModel->orientation = SetOrientation<OHOS::Previewer::Orientation>(aceRunArgs.deviceConfig.orientation);
406 windowModel->colorMode = SetColorMode<OHOS::Previewer::ColorMode>(aceRunArgs.deviceConfig.colorMode);
611 OHOS::Ace::ViewportConfig config;
615 OHOS::Previewer::PreviewerWindow::TransOrientation(windowModel->orientation)));
617 OHOS::Rosen::Window* window = OHOS::Previewer::PreviewerWindow::GetInstance().GetWindowObject();
623 OHOS::AppExecFwk::EventHandler::PostTask([this]() {
632 OHOS::AppExecFwk::EventHandler::PostTask([this]() {
755 void JsAppImpl::ParseSystemParams(OHOS::Ace::Platform::AceRunArgs& args, const Json2::Value& paramObj)
784 void JsAppImpl::SetSystemParams(OHOS::Ace::Platform::SystemParams& params, const Json2::Value& paramObj)
805 OHOS::Ace::Platform::SystemParams params;
818 OHOS::AppExecFwk::EventHandler::PostTask([this]() {
829 void JsAppImpl::DispatchKeyEvent(const std::shared_ptr<OHOS::MMI::KeyEvent>& keyEvent) const
833 OHOS::Rosen::Window* window = OHOS::Previewer::PreviewerWindow::GetInstance().GetWindowObject();
844 void JsAppImpl::DispatchPointerEvent(const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent) const
848 OHOS::Rosen::Window* window = OHOS::Previewer::PreviewerWindow::GetInstance().GetWindowObject();
859 void JsAppImpl::DispatchAxisEvent(const std::shared_ptr<OHOS::MMI::AxisEvent>& axisEvent) const
868 std::string JsAppImpl::GetDeviceTypeName(const OHOS::Ace::DeviceType type) const
889 glfwRenderContext = OHOS::Rosen::GlfwRenderContext::GetGlobal();
921 OHOS::Rosen::FoldStatus status = ConvertFoldStatus(commandFoldStatus);
923 OHOS::Previewer::PreviewerDisplay::GetInstance().SetFoldStatus(status);
924 OHOS::Previewer::PreviewerDisplay::GetInstance().ExecStatusChangedCallback();
925 if (status == OHOS::Rosen::FoldStatus::UNKNOWN) {
933 OHOS::Rosen::FoldStatus JsAppImpl::ConvertFoldStatus(std::string value) const
935 OHOS::Rosen::FoldStatus foldStatus = OHOS::Rosen::FoldStatus::EXPAND;
937 foldStatus = OHOS::Rosen::FoldStatus::FOLDED;
939 foldStatus = OHOS::Rosen::FoldStatus::EXPAND;
941 foldStatus = OHOS::Rosen::FoldStatus::HALF_FOLD;
943 foldStatus = OHOS::Rosen::FoldStatus::UNKNOWN;
953 void JsAppImpl::CalculateAvoidAreaByType(OHOS::Rosen::WindowType type,
954 const OHOS::Rosen::SystemBarProperty& property)
958 OHOS::Rosen::Window* window = GetWindow();
963 sptr<OHOS::Rosen::AvoidArea> statusArea(new(std::nothrow) OHOS::Rosen::AvoidArea());
965 ELOG("new OHOS::Rosen::AvoidArea failed");
968 if (OHOS::Rosen::WindowType::WINDOW_TYPE_STATUS_BAR == type) {
971 window->UpdateAvoidArea(statusArea, OHOS::Rosen::AvoidAreaType::TYPE_SYSTEM);
974 window->UpdateAvoidArea(statusArea, OHOS::Rosen::AvoidAreaType::TYPE_SYSTEM);
977 } else if (OHOS::Rosen::WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR == type) {
981 window->UpdateAvoidArea(statusArea, OHOS::Rosen::AvoidAreaType::TYPE_NAVIGATION_INDICATOR);
984 window->UpdateAvoidArea(statusArea, OHOS::Rosen::AvoidAreaType::TYPE_NAVIGATION_INDICATOR);
992 void JsAppImpl::UpdateAvoidArea2Ide(const std::string& key, const OHOS::Rosen::Rect& value)
1004 OHOS::Rosen::Window* JsAppImpl::GetWindow() const
1008 return OHOS::Previewer::PreviewerWindow::GetInstance().GetWindowObject();
1017 void JsAppImpl::InitAvoidAreas(OHOS::Rosen::Window* window)
1019 CalculateAvoidAreaByType(OHOS::Rosen::WindowType::WINDOW_TYPE_STATUS_BAR,
1020 window->GetSystemBarPropertyByType(OHOS::Rosen::WindowType::WINDOW_TYPE_STATUS_BAR));
1021 CalculateAvoidAreaByType(OHOS::Rosen::WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR,
1022 window->GetSystemBarPropertyByType(OHOS::Rosen::WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR));
1087 OHOS::Rosen::Window* window = GetWindow();
1089 window->UnRegisterSystemBarEnableListener(sptr<OHOS::Rosen::IWindowSystemBarEnableListener>(listener));
1102 OHOS::Ide::StageContext::GetInstance().ReleaseHspBuffers();