Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_hud.c
| Show All 21 Lines | |||||
| * | * | ||||
| * Floating Persistent Region | * Floating Persistent Region | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_screen_types.h" | |||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_rect.h" | #include "BLI_rect.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| ▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | ARegionType *ED_area_type_hud(int space_type) | ||||
| ARegionType *art = MEM_callocN(sizeof(ARegionType), __func__); | ARegionType *art = MEM_callocN(sizeof(ARegionType), __func__); | ||||
| art->regionid = RGN_TYPE_HUD; | art->regionid = RGN_TYPE_HUD; | ||||
| art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D; | art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D; | ||||
| art->layout = hud_region_layout; | art->layout = hud_region_layout; | ||||
| art->draw = hud_region_draw; | art->draw = hud_region_draw; | ||||
| art->init = hud_region_init; | art->init = hud_region_init; | ||||
| art->free = hud_region_free; | art->free = hud_region_free; | ||||
| /* We need to indicate a preferred size to avoid false `RGN_FLAG_TOO_SMALL` | |||||
| * the first time the region is created. */ | |||||
| art->prefsizex = AREAMINX; | |||||
| art->prefsizey = HEADERY; | |||||
| hud_panels_register(art, space_type, art->regionid); | hud_panels_register(art, space_type, art->regionid); | ||||
| art->lock = 1; /* can become flag, see BKE_spacedata_draw_locks */ | art->lock = 1; /* can become flag, see BKE_spacedata_draw_locks */ | ||||
| return art; | return art; | ||||
| } | } | ||||
| static ARegion *hud_region_add(ScrArea *sa) | static ARegion *hud_region_add(ScrArea *sa) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines | |||||