Cleanup: Rename bScreen variables from sc/scr to screen
Part of T74432. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
This commit is contained in:
@@ -155,7 +155,7 @@ typedef struct ARegionType {
|
|||||||
void (*message_subscribe)(const struct bContext *C,
|
void (*message_subscribe)(const struct bContext *C,
|
||||||
struct WorkSpace *workspace,
|
struct WorkSpace *workspace,
|
||||||
struct Scene *scene,
|
struct Scene *scene,
|
||||||
struct bScreen *sc,
|
struct bScreen *screen,
|
||||||
struct ScrArea *area,
|
struct ScrArea *area,
|
||||||
struct ARegion *region,
|
struct ARegion *region,
|
||||||
struct wmMsgBus *mbus);
|
struct wmMsgBus *mbus);
|
||||||
@@ -357,23 +357,27 @@ void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizm
|
|||||||
struct ARegion *BKE_area_find_region_type(const struct ScrArea *area, int type);
|
struct ARegion *BKE_area_find_region_type(const struct ScrArea *area, int type);
|
||||||
struct ARegion *BKE_area_find_region_active_win(struct ScrArea *area);
|
struct ARegion *BKE_area_find_region_active_win(struct ScrArea *area);
|
||||||
struct ARegion *BKE_area_find_region_xy(struct ScrArea *area, const int regiontype, int x, int y);
|
struct ARegion *BKE_area_find_region_xy(struct ScrArea *area, const int regiontype, int x, int y);
|
||||||
struct ARegion *BKE_screen_find_region_xy(struct bScreen *sc, const int regiontype, int x, int y)
|
struct ARegion *BKE_screen_find_region_xy(struct bScreen *screen,
|
||||||
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
|
const int regiontype,
|
||||||
|
int x,
|
||||||
|
int y) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
|
||||||
|
|
||||||
struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc,
|
struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *screen,
|
||||||
struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT
|
struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT
|
||||||
ATTR_NONNULL(1, 2);
|
ATTR_NONNULL(1, 2);
|
||||||
struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min);
|
struct ScrArea *BKE_screen_find_big_area(struct bScreen *screen,
|
||||||
|
const int spacetype,
|
||||||
|
const short min);
|
||||||
struct ScrArea *BKE_screen_area_map_find_area_xy(const struct ScrAreaMap *areamap,
|
struct ScrArea *BKE_screen_area_map_find_area_xy(const struct ScrAreaMap *areamap,
|
||||||
const int spacetype,
|
const int spacetype,
|
||||||
int x,
|
int x,
|
||||||
int y);
|
int y);
|
||||||
struct ScrArea *BKE_screen_find_area_xy(struct bScreen *sc, const int spacetype, int x, int y);
|
struct ScrArea *BKE_screen_find_area_xy(struct bScreen *screen, const int spacetype, int x, int y);
|
||||||
|
|
||||||
void BKE_screen_gizmo_tag_refresh(struct bScreen *sc);
|
void BKE_screen_gizmo_tag_refresh(struct bScreen *screen);
|
||||||
|
|
||||||
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
|
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
|
||||||
void BKE_screen_view3d_scene_sync(struct bScreen *sc, struct Scene *scene);
|
void BKE_screen_view3d_scene_sync(struct bScreen *screen, struct Scene *scene);
|
||||||
bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT
|
bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT
|
||||||
ATTR_NONNULL();
|
ATTR_NONNULL();
|
||||||
bool BKE_screen_is_used(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
bool BKE_screen_is_used(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
|
||||||
@@ -385,15 +389,17 @@ float BKE_screen_view3d_zoom_from_fac(float zoomfac);
|
|||||||
void BKE_screen_view3d_shading_init(struct View3DShading *shading);
|
void BKE_screen_view3d_shading_init(struct View3DShading *shading);
|
||||||
|
|
||||||
/* screen */
|
/* screen */
|
||||||
void BKE_screen_free(struct bScreen *sc);
|
void BKE_screen_free(struct bScreen *screen);
|
||||||
void BKE_screen_area_map_free(struct ScrAreaMap *area_map) ATTR_NONNULL();
|
void BKE_screen_area_map_free(struct ScrAreaMap *area_map) ATTR_NONNULL();
|
||||||
|
|
||||||
struct ScrEdge *BKE_screen_find_edge(struct bScreen *sc, struct ScrVert *v1, struct ScrVert *v2);
|
struct ScrEdge *BKE_screen_find_edge(struct bScreen *screen,
|
||||||
|
struct ScrVert *v1,
|
||||||
|
struct ScrVert *v2);
|
||||||
void BKE_screen_sort_scrvert(struct ScrVert **v1, struct ScrVert **v2);
|
void BKE_screen_sort_scrvert(struct ScrVert **v1, struct ScrVert **v2);
|
||||||
void BKE_screen_remove_double_scrverts(struct bScreen *sc);
|
void BKE_screen_remove_double_scrverts(struct bScreen *screen);
|
||||||
void BKE_screen_remove_double_scredges(struct bScreen *sc);
|
void BKE_screen_remove_double_scredges(struct bScreen *screen);
|
||||||
void BKE_screen_remove_unused_scredges(struct bScreen *sc);
|
void BKE_screen_remove_unused_scredges(struct bScreen *screen);
|
||||||
void BKE_screen_remove_unused_scrverts(struct bScreen *sc);
|
void BKE_screen_remove_unused_scrverts(struct bScreen *screen);
|
||||||
|
|
||||||
void BKE_screen_header_alignment_reset(struct bScreen *screen);
|
void BKE_screen_header_alignment_reset(struct bScreen *screen);
|
||||||
|
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ static void *ctx_wm_python_context_get(const bContext *C,
|
|||||||
|
|
||||||
static int ctx_data_get(bContext *C, const char *member, bContextDataResult *result)
|
static int ctx_data_get(bContext *C, const char *member, bContextDataResult *result)
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
int done = 0, recursion = C->data.recursion;
|
int done = 0, recursion = C->data.recursion;
|
||||||
@@ -336,8 +336,8 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (done != 1 && recursion < 4 && (sc = CTX_wm_screen(C))) {
|
if (done != 1 && recursion < 4 && (screen = CTX_wm_screen(C))) {
|
||||||
bContextDataCallback cb = sc->context;
|
bContextDataCallback cb = screen->context;
|
||||||
C->data.recursion = 4;
|
C->data.recursion = 4;
|
||||||
if (cb) {
|
if (cb) {
|
||||||
ret = cb(C, member, result);
|
ret = cb(C, member, result);
|
||||||
@@ -543,7 +543,7 @@ ListBase CTX_data_dir_get_ex(const bContext *C,
|
|||||||
{
|
{
|
||||||
bContextDataResult result;
|
bContextDataResult result;
|
||||||
ListBase lb;
|
ListBase lb;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
int a;
|
int a;
|
||||||
@@ -598,8 +598,8 @@ ListBase CTX_data_dir_get_ex(const bContext *C,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((sc = CTX_wm_screen(C)) && sc->context) {
|
if ((screen = CTX_wm_screen(C)) && screen->context) {
|
||||||
bContextDataCallback cb = sc->context;
|
bContextDataCallback cb = screen->context;
|
||||||
memset(&result, 0, sizeof(result));
|
memset(&result, 0, sizeof(result));
|
||||||
cb(C, "", &result);
|
cb(C, "", &result);
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizm
|
|||||||
region_refresh_tag_gizmomap_callback = callback;
|
region_refresh_tag_gizmomap_callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_gizmo_tag_refresh(struct bScreen *sc)
|
void BKE_screen_gizmo_tag_refresh(struct bScreen *screen)
|
||||||
{
|
{
|
||||||
if (region_refresh_tag_gizmomap_callback == NULL) {
|
if (region_refresh_tag_gizmomap_callback == NULL) {
|
||||||
return;
|
return;
|
||||||
@@ -397,7 +397,7 @@ void BKE_screen_gizmo_tag_refresh(struct bScreen *sc)
|
|||||||
|
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
for (region = area->regionbase.first; region; region = region->next) {
|
for (region = area->regionbase.first; region; region = region->next) {
|
||||||
if (region->gizmo_map != NULL) {
|
if (region->gizmo_map != NULL) {
|
||||||
region_refresh_tag_gizmomap_callback(region->gizmo_map);
|
region_refresh_tag_gizmomap_callback(region->gizmo_map);
|
||||||
@@ -514,19 +514,19 @@ void BKE_screen_area_map_free(ScrAreaMap *area_map)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Free (or release) any data used by this screen (does not free the screen itself). */
|
/** Free (or release) any data used by this screen (does not free the screen itself). */
|
||||||
void BKE_screen_free(bScreen *sc)
|
void BKE_screen_free(bScreen *screen)
|
||||||
{
|
{
|
||||||
screen_free_data(&sc->id);
|
screen_free_data(&screen->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************** Screen edges & verts ***************** */
|
/* ***************** Screen edges & verts ***************** */
|
||||||
|
|
||||||
ScrEdge *BKE_screen_find_edge(bScreen *sc, ScrVert *v1, ScrVert *v2)
|
ScrEdge *BKE_screen_find_edge(bScreen *screen, ScrVert *v1, ScrVert *v2)
|
||||||
{
|
{
|
||||||
ScrEdge *se;
|
ScrEdge *se;
|
||||||
|
|
||||||
BKE_screen_sort_scrvert(&v1, &v2);
|
BKE_screen_sort_scrvert(&v1, &v2);
|
||||||
for (se = sc->edgebase.first; se; se = se->next) {
|
for (se = screen->edgebase.first; se; se = se->next) {
|
||||||
if (se->v1 == v1 && se->v2 == v2) {
|
if (se->v1 == v1 && se->v2 == v2) {
|
||||||
return se;
|
return se;
|
||||||
}
|
}
|
||||||
@@ -546,13 +546,13 @@ void BKE_screen_sort_scrvert(ScrVert **v1, ScrVert **v2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_remove_double_scrverts(bScreen *sc)
|
void BKE_screen_remove_double_scrverts(bScreen *screen)
|
||||||
{
|
{
|
||||||
ScrVert *v1, *verg;
|
ScrVert *v1, *verg;
|
||||||
ScrEdge *se;
|
ScrEdge *se;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
verg = sc->vertbase.first;
|
verg = screen->vertbase.first;
|
||||||
while (verg) {
|
while (verg) {
|
||||||
if (verg->newv == NULL) { /* !!! */
|
if (verg->newv == NULL) { /* !!! */
|
||||||
v1 = verg->next;
|
v1 = verg->next;
|
||||||
@@ -570,7 +570,7 @@ void BKE_screen_remove_double_scrverts(bScreen *sc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* replace pointers in edges and faces */
|
/* replace pointers in edges and faces */
|
||||||
se = sc->edgebase.first;
|
se = screen->edgebase.first;
|
||||||
while (se) {
|
while (se) {
|
||||||
if (se->v1->newv) {
|
if (se->v1->newv) {
|
||||||
se->v1 = se->v1->newv;
|
se->v1 = se->v1->newv;
|
||||||
@@ -582,7 +582,7 @@ void BKE_screen_remove_double_scrverts(bScreen *sc)
|
|||||||
BKE_screen_sort_scrvert(&(se->v1), &(se->v2));
|
BKE_screen_sort_scrvert(&(se->v1), &(se->v2));
|
||||||
se = se->next;
|
se = se->next;
|
||||||
}
|
}
|
||||||
area = sc->areabase.first;
|
area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
if (area->v1->newv) {
|
if (area->v1->newv) {
|
||||||
area->v1 = area->v1->newv;
|
area->v1 = area->v1->newv;
|
||||||
@@ -600,29 +600,29 @@ void BKE_screen_remove_double_scrverts(bScreen *sc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* remove */
|
/* remove */
|
||||||
verg = sc->vertbase.first;
|
verg = screen->vertbase.first;
|
||||||
while (verg) {
|
while (verg) {
|
||||||
v1 = verg->next;
|
v1 = verg->next;
|
||||||
if (verg->newv) {
|
if (verg->newv) {
|
||||||
BLI_remlink(&sc->vertbase, verg);
|
BLI_remlink(&screen->vertbase, verg);
|
||||||
MEM_freeN(verg);
|
MEM_freeN(verg);
|
||||||
}
|
}
|
||||||
verg = v1;
|
verg = v1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_remove_double_scredges(bScreen *sc)
|
void BKE_screen_remove_double_scredges(bScreen *screen)
|
||||||
{
|
{
|
||||||
ScrEdge *verg, *se, *sn;
|
ScrEdge *verg, *se, *sn;
|
||||||
|
|
||||||
/* compare */
|
/* compare */
|
||||||
verg = sc->edgebase.first;
|
verg = screen->edgebase.first;
|
||||||
while (verg) {
|
while (verg) {
|
||||||
se = verg->next;
|
se = verg->next;
|
||||||
while (se) {
|
while (se) {
|
||||||
sn = se->next;
|
sn = se->next;
|
||||||
if (verg->v1 == se->v1 && verg->v2 == se->v2) {
|
if (verg->v1 == se->v1 && verg->v2 == se->v2) {
|
||||||
BLI_remlink(&sc->edgebase, se);
|
BLI_remlink(&screen->edgebase, se);
|
||||||
MEM_freeN(se);
|
MEM_freeN(se);
|
||||||
}
|
}
|
||||||
se = sn;
|
se = sn;
|
||||||
@@ -631,37 +631,37 @@ void BKE_screen_remove_double_scredges(bScreen *sc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_remove_unused_scredges(bScreen *sc)
|
void BKE_screen_remove_unused_scredges(bScreen *screen)
|
||||||
{
|
{
|
||||||
ScrEdge *se, *sen;
|
ScrEdge *se, *sen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
int a = 0;
|
int a = 0;
|
||||||
|
|
||||||
/* sets flags when edge is used in area */
|
/* sets flags when edge is used in area */
|
||||||
area = sc->areabase.first;
|
area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
se = BKE_screen_find_edge(sc, area->v1, area->v2);
|
se = BKE_screen_find_edge(screen, area->v1, area->v2);
|
||||||
if (se == NULL) {
|
if (se == NULL) {
|
||||||
printf("error: area %d edge 1 doesn't exist\n", a);
|
printf("error: area %d edge 1 doesn't exist\n", a);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
se->flag = 1;
|
se->flag = 1;
|
||||||
}
|
}
|
||||||
se = BKE_screen_find_edge(sc, area->v2, area->v3);
|
se = BKE_screen_find_edge(screen, area->v2, area->v3);
|
||||||
if (se == NULL) {
|
if (se == NULL) {
|
||||||
printf("error: area %d edge 2 doesn't exist\n", a);
|
printf("error: area %d edge 2 doesn't exist\n", a);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
se->flag = 1;
|
se->flag = 1;
|
||||||
}
|
}
|
||||||
se = BKE_screen_find_edge(sc, area->v3, area->v4);
|
se = BKE_screen_find_edge(screen, area->v3, area->v4);
|
||||||
if (se == NULL) {
|
if (se == NULL) {
|
||||||
printf("error: area %d edge 3 doesn't exist\n", a);
|
printf("error: area %d edge 3 doesn't exist\n", a);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
se->flag = 1;
|
se->flag = 1;
|
||||||
}
|
}
|
||||||
se = BKE_screen_find_edge(sc, area->v4, area->v1);
|
se = BKE_screen_find_edge(screen, area->v4, area->v1);
|
||||||
if (se == NULL) {
|
if (se == NULL) {
|
||||||
printf("error: area %d edge 4 doesn't exist\n", a);
|
printf("error: area %d edge 4 doesn't exist\n", a);
|
||||||
}
|
}
|
||||||
@@ -671,11 +671,11 @@ void BKE_screen_remove_unused_scredges(bScreen *sc)
|
|||||||
area = area->next;
|
area = area->next;
|
||||||
a++;
|
a++;
|
||||||
}
|
}
|
||||||
se = sc->edgebase.first;
|
se = screen->edgebase.first;
|
||||||
while (se) {
|
while (se) {
|
||||||
sen = se->next;
|
sen = se->next;
|
||||||
if (se->flag == 0) {
|
if (se->flag == 0) {
|
||||||
BLI_remlink(&sc->edgebase, se);
|
BLI_remlink(&screen->edgebase, se);
|
||||||
MEM_freeN(se);
|
MEM_freeN(se);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -685,25 +685,25 @@ void BKE_screen_remove_unused_scredges(bScreen *sc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_remove_unused_scrverts(bScreen *sc)
|
void BKE_screen_remove_unused_scrverts(bScreen *screen)
|
||||||
{
|
{
|
||||||
ScrVert *sv, *svn;
|
ScrVert *sv, *svn;
|
||||||
ScrEdge *se;
|
ScrEdge *se;
|
||||||
|
|
||||||
/* we assume edges are ok */
|
/* we assume edges are ok */
|
||||||
|
|
||||||
se = sc->edgebase.first;
|
se = screen->edgebase.first;
|
||||||
while (se) {
|
while (se) {
|
||||||
se->v1->flag = 1;
|
se->v1->flag = 1;
|
||||||
se->v2->flag = 1;
|
se->v2->flag = 1;
|
||||||
se = se->next;
|
se = se->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
sv = sc->vertbase.first;
|
sv = screen->vertbase.first;
|
||||||
while (sv) {
|
while (sv) {
|
||||||
svn = sv->next;
|
svn = sv->next;
|
||||||
if (sv->flag == 0) {
|
if (sv->flag == 0) {
|
||||||
BLI_remlink(&sc->vertbase, sv);
|
BLI_remlink(&screen->vertbase, sv);
|
||||||
MEM_freeN(sv);
|
MEM_freeN(sv);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -768,10 +768,10 @@ ARegion *BKE_area_find_region_xy(ScrArea *area, const int regiontype, int x, int
|
|||||||
/**
|
/**
|
||||||
* \note This is only for screen level regions (typically menus/popups).
|
* \note This is only for screen level regions (typically menus/popups).
|
||||||
*/
|
*/
|
||||||
ARegion *BKE_screen_find_region_xy(bScreen *sc, const int regiontype, int x, int y)
|
ARegion *BKE_screen_find_region_xy(bScreen *screen, const int regiontype, int x, int y)
|
||||||
{
|
{
|
||||||
ARegion *region_found = NULL;
|
ARegion *region_found = NULL;
|
||||||
for (ARegion *region = sc->regionbase.first; region; region = region->next) {
|
for (ARegion *region = screen->regionbase.first; region; region = region->next) {
|
||||||
if ((regiontype == RGN_TYPE_ANY) || (region->regiontype == regiontype)) {
|
if ((regiontype == RGN_TYPE_ANY) || (region->regiontype == regiontype)) {
|
||||||
if (BLI_rcti_isect_pt(®ion->winrct, x, y)) {
|
if (BLI_rcti_isect_pt(®ion->winrct, x, y)) {
|
||||||
region_found = region;
|
region_found = region;
|
||||||
@@ -786,11 +786,11 @@ ARegion *BKE_screen_find_region_xy(bScreen *sc, const int regiontype, int x, int
|
|||||||
* \note Ideally we can get the area from the context,
|
* \note Ideally we can get the area from the context,
|
||||||
* there are a few places however where this isn't practical.
|
* there are a few places however where this isn't practical.
|
||||||
*/
|
*/
|
||||||
ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, SpaceLink *sl)
|
ScrArea *BKE_screen_find_area_from_space(struct bScreen *screen, SpaceLink *sl)
|
||||||
{
|
{
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if (BLI_findindex(&area->spacedata, sl) != -1) {
|
if (BLI_findindex(&area->spacedata, sl) != -1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -803,12 +803,12 @@ ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, SpaceLink *sl)
|
|||||||
* \note Using this function is generally a last resort, you really want to be
|
* \note Using this function is generally a last resort, you really want to be
|
||||||
* using the context when you can - campbell
|
* using the context when you can - campbell
|
||||||
*/
|
*/
|
||||||
ScrArea *BKE_screen_find_big_area(bScreen *sc, const int spacetype, const short min)
|
ScrArea *BKE_screen_find_big_area(bScreen *screen, const int spacetype, const short min)
|
||||||
{
|
{
|
||||||
ScrArea *area, *big = NULL;
|
ScrArea *area, *big = NULL;
|
||||||
int size, maxsize = 0;
|
int size, maxsize = 0;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if ((spacetype == SPACE_TYPE_ANY) || (area->spacetype == spacetype)) {
|
if ((spacetype == SPACE_TYPE_ANY) || (area->spacetype == spacetype)) {
|
||||||
if (min <= area->winx && min <= area->winy) {
|
if (min <= area->winx && min <= area->winy) {
|
||||||
size = area->winx * area->winy;
|
size = area->winx * area->winy;
|
||||||
@@ -838,9 +838,9 @@ ScrArea *BKE_screen_area_map_find_area_xy(const ScrAreaMap *areamap,
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ScrArea *BKE_screen_find_area_xy(bScreen *sc, const int spacetype, int x, int y)
|
ScrArea *BKE_screen_find_area_xy(bScreen *screen, const int spacetype, int x, int y)
|
||||||
{
|
{
|
||||||
return BKE_screen_area_map_find_area_xy(AREAMAP_FROM_SCREEN(sc), spacetype, x, y);
|
return BKE_screen_area_map_find_area_xy(AREAMAP_FROM_SCREEN(screen), spacetype, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene)
|
void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene)
|
||||||
@@ -863,11 +863,11 @@ void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_screen_view3d_scene_sync(bScreen *sc, Scene *scene)
|
void BKE_screen_view3d_scene_sync(bScreen *screen, Scene *scene)
|
||||||
{
|
{
|
||||||
/* are there cameras in the views that are not in the scene? */
|
/* are there cameras in the views that are not in the scene? */
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
|
|||||||
@@ -7847,17 +7847,17 @@ static void lib_link_windowmanager(FileData *fd, Main *UNUSED(bmain), wmWindowMa
|
|||||||
|
|
||||||
/* note: file read without screens option G_FILE_NO_UI;
|
/* note: file read without screens option G_FILE_NO_UI;
|
||||||
* check lib pointers in call below */
|
* check lib pointers in call below */
|
||||||
static void lib_link_screen(FileData *fd, Main *UNUSED(bmain), bScreen *sc)
|
static void lib_link_screen(FileData *fd, Main *UNUSED(bmain), bScreen *screen)
|
||||||
{
|
{
|
||||||
/* deprecated, but needed for versioning (will be NULL'ed then) */
|
/* deprecated, but needed for versioning (will be NULL'ed then) */
|
||||||
sc->scene = newlibadr(fd, sc->id.lib, sc->scene);
|
screen->scene = newlibadr(fd, screen->id.lib, screen->scene);
|
||||||
|
|
||||||
sc->animtimer = NULL; /* saved in rare cases */
|
screen->animtimer = NULL; /* saved in rare cases */
|
||||||
sc->tool_tip = NULL;
|
screen->tool_tip = NULL;
|
||||||
sc->scrubbing = false;
|
screen->scrubbing = false;
|
||||||
|
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
lib_link_area(fd, &sc->id, area);
|
lib_link_area(fd, &screen->id, area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8195,7 +8195,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
|
|||||||
|
|
||||||
scpt->script = restore_pointer_by_name(id_map, (ID *)scpt->script, USER_REAL);
|
scpt->script = restore_pointer_by_name(id_map, (ID *)scpt->script, USER_REAL);
|
||||||
|
|
||||||
/*sc->script = NULL; - 2.45 set to null, better re-run the script */
|
/*screen->script = NULL; - 2.45 set to null, better re-run the script */
|
||||||
if (scpt->script) {
|
if (scpt->script) {
|
||||||
SCRIPT_SET_NULL(scpt->script);
|
SCRIPT_SET_NULL(scpt->script);
|
||||||
}
|
}
|
||||||
@@ -8378,18 +8378,18 @@ void blo_do_versions_view3d_split_250(View3D *v3d, ListBase *regions)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool direct_link_screen(FileData *fd, bScreen *sc)
|
static bool direct_link_screen(FileData *fd, bScreen *screen)
|
||||||
{
|
{
|
||||||
bool wrong_id = false;
|
bool wrong_id = false;
|
||||||
|
|
||||||
sc->regionbase.first = sc->regionbase.last = NULL;
|
screen->regionbase.first = screen->regionbase.last = NULL;
|
||||||
sc->context = NULL;
|
screen->context = NULL;
|
||||||
sc->active_region = NULL;
|
screen->active_region = NULL;
|
||||||
|
|
||||||
sc->preview = direct_link_preview_image(fd, sc->preview);
|
screen->preview = direct_link_preview_image(fd, screen->preview);
|
||||||
|
|
||||||
if (!direct_link_area_map(fd, AREAMAP_FROM_SCREEN(sc))) {
|
if (!direct_link_area_map(fd, AREAMAP_FROM_SCREEN(screen))) {
|
||||||
printf("Error reading Screen %s... removing it.\n", sc->id.name + 2);
|
printf("Error reading Screen %s... removing it.\n", screen->id.name + 2);
|
||||||
wrong_id = true;
|
wrong_id = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1460,15 +1460,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
|
if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
/* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_HIDE_OVERLAYS.
|
/* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_HIDE_OVERLAYS.
|
||||||
* This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated.
|
* This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated.
|
||||||
* Here we clear it for old files so they don't come in with V3D_HIDE_OVERLAYS set,
|
* Here we clear it for old files so they don't come in with V3D_HIDE_OVERLAYS set,
|
||||||
* which would cause cameras, lights, etc to become invisible */
|
* which would cause cameras, lights, etc to become invisible */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
@@ -1547,13 +1547,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) {
|
if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 5)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
/* Image editor scopes */
|
/* Image editor scopes */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1569,13 +1569,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
if (bmain->versionfile < 253) {
|
if (bmain->versionfile < 253) {
|
||||||
Object *ob;
|
Object *ob;
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Tex *tex;
|
Tex *tex;
|
||||||
Brush *brush;
|
Brush *brush;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1833,7 +1833,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 1)) {
|
if (bmain->versionfile < 255 || (bmain->versionfile == 255 && bmain->subversionfile < 1)) {
|
||||||
Brush *br;
|
Brush *br;
|
||||||
ParticleSettings *part;
|
ParticleSettings *part;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (br = bmain->brushes.first; br; br = br->id.next) {
|
for (br = bmain->brushes.first; br; br = br->id.next) {
|
||||||
if (br->ob_mode == 0) {
|
if (br->ob_mode == 0) {
|
||||||
@@ -1850,9 +1850,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
part->kink_amp_clump = 1.f; /* keep old files looking similar */
|
part->kink_amp_clump = 1.f; /* keep old files looking similar */
|
||||||
}
|
}
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_INFO) {
|
if (sl->spacetype == SPACE_INFO) {
|
||||||
@@ -1896,13 +1896,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 256) {
|
if (bmain->versionfile < 256) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
Key *key;
|
Key *key;
|
||||||
|
|
||||||
/* Fix for sample line scope initializing with no height */
|
/* Fix for sample line scope initializing with no height */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
area = sc->areabase.first;
|
area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -2040,18 +2040,18 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 3)) {
|
if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 3)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Brush *brush;
|
Brush *brush;
|
||||||
Object *ob;
|
Object *ob;
|
||||||
ParticleSettings *part;
|
ParticleSettings *part;
|
||||||
|
|
||||||
/* redraws flag in SpaceTime has been moved to Screen level */
|
/* redraws flag in SpaceTime has been moved to Screen level */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
if (sc->redraws_flag == 0) {
|
if (screen->redraws_flag == 0) {
|
||||||
/* just initialize to default? */
|
/* just initialize to default? */
|
||||||
/* XXX: we could also have iterated through areas,
|
/* XXX: we could also have iterated through areas,
|
||||||
* and taken them from the first timeline available... */
|
* and taken them from the first timeline available... */
|
||||||
sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN;
|
screen->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -765,12 +765,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
|
|
||||||
{
|
{
|
||||||
/* Tomato compatibility code. */
|
/* Tomato compatibility code. */
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
MovieClip *clip;
|
MovieClip *clip;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
@@ -1188,11 +1188,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) {
|
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1368,12 +1368,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1661,11 +1661,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
|
|
||||||
/* render border for viewport */
|
/* render border for viewport */
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
@@ -1758,10 +1758,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) {
|
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
switch (sl->spacetype) {
|
switch (sl->spacetype) {
|
||||||
@@ -1943,10 +1943,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
if (MAIN_VERSION_OLDER(bmain, 266, 2)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_NODE) {
|
if (sl->spacetype == SPACE_NODE) {
|
||||||
@@ -2199,7 +2199,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 268, 4)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 4)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Object *ob;
|
Object *ob;
|
||||||
|
|
||||||
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
||||||
@@ -2240,9 +2240,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
*
|
*
|
||||||
* We moved this check to the do versions to be sure the value makes any sense.
|
* We moved this check to the do versions to be sure the value makes any sense.
|
||||||
*/
|
*/
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_NODE) {
|
if (sl->spacetype == SPACE_NODE) {
|
||||||
@@ -2257,12 +2257,12 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 268, 5)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 268, 5)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
/* add missing (+) expander in node editor */
|
/* add missing (+) expander in node editor */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
ARegion *region, *arnew;
|
ARegion *region, *arnew;
|
||||||
|
|
||||||
if (area->spacetype == SPACE_NODE) {
|
if (area->spacetype == SPACE_NODE) {
|
||||||
@@ -2338,14 +2338,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 3)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
|
|
||||||
/* Update files using invalid (outdated) outlinevis Outliner values. */
|
/* Update files using invalid (outdated) outlinevis Outliner values. */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_OUTLINER) {
|
if (sl->spacetype == SPACE_OUTLINER) {
|
||||||
SpaceOutliner *so = (SpaceOutliner *)sl;
|
SpaceOutliner *so = (SpaceOutliner *)sl;
|
||||||
@@ -2542,11 +2542,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 269, 11)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 269, 11)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *space_link;
|
SpaceLink *space_link;
|
||||||
|
|
||||||
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
|
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
|
||||||
|
|||||||
@@ -519,11 +519,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
* leading to corrupted files (see T39847).
|
* leading to corrupted files (see T39847).
|
||||||
* This will always reset situation to a valid state.
|
* This will always reset situation to a valid state.
|
||||||
*/
|
*/
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -852,14 +852,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 273, 9)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 273, 9)) {
|
||||||
bScreen *scr;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
/* Make sure sequencer preview area limits zoom */
|
/* Make sure sequencer preview area limits zoom */
|
||||||
for (scr = bmain->screens.first; scr; scr = scr->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = scr->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_SEQ) {
|
if (sl->spacetype == SPACE_SEQ) {
|
||||||
for (region = sl->regionbase.first; region; region = region->next) {
|
for (region = sl->regionbase.first; region; region = region->next) {
|
||||||
@@ -1650,9 +1650,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 279, 4)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 279, 4)) {
|
||||||
/* Fix for invalid state of screen due to bug in older versions. */
|
/* Fix for invalid state of screen due to bug in older versions. */
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->full && sc->state == SCREENNORMAL) {
|
if (area->full && screen->state == SCREENNORMAL) {
|
||||||
area->full = NULL;
|
area->full = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1928,13 +1928,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(bmain, 280, 6)) {
|
if (!MAIN_VERSION_ATLEAST(bmain, 280, 6)) {
|
||||||
if (DNA_struct_elem_find(fd->filesdna, "SpaceOutliner", "int", "filter") == false) {
|
if (DNA_struct_elem_find(fd->filesdna, "SpaceOutliner", "int", "filter") == false) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
/* Update files using invalid (outdated) outlinevis Outliner values. */
|
/* Update files using invalid (outdated) outlinevis Outliner values. */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_OUTLINER) {
|
if (sl->spacetype == SPACE_OUTLINER) {
|
||||||
SpaceOutliner *so = (SpaceOutliner *)sl;
|
SpaceOutliner *so = (SpaceOutliner *)sl;
|
||||||
@@ -1973,8 +1973,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
View3D *v3d = (View3D *)sl;
|
View3D *v3d = (View3D *)sl;
|
||||||
@@ -2643,8 +2643,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
/* initialize grease pencil view data */
|
/* initialize grease pencil view data */
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "SpaceView3D", "float", "vertex_opacity")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "SpaceView3D", "float", "vertex_opacity")) {
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
View3D *v3d = (View3D *)sl;
|
View3D *v3d = (View3D *)sl;
|
||||||
|
|||||||
@@ -580,9 +580,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
|
|
||||||
if (bmain->versionfile <= 109) {
|
if (bmain->versionfile <= 109) {
|
||||||
/* new variable: gridlines */
|
/* new variable: gridlines */
|
||||||
bScreen *sc = bmain->screens.first;
|
bScreen *screen = bmain->screens.first;
|
||||||
while (sc) {
|
while (screen) {
|
||||||
ScrArea *area = sc->areabase.first;
|
ScrArea *area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
while (sl) {
|
while (sl) {
|
||||||
@@ -597,7 +597,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
area = area->next;
|
area = area->next;
|
||||||
}
|
}
|
||||||
sc = sc->id.next;
|
screen = screen->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,9 +694,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 169) {
|
if (bmain->versionfile <= 169) {
|
||||||
bScreen *sc = bmain->screens.first;
|
bScreen *screen = bmain->screens.first;
|
||||||
while (sc) {
|
while (screen) {
|
||||||
ScrArea *area = sc->areabase.first;
|
ScrArea *area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
while (sl) {
|
while (sl) {
|
||||||
@@ -708,7 +708,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
area = area->next;
|
area = area->next;
|
||||||
}
|
}
|
||||||
sc = sc->id.next;
|
screen = screen->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,9 +727,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 171) {
|
if (bmain->versionfile <= 171) {
|
||||||
bScreen *sc = bmain->screens.first;
|
bScreen *screen = bmain->screens.first;
|
||||||
while (sc) {
|
while (screen) {
|
||||||
ScrArea *area = sc->areabase.first;
|
ScrArea *area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
while (sl) {
|
while (sl) {
|
||||||
@@ -741,7 +741,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
area = area->next;
|
area = area->next;
|
||||||
}
|
}
|
||||||
sc = sc->id.next;
|
screen = screen->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -866,7 +866,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
bSound *sound;
|
bSound *sound;
|
||||||
Scene *sce;
|
Scene *sce;
|
||||||
Mesh *me;
|
Mesh *me;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sound = bmain->sounds.first; sound; sound = sound->id.next) {
|
for (sound = bmain->sounds.first; sound; sound = sound->id.next) {
|
||||||
if (sound->packedfile) {
|
if (sound->packedfile) {
|
||||||
@@ -889,10 +889,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* some oldfile patch, moved from set_func_space */
|
/* some oldfile patch, moved from set_func_space */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -907,7 +907,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
|
|
||||||
if (bmain->versionfile <= 227) {
|
if (bmain->versionfile <= 227) {
|
||||||
Scene *sce;
|
Scene *sce;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Object *ob;
|
Object *ob;
|
||||||
|
|
||||||
/* As of now, this insures that the transition from the old Track system
|
/* As of now, this insures that the transition from the old Track system
|
||||||
@@ -962,10 +962,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* patch for old wrong max view2d settings, allows zooming out more */
|
/* patch for old wrong max view2d settings, allows zooming out more */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -983,7 +983,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 228) {
|
if (bmain->versionfile <= 228) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Object *ob;
|
Object *ob;
|
||||||
|
|
||||||
/* As of now, this insures that the transition from the old Track system
|
/* As of now, this insures that the transition from the old Track system
|
||||||
@@ -1029,10 +1029,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert old mainb values for new button panels */
|
/* convert old mainb values for new button panels */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1096,13 +1096,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (bmain->versionfile <= 230) {
|
if (bmain->versionfile <= 230) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
/* new variable blockscale, for panels in any area */
|
/* new variable blockscale, for panels in any area */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -1117,12 +1117,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 231) {
|
if (bmain->versionfile <= 231) {
|
||||||
bScreen *sc = bmain->screens.first;
|
bScreen *screen = bmain->screens.first;
|
||||||
|
|
||||||
/* new bit flags for showing/hiding grid floor and axes */
|
/* new bit flags for showing/hiding grid floor and axes */
|
||||||
|
|
||||||
while (sc) {
|
while (screen) {
|
||||||
ScrArea *area = sc->areabase.first;
|
ScrArea *area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
while (sl) {
|
while (sl) {
|
||||||
@@ -1140,14 +1140,14 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
area = area->next;
|
area = area->next;
|
||||||
}
|
}
|
||||||
sc = sc->id.next;
|
screen = screen->id.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 232) {
|
if (bmain->versionfile <= 232) {
|
||||||
Tex *tex = bmain->textures.first;
|
Tex *tex = bmain->textures.first;
|
||||||
World *wrld = bmain->worlds.first;
|
World *wrld = bmain->worlds.first;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
while (tex) {
|
while (tex) {
|
||||||
if ((tex->flag & (TEX_CHECKER_ODD + TEX_CHECKER_EVEN)) == 0) {
|
if ((tex->flag & (TEX_CHECKER_ODD + TEX_CHECKER_EVEN)) == 0) {
|
||||||
@@ -1184,9 +1184,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
/* new variable blockscale, for panels in any area, do again because new
|
/* new variable blockscale, for panels in any area, do again because new
|
||||||
* areas didn't initialize it to 0.7 yet
|
* areas didn't initialize it to 0.7 yet
|
||||||
*/
|
*/
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
/* added: 5x better zoom in for nla */
|
/* added: 5x better zoom in for nla */
|
||||||
@@ -1200,11 +1200,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 233) {
|
if (bmain->versionfile <= 233) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
@@ -1217,11 +1217,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 234) {
|
if (bmain->versionfile <= 234) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_TEXT) {
|
if (sl->spacetype == SPACE_TEXT) {
|
||||||
@@ -1651,7 +1651,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
|
|
||||||
if (bmain->versionfile <= 242) {
|
if (bmain->versionfile <= 242) {
|
||||||
Scene *sce;
|
Scene *sce;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Object *ob;
|
Object *ob;
|
||||||
Curve *cu;
|
Curve *cu;
|
||||||
Material *ma;
|
Material *ma;
|
||||||
@@ -1663,9 +1663,9 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
bNodeTree *ntree;
|
bNodeTree *ntree;
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
area = sc->areabase.first;
|
area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
@@ -1922,13 +1922,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile <= 244) {
|
if (bmain->versionfile <= 244) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
if (bmain->versionfile != 244 || bmain->subversionfile < 2) {
|
if (bmain->versionfile != 244 || bmain->subversionfile < 2) {
|
||||||
/* correct older action editors - incorrect scrolling */
|
/* correct older action editors - incorrect scrolling */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
area = sc->areabase.first;
|
area = screen->areabase.first;
|
||||||
while (area) {
|
while (area) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
@@ -2540,13 +2540,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 3)) {
|
if (bmain->versionfile < 248 || (bmain->versionfile == 248 && bmain->subversionfile < 3)) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
/* adjust default settings for Animation Editors */
|
/* adjust default settings for Animation Editors */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
|
|||||||
@@ -3134,19 +3134,19 @@ static void write_windowmanager(WriteData *wd, wmWindowManager *wm, const void *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_screen(WriteData *wd, bScreen *sc, const void *id_address)
|
static void write_screen(WriteData *wd, bScreen *screen, const void *id_address)
|
||||||
{
|
{
|
||||||
/* Screens are reference counted, only saved if used by a workspace. */
|
/* Screens are reference counted, only saved if used by a workspace. */
|
||||||
if (sc->id.us > 0 || wd->use_memfile) {
|
if (screen->id.us > 0 || wd->use_memfile) {
|
||||||
/* write LibData */
|
/* write LibData */
|
||||||
/* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
|
/* in 2.50+ files, the file identifier for screens is patched, forward compatibility */
|
||||||
writestruct_at_address(wd, ID_SCRN, bScreen, 1, id_address, sc);
|
writestruct_at_address(wd, ID_SCRN, bScreen, 1, id_address, screen);
|
||||||
write_iddata(wd, &sc->id);
|
write_iddata(wd, &screen->id);
|
||||||
|
|
||||||
write_previews(wd, sc->preview);
|
write_previews(wd, screen->preview);
|
||||||
|
|
||||||
/* direct data */
|
/* direct data */
|
||||||
write_area_map(wd, AREAMAP_FROM_SCREEN(sc));
|
write_area_map(wd, AREAMAP_FROM_SCREEN(screen));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -906,7 +906,7 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *eve
|
|||||||
static void ed_marker_move_apply(bContext *C, wmOperator *op)
|
static void ed_marker_move_apply(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
#ifdef DURIAN_CAMERA_SWITCH
|
#ifdef DURIAN_CAMERA_SWITCH
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Object *camera = scene->camera;
|
Object *camera = scene->camera;
|
||||||
#endif
|
#endif
|
||||||
@@ -930,7 +930,7 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op)
|
|||||||
BKE_scene_camera_switch_update(scene);
|
BKE_scene_camera_switch_update(scene);
|
||||||
|
|
||||||
if (camera != scene->camera) {
|
if (camera != scene->camera) {
|
||||||
BKE_screen_view3d_scene_sync(sc, scene);
|
BKE_screen_view3d_scene_sync(screen, scene);
|
||||||
WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);
|
WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1621,7 +1621,7 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op)
|
static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = CTX_data_active_object(C);
|
||||||
ListBase *markers = ED_context_get_markers(C);
|
ListBase *markers = ED_context_get_markers(C);
|
||||||
@@ -1658,7 +1658,7 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
/* camera may have changes */
|
/* camera may have changes */
|
||||||
BKE_scene_camera_switch_update(scene);
|
BKE_scene_camera_switch_update(scene);
|
||||||
BKE_screen_view3d_scene_sync(sc, scene);
|
BKE_screen_view3d_scene_sync(screen, scene);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
|
WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
|
||||||
WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
|
WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
|
||||||
|
|||||||
@@ -1933,8 +1933,8 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
|
|||||||
/* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */
|
/* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */
|
||||||
static bool gpencil_area_exists(bContext *C, ScrArea *area_test)
|
static bool gpencil_area_exists(bContext *C, ScrArea *area_test)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
return (BLI_findindex(&sc->areabase, area_test) != -1);
|
return (BLI_findindex(&screen->areabase, area_test) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
|
static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
|
||||||
|
|||||||
@@ -3098,8 +3098,8 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
|
|||||||
/* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */
|
/* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */
|
||||||
static bool gpencil_area_exists(bContext *C, ScrArea *area_test)
|
static bool gpencil_area_exists(bContext *C, ScrArea *area_test)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
return (BLI_findindex(&sc->areabase, area_test) != -1);
|
return (BLI_findindex(&screen->areabase, area_test) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
|
static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void ED_operatortypes_render(void);
|
|||||||
|
|
||||||
void ED_render_engine_changed(struct Main *bmain);
|
void ED_render_engine_changed(struct Main *bmain);
|
||||||
void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area);
|
void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area);
|
||||||
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *sc);
|
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen);
|
||||||
|
|
||||||
/* Callbacks handling data update events coming from depsgraph. */
|
/* Callbacks handling data update events coming from depsgraph. */
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ void ED_screen_ensure_updated(struct wmWindowManager *wm,
|
|||||||
struct wmWindow *win,
|
struct wmWindow *win,
|
||||||
struct bScreen *screen);
|
struct bScreen *screen);
|
||||||
void ED_screen_do_listen(struct bContext *C, struct wmNotifier *note);
|
void ED_screen_do_listen(struct bContext *C, struct wmNotifier *note);
|
||||||
bool ED_screen_change(struct bContext *C, struct bScreen *sc);
|
bool ED_screen_change(struct bContext *C, struct bScreen *screen);
|
||||||
void ED_screen_scene_change(struct bContext *C, struct wmWindow *win, struct Scene *scene);
|
void ED_screen_scene_change(struct bContext *C, struct wmWindow *win, struct Scene *scene);
|
||||||
void ED_screen_set_active_region(struct bContext *C, struct wmWindow *win, const int xy[2]);
|
void ED_screen_set_active_region(struct bContext *C, struct wmWindow *win, const int xy[2]);
|
||||||
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
||||||
|
|||||||
@@ -2470,7 +2470,7 @@ struct ARegion *UI_tooltip_create_from_button(struct bContext *C,
|
|||||||
uiBut *but,
|
uiBut *but,
|
||||||
bool is_label);
|
bool is_label);
|
||||||
struct ARegion *UI_tooltip_create_from_gizmo(struct bContext *C, struct wmGizmo *gz);
|
struct ARegion *UI_tooltip_create_from_gizmo(struct bContext *C, struct wmGizmo *gz);
|
||||||
void UI_tooltip_free(struct bContext *C, struct bScreen *sc, struct ARegion *region);
|
void UI_tooltip_free(struct bContext *C, struct bScreen *screen, struct ARegion *region);
|
||||||
|
|
||||||
/* How long before a tool-tip shows. */
|
/* How long before a tool-tip shows. */
|
||||||
#define UI_TOOLTIP_DELAY 0.5
|
#define UI_TOOLTIP_DELAY 0.5
|
||||||
|
|||||||
@@ -1233,7 +1233,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
|||||||
*/
|
*/
|
||||||
void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *pa)
|
void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *pa)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
const bool has_panel_category = UI_panel_category_is_visible(region);
|
const bool has_panel_category = UI_panel_category_is_visible(region);
|
||||||
const bool any_item_visible = has_panel_category;
|
const bool any_item_visible = has_panel_category;
|
||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
@@ -1247,7 +1247,7 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *pa)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RNA_pointer_create(&sc->id, &RNA_Panel, pa, &ptr);
|
RNA_pointer_create(&screen->id, &RNA_Panel, pa, &ptr);
|
||||||
|
|
||||||
pup = UI_popup_menu_begin(C, IFACE_("Panel"), ICON_NONE);
|
pup = UI_popup_menu_begin(C, IFACE_("Panel"), ICON_NONE);
|
||||||
layout = UI_popup_menu_layout(pup);
|
layout = UI_popup_menu_layout(pup);
|
||||||
|
|||||||
@@ -7707,8 +7707,8 @@ void UI_but_tooltip_refresh(bContext *C, uiBut *but)
|
|||||||
{
|
{
|
||||||
uiHandleButtonData *data = but->active;
|
uiHandleButtonData *data = but->active;
|
||||||
if (data) {
|
if (data) {
|
||||||
bScreen *sc = WM_window_get_active_screen(data->window);
|
bScreen *screen = WM_window_get_active_screen(data->window);
|
||||||
if (sc->tool_tip && sc->tool_tip->region) {
|
if (screen->tool_tip && screen->tool_tip->region) {
|
||||||
WM_tooltip_refresh(C, data->window);
|
WM_tooltip_refresh(C, data->window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7768,9 +7768,9 @@ static void button_tooltip_timer_reset(bContext *C, uiBut *but)
|
|||||||
WM_tooltip_timer_init_ex(
|
WM_tooltip_timer_init_ex(
|
||||||
C, data->window, data->area, data->region, ui_but_tooltip_init, delay);
|
C, data->window, data->area, data->region, ui_but_tooltip_init, delay);
|
||||||
if (is_label) {
|
if (is_label) {
|
||||||
bScreen *sc = WM_window_get_active_screen(data->window);
|
bScreen *screen = WM_window_get_active_screen(data->window);
|
||||||
if (sc->tool_tip) {
|
if (screen->tool_tip) {
|
||||||
sc->tool_tip->pass = 1;
|
screen->tool_tip->pass = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8056,11 +8056,11 @@ static void button_activate_init(bContext *C,
|
|||||||
|
|
||||||
if (UI_but_has_tooltip_label(but)) {
|
if (UI_but_has_tooltip_label(but)) {
|
||||||
/* Show a label for this button. */
|
/* Show a label for this button. */
|
||||||
bScreen *sc = WM_window_get_active_screen(data->window);
|
bScreen *screen = WM_window_get_active_screen(data->window);
|
||||||
if ((PIL_check_seconds_timer() - WM_tooltip_time_closed()) < 0.1) {
|
if ((PIL_check_seconds_timer() - WM_tooltip_time_closed()) < 0.1) {
|
||||||
WM_tooltip_immediate_init(C, CTX_wm_window(C), data->area, region, ui_but_tooltip_init);
|
WM_tooltip_immediate_init(C, CTX_wm_window(C), data->area, region, ui_but_tooltip_init);
|
||||||
if (sc->tool_tip) {
|
if (screen->tool_tip) {
|
||||||
sc->tool_tip->pass = 1;
|
screen->tool_tip->pass = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8343,10 +8343,10 @@ wmOperator *UI_context_active_operator_get(const struct bContext *C)
|
|||||||
|
|
||||||
/* scan popups */
|
/* scan popups */
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
for (region = sc->regionbase.first; region; region = region->next) {
|
for (region = screen->regionbase.first; region; region = region->next) {
|
||||||
if (region == region_ctx) {
|
if (region == region_ctx) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -10640,7 +10640,7 @@ static int ui_region_handler(bContext *C, const wmEvent *event, void *UNUSED(use
|
|||||||
|
|
||||||
static void ui_region_handler_remove(bContext *C, void *UNUSED(userdata))
|
static void ui_region_handler_remove(bContext *C, void *UNUSED(userdata))
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
region = CTX_wm_region(C);
|
region = CTX_wm_region(C);
|
||||||
@@ -10650,15 +10650,15 @@ static void ui_region_handler_remove(bContext *C, void *UNUSED(userdata))
|
|||||||
|
|
||||||
UI_blocklist_free(C, ®ion->uiblocks);
|
UI_blocklist_free(C, ®ion->uiblocks);
|
||||||
|
|
||||||
sc = CTX_wm_screen(C);
|
screen = CTX_wm_screen(C);
|
||||||
if (sc == NULL) {
|
if (screen == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delayed apply callbacks, but not for screen level regions, those
|
/* delayed apply callbacks, but not for screen level regions, those
|
||||||
* we rather do at the very end after closing them all, which will
|
* we rather do at the very end after closing them all, which will
|
||||||
* be done in ui_region_handler/window */
|
* be done in ui_region_handler/window */
|
||||||
if (BLI_findindex(&sc->regionbase, region) == -1) {
|
if (BLI_findindex(&screen->regionbase, region) == -1) {
|
||||||
ui_apply_but_funcs_after(C);
|
ui_apply_but_funcs_after(C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1620,10 +1620,11 @@ static void UI_OT_reloadtranslation(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
const bool skip_depressed = RNA_boolean_get(op->ptr, "skip_depressed");
|
const bool skip_depressed = RNA_boolean_get(op->ptr, "skip_depressed");
|
||||||
ARegion *region_prev = CTX_wm_region(C);
|
ARegion *region_prev = CTX_wm_region(C);
|
||||||
ARegion *region = sc ? BKE_screen_find_region_xy(sc, RGN_TYPE_ANY, event->x, event->y) : NULL;
|
ARegion *region = screen ? BKE_screen_find_region_xy(screen, RGN_TYPE_ANY, event->x, event->y) :
|
||||||
|
NULL;
|
||||||
|
|
||||||
if (region == NULL) {
|
if (region == NULL) {
|
||||||
region = region_prev;
|
region = region_prev;
|
||||||
|
|||||||
@@ -530,23 +530,23 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle)
|
|||||||
|
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
wmWindow *win = ctx_win;
|
wmWindow *win = ctx_win;
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
|
|
||||||
/* There may actually be a different window active than the one showing the popup, so lookup real
|
/* There may actually be a different window active than the one showing the popup, so lookup real
|
||||||
* one. */
|
* one. */
|
||||||
if (BLI_findindex(&sc->regionbase, handle->region) == -1) {
|
if (BLI_findindex(&screen->regionbase, handle->region) == -1) {
|
||||||
for (win = wm->windows.first; win; win = win->next) {
|
for (win = wm->windows.first; win; win = win->next) {
|
||||||
sc = WM_window_get_active_screen(win);
|
screen = WM_window_get_active_screen(win);
|
||||||
if (BLI_findindex(&sc->regionbase, handle->region) != -1) {
|
if (BLI_findindex(&screen->regionbase, handle->region) != -1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_assert(win && sc);
|
BLI_assert(win && screen);
|
||||||
|
|
||||||
CTX_wm_window_set(C, win);
|
CTX_wm_window_set(C, win);
|
||||||
ui_region_temp_remove(C, sc, handle->region);
|
ui_region_temp_remove(C, screen, handle->region);
|
||||||
|
|
||||||
/* Reset context (area and region were NULL'ed when chaning context window). */
|
/* Reset context (area and region were NULL'ed when chaning context window). */
|
||||||
CTX_wm_window_set(C, ctx_win);
|
CTX_wm_window_set(C, ctx_win);
|
||||||
@@ -554,7 +554,7 @@ static void ui_popup_block_remove(bContext *C, uiPopupBlockHandle *handle)
|
|||||||
CTX_wm_region_set(C, ctx_region);
|
CTX_wm_region_set(C, ctx_region);
|
||||||
|
|
||||||
/* reset to region cursor (only if there's not another menu open) */
|
/* reset to region cursor (only if there's not another menu open) */
|
||||||
if (BLI_listbase_is_empty(&sc->regionbase)) {
|
if (BLI_listbase_is_empty(&screen->regionbase)) {
|
||||||
win->tag_cursor_refresh = true;
|
win->tag_cursor_refresh = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1480,9 +1480,9 @@ ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz)
|
|||||||
return ui_tooltip_create_with_data(C, data, init_position, NULL, aspect);
|
return ui_tooltip_create_with_data(C, data, init_position, NULL, aspect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_tooltip_free(bContext *C, bScreen *sc, ARegion *region)
|
void UI_tooltip_free(bContext *C, bScreen *screen, ARegion *region)
|
||||||
{
|
{
|
||||||
ui_region_temp_remove(C, sc, region);
|
ui_region_temp_remove(C, screen, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|||||||
@@ -39,12 +39,12 @@
|
|||||||
|
|
||||||
#include "interface_regions_intern.h"
|
#include "interface_regions_intern.h"
|
||||||
|
|
||||||
ARegion *ui_region_temp_add(bScreen *sc)
|
ARegion *ui_region_temp_add(bScreen *screen)
|
||||||
{
|
{
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
region = MEM_callocN(sizeof(ARegion), "area region");
|
region = MEM_callocN(sizeof(ARegion), "area region");
|
||||||
BLI_addtail(&sc->regionbase, region);
|
BLI_addtail(&screen->regionbase, region);
|
||||||
|
|
||||||
region->regiontype = RGN_TYPE_TEMPORARY;
|
region->regiontype = RGN_TYPE_TEMPORARY;
|
||||||
region->alignment = RGN_ALIGN_FLOAT;
|
region->alignment = RGN_ALIGN_FLOAT;
|
||||||
@@ -52,17 +52,17 @@ ARegion *ui_region_temp_add(bScreen *sc)
|
|||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_region_temp_remove(bContext *C, bScreen *sc, ARegion *region)
|
void ui_region_temp_remove(bContext *C, bScreen *screen, ARegion *region)
|
||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
|
|
||||||
BLI_assert(region->regiontype == RGN_TYPE_TEMPORARY);
|
BLI_assert(region->regiontype == RGN_TYPE_TEMPORARY);
|
||||||
BLI_assert(BLI_findindex(&sc->regionbase, region) != -1);
|
BLI_assert(BLI_findindex(&screen->regionbase, region) != -1);
|
||||||
if (win) {
|
if (win) {
|
||||||
wm_draw_region_clear(win, region);
|
wm_draw_region_clear(win, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
ED_region_exit(C, region);
|
ED_region_exit(C, region);
|
||||||
BKE_area_region_free(NULL, region); /* NULL: no spacetype */
|
BKE_area_region_free(NULL, region); /* NULL: no spacetype */
|
||||||
BLI_freelinkN(&sc->regionbase, region);
|
BLI_freelinkN(&screen->regionbase, region);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
uint ui_popup_menu_hash(const char *str);
|
uint ui_popup_menu_hash(const char *str);
|
||||||
|
|
||||||
/* interface_regions_intern.h */
|
/* interface_regions_intern.h */
|
||||||
ARegion *ui_region_temp_add(bScreen *sc);
|
ARegion *ui_region_temp_add(bScreen *screen);
|
||||||
void ui_region_temp_remove(struct bContext *C, bScreen *sc, ARegion *region);
|
void ui_region_temp_remove(struct bContext *C, bScreen *screen, ARegion *region);
|
||||||
|
|
||||||
#endif /* __INTERFACE_REGIONS_INTERN_H__ */
|
#endif /* __INTERFACE_REGIONS_INTERN_H__ */
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ static bool view2d_poll(bContext *C)
|
|||||||
*/
|
*/
|
||||||
typedef struct v2dViewPanData {
|
typedef struct v2dViewPanData {
|
||||||
/** screen where view pan was initiated */
|
/** screen where view pan was initiated */
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
/** area where view pan was initiated */
|
/** area where view pan was initiated */
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
/** region where view pan was initiated */
|
/** region where view pan was initiated */
|
||||||
@@ -126,7 +126,7 @@ static int view_pan_init(bContext *C, wmOperator *op)
|
|||||||
op->customdata = vpd;
|
op->customdata = vpd;
|
||||||
|
|
||||||
/* set pointers to owners */
|
/* set pointers to owners */
|
||||||
vpd->sc = CTX_wm_screen(C);
|
vpd->screen = CTX_wm_screen(C);
|
||||||
vpd->area = CTX_wm_area(C);
|
vpd->area = CTX_wm_area(C);
|
||||||
vpd->v2d = v2d;
|
vpd->v2d = v2d;
|
||||||
vpd->region = region;
|
vpd->region = region;
|
||||||
@@ -190,7 +190,7 @@ static void view_pan_apply_ex(bContext *C, v2dViewPanData *vpd, float dx, float
|
|||||||
/* request updates to be done... */
|
/* request updates to be done... */
|
||||||
WM_event_add_mousemove(CTX_wm_window(C));
|
WM_event_add_mousemove(CTX_wm_window(C));
|
||||||
|
|
||||||
UI_view2d_sync(vpd->sc, vpd->area, v2d, V2D_LOCK_COPY);
|
UI_view2d_sync(vpd->screen, vpd->area, v2d, V2D_LOCK_COPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void view_pan_apply(bContext *C, wmOperator *op)
|
static void view_pan_apply(bContext *C, wmOperator *op)
|
||||||
|
|||||||
@@ -1283,13 +1283,13 @@ cleanup:
|
|||||||
static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr)
|
static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr)
|
||||||
{
|
{
|
||||||
bool is_save_internal;
|
bool is_save_internal;
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
|
|
||||||
bkr->ob = CTX_data_active_object(C);
|
bkr->ob = CTX_data_active_object(C);
|
||||||
bkr->main = CTX_data_main(C);
|
bkr->main = CTX_data_main(C);
|
||||||
bkr->view_layer = CTX_data_view_layer(C);
|
bkr->view_layer = CTX_data_view_layer(C);
|
||||||
bkr->scene = CTX_data_scene(C);
|
bkr->scene = CTX_data_scene(C);
|
||||||
bkr->area = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL;
|
bkr->area = screen ? BKE_screen_find_big_area(screen, SPACE_IMAGE, 10) : NULL;
|
||||||
|
|
||||||
bkr->pass_type = RNA_enum_get(op->ptr, "type");
|
bkr->pass_type = RNA_enum_get(op->ptr, "type");
|
||||||
bkr->pass_filter = RNA_enum_get(op->ptr, "pass_filter");
|
bkr->pass_filter = RNA_enum_get(op->ptr, "pass_filter");
|
||||||
|
|||||||
@@ -105,13 +105,13 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update
|
|||||||
wm = bmain->wm.first;
|
wm = bmain->wm.first;
|
||||||
|
|
||||||
for (win = wm->windows.first; win; win = win->next) {
|
for (win = wm->windows.first; win; win = win->next) {
|
||||||
bScreen *sc = WM_window_get_active_screen(win);
|
bScreen *screen = WM_window_get_active_screen(win);
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
CTX_wm_window_set(C, win);
|
CTX_wm_window_set(C, win);
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->spacetype != SPACE_VIEW3D) {
|
if (area->spacetype != SPACE_VIEW3D) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update
|
|||||||
* time of the last update) */
|
* time of the last update) */
|
||||||
if (engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) {
|
if (engine && (updated || (engine->flag & RE_ENGINE_DO_UPDATE))) {
|
||||||
|
|
||||||
CTX_wm_screen_set(C, sc);
|
CTX_wm_screen_set(C, screen);
|
||||||
CTX_wm_area_set(C, area);
|
CTX_wm_area_set(C, area);
|
||||||
CTX_wm_region_set(C, region);
|
CTX_wm_region_set(C, region);
|
||||||
|
|
||||||
@@ -181,8 +181,8 @@ void ED_render_engine_area_exit(Main *bmain, ScrArea *area)
|
|||||||
void ED_render_engine_changed(Main *bmain)
|
void ED_render_engine_changed(Main *bmain)
|
||||||
{
|
{
|
||||||
/* on changing the render engine type, clear all running render engines */
|
/* on changing the render engine type, clear all running render engines */
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
ED_render_engine_area_exit(bmain, area);
|
ED_render_engine_area_exit(bmain, area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,9 +204,9 @@ void ED_render_engine_changed(Main *bmain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_render_view_layer_changed(Main *bmain, bScreen *sc)
|
void ED_render_view_layer_changed(Main *bmain, bScreen *screen)
|
||||||
{
|
{
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
ED_render_engine_area_exit(bmain, area);
|
ED_render_engine_area_exit(bmain, area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,12 @@
|
|||||||
/* would use BKE_screen_find_big_area(...) but this is too specific */
|
/* would use BKE_screen_find_big_area(...) but this is too specific */
|
||||||
static ScrArea *biggest_non_image_area(bContext *C)
|
static ScrArea *biggest_non_image_area(bContext *C)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area, *big = NULL;
|
ScrArea *area, *big = NULL;
|
||||||
int size, maxsize = 0, bwmaxsize = 0;
|
int size, maxsize = 0, bwmaxsize = 0;
|
||||||
short foundwin = 0;
|
short foundwin = 0;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->winx > 30 && area->winy > 30) {
|
if (area->winx > 30 && area->winy > 30) {
|
||||||
size = area->winx * area->winy;
|
size = area->winx * area->winy;
|
||||||
if (!area->full && area->spacetype == SPACE_PROPERTIES) {
|
if (!area->full && area->spacetype == SPACE_PROPERTIES) {
|
||||||
@@ -111,12 +111,12 @@ static ScrArea *find_area_showing_r_result(bContext *C, Scene *scene, wmWindow *
|
|||||||
|
|
||||||
static ScrArea *find_area_image_empty(bContext *C)
|
static ScrArea *find_area_image_empty(bContext *C)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
SpaceImage *sima;
|
SpaceImage *sima;
|
||||||
|
|
||||||
/* find an imagewindow showing render result */
|
/* find an imagewindow showing render result */
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->spacetype == SPACE_IMAGE) {
|
if (area->spacetype == SPACE_IMAGE) {
|
||||||
sima = area->spacedata.first;
|
sima = area->spacedata.first;
|
||||||
if ((sima->mode == SI_MODE_VIEW) && !sima->image) {
|
if ((sima->mode == SI_MODE_VIEW) && !sima->image) {
|
||||||
@@ -324,10 +324,10 @@ static int render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
|||||||
|
|
||||||
/* is there another window on current scene showing result? */
|
/* is there another window on current scene showing result? */
|
||||||
for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
|
for (win = CTX_wm_manager(C)->windows.first; win; win = win->next) {
|
||||||
const bScreen *sc = WM_window_get_active_screen(win);
|
const bScreen *screen = WM_window_get_active_screen(win);
|
||||||
|
|
||||||
if ((WM_window_is_temp_screen(win) &&
|
if ((WM_window_is_temp_screen(win) &&
|
||||||
((ScrArea *)sc->areabase.first)->spacetype == SPACE_IMAGE) ||
|
((ScrArea *)screen->areabase.first)->spacetype == SPACE_IMAGE) ||
|
||||||
(win == winshow && winshow != wincur)) {
|
(win == winshow && winshow != wincur)) {
|
||||||
wm_window_raise(win);
|
wm_window_raise(win);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
|
|||||||
@@ -2263,11 +2263,11 @@ void ED_area_prevspace(bContext *C, ScrArea *area)
|
|||||||
int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
|
int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
|
||||||
{
|
{
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
bScreen *scr = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
PointerRNA areaptr;
|
PointerRNA areaptr;
|
||||||
int xco = 0.4 * U.widget_unit;
|
int xco = 0.4 * U.widget_unit;
|
||||||
|
|
||||||
RNA_pointer_create(&(scr->id), &RNA_Area, area, &areaptr);
|
RNA_pointer_create(&(screen->id), &RNA_Area, area, &areaptr);
|
||||||
|
|
||||||
uiDefButR(block,
|
uiDefButR(block,
|
||||||
UI_BTYPE_MENU,
|
UI_BTYPE_MENU,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
View3D *v3d = CTX_wm_view3d(C); /* This may be NULL in a lot of cases. */
|
View3D *v3d = CTX_wm_view3d(C); /* This may be NULL in a lot of cases. */
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
Scene *scene = WM_window_get_active_scene(win);
|
Scene *scene = WM_window_get_active_scene(win);
|
||||||
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
||||||
@@ -555,7 +555,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CTX_data_equals(member, "annotation_data")) {
|
else if (CTX_data_equals(member, "annotation_data")) {
|
||||||
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, area, scene);
|
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
|
||||||
|
|
||||||
if (gpd) {
|
if (gpd) {
|
||||||
CTX_data_id_pointer_set(result, &gpd->id);
|
CTX_data_id_pointer_set(result, &gpd->id);
|
||||||
@@ -568,7 +568,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
|
|
||||||
/* Get pointer to Grease Pencil Data. */
|
/* Get pointer to Grease Pencil Data. */
|
||||||
gpd_ptr = ED_annotation_data_get_pointers_direct((ID *)sc, area, scene, &ptr);
|
gpd_ptr = ED_annotation_data_get_pointers_direct((ID *)screen, area, scene, &ptr);
|
||||||
|
|
||||||
if (gpd_ptr) {
|
if (gpd_ptr) {
|
||||||
CTX_data_pointer_set(result, ptr.owner_id, ptr.type, ptr.data);
|
CTX_data_pointer_set(result, ptr.owner_id, ptr.type, ptr.data);
|
||||||
@@ -588,7 +588,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CTX_data_equals(member, "active_annotation_layer")) {
|
else if (CTX_data_equals(member, "active_annotation_layer")) {
|
||||||
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)sc, area, scene);
|
bGPdata *gpd = ED_annotation_data_get_active_direct((ID *)screen, area, scene);
|
||||||
|
|
||||||
if (gpd) {
|
if (gpd) {
|
||||||
bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd);
|
bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ static ScrArea *screen_addarea_ex(ScrAreaMap *area_map,
|
|||||||
|
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
static ScrArea *screen_addarea(bScreen *sc,
|
static ScrArea *screen_addarea(bScreen *screen,
|
||||||
ScrVert *left_bottom,
|
ScrVert *left_bottom,
|
||||||
ScrVert *left_top,
|
ScrVert *left_top,
|
||||||
ScrVert *right_top,
|
ScrVert *right_top,
|
||||||
@@ -90,22 +90,22 @@ static ScrArea *screen_addarea(bScreen *sc,
|
|||||||
short spacetype)
|
short spacetype)
|
||||||
{
|
{
|
||||||
return screen_addarea_ex(
|
return screen_addarea_ex(
|
||||||
AREAMAP_FROM_SCREEN(sc), left_bottom, left_top, right_top, right_bottom, spacetype);
|
AREAMAP_FROM_SCREEN(screen), left_bottom, left_top, right_top, right_bottom, spacetype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void screen_delarea(bContext *C, bScreen *sc, ScrArea *area)
|
static void screen_delarea(bContext *C, bScreen *screen, ScrArea *area)
|
||||||
{
|
{
|
||||||
|
|
||||||
ED_area_exit(C, area);
|
ED_area_exit(C, area);
|
||||||
|
|
||||||
BKE_screen_area_free(area);
|
BKE_screen_area_free(area);
|
||||||
|
|
||||||
BLI_remlink(&sc->areabase, area);
|
BLI_remlink(&screen->areabase, area);
|
||||||
MEM_freeN(area);
|
MEM_freeN(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrArea *area_split(
|
ScrArea *area_split(
|
||||||
const wmWindow *win, bScreen *sc, ScrArea *area, char dir, float fac, int merge)
|
const wmWindow *win, bScreen *screen, ScrArea *area, char dir, float fac, int merge)
|
||||||
{
|
{
|
||||||
ScrArea *newa = NULL;
|
ScrArea *newa = NULL;
|
||||||
ScrVert *sv1, *sv2;
|
ScrVert *sv1, *sv2;
|
||||||
@@ -129,19 +129,19 @@ ScrArea *area_split(
|
|||||||
|
|
||||||
if (dir == 'h') {
|
if (dir == 'h') {
|
||||||
/* new vertices */
|
/* new vertices */
|
||||||
sv1 = screen_geom_vertex_add(sc, area->v1->vec.x, split);
|
sv1 = screen_geom_vertex_add(screen, area->v1->vec.x, split);
|
||||||
sv2 = screen_geom_vertex_add(sc, area->v4->vec.x, split);
|
sv2 = screen_geom_vertex_add(screen, area->v4->vec.x, split);
|
||||||
|
|
||||||
/* new edges */
|
/* new edges */
|
||||||
screen_geom_edge_add(sc, area->v1, sv1);
|
screen_geom_edge_add(screen, area->v1, sv1);
|
||||||
screen_geom_edge_add(sc, sv1, area->v2);
|
screen_geom_edge_add(screen, sv1, area->v2);
|
||||||
screen_geom_edge_add(sc, area->v3, sv2);
|
screen_geom_edge_add(screen, area->v3, sv2);
|
||||||
screen_geom_edge_add(sc, sv2, area->v4);
|
screen_geom_edge_add(screen, sv2, area->v4);
|
||||||
screen_geom_edge_add(sc, sv1, sv2);
|
screen_geom_edge_add(screen, sv1, sv2);
|
||||||
|
|
||||||
if (fac > 0.5f) {
|
if (fac > 0.5f) {
|
||||||
/* new areas: top */
|
/* new areas: top */
|
||||||
newa = screen_addarea(sc, sv1, area->v2, area->v3, sv2, area->spacetype);
|
newa = screen_addarea(screen, sv1, area->v2, area->v3, sv2, area->spacetype);
|
||||||
|
|
||||||
/* area below */
|
/* area below */
|
||||||
area->v2 = sv1;
|
area->v2 = sv1;
|
||||||
@@ -149,7 +149,7 @@ ScrArea *area_split(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* new areas: bottom */
|
/* new areas: bottom */
|
||||||
newa = screen_addarea(sc, area->v1, sv1, sv2, area->v4, area->spacetype);
|
newa = screen_addarea(screen, area->v1, sv1, sv2, area->v4, area->spacetype);
|
||||||
|
|
||||||
/* area above */
|
/* area above */
|
||||||
area->v1 = sv1;
|
area->v1 = sv1;
|
||||||
@@ -160,19 +160,19 @@ ScrArea *area_split(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* new vertices */
|
/* new vertices */
|
||||||
sv1 = screen_geom_vertex_add(sc, split, area->v1->vec.y);
|
sv1 = screen_geom_vertex_add(screen, split, area->v1->vec.y);
|
||||||
sv2 = screen_geom_vertex_add(sc, split, area->v2->vec.y);
|
sv2 = screen_geom_vertex_add(screen, split, area->v2->vec.y);
|
||||||
|
|
||||||
/* new edges */
|
/* new edges */
|
||||||
screen_geom_edge_add(sc, area->v1, sv1);
|
screen_geom_edge_add(screen, area->v1, sv1);
|
||||||
screen_geom_edge_add(sc, sv1, area->v4);
|
screen_geom_edge_add(screen, sv1, area->v4);
|
||||||
screen_geom_edge_add(sc, area->v2, sv2);
|
screen_geom_edge_add(screen, area->v2, sv2);
|
||||||
screen_geom_edge_add(sc, sv2, area->v3);
|
screen_geom_edge_add(screen, sv2, area->v3);
|
||||||
screen_geom_edge_add(sc, sv1, sv2);
|
screen_geom_edge_add(screen, sv1, sv2);
|
||||||
|
|
||||||
if (fac > 0.5f) {
|
if (fac > 0.5f) {
|
||||||
/* new areas: right */
|
/* new areas: right */
|
||||||
newa = screen_addarea(sc, sv1, sv2, area->v3, area->v4, area->spacetype);
|
newa = screen_addarea(screen, sv1, sv2, area->v3, area->v4, area->spacetype);
|
||||||
|
|
||||||
/* area left */
|
/* area left */
|
||||||
area->v3 = sv2;
|
area->v3 = sv2;
|
||||||
@@ -180,7 +180,7 @@ ScrArea *area_split(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* new areas: left */
|
/* new areas: left */
|
||||||
newa = screen_addarea(sc, area->v1, area->v2, sv2, sv1, area->spacetype);
|
newa = screen_addarea(screen, area->v1, area->v2, sv2, sv1, area->spacetype);
|
||||||
|
|
||||||
/* area right */
|
/* area right */
|
||||||
area->v1 = sv1;
|
area->v1 = sv1;
|
||||||
@@ -192,10 +192,10 @@ ScrArea *area_split(
|
|||||||
|
|
||||||
/* remove double vertices en edges */
|
/* remove double vertices en edges */
|
||||||
if (merge) {
|
if (merge) {
|
||||||
BKE_screen_remove_double_scrverts(sc);
|
BKE_screen_remove_double_scrverts(screen);
|
||||||
}
|
}
|
||||||
BKE_screen_remove_double_scredges(sc);
|
BKE_screen_remove_double_scredges(screen);
|
||||||
BKE_screen_remove_unused_scredges(sc);
|
BKE_screen_remove_unused_scredges(screen);
|
||||||
|
|
||||||
return newa;
|
return newa;
|
||||||
}
|
}
|
||||||
@@ -205,27 +205,27 @@ ScrArea *area_split(
|
|||||||
*/
|
*/
|
||||||
bScreen *screen_add(Main *bmain, const char *name, const rcti *rect)
|
bScreen *screen_add(Main *bmain, const char *name, const rcti *rect)
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
ScrVert *sv1, *sv2, *sv3, *sv4;
|
ScrVert *sv1, *sv2, *sv3, *sv4;
|
||||||
|
|
||||||
sc = BKE_libblock_alloc(bmain, ID_SCR, name, 0);
|
screen = BKE_libblock_alloc(bmain, ID_SCR, name, 0);
|
||||||
sc->do_refresh = true;
|
screen->do_refresh = true;
|
||||||
sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN;
|
screen->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN;
|
||||||
|
|
||||||
sv1 = screen_geom_vertex_add(sc, rect->xmin, rect->ymin);
|
sv1 = screen_geom_vertex_add(screen, rect->xmin, rect->ymin);
|
||||||
sv2 = screen_geom_vertex_add(sc, rect->xmin, rect->ymax - 1);
|
sv2 = screen_geom_vertex_add(screen, rect->xmin, rect->ymax - 1);
|
||||||
sv3 = screen_geom_vertex_add(sc, rect->xmax - 1, rect->ymax - 1);
|
sv3 = screen_geom_vertex_add(screen, rect->xmax - 1, rect->ymax - 1);
|
||||||
sv4 = screen_geom_vertex_add(sc, rect->xmax - 1, rect->ymin);
|
sv4 = screen_geom_vertex_add(screen, rect->xmax - 1, rect->ymin);
|
||||||
|
|
||||||
screen_geom_edge_add(sc, sv1, sv2);
|
screen_geom_edge_add(screen, sv1, sv2);
|
||||||
screen_geom_edge_add(sc, sv2, sv3);
|
screen_geom_edge_add(screen, sv2, sv3);
|
||||||
screen_geom_edge_add(sc, sv3, sv4);
|
screen_geom_edge_add(screen, sv3, sv4);
|
||||||
screen_geom_edge_add(sc, sv4, sv1);
|
screen_geom_edge_add(screen, sv4, sv1);
|
||||||
|
|
||||||
/* dummy type, no spacedata */
|
/* dummy type, no spacedata */
|
||||||
screen_addarea(sc, sv1, sv2, sv3, sv4, SPACE_EMPTY);
|
screen_addarea(screen, sv1, sv2, sv3, sv4, SPACE_EMPTY);
|
||||||
|
|
||||||
return sc;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void screen_data_copy(bScreen *to, bScreen *from)
|
void screen_data_copy(bScreen *to, bScreen *from)
|
||||||
@@ -339,7 +339,7 @@ int area_getorientation(ScrArea *area, ScrArea *sb)
|
|||||||
/* Helper function to join 2 areas, it has a return value, 0=failed 1=success
|
/* Helper function to join 2 areas, it has a return value, 0=failed 1=success
|
||||||
* used by the split, join operators
|
* used by the split, join operators
|
||||||
*/
|
*/
|
||||||
int screen_area_join(bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2)
|
int screen_area_join(bContext *C, bScreen *screen, ScrArea *sa1, ScrArea *sa2)
|
||||||
{
|
{
|
||||||
int dir = area_getorientation(sa1, sa2);
|
int dir = area_getorientation(sa1, sa2);
|
||||||
|
|
||||||
@@ -367,32 +367,32 @@ int screen_area_join(bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2)
|
|||||||
if (dir == 0) { /* sa1 to right of sa2 = W */
|
if (dir == 0) { /* sa1 to right of sa2 = W */
|
||||||
sa1->v1 = sa2->v1; /* BL */
|
sa1->v1 = sa2->v1; /* BL */
|
||||||
sa1->v2 = sa2->v2; /* TL */
|
sa1->v2 = sa2->v2; /* TL */
|
||||||
screen_geom_edge_add(scr, sa1->v2, sa1->v3);
|
screen_geom_edge_add(screen, sa1->v2, sa1->v3);
|
||||||
screen_geom_edge_add(scr, sa1->v1, sa1->v4);
|
screen_geom_edge_add(screen, sa1->v1, sa1->v4);
|
||||||
}
|
}
|
||||||
else if (dir == 1) { /* sa1 to bottom of sa2 = N */
|
else if (dir == 1) { /* sa1 to bottom of sa2 = N */
|
||||||
sa1->v2 = sa2->v2; /* TL */
|
sa1->v2 = sa2->v2; /* TL */
|
||||||
sa1->v3 = sa2->v3; /* TR */
|
sa1->v3 = sa2->v3; /* TR */
|
||||||
screen_geom_edge_add(scr, sa1->v1, sa1->v2);
|
screen_geom_edge_add(screen, sa1->v1, sa1->v2);
|
||||||
screen_geom_edge_add(scr, sa1->v3, sa1->v4);
|
screen_geom_edge_add(screen, sa1->v3, sa1->v4);
|
||||||
}
|
}
|
||||||
else if (dir == 2) { /* sa1 to left of sa2 = E */
|
else if (dir == 2) { /* sa1 to left of sa2 = E */
|
||||||
sa1->v3 = sa2->v3; /* TR */
|
sa1->v3 = sa2->v3; /* TR */
|
||||||
sa1->v4 = sa2->v4; /* BR */
|
sa1->v4 = sa2->v4; /* BR */
|
||||||
screen_geom_edge_add(scr, sa1->v2, sa1->v3);
|
screen_geom_edge_add(screen, sa1->v2, sa1->v3);
|
||||||
screen_geom_edge_add(scr, sa1->v1, sa1->v4);
|
screen_geom_edge_add(screen, sa1->v1, sa1->v4);
|
||||||
}
|
}
|
||||||
else if (dir == 3) { /* sa1 on top of sa2 = S */
|
else if (dir == 3) { /* sa1 on top of sa2 = S */
|
||||||
sa1->v1 = sa2->v1; /* BL */
|
sa1->v1 = sa2->v1; /* BL */
|
||||||
sa1->v4 = sa2->v4; /* BR */
|
sa1->v4 = sa2->v4; /* BR */
|
||||||
screen_geom_edge_add(scr, sa1->v1, sa1->v2);
|
screen_geom_edge_add(screen, sa1->v1, sa1->v2);
|
||||||
screen_geom_edge_add(scr, sa1->v3, sa1->v4);
|
screen_geom_edge_add(screen, sa1->v3, sa1->v4);
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_delarea(C, scr, sa2);
|
screen_delarea(C, screen, sa2);
|
||||||
BKE_screen_remove_double_scrverts(scr);
|
BKE_screen_remove_double_scrverts(screen);
|
||||||
/* Update preview thumbnail */
|
/* Update preview thumbnail */
|
||||||
BKE_icon_changed(scr->id.icon_id);
|
BKE_icon_changed(screen->id.icon_id);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -682,16 +682,16 @@ static void screen_cursor_set(wmWindow *win, const int xy[2])
|
|||||||
*/
|
*/
|
||||||
void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
||||||
{
|
{
|
||||||
bScreen *scr = WM_window_get_active_screen(win);
|
bScreen *screen = WM_window_get_active_screen(win);
|
||||||
if (scr == NULL) {
|
if (screen == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrArea *area = NULL;
|
ScrArea *area = NULL;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
ARegion *region_prev = scr->active_region;
|
ARegion *region_prev = screen->active_region;
|
||||||
|
|
||||||
ED_screen_areas_iter(win, scr, area_iter)
|
ED_screen_areas_iter(win, screen, area_iter)
|
||||||
{
|
{
|
||||||
if (xy[0] > area_iter->totrct.xmin && xy[0] < area_iter->totrct.xmax) {
|
if (xy[0] > area_iter->totrct.xmin && xy[0] < area_iter->totrct.xmax) {
|
||||||
if (xy[1] > area_iter->totrct.ymin && xy[1] < area_iter->totrct.ymax) {
|
if (xy[1] > area_iter->totrct.ymin && xy[1] < area_iter->totrct.ymax) {
|
||||||
@@ -706,19 +706,19 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
|||||||
/* Make overlap active when mouse over. */
|
/* Make overlap active when mouse over. */
|
||||||
for (region = area->regionbase.first; region; region = region->next) {
|
for (region = area->regionbase.first; region; region = region->next) {
|
||||||
if (ED_region_contains_xy(region, xy)) {
|
if (ED_region_contains_xy(region, xy)) {
|
||||||
scr->active_region = region;
|
screen->active_region = region;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scr->active_region = NULL;
|
screen->active_region = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for redraw headers. */
|
/* Check for redraw headers. */
|
||||||
if (region_prev != scr->active_region) {
|
if (region_prev != screen->active_region) {
|
||||||
|
|
||||||
ED_screen_areas_iter(win, scr, area_iter)
|
ED_screen_areas_iter(win, screen, area_iter)
|
||||||
{
|
{
|
||||||
bool do_draw = false;
|
bool do_draw = false;
|
||||||
|
|
||||||
@@ -729,7 +729,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
|||||||
area_iter->type->deactivate(area_iter);
|
area_iter->type->deactivate(area_iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (region == region_prev && region != scr->active_region) {
|
if (region == region_prev && region != screen->active_region) {
|
||||||
wmGizmoMap *gzmap = region_prev->gizmo_map;
|
wmGizmoMap *gzmap = region_prev->gizmo_map;
|
||||||
if (gzmap) {
|
if (gzmap) {
|
||||||
if (WM_gizmo_highlight_set(gzmap, NULL)) {
|
if (WM_gizmo_highlight_set(gzmap, NULL)) {
|
||||||
@@ -738,7 +738,7 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (region == region_prev || region == scr->active_region) {
|
if (region == region_prev || region == screen->active_region) {
|
||||||
do_draw = true;
|
do_draw = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -755,19 +755,19 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
|||||||
|
|
||||||
/* Cursors, for time being set always on edges,
|
/* Cursors, for time being set always on edges,
|
||||||
* otherwise the active region doesn't switch. */
|
* otherwise the active region doesn't switch. */
|
||||||
if (scr->active_region == NULL) {
|
if (screen->active_region == NULL) {
|
||||||
screen_cursor_set(win, xy);
|
screen_cursor_set(win, xy);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Notifier invokes freeing the buttons... causing a bit too much redraws. */
|
/* Notifier invokes freeing the buttons... causing a bit too much redraws. */
|
||||||
region_cursor_set_ex(win, area, scr->active_region, region_prev != scr->active_region);
|
region_cursor_set_ex(win, area, screen->active_region, region_prev != screen->active_region);
|
||||||
|
|
||||||
if (region_prev != scr->active_region) {
|
if (region_prev != screen->active_region) {
|
||||||
/* This used to be a notifier, but needs to be done immediate
|
/* This used to be a notifier, but needs to be done immediate
|
||||||
* because it can undo setting the right button as active due
|
* because it can undo setting the right button as active due
|
||||||
* to delayed notifier handling. */
|
* to delayed notifier handling. */
|
||||||
if (C) {
|
if (C) {
|
||||||
UI_screen_free_active_but(C, scr);
|
UI_screen_free_active_but(C, screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -776,10 +776,10 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
|
|||||||
int ED_screen_area_active(const bContext *C)
|
int ED_screen_area_active(const bContext *C)
|
||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
|
|
||||||
if (win && sc && area) {
|
if (win && screen && area) {
|
||||||
AZone *az = ED_area_actionzone_find_xy(area, &win->eventstate->x);
|
AZone *az = ED_area_actionzone_find_xy(area, &win->eventstate->x);
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
@@ -788,7 +788,7 @@ int ED_screen_area_active(const bContext *C)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (region = area->regionbase.first; region; region = region->next) {
|
for (region = area->regionbase.first; region; region = region->next) {
|
||||||
if (region == sc->active_region) {
|
if (region == screen->active_region) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1000,17 +1000,17 @@ bScreen *screen_change_prepare(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void screen_change_update(bContext *C, wmWindow *win, bScreen *sc)
|
void screen_change_update(bContext *C, wmWindow *win, bScreen *screen)
|
||||||
{
|
{
|
||||||
Scene *scene = WM_window_get_active_scene(win);
|
Scene *scene = WM_window_get_active_scene(win);
|
||||||
WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
|
WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
|
||||||
WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, sc);
|
WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, screen);
|
||||||
|
|
||||||
CTX_wm_window_set(C, win); /* stores C->wm.screen... hrmf */
|
CTX_wm_window_set(C, win); /* stores C->wm.screen... hrmf */
|
||||||
|
|
||||||
ED_screen_refresh(CTX_wm_manager(C), win);
|
ED_screen_refresh(CTX_wm_manager(C), win);
|
||||||
|
|
||||||
BKE_screen_view3d_scene_sync(sc, scene); /* sync new screen with scene data */
|
BKE_screen_view3d_scene_sync(screen, scene); /* sync new screen with scene data */
|
||||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||||
WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTSET, layout);
|
WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTSET, layout);
|
||||||
|
|
||||||
@@ -1026,16 +1026,16 @@ void screen_change_update(bContext *C, wmWindow *win, bScreen *sc)
|
|||||||
* \warning Do NOT call in area/region queues!
|
* \warning Do NOT call in area/region queues!
|
||||||
* \returns if screen changing was successful.
|
* \returns if screen changing was successful.
|
||||||
*/
|
*/
|
||||||
bool ED_screen_change(bContext *C, bScreen *sc)
|
bool ED_screen_change(bContext *C, bScreen *screen)
|
||||||
{
|
{
|
||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *screen_old = CTX_wm_screen(C);
|
bScreen *screen_old = CTX_wm_screen(C);
|
||||||
bScreen *screen_new = screen_change_prepare(screen_old, sc, bmain, C, win);
|
bScreen *screen_new = screen_change_prepare(screen_old, screen, bmain, C, win);
|
||||||
|
|
||||||
if (screen_new) {
|
if (screen_new) {
|
||||||
WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
|
WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook);
|
||||||
WM_window_set_active_screen(win, workspace, sc);
|
WM_window_set_active_screen(win, workspace, screen);
|
||||||
screen_change_update(C, win, screen_new);
|
screen_change_update(C, win, screen_new);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -1054,7 +1054,7 @@ static void screen_set_3dview_camera(Scene *scene,
|
|||||||
|
|
||||||
if (!v3d->camera || !BKE_view_layer_base_find(view_layer, v3d->camera)) {
|
if (!v3d->camera || !BKE_view_layer_base_find(view_layer, v3d->camera)) {
|
||||||
v3d->camera = BKE_view_layer_camera_find(view_layer);
|
v3d->camera = BKE_view_layer_camera_find(view_layer);
|
||||||
// XXX if (sc == curscreen) handle_view3d_lock();
|
// XXX if (screen == curscreen) handle_view3d_lock();
|
||||||
if (!v3d->camera) {
|
if (!v3d->camera) {
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
ListBase *regionbase;
|
ListBase *regionbase;
|
||||||
@@ -1214,7 +1214,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
WorkSpace *workspace = WM_window_get_active_workspace(win);
|
WorkSpace *workspace = WM_window_get_active_workspace(win);
|
||||||
bScreen *sc, *oldscreen;
|
bScreen *screen, *oldscreen;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
if (area) {
|
if (area) {
|
||||||
@@ -1238,18 +1238,18 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
if (area && area->full) {
|
if (area && area->full) {
|
||||||
WorkSpaceLayout *layout_old = WM_window_get_active_layout(win);
|
WorkSpaceLayout *layout_old = WM_window_get_active_layout(win);
|
||||||
/* restoring back to SCREENNORMAL */
|
/* restoring back to SCREENNORMAL */
|
||||||
sc = area->full; /* the old screen to restore */
|
screen = area->full; /* the old screen to restore */
|
||||||
oldscreen = WM_window_get_active_screen(win); /* the one disappearing */
|
oldscreen = WM_window_get_active_screen(win); /* the one disappearing */
|
||||||
|
|
||||||
BLI_assert(BKE_workspace_layout_screen_get(layout_old) != sc);
|
BLI_assert(BKE_workspace_layout_screen_get(layout_old) != screen);
|
||||||
BLI_assert(BKE_workspace_layout_screen_get(layout_old)->state != SCREENNORMAL);
|
BLI_assert(BKE_workspace_layout_screen_get(layout_old)->state != SCREENNORMAL);
|
||||||
|
|
||||||
sc->state = SCREENNORMAL;
|
screen->state = SCREENNORMAL;
|
||||||
sc->flag = oldscreen->flag;
|
screen->flag = oldscreen->flag;
|
||||||
|
|
||||||
/* find old area to restore from */
|
/* find old area to restore from */
|
||||||
ScrArea *fullsa = NULL;
|
ScrArea *fullsa = NULL;
|
||||||
for (ScrArea *old = sc->areabase.first; old; old = old->next) {
|
for (ScrArea *old = screen->areabase.first; old; old = old->next) {
|
||||||
/* area to restore from is always first */
|
/* area to restore from is always first */
|
||||||
if (old->full && !fullsa) {
|
if (old->full && !fullsa) {
|
||||||
fullsa = old;
|
fullsa = old;
|
||||||
@@ -1283,10 +1283,10 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
ED_area_data_swap(fullsa, area);
|
ED_area_data_swap(fullsa, area);
|
||||||
|
|
||||||
/* animtimer back */
|
/* animtimer back */
|
||||||
sc->animtimer = oldscreen->animtimer;
|
screen->animtimer = oldscreen->animtimer;
|
||||||
oldscreen->animtimer = NULL;
|
oldscreen->animtimer = NULL;
|
||||||
|
|
||||||
ED_screen_change(C, sc);
|
ED_screen_change(C, screen);
|
||||||
|
|
||||||
BKE_workspace_layout_remove(CTX_data_main(C), workspace, layout_old);
|
BKE_workspace_layout_remove(CTX_data_main(C), workspace, layout_old);
|
||||||
|
|
||||||
@@ -1294,7 +1294,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
* screen handling as it uses the area coords which aren't updated yet.
|
* screen handling as it uses the area coords which aren't updated yet.
|
||||||
* Without doing so, the screen handling gets wrong area coords,
|
* Without doing so, the screen handling gets wrong area coords,
|
||||||
* which in worst case can lead to crashes (see T43139) */
|
* which in worst case can lead to crashes (see T43139) */
|
||||||
sc->skip_handling = true;
|
screen->skip_handling = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* change from SCREENNORMAL to new state */
|
/* change from SCREENNORMAL to new state */
|
||||||
@@ -1311,14 +1311,14 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
|
|
||||||
layout_new = ED_workspace_layout_add(bmain, workspace, win, newname);
|
layout_new = ED_workspace_layout_add(bmain, workspace, win, newname);
|
||||||
|
|
||||||
sc = BKE_workspace_layout_screen_get(layout_new);
|
screen = BKE_workspace_layout_screen_get(layout_new);
|
||||||
sc->state = state;
|
screen->state = state;
|
||||||
sc->redraws_flag = oldscreen->redraws_flag;
|
screen->redraws_flag = oldscreen->redraws_flag;
|
||||||
sc->temp = oldscreen->temp;
|
screen->temp = oldscreen->temp;
|
||||||
sc->flag = oldscreen->flag;
|
screen->flag = oldscreen->flag;
|
||||||
|
|
||||||
/* timer */
|
/* timer */
|
||||||
sc->animtimer = oldscreen->animtimer;
|
screen->animtimer = oldscreen->animtimer;
|
||||||
oldscreen->animtimer = NULL;
|
oldscreen->animtimer = NULL;
|
||||||
|
|
||||||
/* use random area when we have no active one, e.g. when the
|
/* use random area when we have no active one, e.g. when the
|
||||||
@@ -1327,7 +1327,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
area = oldscreen->areabase.first;
|
area = oldscreen->areabase.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
newa = (ScrArea *)sc->areabase.first;
|
newa = (ScrArea *)screen->areabase.first;
|
||||||
|
|
||||||
/* copy area */
|
/* copy area */
|
||||||
ED_area_data_swap(newa, area);
|
ED_area_data_swap(newa, area);
|
||||||
@@ -1359,13 +1359,13 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, const
|
|||||||
area->full = oldscreen;
|
area->full = oldscreen;
|
||||||
newa->full = oldscreen;
|
newa->full = oldscreen;
|
||||||
|
|
||||||
ED_screen_change(C, sc);
|
ED_screen_change(C, screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX bad code: setscreen() ends with first area active. fullscreen render assumes this too */
|
/* XXX bad code: setscreen() ends with first area active. fullscreen render assumes this too */
|
||||||
CTX_wm_area_set(C, sc->areabase.first);
|
CTX_wm_area_set(C, screen->areabase.first);
|
||||||
|
|
||||||
return sc->areabase.first;
|
return screen->areabase.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1557,11 +1557,11 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph)
|
|||||||
#ifdef DURIAN_CAMERA_SWITCH
|
#ifdef DURIAN_CAMERA_SWITCH
|
||||||
void *camera = BKE_scene_camera_switch_find(scene);
|
void *camera = BKE_scene_camera_switch_find(scene);
|
||||||
if (camera && scene->camera != camera) {
|
if (camera && scene->camera != camera) {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
scene->camera = camera;
|
scene->camera = camera;
|
||||||
/* are there cameras in the views that are not in the scene? */
|
/* are there cameras in the views that are not in the scene? */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
BKE_screen_view3d_scene_sync(sc, scene);
|
BKE_screen_view3d_scene_sync(screen, scene);
|
||||||
}
|
}
|
||||||
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
|
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ ScrVert *screen_geom_vertex_add_ex(ScrAreaMap *area_map, short x, short y)
|
|||||||
BLI_addtail(&area_map->vertbase, sv);
|
BLI_addtail(&area_map->vertbase, sv);
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
ScrVert *screen_geom_vertex_add(bScreen *sc, short x, short y)
|
ScrVert *screen_geom_vertex_add(bScreen *screen, short x, short y)
|
||||||
{
|
{
|
||||||
return screen_geom_vertex_add_ex(AREAMAP_FROM_SCREEN(sc), x, y);
|
return screen_geom_vertex_add_ex(AREAMAP_FROM_SCREEN(screen), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrEdge *screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2)
|
ScrEdge *screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2)
|
||||||
@@ -73,9 +73,9 @@ ScrEdge *screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2)
|
|||||||
BLI_addtail(&area_map->edgebase, se);
|
BLI_addtail(&area_map->edgebase, se);
|
||||||
return se;
|
return se;
|
||||||
}
|
}
|
||||||
ScrEdge *screen_geom_edge_add(bScreen *sc, ScrVert *v1, ScrVert *v2)
|
ScrEdge *screen_geom_edge_add(bScreen *screen, ScrVert *v1, ScrVert *v2)
|
||||||
{
|
{
|
||||||
return screen_geom_edge_add_ex(AREAMAP_FROM_SCREEN(sc), v1, v2);
|
return screen_geom_edge_add_ex(AREAMAP_FROM_SCREEN(screen), v1, v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool screen_geom_edge_is_horizontal(ScrEdge *se)
|
bool screen_geom_edge_is_horizontal(ScrEdge *se)
|
||||||
@@ -153,7 +153,7 @@ ScrEdge *screen_geom_find_active_scredge(const wmWindow *win,
|
|||||||
* * Ensure areas have a minimum height.
|
* * Ensure areas have a minimum height.
|
||||||
* * Correctly set global areas to their fixed height.
|
* * Correctly set global areas to their fixed height.
|
||||||
*/
|
*/
|
||||||
void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
|
void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen)
|
||||||
{
|
{
|
||||||
rcti window_rect, screen_rect;
|
rcti window_rect, screen_rect;
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
|
|||||||
min[0] = min[1] = 20000.0f;
|
min[0] = min[1] = 20000.0f;
|
||||||
max[0] = max[1] = 0.0f;
|
max[0] = max[1] = 0.0f;
|
||||||
|
|
||||||
for (sv = sc->vertbase.first; sv; sv = sv->next) {
|
for (sv = screen->vertbase.first; sv; sv = sv->next) {
|
||||||
const float fv[2] = {(float)sv->vec.x, (float)sv->vec.y};
|
const float fv[2] = {(float)sv->vec.x, (float)sv->vec.y};
|
||||||
minmax_v2v2_v2(min, max, fv);
|
minmax_v2v2_v2(min, max, fv);
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
|
|||||||
const float facy = ((float)screen_size_y - 1) / ((float)screen_size_y_prev - 1);
|
const float facy = ((float)screen_size_y - 1) / ((float)screen_size_y_prev - 1);
|
||||||
|
|
||||||
/* make sure it fits! */
|
/* make sure it fits! */
|
||||||
for (sv = sc->vertbase.first; sv; sv = sv->next) {
|
for (sv = screen->vertbase.first; sv; sv = sv->next) {
|
||||||
sv->vec.x = screen_rect.xmin + round_fl_to_short((sv->vec.x - min[0]) * facx);
|
sv->vec.x = screen_rect.xmin + round_fl_to_short((sv->vec.x - min[0]) * facx);
|
||||||
CLAMP(sv->vec.x, screen_rect.xmin, screen_rect.xmax - 1);
|
CLAMP(sv->vec.x, screen_rect.xmin, screen_rect.xmax - 1);
|
||||||
|
|
||||||
@@ -198,17 +198,17 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
|
|||||||
|
|
||||||
if (facy > 1) {
|
if (facy > 1) {
|
||||||
/* Keep timeline small in video edit workspace. */
|
/* Keep timeline small in video edit workspace. */
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->spacetype == SPACE_ACTION && area->v1->vec.y == screen_rect.ymin &&
|
if (area->spacetype == SPACE_ACTION && area->v1->vec.y == screen_rect.ymin &&
|
||||||
screen_geom_area_height(area) <= headery * facy + 1) {
|
screen_geom_area_height(area) <= headery * facy + 1) {
|
||||||
ScrEdge *se = BKE_screen_find_edge(sc, area->v2, area->v3);
|
ScrEdge *se = BKE_screen_find_edge(screen, area->v2, area->v3);
|
||||||
if (se) {
|
if (se) {
|
||||||
const int yval = area->v1->vec.y + headery - 1;
|
const int yval = area->v1->vec.y + headery - 1;
|
||||||
|
|
||||||
screen_geom_select_connected_edge(win, se);
|
screen_geom_select_connected_edge(win, se);
|
||||||
|
|
||||||
/* all selected vertices get the right offset */
|
/* all selected vertices get the right offset */
|
||||||
for (sv = sc->vertbase.first; sv; sv = sv->next) {
|
for (sv = screen->vertbase.first; sv; sv = sv->next) {
|
||||||
/* if is a collapsed area */
|
/* if is a collapsed area */
|
||||||
if (sv != area->v1 && sv != area->v4) {
|
if (sv != area->v1 && sv != area->v4) {
|
||||||
if (sv->flag) {
|
if (sv->flag) {
|
||||||
@@ -222,17 +222,17 @@ void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc)
|
|||||||
}
|
}
|
||||||
if (facy < 1) {
|
if (facy < 1) {
|
||||||
/* make each window at least ED_area_headersize() high */
|
/* make each window at least ED_area_headersize() high */
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
if (screen_geom_area_height(area) < headery) {
|
if (screen_geom_area_height(area) < headery) {
|
||||||
/* lower edge */
|
/* lower edge */
|
||||||
ScrEdge *se = BKE_screen_find_edge(sc, area->v4, area->v1);
|
ScrEdge *se = BKE_screen_find_edge(screen, area->v4, area->v1);
|
||||||
if (se && area->v1 != area->v2) {
|
if (se && area->v1 != area->v2) {
|
||||||
const int yval = area->v2->vec.y - headery + 1;
|
const int yval = area->v2->vec.y - headery + 1;
|
||||||
|
|
||||||
screen_geom_select_connected_edge(win, se);
|
screen_geom_select_connected_edge(win, se);
|
||||||
|
|
||||||
/* all selected vertices get the right offset */
|
/* all selected vertices get the right offset */
|
||||||
for (sv = sc->vertbase.first; sv; sv = sv->next) {
|
for (sv = screen->vertbase.first; sv; sv = sv->next) {
|
||||||
/* if is not a collapsed area */
|
/* if is not a collapsed area */
|
||||||
if (sv != area->v2 && sv != area->v3) {
|
if (sv != area->v2 && sv != area->v3) {
|
||||||
if (sv->flag) {
|
if (sv->flag) {
|
||||||
@@ -355,7 +355,7 @@ short screen_geom_find_area_split_point(const ScrArea *area,
|
|||||||
*/
|
*/
|
||||||
void screen_geom_select_connected_edge(const wmWindow *win, ScrEdge *edge)
|
void screen_geom_select_connected_edge(const wmWindow *win, ScrEdge *edge)
|
||||||
{
|
{
|
||||||
bScreen *sc = WM_window_get_active_screen(win);
|
bScreen *screen = WM_window_get_active_screen(win);
|
||||||
bool oneselected = true;
|
bool oneselected = true;
|
||||||
char dir;
|
char dir;
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ void screen_geom_select_connected_edge(const wmWindow *win, ScrEdge *edge)
|
|||||||
dir = 'h';
|
dir = 'h';
|
||||||
}
|
}
|
||||||
|
|
||||||
ED_screen_verts_iter(win, sc, sv)
|
ED_screen_verts_iter(win, screen, sv)
|
||||||
{
|
{
|
||||||
sv->flag = 0;
|
sv->flag = 0;
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,7 @@ void screen_geom_select_connected_edge(const wmWindow *win, ScrEdge *edge)
|
|||||||
|
|
||||||
while (oneselected) {
|
while (oneselected) {
|
||||||
oneselected = false;
|
oneselected = false;
|
||||||
for (ScrEdge *se = sc->edgebase.first; se; se = se->next) {
|
for (ScrEdge *se = screen->edgebase.first; se; se = se->next) {
|
||||||
if (se->v1->flag + se->v2->flag == 1) {
|
if (se->v1->flag + se->v2->flag == 1) {
|
||||||
if (dir == 'h') {
|
if (dir == 'h') {
|
||||||
if (se->v1->vec.y == se->v2->vec.y) {
|
if (se->v1->vec.y == se->v2->vec.y) {
|
||||||
|
|||||||
@@ -44,15 +44,15 @@ void region_toggle_hidden(struct bContext *C, ARegion *region, const bool do_fad
|
|||||||
bScreen *screen_add(struct Main *bmain, const char *name, const rcti *rect);
|
bScreen *screen_add(struct Main *bmain, const char *name, const rcti *rect);
|
||||||
void screen_data_copy(bScreen *to, bScreen *from);
|
void screen_data_copy(bScreen *to, bScreen *from);
|
||||||
void screen_new_activate_prepare(const wmWindow *win, bScreen *screen_new);
|
void screen_new_activate_prepare(const wmWindow *win, bScreen *screen_new);
|
||||||
void screen_change_update(struct bContext *C, wmWindow *win, bScreen *sc);
|
void screen_change_update(struct bContext *C, wmWindow *win, bScreen *screen);
|
||||||
bScreen *screen_change_prepare(bScreen *screen_old,
|
bScreen *screen_change_prepare(bScreen *screen_old,
|
||||||
bScreen *screen_new,
|
bScreen *screen_new,
|
||||||
struct Main *bmain,
|
struct Main *bmain,
|
||||||
struct bContext *C,
|
struct bContext *C,
|
||||||
wmWindow *win);
|
wmWindow *win);
|
||||||
ScrArea *area_split(
|
ScrArea *area_split(
|
||||||
const wmWindow *win, bScreen *sc, ScrArea *area, char dir, float fac, int merge);
|
const wmWindow *win, bScreen *screen, ScrArea *area, char dir, float fac, int merge);
|
||||||
int screen_area_join(struct bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2);
|
int screen_area_join(struct bContext *C, bScreen *screen, ScrArea *sa1, ScrArea *sa2);
|
||||||
int area_getorientation(ScrArea *area, ScrArea *sb);
|
int area_getorientation(ScrArea *area, ScrArea *sb);
|
||||||
|
|
||||||
struct AZone *ED_area_actionzone_find_xy(ScrArea *area, const int xy[2]);
|
struct AZone *ED_area_actionzone_find_xy(ScrArea *area, const int xy[2]);
|
||||||
@@ -61,9 +61,9 @@ struct AZone *ED_area_actionzone_find_xy(ScrArea *area, const int xy[2]);
|
|||||||
int screen_geom_area_height(const ScrArea *area);
|
int screen_geom_area_height(const ScrArea *area);
|
||||||
int screen_geom_area_width(const ScrArea *area);
|
int screen_geom_area_width(const ScrArea *area);
|
||||||
ScrVert *screen_geom_vertex_add_ex(ScrAreaMap *area_map, short x, short y);
|
ScrVert *screen_geom_vertex_add_ex(ScrAreaMap *area_map, short x, short y);
|
||||||
ScrVert *screen_geom_vertex_add(bScreen *sc, short x, short y);
|
ScrVert *screen_geom_vertex_add(bScreen *screen, short x, short y);
|
||||||
ScrEdge *screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2);
|
ScrEdge *screen_geom_edge_add_ex(ScrAreaMap *area_map, ScrVert *v1, ScrVert *v2);
|
||||||
ScrEdge *screen_geom_edge_add(bScreen *sc, ScrVert *v1, ScrVert *v2);
|
ScrEdge *screen_geom_edge_add(bScreen *screen, ScrVert *v1, ScrVert *v2);
|
||||||
bool screen_geom_edge_is_horizontal(ScrEdge *se);
|
bool screen_geom_edge_is_horizontal(ScrEdge *se);
|
||||||
ScrEdge *screen_geom_area_map_find_active_scredge(const struct ScrAreaMap *area_map,
|
ScrEdge *screen_geom_area_map_find_active_scredge(const struct ScrAreaMap *area_map,
|
||||||
const rcti *bounds_rect,
|
const rcti *bounds_rect,
|
||||||
@@ -73,7 +73,7 @@ ScrEdge *screen_geom_find_active_scredge(const wmWindow *win,
|
|||||||
const bScreen *screen,
|
const bScreen *screen,
|
||||||
const int mx,
|
const int mx,
|
||||||
const int my);
|
const int my);
|
||||||
void screen_geom_vertices_scale(const wmWindow *win, bScreen *sc);
|
void screen_geom_vertices_scale(const wmWindow *win, bScreen *screen);
|
||||||
short screen_geom_find_area_split_point(const ScrArea *area,
|
short screen_geom_find_area_split_point(const ScrArea *area,
|
||||||
const rcti *window_rect,
|
const rcti *window_rect,
|
||||||
char dir,
|
char dir,
|
||||||
|
|||||||
@@ -594,8 +594,8 @@ bool ED_operator_mask(bContext *C)
|
|||||||
if (area && area->spacedata.first) {
|
if (area && area->spacedata.first) {
|
||||||
switch (area->spacetype) {
|
switch (area->spacetype) {
|
||||||
case SPACE_CLIP: {
|
case SPACE_CLIP: {
|
||||||
SpaceClip *sc = area->spacedata.first;
|
SpaceClip *screen = area->spacedata.first;
|
||||||
return ED_space_clip_check_show_maskedit(sc);
|
return ED_space_clip_check_show_maskedit(screen);
|
||||||
}
|
}
|
||||||
case SPACE_SEQ: {
|
case SPACE_SEQ: {
|
||||||
SpaceSeq *sseq = area->spacedata.first;
|
SpaceSeq *sseq = area->spacedata.first;
|
||||||
@@ -893,9 +893,9 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Finds an action-zone by position in entire screen so azones can overlap. */
|
/* Finds an action-zone by position in entire screen so azones can overlap. */
|
||||||
static AZone *screen_actionzone_find_xy(bScreen *sc, const int xy[2])
|
static AZone *screen_actionzone_find_xy(bScreen *screen, const int xy[2])
|
||||||
{
|
{
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
AZone *az = area_actionzone_refresh_xy(area, xy, true);
|
AZone *az = area_actionzone_refresh_xy(area, xy, true);
|
||||||
if (az != NULL) {
|
if (az != NULL) {
|
||||||
return az;
|
return az;
|
||||||
@@ -905,9 +905,9 @@ static AZone *screen_actionzone_find_xy(bScreen *sc, const int xy[2])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the area that the azone belongs to */
|
/* Returns the area that the azone belongs to */
|
||||||
static ScrArea *screen_actionzone_area(bScreen *sc, const AZone *az)
|
static ScrArea *screen_actionzone_area(bScreen *screen, const AZone *az)
|
||||||
{
|
{
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (AZone *zone = area->actionzones.first; zone; zone = zone->next) {
|
for (AZone *zone = area->actionzones.first; zone; zone = zone->next) {
|
||||||
if (zone == az) {
|
if (zone == az) {
|
||||||
return area;
|
return area;
|
||||||
@@ -968,8 +968,8 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type)
|
|||||||
|
|
||||||
static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
AZone *az = screen_actionzone_find_xy(sc, &event->x);
|
AZone *az = screen_actionzone_find_xy(screen, &event->x);
|
||||||
sActionzoneData *sad;
|
sActionzoneData *sad;
|
||||||
|
|
||||||
/* Quick escape - Scroll azones only hide/unhide the scroll-bars,
|
/* Quick escape - Scroll azones only hide/unhide the scroll-bars,
|
||||||
@@ -980,7 +980,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
|
|
||||||
/* ok we do the action-zone */
|
/* ok we do the action-zone */
|
||||||
sad = op->customdata = MEM_callocN(sizeof(sActionzoneData), "sActionzoneData");
|
sad = op->customdata = MEM_callocN(sizeof(sActionzoneData), "sActionzoneData");
|
||||||
sad->sa1 = screen_actionzone_area(sc, az);
|
sad->sa1 = screen_actionzone_area(screen, az);
|
||||||
sad->az = az;
|
sad->az = az;
|
||||||
sad->x = event->x;
|
sad->x = event->x;
|
||||||
sad->y = event->y;
|
sad->y = event->y;
|
||||||
@@ -1003,7 +1003,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
|
|
||||||
static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
sActionzoneData *sad = op->customdata;
|
sActionzoneData *sad = op->customdata;
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
@@ -1044,9 +1044,9 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
/* Have we dragged off the zone and are not on an edge? */
|
/* Have we dragged off the zone and are not on an edge? */
|
||||||
if ((ED_area_actionzone_find_xy(sad->sa1, &event->x) != sad->az) &&
|
if ((ED_area_actionzone_find_xy(sad->sa1, &event->x) != sad->az) &&
|
||||||
(screen_geom_area_map_find_active_scredge(
|
(screen_geom_area_map_find_active_scredge(
|
||||||
AREAMAP_FROM_SCREEN(sc), &screen_rect, event->x, event->y) == NULL)) {
|
AREAMAP_FROM_SCREEN(screen), &screen_rect, event->x, event->y) == NULL)) {
|
||||||
/* Are we still in same area? */
|
/* Are we still in same area? */
|
||||||
if (BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y) == sad->sa1) {
|
if (BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y) == sad->sa1) {
|
||||||
/* Same area, so possible split. */
|
/* Same area, so possible split. */
|
||||||
WM_cursor_set(
|
WM_cursor_set(
|
||||||
win, (ELEM(sad->gesture_dir, 'n', 's')) ? WM_CURSOR_H_SPLIT : WM_CURSOR_V_SPLIT);
|
win, (ELEM(sad->gesture_dir, 'n', 's')) ? WM_CURSOR_H_SPLIT : WM_CURSOR_V_SPLIT);
|
||||||
@@ -1081,7 +1081,7 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
/* gesture is large enough? */
|
/* gesture is large enough? */
|
||||||
if (is_gesture) {
|
if (is_gesture) {
|
||||||
/* second area, for join when (sa1 != sa2) */
|
/* second area, for join when (sa1 != sa2) */
|
||||||
sad->sa2 = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y);
|
sad->sa2 = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y);
|
||||||
/* apply sends event */
|
/* apply sends event */
|
||||||
actionzone_apply(C, op, sad->az->type);
|
actionzone_apply(C, op, sad->az->type);
|
||||||
actionzone_exit(op);
|
actionzone_exit(op);
|
||||||
@@ -1136,12 +1136,12 @@ static ScrEdge *screen_area_edge_from_cursor(const bContext *C,
|
|||||||
ScrArea **r_sa2)
|
ScrArea **r_sa2)
|
||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrEdge *actedge;
|
ScrEdge *actedge;
|
||||||
rcti window_rect;
|
rcti window_rect;
|
||||||
WM_window_rect_calc(win, &window_rect);
|
WM_window_rect_calc(win, &window_rect);
|
||||||
actedge = screen_geom_area_map_find_active_scredge(
|
actedge = screen_geom_area_map_find_active_scredge(
|
||||||
AREAMAP_FROM_SCREEN(sc), &window_rect, cursor[0], cursor[1]);
|
AREAMAP_FROM_SCREEN(screen), &window_rect, cursor[0], cursor[1]);
|
||||||
*r_sa1 = NULL;
|
*r_sa1 = NULL;
|
||||||
*r_sa2 = NULL;
|
*r_sa2 = NULL;
|
||||||
if (actedge == NULL) {
|
if (actedge == NULL) {
|
||||||
@@ -1150,12 +1150,12 @@ static ScrEdge *screen_area_edge_from_cursor(const bContext *C,
|
|||||||
int borderwidth = (4 * UI_DPI_FAC);
|
int borderwidth = (4 * UI_DPI_FAC);
|
||||||
ScrArea *sa1, *sa2;
|
ScrArea *sa1, *sa2;
|
||||||
if (screen_geom_edge_is_horizontal(actedge)) {
|
if (screen_geom_edge_is_horizontal(actedge)) {
|
||||||
sa1 = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, cursor[0], cursor[1] + borderwidth);
|
sa1 = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, cursor[0], cursor[1] + borderwidth);
|
||||||
sa2 = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, cursor[0], cursor[1] - borderwidth);
|
sa2 = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, cursor[0], cursor[1] - borderwidth);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sa1 = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, cursor[0] + borderwidth, cursor[1]);
|
sa1 = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, cursor[0] + borderwidth, cursor[1]);
|
||||||
sa2 = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, cursor[0] - borderwidth, cursor[1]);
|
sa2 = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, cursor[0] - borderwidth, cursor[1]);
|
||||||
}
|
}
|
||||||
bool isGlobal = ((sa1 && ED_area_is_global(sa1)) || (sa2 && ED_area_is_global(sa2)));
|
bool isGlobal = ((sa1 && ED_area_is_global(sa1)) || (sa2 && ED_area_is_global(sa2)));
|
||||||
if (!isGlobal) {
|
if (!isGlobal) {
|
||||||
@@ -1454,8 +1454,12 @@ typedef struct sAreaMoveData {
|
|||||||
|
|
||||||
/* helper call to move area-edge, sets limits
|
/* helper call to move area-edge, sets limits
|
||||||
* need window bounds in order to get correct limits */
|
* need window bounds in order to get correct limits */
|
||||||
static void area_move_set_limits(
|
static void area_move_set_limits(wmWindow *win,
|
||||||
wmWindow *win, bScreen *sc, int dir, int *bigger, int *smaller, bool *use_bigger_smaller_snap)
|
bScreen *screen,
|
||||||
|
int dir,
|
||||||
|
int *bigger,
|
||||||
|
int *smaller,
|
||||||
|
bool *use_bigger_smaller_snap)
|
||||||
{
|
{
|
||||||
rcti window_rect;
|
rcti window_rect;
|
||||||
int areaminy = ED_area_headersize();
|
int areaminy = ED_area_headersize();
|
||||||
@@ -1507,7 +1511,7 @@ static void area_move_set_limits(
|
|||||||
|
|
||||||
WM_window_rect_calc(win, &window_rect);
|
WM_window_rect_calc(win, &window_rect);
|
||||||
|
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
if (dir == 'h') {
|
if (dir == 'h') {
|
||||||
int y1;
|
int y1;
|
||||||
areamin = areaminy;
|
areamin = areaminy;
|
||||||
@@ -1557,7 +1561,7 @@ static void area_move_set_limits(
|
|||||||
/* return 0: init failed */
|
/* return 0: init failed */
|
||||||
static int area_move_init(bContext *C, wmOperator *op)
|
static int area_move_init(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
ScrEdge *actedge;
|
ScrEdge *actedge;
|
||||||
sAreaMoveData *md;
|
sAreaMoveData *md;
|
||||||
@@ -1568,7 +1572,7 @@ static int area_move_init(bContext *C, wmOperator *op)
|
|||||||
y = RNA_int_get(op->ptr, "y");
|
y = RNA_int_get(op->ptr, "y");
|
||||||
|
|
||||||
/* setup */
|
/* setup */
|
||||||
actedge = screen_geom_find_active_scredge(win, sc, x, y);
|
actedge = screen_geom_find_active_scredge(win, screen, x, y);
|
||||||
if (actedge == NULL) {
|
if (actedge == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1586,20 +1590,20 @@ static int area_move_init(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
screen_geom_select_connected_edge(win, actedge);
|
screen_geom_select_connected_edge(win, actedge);
|
||||||
/* now all vertices with 'flag == 1' are the ones that can be moved. Move this to editflag */
|
/* now all vertices with 'flag == 1' are the ones that can be moved. Move this to editflag */
|
||||||
ED_screen_verts_iter(win, sc, v1)
|
ED_screen_verts_iter(win, screen, v1)
|
||||||
{
|
{
|
||||||
v1->editflag = v1->flag;
|
v1->editflag = v1->flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool use_bigger_smaller_snap = false;
|
bool use_bigger_smaller_snap = false;
|
||||||
area_move_set_limits(win, sc, md->dir, &md->bigger, &md->smaller, &use_bigger_smaller_snap);
|
area_move_set_limits(win, screen, md->dir, &md->bigger, &md->smaller, &use_bigger_smaller_snap);
|
||||||
|
|
||||||
md->snap_type = use_bigger_smaller_snap ? SNAP_BIGGER_SMALLER_ONLY : SNAP_AREAGRID;
|
md->snap_type = use_bigger_smaller_snap ? SNAP_BIGGER_SMALLER_ONLY : SNAP_AREAGRID;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int area_snap_calc_location(const bScreen *sc,
|
static int area_snap_calc_location(const bScreen *screen,
|
||||||
const enum AreaMoveSnapType snap_type,
|
const enum AreaMoveSnapType snap_type,
|
||||||
const int delta,
|
const int delta,
|
||||||
const int origval,
|
const int origval,
|
||||||
@@ -1657,13 +1661,13 @@ static int area_snap_calc_location(const bScreen *sc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const ScrVert *v1 = sc->vertbase.first; v1; v1 = v1->next) {
|
for (const ScrVert *v1 = screen->vertbase.first; v1; v1 = v1->next) {
|
||||||
if (!v1->editflag) {
|
if (!v1->editflag) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const int v_loc = (&v1->vec.x)[!axis];
|
const int v_loc = (&v1->vec.x)[!axis];
|
||||||
|
|
||||||
for (const ScrVert *v2 = sc->vertbase.first; v2; v2 = v2->next) {
|
for (const ScrVert *v2 = screen->vertbase.first; v2; v2 = v2->next) {
|
||||||
if (v2->editflag) {
|
if (v2->editflag) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1702,7 +1706,7 @@ static void area_move_apply_do(const bContext *C,
|
|||||||
const enum AreaMoveSnapType snap_type)
|
const enum AreaMoveSnapType snap_type)
|
||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
short final_loc = -1;
|
short final_loc = -1;
|
||||||
bool doredraw = false;
|
bool doredraw = false;
|
||||||
|
|
||||||
@@ -1714,13 +1718,13 @@ static void area_move_apply_do(const bContext *C,
|
|||||||
final_loc = origval + delta;
|
final_loc = origval + delta;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final_loc = area_snap_calc_location(sc, snap_type, delta, origval, dir, bigger, smaller);
|
final_loc = area_snap_calc_location(screen, snap_type, delta, origval, dir, bigger, smaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_assert(final_loc != -1);
|
BLI_assert(final_loc != -1);
|
||||||
short axis = (dir == 'v') ? 0 : 1;
|
short axis = (dir == 'v') ? 0 : 1;
|
||||||
|
|
||||||
ED_screen_verts_iter(win, sc, v1)
|
ED_screen_verts_iter(win, screen, v1)
|
||||||
{
|
{
|
||||||
if (v1->editflag) {
|
if (v1->editflag) {
|
||||||
short oldval = (&v1->vec.x)[axis];
|
short oldval = (&v1->vec.x)[axis];
|
||||||
@@ -1737,7 +1741,7 @@ static void area_move_apply_do(const bContext *C,
|
|||||||
/* only redraw if we actually moved a screen vert, for AREAGRID */
|
/* only redraw if we actually moved a screen vert, for AREAGRID */
|
||||||
if (doredraw) {
|
if (doredraw) {
|
||||||
bool redraw_all = false;
|
bool redraw_all = false;
|
||||||
ED_screen_areas_iter(win, sc, area)
|
ED_screen_areas_iter(win, screen, area)
|
||||||
{
|
{
|
||||||
if (area->v1->editflag || area->v2->editflag || area->v3->editflag || area->v4->editflag) {
|
if (area->v1->editflag || area->v2->editflag || area->v3->editflag || area->v4->editflag) {
|
||||||
if (ED_area_is_global(area)) {
|
if (ED_area_is_global(area)) {
|
||||||
@@ -1750,14 +1754,14 @@ static void area_move_apply_do(const bContext *C,
|
|||||||
area->global->cur_fixed_height = area->global->size_max;
|
area->global->cur_fixed_height = area->global->size_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->do_refresh = true;
|
screen->do_refresh = true;
|
||||||
redraw_all = true;
|
redraw_all = true;
|
||||||
}
|
}
|
||||||
ED_area_tag_redraw(area);
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (redraw_all) {
|
if (redraw_all) {
|
||||||
ED_screen_areas_iter(win, sc, area)
|
ED_screen_areas_iter(win, screen, area)
|
||||||
{
|
{
|
||||||
ED_area_tag_redraw(area);
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
@@ -1767,7 +1771,7 @@ static void area_move_apply_do(const bContext *C,
|
|||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); /* redraw everything */
|
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL); /* redraw everything */
|
||||||
/* Update preview thumbnail */
|
/* Update preview thumbnail */
|
||||||
BKE_icon_changed(sc->id.icon_id);
|
BKE_icon_changed(screen->id.icon_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2055,7 +2059,7 @@ static ScrEdge *area_findsharededge(bScreen *screen, ScrArea *area, ScrArea *sb)
|
|||||||
static int area_split_apply(bContext *C, wmOperator *op)
|
static int area_split_apply(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
const wmWindow *win = CTX_wm_window(C);
|
const wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
sAreaSplitData *sd = (sAreaSplitData *)op->customdata;
|
sAreaSplitData *sd = (sAreaSplitData *)op->customdata;
|
||||||
float fac;
|
float fac;
|
||||||
int dir;
|
int dir;
|
||||||
@@ -2063,13 +2067,13 @@ static int area_split_apply(bContext *C, wmOperator *op)
|
|||||||
fac = RNA_float_get(op->ptr, "factor");
|
fac = RNA_float_get(op->ptr, "factor");
|
||||||
dir = RNA_enum_get(op->ptr, "direction");
|
dir = RNA_enum_get(op->ptr, "direction");
|
||||||
|
|
||||||
sd->narea = area_split(win, sc, sd->sarea, dir, fac, 0); /* 0 = no merge */
|
sd->narea = area_split(win, screen, sd->sarea, dir, fac, 0); /* 0 = no merge */
|
||||||
|
|
||||||
if (sd->narea) {
|
if (sd->narea) {
|
||||||
sd->nedge = area_findsharededge(sc, sd->sarea, sd->narea);
|
sd->nedge = area_findsharededge(screen, sd->sarea, sd->narea);
|
||||||
|
|
||||||
/* select newly created edge, prepare for moving edge */
|
/* select newly created edge, prepare for moving edge */
|
||||||
ED_screen_verts_iter(win, sc, sv)
|
ED_screen_verts_iter(win, screen, sv)
|
||||||
{
|
{
|
||||||
sv->editflag = 0;
|
sv->editflag = 0;
|
||||||
}
|
}
|
||||||
@@ -2089,7 +2093,7 @@ static int area_split_apply(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
|
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
|
||||||
/* Update preview thumbnail */
|
/* Update preview thumbnail */
|
||||||
BKE_icon_changed(sc->id.icon_id);
|
BKE_icon_changed(screen->id.icon_id);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -2137,12 +2141,12 @@ static void area_split_preview_update_cursor(bContext *C, wmOperator *op)
|
|||||||
static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
{
|
{
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
sAreaSplitData *sd;
|
sAreaSplitData *sd;
|
||||||
int dir;
|
int dir;
|
||||||
|
|
||||||
/* no full window splitting allowed */
|
/* no full window splitting allowed */
|
||||||
BLI_assert(sc->state == SCREENNORMAL);
|
BLI_assert(screen->state == SCREENNORMAL);
|
||||||
|
|
||||||
PropertyRNA *prop_dir = RNA_struct_find_property(op->ptr, "direction");
|
PropertyRNA *prop_dir = RNA_struct_find_property(op->ptr, "direction");
|
||||||
PropertyRNA *prop_factor = RNA_struct_find_property(op->ptr, "factor");
|
PropertyRNA *prop_factor = RNA_struct_find_property(op->ptr, "factor");
|
||||||
@@ -2232,7 +2236,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
WM_window_rect_calc(win, &window_rect);
|
WM_window_rect_calc(win, &window_rect);
|
||||||
|
|
||||||
actedge = screen_geom_area_map_find_active_scredge(
|
actedge = screen_geom_area_map_find_active_scredge(
|
||||||
AREAMAP_FROM_SCREEN(sc), &window_rect, event_co[0], event_co[1]);
|
AREAMAP_FROM_SCREEN(screen), &window_rect, event_co[0], event_co[1]);
|
||||||
if (actedge == NULL) {
|
if (actedge == NULL) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
@@ -2253,7 +2257,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
|
|
||||||
/* do the split */
|
/* do the split */
|
||||||
if (area_split_apply(C, op)) {
|
if (area_split_apply(C, op)) {
|
||||||
area_move_set_limits(win, sc, dir, &sd->bigger, &sd->smaller, NULL);
|
area_move_set_limits(win, screen, dir, &sd->bigger, &sd->smaller, NULL);
|
||||||
|
|
||||||
/* add temp handler for edge move or cancel */
|
/* add temp handler for edge move or cancel */
|
||||||
G.moving |= G_TRANSFORM_WM;
|
G.moving |= G_TRANSFORM_WM;
|
||||||
@@ -2794,7 +2798,7 @@ static void SCREEN_OT_region_scale(wmOperatorType *ot)
|
|||||||
|
|
||||||
static void areas_do_frame_follow(bContext *C, bool middle)
|
static void areas_do_frame_follow(bContext *C, bool middle)
|
||||||
{
|
{
|
||||||
bScreen *scr = CTX_wm_screen(C);
|
bScreen *screen_ctx = CTX_wm_screen(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
for (wmWindow *window = wm->windows.first; window; window = window->next) {
|
for (wmWindow *window = wm->windows.first; window; window = window->next) {
|
||||||
@@ -2803,7 +2807,7 @@ static void areas_do_frame_follow(bContext *C, bool middle)
|
|||||||
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (ARegion *region = area->regionbase.first; region; region = region->next) {
|
for (ARegion *region = area->regionbase.first; region; region = region->next) {
|
||||||
/* do follow here if editor type supports it */
|
/* do follow here if editor type supports it */
|
||||||
if ((scr->redraws_flag & TIME_FOLLOW)) {
|
if ((screen_ctx->redraws_flag & TIME_FOLLOW)) {
|
||||||
if ((region->regiontype == RGN_TYPE_WINDOW &&
|
if ((region->regiontype == RGN_TYPE_WINDOW &&
|
||||||
ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) ||
|
ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) ||
|
||||||
(area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) {
|
(area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) {
|
||||||
@@ -3381,7 +3385,7 @@ static void area_join_cancel(bContext *C, wmOperator *op)
|
|||||||
/* modal callback while selecting area (space) that will be removed */
|
/* modal callback while selecting area (space) that will be removed */
|
||||||
static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
wmWindow *win = CTX_wm_window(C);
|
wmWindow *win = CTX_wm_window(C);
|
||||||
sAreaJoinData *jd;
|
sAreaJoinData *jd;
|
||||||
|
|
||||||
@@ -3396,7 +3400,7 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
|
|
||||||
case MOUSEMOVE: {
|
case MOUSEMOVE: {
|
||||||
ScrArea *area = BKE_screen_find_area_xy(sc, SPACE_TYPE_ANY, event->x, event->y);
|
ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y);
|
||||||
int dir = -1;
|
int dir = -1;
|
||||||
|
|
||||||
if (area) {
|
if (area) {
|
||||||
@@ -5037,9 +5041,9 @@ static void SCREEN_OT_new(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int screen_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
static int screen_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
WorkSpace *workspace = CTX_wm_workspace(C);
|
WorkSpace *workspace = CTX_wm_workspace(C);
|
||||||
WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, sc);
|
WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, screen);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTDELETE, layout);
|
WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTDELETE, layout);
|
||||||
|
|
||||||
|
|||||||
@@ -1159,7 +1159,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
|
|||||||
toggle_paint_cursor(C, 0);
|
toggle_paint_cursor(C, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Image *ima = NULL;
|
Image *ima = NULL;
|
||||||
ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
|
ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
|
||||||
|
|
||||||
@@ -1183,9 +1183,9 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ima) {
|
if (ima) {
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_IMAGE) {
|
if (sl->spacetype == SPACE_IMAGE) {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ static bool graph_panel_poll(const bContext *C, PanelType *UNUSED(pt))
|
|||||||
|
|
||||||
static void graph_panel_cursor_header(const bContext *C, Panel *pa)
|
static void graph_panel_cursor_header(const bContext *C, Panel *pa)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
PointerRNA spaceptr, sceneptr;
|
PointerRNA spaceptr, sceneptr;
|
||||||
@@ -121,7 +121,7 @@ static void graph_panel_cursor_header(const bContext *C, Panel *pa)
|
|||||||
|
|
||||||
/* get RNA pointers for use when creating the UI elements */
|
/* get RNA pointers for use when creating the UI elements */
|
||||||
RNA_id_pointer_create(&scene->id, &sceneptr);
|
RNA_id_pointer_create(&scene->id, &sceneptr);
|
||||||
RNA_pointer_create(&sc->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
||||||
|
|
||||||
/* 2D-Cursor */
|
/* 2D-Cursor */
|
||||||
col = uiLayoutColumn(pa->layout, false);
|
col = uiLayoutColumn(pa->layout, false);
|
||||||
@@ -130,7 +130,7 @@ static void graph_panel_cursor_header(const bContext *C, Panel *pa)
|
|||||||
|
|
||||||
static void graph_panel_cursor(const bContext *C, Panel *pa)
|
static void graph_panel_cursor(const bContext *C, Panel *pa)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
SpaceGraph *sipo = CTX_wm_space_graph(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
PointerRNA spaceptr, sceneptr;
|
PointerRNA spaceptr, sceneptr;
|
||||||
@@ -139,7 +139,7 @@ static void graph_panel_cursor(const bContext *C, Panel *pa)
|
|||||||
|
|
||||||
/* get RNA pointers for use when creating the UI elements */
|
/* get RNA pointers for use when creating the UI elements */
|
||||||
RNA_id_pointer_create(&scene->id, &sceneptr);
|
RNA_id_pointer_create(&scene->id, &sceneptr);
|
||||||
RNA_pointer_create(&sc->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
RNA_pointer_create(&screen->id, &RNA_SpaceGraphEditor, sipo, &spaceptr);
|
||||||
|
|
||||||
uiLayoutSetPropSep(layout, true);
|
uiLayoutSetPropSep(layout, true);
|
||||||
uiLayoutSetPropDecorate(layout, false);
|
uiLayoutSetPropDecorate(layout, false);
|
||||||
|
|||||||
@@ -127,10 +127,10 @@ static int compo_get_recalc_flags(const bContext *C)
|
|||||||
int recalc_flags = 0;
|
int recalc_flags = 0;
|
||||||
|
|
||||||
for (win = wm->windows.first; win; win = win->next) {
|
for (win = wm->windows.first; win; win = win->next) {
|
||||||
const bScreen *sc = WM_window_get_active_screen(win);
|
const bScreen *screen = WM_window_get_active_screen(win);
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->spacetype == SPACE_IMAGE) {
|
if (area->spacetype == SPACE_IMAGE) {
|
||||||
SpaceImage *sima = area->spacedata.first;
|
SpaceImage *sima = area->spacedata.first;
|
||||||
if (sima->image) {
|
if (sima->image) {
|
||||||
|
|||||||
@@ -2951,7 +2951,7 @@ void SEQUENCER_OT_view_frame(wmOperatorType *ot)
|
|||||||
/* view_all operator */
|
/* view_all operator */
|
||||||
static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
|
static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
#if 0
|
#if 0
|
||||||
ARegion *region = CTX_wm_region(C);
|
ARegion *region = CTX_wm_region(C);
|
||||||
@@ -2962,7 +2962,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
v2d->cur = v2d->tot;
|
v2d->cur = v2d->tot;
|
||||||
UI_view2d_curRect_validate(v2d);
|
UI_view2d_curRect_validate(v2d);
|
||||||
UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
|
UI_view2d_sync(screen, area, v2d, V2D_LOCK_COPY);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Like zooming on an image view */
|
/* Like zooming on an image view */
|
||||||
|
|||||||
@@ -228,13 +228,13 @@ void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist)
|
|||||||
|
|
||||||
bool ED_view3d_context_activate(bContext *C)
|
bool ED_view3d_context_activate(bContext *C)
|
||||||
{
|
{
|
||||||
bScreen *sc = CTX_wm_screen(C);
|
bScreen *screen = CTX_wm_screen(C);
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
/* area can be NULL when called from python */
|
/* area can be NULL when called from python */
|
||||||
if (area == NULL || area->spacetype != SPACE_VIEW3D) {
|
if (area == NULL || area->spacetype != SPACE_VIEW3D) {
|
||||||
area = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0);
|
area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (area == NULL) {
|
if (area == NULL) {
|
||||||
|
|||||||
@@ -1201,14 +1201,14 @@ finally:
|
|||||||
static uint free_localview_bit(Main *bmain)
|
static uint free_localview_bit(Main *bmain)
|
||||||
{
|
{
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
ushort local_view_bits = 0;
|
ushort local_view_bits = 0;
|
||||||
|
|
||||||
/* sometimes we loose a localview: when an area is closed */
|
/* sometimes we loose a localview: when an area is closed */
|
||||||
/* check all areas: which localviews are in use? */
|
/* check all areas: which localviews are in use? */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
for (; sl; sl = sl->next) {
|
for (; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
@@ -1559,13 +1559,13 @@ void VIEW3D_OT_localview_remove_from(wmOperatorType *ot)
|
|||||||
static uint free_localcollection_bit(Main *bmain, ushort local_collections_uuid, bool *r_reset)
|
static uint free_localcollection_bit(Main *bmain, ushort local_collections_uuid, bool *r_reset)
|
||||||
{
|
{
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
ushort local_view_bits = 0;
|
ushort local_view_bits = 0;
|
||||||
|
|
||||||
/* Check all areas: which localviews are in use? */
|
/* Check all areas: which localviews are in use? */
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl = area->spacedata.first;
|
SpaceLink *sl = area->spacedata.first;
|
||||||
for (; sl; sl = sl->next) {
|
for (; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_VIEW3D) {
|
if (sl->spacetype == SPACE_VIEW3D) {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain,
|
|||||||
Scene *UNUSED(scene),
|
Scene *UNUSED(scene),
|
||||||
PointerRNA *ptr)
|
PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Material *ma = (Material *)ptr->owner_id;
|
Material *ma = (Material *)ptr->owner_id;
|
||||||
|
|
||||||
if (ma->use_nodes && ma->nodetree) {
|
if (ma->use_nodes && ma->nodetree) {
|
||||||
@@ -157,8 +157,8 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain,
|
|||||||
|
|
||||||
if (ma->texpaintslot) {
|
if (ma->texpaintslot) {
|
||||||
Image *image = ma->texpaintslot[ma->paint_active_slot].ima;
|
Image *image = ma->texpaintslot[ma->paint_active_slot].ima;
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
wmWindow *win = ED_screen_window_find(sc, bmain->wm.first);
|
wmWindow *win = ED_screen_window_find(screen, bmain->wm.first);
|
||||||
if (win == NULL) {
|
if (win == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
if (sl->spacetype == SPACE_IMAGE) {
|
if (sl->spacetype == SPACE_IMAGE) {
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ static bool rna_Object_indirect_only_get(Object *ob, bContext *C, ViewLayer *vie
|
|||||||
return ((base->flag & BASE_INDIRECT_ONLY) != 0);
|
return ((base->flag & BASE_INDIRECT_ONLY) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Base *rna_Object_local_view_property_helper(bScreen *sc,
|
static Base *rna_Object_local_view_property_helper(bScreen *screen,
|
||||||
View3D *v3d,
|
View3D *v3d,
|
||||||
ViewLayer *view_layer,
|
ViewLayer *view_layer,
|
||||||
Object *ob,
|
Object *ob,
|
||||||
@@ -235,7 +235,7 @@ static Base *rna_Object_local_view_property_helper(bScreen *sc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (view_layer == NULL) {
|
if (view_layer == NULL) {
|
||||||
win = ED_screen_window_find(sc, G_MAIN->wm.first);
|
win = ED_screen_window_find(screen, G_MAIN->wm.first);
|
||||||
view_layer = WM_window_get_active_view_layer(win);
|
view_layer = WM_window_get_active_view_layer(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,10 +265,10 @@ static void rna_Object_local_view_set(Object *ob,
|
|||||||
PointerRNA *v3d_ptr,
|
PointerRNA *v3d_ptr,
|
||||||
bool state)
|
bool state)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)v3d_ptr->owner_id;
|
bScreen *screen = (bScreen *)v3d_ptr->owner_id;
|
||||||
View3D *v3d = v3d_ptr->data;
|
View3D *v3d = v3d_ptr->data;
|
||||||
Scene *scene;
|
Scene *scene;
|
||||||
Base *base = rna_Object_local_view_property_helper(sc, v3d, NULL, ob, reports, &scene);
|
Base *base = rna_Object_local_view_property_helper(screen, v3d, NULL, ob, reports, &scene);
|
||||||
if (base == NULL) {
|
if (base == NULL) {
|
||||||
return; /* Error reported. */
|
return; /* Error reported. */
|
||||||
}
|
}
|
||||||
@@ -276,7 +276,7 @@ static void rna_Object_local_view_set(Object *ob,
|
|||||||
SET_FLAG_FROM_TEST(base->local_view_bits, state, v3d->local_view_uuid);
|
SET_FLAG_FROM_TEST(base->local_view_bits, state, v3d->local_view_uuid);
|
||||||
if (local_view_bits_prev != base->local_view_bits) {
|
if (local_view_bits_prev != base->local_view_bits) {
|
||||||
DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
|
DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
|
||||||
ScrArea *area = ED_screen_area_find_with_spacedata(sc, (SpaceLink *)v3d, true);
|
ScrArea *area = ED_screen_area_find_with_spacedata(screen, (SpaceLink *)v3d, true);
|
||||||
if (area) {
|
if (area) {
|
||||||
ED_area_tag_redraw(area);
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1679,10 +1679,10 @@ void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA
|
|||||||
|
|
||||||
static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Scene *sc = (Scene *)ptr->owner_id;
|
Scene *screen = (Scene *)ptr->owner_id;
|
||||||
|
|
||||||
rna_Scene_glsl_update(bmain, scene, ptr);
|
rna_Scene_glsl_update(bmain, scene, ptr);
|
||||||
WM_main_add_notifier(NC_WORLD | ND_WORLD, &sc->id);
|
WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id);
|
||||||
DEG_relations_tag_update(bmain);
|
DEG_relations_tag_update(bmain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, int frame, float subf
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
if (BKE_scene_camera_switch_update(scene)) {
|
if (BKE_scene_camera_switch_update(scene)) {
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
BKE_screen_view3d_scene_sync(sc, scene);
|
BKE_screen_view3d_scene_sync(screen, scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ static int rna_region_alignment_get(PointerRNA *ptr)
|
|||||||
|
|
||||||
static bool rna_Screen_fullscreen_get(PointerRNA *ptr)
|
static bool rna_Screen_fullscreen_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)ptr->data;
|
bScreen *screen = (bScreen *)ptr->data;
|
||||||
return (sc->state == SCREENMAXIMIZED);
|
return (screen->state == SCREENMAXIMIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UI compatible list: should not be needed, but for now we need to keep EMPTY
|
/* UI compatible list: should not be needed, but for now we need to keep EMPTY
|
||||||
@@ -137,7 +137,7 @@ static void rna_Area_type_set(PointerRNA *ptr, int value)
|
|||||||
|
|
||||||
static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
|
static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
ScrArea *area = (ScrArea *)ptr->data;
|
ScrArea *area = (ScrArea *)ptr->data;
|
||||||
|
|
||||||
/* Running update without having called 'set', see: T64049 */
|
/* Running update without having called 'set', see: T64049 */
|
||||||
@@ -149,7 +149,7 @@ static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
|
|||||||
wmWindow *win;
|
wmWindow *win;
|
||||||
/* XXX this call still use context, so we trick it to work in the right context */
|
/* XXX this call still use context, so we trick it to work in the right context */
|
||||||
for (win = wm->windows.first; win; win = win->next) {
|
for (win = wm->windows.first; win; win = win->next) {
|
||||||
if (sc == WM_window_get_active_screen(win)) {
|
if (screen == WM_window_get_active_screen(win)) {
|
||||||
wmWindow *prevwin = CTX_wm_window(C);
|
wmWindow *prevwin = CTX_wm_window(C);
|
||||||
ScrArea *prevsa = CTX_wm_area(C);
|
ScrArea *prevsa = CTX_wm_area(C);
|
||||||
ARegion *prevar = CTX_wm_region(C);
|
ARegion *prevar = CTX_wm_region(C);
|
||||||
|
|||||||
@@ -507,12 +507,12 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr))
|
|||||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
Object *ob = OBACT(view_layer);
|
Object *ob = OBACT(view_layer);
|
||||||
Object *obedit = OBEDIT_FROM_OBACT(ob);
|
Object *obedit = OBEDIT_FROM_OBACT(ob);
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
Image *ima = scene->toolsettings->imapaint.canvas;
|
Image *ima = scene->toolsettings->imapaint.canvas;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *slink;
|
SpaceLink *slink;
|
||||||
for (slink = area->spacedata.first; slink; slink = slink->next) {
|
for (slink = area->spacedata.first; slink; slink = slink->next) {
|
||||||
if (slink->spacetype == SPACE_IMAGE) {
|
if (slink->spacetype == SPACE_IMAGE) {
|
||||||
|
|||||||
@@ -568,12 +568,12 @@ static StructRNA *rna_Space_refine(struct PointerRNA *ptr)
|
|||||||
|
|
||||||
static ScrArea *rna_area_from_space(PointerRNA *ptr)
|
static ScrArea *rna_area_from_space(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
SpaceLink *link = (SpaceLink *)ptr->data;
|
SpaceLink *link = (SpaceLink *)ptr->data;
|
||||||
return BKE_screen_find_area_from_space(sc, link);
|
return BKE_screen_find_area_from_space(screen, link);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void area_region_from_regiondata(bScreen *sc,
|
static void area_region_from_regiondata(bScreen *screen,
|
||||||
void *regiondata,
|
void *regiondata,
|
||||||
ScrArea **r_area,
|
ScrArea **r_area,
|
||||||
ARegion **r_region)
|
ARegion **r_region)
|
||||||
@@ -584,7 +584,7 @@ static void area_region_from_regiondata(bScreen *sc,
|
|||||||
*r_area = NULL;
|
*r_area = NULL;
|
||||||
*r_region = NULL;
|
*r_region = NULL;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
for (region = area->regionbase.first; region; region = region->next) {
|
for (region = area->regionbase.first; region; region = region->next) {
|
||||||
if (region->regiondata == regiondata) {
|
if (region->regiondata == regiondata) {
|
||||||
*r_area = area;
|
*r_area = area;
|
||||||
@@ -597,10 +597,10 @@ static void area_region_from_regiondata(bScreen *sc,
|
|||||||
|
|
||||||
static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
|
static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
void *regiondata = ptr->data;
|
void *regiondata = ptr->data;
|
||||||
|
|
||||||
area_region_from_regiondata(sc, regiondata, r_area, r_region);
|
area_region_from_regiondata(screen, regiondata, r_area, r_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
@@ -815,10 +815,10 @@ static void rna_Space_view2d_sync_update(Main *UNUSED(bmain),
|
|||||||
region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
||||||
|
|
||||||
if (region) {
|
if (region) {
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
View2D *v2d = ®ion->v2d;
|
View2D *v2d = ®ion->v2d;
|
||||||
|
|
||||||
UI_view2d_sync(sc, area, v2d, V2D_LOCK_SET);
|
UI_view2d_sync(screen, area, v2d, V2D_LOCK_SET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,12 +853,12 @@ static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA
|
|||||||
static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
|
static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
|
||||||
{
|
{
|
||||||
View3D *v3d = (View3D *)(ptr->data);
|
View3D *v3d = (View3D *)(ptr->data);
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
|
|
||||||
v3d->scenelock = !value;
|
v3d->scenelock = !value;
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
Scene *scene = ED_screen_scene_find(sc, G_MAIN->wm.first);
|
Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first);
|
||||||
/* NULL if the screen isn't in an active window (happens when setting from Python).
|
/* NULL if the screen isn't in an active window (happens when setting from Python).
|
||||||
* This could be moved to the update function, in that case the scene wont relate to the screen
|
* This could be moved to the update function, in that case the scene wont relate to the screen
|
||||||
* so keep it working this way. */
|
* so keep it working this way. */
|
||||||
@@ -1455,8 +1455,8 @@ static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
|
|||||||
static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
|
static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first);
|
wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first);
|
||||||
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
||||||
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
|
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
|
||||||
return ED_space_image_show_uvedit(sima, obedit);
|
return ED_space_image_show_uvedit(sima, obedit);
|
||||||
@@ -1465,8 +1465,8 @@ static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
|
|||||||
static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
|
static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first);
|
wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first);
|
||||||
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
||||||
return ED_space_image_check_show_maskedit(sima, view_layer);
|
return ED_space_image_check_show_maskedit(sima, view_layer);
|
||||||
}
|
}
|
||||||
@@ -1476,8 +1476,8 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr,
|
|||||||
struct ReportList *UNUSED(reports))
|
struct ReportList *UNUSED(reports))
|
||||||
{
|
{
|
||||||
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
SpaceImage *sima = (SpaceImage *)(ptr->data);
|
||||||
bScreen *sc = (bScreen *)ptr->owner_id;
|
bScreen *screen = (bScreen *)ptr->owner_id;
|
||||||
wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first);
|
wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first);
|
||||||
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
||||||
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
|
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
|
||||||
|
|
||||||
|
|||||||
@@ -32,12 +32,12 @@
|
|||||||
|
|
||||||
static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C)
|
static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C)
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)id;
|
bScreen *screen = (bScreen *)id;
|
||||||
|
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
|
|
||||||
area_region_from_regiondata(sc, rv3d, &area, ®ion);
|
area_region_from_regiondata(screen, rv3d, &area, ®ion);
|
||||||
|
|
||||||
if (area && region && area->spacetype == SPACE_VIEW3D) {
|
if (area && region && area->spacetype == SPACE_VIEW3D) {
|
||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
@@ -46,7 +46,7 @@ static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C)
|
|||||||
wmWindow *win;
|
wmWindow *win;
|
||||||
|
|
||||||
for (win = wm->windows.first; win; win = win->next) {
|
for (win = wm->windows.first; win; win = win->next) {
|
||||||
if (WM_window_get_active_screen(win) == sc) {
|
if (WM_window_get_active_screen(win) == screen) {
|
||||||
Scene *scene = WM_window_get_active_scene(win);
|
Scene *scene = WM_window_get_active_scene(win);
|
||||||
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
|
||||||
Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true);
|
Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true);
|
||||||
@@ -61,8 +61,8 @@ static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C)
|
|||||||
static void rna_SpaceTextEditor_region_location_from_cursor(
|
static void rna_SpaceTextEditor_region_location_from_cursor(
|
||||||
ID *id, SpaceText *st, int line, int column, int r_pixel_pos[2])
|
ID *id, SpaceText *st, int line, int column, int r_pixel_pos[2])
|
||||||
{
|
{
|
||||||
bScreen *sc = (bScreen *)id;
|
bScreen *screen = (bScreen *)id;
|
||||||
ScrArea *area = BKE_screen_find_area_from_space(sc, (SpaceLink *)st);
|
ScrArea *area = BKE_screen_find_area_from_space(screen, (SpaceLink *)st);
|
||||||
if (area) {
|
if (area) {
|
||||||
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
||||||
const int cursor_co[2] = {line, column};
|
const int cursor_co[2] = {line, column};
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ const char *WM_window_cursor_keymap_status_get(const struct wmWindow *win,
|
|||||||
void WM_window_cursor_keymap_status_refresh(struct bContext *C, struct wmWindow *win);
|
void WM_window_cursor_keymap_status_refresh(struct bContext *C, struct wmWindow *win);
|
||||||
|
|
||||||
void WM_window_status_area_tag_redraw(struct wmWindow *win);
|
void WM_window_status_area_tag_redraw(struct wmWindow *win);
|
||||||
struct ScrArea *WM_window_status_area_find(struct wmWindow *win, struct bScreen *sc);
|
struct ScrArea *WM_window_status_area_find(struct wmWindow *win, struct bScreen *screen);
|
||||||
bool WM_window_modal_keymap_status_draw(struct bContext *C,
|
bool WM_window_modal_keymap_status_draw(struct bContext *C,
|
||||||
struct wmWindow *win,
|
struct wmWindow *win,
|
||||||
struct uiLayout *layout);
|
struct uiLayout *layout);
|
||||||
|
|||||||
@@ -298,8 +298,8 @@ void WM_gizmo_group_remove_by_tool(bContext *C,
|
|||||||
const bToolRef *tref)
|
const bToolRef *tref)
|
||||||
{
|
{
|
||||||
wmGizmoMapType *gzmap_type = WM_gizmomaptype_find(&gzgt->gzmap_params);
|
wmGizmoMapType *gzmap_type = WM_gizmomaptype_find(&gzgt->gzmap_params);
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
if (area->runtime.tool == tref) {
|
if (area->runtime.tool == tref) {
|
||||||
for (ARegion *region = area->regionbase.first; region; region = region->next) {
|
for (ARegion *region = area->regionbase.first; region; region = region->next) {
|
||||||
wmGizmoMap *gzmap = region->gizmo_map;
|
wmGizmoMap *gzmap = region->gizmo_map;
|
||||||
@@ -908,8 +908,8 @@ void WM_gizmomaptype_group_init_runtime(const Main *bmain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now create a gizmo for all existing areas */
|
/* now create a gizmo for all existing areas */
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
||||||
for (ARegion *region = lb->first; region; region = region->next) {
|
for (ARegion *region = lb->first; region; region = region->next) {
|
||||||
@@ -963,8 +963,8 @@ void WM_gizmomaptype_group_unlink(bContext *C,
|
|||||||
const wmGizmoGroupType *gzgt)
|
const wmGizmoGroupType *gzgt)
|
||||||
{
|
{
|
||||||
/* Free instances. */
|
/* Free instances. */
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
||||||
for (ARegion *region = lb->first; region; region = region->next) {
|
for (ARegion *region = lb->first; region; region = region->next) {
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ static void gizmotype_free(wmGizmoType *gzt)
|
|||||||
static void gizmotype_unlink(bContext *C, Main *bmain, wmGizmoType *gzt)
|
static void gizmotype_unlink(bContext *C, Main *bmain, wmGizmoType *gzt)
|
||||||
{
|
{
|
||||||
/* Free instances. */
|
/* Free instances. */
|
||||||
for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
for (ScrArea *area = sc->areabase.first; area; area = area->next) {
|
for (ScrArea *area = screen->areabase.first; area; area = area->next) {
|
||||||
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
ListBase *lb = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
||||||
for (ARegion *region = lb->first; region; region = region->next) {
|
for (ARegion *region = lb->first; region; region = region->next) {
|
||||||
|
|||||||
@@ -285,12 +285,12 @@ void WM_main_remove_notifier_reference(const void *reference)
|
|||||||
void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id)
|
void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id)
|
||||||
{
|
{
|
||||||
Main *bmain = G_MAIN;
|
Main *bmain = G_MAIN;
|
||||||
bScreen *sc;
|
bScreen *screen;
|
||||||
|
|
||||||
for (sc = bmain->screens.first; sc; sc = sc->id.next) {
|
for (screen = bmain->screens.first; screen; screen = screen->id.next) {
|
||||||
ScrArea *area;
|
ScrArea *area;
|
||||||
|
|
||||||
for (area = sc->areabase.first; area; area = area->next) {
|
for (area = screen->areabase.first; area; area = area->next) {
|
||||||
SpaceLink *sl;
|
SpaceLink *sl;
|
||||||
|
|
||||||
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
||||||
@@ -4892,8 +4892,8 @@ ScrArea *WM_window_status_area_find(wmWindow *win, bScreen *screen)
|
|||||||
|
|
||||||
void WM_window_status_area_tag_redraw(wmWindow *win)
|
void WM_window_status_area_tag_redraw(wmWindow *win)
|
||||||
{
|
{
|
||||||
bScreen *sc = WM_window_get_active_screen(win);
|
bScreen *screen = WM_window_get_active_screen(win);
|
||||||
ScrArea *area = WM_window_status_area_find(win, sc);
|
ScrArea *area = WM_window_status_area_find(win, screen);
|
||||||
if (area != NULL) {
|
if (area != NULL) {
|
||||||
ED_area_tag_redraw(area);
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user