Blender  V2.93
BLI_timer.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2018 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
22 #include "BLI_sys_types.h"
23 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* ret < 0: the timer will be removed.
33  * ret >= 0: the timer will be called again in ret seconds */
34 typedef double (*BLI_timer_func)(uintptr_t uuid, void *user_data);
35 typedef void (*BLI_timer_data_free)(uintptr_t uuid, void *user_data);
36 
37 /* `func(...) < 0`: The timer will be removed.
38  * `func(...) >= 0`: The function will be called again in that many seconds. */
40  BLI_timer_func func,
41  void *user_data,
42  BLI_timer_data_free user_data_free,
43  double first_interval,
44  bool persistent);
45 
47 
48 /* Returns False when the timer does not exist (anymore). */
50 
51 /* Execute all registered functions that are due. */
52 void BLI_timer_execute(void);
53 
54 void BLI_timer_free(void);
55 
56 /* This function is to be called next to BKE_CB_EVT_LOAD_PRE, to make sure the module
57  * is properly configured for the new file. */
58 void BLI_timer_on_file_load(void);
59 
60 #ifdef __cplusplus
61 }
62 #endif
bool BLI_timer_is_registered(uintptr_t uuid)
Definition: BLI_timer.c:88
void BLI_timer_register(uintptr_t uuid, BLI_timer_func func, void *user_data, BLI_timer_data_free user_data_free, double first_interval, bool persistent)
Definition: BLI_timer.c:49
void(* BLI_timer_data_free)(uintptr_t uuid, void *user_data)
Definition: BLI_timer.h:35
bool BLI_timer_unregister(uintptr_t uuid)
Definition: BLI_timer.c:76
void BLI_timer_free(void)
Definition: BLI_timer.c:139
double(* BLI_timer_func)(uintptr_t uuid, void *user_data)
Definition: BLI_timer.h:34
void BLI_timer_on_file_load(void)
Definition: BLI_timer.c:157
void BLI_timer_execute(void)
Definition: BLI_timer.c:133
typedef double(DMatrix)[4][4]
void * user_data
_W64 unsigned int uintptr_t
Definition: stdint.h:122