Re: XRE_InitEmbeddingType missing?
Georgios Petasis <[email protected]> Wed, 05 Oct 2011 11:42:57 +0300
| Newsgroups | gmane.comp.mozilla.devel.embedding |
|---|---|
| Organization | NCSR "Demokritos" |
| Message-ID | <[email protected]> |
Dear Babele, Thank you very much for your reply! I have found that only XRE_InitEmbedding2 was defined by looking at the header files, but your code snippet is really nice. I have managed to compile my code, but now I observe a different behaviour. I get an nsIDocumentEncoder for text/plain, and despite I am setting a specific dom node with setNode(), the encoder returns the text of the whole page. Strange... Regards, George Στις 5/10/2011 11:08, ο/η Babele Dunnit έγραψε: > On Oct 4, 10:08 pm, George Petasis<[email protected]> wrote: >> Hi all, >> >> I had some code that used to work (with xulrunner 1.9.2), but does not >> even compile with xulrunner 2.0 (xulrunner 7.0 as the OS - Fedora 15 - >> reports it). >> One of the most puzzling error is that the symbol XRE_InitEmbeddingType >> is undefined. And indeed, looking all the files in >> /usr/include/xulrunner-sdk-2, none of them contains this symbol. >> >> What has happened to it? >> Is there a guide on what changed, and how can I embed now? >> >> George > yep, it changed since some time... if you find any guide please > forward, I always wrestle against this kind of stuff. > > MXR is your friend. http://mxr.mozilla.org/ > > some snippet of mine which may help you not reinventing the wheel: > > > --------------------- > > #if defined USE_FF_30_INITIALIZATION > XRE_InitEmbeddingType XRE_InitEmbedding = NULL; > #elif defined USE_FF_40_INITIALIZATION > XRE_InitEmbedding2Type XRE_InitEmbedding2 = NULL; > #else > #error please define something > #endif > > --------------------- > > > // load XUL functions > nsDynamicFunctionLoad nsFuncs[] = > { > #if defined USE_FF_40_INITIALIZATION > {"XRE_InitEmbedding2", (NSFuncPtr*)&XRE_InitEmbedding2}, > #elif defined USE_FF_30_INITIALIZATION > {"XRE_InitEmbedding", (NSFuncPtr*)&XRE_InitEmbedding}, > #else > #error please define something > #endif > {"XRE_TermEmbedding", (NSFuncPtr*)&XRE_TermEmbedding}, > {0, 0} > }; > > > ------------------------------- > > #if defined USE_FF_40_INITIALIZATION > rv = XRE_InitEmbedding2(xuldir, appdir, nsnull); > #elif defined USE_FF_30_INITIALIZATION > rv = XRE_InitEmbedding( xuldir, nsnull, nsnull, nsnull, 0); > #else > #error please define something > #endif > > > ------------------------------- > > Also, please note they removed some "secondary" interfaces and moved > methods into "primary" ones. For example, nsIDOMNode3 does not exist > anymore, and they moved the method GetInnerText into nsIDOMNode. So, > less interface navigation and querying. > > _______________________________________________ > dev-embedding mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-embedding > _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding