Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_topbar/space_topbar.c
| Show All 22 Lines | |||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_space_api.h" | #include "ED_space_api.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 "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_message.h" | #include "WM_message.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| /* ******************** default callbacks for topbar space ***************** */ | /* ******************** default callbacks for topbar space ***************** */ | ||||
| ▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | static void undo_history_menu_register(void) | ||||
| mt = MEM_callocN(sizeof(MenuType), __func__); | mt = MEM_callocN(sizeof(MenuType), __func__); | ||||
| strcpy(mt->idname, "TOPBAR_MT_undo_history"); | strcpy(mt->idname, "TOPBAR_MT_undo_history"); | ||||
| strcpy(mt->label, N_("Undo History")); | strcpy(mt->label, N_("Undo History")); | ||||
| strcpy(mt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); | strcpy(mt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); | ||||
| mt->draw = undo_history_draw_menu; | mt->draw = undo_history_draw_menu; | ||||
| WM_menutype_add(mt); | WM_menutype_add(mt); | ||||
| } | } | ||||
| static void topbar_blend_write(BlendWriter *writer, SpaceLink *sl) | |||||
| { | |||||
| BLO_write_struct(writer, SpaceTopBar, sl); | |||||
| } | |||||
| void ED_spacetype_topbar(void) | void ED_spacetype_topbar(void) | ||||
| { | { | ||||
| SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype topbar"); | SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype topbar"); | ||||
| ARegionType *art; | ARegionType *art; | ||||
| st->spaceid = SPACE_TOPBAR; | st->spaceid = SPACE_TOPBAR; | ||||
| STRNCPY(st->name, "Top Bar"); | STRNCPY(st->name, "Top Bar"); | ||||
| st->create = topbar_create; | st->create = topbar_create; | ||||
| st->free = topbar_free; | st->free = topbar_free; | ||||
| st->init = topbar_init; | st->init = topbar_init; | ||||
| st->duplicate = topbar_duplicate; | st->duplicate = topbar_duplicate; | ||||
| st->operatortypes = topbar_operatortypes; | st->operatortypes = topbar_operatortypes; | ||||
| st->keymap = topbar_keymap; | st->keymap = topbar_keymap; | ||||
| st->blend_write = topbar_blend_write; | |||||
| /* regions: main window */ | /* regions: main window */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype topbar main region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype topbar main region"); | ||||
| art->regionid = RGN_TYPE_WINDOW; | art->regionid = RGN_TYPE_WINDOW; | ||||
| art->init = topbar_main_region_init; | art->init = topbar_main_region_init; | ||||
| art->layout = ED_region_header_layout; | art->layout = ED_region_header_layout; | ||||
| art->draw = ED_region_header_draw; | art->draw = ED_region_header_draw; | ||||
| art->listener = topbar_main_region_listener; | art->listener = topbar_main_region_listener; | ||||
| Show All 24 Lines | |||||