[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] Getting the window containing an e17 widget

On Sat, 19 Aug 2006 23:15:59 +0200 Simon TRENY <simon.treny@free.fr> babbled:

> Hi,
> I'm working on the entry of e17 and I'm currently implementing
> copy/paste support. For this, I need to call the
> ecore_x_selection_clipboard_*() functions which require an "Ecore_X *".
> Since the entry is just a simple Evas smart object, there is no
> way to get this Ecore_X pointer.
> I would also need this to change the pointer of the mouse when the
> mouse enters the entry, using the e_pointer_*() functions.
> e_pointer_*() requires an "E_Pointer *" pointer.
> Both "Ecore_X *" and "E_Pointer *" could be accessed if I could get the
> "E_Border *" containing the widget. Do you have any idea how could I
> get the border (or another struct that would allow me to get what I
> need) that contains the entry?

unfortunately there is a disconnect here between the canvas and its border you
can hunt up as far as the evas that contains the widgets - but that's where it
stops. but this is easy to bridge - evas_data_attach_set() and
evas_data_attach_get() - i'll just attach the info to the evas under a key -
and you can get it whenever you need it from the evas :) i will attach the
E_Win pointer - from that you can get everything you need (the ecore_evas, the
border, if there is one yet, etc. etc. etc.)


E_Win *win;

win = evas_data_attach_get(evas_object_evas_get(obj), "E_Win");

where "obj" is your widget.
win is the E_Win struct - see e_win.h for its members :)

now comes problem #2 - you need a pointer handle. you can get this from
win->container->manager->pointer :) push and pop with the obj being the win
handle i.e.:

to push the pointer onto the stack (on mouse in event):
if (!pointer_mode_is_special)
  e_pointer_type_push(win->container->manager->pointer, win, "whatever");
  pointer_mode_is_special = 1;

to pop it when done (mouse out event):
e_pointer_type_pop(win->container->manager->pointer, win, "whatever");
pointer_mode_is_special = 0;

NB - keep a flag to know if the pointer should be in this mode or not - it is
possible to not get a mouse out event in certain circumstances and then get
another mouse in (eg mouse grabs etc. etc.)

> Thanks,
> Simon TRENY <MoOM>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> 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)    raster@rasterman.com
Tokyo, Japan (東京 日本)