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
This commit is contained in:
Kent Mein
2006-11-09 15:45:19 +00:00
parent 56a12a30c5
commit d1285dc756
12 changed files with 93 additions and 2 deletions

View File

@@ -109,6 +109,12 @@ BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = 'true' # -DWITH_QUICKTIME
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = 'true'
BF_OPENGL_LIB = 'GL GLU'

View File

@@ -103,6 +103,12 @@ WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
BF_QUICKTIME = '/usr/local'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# enable ffmpeg support
WITH_BF_FFMPEG = 'false' # -DWITH_FFMPEG
BF_FFMPEG = '/usr'

View File

@@ -98,6 +98,12 @@ WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
BF_QUICKTIME = '/usr/local'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = 'false'
BF_OPENGL = 'C:\\MingW'

View File

@@ -103,6 +103,12 @@ BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = 'true'
BF_OPENGL = '/usr/X11R6'

View File

@@ -107,6 +107,12 @@ WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
BF_QUICKTIME = '/usr/local'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
WITH_BF_ICONV = 'true'
BF_ICONV = "/usr"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# enable ffmpeg support
WITH_BF_FFMPEG = 'false' # -DWITH_FFMPEG
BF_FFMPEG = '/usr/local'

View File

@@ -120,6 +120,12 @@ WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
BF_QUICKTIME = '/usr/local'
BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = 'false'
BF_OPENGL = 'C:\\MingW'

View File

@@ -123,6 +123,12 @@ BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
BF_QUICKTIME_LIB = 'qtmlClient'
BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
WITH_BF_ICONV = 'false'
BF_ICONV = LIBDIR + "/iconv"
BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_STATICOPENGL = 'false'
BF_OPENGL_INC = '${BF_OPENGL}/include'
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'

View File

@@ -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)

View File

@@ -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']

View File

@@ -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;

View File

@@ -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);

View File

@@ -118,7 +118,7 @@ ifeq ($(OS),openbsd)
endif
ifeq ($(OS),solaris)
LLIBS = -lGLU -lGL -lXmu -lXext -lX11 -lc -lm -ldl -lsocket -lnsl
LLIBS = -lGLU -lGL -lXmu -lXext -lXi -lX11 -lc -lm -ldl -lsocket -lnsl
DYNLDFLAGS = -shared $(LDFLAGS)
endif
@@ -155,6 +155,10 @@ ifneq ($(OS), irix)
LLIBS += $(NAN_SDLLIBS)
endif
ifeq ($(WITH_ICONV),true)
LLIBS += $(NAN_ICONV_LIBS)
endif
ifeq ($(WITH_FFMPEG),true)
LLIBS += $(NAN_FFMPEGLIBS)
endif