Blender  V2.93
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 
34 {
35  bScreen *screen = CTX_wm_screen(C);
36  if (screen == NULL) {
37  return NULL;
38  }
40  if (area == NULL) {
41  return NULL;
42  }
43 
45 
46  return region;
47 }
48 
50 {
51  bScreen *screen = CTX_wm_screen(C);
52  if (screen == NULL) {
53  return NULL;
54  }
56  if (area == NULL) {
57  return NULL;
58  }
59  if (area) {
60  return area->spacedata.first;
61  }
62 
63  return NULL;
64 }
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
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
@ SPACE_VIEW3D
#define C
Definition: RandGen.cpp:39
View3D * get_invoke_view3d(bContext *C)
ARegion * get_invoke_region(bContext *C)
static void area(int d1, int d2, int e1, int e2, float weights[2])