[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17716] branches/blender2.5/blender/source /blender: * rename some view2d defines to be clearer and more in line with the rest of view2d defines .

Nathan Letwory jesterking at letwory.net
Thu Dec 4 21:29:01 CET 2008


Revision: 17716
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17716
Author:   jesterking
Date:     2008-12-04 21:28:59 +0100 (Thu, 04 Dec 2008)

Log Message:
-----------
* rename some view2d defines to be clearer and more in line with the rest of view2d defines.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c
    branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_view2d_types.h

Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2008-12-04 16:07:46 UTC (rev 17715)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2008-12-04 20:28:59 UTC (rev 17716)
@@ -5074,8 +5074,8 @@
 				SpaceOops *soops= sa->spacedata.first;
 				
 				memcpy(&ar->v2d, &soops->v2d, sizeof(View2D));
-				ar->v2d.scroll &= ~L_SCROLL;
-				ar->v2d.scroll |= R_SCROLL;
+				ar->v2d.scroll &= ~V2D_SCROLL_LEFT;
+				ar->v2d.scroll |= V2D_SCROLL_RIGHT;
 			}
 				break;
 			case SPACE_TIME:
@@ -5083,7 +5083,7 @@
 				SpaceTime *stime= sa->spacedata.first;
 				memcpy(&ar->v2d, &stime->v2d, sizeof(View2D));
 				
-				ar->v2d.scroll |= (B_SCROLL|BGRID_SCROLL);
+				ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_BOTTOM);
 				ar->v2d.keepofs |= V2D_LOCKOFS_Y;
 			}
 				break;

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-04 16:07:46 UTC (rev 17715)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-04 20:28:59 UTC (rev 17716)
@@ -66,30 +66,30 @@
 	 */
 	if (v2d->scroll) {
 		/* vertical scrollbar */
-		if (v2d->scroll & L_SCROLL) {
+		if (v2d->scroll & V2D_SCROLL_LEFT) {
 			/* on left-hand edge of region */
 			v2d->vert= v2d->mask;
-			v2d->vert.xmax= SCROLLB;
-			v2d->mask.xmin= SCROLLB;
+			v2d->vert.xmax= V2D_SCROLL_WIDTH;
+			v2d->mask.xmin= V2D_SCROLL_WIDTH;
 		}
-		else if (v2d->scroll & R_SCROLL) {
+		else if (v2d->scroll & V2D_SCROLL_RIGHT) {
 			/* on right-hand edge of region */
 			v2d->vert= v2d->mask;
-			v2d->vert.xmin= v2d->vert.xmax-SCROLLB;
+			v2d->vert.xmin= v2d->vert.xmax-V2D_SCROLL_WIDTH;
 			v2d->mask.xmax= v2d->vert.xmin;
 		}
 		
 		/* horizontal scrollbar */
-		if (v2d->scroll & (B_SCROLL|B_SCROLLO)) {
-			/* on bottom edge of region (B_SCROLLO is outliner, the ohter is for standard) */
+		if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) {
+			/* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the ohter is for standard) */
 			v2d->hor= v2d->mask;
-			v2d->hor.ymax= SCROLLH;
-			v2d->mask.ymin= SCROLLH;
+			v2d->hor.ymax= V2D_SCROLL_HEIGHT;
+			v2d->mask.ymin= V2D_SCROLL_HEIGHT;
 		}
-		else if (v2d->scroll & T_SCROLL) {
+		else if (v2d->scroll & V2D_SCROLL_TOP) {
 			/* on upper edge of region */
 			v2d->hor= v2d->mask;
-			v2d->hor.ymin= v2d->hor.ymax-SCROLLH;
+			v2d->hor.ymin= v2d->hor.ymax-V2D_SCROLL_HEIGHT;
 			v2d->mask.ymax= v2d->hor.ymin;
 		}
 	}
@@ -107,8 +107,8 @@
 	float dx, dy, temp, fac, zoom;
 	
 	/* correct winx for scrollbars */
-	if (v2d->scroll & L_SCROLL) winx-= SCROLLB;
-	if (v2d->scroll & (B_SCROLL|B_SCROLLO)) winy-= SCROLLH;
+	if (v2d->scroll & V2D_SCROLL_LEFT) winx-= V2D_SCROLL_WIDTH;
+	if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) winy-= V2D_SCROLL_HEIGHT;
 	
 	/* header completely closed window */
 	if (winy <= 0) return;
@@ -638,7 +638,7 @@
 	 */
 	
 	/* horizontal scrollers */
-	if (v2d->scroll & (HOR_SCROLL|HOR_SCROLLO)) {
+	if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
 		/* slider 'button' extents */
 		totsize= v2d->tot.xmax - v2d->tot.xmin;
 		scrollsize= hor.xmax - hor.xmin;
@@ -656,7 +656,7 @@
 	}
 	
 	/* vertical scrollers */
-	if (v2d->scroll & VERT_SCROLL) {
+	if (v2d->scroll & V2D_SCROLL_VERTICAL) {
 		/* slider 'button' extents */
 		totsize= v2d->tot.ymax - v2d->tot.ymin;
 		scrollsize= vert.ymax - vert.ymin;
@@ -674,7 +674,7 @@
 	}
 	
 	/* grid markings on scrollbars */
-	if (v2d->scroll & (HOR_SCROLLGRID|VERT_SCROLLGRID)) {
+	if (v2d->scroll & (V2D_SCROLL_SCALE_HORIZONTAL|V2D_SCROLL_SCALE_VERTICAL)) {
 		/* store clamping */
 		scrollers->xclamp= xclamp;
 		scrollers->xunits= xunits;
@@ -682,9 +682,9 @@
 		scrollers->yunits= yunits;
 		
 		/* calculate grid */
-		if (v2d->scroll & HOR_SCROLLGRID)
+		if (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL)
 			scrollers->grid= UI_view2d_calc_grid(C, v2d, xunits, xclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
-		else if (v2d->scroll & VERT_SCROLLGRID)
+		else if (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL)
 			scrollers->grid= UI_view2d_calc_grid(C, v2d, yunits, yclamp, (hor.xmax - hor.xmin), (vert.ymax - vert.ymin));
 	}
 	
@@ -743,7 +743,7 @@
 	hor= v2d->hor;
 	
 	/* horizontal scrollbar */
-	if (v2d->scroll & (HOR_SCROLL|HOR_SCROLLO)) {
+	if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
 		/* scroller backdrop */
 		UI_ThemeColorShade(TH_SHADE1, light);
 		glRecti(hor.xmin,  hor.ymin,  hor.xmax,  hor.ymax);
@@ -764,7 +764,7 @@
 		
 		/* scale indicators */
 		// XXX will need to update the font drawing when the new stuff comes in
-		if (v2d->scroll & HOR_SCROLLGRID) {
+		if (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) {
 			View2DGrid *grid= scrollers->grid;
 			float fac, dfac, fac2, val;
 			
@@ -828,14 +828,14 @@
 		
 		/* decoration outer bevel line */
 		UI_ThemeColorShade(TH_SHADE1, lighter);
-		if (v2d->scroll & (B_SCROLL|B_SCROLLO))
+		if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O))
 			sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax);
-		else if (v2d->scroll & T_SCROLL)
+		else if (v2d->scroll & V2D_SCROLL_TOP)
 			sdrawline(hor.xmin, hor.ymin, hor.xmax, hor.ymin);
 	}
 	
 	/* vertical scrollbar */
-	if (v2d->scroll & VERT_SCROLL) {
+	if (v2d->scroll & V2D_SCROLL_VERTICAL) {
 		/* scroller backdrop  */
 		UI_ThemeColorShade(TH_SHADE1, light);
 		glRecti(vert.xmin,  vert.ymin,  vert.xmax,  vert.ymax);
@@ -856,7 +856,7 @@
 		
 		/* scale indiators */
 		// XXX will need to update the font drawing when the new stuff comes in
-		if (v2d->scroll & VERT_SCROLLGRID) {
+		if (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) {
 			View2DGrid *grid= scrollers->grid;
 			float fac, dfac, val;
 			
@@ -867,10 +867,10 @@
 			 *	  NOTE: it's assumed that that scrollbar is there if this is involved!
 			 */
 			fac= (grid->starty- v2d->cur.ymin) / (v2d->cur.ymax - v2d->cur.ymin);
-			fac= (vert.ymin + SCROLLH) + fac*(vert.ymax - vert.ymin - SCROLLH);
+			fac= (vert.ymin + V2D_SCROLL_HEIGHT) + fac*(vert.ymax - vert.ymin - V2D_SCROLL_HEIGHT);
 			
 			dfac= (grid->dy) / (v2d->cur.ymax - v2d->cur.ymin);
-			dfac= dfac * (vert.ymax - vert.ymin - SCROLLH);
+			dfac= dfac * (vert.ymax - vert.ymin - V2D_SCROLL_HEIGHT);
 			
 			/* set starting value, and text color */
 			UI_ThemeColor(TH_TEXT);
@@ -889,9 +889,9 @@
 		
 		/* decoration outer bevel line */
 		UI_ThemeColorShade(TH_SHADE1, lighter);
-		if (v2d->scroll & R_SCROLL)
+		if (v2d->scroll & V2D_SCROLL_RIGHT)
 			sdrawline(vert.xmin, vert.ymin, vert.xmin, vert.ymax);
-		else if (v2d->scroll & L_SCROLL)
+		else if (v2d->scroll & V2D_SCROLL_LEFT)
 			sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax);
 	}
 }

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c	2008-12-04 16:07:46 UTC (rev 17715)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d_ops.c	2008-12-04 20:28:59 UTC (rev 17716)
@@ -71,10 +71,10 @@
 	co[1]= y - ar->winrct.ymin;
 	
 	/* check if within scrollbars */
-	if (v2d->scroll & (HOR_SCROLL|HOR_SCROLLO)) {
+	if (v2d->scroll & (V2D_SCROLL_HORIZONTAL|V2D_SCROLL_HORIZONTAL_O)) {
 		if (IN_2D_HORIZ_SCROLL(v2d, co)) return 'h';
 	}
-	if (v2d->scroll & VERT_SCROLL) {
+	if (v2d->scroll & V2D_SCROLL_VERTICAL) {
 		if (IN_2D_VERT_SCROLL(v2d, co)) return 'v';
 	}	
 	

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_view2d_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_view2d_types.h	2008-12-04 16:07:46 UTC (rev 17715)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_view2d_types.h	2008-12-04 20:28:59 UTC (rev 17716)
@@ -77,31 +77,29 @@
 #define V2D_VIEWLOCK	(1<<0)
 
 /* scrollbar thickness */
-	/* height */
-#define SCROLLH	16
-	/* width */
-#define SCROLLB	16
+#define V2D_SCROLL_HEIGHT	16
+#define V2D_SCROLL_WIDTH	16
 
 /* scrollbar flags for View2D */
 	/* left scrollbar */
-#define L_SCROLL 		(1<<0)		
-#define R_SCROLL 		(1<<1)
-#define VERT_SCROLL 	(L_SCROLL|R_SCROLL)
+#define V2D_SCROLL_LEFT 		(1<<0)		
+#define V2D_SCROLL_RIGHT 		(1<<1)
+#define V2D_SCROLL_VERTICAL 	(V2D_SCROLL_LEFT|V2D_SCROLL_RIGHT)
 	/* horizontal scrollbar */
-#define T_SCROLL 		(1<<2)
-#define B_SCROLL 		(1<<3)
-#define HOR_SCROLL  	(T_SCROLL|B_SCROLL)
+#define V2D_SCROLL_TOP 		(1<<2)
+#define V2D_SCROLL_BOTTOM 		(1<<3)
+#define V2D_SCROLL_HORIZONTAL  	(V2D_SCROLL_TOP|V2D_SCROLL_BOTTOM)
 	/* special hacks for outliner hscroll - prevent hanging older versions of Blender */
-#define B_SCROLLO   	(1<<4)
-#define HOR_SCROLLO 	(T_SCROLL|B_SCROLLO)
+#define V2D_SCROLL_BOTTOM_O   	(1<<4)
+#define V2D_SCROLL_HORIZONTAL_O 	(V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)
 	/* scale markings - vertical */
-#define LGRID_SCROLL	(1<<5)
-#define RGRID_SCROLL	(1<<6)
-#define VERT_SCROLLGRID	(LGRID_SCROLL|RGRID_SCROLL)
+#define V2D_SCROLL_SCALE_LEFT	(1<<5)
+#define V2D_SCROLL_SCALE_RIGHT	(1<<6)
+#define V2D_SCROLL_SCALE_VERTICAL	(V2D_SCROLL_SCALE_LEFT|V2D_SCROLL_SCALE_RIGHT)
 	/* scale markings - horizontal */
-#define BGRID_SCROLL	(1<<7)
-#define TGRID_SCROLL	(1<<8)	
-#define HOR_SCROLLGRID	(BGRID_SCROLL|TGRID_SCROLL)
+#define V2D_SCROLL_SCALE_BOTTOM	(1<<7)
+#define V2D_SCROLL_SCALE_TOP	(1<<8)	
+#define V2D_SCROLL_SCALE_HORIZONTAL	(V2D_SCROLL_SCALE_BOTTOM|V2D_SCROLL_SCALE_TOP)
 
 #endif
 





More information about the Bf-blender-cvs mailing list