2009-09-27 20:19:53 +02:00
|
|
|
#ifndef _GUIIMAGEASYNC_H_
|
|
|
|
#define _GUIIMAGEASYNC_H_
|
|
|
|
|
|
|
|
#// arg is a pointer created with malloc()
|
|
|
|
// when the image is destroied then will also the arg deleted with free()
|
2010-09-19 01:16:05 +02:00
|
|
|
typedef GuiImageData * ( *ImageLoaderCallback )( void *arg );
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-02-09 11:59:55 +01:00
|
|
|
class GuiImageAsync : public GuiImage
|
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
public:
|
|
|
|
GuiImageAsync( const char *Filename, GuiImageData * PreloadImg );
|
|
|
|
GuiImageAsync( ImageLoaderCallback Callback, void *arg, int arglen, GuiImageData * PreloadImg );
|
|
|
|
~GuiImageAsync();
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
private:
|
|
|
|
GuiImageData *loadet_imgdata;
|
|
|
|
friend void loader( GuiImageAsync *InUse );
|
2009-09-27 20:19:53 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
friend void Setter( GuiImageAsync *InUse );
|
|
|
|
friend void *GuiImageAsyncThread( void *arg );
|
|
|
|
ImageLoaderCallback callback;
|
|
|
|
void *arg;
|
2009-09-27 20:19:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /*_GUIIMAGEASYNC_H_*/
|