28static void rna_Text_filepath_get(
PointerRNA *
ptr,
char *value)
33 strcpy(value, text->filepath);
43 return (text->filepath) ? strlen(text->filepath) : 0;
46static void rna_Text_filepath_set(
PointerRNA *
ptr,
const char *value)
58 text->filepath =
nullptr;
74static void rna_Text_current_line_index_set(
PointerRNA *
ptr,
int value)
78 if (line ==
nullptr) {
91static void rna_Text_select_end_line_index_set(
PointerRNA *
ptr,
int value)
95 if (line ==
nullptr) {
104 const Text *text =
static_cast<const Text *
>(
ptr->data);
109static void rna_Text_current_character_set(
PointerRNA *
ptr,
const int index)
123static void rna_Text_select_end_character_set(
PointerRNA *
ptr,
const int index)
130static void rna_TextLine_body_get(
PointerRNA *
ptr,
char *value)
135 strcpy(value, line->
line);
148static void rna_TextLine_body_set(
PointerRNA *
ptr,
const char *value)
151 size_t len = strlen(value);
159 memcpy(line->
line, value,
len + 1);
176 prop,
"rna_TextLine_body_get",
"rna_TextLine_body_length",
"rna_TextLine_body_set");
186 {0,
"TABS", 0,
"Tabs",
"Indent using tabs"},
188 {0,
nullptr, 0,
nullptr,
nullptr},
196 srna,
"Text",
"Text data-block referencing an external or packed text file");
202 prop,
"rna_Text_filepath_get",
"rna_Text_filepath_length",
"rna_Text_filepath_set");
215 prop,
"Modified",
"Text file on disk is different than the one in memory");
221 prop,
"Memory",
"Text file is in memory, without a corresponding file on disk");
244 prop,
"Current Line",
"Current line, and start line of selection if one exists");
250 "Index of current character in current line, and also start index of "
251 "character in selection if one exists");
253 prop,
"rna_Text_current_character_get",
"rna_Text_current_character_set",
nullptr);
258 prop,
"rna_Text_current_line_index_get",
"rna_Text_current_line_index_set",
nullptr);
260 prop,
"Current Line Index",
"Index of current TextLine in TextLine collection");
272 prop,
"rna_Text_select_end_line_index_get",
"rna_Text_select_end_line_index_set",
nullptr);
279 "Selection End Character",
280 "Index of character after end of selection in the selection end line");
282 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)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) 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)
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
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
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)