1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#ifndef _SVC_IMGGEN_H
#define _SVC_IMGGEN_H
#include <bfc/dispatch.h>
#include <api/service/services.h>
class NOVTABLE svc_imageGenerator : public Dispatchable
{
public:
static FOURCC getServiceType() { return WaSvc::IMAGEGENERATOR; }
int testDesc(const wchar_t *desc);
ARGB32 *genImage(const wchar_t *desc, int *has_alpha, int *w, int *h, ifc_xmlreaderparams *params = NULL);
int outputCacheable();
enum {
TESTDESC = 10,
GENIMAGE = 30,
OUTPUTCACHEABLE = 40,
};
};
inline int svc_imageGenerator::testDesc(const wchar_t *desc)
{
return _call(TESTDESC, 0, desc);
}
inline ARGB32 *svc_imageGenerator::genImage(const wchar_t *desc, int *has_alpha, int *w, int *h, ifc_xmlreaderparams *params)
{
return _call(GENIMAGE, (ARGB32 *)0, desc, has_alpha, w, h, params);
}
inline int svc_imageGenerator::outputCacheable()
{
return _call(OUTPUTCACHEABLE, 0);
}
// derive from this one
class NOVTABLE svc_imageGeneratorI : public svc_imageGenerator
{
public:
virtual int testDesc(const wchar_t *desc) = 0;
virtual ARGB32 *genImage(const wchar_t *desc, int *has_alpha, int *w, int *h, ifc_xmlreaderparams *params = NULL) = 0;
virtual int outputCacheable() { return 0; }
protected:
RECVS_DISPATCH;
};
#include <api/service/svc_enum.h>
#include <bfc/string/StringW.h>
class ImgGeneratorEnum : public SvcEnumT<svc_imageGenerator>
{
public:
ImgGeneratorEnum(const wchar_t *_desc) : desc(_desc) { }
protected:
virtual int testService(svc_imageGenerator *svc)
{
return svc->testDesc(desc);
}
private:
StringW desc;
};
#endif
|