Set the edje scale factor.
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 19 Feb 2013 11:28:14 +0000 (11:28 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 19 Feb 2013 11:36:16 +0000 (11:36 +0000)
but not using the elm.
because it is not support the root privilege's configuration.

Change-Id: I182efac7c4e25117cbd886bb117ed4954bbba503

packaging/liblivebox-edje.spec
src/script_port.c

index 99a9f9a..a19c426 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-edje
 Summary: EDJE Script loader for the data provider master
-Version: 0.2.3
+Version: 0.2.5
 Release: 1
 Group: framework/livebox
 License: Flora License
index 48565c9..5c6eede 100644 (file)
@@ -35,6 +35,7 @@
 #include "script_port.h"
 
 #define TEXT_CLASS     "tizen"
+#define BASE_WIDTH     720.0f
 
 #define PUBLIC __attribute__((visibility("default")))
 
@@ -87,6 +88,14 @@ static struct {
        .size = -100,
 };
 
+static inline double scale_get(void)
+{
+       int width;
+       int height;
+       ecore_x_window_size_get(0, &width, &height);
+       return (double)width / BASE_WIDTH;
+}
+
 /*!
  * \NOTE
  * Reservce this for future use
@@ -505,8 +514,8 @@ PUBLIC int script_update_image(void *_h, Evas *e, const char *id, const char *pa
                        Evas_Coord tmp_h;
 
                        if (img_opt.width >= 0 && img_opt.height >= 0) {
-                               part_w = img_opt.width;
-                               part_h = img_opt.height;
+                               part_w = img_opt.width * scale_get();
+                               part_h = img_opt.height * scale_get();
                        } else {
                                edje_object_part_geometry_get(edje, part, NULL, NULL, &part_w, &part_h);
                        }
@@ -1003,6 +1012,7 @@ PUBLIC int script_init(void)
        int ret;
        /* ecore is already initialized */
        edje_init();
+       edje_scale_set(scale_get());
 
        s_info.property_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, property_cb, NULL);
        if (!s_info.property_handler)
@@ -1021,7 +1031,6 @@ PUBLIC int script_init(void)
 
 PUBLIC int script_fini(void)
 {
-
        vconf_ignore_key_changed("db/setting/accessibility/font_name", font_name_cb);
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, font_size_cb);
        ecore_event_handler_del(s_info.property_handler);