Hey,

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.


This is what I'm going to go with unless I hear any strong objections by 
Monday.

--
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