[Bf-blender-cvs] [1782ea2] testbuild: Revert "Fullscreen Editor (new fullscreen mode for clean UI)"

Dalai Felinto noreply at git.blender.org
Thu Jul 31 17:20:06 CEST 2014


Commit: 1782ea2e06debfe04efeb162614cee01e4bb978a
Author: Dalai Felinto
Date:   Thu Jul 31 12:17:04 2014 -0300
Branches: testbuild
https://developer.blender.org/rB1782ea2e06debfe04efeb162614cee01e4bb978a

Revert "Fullscreen Editor (new fullscreen mode for clean UI)"

This reverts commit 046b1584c4f01e3e7b7838daaf9ba93d3bdf6762.

===================================================================

M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/render/render_view.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/screen_edit.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesrna/intern/rna_screen.c
M	source/blender/windowmanager/intern/wm_init_exit.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/intern/wm_window.c
M	source/blender/windowmanager/wm_window.h

===================================================================

diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index ed24656..d31be3e 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -110,7 +110,7 @@ void    ED_screen_animation_timer_update(struct bScreen *screen, int redraws, in
 ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
 void    ED_screen_full_prevspace(struct bContext *C, ScrArea *sa);
 void    ED_screen_full_restore(struct bContext *C, ScrArea *sa);
-struct ScrArea *ED_screen_state_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa, const short state);
+struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa);
 void    ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
 
 /* anim */
diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c
index ab28f5f..0beb573 100644
--- a/source/blender/editors/render/render_view.c
+++ b/source/blender/editors/render/render_view.c
@@ -252,7 +252,7 @@ static int render_view_cancel_exec(bContext *C, wmOperator *UNUSED(op))
 	}
 	else if (sima->flag & SI_FULLWINDOW) {
 		sima->flag &= ~SI_FULLWINDOW;
-		ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+		ED_screen_full_toggle(C, win, sa);
 		return OPERATOR_FINISHED;
 	}
 
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 863464f..11e7174 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -571,7 +571,7 @@ static void area_azone_initialize(wmWindow *win, bScreen *screen, ScrArea *sa)
 	/* reinitalize entirely, regions add azones too */
 	BLI_freelistN(&sa->actionzones);
 
-	if (screen->state != SCREENNORMAL) {
+	if (screen->full != SCREENNORMAL) {
 		return;
 	}
 
@@ -1168,8 +1168,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti
 		 * must be minimum '4' */
 	}
 	else {
-		if (ELEM(win->screen->state, SCREENNORMAL, SCREENMAXIMIZED))
-			region_azone_add(sa, ar, alignment);
+		region_azone_add(sa, ar, alignment);
 	}
 
 	region_rect_recursive(win, sa, ar->next, remainder, quad);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 3591548..5beab9f 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1058,7 +1058,7 @@ bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc)
 {
 	bScreen *newsc;
 	
-	if (sc->state != SCREENNORMAL) return NULL;  /* XXX handle this case! */
+	if (sc->full != SCREENNORMAL) return NULL;  /* XXX handle this case! */
 	
 	/* make new empty screen: */
 	newsc = ED_screen_add(win, sc->scene, sc->id.name + 2);
@@ -1485,7 +1485,7 @@ void ED_screen_set(bContext *C, bScreen *sc)
 		return;
 	
 
-	if (sc->state == SCREENFULLSCREEN) {             /* find associated full */
+	if (sc->full) {             /* find associated full */
 		bScreen *sc1;
 		for (sc1 = bmain->screen.first; sc1; sc1 = sc1->id.next) {
 			ScrArea *sa = sc1->areabase.first;
@@ -1586,7 +1586,7 @@ void ED_screen_delete(bContext *C, bScreen *sc)
 	int delete = 1;
 	
 	/* don't allow deleting temp fullscreens for now */
-	if (ELEM(sc->state, SCREENMAXIMIZED, SCREENFULLSCREEN)) {
+	if (sc->full == SCREENFULL) {
 		return;
 	}
 	
@@ -1730,11 +1730,11 @@ ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
 	ScrArea *newsa = NULL;
 
 	if (!sa || sa->full == NULL) {
-		newsa = ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+		newsa = ED_screen_full_toggle(C, win, sa);
 	}
 	
 	if (!newsa) {
-		if (sa->full && screen->state == SCREENMAXIMIZED) {
+		if (sa->full) {
 			/* if this has been called from the temporary info header generated in
 			 * temp fullscreen layouts, find the correct fullscreen area to change
 			 * to create a new space inside */
@@ -1760,7 +1760,7 @@ void ED_screen_full_prevspace(bContext *C, ScrArea *sa)
 	ED_area_prevspace(C, sa);
 	
 	if (sa->full)
-		ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+		ED_screen_full_toggle(C, win, sa);
 }
 
 /* restore a screen / area back to default operation, after temp fullscreen modes */
@@ -1785,23 +1785,23 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa)
 				ED_screen_full_prevspace(C, sa);
 			}
 			else
-				ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+				ED_screen_full_toggle(C, win, sa);
 		}
 		else if (sl->spacetype == SPACE_FILE) {
 			ED_screen_full_prevspace(C, sa);
 		}
 		else {
-			ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+			ED_screen_full_toggle(C, win, sa);
 		}
 	}
 	/* otherwise just tile the area again */
 	else {
-		ED_screen_state_toggle(C, win, sa, SCREENMAXIMIZED);
+		ED_screen_full_toggle(C, win, sa);
 	}
 }
 
-/* this function toggles: if area is maximized/full then the parent will be restored */
-ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const short state)
+/* this function toggles: if area is full then the parent will be restored */
+ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
 {
 	bScreen *sc, *oldscreen;
 	ARegion *ar;
@@ -1812,20 +1812,23 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
 		 * are no longer in the same screen */
 		for (ar = sa->regionbase.first; ar; ar = ar->next)
 			uiFreeBlocks(C, &ar->uiblocks);
-
+		
 		/* prevent hanging header prints */
 		ED_area_headerprint(sa, NULL);
 	}
 
 	if (sa && sa->full) {
-		/* restoring back to SCREENNORMAL */
 		ScrArea *old;
+		/*short fulltype;*/ /*UNUSED*/
 
 		sc = sa->full;       /* the old screen to restore */
 		oldscreen = win->screen; /* the one disappearing */
 
-		sc->state = SCREENNORMAL;
+		/*fulltype = sc->full;*/
+		sc->full = 0;
 
+		/* removed: SCREENAUTOPLAY exception here */
+	
 		/* find old area */
 		for (old = sc->areabase.first; old; old = old->next)
 			if (old->full) break;
@@ -1835,12 +1838,6 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
 			return NULL;
 		}
 
-		if (state == SCREENFULLSCREEN) {
-			/* restore the old side panels/header visibility */
-			for (ar = sa->regionbase.first; ar; ar = ar->next)
-				ar->flag = ar->flagfullscreen;
-		}
-
 		ED_area_data_swap(old, sa);
 		if (sa->flag & AREA_TEMP_INFO) sa->flag &= ~AREA_TEMP_INFO;
 		old->full = NULL;
@@ -1856,66 +1853,44 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
 
 	}
 	else {
-		/* change from SCREENNORMAL to new state */
 		ScrArea *newa;
 		char newname[MAX_ID_NAME - 2];
 
 		oldscreen = win->screen;
 
-		oldscreen->state = state;
-		BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name + 2, "nonnormal");
+		/* nothing wrong with having only 1 area, as far as I can see...
+		 * is there only 1 area? */
+#if 0
+		if (oldscreen->areabase.first == oldscreen->areabase.last)
+			return NULL;
+#endif
+
+		oldscreen->full = SCREENFULL;
+		BLI_snprintf(newname, sizeof(newname), "%s-%s", oldscreen->id.name + 2, "full");
 		sc = ED_screen_add(win, oldscreen->scene, newname);
-		sc->state = state;
+		sc->full = SCREENFULL; // XXX
 
 		/* timer */
 		sc->animtimer = oldscreen->animtimer;
 		oldscreen->animtimer = NULL;
 
+		/* returns the top small area */
+		newa = area_split(sc, (ScrArea *)sc->areabase.first, 'h', 0.99f, 1);
+		ED_area_newspace(C, newa, SPACE_INFO);
+
 		/* use random area when we have no active one, e.g. when the
 		 * mouse is outside of the window and we open a file browser */
 		if (!sa)
 			sa = oldscreen->areabase.first;
 
-		if (state == SCREENMAXIMIZED) {
-			/* returns the top small area */
-			newa = area_split(sc, (ScrArea *)sc->areabase.first, 'h', 0.99f, 1);
-			ED_area_newspace(C, newa, SPACE_INFO);
+		/* copy area */
+		newa = newa->prev;
+		ED_area_data_swap(newa, sa);
+		sa->flag |= AREA_TEMP_INFO;
 
-			/* copy area */
-			newa = newa->prev;
-			ED_area_data_swap(newa, sa);
-			sa->flag |= AREA_TEMP_INFO;
-
-			sa->full = oldscreen;
-			newa->full = oldscreen;
-			newa->next->full = oldscreen; // XXX
-		}
-		else if (state == SCREENFULLSCREEN){
-			newa = (ScrArea *)sc->areabase.first;
-
-			/* copy area */
-			ED_area_data_swap(newa, sa);
-			newa->flag = sa->flag; /* mostly for AREA_FLAG_WASFULLSCREEN */
-
-			/* temporarily hide the side panels/header */
-			for (ar = newa->regionbase.first; ar; ar = ar->next) {
-				ar->flagfullscreen = ar->flag;
-
-				if (ELEM(ar->regiontype,
-						  RGN_TYPE_UI,
-						  RGN_TYPE_PREVIEW,
-						  RGN_TYPE_HEADER,
-						  RGN_TYPE_TOOLS)) {
-					ar->flag |= RGN_FLAG_HIDDEN;
-				}
-			}
-
-			sa->full = oldscreen;
-			newa->full = oldscreen;
-		}
-		else {
-			BLI_assert(false);
-		}
+		sa->full = oldscreen;
+		newa->full = oldscreen;
+		newa->next->full = oldscreen; // XXX
 
 		ED_screen_set(C, sc);
 	}
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index cb689c0..7c7574b 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -129,7 +129,7 @@ static int screen_active_editable(bContext *C)
 {
 	if (ED_operator_screenactive(C)) {
 		/* no full window splitting allowed */
-		if (CTX_wm_screen(C)->state != SCREENNORMAL)
+		if (CTX_wm_screen(C)->full != SCREENNORMAL)
 			return 0;
 		return 1;
 	}
@@ -1462,7 +1462,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 	int dir;
 	
 	/* no full window splitting allowed */
-	if (sc->state != SCREENNORMAL)
+	if (sc->full != SCREENNORMAL)
 		return OPERATOR_CANCELLED;
 	
 	if (event->type == EVT_ACTIONZONE_AREA) {
@@ -2232,7 +2232,7 @@ static void SCREEN_OT_marker_jump(wmOperatorType *ot)
 static bool screen_set_is_ok(bScreen *screen, bScreen *screen_prev)
 {
 	return ((screen->winid == 0)    &&
-	        (screen->state == SCREENNORMAL)     &&
+	        (screen->full == 0)     &&
 	        (screen != screen_prev) &&
 	        (screen->id.name[2] != '.' || !(U.uiflag & USER_HIDE_DOT)));
 }
@@ -2303,13 +2303,10 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot)
 
 
 /* function to be called o

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list