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:
authorAndrea Weikert <elubie@gmx.net>2007-09-02 21:25:03 +0400
committerAndrea Weikert <elubie@gmx.net>2007-09-02 21:25:03 +0400
commit356ab943736e8a2434a8ff5845873482597ba5e2 (patch)
tree910356ace904dc4f11f1daf15330bb0827934f5b /source/blender/blenlib
parent22c23fb04f7f1297b971f03d69b8b04b7dd9caa4 (diff)
== imagebrowser ==
Initial commit of imagebrowser in trunk. BIG COMMIT! Main changes: * completely reworked imasel space * creation and storage of the preview images for materials, textures, world and lamp * thumbnails of images and movie files when browsing in the file system * loading previews from external .blend when linking or appending * thumbnail caching according to the Thumbnail Managing Standard: http://jens.triq.net/thumbnail-spec/ * for now just kept imasel access mostly as old imgbrowser (CTRL+F4, CTRL+F1) a bit hidden still. * filtering of file types (images, movies, .blend, py,...) * preliminary managing of bookmarks ('B' button to add, XKEY while bookmark active to delete) More detailed info which will be updated here: http://wiki.blender.org/index.php/User:Elubie/PreviewImageBrowser Places that need special review (and probably fixes): * BLO_blendhandle_get_previews in readblenentry * readfile.c: do_version and refactorings of do_library_append * UI integration TODO and known issues still: * Accented characters do not display correctly with international fonts * Crash was reported when browsing in directory with movie files * Bookmark management still needs some UI work (second scrollbar?), feedback here is welcome! Credits: Samir Bharadwaj (samirbharadwaj@yahoo.com) for the icon images. Many thanks to everyone who gave feedback and helped so far!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_blenlib.h5
-rw-r--r--source/blender/blenlib/BLI_storage_types.h3
-rw-r--r--source/blender/blenlib/intern/util.c32
3 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index 6e51d171461..aaa50206ddb 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -217,6 +217,11 @@ int BLI_streq(char *a, char *b);
*/
int BLI_strcaseeq(char *a, char *b);
+/* in util.c */
+#ifdef WITH_ICONV
+void BLI_string_to_utf8(char *original, char *utf_8, char *code);
+#endif
+
/**
* Read a file as ASCII lines. An empty list is
* returned if the file cannot be opened or read.
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h
index 825a8bc9cbd..ebce33852a1 100644
--- a/source/blender/blenlib/BLI_storage_types.h
+++ b/source/blender/blenlib/BLI_storage_types.h
@@ -52,6 +52,8 @@ struct header{
typedef unsigned int mode_t;
#endif
+struct ImBuf;
+
struct direntry{
char *string;
mode_t type;
@@ -68,6 +70,7 @@ struct direntry{
char extra[16];
void *poin;
int nr;
+ struct ImBuf *image;
};
struct dirlink
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index cfce8e3dafa..2a47dcc300b 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -1491,6 +1491,38 @@ int BLI_strncasecmp(const char *s1, const char *s2, int n) {
return 0;
}
+
+#ifdef WITH_ICONV
+#include "iconv.h"
+#include "localcharset.h"
+
+void BLI_string_to_utf8(char *original, char *utf_8, char *code)
+{
+ size_t inbytesleft=strlen(original);
+ size_t outbytesleft=512;
+ size_t rv=0;
+ iconv_t cd;
+
+ if (NULL == code) {
+ code = locale_charset();
+ }
+ cd=iconv_open("UTF-8", code);
+
+ if (cd == (iconv_t)(-1)) {
+ printf("iconv_open Error");
+ *utf_8='\0';
+ return ;
+ }
+ rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft);
+ if (rv == (size_t) -1) {
+ printf("iconv Error\n");
+ return ;
+ }
+ *utf_8 = '\0';
+ iconv_close(cd);
+}
+#endif // WITH_ICONV
+
void BLI_timestr(double time, char *str)
{
/* format 00:00:00.00 (hr:min:sec) string has to be 12 long */