Blender  V2.93
clip_toolbar.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) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <string.h>
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "BLI_blenlib.h"
29 #include "BLI_utildefines.h"
30 
31 #include "BKE_context.h"
32 #include "BKE_screen.h"
33 
34 #include "WM_types.h"
35 
36 #include "ED_screen.h"
37 
38 #include "clip_intern.h" /* own include */
39 
40 /* ************************ header area region *********************** */
41 
42 /************************** properties ******************************/
43 
45 {
46  ARegion *region, *arnew;
47 
49  if (region) {
50  return region;
51  }
52 
53  /* add subdiv level; after header */
55 
56  /* is error! */
57  if (region == NULL) {
58  return NULL;
59  }
60 
61  arnew = MEM_callocN(sizeof(ARegion), "clip properties region");
62 
63  BLI_insertlinkafter(&area->regionbase, region, arnew);
64  arnew->regiontype = RGN_TYPE_UI;
65  arnew->alignment = RGN_ALIGN_RIGHT;
66 
67  arnew->flag = RGN_FLAG_HIDDEN;
68 
69  return arnew;
70 }
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:352
@ RGN_ALIGN_RIGHT
@ RGN_FLAG_HIDDEN
@ RGN_TYPE_UI
@ RGN_TYPE_HEADER
Read Guarded memory(de)allocation.
ARegion * ED_clip_has_properties_region(ScrArea *area)
Definition: clip_toolbar.c:44
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static void area(int d1, int d2, int e1, int e2, float weights[2])
short alignment
short regiontype