Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-11-28 07:01:35 +0300
committerJoshua Leung <aligorith@gmail.com>2008-11-28 07:01:35 +0300
commitc8098f953d5f6fa18a00d49d0577a72706b43b89 (patch)
tree9e447b71098f09e3a07dae175112f81690a0d42c /source/blender/makesdna
parentd6769d513e94a5552968f1ed79520e755183ca5d (diff)
View2D - Commented and finished off cleaning up code added so far
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_screen_types.h9
-rw-r--r--source/blender/makesdna/DNA_space_types.h3
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h30
3 files changed, 28 insertions, 14 deletions
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index c03a60ff65f..39cf6454c2c 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -178,14 +178,17 @@ typedef struct ARegion {
#define WIN_BACK_OK 2
#define WIN_EQUAL 3
-#define L_SCROLL 1 /* left scrollbar */
+/* scrollbar flags for View2D */
+ /* left scrollbar */
+#define L_SCROLL 1
#define R_SCROLL 2
#define VERT_SCROLL 3
#define T_SCROLL 4
#define B_SCROLL 8
#define HOR_SCROLL 12
-#define B_SCROLLO 16 /* special hack for outliner hscroll - prevent hanging */
-#define HOR_SCROLLO 20 /* in older versions of blender */
+ /* special hack for outliner hscroll - prevent hanging older versions of Blender */
+#define B_SCROLLO 16
+#define HOR_SCROLLO 20
/* Panel->snap - for snapping to screen edges */
#define PNL_SNAP_NONE 0
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index d1eff908c86..9fd4770c977 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -471,9 +471,6 @@ typedef struct SpaceImaSel {
#define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
#define FOLDERFILE 2048 /* represents folders for filtering */
-#define SCROLLH 16 /* height scrollbar */
-#define SCROLLB 16 /* width scrollbar */
-
/* SpaceImage->mode */
#define SI_TEXTURE 0
#define SI_SHOW 1
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index d7c422407ca..d4425b43f76 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -24,7 +24,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Joshua Leung
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -33,32 +33,46 @@
#include "DNA_vec_types.h"
+/* ---------------------------------- */
+
+/* View 2D data - stored per region */
typedef struct View2D {
rctf tot, cur;
rcti vert, hor, mask;
+
float min[2], max[2];
float minzoom, maxzoom;
- short scroll, keeptot;
+
+ short scroll, keeptot; /* scroll - scrollbars to display (bitflag); keeptot - 'tot' rect */
short keepaspect, keepzoom;
short oldwinx, oldwiny;
- int flag;
- float cursor[2]; /* only used in the UV view for now*/
- short around;
+ int flag; /* settings */
+
+ float cursor[2]; /* only used in the UV view for now (for 2D-cursor) */
+ short around; /* pivot point for transforms (rotate and scale) */
char pad[6];
} View2D;
+/* ---------------------------------- */
+
/* v2d->keepzoom */
#define V2D_KEEPZOOM 0x0001
#define V2D_LOCKZOOM_X 0x0100
#define V2D_LOCKZOOM_Y 0x0200
/* event codes for locking function */
-#define V2D_LOCK_COPY 1
-#define V2D_LOCK_REDRAW 2
+#define V2D_LOCK_COPY 1
+#define V2D_LOCK_REDRAW 2
/* v2d->flag */
-#define V2D_VIEWLOCK 1
+#define V2D_VIEWLOCK (1<<0)
+
+/* scrollbar thickness */
+ /* height */
+#define SCROLLH 16
+ /* width */
+#define SCROLLB 16
#endif