Blender  V3.3
Classes | Macros
bpy_rna_text.c File Reference
#include <Python.h>
#include "DNA_text_types.h"
#include "MEM_guardedalloc.h"
#include "WM_api.h"
#include "BKE_text.h"
#include "bpy_capi_utils.h"
#include "bpy_rna.h"
#include "bpy_rna_text.h"

Go to the source code of this file.

Classes

struct  TextRegion
 

Macros

#define PY_SSIZE_T_CLEAN
 

Typedefs

Data structures.
typedef struct TextRegion TextRegion
 

Text Editor Get / Set region text API

PyMethodDef BPY_rna_region_as_string_method_def
 
PyMethodDef BPY_rna_region_from_string_method_def
 
 PyDoc_STRVAR (bpy_rna_region_as_string_doc, ".. method:: region_as_string(range=None)\n" "\n" " :arg range: The region of text to be returned, " "defaulting to the selection when no range is passed.\n" " Each int pair represents a line and column: " "((start_line, start_column), (end_line, end_column))\n" " The values match Python's slicing logic " "(negative values count backwards from the end, the end value is not inclusive).\n" " :type range: Two pairs of ints\n" " :return: The specified region as a string.\n" " :rtype: str.\n")
 
static PyObject * bpy_rna_region_as_string (PyObject *self, PyObject *args, PyObject *kwds)
 
 PyDoc_STRVAR (bpy_rna_region_from_string_doc, ".. method:: region_from_string(body, range=None)\n" "\n" " :arg body: The text to be inserted.\n" " :type body: str\n" " :arg range: The region of text to be returned, " "defaulting to the selection when no range is passed.\n" " Each int pair represents a line and column: " "((start_line, start_column), (end_line, end_column))\n" " The values match Python's slicing logic " "(negative values count backwards from the end, the end value is not inclusive).\n" " :type range: Two pairs of ints\n")
 
static PyObject * bpy_rna_region_from_string (PyObject *self, PyObject *args, PyObject *kwds)
 

Detailed Description

This file extends the text editor with C/Python API methods and attributes.

Definition in file bpy_rna_text.c.

Macro Definition Documentation

◆ PY_SSIZE_T_CLEAN

#define PY_SSIZE_T_CLEAN

Definition at line 9 of file bpy_rna_text.c.

Typedef Documentation

◆ TextRegion

typedef struct TextRegion TextRegion

Struct representing a selection which is extracted from Python arguments.

Function Documentation

◆ bpy_rna_region_as_string()

static PyObject* bpy_rna_region_as_string ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

◆ bpy_rna_region_from_string()

static PyObject* bpy_rna_region_from_string ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

◆ PyDoc_STRVAR() [1/2]

PyDoc_STRVAR ( bpy_rna_region_as_string_doc  ,
".. method:: region_as_string(range=None)\n" "\n" " :arg range: The region of text to be  returned,
" "defaulting to the selection when no range is passed.\n" " Each int pair represents a line and column:" "((start_line, start_column),(end_line, end_column))\n" " The values match Python 's slicing logic " "(negative values count backwards from the end, the end value is not inclusive).\n" " :type range:Two pairs of ints\n" " :return:The specified region as a string.\n" " :rtype:str.\n"   
)

◆ PyDoc_STRVAR() [2/2]

PyDoc_STRVAR ( bpy_rna_region_from_string_doc  ,
".. method:: region_from_string(body, range=None)\n" "\n" " :arg body: The text to be inserted.\n" " :type body: str\n" " :arg range: The region of text to be  returned,
" "defaulting to the selection when no range is passed.\n" " Each int pair represents a line and column:" "((start_line, start_column),(end_line, end_column))\n" " The values match Python 's slicing logic " "(negative values count backwards from the end, the end value is not inclusive).\n" " :type range:Two pairs of ints\n"   
)

Variable Documentation

◆ BPY_rna_region_as_string_method_def

PyMethodDef BPY_rna_region_as_string_method_def
Initial value:
= {
"region_as_string",
METH_VARARGS | METH_KEYWORDS,
bpy_rna_region_as_string_doc,
}
static PyObject * bpy_rna_region_as_string(PyObject *self, PyObject *args, PyObject *kwds)
Definition: bpy_rna_text.c:58

Definition at line 93 of file bpy_rna_text.c.

Referenced by BPY_rna_types_extend_capi().

◆ BPY_rna_region_from_string_method_def

PyMethodDef BPY_rna_region_from_string_method_def
Initial value:
= {
"region_from_string",
METH_VARARGS | METH_KEYWORDS,
bpy_rna_region_from_string_doc,
}
static PyObject * bpy_rna_region_from_string(PyObject *self, PyObject *args, PyObject *kwds)
Definition: bpy_rna_text.c:112

Definition at line 155 of file bpy_rna_text.c.

Referenced by BPY_rna_types_extend_capi().