2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bli
|
2011-02-27 20:37:56 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BLI_CALLBACKS_H__
|
|
|
|
#define __BLI_CALLBACKS_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-06-24 16:54:30 +00:00
|
|
|
struct ID;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Main;
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2014-08-29 16:17:31 +10:00
|
|
|
/**
|
|
|
|
* Common suffix uses:
|
|
|
|
* - ``_PRE/_POST``:
|
|
|
|
* For handling discrete non-interactive events.
|
|
|
|
* - ``_INIT/_COMPLETE/_CANCEL``:
|
|
|
|
* For handling jobs (which may in turn cause other handlers to be called).
|
|
|
|
*/
|
2011-06-24 16:54:30 +00:00
|
|
|
typedef enum {
|
2019-04-17 06:17:24 +02:00
|
|
|
BLI_CB_EVT_FRAME_CHANGE_PRE,
|
|
|
|
BLI_CB_EVT_FRAME_CHANGE_POST,
|
|
|
|
BLI_CB_EVT_RENDER_PRE,
|
|
|
|
BLI_CB_EVT_RENDER_POST,
|
|
|
|
BLI_CB_EVT_RENDER_WRITE,
|
|
|
|
BLI_CB_EVT_RENDER_STATS,
|
|
|
|
BLI_CB_EVT_RENDER_INIT,
|
|
|
|
BLI_CB_EVT_RENDER_COMPLETE,
|
|
|
|
BLI_CB_EVT_RENDER_CANCEL,
|
|
|
|
BLI_CB_EVT_LOAD_PRE,
|
|
|
|
BLI_CB_EVT_LOAD_POST,
|
|
|
|
BLI_CB_EVT_SAVE_PRE,
|
|
|
|
BLI_CB_EVT_SAVE_POST,
|
|
|
|
BLI_CB_EVT_UNDO_PRE,
|
|
|
|
BLI_CB_EVT_UNDO_POST,
|
|
|
|
BLI_CB_EVT_REDO_PRE,
|
|
|
|
BLI_CB_EVT_REDO_POST,
|
|
|
|
BLI_CB_EVT_DEPSGRAPH_UPDATE_PRE,
|
|
|
|
BLI_CB_EVT_DEPSGRAPH_UPDATE_POST,
|
|
|
|
BLI_CB_EVT_VERSION_UPDATE,
|
2019-05-22 14:28:10 +10:00
|
|
|
BLI_CB_EVT_LOAD_FACTORY_USERDEF_POST,
|
2019-04-17 06:17:24 +02:00
|
|
|
BLI_CB_EVT_LOAD_FACTORY_STARTUP_POST,
|
|
|
|
BLI_CB_EVT_TOT,
|
2011-06-24 16:54:30 +00:00
|
|
|
} eCbEvent;
|
|
|
|
|
2013-03-24 01:19:55 +00:00
|
|
|
typedef struct bCallbackFuncStore {
|
2019-04-17 06:17:24 +02:00
|
|
|
struct bCallbackFuncStore *next, *prev;
|
|
|
|
void (*func)(struct Main *, struct ID *, void *arg);
|
|
|
|
void *arg;
|
|
|
|
short alloc;
|
2011-06-24 16:54:30 +00:00
|
|
|
} bCallbackFuncStore;
|
|
|
|
|
2018-06-15 17:42:17 +02:00
|
|
|
void BLI_callback_exec(struct Main *bmain, struct ID *self, eCbEvent evt);
|
2012-05-05 00:23:55 +00:00
|
|
|
void BLI_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-05 00:23:55 +00:00
|
|
|
void BLI_callback_global_init(void);
|
|
|
|
void BLI_callback_global_finalize(void);
|
2011-06-24 16:54:30 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __BLI_CALLBACKS_H__ */
|