Back to index

lightning-sunbird  0.9+nobinonly
gfxIImageFrame.idl
Go to the documentation of this file.
00001 
00041 #include "nsISupports.idl"
00042 #include "gfxtypes.idl"
00043 #include "gfxIFormats.idl"
00044 
00045 %{C++
00046 #include "nsRect.h"
00047 %}
00048 
00049 native nsRectRef(nsIntRect &);
00050 
00060 [scriptable, uuid(f6d00ee7-defc-4101-b2dc-e72cf4c37c3c)]
00061 interface gfxIImageFrame : nsISupports
00062 {
00074   void init(in PRInt32 aX,
00075             in PRInt32 aY,
00076             in PRInt32 aWidth,
00077             in PRInt32 aHeight,
00078             in gfx_format aFormat,
00079             in gfx_depth aDepth);
00080 
00085   attribute boolean mutable;
00086 
00090   readonly attribute PRInt32 x;
00091 
00095   readonly attribute PRInt32 y;
00096 
00100   readonly attribute PRInt32 width;
00101 
00105   readonly attribute PRInt32 height;
00106 
00111   [noscript] void getRect(in nsRectRef rect);
00112 
00117   readonly attribute gfx_format format;
00118 
00122   readonly attribute boolean needsBackground;
00123 
00124   /* data accessors */
00125   readonly attribute unsigned long imageBytesPerRow;
00126 
00130   readonly attribute unsigned long imageDataLength;
00131 
00132   // XXX do we copy here?  lets not...
00133   void getImageData([array, size_is(length)] out PRUint8 bits, out unsigned long length);
00134 
00143   void setImageData([array, size_is(length), const] in PRUint8 data,
00144                     in unsigned long length,
00145                     in long offset);
00146 
00150   void lockImageData();
00151 
00155   void unlockImageData();
00156 
00157 
00158 
00159   /* alpha stuff.. used for _A1 and _A8 formated images */
00160   readonly attribute unsigned long alphaBytesPerRow;
00161 
00165   readonly attribute unsigned long alphaDataLength;
00166 
00167   // XXX do we copy here?  lets not...
00168   void getAlphaData([array, size_is(length)] out PRUint8 bits, out unsigned long length);
00169 
00173   void setAlphaData([array, size_is(length), const] in PRUint8 data,
00174                     in unsigned long length,
00175                     in long offset);
00176 
00180   void lockAlphaData();
00181 
00185   void unlockAlphaData();
00186 
00187 
00188 
00189   /* GIF Specific methods.  These should be in a different class or interface. */
00190 
00194   void drawTo(in gfxIImageFrame aDst,
00195               in PRInt32 aDX,
00196               in PRInt32 aDY,
00197               in PRInt32 aDWidth,
00198               in PRInt32 aDHeight);
00199 
00204   attribute long timeout;
00205 
00206   /* frame disposal method, used only by GIFs. Should probably subclass image frame
00207    * and image container for GIFs special needs, but for simplicity it is here for the
00208    * moment
00209    */
00210   attribute long frameDisposalMethod;
00211 
00212   /* frame background color
00213    * GIF specific, should be in a GIF specific frame
00214    */  
00215   attribute gfx_color backgroundColor;
00216 };