Blender  V3.3
Macros | Functions | Variables
bpy_app_handlers.c File Reference
#include "BLI_utildefines.h"
#include <Python.h>
#include "BKE_callbacks.h"
#include "RNA_access.h"
#include "RNA_types.h"
#include "bpy_app_handlers.h"
#include "bpy_rna.h"
#include "../generic/python_utildefines.h"
#include "BPY_extern.h"

Go to the source code of this file.

Macros

#define APP_CB_OTHER_FIELDS   1
 
#define PERMINENT_CB_ID   "_bpy_persistent"
 

Functions

void bpy_app_generic_callback (struct Main *main, struct PointerRNA **pointers, const int pointers_num, void *arg)
 
static PyObject * bpy_app_handlers_persistent_new (PyTypeObject *UNUSED(type), PyObject *args, PyObject *UNUSED(kwds))
 
static PyObject * make_app_cb_info (void)
 
PyObject * BPY_app_handlers_struct (void)
 
void BPY_app_handlers_reset (const bool do_all)
 
static PyObject * choose_arguments (PyObject *func, PyObject *args_all, PyObject *args_single)
 
void bpy_app_generic_callback (struct Main *UNUSED(main), struct PointerRNA **pointers, const int pointers_num, void *arg)
 

Variables

static PyTypeObject BlenderAppCbType
 
static PyStructSequence_Field app_cb_info_fields []
 
static PyStructSequence_Desc app_cb_info_desc
 
static PyTypeObject BPyPersistent_Type
 
static PyObject * py_cb_array [BKE_CB_EVT_TOT] = {NULL}
 

Detailed Description

This file defines a 'PyStructSequence' accessed via 'bpy.app.handlers', which exposes various lists that the script author can add callback functions into (called via blenders generic BLI_cb api)

Definition in file bpy_app_handlers.c.

Macro Definition Documentation

◆ APP_CB_OTHER_FIELDS

#define APP_CB_OTHER_FIELDS   1

◆ PERMINENT_CB_ID

#define PERMINENT_CB_ID   "_bpy_persistent"

Definition at line 99 of file bpy_app_handlers.c.

Function Documentation

◆ bpy_app_generic_callback() [1/2]

void bpy_app_generic_callback ( struct Main main,
struct PointerRNA **  pointers,
const int  pointers_num,
void arg 
)

Referenced by BPY_app_handlers_struct().

◆ bpy_app_generic_callback() [2/2]

void bpy_app_generic_callback ( struct Main UNUSEDmain,
struct PointerRNA **  pointers,
const int  pointers_num,
void arg 
)

◆ bpy_app_handlers_persistent_new()

static PyObject* bpy_app_handlers_persistent_new ( PyTypeObject *  UNUSEDtype,
PyObject *  args,
PyObject *  UNUSEDkwds 
)
static

Definition at line 101 of file bpy_app_handlers.c.

References NULL, and PERMINENT_CB_ID.

◆ BPY_app_handlers_reset()

void BPY_app_handlers_reset ( const bool  do_all)

Definition at line 253 of file bpy_app_handlers.c.

References BKE_CB_EVT_TOT, NULL, PERMINENT_CB_ID, pos, and py_cb_array.

Referenced by BPY_python_reset().

◆ BPY_app_handlers_struct()

PyObject* BPY_app_handlers_struct ( void  )

◆ choose_arguments()

static PyObject* choose_arguments ( PyObject *  func,
PyObject *  args_all,
PyObject *  args_single 
)
static

Definition at line 304 of file bpy_app_handlers.c.

Referenced by bpy_app_generic_callback().

◆ make_app_cb_info()

static PyObject* make_app_cb_info ( void  )
static

Variable Documentation

◆ app_cb_info_desc

PyStructSequence_Desc app_cb_info_desc
static
Initial value:
= {
"bpy.app.handlers",
"This module contains callback lists",
}
#define ARRAY_SIZE(arr)
static PyStructSequence_Field app_cb_info_fields[]

Definition at line 84 of file bpy_app_handlers.c.

Referenced by BPY_app_handlers_struct().

◆ app_cb_info_fields

PyStructSequence_Field app_cb_info_fields[]
static

See BKE_callbacks.h eCbEvent declaration for the policy on naming.

Definition at line 35 of file bpy_app_handlers.c.

Referenced by make_app_cb_info().

◆ BlenderAppCbType

PyTypeObject BlenderAppCbType
static

Definition at line 30 of file bpy_app_handlers.c.

Referenced by BPY_app_handlers_struct(), and make_app_cb_info().

◆ BPyPersistent_Type

PyTypeObject BPyPersistent_Type
static

Definition at line 136 of file bpy_app_handlers.c.

Referenced by BPY_app_handlers_struct(), and make_app_cb_info().

◆ py_cb_array

PyObject* py_cb_array[BKE_CB_EVT_TOT] = {NULL}
static