[gdome] Changes to gdome's API
- From: lacage email enst fr (Mathieu Lacage)
- To: gdome rpmfind net
- Subject: [gdome] Changes to gdome's API
- Date: 19 Jan 2000 00:08:32 +0100
hi,
I should have done this sooner but well...
I have recently commited to gdome some changes which
I suspect are non-source-compatible for applications.
Here is a description of the changes done and what
should be done to update to the new gdome cvs version.
1) EventTarget.
previously, gdome had
gdome_n_addEventListener,
gdome_n_removeEventListener,
gdome_n_handleEvent.
These functions still exist and behave as expected but are
deprecated.
their replacements are
gdome_evntt_addEventListener,
gdome_evntt_removeEventListener,
gdome_evntt_handleEvent.
2) casting macros.
No direct casts should be done anymore between GdomeAttr and
GdomeNode for example. The folowing should never be written
anymore.
GdomeAttr *priv = (GdomeAttr *) attr;
GdomeNode *n = (GdomeNode *) priv;
instead, people should write :
GdomeAttr *priv = GDOME_ATTR (attr);
GdomeNode *n = GDOME_NODE (priv);
These macros (defined in gdome-util.h) resolve to simple casts now but
they may resolve to something else later like query_interface calls.
(even if this is not likely to happen: I have a prototype implementation
of EventTarget which used this approach in my HD and it was rather painful.)
3) EventListener
previously, application developers had to create a GdomeListener
structure and fill inside the epv with function pointers to their
implementations of the EventListener object.
This is not the case anymore. EventListener is a new object now and
has its own implementation.
the folowing functions are now available: gdome_evntl_ref/unref/query_interface/handleEvent
Also, the folowing constructor is exported by gdome:
GdomeEventListener *gdome_xml_evntl_new (callback)
where callback is a pointer to the callback for this EventListener.
Please, look in gdome-xml-util.h for the signature.
regards,
Mathieu
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]