Update icon layout and font change event handler for utility service.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 13 Jun 2013 01:01:22 +0000 (10:01 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 13 Jun 2013 01:21:45 +0000 (10:21 +0900)
[model] Tizen
[binary_type] AP
[customer] Tizen Developer
[issue#] N/A
[problem] Icon text style is not changed. Layout is updated.
[cause] UX is changed. Font change event handler is not registered.
[solution] Update Icon layout. register the font change event handler.
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: If59c67b250170de9e24be8d2b394a8982af92bbe

data/icon.edc
data/icon_shadow.png
data/shortcut_bg_1x1.png [new file with mode: 0644]
icon_src/main.c
icon_src/script_handler.c
include/debug.h
org.tizen.data-provider-slave.rule
packaging/org.tizen.data-provider-slave.spec
src/conf.c
src/main.c

index 177a503..cbf17ae 100644 (file)
@@ -16,6 +16,7 @@
 
 images {
        image: "icon_shadow.png" COMP;
+       image: "shortcut_bg_1x1.png" COMP;
 }
 
 collections {
@@ -23,12 +24,23 @@ collections {
                name: "default,1x1";
                parts {
                        part {
+                               name: "box,bg";
+                               type: IMAGE;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "shortcut_bg_1x1.png"; }
+                               }
+                       }
+
+                       part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 27/175 13/175; }
-                                       rel2 { relative: 148/175 134/175; }
+                                       rel1 { relative: 23/175 11/175; }
+                                       rel2 { relative: 152/175 140/175; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -36,12 +48,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 11/175 135/175; }
+                                       rel2 { relative: 166/175 169/175; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -50,10 +79,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 8/175 134/175; }
-                                       rel2 { relative: 167/175 162/175; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 10/175 133/175; }
+                                       rel2 { relative: 165/175 167/175; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -66,15 +95,15 @@ collections {
        }
 
        group {
-               name: "default,2x1";
+               name: "default,2x1"; /* +89.5, 0 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 116.5/354 13/175; }
-                                       rel2 { relative: 237.5/354 134/175; }
+                                       rel1 { relative: 112.5/354 11/175; }
+                                       rel2 { relative: 241.5/354 140/175; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -82,12 +111,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 100.5/354 135/175; }
+                                       rel2 { relative: 255.5/354 169/175; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -96,10 +142,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 97.5/354 134/175; }
-                                       rel2 { relative: 256.5/354 162/175; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 99.5/354 133/175; }
+                                       rel2 { relative: 254.5/354 167/175; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -112,15 +158,15 @@ collections {
        }
 
        group {
-               name: "default,2x2";
+               name: "default,2x2"; /* +89.5, +89.5 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 116.5/354 102.5/354; }
-                                       rel2 { relative: 237.5/354 223.5/354; }
+                                       rel1 { relative: 112.5/354 100.5/354; }
+                                       rel2 { relative: 241.5/354 229.5/354; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -128,12 +174,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 100.5/354 224.5/354; }
+                                       rel2 { relative: 255.5/354 258.5/354; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -142,10 +205,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 97.5/354 223.5/354; }
-                                       rel2 { relative: 256.5/354 251.5/354; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 99.5/354 222.5/354; }
+                                       rel2 { relative: 254.5/354 256.5/354; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -158,15 +221,15 @@ collections {
        }
 
        group {
-               name: "default,4x1";
+               name: "default,4x1"; /* +268.5, 0 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 13/175; }
-                                       rel2 { relative: 416/712 134/175; }
+                                       rel1 { relative: 291.5/712 11/175; }
+                                       rel2 { relative: 420.5/712 140/175; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -174,12 +237,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 135/175; }
+                                       rel2 { relative: 434.5/712 169/175; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -188,10 +268,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 134/175; }
-                                       rel2 { relative: 435.5/712 164/175; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 133/175; }
+                                       rel2 { relative: 433.5/712 167/175; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -204,15 +284,15 @@ collections {
        }
 
        group {
-               name: "default,4x2";
+               name: "default,4x2"; /* +268.5, +89.5 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 102.5/354; }
-                                       rel2 { relative: 416/712 223.5/354; }
+                                       rel1 { relative: 291.5/712 100.5/354; }
+                                       rel2 { relative: 420.5/712 229.5/354; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -220,12 +300,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 224.5/354; }
+                                       rel2 { relative: 434.5/712 258.5/354; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -234,10 +331,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 223/354; }
-                                       rel2 { relative: 435.5/712 253/354; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 222.5/354; }
+                                       rel2 { relative: 433.5/712 256.5/354; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -250,15 +347,15 @@ collections {
        }
 
        group {
-               name: "default,4x3";
+               name: "default,4x3"; /* +268.5, +179 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 192/533; }
-                                       rel2 { relative: 416/712 313/533; }
+                                       rel1 { relative: 291.5/712 190/533; }
+                                       rel2 { relative: 420.5/712 319/533; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -266,12 +363,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 314/533; }
+                                       rel2 { relative: 434.5/712 348/533; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -280,10 +394,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 313/533; }
-                                       rel2 { relative: 435.5/712 341/533; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 312/533; }
+                                       rel2 { relative: 433.5/712 346/533; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -296,15 +410,15 @@ collections {
        }
 
        group {
-               name: "default,4x4";
+               name: "default,4x4"; /* +268.5, +268.5 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 281.5/712; }
-                                       rel2 { relative: 416/712 402.5/712; }
+                                       rel1 { relative: 291.5/712 279.5/712; }
+                                       rel2 { relative: 420.5/712 408.5/712; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -312,12 +426,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 403.5/712; }
+                                       rel2 { relative: 434.5/712 437.5/712; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -326,10 +457,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 402.5/712; }
-                                       rel2 { relative: 435.5/712 430.5/712; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 401.5/712; }
+                                       rel2 { relative: 433.5/712 435.5/712; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -342,15 +473,15 @@ collections {
        }
 
        group {
-               name: "default,4x5";
+               name: "default,4x5"; /* +268.5, +358 , 891 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 371/891; }
-                                       rel2 { relative: 416/712 492/891; }
+                                       rel1 { relative: 291.5/712 369/891; }
+                                       rel2 { relative: 420.5/712 498/891; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -358,12 +489,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 493/891; }
+                                       rel2 { relative: 434.5/712 527/891; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -372,10 +520,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 492/891; }
-                                       rel2 { relative: 435.5/712 520/891; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 491/891; }
+                                       rel2 { relative: 433.5/712 525/891; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
@@ -388,15 +536,15 @@ collections {
        }
 
        group {
-               name: "default,4x6";
+               name: "default,4x6"; /* +268.5, +447.5, 1070 */
                parts {
                        part {
                                name: "bg";
                                type: IMAGE;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 295/712 460.5/1070; }
-                                       rel2 { relative: 416/712 581.5/1070; }
+                                       rel1 { relative: 291.5/712 458.5/1070; }
+                                       rel2 { relative: 420.5/712 587.5/1070; }
                                        image { normal: "icon_shadow.png"; }
                                        align: 0.5 0.5;
                                        aspect: 1.0 1.0;
@@ -404,12 +552,29 @@ collections {
                                }
                        }
 
+                        part {
+                                name: "icon";
+                                type: SWALLOW;
+                                description {
+                                        rel1 { relative: 6/129 3/129; to, "bg"; }
+                                        rel2 { relative: 123/129 120/129; to, "bg"; }
+                               }
+                        }
+
                        part {
-                               name: "icon";
-                               type: SWALLOW;
+                               name: "name,shadow";
+                               type: TEXT;
+                               // effect: FAR_SHADOW
                                description {
-                                       rel1 { relative: 2/121 2/121; to, "bg"; }
-                                       rel2 { relative: 119/121 119/121; to, "bg"; }
+                                       rel1 { relative: 279.5/712 582.5/1070; }
+                                       rel2 { relative: 434.5/712 616.5/1070; }
+                                       color: 0 0 0 102;
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                       }
                                }
                        }
 
@@ -418,10 +583,10 @@ collections {
                                type: TEXT;
                                // effect: FAR_SHADOW;
                                description {
-                                       rel1 { relative: 276.5/712 581.5/1070; }
-                                       rel2 { relative: 435.5/712 609.5/1070; }
-                                       color: 70 70 70 255;
-                                       color3: 255 255 255 153;
+                                       rel1 { relative: 278.5/712 580.5/1070; }
+                                       rel2 { relative: 433.5/712 614.5/1070; }
+                                       color: 255 255 255 255;
+                                       //color3: 255 255 255 153;
                                        text {
                                                font: "Tizen:style=Bold";
                                                text_class: "tizen";
index 7e40ac4..65e836b 100755 (executable)
Binary files a/data/icon_shadow.png and b/data/icon_shadow.png differ
diff --git a/data/shortcut_bg_1x1.png b/data/shortcut_bg_1x1.png
new file mode 100644 (file)
index 0000000..61f8058
Binary files /dev/null and b/data/shortcut_bg_1x1.png differ
index aae3d30..da59e13 100644 (file)
@@ -34,6 +34,7 @@
 #include <Edje.h>
 #include <Eina.h>
 
+#include <vconf.h>
 #include <dlog.h>
 #include <bundle.h>
 #include <livebox-service.h>
 #define DEFAULT_ICON_LAYOUT "/usr/apps/org.tizen.data-provider-slave/res/edje/icon.edj"
 #define DEFAULT_ICON_GROUP "default"
 
+#define TEXT_CLASS     "tizen"
+#define DEFAULT_FONT_SIZE      -100
+
 int script_handler_parse_desc(Evas_Object *edje, const char *descfile);
 
 static struct info {
        Ecore_Timer *ttl_timer;
        int client_fd;
        const char *socket_file;
+       char *font_name;
 } s_info = {
        .ttl_timer = NULL,
        .client_fd = -1,
        .socket_file = UTILITY_ADDR,
+       .font_name = NULL,
 };
 
 #define TTL    30.0f   /* Can alive only 30 seconds from the last event */
@@ -390,8 +396,61 @@ static inline void client_fini(void)
        s_info.client_fd = -1;
 }
 
+static void update_font_cb(void *data)
+{
+       Eina_List *list;
+       char *text;
+
+       list = edje_text_class_list();
+       DbgPrint("List: %p\n", list);
+       if (list) {
+               EINA_LIST_FREE(list, text) {
+                       if (!strncasecmp(text, TEXT_CLASS, strlen(TEXT_CLASS))) {
+                               DbgPrint("Update text class %s (%s, %d)\n", text, s_info.font_name, DEFAULT_FONT_SIZE);
+                               edje_text_class_del(text);
+                               edje_text_class_set(text, s_info.font_name, DEFAULT_FONT_SIZE);
+                       } else {
+                               DbgPrint("Skip text class %s\n", text);
+                       }
+               }
+       } else {
+               DbgPrint("New (%s, %d)\n", s_info.font_name, DEFAULT_FONT_SIZE);
+               edje_text_class_set(TEXT_CLASS, s_info.font_name, DEFAULT_FONT_SIZE);
+       }
+}
+
+static void font_changed_cb(keynode_t *node, void *user_data)
+{
+       char *font_name;
+
+       font_name = vconf_get_str("db/setting/accessibility/font_name");
+       if (!font_name) {
+               ErrPrint("Invalid font name (NULL)\n");
+               return;
+       }
+
+       if (s_info.font_name && !strcmp(s_info.font_name, font_name)) {
+               DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
+               free(font_name);
+               return;
+       }
+
+       if (s_info.font_name) {
+               DbgPrint("Release old font name: %s(%p)\n", s_info.font_name, s_info.font_name);
+               free(s_info.font_name);
+               s_info.font_name = NULL;
+       }
+
+       s_info.font_name = font_name;
+       DbgPrint("Font name is changed to %s(%p)\n", s_info.font_name, s_info.font_name);
+
+       update_font_cb(NULL);
+}
+
 static bool app_create(void *data)
 {
+       int ret;
+
        if (client_init() < 0) {
                ErrPrint("Unable to initiate the client\n");
                return FALSE;
@@ -404,17 +463,28 @@ static bool app_create(void *data)
        if (!s_info.ttl_timer)
                ErrPrint("Unable to register a life timer\n");
 
+       ret = vconf_notify_key_changed("db/setting/accessibility/font_name", font_changed_cb, NULL);
+       DbgPrint("System font is changed: %d\n", ret);
+
+       font_changed_cb(NULL, NULL);
        return TRUE;
 }
 
 static void app_terminate(void *data)
 {
+       int ret;
+
+       ret = vconf_ignore_key_changed("db/setting/accessibility/font_name", font_changed_cb);
+       DbgPrint("Remove font change callback: %d\n", ret);
+
        if (s_info.ttl_timer) {
                ecore_timer_del(s_info.ttl_timer);
                s_info.ttl_timer = NULL;
        }
 
        client_fini();
+
+       free(s_info.font_name);
        return;
 }
 
index 94a6a80..1708220 100644 (file)
@@ -504,12 +504,114 @@ static int update_script_image(Evas_Object *edje, struct block *block)
                                        w = (double)w * fh;
                                }
                        }
-                       DbgPrint("Size: %dx%d\n", w, h);
 
-                       evas_object_image_load_size_set(img, w, h);
-                       evas_object_image_load_region_set(img, (w - part_w) / 2, (h - part_h) / 2, part_w, part_h);
-                       evas_object_image_fill_set(img, 0, 0, part_w, part_h);
-                       evas_object_image_reload(img);
+                       if (!part_w || !part_h || !w || !h) {
+                               evas_object_del(img);
+                               free(child->part);
+                               free(child);
+                               return LB_STATUS_ERROR_INVALID;
+                       }
+
+                       if (evas_object_image_region_support_get(img)) {
+                               evas_object_image_load_region_set(img, (w - part_w) / 2, (h - part_h) / 2, part_w, part_h);
+                               evas_object_image_load_size_set(img, part_w, part_h);
+                               evas_object_image_fill_set(img, 0, 0, part_w, part_h);
+                               DbgPrint("Size: %dx%d (region: %dx%d - %dx%d)\n", w, h, (w - part_w) / 2, (h - part_h) / 2, part_w, part_h);
+                       } else {
+                               Ecore_Evas *ee;
+                               Evas *e;
+                               Evas_Object *src_img;
+                               Evas_Coord rw, rh;
+                               const void *data;
+
+                               DbgPrint("Part loading is not supported\n");
+                               ee = ecore_evas_buffer_new(part_w, part_h);
+                               if (!ee) {
+                                       ErrPrint("Failed to create a EE\n");
+                                       evas_object_del(img);
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_FAULT;
+                               }
+
+                               e = ecore_evas_get(ee);
+                               if (!e) {
+                                       ErrPrint("Unable to get Evas\n");
+                                       ecore_evas_free(ee);
+
+                                       evas_object_del(img);
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_FAULT;
+                               }
+
+                               src_img = evas_object_image_filled_add(e);
+                               if (!src_img) {
+                                       ErrPrint("Unable to add an image\n");
+                                       ecore_evas_free(ee);
+
+                                       evas_object_del(img);
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_FAULT;
+                               }
+
+                               evas_object_image_load_orientation_set(src_img, img_opt.orient);
+                               evas_object_image_file_set(src_img, block->data, NULL);
+                               err = evas_object_image_load_error_get(src_img);
+                               if (err != EVAS_LOAD_ERROR_NONE) {
+                                       ErrPrint("Load error: %s\n", evas_load_error_str(err));
+                                       evas_object_del(src_img);
+                                       ecore_evas_free(ee);
+
+                                       evas_object_del(img);
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_IO;
+                               }
+                               evas_object_image_size_get(src_img, &rw, &rh);
+                               evas_object_image_fill_set(src_img, 0, 0, rw, rh);
+                               evas_object_resize(src_img, w, h);
+                               evas_object_move(src_img, -(w - part_w) / 2, -(h - part_h) / 2);
+                               evas_object_show(src_img);
+
+                               data = ecore_evas_buffer_pixels_get(ee);
+                               if (!data) {
+                                       ErrPrint("Unable to get pixels\n");
+                                       evas_object_del(src_img);
+                                       ecore_evas_free(ee);
+
+                                       evas_object_del(img);
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_IO;
+                               }
+
+                               e = evas_object_evas_get(img);
+                               evas_object_del(img);
+                               img = evas_object_image_filled_add(e);
+                               if (!img) {
+                                       evas_object_del(src_img);
+                                       ecore_evas_free(ee);
+
+                                       free(child->part);
+                                       free(child);
+                                       return LB_STATUS_ERROR_MEMORY;
+                               }
+
+                               evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888);
+                               evas_object_image_smooth_scale_set(img, EINA_TRUE);
+                               evas_object_image_alpha_set(img, EINA_TRUE);
+                               evas_object_image_data_set(img, NULL);
+                               evas_object_image_size_set(img, part_w, part_h);
+                               evas_object_resize(img, part_w, part_h);
+                               evas_object_image_data_copy_set(img, (void *)data);
+                               evas_object_image_fill_set(img, 0, 0, part_w, part_h);
+                               evas_object_image_data_update_add(img, 0, 0, part_w, part_h);
+
+                               evas_object_del(src_img);
+                               ecore_evas_free(ee);
+                       }
                } else if (img_opt.fill == FILL_IN_SIZE) {
                        Evas_Coord part_w;
                        Evas_Coord part_h;
index 7ec29a5..d24ad84 100644 (file)
  * limitations under the License.
  */
 
-#define DbgPrint(format, arg...) LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#if !defined(SECURE_LOGD)
+#define SECURE_LOGD LOGD
+#endif
 
-#define ErrPrint(format, arg...) LOGE("[\e[32m%s/%s\e[0m:%d] \e[33m" format "\e[0m", util_basename(__FILE__), __func__, __LINE__, ##arg)
+#if !defined(SECURE_LOGE)
+#define SECURE_LOGE LOGE
+#endif
 
-#define WarnPrint(format, arg...) LOGW("[\e[32m%s/%s\e[0m:%d] \e[34m" format "\e[0m", util_basename(__FILE__), __func__, __LINE__, ##arg)
+#if !defined(SECURE_LOGW)
+#define SECURE_LOGW LOGW
+#endif
+
+#define DbgPrint(format, arg...) SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+
+#define ErrPrint(format, arg...) SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] \e[33m" format "\e[0m", util_basename(__FILE__), __func__, __LINE__, ##arg)
+
+#define WarnPrint(format, arg...) SECURE_LOGW("[\e[32m%s/%s\e[0m:%d] \e[34m" format "\e[0m", util_basename(__FILE__), __func__, __LINE__, ##arg)
 
 #define DbgFree(a) do { \
        free(a); \
index 863d089..d24231c 100644 (file)
@@ -1,5 +1,7 @@
 org.tizen.data-provider-slave device::app_logging w
 org.tizen.data-provider-slave system::vconf rwxat
+org.tizen.data-provider-slave system::vconf_setting r
+org.tizen.data-provider-slave system::vconf_system r
 org.tizen.data-provider-slave system::homedir rwxat
 org.tizen.data-provider-slave system::use_internet rw
 org.tizen.data-provider-slave system::media rwxat
@@ -14,10 +16,10 @@ org.tizen.data-provider-slave data-provider-master::data rx
 org.tizen.data-provider-slave data-provider-master::share rwxat
 org.tizen.data-provider-slave data-provider-master::db rw
 org.tizen.data-provider-slave data-provider-master rw
+org.tizen.data-provider-slave data-provider-master::utility rw
 org.tizen.data-provider-slave e17 rx
 org.tizen.data-provider-slave pulseaudio rwxat
 org.tizen.data-provider-slave pkgmgr::db rw
-org.tizen.data-provider-slave sys-assert::core rwxat
 e17 org.tizen.data-provider-slave rwx
 dbus org.tizen.data-provider-slave rwx
 org.tizen.data-provider-slave sound_server rw
index 04dd661..fbf84f6 100644 (file)
@@ -2,7 +2,7 @@
 
 Name: org.tizen.data-provider-slave
 Summary: Plugin type livebox service provider.
-Version: 0.11.5
+Version: 0.11.6
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index 4a7ad25..7fe3959 100644 (file)
@@ -508,7 +508,7 @@ HAPI int conf_loader(void)
        do {
                c = getc(fp);
                if ((c == EOF) && (state == VALUE)) {
-                       LOGD("[%s:%d] VALUE state EOF\n", __func__, __LINE__);
+                       DbgPrint("[%s:%d] VALUE state EOF\n", __func__, __LINE__);
                        state = END;
                }
 
index b48d315..c77501b 100644 (file)
@@ -253,8 +253,8 @@ static void app_terminate(void *data)
        ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE);
        DbgPrint("unset fontsize: %d\n", ret);
 
-       ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE);
-       DbgPrint("unset font: %d\n", ret);
+       ret = vconf_ignore_key_changed("db/setting/accessibility/font_name", font_changed_cb);
+       DbgPrint("Remove font change callback: %d\n", ret);
 
        ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_STIME, time_changed_cb);
        DbgPrint("Remove time changed callback: %d\n", ret);