usbloadergx/source/GUI/gui_image_async.h

38 lines
1.0 KiB
C
Raw Normal View History

2009-09-27 20:19:53 +02:00
#ifndef _GUIIMAGEASYNC_H_
#define _GUIIMAGEASYNC_H_
#include <vector>
#include "gui.h"
2010-09-24 02:48:03 +02:00
typedef GuiImageData * (*ImageLoaderCallback)(void *arg);
2009-09-27 20:19:53 +02:00
2010-09-24 02:48:03 +02:00
class GuiImageAsync: public GuiImage
{
public:
2010-09-24 02:48:03 +02:00
GuiImageAsync(const char *Filename, GuiImageData * PreloadImg);
GuiImageAsync(ImageLoaderCallback Callback, const void *Arg, int ArgLen, GuiImageData * PreloadImg);
virtual ~GuiImageAsync();
2009-09-27 20:19:53 +02:00
static void ClearQueue();
private:
GuiImageData *imgData;
ImageLoaderCallback callback;
void *arg;
static void * GuiImageAsyncThread(void *arg);
static void ThreadAddImage(GuiImageAsync* Image);
static void ThreadRemoveImage(GuiImageAsync* Image);
static u32 ThreadInit();
static u32 ThreadExit();
static std::vector<GuiImageAsync *> List;
static lwp_t Thread;
static mutex_t ListLock;
static GuiImageAsync * InUse;
static u32 ThreadCount;
static bool ThreadSleep;
static bool CloseThread;
2009-09-27 20:19:53 +02:00
};
#endif /*_GUIIMAGEASYNC_H_*/