[webkit-efl] ewk_view settings implementation

Pozdnyakov, Mikhail mikhail.pozdnyakov at intel.com
Tue Apr 10 00:56:02 PDT 2012


Hi,

> Have you thought of using an enum instead for properties?
Fully agree, actually I am using enum in my patch already :)

> Bear in mind that you'll probably need to bump the Eina revision in jhbuild.modules if you do plan on using Eina_Value (and there's been no stable revision with it yet).
Thanks for the hint! Will try to figure out which is appropriate version.

Thanks,
Mikhail

-----Original Message-----
From: webkit-efl-bounces at lists.webkit.org [mailto:webkit-efl-bounces at lists.webkit.org] On Behalf Of Raphael Kubo da Costa
Sent: Tuesday, April 10, 2012 8:20 AM
To: webkit-efl at lists.webkit.org
Subject: Re: [webkit-efl] ewk_view settings implementation

"Pozdnyakov, Mikhail" <mikhail.pozdnyakov at intel.com> writes:

> Hello,
>
>  I am implementing now LayoutTestController::overridePreference method 
> for EFL https://bugs.webkit.org/show_bug.cgi?id=83007.
>
> I've noticed that each ewk_view related setting (web preference) is 
> currently present in ewk_view as a separate function (see functions 
> starting with ewk_view_setting_... )
>
> In order to implement LayoutTestController::overridePreference I will 
> need to add more ewk_view_setting_ functions to the ewk_view (as not all the settings are present there). That will affect the existing API and will look quite ugly.
>
>  Don't you think it would be better to have two common methods (getter and setter) for all the web preferences like :
>
> Eina_Bool  ewk_view_setting_set(Evas_Object *o,  const char* property,  
> const Eina_Value* value ); and Eina_Bool ewk_view_setting_get(const 
> Evas_Object *o,  const char* property,  Eina_Value* value );
>
> I could do such refactoring  within the  bug83007.
>
> Could  you  please tell  your opinion about my proposal?

API breakages aside, the idea sounds appealing, but the proposed function signatures could be improved: the biggest risk I see with switching from separate function calls to passing the property name as a string is that you also switch from compile-time checks (for property name typos, for example) to run-time checks. Have you thought of using an enum instead for properties?

Bear in mind that you'll probably need to bump the Eina revision in jhbuild.modules if you do plan on using Eina_Value (and there's been no stable revision with it yet).

_______________________________________________
webkit-efl mailing list
webkit-efl at lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-efl
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the webkit-efl mailing list