[E-devel] evas object event callback API
Context: writing foreign language bindings to Evas I've encountered some snags with Evas callbacks and thought I'd ask for advice (and possibly suggest a better API). Overall, the problem is that Evas assumes in a number of places that one object event callback == exactly one C function. When writing bindings for any dynamic language one would usually want to pass all events through one or two C-level callback functions, so as to decode and convert the event structures. But the current API pretty much requires that there be exactly one C function per event handled: event type is not passed to the callback, so the function called needs to be specialized in advance for that one particular type. In dynamic languages there is usually no compile step (or it is optional), so there is no way of knowing ahead if time which callbacks will be needed. At a certain point in time the program may request a certain type of callback to be added. It would be good to be able to do it without necessarily needing to create a completely separate C function to handle just this one particular callback case. The other issue is how to delete unwanted callbacks. At present callbacks are uniquely identified by the C function pointer. This makes it impossible to have one function handle several events -- evas_object_event_callback_delete removes by comparing function pointers. So, on to humble suggestions: 1. IMHO evas object event callbacks should be uniquely identified by the triplet (Evas_Object, Event_Type, function_ptr). That's what you pass in when you call evas_object_event_callback_add, so that's what you should pass when deleting the callback. I'm not sure if an object can belong to multiple Evases, so I don't know if Evas should be used as well. 2. IMHO the callback function should receive the event type as one of its parameters. 3. Overall, IMHO we should not assume that one callback always equals one C function. I can imagine a number of cases where I'd want to have a dispatching function handling multiple event types or events from multiple objects (or even Evases). --J. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] E submenu placement
So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. Are there bigger plans for menu layout adjustment? I see that placement also needs to take in to account the bottom of the screen. That isn't fixed yet. -- KevinIndex: src/bin/e_menu.c === RCS file: /cvs/e/e17/apps/e/src/bin/e_menu.c,v retrieving revision 1.55 diff -u -r1.55 e_menu.c --- src/bin/e_menu.c28 Jul 2006 23:22:57 - 1.55 +++ src/bin/e_menu.c5 Aug 2006 20:50:16 - @@ -1813,7 +1813,12 @@ Evas_List *l, *tmp = NULL; if (!m-parent_item) return; - m-cur.x = m-parent_item-menu-cur.x + m-parent_item-menu-cur.w; + + /* right placement */ + if(m-parent_item-menu-cur.x + m-parent_item-menu-cur.w + m-cur.w m-parent_item-menu-zone-w) + m-cur.x = m-parent_item-menu-cur.x + m-parent_item-menu-cur.w; + else /* left placement */ + m-cur.x = m-parent_item-menu-cur.x - m-cur.w; m-cur.y = m-parent_item-menu-cur.y + m-parent_item-y - m-container_y; /* FIXME: this will suck for big menus */ for (l = _e_active_menus; l; l = l-next) - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. regards, Koen -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFE1MIaMkyGM64RGpERAk5pAKC9x0xwViz5Z4teQTkEnDk9NVKRuwCeNWkk V2aK87SXHLXmZ8j5zcRw7h0= =PUrP -END PGP SIGNATURE- - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
Well, many people like/dislike such menu behaviour. So, in order to satisfy all around it would be greate to have this functionality as an option. On Sat, Aug 05, 2006 at 06:06:51PM +0200, Koen Kooi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. regards, Koen -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFE1MIaMkyGM64RGpERAk5pAKC9x0xwViz5Z4teQTkEnDk9NVKRuwCeNWkk V2aK87SXHLXmZ8j5zcRw7h0= =PUrP -END PGP SIGNATURE- - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- Aleksej Struk Master Degree Student Free University of Bozen-Bolzano Faculty of Computer Science phone: +39-0471-061749 cell phone: +39-3204627049 +370-61278908 [EMAIL PROTECTED] [EMAIL PROTECTED] - http://astruk.googlepages.com/home - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
On 8/5/06, Koen Kooi [EMAIL PROTECTED] wrote: Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. Offscreen menus can slide in if you push against the offscreen edge. Turning this into an option for E would be a good idea. -- Hisham Mardam Bey MSc (Computer Science) http://hisham.cc/ +9613609386 Codito Ergo Sum (I Code Therefore I Am) - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
Hisham Mardam Bey wrote: On 8/5/06, Koen Kooi [EMAIL PROTECTED] wrote: Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. Offscreen menus can slide in if you push against the offscreen edge. Turning this into an option for E would be a good idea. Yeah, thanks for showing me that on irc. I hadn't seen that behavior in so long I didn't discover it again on my own. It would be handy if the off screen menu had some visual indication of the possible slide behavior. Maybe a grayed edge, or some little arrow indications, or such. Does that sound interesting to anyone? -- Kevin - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hisham Mardam Bey schreef: On 8/5/06, Koen Kooi [EMAIL PROTECTED] wrote: Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. Offscreen menus can slide in if you push against the offscreen edge. That virtually impossible to do with a touchscreen, since you can't 'move' the pointer without generating a button-down event[1]. An option for this would be great! regards, Koen [1] not to mention the amount of jitter of this touchscreen -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFE1Mh3MkyGM64RGpERAqJ7AJwJ3OFmawEh6Fb+QKaDZAcrCgXz9wCggjcH g9Iu16R4Vcg0fYSnIbo+Rmk= =mvXI -END PGP SIGNATURE- - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
Koen Kooi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. hehe, almost the first thing I noticed on my new e17 build also. It sounds like we might make it an option, along with the slide behavior. -- Kevin - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
Koen Kooi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hisham Mardam Bey schreef: On 8/5/06, Koen Kooi [EMAIL PROTECTED] wrote: Kevin Brosius schreef: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. You are a hero! The whole 'menus go offscreen' thing has been annoying me since I installed e17 on my 800x600 psion netbookpro last week. Offscreen menus can slide in if you push against the offscreen edge. That virtually impossible to do with a touchscreen, since you can't 'move' the pointer without generating a button-down event[1]. An option for this would be great! regards, Koen [1] not to mention the amount of jitter of this touchscreen Koen, That's a good reason :) You might find it helpful to change some of the menu scroll settings. It seems to me that under (left mouse menu) | configuration | configuration panel | Menu settings, advanced, the setting 'Autoscroll Margin' determines how far from the screen edge the menu will be scrolled, and the 'Autoscroll Cursor Margin' controls the hot zone for scrolling. Making your cursor margin setting 10 or 15 pixels should help. -- Kevin - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] new taskbar module
Hannes Janetzek wrote: Am Fri, 4 Aug 2006 17:57:43 -0700 schrieb Blake Barnett [EMAIL PROTECTED]: On Aug 4, 2006, at 5:58 PM, Hannes Janetzek wrote: snip It would be great to have some feedback what others think is needed for a taskbar. common give it a try :) snip Here's a couple of my ideas on the subject. (again) http://marc.theaimsgroup.com/?l=enlightenment- develm=113513395432378w=2 hm, could you write a detailed use case for this? I can´t imagine how this should work or look like. I'll see if I can come up with a mock-up image. - User opens an image editing/viewing application. - Taskbar changes to a new mode and displays things like: - A small slideshow or bar of recently edited/viewed images eaps should store mime-types of the applications for this to work. I would appreciate to have this. I'm not sure if this is part of the new fsel? I'll have to look at the code. -A group of tools that the user put in place that they like to have handy when editing images. One could use the menu of the favourite category to which the task icon belongs :) Yes, I like that. :) -Blake - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E submenu placement
On Sat, 05 Aug 2006 12:01:01 -0400 Kevin Brosius [EMAIL PROTECTED] babbled: So, who is working on e menus at the moment? Am I stepping on any toes if I commit stuff like this? The attached patch prevents submenus from being drawn off the right side of the screen. Are there bigger plans for menu layout adjustment? I see that placement also needs to take in to account the bottom of the screen. That isn't fixed yet. well other than what codewarrier said (you can drag to the edge of the screen and scroll - e17's menu code can handle massive menus - well beyond the size gtk or qt can due to just letting you scroll them). yes an inidactor might be nice - in practical terms that probably would need to be yet another window with a canvas (maybe an e_popup) placed on the edges of the screen where you are able to scroll and then shown when needed (also emit a signal so it knows it was shown and can start animating or something). but your patch imho is a little incomplete. the submenu arrow will point the wrong way. you need a way of now having the theme have 2 modes (open to the left or open to the right) and you need to select this when the first parent menu opens. your patch also will have problems: |screen edge [menu] | []---[sub] | [][ ] | [ [sub2]-[ ] | [ [] [ ] | [] | and yes - touchscreen has problems - IF you tap then tap again. if you press and drag style menu (you dont have to release the mouse - or raise the pen) then it works just fine btw :) but yes - this does limit your ability to interact with menus a bit. but as per above we have a few problems. 1. arrow indicator is now wrong 2. menus will overlap back and forth 3. there are menu occasions where the menu code has no idea how big a submenu will be before it is shown (as the contents are generated when it is shown to speed up initial menu popup), so you can't know in advance what arrow to display (thus you will need a way of flipping submenu arrow display on the fly) 4.we can probably make the flip back.forth usable if we allow a tap/click on the submenu parent item will TOGGLE the display of the submenu as opposed to just always display it if it isn't displayed. ... anyway - my point in this is... i applaud your efforts to work on this - but i think you need to think more widely on the implications of the work and all the fine details/touches and solve them too :) (nb - i think we can also solve the touchscreen problem and not even make menus open to the left - if we allow you to CLICK on the you can scroll here indicator/arrow and click and hold begins a scroll in that direction - the only problem is keeping the popups above the menu then :) -- - Codito, ergo sum - I code, therefore I am -- The Rasterman (Carsten Haitzler)[EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本) - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] evas object event callback API
On Sat, 05 Aug 2006 12:45:39 +0200 Jan Rychter [EMAIL PROTECTED] babbled: In ecore_evas - you do have a problem as it expects ONE callabck only per ecore_evas canvas wrapper and events - BUT for evas this is not the case. you can attach N event callbacks to any objects for an event type. as you hve a generic void *data pointer for all of these, you can use this to differentiate, pass extra data for your binding (pass in an allocated struct ptr that then contains all of the data you could/would need - even like event type). the void *data pointer should be sufficient for all your needs - if used right. what about this makes it not possible to bind to another language? i have bound identical callbacks for timers for example in embryo for scripting - a timer gets passed only 1 parameter - a void * pointer. if your point is that you want to create the 1 callback does all thing and only ever bind that 1 function to everything using the event type to then switch off internally - then you just are wanting to do things in a way evas was not intended to work. yes - it expects a callback to be set and specialized for at least that TYPE of event. so you will need N callbacks in the binding api - 1 per event type you wish to handle, and then use the void *data to piggyback whatever extra info you need :) changing the callback api will basically break a few hundred thousand lines of code and i'd need a reason why the current api CANNOT do what you NEED - not just a it doesn't work the way i wanted to do this :) Context: writing foreign language bindings to Evas I've encountered some snags with Evas callbacks and thought I'd ask for advice (and possibly suggest a better API). Overall, the problem is that Evas assumes in a number of places that one object event callback == exactly one C function. When writing bindings for any dynamic language one would usually want to pass all events through one or two C-level callback functions, so as to decode and convert the event structures. But the current API pretty much requires that there be exactly one C function per event handled: event type is not passed to the callback, so the function called needs to be specialized in advance for that one particular type. In dynamic languages there is usually no compile step (or it is optional), so there is no way of knowing ahead if time which callbacks will be needed. At a certain point in time the program may request a certain type of callback to be added. It would be good to be able to do it without necessarily needing to create a completely separate C function to handle just this one particular callback case. The other issue is how to delete unwanted callbacks. At present callbacks are uniquely identified by the C function pointer. This makes it impossible to have one function handle several events -- evas_object_event_callback_delete removes by comparing function pointers. So, on to humble suggestions: 1. IMHO evas object event callbacks should be uniquely identified by the triplet (Evas_Object, Event_Type, function_ptr). That's what you pass in when you call evas_object_event_callback_add, so that's what you should pass when deleting the callback. I'm not sure if an object can belong to multiple Evases, so I don't know if Evas should be used as well. 2. IMHO the callback function should receive the event type as one of its parameters. 3. Overall, IMHO we should not assume that one callback always equals one C function. I can imagine a number of cases where I'd want to have a dispatching function handling multiple event types or events from multiple objects (or even Evases). --J. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- - Codito, ergo sum - I code, therefore I am -- The Rasterman (Carsten Haitzler)[EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本) - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel