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:
authorKent Mein <mein@cs.umn.edu>2006-11-09 18:45:19 +0300
committerKent Mein <mein@cs.umn.edu>2006-11-09 18:45:19 +0300
commitd1285dc756711b6dccb30a30df661376fe513bee (patch)
tree981c646e894b8b77e6001becb88435e41358d9a8 /source/blender
parent56a12a30c5fa3699b66a3f6e92781c373b5403a0 (diff)
This is really two commits but the first one is very small and affects one
file I modified for the other patch. So I'm being bad and combining them together. First one is added -lXi to LLIBS for solaris. (Makes it so it compiles again with the tablet stuff added) Second one is the real commit its an expansion of patch #4458 This adds optional ICONV lining to support international fonts in the file selector. Thanks to wisit venita (dripstone) I mostly just cleaned it up a little and made it optional via defines. Its currently turned off for all platforms except for solaris on scons. For scons see your config/(platform).py file look for WITH_BF_ICONV For the Makefiles look at source/nan_definitions.mk look for WITH_ICONV (basically you'll want to export WITH_ICONV=true and possibly set some other stuff) Let me know if there are any problems. Kent -- mein@cs.umn.edu
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/src/Makefile5
-rw-r--r--source/blender/src/SConscript4
-rw-r--r--source/blender/src/filesel.c36
-rw-r--r--source/blender/src/interface_draw.c2
4 files changed, 46 insertions, 1 deletions
diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile
index fd92c412736..cb6c1954812 100644
--- a/source/blender/src/Makefile
+++ b/source/blender/src/Makefile
@@ -110,6 +110,11 @@ ifeq ($(WITH_QUICKTIME),true)
CPPFLAGS += -DWITH_QUICKTIME
endif
+ifeq ($(WITH_ICONV), true)
+ CPPFLAGS += -DWITH_ICONV
+ CPPFLAGS += $(NAN_ICONV_INC)
+endif
+
ifeq ($(WITH_FFMPEG),true)
CPPFLAGS += -DWITH_FFMPEG
CPPFLAGS += $(NAN_FFMPEGCFLAGS)
diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript
index 37522eb171c..a90f36e1974 100644
--- a/source/blender/src/SConscript
+++ b/source/blender/src/SConscript
@@ -35,6 +35,10 @@ if env['WITH_BF_QUICKTIME']==1:
incs += ' ' + env['BF_QUICKTIME_INC']
defs.append('WITH_QUICKTIME')
+if env['WITH_BF_ICONV'] == 1:
+ incs += ' ' + env['BF_ICONV_INC']
+ defs.append('WITH_ICONV')
+
if env['WITH_BF_FFMPEG'] == 1:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 86e8cdfdc81..cba0ceb6818 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -92,6 +92,7 @@
#include "BIF_space.h"
#include "BIF_screen.h"
#include "BIF_resources.h"
+#include "BIF_language.h"
#include "BLO_readfile.h"
@@ -108,6 +109,10 @@
#include "BIF_fsmenu.h" /* include ourselves */
+#if defined WITH_ICONV
+ #include "iconv.h"
+#endif
+
#if defined WIN32 || defined __BeOS
int fnmatch(const char *pattern, const char *string, int flags)
{
@@ -139,6 +144,7 @@ static void library_to_filelist(SpaceFile *sfile);
static void filesel_select_objects(struct SpaceFile *sfile);
static void active_file_object(struct SpaceFile *sfile);
static int groupname_to_code(char *group);
+static void string_to_utf8(char *original, char *utf_8);
extern void countall(void);
@@ -881,6 +887,7 @@ static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
{
int boxcol=0;
char *s;
+ char utf_8[512];
boxcol= files->flags & (HILITE + ACTIVE);
@@ -924,7 +931,12 @@ static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y)
s = files->string;
if(s) {
glRasterPos2i(x, y);
+#ifdef WITH_ICONV
+ string_to_utf8(files->relname, utf_8);
+ BIF_DrawString(G.font, utf_8, (U.transopts & USER_TR_MENUS));
+#else
BMF_DrawString(G.font, files->relname);
+#endif
x += sfile->maxnamelen + 100;
@@ -1087,6 +1099,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
short mval[2];
char name[20];
char *menu;
+ char utf_8[512];
myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
@@ -1158,6 +1171,29 @@ void drawfilespace(ScrArea *sa, void *spacedata)
sa->win_swap= WIN_BACK_OK;
}
+#ifdef WITH_ICONV
+static void string_to_utf8(char *original, char *utf_8) {
+ size_t inbytesleft=strlen(original);
+ size_t outbytesleft=512;
+ size_t rv=0;
+ iconv_t cd;
+
+ cd=iconv_open("UTF-8", "gb2312");
+ 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
+
static void do_filescroll(SpaceFile *sfile)
{
short mval[2], oldy, yo;
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index 84336b2d293..58ca38ec30c 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -1565,7 +1565,7 @@ static void ui_draw_text_icon(uiBut *but)
if(but->type==LABEL && but->min!=0.0) BIF_ThemeColor(TH_BUT_TEXT_HI);
ui_rasterpos_safe(x, (but->y1+but->y2- 9.0)/2.0, but->aspect);
- if(but->type==TEX || but->type==IDPOIN) transopts= 0; // no translation, of course!
+ if(but->type==IDPOIN) transopts= 0; // no translation, of course!
else transopts= (U.transopts & USER_TR_BUTTONS);
BIF_DrawString(but->font, but->drawstr+but->ofs, transopts);