[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49822] branches/asset-browser/source: == assetbrowser ==
Andrea Weikert
elubie at gmx.net
Sat Aug 11 22:05:27 CEST 2012
Revision: 49822
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49822
Author: elubie
Date: 2012-08-11 20:05:26 +0000 (Sat, 11 Aug 2012)
Log Message:
-----------
== assetbrowser ==
WIP commit
* adapted drawing code from file browser and made it more general so we can use the same code in the file browser as well for drawing and some operators.
* drawing the assets works, but the operators are not integrated yet, so no selection yet etc...
* likely some memory management issues still
* Scons build is untested.
Modified Paths:
--------------
branches/asset-browser/source/blender/blenkernel/BKE_assets.h
branches/asset-browser/source/blender/editors/CMakeLists.txt
branches/asset-browser/source/blender/editors/SConscript
branches/asset-browser/source/blender/editors/interface/resources.c
branches/asset-browser/source/blender/editors/space_asset/CMakeLists.txt
branches/asset-browser/source/blender/editors/space_asset/SConscript
branches/asset-browser/source/blender/editors/space_asset/space_asset.c
branches/asset-browser/source/creator/CMakeLists.txt
Added Paths:
-----------
branches/asset-browser/source/blender/editors/listview/
branches/asset-browser/source/blender/editors/listview/CMakeLists.txt
branches/asset-browser/source/blender/editors/listview/contentlist.c
branches/asset-browser/source/blender/editors/listview/contentlist.h
branches/asset-browser/source/blender/editors/listview/contentlist_intern.h
branches/asset-browser/source/blender/editors/listview/listview_draw.c
branches/asset-browser/source/blender/editors/listview/listview_draw.h
branches/asset-browser/source/blender/editors/listview/listview_layout.c
branches/asset-browser/source/blender/editors/listview/listview_layout.h
branches/asset-browser/source/blender/editors/listview/listview_ops.c
branches/asset-browser/source/blender/editors/listview/listview_ops.h
Modified: branches/asset-browser/source/blender/blenkernel/BKE_assets.h
===================================================================
--- branches/asset-browser/source/blender/blenkernel/BKE_assets.h 2012-08-11 18:58:30 UTC (rev 49821)
+++ branches/asset-browser/source/blender/blenkernel/BKE_assets.h 2012-08-11 20:05:26 UTC (rev 49822)
@@ -50,5 +50,4 @@
struct bAssetDir* BKE_asset_dir_add(struct bAssetCollection *collection);
void BKE_asset_dir_remove(struct bAssetCollection *collection, struct bAssetDir *dir);
-
#endif
Modified: branches/asset-browser/source/blender/editors/CMakeLists.txt
===================================================================
--- branches/asset-browser/source/blender/editors/CMakeLists.txt 2012-08-11 18:58:30 UTC (rev 49821)
+++ branches/asset-browser/source/blender/editors/CMakeLists.txt 2012-08-11 20:05:26 UTC (rev 49822)
@@ -25,6 +25,7 @@
add_subdirectory(gpencil)
add_subdirectory(interface)
add_subdirectory(io)
+ add_subdirectory(listview)
add_subdirectory(mask)
add_subdirectory(mesh)
add_subdirectory(metaball)
Modified: branches/asset-browser/source/blender/editors/SConscript
===================================================================
--- branches/asset-browser/source/blender/editors/SConscript 2012-08-11 18:58:30 UTC (rev 49821)
+++ branches/asset-browser/source/blender/editors/SConscript 2012-08-11 20:05:26 UTC (rev 49822)
@@ -6,6 +6,7 @@
'space_api/SConscript',
'util/SConscript',
'interface/SConscript',
+ 'listview/SConscript',
'io/SConscript',
'animation/SConscript',
'armature/SConscript',
Modified: branches/asset-browser/source/blender/editors/interface/resources.c
===================================================================
--- branches/asset-browser/source/blender/editors/interface/resources.c 2012-08-11 18:58:30 UTC (rev 49821)
+++ branches/asset-browser/source/blender/editors/interface/resources.c 2012-08-11 20:05:26 UTC (rev 49822)
@@ -156,6 +156,7 @@
break;
case SPACE_ASSET:
ts= &btheme->tasset;
+ break;
default:
ts= &btheme->tv3d;
break;
Property changes on: branches/asset-browser/source/blender/editors/listview
___________________________________________________________________
Added: bugtraq:number
+ true
Added: branches/asset-browser/source/blender/editors/listview/CMakeLists.txt
===================================================================
--- branches/asset-browser/source/blender/editors/listview/CMakeLists.txt (rev 0)
+++ branches/asset-browser/source/blender/editors/listview/CMakeLists.txt 2012-08-11 20:05:26 UTC (rev 49822)
@@ -0,0 +1,83 @@
+# ***** 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): Andrea Weikert.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+ ../include
+ ../../blenfont
+ ../../blenkernel
+ ../../blenlib
+ ../../blenloader
+ ../../imbuf
+ ../../makesdna
+ ../../makesrna
+ ../../windowmanager
+ ../../../../intern/guardedalloc
+)
+
+set(INC_SYS
+ ${GLEW_INCLUDE_PATH}
+)
+
+set(SRC
+ contentlist.c
+ listview_draw.c
+ listview_layout.c
+ listview_ops.c
+
+ contentlist.h
+ contentlist_intern.h
+ listview_draw.h
+ listview_layout.h
+ listview_ops.h
+)
+
+if(WITH_HEADLESS)
+ add_definitions(-DWITH_HEADLESS)
+endif()
+
+if(WITH_IMAGE_OPENEXR)
+ add_definitions(-DWITH_OPENEXR)
+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()
+
+blender_add_lib(bf_editor_listview "${SRC}" "${INC}" "${INC_SYS}")
Property changes on: branches/asset-browser/source/blender/editors/listview/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Added: branches/asset-browser/source/blender/editors/listview/contentlist.c
===================================================================
--- branches/asset-browser/source/blender/editors/listview/contentlist.c (rev 0)
+++ branches/asset-browser/source/blender/editors/listview/contentlist.c 2012-08-11 20:05:26 UTC (rev 49822)
@@ -0,0 +1,344 @@
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Andrea Weikert.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/*
+ * ***** 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) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Andrea Weikert
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/editors/space_file/space_file.c
+ * \ingroup spfile
+ */
+
+#include "MEM_guardedalloc.h"
+#include "MEM_sys_types.h"
+
+#include "BKE_main.h"
+#include "BKE_global.h"
+#include "BKE_utildefines.h"
+
+#include "BLI_listbase.h"
+#include "BLI_string.h"
+
+#include "BLF_api.h"
+
+#include "DNA_space_types.h"
+
+#include "contentlist.h"
+#include "contentlist_intern.h"
+#include "listview_layout.h"
+
+void contentlist_free(struct ContentList *cl)
+{
+ cl->f_free(cl);
+}
+
+int contentlist_empty(struct ContentList *cl)
+{
+ return (cl->entries == NULL);
+}
+
+void contentlist_sort(struct ContentList *cl, int col, short ascending)
+{
+ cl->f_sort(cl, col, ascending);
+ contentlist_filter(cl);
+}
+
+void contentlist_read(struct ContentList *cl, struct bContext *C)
+{
+ cl->f_read(cl, C);
+ contentlist_filter(cl);
+}
+
+int contentlist_num_entries(struct ContentList *cl)
+{
+ return cl->num_entries_filtered;
+}
+
+int contentlist_num_columns(struct ContentList *cl)
+{
+ return cl->f_num_columns(cl);
+}
+
+
+char *contentlist_entry_get_formatted(struct ContentList *cl, int entry, int column)
+{
+ int idx = cl->filter_index[entry];
+ return cl->f_entry_get_formatted(cl, idx, column);
+}
+
+char *contentlist_entry_get_dragpath(struct ContentList *cl, int entry)
+{
+ int idx = cl->filter_index[entry];
+ return cl->f_entry_get_dragpath(cl, idx);
+}
+
+int contentlist_get_entry_icon(ContentList *cl, int entry)
+{
+ int idx = cl->filter_index[entry];
+ return cl->f_entry_get_icon(cl, idx);
+}
+
+int contentlist_entry_is_dir(struct ContentList *cl, int entry)
+{
+ int idx = cl->filter_index[entry];
+ return cl->f_entry_is_dir(cl, idx);
+}
+
+int contentlist_entry_is_regular(struct ContentList *cl, int entry)
+{
+ int idx = cl->filter_index[entry];
+ return cl->f_entry_is_regular(cl, idx);
+}
+
+int contentlist_entry_is_selected(struct ContentList *cl, int entry, ContentListCheckType check)
+{
+ int idx = cl->filter_index[entry];
+ ContentListEntry *le = &cl->entries[idx];
+ if (!le) {
+ return 0;
+ }
+ switch (check) {
+ case CL_CHECK_DIRS:
+ return cl->f_entry_is_dir(cl, idx) && (le->selflag & SELECTED_FILE);
+ case CL_CHECK_FILES:
+ return cl->f_entry_is_regular(cl, idx) && (le->selflag & SELECTED_FILE);
+ case CL_CHECK_ALL:
+ default:
+ return (le->selflag & SELECTED_FILE);
+ }
+}
+
+int contentlist_entry_find(struct ContentList *cl, int col, const char *name)
+{
+ int entry;
+ for (entry = 0; entry < cl->num_entries_filtered; ++entry) {
+ int idx = cl->filter_index[entry];
+ const char *entry_str = cl->f_entry_get_formatted(cl, idx, col);
+ if (BLI_strcaseeq(entry_str, name)) {
+ return entry;
+ }
+ }
+ return -1;
+}
+
+void contentlist_entry_select(struct ContentList *cl, int entry, ContentListSelType select, unsigned int flag, ContentListCheckType check)
+{
+ int index = cl->filter_index[entry];
+ struct ContentListEntry *le = &cl->entries[index];
+
+ if (le != NULL) {
+ int check_ok = 0;
+ switch (check) {
+ case CL_CHECK_DIRS:
+ check_ok = cl->f_entry_is_dir(cl, index);
+ break;
+ case CL_CHECK_ALL:
+ check_ok = 1;
+ break;
+ case CL_CHECK_FILES:
+ default:
+ check_ok = !cl->f_entry_is_dir(cl, index);
+ break;
+ }
+ if (check_ok) {
+ switch (select) {
+ case CL_SEL_REMOVE:
+ le->selflag &= ~flag;
+ if ( (flag & SELECTED_FILE) && (cl->active == index)) cl->active = -1;
+ break;
+ case CL_SEL_ADD:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list