PageRenderTime 406ms CodeModel.GetById 161ms app.highlight 3ms RepoModel.GetById 170ms app.codeStats 0ms

/apps/common/ftk_app_dummy.c

http://ftk.googlecode.com/
C | 46 lines | 36 code | 10 blank | 0 comment | 3 complexity | d27e489c27f4a67479d807e32c2a65e7 MD5 | raw file
 1#include "ftk_app.h"
 2
 3typedef struct _PrivInfo
 4{
 5	FtkBitmap* icon;
 6}PrivInfo;
 7
 8static FtkBitmap* ftk_app_dummy_get_icon(FtkApp* thiz)
 9{
10	DECL_PRIV(thiz, priv);
11	return_val_if_fail(priv != NULL, NULL);
12
13	return priv->icon;
14}
15
16static const char* ftk_app_dummy_get_name(FtkApp* thiz)
17{
18	return NULL;
19}
20
21static Ret ftk_app_dummy_run(FtkApp* thiz, int argc, char* argv[])
22{
23	return RET_OK;
24}
25
26static void ftk_app_dummy_destroy(FtkApp* thiz)
27{
28	FTK_FREE(thiz);
29
30	return;
31}
32
33FtkApp* ftk_app_dummy_create(void)
34{
35	FtkApp* thiz = FTK_ZALLOC(sizeof(FtkApp) + sizeof(PrivInfo));
36
37	if(thiz != NULL)
38	{
39		thiz->get_icon = ftk_app_dummy_get_icon;
40		thiz->get_name = ftk_app_dummy_get_name;
41		thiz->run = ftk_app_dummy_run;
42		thiz->destroy = ftk_app_dummy_destroy;
43	}
44
45	return thiz;
46}