Chris Du wrote:

I want to integrate my image decoder for *.xyz to my gecko-based application so that when the application load a web page with <img src="a.xyz">, the image could be correctly shown in layout.

What should I do? I am reading the code about how gif is decoded in Mozilla code. But it is hard to understand the logic there.

So far I build an xp component. My application loads the component successfully when the application starts up. I register the content-type "image/xyz" as by

   rv = catman->AddCategoryEntry("Gecko-Content-Viewers",
 "image/xyz",
 XYZ_ContractID,
 PR_TRUE,
 PR_TRUE,
 &previous);

What should my next move be?
How to let gecko call my decoder?
How to return the decoded raw image back to layout engine to show?



_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding



Adding your component to the "Gecko-content-viewers" category is definitely wrong. To implement a image decoder, all you need to do is implement the imgIDecoder interface, and then register your component under the ContractID: "@mozilla.org/image/decoder;2?type=image/x-foo", where "image/x-foo" is the MIME type you wish to handle.


See: http://lxr.mozilla.org/mozilla/source/modules/libpr0n/public/imgIDecoder.idl

NOTE: imgIDecoder is not a frozen interface, so your component may not work with future versions of Mozilla (or Firefox).

-Darin
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to