
/* Automatically generated struct definitions for the Data API.
 * Do not edit manually, changes will be overwritten.           */

#define RNA_RUNTIME

#include <float.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>

#include <stddef.h>

#include "MEM_guardedalloc.h"

#include "DNA_ID.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"

#include "BLI_utildefines.h"

#include "BKE_context.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"

#include "rna_prototypes_gen.h"

#include "rna_text.c"
#include "rna_text_api.c"

/* Autogenerated Functions */


CollectionPropertyRNA rna_TextLine_rna_properties;
PointerPropertyRNA rna_TextLine_rna_type;
StringPropertyRNA rna_TextLine_body;


extern CollectionPropertyRNA rna_ID_rna_properties;
extern PointerPropertyRNA rna_ID_rna_type;
extern StringPropertyRNA rna_ID_name;
extern IntPropertyRNA rna_ID_users;
extern BoolPropertyRNA rna_ID_use_fake_user;
extern BoolPropertyRNA rna_ID_tag;
extern BoolPropertyRNA rna_ID_is_updated;
extern BoolPropertyRNA rna_ID_is_updated_data;
extern BoolPropertyRNA rna_ID_is_library_indirect;
extern PointerPropertyRNA rna_ID_library;
extern PointerPropertyRNA rna_ID_preview;

StringPropertyRNA rna_Text_filepath;
BoolPropertyRNA rna_Text_is_dirty;
BoolPropertyRNA rna_Text_is_modified;
BoolPropertyRNA rna_Text_is_in_memory;
BoolPropertyRNA rna_Text_use_module;
BoolPropertyRNA rna_Text_use_tabs_as_spaces;
CollectionPropertyRNA rna_Text_lines;
PointerPropertyRNA rna_Text_current_line;
IntPropertyRNA rna_Text_current_character;
IntPropertyRNA rna_Text_current_line_index;
PointerPropertyRNA rna_Text_select_end_line;
IntPropertyRNA rna_Text_select_end_character;

extern FunctionRNA rna_ID_copy_func;
extern PointerPropertyRNA rna_ID_copy_id;

extern FunctionRNA rna_ID_user_clear_func;
extern FunctionRNA rna_ID_user_remap_func;
extern PointerPropertyRNA rna_ID_user_remap_new_id;

extern FunctionRNA rna_ID_make_local_func;
extern BoolPropertyRNA rna_ID_make_local_clear_proxy;
extern PointerPropertyRNA rna_ID_make_local_id;

extern FunctionRNA rna_ID_user_of_id_func;
extern PointerPropertyRNA rna_ID_user_of_id_id;
extern IntPropertyRNA rna_ID_user_of_id_count;

extern FunctionRNA rna_ID_animation_data_create_func;
extern PointerPropertyRNA rna_ID_animation_data_create_anim_data;

extern FunctionRNA rna_ID_animation_data_clear_func;
extern FunctionRNA rna_ID_update_tag_func;
extern EnumPropertyRNA rna_ID_update_tag_refresh;


extern FunctionRNA rna_Text_clear_func;
extern FunctionRNA rna_Text_write_func;
extern StringPropertyRNA rna_Text_write_text;


static PointerRNA TextLine_rna_properties_get(CollectionPropertyIterator *iter)
{
	return rna_builtin_properties_get(iter);
}

void TextLine_rna_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{

	memset(iter, 0, sizeof(*iter));
	iter->parent = *ptr;
	iter->prop = (PropertyRNA *)&rna_TextLine_rna_properties;

	rna_builtin_properties_begin(iter, ptr);

	if (iter->valid)
		iter->ptr = TextLine_rna_properties_get(iter);
}

void TextLine_rna_properties_next(CollectionPropertyIterator *iter)
{
	rna_builtin_properties_next(iter);

	if (iter->valid)
		iter->ptr = TextLine_rna_properties_get(iter);
}

void TextLine_rna_properties_end(CollectionPropertyIterator *iter)
{
	rna_iterator_listbase_end(iter);
}

int TextLine_rna_properties_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
	return rna_builtin_properties_lookup_string(ptr, key, r_ptr);
}

PointerRNA TextLine_rna_type_get(PointerRNA *ptr)
{
	return rna_builtin_type_get(ptr);
}

void TextLine_body_get(PointerRNA *ptr, char *value)
{
	rna_TextLine_body_get(ptr, value);
}

int TextLine_body_length(PointerRNA *ptr)
{
	return rna_TextLine_body_length(ptr);
}

void TextLine_body_set(PointerRNA *ptr, const char *value)
{
	rna_TextLine_body_set(ptr, value);
}

void Text_filepath_get(PointerRNA *ptr, char *value)
{
	rna_Text_filename_get(ptr, value);
}

int Text_filepath_length(PointerRNA *ptr)
{
	return rna_Text_filename_length(ptr);
}

void Text_filepath_set(PointerRNA *ptr, const char *value)
{
	rna_Text_filename_set(ptr, value);
}

int Text_is_dirty_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (((data->flags) & 1) != 0);
}

int Text_is_modified_get(PointerRNA *ptr)
{
	return rna_Text_modified_get(ptr);
}

int Text_is_in_memory_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (((data->flags) & 4) != 0);
}

int Text_use_module_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (((data->flags) & 16) != 0);
}

void Text_use_module_set(PointerRNA *ptr, int value)
{
	Text *data = (Text *)(ptr->data);
	if (value) data->flags |= 16;
	else data->flags &= ~16;
}

int Text_use_tabs_as_spaces_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (((data->flags) & 1024) != 0);
}

void Text_use_tabs_as_spaces_set(PointerRNA *ptr, int value)
{
	Text *data = (Text *)(ptr->data);
	if (value) data->flags |= 1024;
	else data->flags &= ~1024;
}

static PointerRNA Text_lines_get(CollectionPropertyIterator *iter)
{
	return rna_pointer_inherit_refine(&iter->parent, &RNA_TextLine, rna_iterator_listbase_get(iter));
}

void Text_lines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);

	memset(iter, 0, sizeof(*iter));
	iter->parent = *ptr;
	iter->prop = (PropertyRNA *)&rna_Text_lines;

	rna_iterator_listbase_begin(iter, &data->lines, NULL);

	if (iter->valid)
		iter->ptr = Text_lines_get(iter);
}

void Text_lines_next(CollectionPropertyIterator *iter)
{
	rna_iterator_listbase_next(iter);

	if (iter->valid)
		iter->ptr = Text_lines_get(iter);
}

void Text_lines_end(CollectionPropertyIterator *iter)
{
	rna_iterator_listbase_end(iter);
}

int Text_lines_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr)
{
	int found = 0;
	CollectionPropertyIterator iter;

	Text_lines_begin(&iter, ptr);

	if (iter.valid) {
		ListBaseIterator *internal = &iter.internal.listbase;
		if (internal->skip) {
			while (index-- > 0 && iter.valid) {
				rna_iterator_listbase_next(&iter);
			}
			found = (index == -1 && iter.valid);
		}
		else {
			while (index-- > 0 && internal->link)
				internal->link = internal->link->next;
			found = (index == -1 && internal->link);
		}
		if (found) *r_ptr = Text_lines_get(&iter);
	}

	Text_lines_end(&iter);

	return found;
}

PointerRNA Text_current_line_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return rna_pointer_inherit_refine(ptr, &RNA_TextLine, data->curl);
}

int Text_current_character_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (int)(data->curc);
}

int Text_current_line_index_get(PointerRNA *ptr)
{
	return rna_Text_current_line_index_get(ptr);
}

void Text_current_line_index_set(PointerRNA *ptr, int value)
{
	rna_Text_current_line_index_set(ptr, value);
}

PointerRNA Text_select_end_line_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return rna_pointer_inherit_refine(ptr, &RNA_TextLine, data->sell);
}

int Text_select_end_character_get(PointerRNA *ptr)
{
	Text *data = (Text *)(ptr->data);
	return (int)(data->selc);
}


void Text_clear(struct Text *_self)
{
	rna_Text_clear(_self);
}

void Text_clear_call(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)
{
	struct Text *_self;
	_self = (struct Text *)_ptr->data;
	
	rna_Text_clear(_self);
}

void Text_write(struct Text *_self, const char * text)
{
	rna_Text_write(_self, text);
}

void Text_write_call(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)
{
	struct Text *_self;
	const char * text;
	char *_data;
	
	_self = (struct Text *)_ptr->data;
	_data = (char *)_parms->data;
	text = *((const char * *)_data);
	
	rna_Text_write(_self, text);
}

/* Repeated prototypes to detect errors */

void rna_Text_clear(struct Text *_self);
void rna_Text_write(struct Text *_self, const char * text);

/* Text Line */
CollectionPropertyRNA rna_TextLine_rna_properties = {
	{(PropertyRNA *)&rna_TextLine_rna_type, NULL,
	-1, "rna_properties", 0, 0, 1, "Properties",
	"RNA property collection",
	0, "*",
	PROP_COLLECTION, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	TextLine_rna_properties_begin, TextLine_rna_properties_next, TextLine_rna_properties_end, TextLine_rna_properties_get, NULL, NULL, TextLine_rna_properties_lookup_string, NULL, &RNA_Property
};

PointerPropertyRNA rna_TextLine_rna_type = {
	{(PropertyRNA *)&rna_TextLine_body, (PropertyRNA *)&rna_TextLine_rna_properties,
	-1, "rna_type", 8912896, 0, 0, "RNA",
	"RNA type definition",
	0, "*",
	PROP_POINTER, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	TextLine_rna_type_get, NULL, NULL, NULL,&RNA_Struct
};

StringPropertyRNA rna_TextLine_body = {
	{NULL, (PropertyRNA *)&rna_TextLine_rna_type,
	-1, "body", 262145, 0, 0, "Line",
	"Text in the line",
	0, "Text",
	PROP_STRING, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 201326593, NULL, NULL,
	0, -1, NULL},
	TextLine_body_get, TextLine_body_length, TextLine_body_set, NULL, NULL, NULL, 0, ""
};

StructRNA RNA_TextLine = {
	{(ContainerRNA *)&RNA_Text, (ContainerRNA *)&RNA_Speaker,
	NULL,
	{(PropertyRNA *)&rna_TextLine_rna_properties, (PropertyRNA *)&rna_TextLine_body}},
	"TextLine", NULL, NULL, 4, "Text Line",
	"Line of text in a Text data-block",
	"*", 17,
	NULL, (PropertyRNA *)&rna_TextLine_rna_properties,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	{NULL, NULL}
};

/* Text */
StringPropertyRNA rna_Text_filepath = {
	{(PropertyRNA *)&rna_Text_is_dirty, NULL,
	-1, "filepath", 262145, 0, 0, "File Path",
	"Filename of the text file",
	0, "*",
	PROP_STRING, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_filepath_get, Text_filepath_length, Text_filepath_set, NULL, NULL, NULL, 0, ""
};

BoolPropertyRNA rna_Text_is_dirty = {
	{(PropertyRNA *)&rna_Text_is_modified, (PropertyRNA *)&rna_Text_filepath,
	-1, "is_dirty", 2, 0, 0, "Dirty",
	"Text file has been edited since last save",
	0, "*",
	PROP_BOOLEAN, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_is_dirty_get, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
};

BoolPropertyRNA rna_Text_is_modified = {
	{(PropertyRNA *)&rna_Text_is_in_memory, (PropertyRNA *)&rna_Text_is_dirty,
	-1, "is_modified", 2, 0, 0, "Modified",
	"Text file on disk is different than the one in memory",
	0, "*",
	PROP_BOOLEAN, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_is_modified_get, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
};

BoolPropertyRNA rna_Text_is_in_memory = {
	{(PropertyRNA *)&rna_Text_use_module, (PropertyRNA *)&rna_Text_is_modified,
	-1, "is_in_memory", 2, 0, 0, "Memory",
	"Text file is in memory, without a corresponding file on disk",
	0, "*",
	PROP_BOOLEAN, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_is_in_memory_get, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
};

BoolPropertyRNA rna_Text_use_module = {
	{(PropertyRNA *)&rna_Text_use_tabs_as_spaces, (PropertyRNA *)&rna_Text_is_in_memory,
	-1, "use_module", 3, 0, 0, "Register",
	"Register this text as a module on loading, Text name must end with \".py\"",
	0, "*",
	PROP_BOOLEAN, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_use_module_get, Text_use_module_set, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
};

BoolPropertyRNA rna_Text_use_tabs_as_spaces = {
	{(PropertyRNA *)&rna_Text_lines, (PropertyRNA *)&rna_Text_use_module,
	-1, "use_tabs_as_spaces", 3, 0, 0, "Tabs as Spaces",
	"Automatically converts all new tabs into spaces",
	0, "*",
	PROP_BOOLEAN, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_use_tabs_as_spaces_get, Text_use_tabs_as_spaces_set, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL
};

CollectionPropertyRNA rna_Text_lines = {
	{(PropertyRNA *)&rna_Text_current_line, (PropertyRNA *)&rna_Text_use_tabs_as_spaces,
	-1, "lines", 0, 0, 0, "Lines",
	"Lines of text",
	0, "*",
	PROP_COLLECTION, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_lines_begin, Text_lines_next, Text_lines_end, Text_lines_get, NULL, Text_lines_lookup_int, NULL, NULL, &RNA_TextLine
};

PointerPropertyRNA rna_Text_current_line = {
	{(PropertyRNA *)&rna_Text_current_character, (PropertyRNA *)&rna_Text_lines,
	-1, "current_line", 8650752, 0, 0, "Current Line",
	"Current line, and start line of selection if one exists",
	0, "*",
	PROP_POINTER, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_current_line_get, NULL, NULL, NULL,&RNA_TextLine
};

IntPropertyRNA rna_Text_current_character = {
	{(PropertyRNA *)&rna_Text_current_line_index, (PropertyRNA *)&rna_Text_current_line,
	-1, "current_character", 2, 0, 4, "Current Character",
	"Index of current character in current line, and also start index of character in selection if one exists",
	0, "*",
	PROP_INT, PROP_UNSIGNED | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	offsetof(Text, curc), 0, NULL},
	Text_current_character_get, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	0, 10000, 0, INT_MAX, 1, 0, NULL
};

IntPropertyRNA rna_Text_current_line_index = {
	{(PropertyRNA *)&rna_Text_select_end_line, (PropertyRNA *)&rna_Text_current_character,
	-1, "current_line_index", 3, 0, 0, "Current Line Index",
	"Index of current TextLine in TextLine collection",
	0, "*",
	PROP_INT, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 204603392, NULL, NULL,
	0, -1, NULL},
	Text_current_line_index_get, Text_current_line_index_set, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	-10000, 10000, INT_MIN, INT_MAX, 1, 0, NULL
};

PointerPropertyRNA rna_Text_select_end_line = {
	{(PropertyRNA *)&rna_Text_select_end_character, (PropertyRNA *)&rna_Text_current_line_index,
	-1, "select_end_line", 8650752, 0, 0, "Selection End Line",
	"End line of selection",
	0, "*",
	PROP_POINTER, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	Text_select_end_line_get, NULL, NULL, NULL,&RNA_TextLine
};

IntPropertyRNA rna_Text_select_end_character = {
	{NULL, (PropertyRNA *)&rna_Text_select_end_line,
	-1, "select_end_character", 2, 0, 4, "Selection End Character",
	"Index of character after end of selection in the selection end line",
	0, "*",
	PROP_INT, PROP_UNSIGNED | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	offsetof(Text, selc), 0, NULL},
	Text_select_end_character_get, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
	0, 10000, 0, INT_MAX, 1, 0, NULL
};

FunctionRNA rna_Text_clear_func = {
	{(FunctionRNA *)&rna_Text_write_func, NULL,
	NULL,
	{NULL, NULL}},
	"clear", 0, "clear the text block",
	Text_clear_call,
	NULL
};

StringPropertyRNA rna_Text_write_text = {
	{NULL, NULL,
	-1, "text", 262145, 1, 0, "",
	"New text for this data-block",
	0, "*",
	PROP_STRING, PROP_NONE | PROP_UNIT_NONE, NULL, 0, {0, 0, 0}, 0,
	NULL, 0, NULL, NULL,
	0, -1, NULL},
	NULL, NULL, NULL, NULL, NULL, NULL, 0, "Text"
};

FunctionRNA rna_Text_write_func = {
	{NULL, (FunctionRNA *)&rna_Text_clear_func,
	NULL,
	{(PropertyRNA *)&rna_Text_write_text, (PropertyRNA *)&rna_Text_write_text}},
	"write", 0, "write text at the cursor location and advance to the end of the text block",
	Text_write_call,
	NULL
};

StructRNA RNA_Text = {
	{(ContainerRNA *)&RNA_TimelineMarker, (ContainerRNA *)&RNA_TextLine,
	NULL,
	{(PropertyRNA *)&rna_Text_filepath, (PropertyRNA *)&rna_Text_select_end_character}},
	"Text", NULL, NULL, 5, "Text",
	"Text data-block referencing an external or packed text file",
	"*", 112,
	(PropertyRNA *)&rna_ID_name, (PropertyRNA *)&rna_ID_rna_properties,
	&RNA_ID,
	NULL,
	rna_ID_refine,
	NULL,
	NULL,
	NULL,
	NULL,
	rna_ID_idprops,
	{(FunctionRNA *)&rna_Text_clear_func, (FunctionRNA *)&rna_Text_write_func}
};

