[Webkit-unassigned] [Bug 74921] [EFL] Add new commands for Ewk_Editor_Command.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 25 08:49:58 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=74921





--- Comment #15 from Michal Pakula vel Rutka <m.pakula at samsung.com>  2012-04-25 08:49:57 PST ---
(In reply to comment #11)
> (From update of attachment 138327 [details])
> I think separating the enum definition from the _ewk_editor_commands array is error prone; one might inadvertently make the two data structures out of sync and cause havoc. How about doing the following in ewk_editor.cpp (this is similar to what exists in EditorClientQt.cpp):
> 
>   struct EditorCommand {
>       Ewk_Editor_Command ewkCommand;
>       const char editorCommand;
>   };
> 
>   static const EditorCommand editorCommands[] = {
>       { EWK_EDITOR_COMMAND_INSERT_IMAGE, "InsertImage" },
>       { EWK_EDITOR_COMMAND_INSERT_TEXT, "InsertText" },
>       // ...
>   };
> 
>   static const char* _ewk_editor_command_get(Ewk_Editor_Command command)
>   {
>       static Eina_Hash* commandHash = 0;
> 
>       if (!commandHash) {
>           // Initialize the hash map with Ewk_Editor_Command as key and
>           // a const char* as value.
>       }
> 
>       return static_cast<const char*>(eina_hash_find(...));
>   }
> 
>   Eina_Bool ewk_editor_command_execute(...)
>   {
>       // ...
>   }

Good idea, I will apply it as soon as naming discussion will be over.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list