Blender
V2.93
source
blender
editors
interface
interface_regions.c
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*
16
* The Original Code is Copyright (C) 2008 Blender Foundation.
17
* All rights reserved.
18
*/
19
28
#include "
BLI_listbase.h
"
29
#include "
BLI_utildefines.h
"
30
#include "
MEM_guardedalloc.h
"
31
32
#include "
BKE_context.h
"
33
#include "
BKE_screen.h
"
34
35
#include "
WM_api.h
"
36
#include "
wm_draw.h
"
37
38
#include "
ED_screen.h
"
39
40
#include "
interface_regions_intern.h
"
41
42
ARegion
*
ui_region_temp_add
(
bScreen
*screen)
43
{
44
ARegion
*region =
MEM_callocN
(
sizeof
(
ARegion
), __func__);
45
BLI_addtail
(&screen->
regionbase
, region);
46
47
region->
regiontype
=
RGN_TYPE_TEMPORARY
;
48
region->
alignment
=
RGN_ALIGN_FLOAT
;
49
50
return
region;
51
}
52
53
void
ui_region_temp_remove
(
bContext
*
C
,
bScreen
*screen,
ARegion
*region)
54
{
55
wmWindow
*win =
CTX_wm_window
(
C
);
56
57
BLI_assert
(region->
regiontype
==
RGN_TYPE_TEMPORARY
);
58
BLI_assert
(
BLI_findindex
(&screen->
regionbase
, region) != -1);
59
if
(win) {
60
wm_draw_region_clear
(win, region);
61
}
62
63
ED_region_exit
(
C
, region);
64
BKE_area_region_free
(
NULL
, region);
/* NULL: no spacetype */
65
BLI_freelinkN
(&screen->
regionbase
, region);
66
}
BKE_context.h
CTX_wm_window
struct wmWindow * CTX_wm_window(const bContext *C)
Definition:
context.c:699
BKE_screen.h
BKE_area_region_free
void BKE_area_region_free(struct SpaceType *st, struct ARegion *region)
Definition:
screen.c:663
BLI_assert
#define BLI_assert(a)
Definition:
BLI_assert.h:58
BLI_listbase.h
BLI_freelinkN
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition:
listbase.c:281
BLI_addtail
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition:
listbase.c:110
BLI_findindex
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_utildefines.h
RGN_ALIGN_FLOAT
@ RGN_ALIGN_FLOAT
Definition:
DNA_screen_types.h:668
RGN_TYPE_TEMPORARY
@ RGN_TYPE_TEMPORARY
Definition:
DNA_screen_types.h:632
ED_screen.h
ED_region_exit
void ED_region_exit(struct bContext *C, struct ARegion *region)
Definition:
screen_edit.c:572
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
C
#define C
Definition:
RandGen.cpp:39
WM_api.h
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:224
ui_region_temp_remove
void ui_region_temp_remove(bContext *C, bScreen *screen, ARegion *region)
Definition:
interface_regions.c:53
ui_region_temp_add
ARegion * ui_region_temp_add(bScreen *screen)
Definition:
interface_regions.c:42
interface_regions_intern.h
MEM_callocN
void *(* MEM_callocN)(size_t len, const char *str)
Definition:
mallocn.c:45
ARegion
Definition:
DNA_screen_types.h:439
ARegion::alignment
short alignment
Definition:
DNA_screen_types.h:456
ARegion::regiontype
short regiontype
Definition:
DNA_screen_types.h:454
bContext
Definition:
context.c:69
bScreen
Definition:
DNA_screen_types.h:54
bScreen::regionbase
ListBase regionbase
Definition:
DNA_screen_types.h:65
wmWindow
Definition:
DNA_windowmanager_types.h:228
wm_draw_region_clear
void wm_draw_region_clear(wmWindow *win, ARegion *UNUSED(region))
Definition:
wm_draw.c:1080
wm_draw.h
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1