Mercurial > MadButterfly
annotate include/mb_af.h @ 870:512204bcafba
Export the function to create a runtime for an existed window for X.
For some application, we need to create and associate a runtime with
an existed window, and free it the runtime without close the window,
later.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 24 Sep 2010 11:19:53 +0800 |
parents | 586e50f82c1f |
children | 5b58e74988bc |
rev | line source |
---|---|
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
456
diff
changeset
|
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*- |
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
456
diff
changeset
|
2 // vim: sw=4:ts=8:sts=4 |
456
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
3 #ifndef __APP_H |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
4 #define __APP_H |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
6 typedef struct _mbapp mbaf_t; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
7 struct _mbapp { |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
8 void *rt; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 redraw_man_t *rdman; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
10 mb_sprite_t *rootsprite; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
11 mb_obj_t *root; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
12 subject_t *kbevents; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
13 void *private; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
14 }; |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
15 mbaf_t *mbaf_init(const char *module, const char *module_dir); |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
16 void mbaf_set_data(mbaf_t *app,void *data); |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
17 mb_tman_t *mbaf_get_timer(mbaf_t *app); |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
18 void mbaf_loop(mbaf_t *app); |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
19 #define MBAF_DATA(app,type) ((type *) ((app)->private)) |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
20 #define MBAF_RDMAN(app) (((mbaf_t *) app)->rdman) |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
21 #define MBAF_KB_SUBJECT(app) ((app)->kbevents) |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
22 |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
23 #include "mbbutton.h" |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
24 |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
25 #endif /* __MBAF_H_ */ |