Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_text/space_text.c
| Show All 23 Lines | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "BLO_read_write.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_path.h" | #include "RNA_path.h" | ||||
| #include "text_format.h" | #include "text_format.h" | ||||
| #include "text_intern.h" /* own include */ | #include "text_intern.h" /* own include */ | ||||
| /* ******************** default callbacks for text space ***************** */ | /* ******************** default callbacks for text space ***************** */ | ||||
| ▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | |||||
| static void text_id_remap(ScrArea *UNUSED(area), | static void text_id_remap(ScrArea *UNUSED(area), | ||||
| SpaceLink *slink, | SpaceLink *slink, | ||||
| const struct IDRemapper *mappings) | const struct IDRemapper *mappings) | ||||
| { | { | ||||
| SpaceText *stext = (SpaceText *)slink; | SpaceText *stext = (SpaceText *)slink; | ||||
| BKE_id_remapper_apply(mappings, (ID **)&stext->text, ID_REMAP_APPLY_ENSURE_REAL); | BKE_id_remapper_apply(mappings, (ID **)&stext->text, ID_REMAP_APPLY_ENSURE_REAL); | ||||
| } | } | ||||
| static void text_blend_read_data(BlendDataReader *UNUSED(reader), SpaceLink *sl) | |||||
| { | |||||
| SpaceText *st = (SpaceText *)sl; | |||||
| memset(&st->runtime, 0x0, sizeof(st->runtime)); | |||||
| } | |||||
| static void text_blend_read_lib(BlendLibReader *reader, ID *parent_id, SpaceLink *sl) | |||||
| { | |||||
| SpaceText *st = (SpaceText *)sl; | |||||
| BLO_read_id_address(reader, parent_id->lib, &st->text); | |||||
| } | |||||
| static void text_blend_write(BlendWriter *writer, SpaceLink *sl) | |||||
| { | |||||
| BLO_write_struct(writer, SpaceText, sl); | |||||
| } | |||||
| /********************* registration ********************/ | /********************* registration ********************/ | ||||
| void ED_spacetype_text(void) | void ED_spacetype_text(void) | ||||
| { | { | ||||
| SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype text"); | SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype text"); | ||||
| ARegionType *art; | ARegionType *art; | ||||
| st->spaceid = SPACE_TEXT; | st->spaceid = SPACE_TEXT; | ||||
| STRNCPY(st->name, "Text"); | STRNCPY(st->name, "Text"); | ||||
| st->create = text_create; | st->create = text_create; | ||||
| st->free = text_free; | st->free = text_free; | ||||
| st->init = text_init; | st->init = text_init; | ||||
| st->duplicate = text_duplicate; | st->duplicate = text_duplicate; | ||||
| st->operatortypes = text_operatortypes; | st->operatortypes = text_operatortypes; | ||||
| st->keymap = text_keymap; | st->keymap = text_keymap; | ||||
| st->listener = text_listener; | st->listener = text_listener; | ||||
| st->context = text_context; | st->context = text_context; | ||||
| st->dropboxes = text_dropboxes; | st->dropboxes = text_dropboxes; | ||||
| st->id_remap = text_id_remap; | st->id_remap = text_id_remap; | ||||
| st->blend_read_data = text_blend_read_data; | |||||
| st->blend_read_lib = text_blend_read_lib; | |||||
| st->blend_write = text_blend_write; | |||||
| /* regions: main window */ | /* regions: main window */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype text region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype text region"); | ||||
| art->regionid = RGN_TYPE_WINDOW; | art->regionid = RGN_TYPE_WINDOW; | ||||
| art->init = text_main_region_init; | art->init = text_main_region_init; | ||||
| art->draw = text_main_region_draw; | art->draw = text_main_region_draw; | ||||
| art->cursor = text_cursor; | art->cursor = text_cursor; | ||||
| art->event_cursor = true; | art->event_cursor = true; | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||