30static void rna_Text_filepath_get(
PointerRNA *
ptr,
char *value)
35 strcpy(value, text->filepath);
45 return (text->filepath) ? strlen(text->filepath) : 0;
48static void rna_Text_filepath_set(
PointerRNA *
ptr,
const char *value)
60 text->filepath =
nullptr;
76static void rna_Text_current_line_index_set(
PointerRNA *
ptr,
int value)
80 if (line ==
nullptr) {
81 line =
static_cast<TextLine *
>(text->lines.last);
93static void rna_Text_select_end_line_index_set(
PointerRNA *
ptr,
int value)
97 if (line ==
nullptr) {
98 line =
static_cast<TextLine *
>(text->lines.last);
111static void rna_Text_current_character_set(
PointerRNA *
ptr,
const int index)
125static void rna_Text_select_end_character_set(
PointerRNA *
ptr,
const int index)
132static void rna_TextLine_body_get(
PointerRNA *
ptr,
char *value)
137 strcpy(value, line->line);
150static void rna_TextLine_body_set(
PointerRNA *
ptr,
const char *value)
153 int len = strlen(value);
159 line->line =
static_cast<char *
>(
MEM_mallocN((
len + 1) *
sizeof(
char),
"rna_text_body"));
161 memcpy(line->line, value,
len + 1);
165 line->format =
nullptr;
181 prop,
"rna_TextLine_body_get",
"rna_TextLine_body_length",
"rna_TextLine_body_set");
191 {0,
"TABS", 0,
"Tabs",
"Indent using tabs"},
193 {0,
nullptr, 0,
nullptr,
nullptr},
201 srna,
"Text",
"Text data-block referencing an external or packed text file");
207 prop,
"rna_Text_filepath_get",
"rna_Text_filepath_length",
"rna_Text_filepath_set");
220 prop,
"Modified",
"Text file on disk is different than the one in memory");
226 prop,
"Memory",
"Text file is in memory, without a corresponding file on disk");
249 prop,
"Current Line",
"Current line, and start line of selection if one exists");
255 "Index of current character in current line, and also start index of "
256 "character in selection if one exists");
258 prop,
"rna_Text_current_character_get",
"rna_Text_current_character_set",
nullptr);
263 prop,
"rna_Text_current_line_index_get",
"rna_Text_current_line_index_set",
nullptr);
265 prop,
"Current Line Index",
"Index of current TextLine in TextLine collection");
277 prop,
"rna_Text_select_end_line_index_get",
"rna_Text_select_end_line_index_set",
nullptr);
284 "Selection End Character",
285 "Index of character after end of selection in the selection end line");
287 prop,
"rna_Text_select_end_character_get",
"rna_Text_select_end_character_set",
nullptr);
void int BKE_text_file_modified_check(const struct Text *text)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t size_t int BLI_str_utf8_offset_to_index(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLT_I18NCONTEXT_ID_TEXT
Read Guarded memory(de)allocation.
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_api_text(StructRNA *srna)
static void rna_def_text_line(BlenderRNA *brna)
static void rna_def_text(BlenderRNA *brna)
void RNA_def_text(BlenderRNA *brna)