I'm writing an application which embeds mozilla.
In my C++ code I would like to use nsHTMLAtoms (from nsHTMLAtoms.h which is
exposed in .../dist/include/content)
The problem arises when I'm trying to link my executable.
I get all the atoms referenced in my code as unresolved symbols.
Linking with libgklayout.so is not a solution since these symbols are not
exposed in non debug mode.
Please suggest what to do.
Thanks,
-Michael.
You shouldn't use nsHTMLAtoms. Instead, you should call NS_NewAtom,
do_GetAtom, or equivalent to get the atom for the same string. The
atom table will ensure that you are given the same atom object
(which, after all, is the point of atoms). Depending on whether
you're linking against XPCOM, you want to use either the methods in
nsIAtom.idl (if you are) or nsIAtomService.idl (if you aren't).
-David
--
L. David Baron http://dbaron.org/
Mozilla Corporation http://www.mozilla.com/
Actually, I gave the HTML atoms as an example.
I would like to understand how I can use the internal API of mozilla when
embeding it ?
I see that the libraries in .../dist/bin/components are not exposing those
symbols (libgklayout.so is a good example)
MOZILLA_INTERNAL_API flag doesn't help.
Thanks,
Michael.
>why is nsHTMLAtoms.h exposed in the mozilla header directory ?
>
>
Because it's used to compile mozilla. Ideally you should be looking in
the SDK directory instead, but I guess none of the atom functions are
exposed there, so your next stop should be the idl directory.
--
Warning: May contain traces of nuts.
Perhaps that's a mistake.
> Actually, I gave the HTML atoms as an example.
> I would like to understand how I can use the internal API of mozilla when
> embeding it ?
I'm not sure how to answer that question in general. I think it
depends on the API.