view include/mb_af.h @ 1161:a7faab54e8f8

Fix broken of running animation - Running animation is stop automatically after a certain time. - It is 300ms according MBScene._updateUI(). - It is caused by notification of changing DOM tree. The notification handlers would call MBScene.updateUI() to update framelines and buttons. - MBScene.updateUI() would call MBScene.show() after 300ms, MBScene.show() calls MBScene.parseScene() in turn. - MBScene.parseScene() would remove duplicate group that is using by code of running animation, MBScene.doRunNext(). It make running animation stop. - fixed by setting MBScene.lockui when a running animation is started or stoped.
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 28 Dec 2010 13:35:34 +0800
parents 5d9def42df12
children
line wrap: on
line source

// -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*-
// vim: sw=4:ts=8:sts=4
#ifndef __APP_H
#define __APP_H

#include "mb_backend.h"

typedef struct _mbapp mbaf_t;
struct _mbapp {
    mb_rt_t *rt;
    redraw_man_t *rdman;
    mb_sprite_t *rootsprite;
    mb_obj_t *root;
    subject_t *kbevents;
    void *private;
};
mbaf_t *mbaf_init(const char *module, const char *module_dir);
void mbaf_set_data(mbaf_t *app,void *data);
mb_timer_man_t *mbaf_get_timer(mbaf_t *app);
void mbaf_loop(mbaf_t *app);
#define MBAF_DATA(app,type) ((type *) ((app)->private))
#define MBAF_RDMAN(app) (((mbaf_t *) app)->rdman)
#define MBAF_KB_SUBJECT(app) ((app)->kbevents)

#include "mbbutton.h"

#endif /* __MBAF_H_ */