diff --git a/graphic/graphic_2d/native_hgm/BUILD.gn b/graphic/graphic_2d/native_hgm/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..b997d65d07c15d9a4fbbeb5eb8c2e5a5998ed06f --- /dev/null +++ b/graphic/graphic_2d/native_hgm/BUILD.gn @@ -0,0 +1,30 @@ +# 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. + +import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("native_hgm_header") { + dest_dir = "$ndk_headers_out_dir/native_hgm" + sources = [ + "//interface/sdk_c/graphic/graphic_2d/native_hgm/native_hgm.h", + ] +} + +ohos_ndk_library("libnative_hgm_ndk") { + output_name = "native_hgm" + output_extension = "so" + ndk_description_file = "./libnative_hgm.ndk.json" + system_capability = "SystemCapability.Graphic.Graphic2D.NativeHgm" + system_capability_headers = [ "native_hgm/native_hgm.h" ] +} diff --git a/graphic/graphic_2d/native_hgm/libnative_hgm.ndk.json b/graphic/graphic_2d/native_hgm/libnative_hgm.ndk.json new file mode 100644 index 0000000000000000000000000000000000000000..c93fd9f1eb0fad1192724d3a4831b0ad7a65fb81 --- /dev/null +++ b/graphic/graphic_2d/native_hgm/libnative_hgm.ndk.json @@ -0,0 +1,6 @@ +[ + { "name": "OH_NativeHgm_SetRefreshRateMode" }, + { "name": "OH_NativeHgm_GetScreenCurrentRefreshRate" }, + { "name": "OH_NativeHgm_GetCurrentRefreshRateMode" }, + { "name": "OH_NativeHgm_GetScreenSupportedRefreshRates" } +] \ No newline at end of file diff --git a/graphic/graphic_2d/native_hgm/native_hgm.h b/graphic/graphic_2d/native_hgm/native_hgm.h new file mode 100644 index 0000000000000000000000000000000000000000..3f9d70a3c5995064ddd1d05f52996b1a43e5bed0 --- /dev/null +++ b/graphic/graphic_2d/native_hgm/native_hgm.h @@ -0,0 +1,94 @@ +/* + * 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 NATIVE_HYPER_GRAPHIC_MANAGER_H_ +#define NATIVE_HYPER_GRAPHIC_MANAGER_H_ + +/** + * @addtogroup NativeHgm + * @{ + * + * @brief Provides the native hyper_graphic_manager capability. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeHgm + * @since 10 + * @version 1.0 + */ + +/** + * @file native_hgm.h + * + * @brief Defines the functions for obtaining and using a native hyper_graphic_manager. + * + * @library libnative_hgm.so + * @since 10 + * @version 1.0 + */ +#include +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Creates a NativeHgm instance.\n + * A new NativeHgm instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeHgm + * @param screen Indicates screenId. + * @since 10 + * @version 1.0 + */ +void OH_NativeHgm_SetRefreshRateMode(int32_t mode); + +/** + * @brief Creates a NativeHgm instance.\n + * A new NativeHgm instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeHgm + * @param screen Indicates screenId. + * @return Returns int32_t, return value == 0, success, otherwise, failed. + * @since 10 + * @version 1.0 + */ +int32_t OH_NativeHgm_GetScreenCurrentRefreshRate(int32_t screen); + +/** + * @brief Creates a NativeHgm instance.\n + * A new NativeHgm instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeHgm + * @return Returns int32_t, return value == 0, success, otherwise, failed. + * @since 10 + * @version 1.0 + */ +int32_t OH_NativeHgm_GetCurrentRefreshRateMode(); + +/** + * @brief Creates a NativeHgm instance.\n + * A new NativeHgm instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeHgm + * @param screen Indicates the hyper_graphic_manager connection name. + * @return Returns int32_t*. + * @since 10 + * @version 1.0 + */ +int32_t* OH_NativeHgm_GetScreenSupportedRefreshRates(int32_t screen); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file