screenshot: add permission denied error return 98/205298/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 2 May 2019 05:41:56 +0000 (14:41 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 2 May 2019 05:41:59 +0000 (14:41 +0900)
Change-Id: If3f3477b9e085584ed767780649f6f6b2ef2814b
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
include/efl_util.h.in
include/efl_util_screenshot_extension.h
src/efl_util.c

index b248cb63defd819fe0659e8e1070b981709fc8a0..202ce023edf2ca1a12c3a40052c20f6eba13f684 100644 (file)
@@ -429,6 +429,7 @@ typedef struct _efl_util_screenshot_h * efl_util_screenshot_h;
  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
  * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
+ * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
  * @see efl_util_screenshot_deinitialize()
  */
 API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height);
@@ -447,6 +448,7 @@ API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height);
  * @exception #EFL_UTIL_ERROR_NONE Successful
  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
  * @exception #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
+ * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
  * @see efl_util_screenshot_initialize()
  * @see efl_util_screenshot_deinitialize()
  */
@@ -462,6 +464,7 @@ API tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h scr
  * @return @c 0 on success, otherwise a negative error value
  * @retval #EFL_UTIL_ERROR_NONE Successful
  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
  * @see efl_util_screenshot_initialize()
  */
 API int efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot);
index 6a150aa3705a4f212d8abd275c570d5feb5f7bf4..9860bb8c388fd9fa30bc9768c4de4b23b2e9dca6 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
  * @return @c 0 on success, otherwise a negative error value
  * @retval #EFL_UTIL_ERROR_NONE Successful
  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
  * @see efl_util_screenshot_get_auto_rotation()
  */
 API int efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set);
@@ -64,6 +65,7 @@ API int efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot,
  * @return @c 0 on success, otherwise a negative error value
  * @retval #EFL_UTIL_ERROR_NONE Successful
  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
  * @see efl_util_screenshot_set_auto_rotation()
  */
 API int efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set);
index c1a2f38d867a4cd7e8a2a28c13788853859d47fb..46d35dc4cf0e7ce6e3ddf7b7cca220d5a8e0f99d 100644 (file)
@@ -2005,7 +2005,10 @@ fail_init:
         _screenshot_mutex_unlock();
         efl_util_screenshot_deinitialize(screenshot);
      }
-   set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
+   if (_eflutil.wl.shot.noti == 0)
+     set_last_result(EFL_UTIL_ERROR_PERMISSION_DENIED);
+   else
+     set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
    return NULL;
 /* LCOV_EXCL_STOP */
 }