Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_action/space_action.c
| Show All 36 Lines | |||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| #include "ED_anim_api.h" | #include "ED_anim_api.h" | ||||
| #include "ED_markers.h" | #include "ED_markers.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_space_api.h" | #include "ED_space_api.h" | ||||
| #include "ED_time_scrub_ui.h" | #include "ED_time_scrub_ui.h" | ||||
| #include "BLO_read_write.h" | |||||
| #include "action_intern.h" /* own include */ | #include "action_intern.h" /* own include */ | ||||
| /* ******************** default callbacks for action space ***************** */ | /* ******************** default callbacks for action space ***************** */ | ||||
| static SpaceLink *action_create(const ScrArea *area, const Scene *scene) | static SpaceLink *action_create(const ScrArea *area, const Scene *scene) | ||||
| { | { | ||||
| SpaceAction *saction; | SpaceAction *saction; | ||||
| ARegion *region; | ARegion *region; | ||||
| ▲ Show 20 Lines • Show All 776 Lines • ▼ Show 20 Lines | |||||
| static void action_space_subtype_item_extend(bContext *UNUSED(C), | static void action_space_subtype_item_extend(bContext *UNUSED(C), | ||||
| EnumPropertyItem **item, | EnumPropertyItem **item, | ||||
| int *totitem) | int *totitem) | ||||
| { | { | ||||
| RNA_enum_items_add(item, totitem, rna_enum_space_action_mode_items); | RNA_enum_items_add(item, totitem, rna_enum_space_action_mode_items); | ||||
| } | } | ||||
| static void action_blend_read_data(BlendDataReader *UNUSED(reader), SpaceLink *sl) | |||||
| { | |||||
| SpaceAction *saction = (SpaceAction *)sl; | |||||
| memset(&saction->runtime, 0x0, sizeof(saction->runtime)); | |||||
| } | |||||
| static void action_blend_read_lib(BlendLibReader *reader, ID *parent_id, SpaceLink *sl) | |||||
| { | |||||
| SpaceAction *saction = (SpaceAction *)sl; | |||||
| bDopeSheet *ads = &saction->ads; | |||||
| if (ads) { | |||||
| BLO_read_id_address(reader, parent_id->lib, &ads->source); | |||||
| BLO_read_id_address(reader, parent_id->lib, &ads->filter_grp); | |||||
| } | |||||
| BLO_read_id_address(reader, parent_id->lib, &saction->action); | |||||
| } | |||||
| static void action_blend_write(BlendWriter *writer, SpaceLink *sl) | |||||
| { | |||||
| BLO_write_struct(writer, SpaceAction, sl); | |||||
| } | |||||
| void ED_spacetype_action(void) | void ED_spacetype_action(void) | ||||
| { | { | ||||
| SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype action"); | SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype action"); | ||||
| ARegionType *art; | ARegionType *art; | ||||
| st->spaceid = SPACE_ACTION; | st->spaceid = SPACE_ACTION; | ||||
| STRNCPY(st->name, "Action"); | STRNCPY(st->name, "Action"); | ||||
| st->create = action_create; | st->create = action_create; | ||||
| st->free = action_free; | st->free = action_free; | ||||
| st->init = action_init; | st->init = action_init; | ||||
| st->duplicate = action_duplicate; | st->duplicate = action_duplicate; | ||||
| st->operatortypes = action_operatortypes; | st->operatortypes = action_operatortypes; | ||||
| st->keymap = action_keymap; | st->keymap = action_keymap; | ||||
| st->listener = action_listener; | st->listener = action_listener; | ||||
| st->refresh = action_refresh; | st->refresh = action_refresh; | ||||
| st->id_remap = action_id_remap; | st->id_remap = action_id_remap; | ||||
| st->space_subtype_item_extend = action_space_subtype_item_extend; | st->space_subtype_item_extend = action_space_subtype_item_extend; | ||||
| st->space_subtype_get = action_space_subtype_get; | st->space_subtype_get = action_space_subtype_get; | ||||
| st->space_subtype_set = action_space_subtype_set; | st->space_subtype_set = action_space_subtype_set; | ||||
| st->blend_read_data = action_blend_read_data; | |||||
| st->blend_read_lib = action_blend_read_lib; | |||||
| st->blend_write = action_blend_write; | |||||
| /* regions: main window */ | /* regions: main window */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype action region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype action region"); | ||||
| art->regionid = RGN_TYPE_WINDOW; | art->regionid = RGN_TYPE_WINDOW; | ||||
| art->init = action_main_region_init; | art->init = action_main_region_init; | ||||
| art->draw = action_main_region_draw; | art->draw = action_main_region_draw; | ||||
| art->draw_overlay = action_main_region_draw_overlay; | art->draw_overlay = action_main_region_draw_overlay; | ||||
| art->listener = action_main_region_listener; | art->listener = action_main_region_listener; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||