#include "BLI_timer.h"
#include <Python.h>
#include <algorithm>
#include "bpy_app_timers.hh"
#include "../generic/python_compat.hh"
Go to the source code of this file.
|
| static double | handle_returned_value (PyObject *function, PyObject *ret) |
| static double | py_timer_execute (uintptr_t, void *user_data) |
| static void | py_timer_free (uintptr_t, void *user_data) |
| | PyDoc_STRVAR (bpy_app_timers_register_doc, ".. function:: register(function, *, first_interval=0, persistent=False)\n" "\n" " Add a new function that will be called after the specified amount of seconds.\n" " The function gets no arguments and is expected to return either None or a float.\n" " If ``None`` is returned, the timer will be unregistered.\n" " A returned number specifies the delay until the function is called again.\n" " ``functools.partial`` can be used to assign some parameters.\n" "\n" " :arg function: The function that should called.\n" " :type function: Callable[[], float | None]\n" " :arg first_interval: Seconds until the callback should be called the first time.\n" " :type first_interval: float\n" " :arg persistent: Don't remove timer when a new file is loaded.\n" " :type persistent: bool\n") |
| static PyObject * | bpy_app_timers_register (PyObject *, PyObject *args, PyObject *kw) |
| | PyDoc_STRVAR (bpy_app_timers_unregister_doc, ".. function:: unregister(function)\n" "\n" " Unregister timer.\n" "\n" " :arg function: Function to unregister.\n" " :type function: Callable[[], float | None]\n") |
| static PyObject * | bpy_app_timers_unregister (PyObject *, PyObject *function) |
| | PyDoc_STRVAR (bpy_app_timers_is_registered_doc, ".. function:: is_registered(function)\n" "\n" " Check if this function is registered as a timer.\n" "\n" " :arg function: Function to check.\n" " :type function: Callable[[], float | None]\n" " :return: True when this function is registered, otherwise False.\n" " :rtype: bool\n") |
| static PyObject * | bpy_app_timers_is_registered (PyObject *, PyObject *function) |
| PyObject * | BPY_app_timers_module () |
◆ bpy_app_timers_is_registered()
| PyObject * bpy_app_timers_is_registered |
( |
PyObject * | , |
|
|
PyObject * | function ) |
|
static |
◆ BPY_app_timers_module()
| PyObject * BPY_app_timers_module |
( |
| ) |
|
|
nodiscard |
◆ bpy_app_timers_register()
| PyObject * bpy_app_timers_register |
( |
PyObject * | , |
|
|
PyObject * | args, |
|
|
PyObject * | kw ) |
|
static |
◆ bpy_app_timers_unregister()
| PyObject * bpy_app_timers_unregister |
( |
PyObject * | , |
|
|
PyObject * | function ) |
|
static |
◆ handle_returned_value()
| double handle_returned_value |
( |
PyObject * | function, |
|
|
PyObject * | ret ) |
|
static |
◆ py_timer_execute()
| double py_timer_execute |
( |
uintptr_t | , |
|
|
void * | user_data ) |
|
static |
◆ py_timer_free()
| void py_timer_free |
( |
uintptr_t | , |
|
|
void * | user_data ) |
|
static |
◆ PyDoc_STRVAR() [1/3]
| PyDoc_STRVAR |
( |
bpy_app_timers_is_registered_doc | , |
|
|
".. function:: is_registered(function)\n" "\n" " Check if this function is registered as a timer.\n" "\n" " :arg function: Function to check.\n" " :type function: | Callable[[], |
|
|
float|None]\n" " :return:True when this function is | registered, |
|
|
otherwise False.\n" " :rtype:bool\n" | ) |
◆ PyDoc_STRVAR() [2/3]
| PyDoc_STRVAR |
( |
bpy_app_timers_register_doc | , |
|
|
".. function:: register(function, *, first_interval=0, persistent=False)\n" "\n" " Add a new function that will be called after the specified amount of seconds.\n" " The function gets no arguments and is expected to return either None or a float.\n" " If ``None`` is | returned, |
|
|
the timer will be unregistered.\n" " A returned number specifies the delay until the function is called again.\n" " ``functools.partial`` can be used to assign some parameters.\n" "\n" " :arg function:The function that should called.\n" " :type function:Callable | [[], |
|
|
float|None]\n" " :arg first_interval:Seconds until the callback should be called the first time.\n" " :type first_interval:float\n" " :arg persistent:Don 't remove timer when a new file is loaded.\n" " :type persistent:bool\n" | ) |
◆ PyDoc_STRVAR() [3/3]
| PyDoc_STRVAR |
( |
bpy_app_timers_unregister_doc | , |
|
|
".. function:: unregister(function)\n" "\n" " Unregister timer.\n" "\n" " :arg function: Function to unregister.\n" " :type function: | Callable[[], |
|
|
float|None]\n" | ) |
◆ M_AppTimers_methods
| PyMethodDef M_AppTimers_methods[] |
|
static |
Initial value: = {
{"register",
METH_VARARGS | METH_KEYWORDS,
bpy_app_timers_register_doc},
{"is_registered",
METH_O,
bpy_app_timers_is_registered_doc},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * bpy_app_timers_unregister(PyObject *, PyObject *function)
static PyObject * bpy_app_timers_register(PyObject *, PyObject *args, PyObject *kw)
static PyObject * bpy_app_timers_is_registered(PyObject *, PyObject *function)
Definition at line 164 of file bpy_app_timers.cc.
◆ M_AppTimers_module_def
| PyModuleDef M_AppTimers_module_def |
|
static |
Initial value: = {
"bpy.app.timers",
nullptr,
0,
nullptr,
nullptr,
nullptr,
nullptr,
}
static PyMethodDef M_AppTimers_methods[]
Definition at line 185 of file bpy_app_timers.cc.
Referenced by BPY_app_timers_module().