Blender
V3.3
source
blender
editors
interface
interface_regions.cc
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2008 Blender Foundation. All rights reserved. */
3
12
#include "
BLI_listbase.h
"
13
#include "
BLI_utildefines.h
"
14
#include "
MEM_guardedalloc.h
"
15
16
#include "
BKE_context.h
"
17
#include "
BKE_screen.h
"
18
19
#include "
WM_api.h
"
20
#include "
wm_draw.h
"
21
22
#include "
ED_screen.h
"
23
24
#include "
interface_regions_intern.h
"
25
26
ARegion
*
ui_region_temp_add
(
bScreen
*screen)
27
{
28
ARegion
*region = MEM_cnew<ARegion>(__func__);
29
BLI_addtail
(&screen->
regionbase
, region);
30
31
region->
regiontype
=
RGN_TYPE_TEMPORARY
;
32
region->
alignment
=
RGN_ALIGN_FLOAT
;
33
34
return
region;
35
}
36
37
void
ui_region_temp_remove
(
bContext
*
C
,
bScreen
*screen,
ARegion
*region)
38
{
39
wmWindow
*win =
CTX_wm_window
(
C
);
40
41
BLI_assert
(region->
regiontype
==
RGN_TYPE_TEMPORARY
);
42
BLI_assert
(
BLI_findindex
(&screen->
regionbase
, region) != -1);
43
if
(win) {
44
wm_draw_region_clear
(win, region);
45
}
46
47
ED_region_exit
(
C
, region);
48
BKE_area_region_free
(
nullptr
, region);
/* nullptr: no spacetype */
49
BLI_freelinkN
(&screen->
regionbase
, region);
50
}
BKE_context.h
CTX_wm_window
struct wmWindow * CTX_wm_window(const bContext *C)
Definition:
context.c:723
BKE_screen.h
BKE_area_region_free
void BKE_area_region_free(struct SpaceType *st, struct ARegion *region)
Definition:
screen.c:626
BLI_assert
#define BLI_assert(a)
Definition:
BLI_assert.h:46
BLI_listbase.h
BLI_freelinkN
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition:
listbase.c:239
BLI_addtail
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition:
listbase.c:80
BLI_findindex
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_utildefines.h
RGN_TYPE_TEMPORARY
@ RGN_TYPE_TEMPORARY
Definition:
DNA_screen_types.h:645
RGN_ALIGN_FLOAT
@ RGN_ALIGN_FLOAT
Definition:
DNA_screen_types.h:684
ED_screen.h
ED_region_exit
void ED_region_exit(struct bContext *C, struct ARegion *region)
Definition:
screen_edit.c:686
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
C
#define C
Definition:
RandGen.cpp:25
WM_api.h
ui_region_temp_remove
void ui_region_temp_remove(bContext *C, bScreen *screen, ARegion *region)
Definition:
interface_regions.cc:37
ui_region_temp_add
ARegion * ui_region_temp_add(bScreen *screen)
Definition:
interface_regions.cc:26
interface_regions_intern.h
ARegion
Definition:
DNA_screen_types.h:447
ARegion::alignment
short alignment
Definition:
DNA_screen_types.h:464
ARegion::regiontype
short regiontype
Definition:
DNA_screen_types.h:462
bContext
Definition:
context.c:56
bScreen
Definition:
DNA_screen_types.h:39
bScreen::regionbase
ListBase regionbase
Definition:
DNA_screen_types.h:51
wmWindow
Definition:
DNA_windowmanager_types.h:225
wm_draw_region_clear
void wm_draw_region_clear(wmWindow *win, ARegion *UNUSED(region))
Definition:
wm_draw.c:1354
wm_draw.h
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1