annotate examples/dynamic/mbbutton.h @ 1214:e55499f7505a

Fix the issues with multiple framelines - For multiple framelines, user move mouse from one frameline to another, the frame is not showed correctly. - Old implementation always draw normal frame on the frameline where mouse just leaving. - It is fixed by detecting leave-notify event and removing hover mark. - When user active a frame on a frameline that is not what old active frame is at, the old active frame is not deactivated. - It is fixed by calling frameline.deactive() of a frameline when a frame is activated on another frameline.
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 05 Jan 2011 17:56:14 +0800
parents ab8284c8dcee
children
rev   line source
247
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
1 #ifndef __MBBUTTON_H
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
2 #define __MBBUTTON_H
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
3 typedef struct _mb_button {
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
4 mb_obj_t obj;
249
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 247
diff changeset
5 redraw_man_t *rdman;
247
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
6 int state;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
7 coord_t *root;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
8 coord_t *active;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
9 coord_t *normal;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
10 coord_t *click;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
11 void (*press)();
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
12 void *arg;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
13 observer_t *obs_move,*obs_out,*obs_press;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
14 mb_progm_t *progm;
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
15 } mb_button_t;
249
ab8284c8dcee * Add loopback reference from rdman to the backend. This is only required when we need to acquire the tman for the animation. This is not a reasonable arrangement since the animation should be backend transparent. We should not touch the backend directly from the animation. We should relocate the tman to the rdman.
wycc
parents: 247
diff changeset
16 mb_button_t *mb_button_new(redraw_man_t *rdman,mb_sprite_t *sp, char *name);
247
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
17 void mb_button_add_onClick(mb_button_t *b, void (*h)(void *arg), void *arg);
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
18 #endif
d9a78c859660 Seperate the frameowrk codes from the main.c.
wycc
parents:
diff changeset
19