From: Changyeon Lee Date: Tue, 15 Nov 2016 05:33:53 +0000 (+0900) Subject: Added cursor available size in caps output X-Git-Tag: 1.5.0~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=761c8d49c3c3b59d593dd343e1afdee9641a8b69;p=platform%2Fcore%2Fuifw%2Flibtdm.git Added cursor available size in caps output Change-Id: Ief1b42e61b51ba4710430f68b40e48bc3b189844 --- diff --git a/include/tdm.h b/include/tdm.h index ee7b160..7834591 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -358,6 +358,21 @@ tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h, int *max_w, int *max_h, int *preferred_align); /** + * @brief Get the available cursor size of a output object. + * @details -1 means that a TDM backend module doesn't define the value. + * @param[in] output A output object + * @param[out] min_w The minimum width which TDM can handle + * @param[out] min_h The minimum height which TDM can handle + * @param[out] max_w The maximum width which TDM can handle + * @param[out] max_h The maximum height which TDM can handle + * @param[out] preferred_align The preferred align width which TDM can handle + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h, + int *max_w, int *max_h, int *preferred_align); + +/** * @brief Get the physical size of a output object. * @param[in] output A output object * @param[out] mmWidth The milimeter width diff --git a/include/tdm_backend.h b/include/tdm_backend.h index c1c2120..91ee955 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -119,6 +119,12 @@ typedef struct _tdm_caps_output { int preferred_align; /**< The prefered align. -1 means "not defined" */ tdm_output_capability capabilities; /**< The capabilities of output. @since 1.4.1 */ + + int cursor_min_w; /**< The minimun width. -1 means "not defined" @since 1.5.0 */ + int cursor_min_h; /**< The minimun height. -1 means "not defined" @since 1.5.0 */ + int cursor_max_w; /**< The maximum width. -1 means "not defined" @since 1.5.0 */ + int cursor_max_h; /**< The maximum height. -1 means "not defined" @since 1.5.0 */ + int cursor_preferred_align; /**< The prefered align. -1 means "not defined" @since 1.5.0 */ } tdm_caps_output; /** diff --git a/src/tdm_display.c b/src/tdm_display.c index 7d9b08f..975e72f 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -714,6 +714,48 @@ tdm_output_get_available_size(tdm_output *output, int *min_w, int *min_h, } EXTERN tdm_error +tdm_output_get_cursor_available_size(tdm_output *output, int *min_w, int *min_h, + int *max_w, int *max_h, int *preferred_align) +{ + OUTPUT_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + if (!tdm_display_check_module_abi(private_display, 1, 5)) { + + if (min_w) + *min_w = -1; + if (min_h) + *min_h = -1; + if (max_w) + *max_w = -1; + if (max_h) + *max_h = -1; + if (preferred_align) + *preferred_align = -1; + + _pthread_mutex_unlock(&private_display->lock); + + return TDM_ERROR_BAD_MODULE; + } + + if (min_w) + *min_w = private_output->caps.cursor_min_w; + if (min_h) + *min_h = private_output->caps.cursor_min_h; + if (max_w) + *max_w = private_output->caps.cursor_max_w; + if (max_h) + *max_h = private_output->caps.cursor_max_h; + if (preferred_align) + *preferred_align = private_output->caps.cursor_preferred_align; + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_output_get_physical_size(tdm_output *output, unsigned int *mmWidth, unsigned int *mmHeight) {