On Tue, 30 Aug 2011 14:28:58 +0300 Tom Hacohen <tom.haco...@partner.samsung.com> said:
> Hey everyone, > > As part my effort of improving entry, I started implementing undo/redo > support. I guess there are several ways of doing it, therefore I'd like > to hear what you guys think about the solutions in general, and the one > I chose in particular. > > Before I start, there's one important thing to remember: Elm_Entry > interacts with textblock through edje_entry. Edje_entry's callbacks > aren't "smart callbacks" but are edje signals instead, which means they > aren't called immediately. Edje signals are inserted into the edje queue > with additional information, which means all the data passed with them > has to be allocated on the heap and stored. Also, because it's not > possible to know in advance when a signal will be called, querying the > issuing object upon calling the callback is also not possible, as it may > have changed in the meanwhile. > > This means I have to do one of the following: either I add smart > callbacks to edje (or custom ones like is done with text_filter) which > means I don't have to allocate anything on the heap, and if I do, it's > very contained and will only happen if a callback will actually be > called. The worst thing about this method is probably that it breaks > order of callbacks, as those will be called before signals emitted. The > other alternative is what I currently implemented: I added a way to pass > additional information to c callbacks listening to signals ( (added a > function: edje_object_signal_callback_extra_data_get(void)). > > I really don't know which one is better. I prefer using smart callbacks, > but there are many drawbacks. As for the additional data with signals: > there won't be many allocations because "changed,user" is only called on > user changes, which are very limited anyway. > > So, what do you guys think I should do? the re-ordering of smart callback vs signal is a bit of an issue indeed. i would say its ok to implement smart callbacks in addition to signals - then we have an inline calling method so when u get called the entry is currently in exactly that state. -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel