[Bf-blender-cvs] [bde3cda7101] workspaces: Rename editors/workspace back to editors/screen

Julian Eisel noreply at git.blender.org
Thu Mar 30 01:36:42 CEST 2017


Commit: bde3cda7101fda2df671f72b518f4cf0a7f9e3a2
Author: Julian Eisel
Date:   Thu Mar 30 01:29:04 2017 +0200
Branches: workspaces
https://developer.blender.org/rBbde3cda7101fda2df671f72b518f4cf0a7f9e3a2

Rename editors/workspace back to editors/screen

We'll keep the name 'screen' to describe everything visible within the
window, including the global bars (top bar, status bar) which are not
part of bScreen struct (which describes the customizable screen-layout).
It's quite confusing to have the term 'screen' used for bScreen
operations too, but plan is to get rid of bScreen and move its data to
WorkSpace and WorkSpaceLayout (could be called ScreenLayout then).

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

M	build_files/cmake/macros.cmake
M	doc/doxygen/doxygen.source.h
M	source/blender/editors/CMakeLists.txt
R095	source/blender/editors/workspace/CMakeLists.txt	source/blender/editors/screen/CMakeLists.txt
R099	source/blender/editors/workspace/area.c	source/blender/editors/screen/area.c
R099	source/blender/editors/workspace/glutil.c	source/blender/editors/screen/glutil.c
A	source/blender/editors/screen/glutil.c.orig
R099	source/blender/editors/workspace/screen_context.c	source/blender/editors/screen/screen_context.c
R099	source/blender/editors/workspace/screen_draw.c	source/blender/editors/screen/screen_draw.c
A	source/blender/editors/screen/screen_draw.c.orig
R099	source/blender/editors/workspace/screen_edit.c	source/blender/editors/screen/screen_edit.c
R097	source/blender/editors/workspace/screen_intern.h	source/blender/editors/screen/screen_intern.h
R099	source/blender/editors/workspace/screen_ops.c	source/blender/editors/screen/screen_ops.c
R099	source/blender/editors/workspace/screendump.c	source/blender/editors/screen/screendump.c
R099	source/blender/editors/workspace/workspace_edit.c	source/blender/editors/screen/workspace_edit.c
R098	source/blender/editors/workspace/workspace_layout_edit.c	source/blender/editors/screen/workspace_layout_edit.c

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

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 650142ec44e..55562297b8b 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -580,9 +580,9 @@ function(SETUP_BLENDER_SORTED_LIBS)
 		bf_editor_physics
 		bf_editor_render
 		bf_editor_scene
+		bf_editor_screen
 		bf_editor_sculpt_paint
 		bf_editor_sound
-		bf_editor_workspace
 		bf_editor_animation
 		bf_editor_datafiles
 		bf_editor_mask
diff --git a/doc/doxygen/doxygen.source.h b/doc/doxygen/doxygen.source.h
index a91469d4a87..eb56f52ae73 100644
--- a/doc/doxygen/doxygen.source.h
+++ b/doc/doxygen/doxygen.source.h
@@ -219,19 +219,19 @@
  *  \ingroup editors
  */
 
-/** \defgroup edscene scene
+/** \defgroup edscreen screen
  *  \ingroup editors
  */
 
-/** \defgroup edsculpt sculpt and paint
+/** \defgroup edscene scene
  *  \ingroup editors
  */
 
-/** \defgroup edsnd sound
+/** \defgroup edsculpt sculpt and paint
  *  \ingroup editors
  */
 
-/** \defgroup edworkspace workspace
+/** \defgroup edsnd sound
  *  \ingroup editors
  */
 
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index 78716c853c5..f62db3c1ddb 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -60,7 +60,7 @@ if(WITH_BLENDER)
 	add_subdirectory(transform)
 	add_subdirectory(util)
 	add_subdirectory(uvedit)
-	add_subdirectory(workspace)
+	add_subdirectory(screen)
 endif()
 
 add_subdirectory(datafiles)
diff --git a/source/blender/editors/workspace/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt
similarity index 95%
rename from source/blender/editors/workspace/CMakeLists.txt
rename to source/blender/editors/screen/CMakeLists.txt
index 9f5a97c115f..02584a4611b 100644
--- a/source/blender/editors/workspace/CMakeLists.txt
+++ b/source/blender/editors/screen/CMakeLists.txt
@@ -59,4 +59,4 @@ endif()
 
 add_definitions(${GL_DEFINITIONS})
 
-blender_add_lib(bf_editor_workspace "${SRC}" "${INC}" "${INC_SYS}")
+blender_add_lib(bf_editor_screen "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/workspace/area.c b/source/blender/editors/screen/area.c
similarity index 99%
rename from source/blender/editors/workspace/area.c
rename to source/blender/editors/screen/area.c
index 697a0693c38..7091b9eb037 100644
--- a/source/blender/editors/workspace/area.c
+++ b/source/blender/editors/screen/area.c
@@ -24,8 +24,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/editors/workspace/area.c
- *  \ingroup edworkspace
+/** \file blender/editors/screen/area.c
+ *  \ingroup edscreen
  */
 
 
diff --git a/source/blender/editors/workspace/glutil.c b/source/blender/editors/screen/glutil.c
similarity index 99%
copy from source/blender/editors/workspace/glutil.c
copy to source/blender/editors/screen/glutil.c
index bde8313670f..f4174296da2 100644
--- a/source/blender/editors/workspace/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -23,8 +23,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/editors/workspace/glutil.c
- *  \ingroup workspace
+/** \file blender/editors/screen/glutil.c
+ *  \ingroup edscreen
  */
 
 
diff --git a/source/blender/editors/workspace/glutil.c b/source/blender/editors/screen/glutil.c.orig
similarity index 63%
rename from source/blender/editors/workspace/glutil.c
rename to source/blender/editors/screen/glutil.c.orig
index bde8313670f..948895f9089 100644
--- a/source/blender/editors/workspace/glutil.c
+++ b/source/blender/editors/screen/glutil.c.orig
@@ -50,10 +50,68 @@
 
 #include "GPU_basic_shader.h"
 #include "GPU_immediate.h"
-#include "GPU_matrix.h"
 
 #include "UI_interface.h"
 
+/* DEPRECATED: use imm_draw_line instead */
+void fdrawline(float x1, float y1, float x2, float y2)
+{
+	glBegin(GL_LINES);
+	glVertex2f(x1, y1);
+	glVertex2f(x2, y2);
+	glEnd();
+}
+
+void fdrawbox(float x1, float y1, float x2, float y2)
+{
+	/* DEPRECATED: use imm_draw_line_box instead */
+	glBegin(GL_LINE_LOOP);
+	
+	glVertex2f(x1, y1);
+	glVertex2f(x1, y2);
+	glVertex2f(x2, y2);
+	glVertex2f(x2, y1);
+	
+	glEnd();
+}
+
+void fdrawcheckerboard(float x1, float y1, float x2, float y2)
+{
+	/* DEPRECATED: use imm_draw_checker_box instead */
+	unsigned char col1[4] = {40, 40, 40}, col2[4] = {50, 50, 50};
+
+	glColor3ubv(col1);
+	glRectf(x1, y1, x2, y2);
+	glColor3ubv(col2);
+
+	GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
+	GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_CHECKER_8PX);
+	glRectf(x1, y1, x2, y2);
+	GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
+}
+
+void sdrawline(int x1, int y1, int x2, int y2) /* DEPRECATED */
+{
+	glBegin(GL_LINES);
+	glVertex2i(x1, y1);
+	glVertex2i(x2, y2);
+	glEnd();
+}
+
+void sdrawbox(int x1, int y1, int x2, int y2)
+{
+	/* DEPRECATED: use imm_draw_line_box instead */
+	glBegin(GL_LINE_LOOP);
+	
+	glVertex2i(x1, y1);
+	glVertex2i(x1, y2);
+	glVertex2i(x2, y2);
+	glVertex2i(x2, y1);
+	
+	glEnd();
+}
+
+
 /* ******************************************** */
 
 void setlinestyle(int nr)
@@ -82,6 +140,38 @@ void set_inverted_drawing(int enable)
 	GL_TOGGLE(GL_DITHER, !enable);
 }
 
+
+void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments)
+{
+	/* DEPRECATED */
+	int i;
+	
+	glBegin(GL_TRIANGLE_FAN);
+	glVertex2f(0.0, 0.0);
+	for (i = 0; i < nsegments; i++) {
+		float t = (float) i / (nsegments - 1);
+		float cur = start + t * angle;
+		
+		glVertex2f(cosf(cur) * radius, sinf(cur) * radius);
+	}
+	glEnd();
+}
+
+void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments)
+{
+	/* DEPRECATED */
+	int i;
+	
+	glBegin(GL_LINE_STRIP);
+	for (i = 0; i < nsegments; i++) {
+		float t = (float) i / (nsegments - 1);
+		float cur = start + t * angle;
+		
+		glVertex2f(cosf(cur) * radius, sinf(cur) * radius);
+	}
+	glEnd();
+}
+
 static void imm_draw_circle(PrimitiveType prim_type, unsigned pos, float x, float y, float rad, int nsegments)
 {
 	immBegin(prim_type, nsegments);
@@ -156,7 +246,7 @@ void imm_cpack(unsigned int x)
 		(((x) >> 16) & 0xFF));
 }
 
-void imm_cylinder_nor(unsigned int pos, unsigned int nor, float base, float top, float height, int slices, int stacks)
+void imm_cylinder(unsigned int pos, unsigned int nor, float base, float top, float height, int slices, int stacks)
 {
 	immBegin(GL_TRIANGLES, 6 * slices * stacks);
 	for (int i = 0; i < slices; ++i) {
@@ -207,81 +297,6 @@ void imm_cylinder_nor(unsigned int pos, unsigned int nor, float base, float top,
 	immEnd();
 }
 
-void imm_cylinder_wire(unsigned int pos, float base, float top, float height, int slices, int stacks)
-{
-	immBegin(GL_LINES, 6 * slices * stacks);
-	for (int i = 0; i < slices; ++i) {
-		const float angle1 = 2 * M_PI * ((float)i / (float)slices);
-		const float angle2 = 2 * M_PI * ((float)(i+1) / (float)slices);
-		const float cos1 = cosf(angle1);
-		const float sin1 = sinf(angle1);
-		const float cos2 = cosf(angle2);
-		const float sin2 = sinf(angle2);
-
-		for (int j = 0; j < stacks; ++j) {
-			float fac1 = (float)j / (float)stacks;
-			float fac2 = (float)(j+1) / (float)stacks;
-			float r1 = base * (1.f - fac1) + top * fac1;
-			float r2 = base * (1.f - fac2) + top * fac2;
-			float h1 = height * ((float)j / (float)stacks);
-			float h2 = height * ((float)(j+1) / (float)stacks);
-
-			float v1[3] = {r1 * cos2, r1 * sin2, h1};
-			float v2[3] = {r2 * cos2, r2 * sin2, h2};
-			float v3[3] = {r2 * cos1, r2 * sin1, h2};
-			float v4[3] = {r1 * cos1, r1 * sin1, h1};
-
-			immVertex3fv(pos, v1);
-			immVertex3fv(pos, v2);
-			
-			immVertex3fv(pos, v2);
-			immVertex3fv(pos, v3);
-
-			immVertex3fv(pos, v1);
-			immVertex3fv(pos, v4);
-		}
-	}
-	immEnd();
-}
-
-void imm_cylinder(unsigned int pos, float base, float top, float height, int slices, int stacks)
-{
-	immBegin(GL_TRIANGLES, 6 * slices * stacks);
-	for (int i = 0; i < slices; ++i) {
-		const float angle1 = 2 * M_PI * ((float)i / (float)slices);
-		const float angle2 = 2 * M_PI * ((float)(i + 1) / (float)slices);
-		const float cos1 = cosf(angle1);
-		const float sin1 = sinf(angle1);
-		const float cos2 = cosf(angle2);
-		const float sin2 = sinf(angle2);
-
-		for (int j = 0; j < stacks; ++j) {
-			float fac1 = (float)j / (float)stacks;
-			float fac2 = (float)(j + 1) / (float)stacks;
-			float r1 = base * (1.f - fac1) + top * fac1;
-			float r2 = base * (1.f - fac2) + top * fac2;
-			float h1 = height * ((float)j / (float)stacks);
-			float h2 = height * ((float)(j + 1) / (float)stacks);
-
-			float v1[3] = { r1 * cos2, r1 * sin2, h1 };
-			float v2[3] = { r2 * cos2, r2 * sin2, h2 };
-			float v3[3] = { r2 * cos1, r2 * sin1, h2 };
-			float v4[3] = { r1 * cos1, r1 * sin1, h1 };
-
-			/* first tri */
-			immVertex3fv(pos, v1);
-			immVertex3fv(pos, v2);
-			immVertex3fv(pos, v3);
-
-			/* second tri */
-			immVertex3fv(pos, v3);
-			immVertex3fv(pos, v4);
-			immVertex3fv(pos, v1);
-		}
-	}
-	immEnd();
-}
-
 float glaGetOneFloat(int param)
 {
 	GLfloat v;
@@ -337,6 +352,274 @@ static int get_cached_work_texture(int *r_w, int *r_h)
 	return texid;
 }
 
+#if 0 /* Obsolete / unused */
+/* DEPRECATED: use immDrawPixelsTexScaled_clipping instead */
+void glaDrawPixelsTexScaled_clipping(float x, float y, int img_w, int img_h,
+                                     int format, int type, int zoomfilter, void *rect,
+                                     float scaleX, float scaleY,
+                                     float clip_min_x, float clip_min_y,
+                                     float clip_max_x, float clip_max_y)
+{
+	unsigned char *uc_rect = (unsigned char *) rect;
+	const float *f_rect = (float *)rect;
+	float xzoom = glaGetOneFloat(GL_ZOOM_X), yzoom = glaGetOneFloat(GL_ZOOM_Y);
+	int subpart_x, subpart_y, tex_w, tex_h;
+	int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y;
+	int texid = get_cached_work_texture(&tex_w, &tex_h);
+	int components;
+	const bool use_clipping = ((clip_min_x < clip_max_x) && (clip_min_y < clip_max_y));
+
+	/* Specify the color outside this function, and tex will modulate it.
+	 * This is useful for changing alpha without using glPixelTransferf()
+	 */
+	glPixelStorei(GL_UNPACK_ROW_LENGTH, img_w);
+	glBindTexture(GL_TEXTURE_2D, texid);
+
+	/* don't want nasty bor

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list