From 8dd3f8f264045463fd77794b69c05e0118c48a2e Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Wed, 2 Oct 2024 16:03:11 +0900 Subject: [PATCH] touchscreen: Enhance API description To improve readability and facilitate comprehension, more detailed API descriptions are added. Change-Id: Iffbc72a31817dff1d0964c33fea027294b9bc594 Signed-off-by: Yunhee Seo --- include/touchscreen-internal.h | 110 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/include/touchscreen-internal.h b/include/touchscreen-internal.h index 2e47139..1cea068 100644 --- a/include/touchscreen-internal.h +++ b/include/touchscreen-internal.h @@ -1,10 +1,120 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 __TIZEN_SYSTEM_TOUCHSCREEN_INTERNAL_H__ #define __TIZEN_SYSTEM_TOUCHSCREEN_INTERNAL_H__ #include #include +/** + * @brief Enables the current device's touchscreen device to start. + * @details Enables the touchscreen device and registers a callback function to be invoked when the operation is completed asynchronously. + * @since_tizen 6.0 + * @remarks Ensure the callback @a cb signature is the as described below. + * @param[in] cb The callback function to be called when the operation is completed. + * The callback function should have the following signature: + * void callback(GVariant *result, void *data, GError *err); + * @return 0 on success, otherwise a negative error value. + * @retval #DEVICE_ERROR_NONE Successful + * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied + * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed + * @code + * #include + * ... + * void dbus_cb(GVariant *result, void *data, GError *err) + * { + * int temp = 0; + * + * if (!result) { + * _E("Can't get result of touchscreen enable request.:%s", err->message); + * return; + * } + * if (!g_variant_get_safe(result, "(i)", &temp)) { + * _E("Failed to get variant(%s): no call back message", g_variant_get_type_string(result)); + * goto out; + * } + * _I("replay message(%d)", temp); + * out: + * g_variant_unref(result); + * } + * ... + * int main(void) + * { + * int ret = 0; + * + * ret = device_touchscreen_enable(dbus_cb); + * ... + * return 0; + * } + * ... + * @endcode + * @see device_touchscreen_disable() + */ int device_touchscreen_enable(dbus_pending_cb cb); + +/** + * @brief Disables the current device's touchscreen device to stop. + * @details Disables the touchscreen device and registers a callback function to be invoked when the operation is completed asynchronously. + * @since_tizen 6.0 + * @remarks Ensure the callback @a cb signature is the as described below. + * @param[in] cb The callback function to be called when the operation is completed. + * The callback function should have the following signature: + * void callback(GVariant *result, void *data, GError *err); + * @return 0 on success, otherwise a negative error value. + * @retval #DEVICE_ERROR_NONE Successful + * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied + * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed + * @code + * #include + * ... + * void dbus_cb(GVariant *result, void *data, GError *err) + * { + * int temp = 0; + * + * if (!result) { + * _E("Can't get result of touchscreen device api request.:%s", err->message); + * return; + * } + * if (!g_variant_get_safe(result, "(i)", &temp)) { + * _E("Failed to get variant(%s): no call back message", g_variant_get_type_string(result)); + * goto out; + * } + * _I("replay message(%d)", temp); + * out: + * g_variant_unref(result); + * } + * ... + * int main(void) + * { + * int ret = 0; + * + * ret = device_touchscreen_enable(dbus_cb); + * if (ret == DEVICE_ERROR_NONE) { + * ... + * ret = device_touchscreen_disable(dbus_cb); + * } + * return 0; + * } + * ... + * @endcode + * @see device_touchscreen_enable() + */ int device_touchscreen_disable(dbus_pending_cb cb); #endif -- 2.7.4