Add new size type
authorSung-jae Park <nicesj.park@samsung.com>
Sun, 27 Jan 2013 12:32:20 +0000 (12:32 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 27 Jan 2013 12:32:20 +0000 (12:32 +0000)
1x1 = 207x207
3x1 = 645x207
3x3 = 645x645

Change-Id: I36dfc1abf3486aa639f7617ebc821a01baaa7bdd

include/livebox-service.h
packaging/liblivebox-service.spec
src/livebox-service.c

index 7fdd3f0..ada9b53 100644 (file)
 extern "C" {
 #endif
 
-#define NR_OF_SIZE_LIST 7
+#define NR_OF_SIZE_LIST 10
 
 enum livebox_size_type {
-       LB_SIZE_TYPE_1x1 = 0x01,
-       LB_SIZE_TYPE_2x1 = 0x02,
-       LB_SIZE_TYPE_2x2 = 0x04,
-       LB_SIZE_TYPE_4x1 = 0x08,
-       LB_SIZE_TYPE_4x2 = 0x10,
-       LB_SIZE_TYPE_4x3 = 0x20,
-       LB_SIZE_TYPE_4x4 = 0x40,
-       LB_SIZE_TYPE_UNKNOWN = 0xFF,
+       LB_SIZE_TYPE_1x1 = 0x0001,
+       LB_SIZE_TYPE_2x1 = 0x0002,
+       LB_SIZE_TYPE_2x2 = 0x0004,
+       LB_SIZE_TYPE_4x1 = 0x0008,
+       LB_SIZE_TYPE_4x2 = 0x0010,
+       LB_SIZE_TYPE_4x3 = 0x0020,
+       LB_SIZE_TYPE_4x4 = 0x0040,
+       LB_SIZE_TYPE_EASY_1x1 = 0x0100,
+       LB_SIZE_TYPE_EASY_3x1 = 0x0200,
+       LB_SIZE_TYPE_EASY_3x3 = 0x0400,
+       LB_SIZE_TYPE_UNKNOWN = 0xFFFF,
 };
 
 /*!
index b87430a..0b01175 100644 (file)
@@ -1,8 +1,8 @@
 Name: liblivebox-service
-Summary: Library for the development of a livebox service
-Version: 0.2.13
+Summary: Service API for gathering installed livebox information.
+Version: 0.3.0
 Release: 1
-Group: main/app
+Group: framework/livebox
 License: Flora License
 Source0: %{name}-%{version}.tar.gz
 BuildRequires: cmake, gettext-tools, coreutils
@@ -17,7 +17,7 @@ BuildRequires: pkgconfig(x11)
 BuildRequires: pkgconfig(vconf)
 
 %description
-Livebox service library
+Service API for gathering installed livebox information
 
 %package devel
 Summary: Files for livebox service.
@@ -25,7 +25,7 @@ Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
 
 %description devel
-Livebox service library (dev)
+Gathering the installed livebox information.
 
 %prep
 %setup -q
index 6d3477e..5f638d0 100644 (file)
@@ -54,6 +54,9 @@ static struct supported_size_list {
        { 700, 348 }, /*!< 4x2 */
        { 700, 520 }, /*!< 4x3 */
        { 700, 700 }, /*!< 4x4 */
+       { 207, 207 }, /*!< 21x21 */
+       { 645, 207 }, /*!< 23x21 */
+       { 645, 645 }, /*!< 23x23 */
 };
 
 static struct info {
@@ -95,6 +98,15 @@ static inline int update_info(int width_type, int height_type, int width, int he
        } else if (width_type == 4 && height_type == 4) {
                DbgPrint("4x4 Updated to %dx%d\n", width, height);
                idx = 6;
+       } else if (width_type == 21 && height_type == 21) {
+               DbgPrint("Easy 1x1 Updated to %dx%d\n", width, height);
+               idx = 7;
+       } else if (width_type == 23 && height_type == 21) {
+               DbgPrint("Easy 3x1 Updated to %dx%d\n", width, height);
+               idx = 8;
+       } else if (width_type == 23 && height_type == 23) {
+               DbgPrint("Easy 3x3 Updated to %dx%d\n", width, height);
+               idx = 9;
        } else {
                ErrPrint("Unknown size type: %dx%d (%dx%d)\n", width_type, height_type, width, height);
                return 0;
@@ -324,6 +336,15 @@ static inline int convert_size_from_type(enum livebox_size_type type, int *width
        case LB_SIZE_TYPE_4x4: /*!< 700x700 */
                idx = 6;
                break;
+       case LB_SIZE_TYPE_EASY_1x1: /*< 207x207 */
+               idx = 7;
+               break;
+       case LB_SIZE_TYPE_EASY_3x1: /*!< 645x207 */
+               idx = 8;
+               break;
+       case LB_SIZE_TYPE_EASY_3x3: /*!< 645x645 */
+               idx = 9;
+               break;
        default:
                return -EINVAL;
        }
@@ -1694,6 +1715,12 @@ EAPI int livebox_service_size_type(int width, int height)
                return LB_SIZE_TYPE_4x3;
        case 6:
                return LB_SIZE_TYPE_4x4;
+       case 7:
+               return LB_SIZE_TYPE_EASY_1x1;
+       case 8:
+               return LB_SIZE_TYPE_EASY_3x1;
+       case 9:
+               return LB_SIZE_TYPE_EASY_3x3;
        default:
                break;
        }