On 09/06/16 16:23, Cedric BAIL wrote:
> On Jun 9, 2016 03:14, "Tom Hacohen" <t...@osg.samsung.com> wrote:
>> As part of reworking the text API for the next version I'm tackling the
>> text filter API. It needs to be easy to bind, easy to use and efficient.
>> I have an idea in mind, and I want to hear some feedback from people
>> who've used text filtering to know if there's something I may be
>> missing/can do better.
>>
>> What I have in mind:
>>
>> Add a text filter event with Text_Filter_Info (keeping the name short
>> for this example) as the event info.
>>
>> Text_Filter_Info looks as follows (names will change, just for the
> example):
>>         orig: const char *
>>          new: Eina_Strbuf *
>>          rejected: bool
>>
>> The event is called with orig=original text, new=null, rejected=false.
>> The event callbacks can then decide to reject the text chunk (by setting
>> rejected = true), or modify the original text by creating a new strbuf
>> and setting new to it.
>> If rejected is set, the chunk is rejected no matter what the strbuf
>> value is.
>> I chose a strbuf because it's more efficient and easier to augment the
>> text with a strbuf (most likely) than with a normal allocated string.
>> However, a case could be made for a normal allocated string because in
>> almost (all?) cases, the string will not grow.
>
> My main concern is actually what happen if there is more than one event
> handler registered. I think it become pretty complex to chain them with all
> this parameter. What if you just pass the text embedded in the strbuf
> already and you just look at it for all behavior at the end ?

I disagree. This is irrelevant though because of what Felipe said. I'll 
reply to his email now.

--
Tom.


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to