Title: [104449] trunk/Source/WebKit2
Revision
104449
Author
[email protected]
Date
2012-01-09 04:13:37 -0800 (Mon, 09 Jan 2012)

Log Message

[EFL][WK2] Set color_set function to the clipped smart class.
https://bugs.webkit.org/show_bug.cgi?id=75286

Patch by Eunmi Lee <[email protected]> on 2012-01-09
Reviewed by Andreas Kling.

Set _ewk_view_smart_color_set() function to the clipped smart class's color_set,
so application can set webpage's background color using evas_object_color_set() API.

* UIProcess/API/efl/ewk_view.cpp:
(_ewk_view_smart_color_set):
(ewk_view_smart_class_init):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (104448 => 104449)


--- trunk/Source/WebKit2/ChangeLog	2012-01-09 12:06:10 UTC (rev 104448)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-09 12:13:37 UTC (rev 104449)
@@ -1,3 +1,17 @@
+2012-01-09  Eunmi Lee  <[email protected]>
+
+        [EFL][WK2] Set color_set function to the clipped smart class.
+        https://bugs.webkit.org/show_bug.cgi?id=75286
+
+        Reviewed by Andreas Kling.
+
+        Set _ewk_view_smart_color_set() function to the clipped smart class's color_set,
+        so application can set webpage's background color using evas_object_color_set() API.
+
+        * UIProcess/API/efl/ewk_view.cpp:
+        (_ewk_view_smart_color_set):
+        (ewk_view_smart_class_init):
+
 2012-01-08  Dan Bernstein  <[email protected]>
 
         REGRESSION (r103859): WKViews leak

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (104448 => 104449)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-01-09 12:06:10 UTC (rev 104448)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-01-09 12:13:37 UTC (rev 104449)
@@ -385,6 +385,33 @@
     evas_object_hide(smartData->image);
 }
 
+static void _ewk_view_smart_color_set(Evas_Object* ewkView, int red, int green, int blue, int alpha)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+
+    if (alpha < 0)
+        alpha = 0;
+    else if (alpha > 255)
+        alpha = 255;
+
+#define CHECK_COLOR(color, alpha) \
+    if (color < 0)                \
+        color = 0;                \
+    else if (color > alpha)       \
+        color = alpha;
+    CHECK_COLOR(red, alpha);
+    CHECK_COLOR(green, alpha);
+    CHECK_COLOR(blue, alpha);
+#undef CHECK_COLOR
+
+    evas_object_image_alpha_set(smartData->image, alpha < 255);
+    priv->pageClient->page()->setDrawsBackground(red || green || blue);
+    priv->pageClient->page()->setDrawsTransparentBackground(alpha < 255);
+
+    g_parentSmartClass.color_set(ewkView, red, green, blue, alpha);
+}
+
 Eina_Bool ewk_view_smart_class_init(Ewk_View_Smart_Class* api)
 {
     EINA_SAFETY_ON_NULL_RETURN_VAL(api, false);
@@ -407,6 +434,7 @@
     api->sc.resize = _ewk_view_smart_resize;
     api->sc.show = _ewk_view_smart_show;
     api->sc.hide = _ewk_view_smart_hide;
+    api->sc.color_set = _ewk_view_smart_color_set;
     api->sc.calculate = _ewk_view_smart_calculate;
     api->sc.data = "" // It is used by type checking.
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to