Blender  V3.3
bpy_rna_types_capi.c File Reference
#include <Python.h>
#include <descrobject.h>
#include "RNA_types.h"
#include "BLI_utildefines.h"
#include "bpy_library.h"
#include "bpy_rna.h"
#include "bpy_rna_callback.h"
#include "bpy_rna_context.h"
#include "bpy_rna_data.h"
#include "bpy_rna_id_collection.h"
#include "bpy_rna_text.h"
#include "bpy_rna_types_capi.h"
#include "bpy_rna_ui.h"
#include "bpy_rna_operator.h"
#include "../generic/py_capi_utils.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "MEM_guardedalloc.h"
#include "WM_api.h"

Go to the source code of this file.

Functions

Window Manager Clipboard Property

Avoid using the RNA API because this value may change between checking its length and creating the buffer, causing writes past the allocated length.

 PyDoc_STRVAR (pyrna_WindowManager_clipboard_doc, "Clipboard text storage.\n\n:type: string")
 
static PyObject * pyrna_WindowManager_clipboard_get (PyObject *UNUSED(self), void *UNUSED(flag))
 
static int pyrna_WindowManager_clipboard_set (PyObject *UNUSED(self), PyObject *value, void *UNUSED(flag))
 
Public API
void BPY_rna_types_extend_capi (void)
 

Variables

Blend Data
static struct PyMethodDef pyrna_blenddata_methods []
 
Blend Data Libraries
static struct PyMethodDef pyrna_blenddatalibraries_methods []
 
UI Layout
static struct PyMethodDef pyrna_uilayout_methods []
 
Operator
static struct PyMethodDef pyrna_operator_methods []
 
Text Editor
static struct PyMethodDef pyrna_text_methods []
 
Window Manager Type
static struct PyMethodDef pyrna_windowmanager_methods []
 
static struct PyGetSetDef pyrna_windowmanager_getset []
 
Context Type
static struct PyMethodDef pyrna_context_methods []
 

Space Type

static struct PyMethodDef pyrna_space_methods []
 
 PyDoc_STRVAR (pyrna_draw_handler_add_doc, ".. method:: draw_handler_add(callback, args, region_type, draw_type)\n" "\n" " Add a new draw handler to this space type.\n" " It will be called every time the specified region in the space type will be drawn.\n" " Note: All arguments are positional only for now.\n" "\n" " :param callback:\n" " A function that will be called when the region is drawn.\n" " It gets the specified arguments as input.\n" " :type callback: function\n" " :param args: Arguments that will be passed to the callback.\n" " :type args: tuple\n" " :param region_type: The region type the callback draws in; usually ``WINDOW``. " "(:class:`bpy.types.Region.type`)\n" " :type region_type: str\n" " :param draw_type: Usually ``POST_PIXEL`` for 2D drawing and ``POST_VIEW`` for 3D drawing. " "In some cases ``PRE_VIEW`` can be used. ``BACKDROP`` can be used for backdrops in the node " "editor.\n" " :type draw_type: str\n" " :return: Handler that can be removed later on.\n" " :rtype: object")
 
 PyDoc_STRVAR (pyrna_draw_handler_remove_doc, ".. method:: draw_handler_remove(handler, region_type)\n" "\n" " Remove a draw handler that was added previously.\n" "\n" " :param handler: The draw handler that should be removed.\n" " :type handler: object\n" " :param region_type: Region type the callback was added to.\n" " :type region_type: str\n")
 

Detailed Description

This file extends RNA types from bpy.types with C/Python API methods and attributes.

We should avoid adding code here, and prefer:

Otherwise functions can be added here as a last resort.

Definition in file bpy_rna_types_capi.c.

Function Documentation

◆ BPY_rna_types_extend_capi()

void BPY_rna_types_extend_capi ( void  )

◆ PyDoc_STRVAR() [1/3]

PyDoc_STRVAR ( pyrna_draw_handler_add_doc  ,
".. method:: draw_handler_add(callback, args, region_type, draw_type)\n" "\n" " Add a new draw handler to this space type.\n" " It will be called every time the specified region in the space type will be drawn.\n" " Note: All arguments are positional only for now.\n" "\n" " :param callback:\n" " A function that will be called when the region is drawn.\n" " It gets the specified arguments as input.\n" " :type callback: function\n" " :param args: Arguments that will be passed to the callback.\n" " :type args: tuple\n" " :param region_type: The region type the callback draws in; usually ``WINDOW``. " "(:class:`bpy.types.Region.type`)\n" " :type region_type: str\n" " :param draw_type: Usually ``POST_PIXEL`` for 2D drawing and ``POST_VIEW`` for 3D drawing. " "In some cases ``PRE_VIEW`` can be used. ``BACKDROP`` can be used for backdrops in the node " "editor.\n" " :type draw_type: str\n" " :return: Handler that can be removed later on.\n" " :rtype: object"   
)

◆ PyDoc_STRVAR() [2/3]

PyDoc_STRVAR ( pyrna_draw_handler_remove_doc  ,
".. method:: draw_handler_remove(handler, region_type)\n" "\n" " Remove a draw handler that was added previously.\n" "\n" " :param handler: The draw handler that should be removed.\n" " :type handler: object\n" " :param region_type: Region type the callback was added to.\n" " :type region_type: str\n"   
)

◆ PyDoc_STRVAR() [3/3]

PyDoc_STRVAR ( pyrna_WindowManager_clipboard_doc  ,
"Clipboard text storage.\n\n:type: string"   
)

◆ pyrna_WindowManager_clipboard_get()

static PyObject* pyrna_WindowManager_clipboard_get ( PyObject *  UNUSEDself,
void UNUSEDflag 
)
static

◆ pyrna_WindowManager_clipboard_set()

static int pyrna_WindowManager_clipboard_set ( PyObject *  UNUSEDself,
PyObject *  value,
void UNUSEDflag 
)
static

Definition at line 122 of file bpy_rna_types_capi.c.

Variable Documentation

◆ pyrna_blenddata_methods

struct PyMethodDef pyrna_blenddata_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 1 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_blenddatalibraries_methods

struct PyMethodDef pyrna_blenddatalibraries_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 1 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_context_methods

struct PyMethodDef pyrna_context_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 122 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_operator_methods

struct PyMethodDef pyrna_operator_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 1 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_space_methods

struct PyMethodDef pyrna_space_methods[]
static
Initial value:
= {
{"draw_handler_add",
METH_VARARGS | METH_CLASS,
pyrna_draw_handler_add_doc},
{"draw_handler_remove",
METH_VARARGS | METH_CLASS,
pyrna_draw_handler_remove_doc},
{NULL, NULL, 0, NULL},
}
PyObject * pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *args)
PyObject * pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args)

Definition at line 204 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_text_methods

struct PyMethodDef pyrna_text_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 1 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_uilayout_methods

struct PyMethodDef pyrna_uilayout_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL},
{NULL, NULL, 0, NULL},
}

Definition at line 1 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_windowmanager_getset

struct PyGetSetDef pyrna_windowmanager_getset[]
static
Initial value:
= {
{"clipboard",
pyrna_WindowManager_clipboard_doc,
NULL},
}
static int pyrna_WindowManager_clipboard_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(flag))
static PyObject * pyrna_WindowManager_clipboard_get(PyObject *UNUSED(self), void *UNUSED(flag))

Definition at line 122 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_windowmanager_methods

struct PyMethodDef pyrna_windowmanager_methods[]
static
Initial value:
= {
{"draw_cursor_add",
METH_VARARGS | METH_CLASS,
""},
{"draw_cursor_remove",
METH_VARARGS | METH_CLASS,
""},
{NULL, NULL, 0, NULL},
}

Definition at line 122 of file bpy_rna_types_capi.c.

Referenced by BPY_rna_types_extend_capi().