[Bf-blender-cvs] [fb80477] blender2.8: Revert "OpenGL: draw lamp objects with new imm mode"

Mike Erwin noreply at git.blender.org
Thu Oct 20 21:16:43 CEST 2016


Commit: fb80477ee1b831f166aa4b87bd164213c98b60a4
Author: Mike Erwin
Date:   Thu Oct 20 15:13:02 2016 -0400
Branches: blender2.8
https://developer.blender.org/rBfb80477ee1b831f166aa4b87bd164213c98b60a4

Revert "OpenGL: draw lamp objects with new imm mode"

This reverts commit 7a0377e22ba8e5d3a79e76699b00743e0eca757e.

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

A	source/blender/editors/space_file/CMakeLists.txt
A	source/blender/editors/space_file/file_draw.c
A	source/blender/editors/space_file/file_intern.h
A	source/blender/editors/space_file/file_ops.c
A	source/blender/editors/space_file/file_panels.c
A	source/blender/editors/space_file/file_utils.c
A	source/blender/editors/space_file/filelist.c
A	source/blender/editors/space_file/filelist.h
A	source/blender/editors/space_file/filesel.c
A	source/blender/editors/space_file/fsmenu.c
A	source/blender/editors/space_file/fsmenu.h
A	source/blender/editors/space_file/space_file.c
A	source/blender/editors/space_graph/CMakeLists.txt
A	source/blender/editors/space_graph/graph_buttons.c
A	source/blender/editors/space_graph/graph_draw.c
A	source/blender/editors/space_graph/graph_edit.c
A	source/blender/editors/space_graph/graph_intern.h
A	source/blender/editors/space_graph/graph_ops.c
A	source/blender/editors/space_graph/graph_select.c
A	source/blender/editors/space_graph/graph_utils.c
A	source/blender/editors/space_graph/space_graph.c
A	source/blender/editors/space_image/CMakeLists.txt
A	source/blender/editors/space_image/image_buttons.c
A	source/blender/editors/space_image/image_draw.c
A	source/blender/editors/space_image/image_edit.c
A	source/blender/editors/space_image/image_intern.h
A	source/blender/editors/space_image/image_ops.c
A	source/blender/editors/space_image/space_image.c
A	source/blender/editors/space_info/CMakeLists.txt
A	source/blender/editors/space_info/info_draw.c
A	source/blender/editors/space_info/info_intern.h
A	source/blender/editors/space_info/info_ops.c
A	source/blender/editors/space_info/info_report.c
A	source/blender/editors/space_info/info_stats.c
A	source/blender/editors/space_info/space_info.c
A	source/blender/editors/space_info/textview.c
A	source/blender/editors/space_info/textview.h
A	source/blender/editors/space_logic/CMakeLists.txt
A	source/blender/editors/space_logic/logic_buttons.c
A	source/blender/editors/space_logic/logic_intern.h
A	source/blender/editors/space_logic/logic_ops.c
A	source/blender/editors/space_logic/logic_window.c
A	source/blender/editors/space_logic/space_logic.c
A	source/blender/editors/space_nla/CMakeLists.txt
A	source/blender/editors/space_nla/nla_buttons.c
A	source/blender/editors/space_nla/nla_channels.c
A	source/blender/editors/space_nla/nla_draw.c
A	source/blender/editors/space_nla/nla_edit.c
A	source/blender/editors/space_nla/nla_intern.h
A	source/blender/editors/space_nla/nla_ops.c
A	source/blender/editors/space_nla/nla_select.c
A	source/blender/editors/space_nla/space_nla.c
A	source/blender/editors/space_node/CMakeLists.txt
A	source/blender/editors/space_node/drawnode.c
A	source/blender/editors/space_node/node_add.c
A	source/blender/editors/space_node/node_buttons.c
A	source/blender/editors/space_node/node_draw.c
A	source/blender/editors/space_node/node_edit.c
A	source/blender/editors/space_node/node_group.c
A	source/blender/editors/space_node/node_intern.h
A	source/blender/editors/space_node/node_ops.c
A	source/blender/editors/space_node/node_relationships.c
A	source/blender/editors/space_node/node_select.c
A	source/blender/editors/space_node/node_templates.c
A	source/blender/editors/space_node/node_toolbar.c
A	source/blender/editors/space_node/node_view.c
A	source/blender/editors/space_node/space_node.c
A	source/blender/editors/space_outliner/CMakeLists.txt
A	source/blender/editors/space_outliner/outliner_draw.c
A	source/blender/editors/space_outliner/outliner_edit.c
A	source/blender/editors/space_outliner/outliner_intern.h
A	source/blender/editors/space_outliner/outliner_ops.c
A	source/blender/editors/space_outliner/outliner_select.c
A	source/blender/editors/space_outliner/outliner_tools.c
A	source/blender/editors/space_outliner/outliner_tree.c
A	source/blender/editors/space_outliner/space_outliner.c
A	source/blender/editors/space_script/CMakeLists.txt
A	source/blender/editors/space_script/script_edit.c
A	source/blender/editors/space_script/script_intern.h
A	source/blender/editors/space_script/script_ops.c
A	source/blender/editors/space_script/space_script.c
A	source/blender/editors/space_sequencer/CMakeLists.txt
A	source/blender/editors/space_sequencer/sequencer_add.c
A	source/blender/editors/space_sequencer/sequencer_buttons.c
A	source/blender/editors/space_sequencer/sequencer_draw.c
A	source/blender/editors/space_sequencer/sequencer_edit.c
A	source/blender/editors/space_sequencer/sequencer_intern.h
A	source/blender/editors/space_sequencer/sequencer_modifier.c
A	source/blender/editors/space_sequencer/sequencer_ops.c
A	source/blender/editors/space_sequencer/sequencer_preview.c
A	source/blender/editors/space_sequencer/sequencer_scopes.c
A	source/blender/editors/space_sequencer/sequencer_select.c
A	source/blender/editors/space_sequencer/sequencer_view.c
A	source/blender/editors/space_sequencer/space_sequencer.c
A	source/blender/editors/space_text/CMakeLists.txt
A	source/blender/editors/space_text/space_text.c
A	source/blender/editors/space_text/text_autocomplete.c
A	source/blender/editors/space_text/text_draw.c
A	source/blender/editors/space_text/text_format.c
A	source/blender/editors/space_text/text_format.h
A	source/blender/editors/space_text/text_format_lua.c
A	source/blender/editors/space_text/text_format_osl.c
A	source/blender/editors/space_text/text_format_py.c
A	source/blender/editors/space_text/text_header.c
A	source/blender/editors/space_text/text_intern.h
A	source/blender/editors/space_text/text_ops.c
A	source/blender/editors/space_time/CMakeLists.txt
A	source/blender/editors/space_time/space_time.c
A	source/blender/editors/space_time/time_intern.h
A	source/blender/editors/space_time/time_ops.c
A	source/blender/editors/space_userpref/CMakeLists.txt
A	source/blender/editors/space_userpref/space_userpref.c
A	source/blender/editors/space_userpref/userpref_intern.h
A	source/blender/editors/space_userpref/userpref_ops.c
A	source/blender/editors/space_view3d/CMakeLists.txt
A	source/blender/editors/space_view3d/drawanimviz.c
A	source/blender/editors/space_view3d/drawarmature.c
A	source/blender/editors/space_view3d/drawmesh.c
A	source/blender/editors/space_view3d/drawobject.c
A	source/blender/editors/space_view3d/drawsimdebug.c
A	source/blender/editors/space_view3d/drawvolume.c
A	source/blender/editors/space_view3d/space_view3d.c
A	source/blender/editors/space_view3d/view3d_buttons.c
A	source/blender/editors/space_view3d/view3d_camera_control.c
A	source/blender/editors/space_view3d/view3d_draw.c
A	source/blender/editors/space_view3d/view3d_draw_legacy.c
A	source/blender/editors/space_view3d/view3d_edit.c
A	source/blender/editors/space_view3d/view3d_fly.c
A	source/blender/editors/space_view3d/view3d_header.c
A	source/blender/editors/space_view3d/view3d_intern.h
A	source/blender/editors/space_view3d/view3d_iterators.c
A	source/blender/editors/space_view3d/view3d_ops.c
A	source/blender/editors/space_view3d/view3d_project.c
A	source/blender/editors/space_view3d/view3d_ruler.c
A	source/blender/editors/space_view3d/view3d_select.c
A	source/blender/editors/space_view3d/view3d_snap.c
A	source/blender/editors/space_view3d/view3d_toolbar.c
A	source/blender/editors/space_view3d/view3d_view.c
A	source/blender/editors/space_view3d/view3d_walk.c
A	source/blender/editors/transform/CMakeLists.txt
A	source/blender/editors/transform/transform.c
A	source/blender/editors/transform/transform.h
A	source/blender/editors/transform/transform_constraints.c
A	source/blender/editors/transform/transform_conversions.c
A	source/blender/editors/transform/transform_generics.c
A	source/blender/editors/transform/transform_input.c
A	source/blender/editors/transform/transform_manipulator.c
A	source/blender/editors/transform/transform_ops.c
A	source/blender/editors/transform/transform_orientations.c
A	source/blender/editors/transform/transform_snap.c
A	source/blender/editors/transform/transform_snap_object.c
A	source/blender/physics/BPH_mass_spring.h
A	source/blender/physics/CMakeLists.txt
A	source/blender/physics/intern/BPH_mass_spring.cpp
A	source/blender/physics/intern/ConstrainedConjugateGradient.h
A	source/blender/physics/intern/eigen_utils.h
A	source/blender/physics/intern/hair_volume.cpp
A	source/blender/physics/intern/implicit.h
A	source/blender/physics/intern/implicit_blender.c
A	source/blender/physics/intern/implicit_eigen.cpp

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

diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt
new file mode 100644
index 0000000..fd701a8
--- /dev/null
+++ b/source/blender/editors/space_file/CMakeLists.txt
@@ -0,0 +1,100 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+	../include
+	../../blenfont
+	../../blenkernel
+	../../blenlib
+	../../blenloader
+	../../blentranslation
+	../../imbuf
+	../../gpu
+	../../makesdna
+	../../makesrna
+	../../render/extern/include
+	../../windowmanager
+	../../../../intern/atomic
+	../../../../intern/guardedalloc
+	../../../../intern/glew-mx
+)
+
+set(INC_SYS
+	${GLEW_INCLUDE_PATH}
+)
+
+set(SRC
+	file_draw.c
+	file_ops.c
+	file_panels.c
+	file_utils.c
+	filelist.c
+	filesel.c
+	fsmenu.c
+	space_file.c
+
+	file_intern.h
+	filelist.h
+	fsmenu.h
+)
+
+if(WITH_HEADLESS)
+	add_definitions(-DWITH_HEADLESS)
+endif()
+
+if(WITH_IMAGE_OPENEXR)
+	add_definitions(-DWITH_OPENEXR)
+endif()
+
+if(WITH_OPENIMAGEIO)
+	add_definitions(-DWITH_OPENIMAGEIO)
+endif()
+
+if(WITH_IMAGE_TIFF)
+	add_definitions(-DWITH_TIFF)
+endif()
+
+if(WITH_IMAGE_OPENJPEG)
+	add_definitions(-DWITH_OPENJPEG)
+endif()
+
+if(WITH_IMAGE_DDS)
+	add_definitions(-DWITH_DDS)
+endif()
+
+if(WITH_IMAGE_CINEON)
+	add_definitions(-DWITH_CINEON)
+endif()
+
+if(WITH_IMAGE_HDR)
+	add_definitions(-DWITH_HDR)
+endif()
+
+if(WITH_INTERNATIONAL)
+	add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
+add_definitions(${GL_DEFINITIONS})
+
+if(WITH_FREESTYLE)
+	add_definitions(-DWITH_FREESTYLE)
+endif()
+
+blender_add_lib(bf_editor_space_file "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
new file mode 100644
index 0000000..925efec
--- /dev/null
+++ b/source/blender/editors/space_file/file_draw.c
@@ -0,0 +1,724 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/editors/space_file/file_draw.c
+ *  \ingroup spfile
+ */
+
+
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+
+#include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
+#include "BLI_fileops_types.h"
+#include "BLI_math.h"
+
+#ifdef WIN32
+#  include "BLI_winstuff.h"
+#endif
+
+#include "BIF_gl.h"
+#include "BIF_glutil.h"
+
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_main.h"
+
+#include "BLO_readfile.h"
+
+#include "BLT_translation.h"
+
+#include "IMB_imbuf_types.h"
+
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "RNA_access.h"
+
+#include "ED_fileselect.h"
+#include "ED_screen.h"
+
+#include "UI_interface.h"
+#include "UI_interface_icons.h"
+#include "UI_resources.h"
+#include "UI_view2d.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+//#include "GPU_draw.h"
+//#include "GPU_basic_shader.h"
+#include "GPU_immediate.h"
+
+#include "filelist.h"
+
+#include "file_intern.h"    // own include
+
+/* Dummy helper - we need dynamic tooltips here. */
+static char *file_draw_tooltip_func(bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
+{
+	char *dyn_tooltip = argN;
+	return BLI_strdup(dyn_tooltip);
+}
+
+/* Note: This function uses pixelspace (0, 0, winx, winy), not view2d. 
+ * The controls are laid out as follows:
+ *
+ * -------------------------------------------
+ * | Directory input               | execute |
+ * -------------------------------------------
+ * | Filename input        | + | - | cancel  |
+ * -------------------------------------------
+ *
+ * The input widgets will stretch to fill any excess space.
+ * When there isn't enough space for all controls to be shown, they are
+ * hidden in this order: x/-, execute/cancel, input widgets.
+ */
+void file_draw_buttons(const bContext *C, ARegion *ar)
+{
+	/* Button layout. */
+	const int max_x      = ar->winx - 10;
+	const int line1_y    = ar->winy - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
+	const int line2_y    = line1_y - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
+	const int input_minw = 20;
+	const int btn_h      = UI_UNIT_Y;
+	const int btn_fn_w   = UI_UNIT_X;
+	const int btn_minw   = 80;
+	const int btn_margin = 20;
+	const int separator  = 4;
+
+	/* Additional locals. */
+	char uiblockstr[32];
+	int loadbutton;
+	int fnumbuttons;
+	int min_x       = 10;
+	int chan_offs   = 0;
+	int available_w = max_x - min_x;
+	int line1_w     = available_w;
+	int line2_w     = available_w;
+	
+	uiBut *but;
+	uiBlock *block;
+	SpaceFile *sfile  = CTX_wm_space_file(C);
+	FileSelectParams *params = ED_fileselect_get_params(sfile);
+	ARegion *artmp;
+	const bool is_browse_only = (sfile->op == NULL);
+	
+	/* Initialize UI block. */
+	BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar);
+	block = UI_block_begin(C, ar, uiblockstr, UI_EMBOSS);
+
+	/* exception to make space for collapsed region icon */
+	for (artmp = CTX_wm_area(C)->regionbase.first; artmp; artmp = artmp->next) {
+		if (artmp->regiontype == RGN_TYPE_TOOLS && artmp->flag & RGN_FLAG_HIDDEN) {
+			chan_offs = 16;
+			min_x += chan_offs;
+			available_w -= chan_offs;
+		}
+	}
+
+	/* Is there enough space for the execute / cancel buttons? */
+
+
+	if (is_browse_only) {
+		loadbutton = 0;
+	}
+	else {
+		const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
+		loadbutton = UI_fontstyle_string_width(fstyle, params->title) + btn_margin;
+		CLAMP_MIN(loadbutton, btn_minw);
+		if (available_w <= loadbutton + separator + input_minw) {
+			loadbutton = 0;
+		}
+	}
+
+	if (loadbutton) {
+		line1_w -= (loadbutton + separator);
+		line2_w  = line1_w;
+	}
+
+	/* Is there enough space for file number increment/decrement buttons? */
+	fnumbuttons = 2 * btn_fn_w;
+	if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
+		fnumbuttons = 0;
+	}
+	else {
+		line2_w -= (fnumbuttons + separator);
+	}
+
+	/* Text input fields for directory and file. */
+	if (available_w > 0) {
+		const struct FileDirEntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL;
+		int overwrite_alert = file_draw_check_exists(sfile);
+		const bool is_active_dir = file && (file->typeflag & FILE_TYPE_FOLDER);
+
+		/* callbacks for operator check functions */
+		UI_block_func_set(block, file_draw_check_cb, NULL, NULL);
+
+		but = uiDefBut(block, UI_BTYPE_TEXT, -1, "",
+		               min_x, line1_y, line1_w - chan_offs, btn_h,
+		               params->dir, 0.0, (float)FILE_MAX, 0, 0,
+		               TIP_("File path"));
+		UI_but_func_complete_set(but, autocomplete_directory, NULL);
+		UI_but_flag_enable(but, UI_BUT_NO_UTF8);
+		UI_but_flag_disable(but, UI_BUT_UNDO);
+		UI_but_funcN_set(but, file_directory_enter_handle, NULL, but);
+
+		/* TODO, directory editing is non-functional while a library is loaded
+		 * until this is properly supported just disable it. */
+		if (sfile->files && filelist_lib(sfile->files))
+			UI_but_flag_enable(but, UI_BUT_DISABLED);
+
+		if ((params->flag & FILE_DIRSEL_ONLY) == 0) {
+			but = uiDefBut(block, UI_BTYPE_TEXT, -1, "",
+			               min_x, line2_y, line2_w - chan_offs, btn_h,
+			               is_active_dir ? (char *)"" : params->file,
+			               0.0, (float)FILE_MAXFILE, 0, 0,
+			               TIP_(overwrite_alert ? N_("File name, overwrite existing") : N_("File name")));
+			UI_but_func_complete_set(but, autocomplete_file, NULL);
+			UI_but_flag_enable(but, UI_BUT_NO_UTF8);
+			UI_but_flag_disable(but, UI_BUT_UNDO);
+			/* silly workaround calling NFunc to ensure this does not get called
+			 * immediate ui_apply_but_func but only after button deactivates */
+			UI_but_funcN_set(but, file_filename_enter_handle, NULL, but);
+
+			/* check if this overrides a file and if the operator option is used */
+			if (overwrite_alert) {
+				UI_but_flag_enable(but, UI_BUT_REDALERT);
+			}
+		}
+		
+		/* clear func */
+		UI_block_func_set(block, NULL, NULL, NULL);
+	}
+	
+	/* Filename number increment / decrement buttons. */
+	if (fnumbuttons && (params->flag & FILE_DIRSEL_ONLY) == 0) {
+		UI_block_align_begin(block);
+		but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT,
+		                    min_x + line2_w + separator - chan_offs, line2_y,
+		                    btn_fn_w, btn_h,
+		                    TIP_("Decrement the filename number"));
+		RNA_int_set(UI_but_operator_ptr_get(but), "increment", -1);
+
+		but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN,
+		                    min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y,
+		                    btn_fn_w, btn_h,
+		       

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list