DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE, /**< Rotate with counter clockwise direction */
} device_display_rotation_direction_e;
+
+/**
+ * @brief Enumeration for the display initial direction.
+ * Initial direction means the display direction of degree 0.
+ * @since_tizen 7.0
+ */
+typedef enum
+{
+ DEVICE_DISPLAY_INIT_DIRECTION_HORIZONTAL, /**< Display initial direction is horizontal */
+ DEVICE_DISPLAY_INIT_DIRECTION_VERTICAL, /**< Display initial direction is vertical */
+} device_display_init_direction_e;
+
+
/**
* @brief Gets the display brightness value.
* @since_tizen @if MOBILE 5.0 @elseif WEARABLE 5.0 @endif
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90\n
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180\n
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270\n
+ * @param[out] init_direction The type is display initial direction
+ * When the rotation angle is 0 degree, initial direction means the display is a horizontal or vertical.\n
+ * DEVICE_DISPLAY_INIT_DIRECTION_HORIZONTAL\n
+ * DEVICE_DISPLAY_INIT_DIRECTION_VERTICAL\n
* @return @c 0 on success,
* otherwise a negative error value
* @retval #DEVICE_ERROR_NONE Successful
* @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
* @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
*/
-int device_display_get_rotation_angle(int display_index, device_display_rotation_angle_e *angle);
+int device_display_get_rotation_angle(int display_index,
+ device_display_rotation_angle_e *angle,
+ device_display_init_direction_e *init_direction);
/**
* @brief Set display rotation angle
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90\n
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180\n
* DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270\n
- * @param[in] direction The type is display rotation direction\n
+ * @param[in] rotation_direction The type is display rotation direction\n
* DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE\n
* DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE\n
* @return @c 0 on success,
* @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
* @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
*/
-int device_display_set_rotation_angle(int display_index, device_display_rotation_angle_e angle, device_display_rotation_direction_e direction);
+int device_display_set_rotation_angle(int display_index,
+ device_display_rotation_angle_e angle,
+ device_display_rotation_direction_e rotation_direction);
/**
* @platform
return display_sensor_listener_stop();
}
-int device_display_get_rotation_angle(int display_index, int *angle)
+int device_display_get_rotation_angle(int display_index,
+ device_display_rotation_angle_e *angle,
+ device_display_init_direction_e *init_direction)
{
- int ret = 0, reply_val = 0;
+ int ret = 0, reply_angle, reply_init_direction;
GVariant *reply;
ret = is_feature_display_supported();
return ret;
}
- if (display_index < 0 || display_index >= display_cnt || !angle)
+ if (display_index < 0 || display_index >= display_cnt || !angle || !init_direction)
return DEVICE_ERROR_INVALID_PARAMETER;
/* Get the display rotation angle from deviced */
return ret;
}
- g_variant_get(reply, "(ii)", &ret, &reply_val);
+ g_variant_get(reply, "(iii)", &ret, &reply_angle, &reply_init_direction);
g_variant_unref(reply);
if (ret < 0 && ret != -ENODEV) {
_E("Failed to get display rotation angle");
return ret;
} else if (ret >= 0) {
- *angle = reply_val;
+ *angle = reply_angle;
+ *init_direction = reply_init_direction;
return DEVICE_ERROR_NONE;
}
* If the device don't support display rotation,
* get the display rotation angle using capi-system-sensor.
*/
+ *init_direction = DEVICE_DISPLAY_INIT_DIRECTION_VERTICAL;
return sensor_get_rotation_angle(angle);
}
int device_display_set_rotation_angle(int display_index,
device_display_rotation_angle_e angle,
- device_display_rotation_direction_e direction)
+ device_display_rotation_direction_e rotation_direction)
{
int ret, reply;
|| angle > ROTATION_ANGLE_DEGREE_MAX)
return DEVICE_ERROR_INVALID_PARAMETER;
- switch (direction) {
+ switch (rotation_direction) {
case DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE:
case DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE:
break;
DEVICED_PATH_DISPLAY,
DEVICED_INTERFACE_DISPLAY,
METHOD_SET_ROTATION_ANGLE,
- g_variant_new("(iii)", display_index, angle, direction),
+ g_variant_new("(iii)", display_index, angle, rotation_direction),
&reply);
if (ret < 0) {