68 static const char *_keywords[] = {
"range",
nullptr};
69 static _PyArg_Parser _parser = {
77 if (!_PyArg_ParseTupleAndKeywordsFast(
78 args, kwds, &_parser, ®ion.curl, ®ion.curc, ®ion.sell, ®ion.selc))
83 if (kwds && PyDict_GET_SIZE(kwds) > 0) {
84 txt_sel_set(text, region.curl, region.curc, region.sell, region.selc);
89 return PyUnicode_FromString(
"");
92 PyObject *sel_text = PyUnicode_FromString(buf);
138 static const char *_keywords[] = {
"",
"range",
nullptr};
139 static _PyArg_Parser _parser = {
144 ":region_from_string",
148 if (!_PyArg_ParseTupleAndKeywordsFast(args,
161 if (kwds && PyDict_GET_SIZE(kwds) > 0) {
162 txt_sel_set(text, region.curl, region.curc, region.sell, region.selc);
bool txt_has_sel(const struct Text *text)
void txt_sel_set(struct Text *text, int startl, int startc, int endl, int endc)
char * txt_sel_to_buf(const struct Text *text, size_t *r_buf_strlen)
void txt_insert_buf(struct Text *text, const char *in_buffer, int in_buffer_len) ATTR_NONNULL(1
static PyObject * bpy_rna_region_from_string(PyObject *self, PyObject *args, PyObject *kwds)
PyMethodDef BPY_rna_region_from_string_method_def
PyMethodDef BPY_rna_region_as_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: tuple[tuple[int, int], tuple[int, int]]\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)