Support internal size types 62/234862/5
authorhyunho <hhstark.kang@samsung.com>
Fri, 29 May 2020 08:47:47 +0000 (17:47 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 1 Jun 2020 08:05:38 +0000 (17:05 +0900)
Change-Id: Id60fb0e9bea27ce27f9e4359be4efa2d85bc57f1
Signed-off-by: hyunho <hhstark.kang@samsung.com>
include/widget_service_internal.h
src/widget_service.c

index a9a8251..061d091 100644 (file)
@@ -65,6 +65,22 @@ extern "C" {
 #define WIDGET_EVENT_WIDGET_EXTRA_BUFFER_DESTROYED 24 /**< WIDGET Extra Buffer destroyed event */
 #define WIDGET_EVENT_GBAR_EXTRA_BUFFER_DESTROYED 25 /**< WIDGET Extra Buffer destroyed event */
 
+
+/**
+ * @brief Enumeration for list of supporting widget size types.
+ * @since_tizen 6.0
+ */
+typedef enum widget_size_internal_type {
+       WIDGET_SIZE_TYPE_3x1 = 0x010000, /**< 480x126 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_3x3 = 0x020000, /**< 480x426 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_3x6 = 0x040000, /**< 480x876 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_6x3 = 0x080000, /**< 984x426 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_6x6 = 0x100000, /**< 984x876 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_6x12 = 0x200000, /**< 984x1776 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_2x6 = 0x400000, /**< 360x876 based on 1080x1920 resolution */
+       WIDGET_SIZE_TYPE_6x4 = 0x800000, /**< 876x600 based on 1080x1920 resolution */
+} widget_size_internal_type_e;
+
 /**
  * @internal
  * @brief specify the source of input event
index 1fe054b..529aa22 100644 (file)
@@ -499,7 +499,7 @@ static void _get_column_double(sqlite3_stmt *stmt, int idx, double *i)
        *i = sqlite3_column_double(stmt, idx);
 }
 
-#define WIDGET_SIZE_TYPE_MAX 13
+#define WIDGET_SIZE_TYPE_MAX 21
 static int size_list[WIDGET_SIZE_TYPE_MAX][5] = {
        { 1, 1, 175, 175, WIDGET_SIZE_TYPE_1x1 }, /*!< 1x1 */
        { 2, 1, 354, 175, WIDGET_SIZE_TYPE_2x1 }, /*!< 2x1 */
@@ -514,6 +514,14 @@ static int size_list[WIDGET_SIZE_TYPE_MAX][5] = {
        { 23, 21, 680, 215, WIDGET_SIZE_TYPE_EASY_3x1 }, /*!< 23x21 */
        { 23, 23, 680, 653, WIDGET_SIZE_TYPE_EASY_3x3 }, /*!< 23x23 */
        { 0, 0, 720, 1280, WIDGET_SIZE_TYPE_FULL }, /*!< 0x0 */
+       { 3, 1, 480, 126, WIDGET_SIZE_TYPE_3x1 }, /*!< 3x1 */
+       { 3, 3, 480, 426, WIDGET_SIZE_TYPE_3x3 }, /*!< 3x3 */
+       { 3, 6, 480, 876, WIDGET_SIZE_TYPE_3x6 }, /*!< 3x6 */
+       { 6, 3, 984, 426, WIDGET_SIZE_TYPE_6x3 }, /*!< 6x3 */
+       { 6, 6, 984, 876, WIDGET_SIZE_TYPE_6x6 }, /*!< 6x6 */
+       { 6, 12, 720, 1280, WIDGET_SIZE_TYPE_6x12 }, /*!< 6x12 */
+       { 2, 6, 360, 876, WIDGET_SIZE_TYPE_2x6 }, /*!< 2x6 */
+       { 6, 4, 876, 600, WIDGET_SIZE_TYPE_6x4 }, /*!< 6x4 */
 };
 
 static char *_resolution_file_path(void)
@@ -592,6 +600,22 @@ static void _resolution_update_size_list(int width_type, int height_type, int wi
                idx = 11;
        } else if (width_type == 0 && height_type == 0) {
                idx = 12;
+       } else if (width_type == 3 && height_type == 1) {
+               idx = 13;
+       } else if (width_type == 3 && height_type == 3) {
+               idx = 14;
+       } else if (width_type == 3 && height_type == 6) {
+               idx = 15;
+       } else if (width_type == 6 && height_type == 3) {
+               idx = 16;
+       } else if (width_type == 6 && height_type == 6) {
+               idx = 17;
+       } else if (width_type == 6 && height_type == 12) {
+               idx = 18;
+       } else if (width_type == 2 && height_type == 6) {
+               idx = 19;
+       } else if (width_type == 6 && height_type == 4) {
+               idx = 20;
        } else {
                _E("Unknown size type: %dx%d (%dx%d)\n", width_type, height_type, width, height);
                return;
@@ -599,6 +623,8 @@ static void _resolution_update_size_list(int width_type, int height_type, int wi
 
        size_list[idx][2] = width;
        size_list[idx][3] = height;
+
+       _I("size type(%d): %dx%d (%dx%d)\n", idx, width_type, height_type, width, height);
 }
 
 static int _resolution_update_from_file(void)