Public Member Functions | Private Member Functions | Private Attributes

IE_ImpGraphic_GdkPixbuf Class Reference

#include <ie_impGraphic_GdkPixbuf.h>

Inheritance diagram for IE_ImpGraphic_GdkPixbuf:

List of all members.

Public Member Functions

 IE_ImpGraphic_GdkPixbuf ()
virtual ~IE_ImpGraphic_GdkPixbuf ()
virtual UT_Error importGraphic (const UT_ConstByteBufPtr &pBB, FG_ConstGraphicPtr &pfg)

Private Member Functions

GdkPixbuf * pixbufForByteBuf (const UT_ConstByteBufPtr &pBB, std::string &mimetype)
void _createPNGFromPixbuf (GdkPixbuf *pixbuf)
UT_Error _png_write (GdkPixbuf *pixbuf)
 needed for the stejmp context
GdkPixbuf * _loadXPM (const UT_ConstByteBufPtr &pBB)
UT_Error Initialize_PNG (void)

Private Attributes

png_structp m_pPNG
png_infop m_pPNGInfo
UT_ConstByteBufPtr m_pPngBB

Constructor & Destructor Documentation

IE_ImpGraphic_GdkPixbuf::IE_ImpGraphic_GdkPixbuf (  ) 
IE_ImpGraphic_GdkPixbuf::~IE_ImpGraphic_GdkPixbuf (  )  [virtual]

Member Function Documentation

void IE_ImpGraphic_GdkPixbuf::_createPNGFromPixbuf ( GdkPixbuf *  pixbuf  )  [private]

This method fills the m_pPNG byte buffer with a PNG representation of of the supplied gdk-pixbuf. This can be saved in the PT as a data-item and recreated. ppBB is a pointer to a pointer of a byte buffer. It's the callers job to delete it.

References m_pPNG, m_pPNGInfo, and UT_DEBUGMSG.

Referenced by _png_write().

GdkPixbuf * IE_ImpGraphic_GdkPixbuf::_loadXPM ( const UT_ConstByteBufPtr pBB  )  [private]

Massage the byte buffer into an array of strings that can be loaded by gdk-pixbuf

References UT_GenericVector< T >::addItem(), DELETEP, FREEP, UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), and UT_calloc().

Referenced by pixbufForByteBuf().

UT_Error IE_ImpGraphic_GdkPixbuf::_png_write ( GdkPixbuf *  pixbuf  )  [private]

needed for the stejmp context

References _createPNGFromPixbuf(), m_pPNG, m_pPngBB, and m_pPNGInfo.

Referenced by importGraphic().

UT_Error IE_ImpGraphic_GdkPixbuf::importGraphic ( const UT_ConstByteBufPtr pBB,
FG_ConstGraphicPtr pfg 
) [virtual]

Convert an image data buffer into PNG image buffer.

Reimplemented from IE_ImpGraphic.

References _png_write(), Initialize_PNG(), m_pPngBB, pixbufForByteBuf(), UT_DEBUGMSG, and UT_OK.

UT_Error IE_ImpGraphic_GdkPixbuf::Initialize_PNG ( void   )  [private]

References m_pPNG, m_pPngBB, and m_pPNGInfo.

Referenced by importGraphic().

GdkPixbuf * IE_ImpGraphic_GdkPixbuf::pixbufForByteBuf ( const UT_ConstByteBufPtr pBB,
std::string &  mimetype 
) [private]

References _loadXPM(), gchar, mime_types, UT_ASSERT, and UT_DEBUGMSG.

Referenced by importGraphic().

Member Data Documentation

The documentation for this class was generated from the following files: