Blender
V2.93
source
blender
editors
io
io_gpencil_utils.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) 2020 Blender Foundation.
17
* All rights reserved.
18
*/
19
24
#include "
DNA_space_types.h
"
25
26
#include "
BKE_context.h
"
27
#include "
BKE_screen.h
"
28
29
#include "
WM_api.h
"
30
31
#include "
io_gpencil.h
"
32
33
ARegion
*
get_invoke_region
(
bContext
*
C
)
34
{
35
bScreen
*screen =
CTX_wm_screen
(
C
);
36
if
(screen ==
NULL
) {
37
return
NULL
;
38
}
39
ScrArea
*
area
=
BKE_screen_find_big_area
(screen,
SPACE_VIEW3D
, 0);
40
if
(
area
==
NULL
) {
41
return
NULL
;
42
}
43
44
ARegion
*region =
BKE_area_find_region_type
(
area
,
RGN_TYPE_WINDOW
);
45
46
return
region;
47
}
48
49
View3D
*
get_invoke_view3d
(
bContext
*
C
)
50
{
51
bScreen
*screen =
CTX_wm_screen
(
C
);
52
if
(screen ==
NULL
) {
53
return
NULL
;
54
}
55
ScrArea
*
area
=
BKE_screen_find_big_area
(screen,
SPACE_VIEW3D
, 0);
56
if
(
area
==
NULL
) {
57
return
NULL
;
58
}
59
if
(
area
) {
60
return
area
->spacedata.first;
61
}
62
63
return
NULL
;
64
}
BKE_context.h
CTX_wm_screen
struct bScreen * CTX_wm_screen(const bContext *C)
Definition:
context.c:709
BKE_screen.h
BKE_area_find_region_type
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
BKE_screen_find_big_area
struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, const int spacetype, const short min)
Definition:
screen.c:983
RGN_TYPE_WINDOW
@ RGN_TYPE_WINDOW
Definition:
DNA_screen_types.h:629
DNA_space_types.h
SPACE_VIEW3D
@ SPACE_VIEW3D
Definition:
DNA_space_types.h:1970
C
#define C
Definition:
RandGen.cpp:39
WM_api.h
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:224
io_gpencil.h
get_invoke_view3d
View3D * get_invoke_view3d(bContext *C)
Definition:
io_gpencil_utils.c:49
get_invoke_region
ARegion * get_invoke_region(bContext *C)
Definition:
io_gpencil_utils.c:33
blender::compositor::area
static void area(int d1, int d2, int e1, int e2, float weights[2])
Definition:
COM_SMAAOperation.cc:123
ARegion
Definition:
DNA_screen_types.h:439
ScrArea
Definition:
DNA_screen_types.h:360
View3D
Definition:
DNA_view3d_types.h:264
bContext
Definition:
context.c:69
bScreen
Definition:
DNA_screen_types.h:54
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1