Tue Mar 14 20:23:53 CET 2000

(Saur)

Added patch from Masahiko Mori <masa@cthulhu.engr.sgi.com>
to improve localization support (I modified the patch somewhat).


SVN revision: 2230
This commit is contained in:
Peter Kjellerstedt 2000-03-14 19:27:33 +00:00
parent 13b24955a9
commit f250c01e99
11 changed files with 1120 additions and 1158 deletions

View File

@ -56,3 +56,10 @@ Sun Dec 26 22:54:57 PST 1999
Added patch from Yukihiro Nakai <nakai@internetsolutions.co.jp>
to add setlocale to dox.c
-----------------------------------------------------------------
Tue Mar 14 20:23:53 CET 2000
(Saur)
Added patch from Masahiko Mori <masa@cthulhu.engr.sgi.com>
to improve localization support (I modified the patch somewhat).

View File

@ -12,7 +12,3 @@ EXTRA_SCRIPTS =
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(edocdatadir)
# Japanese
gzip -d -c < $(srcdir)/MAIN-ja | (cd $(DESTDIR)$(edocdatadir); tar -xmf -)
rm -f $(srcdir)/MAIN-ja

View File

@ -194,7 +194,6 @@ main(int argc, char **argv)
int *page_hist = NULL;
int page_hist_len = 1;
int page_hist_pos = 0;
char *lang;
w = 512;
h = 400;
@ -211,8 +210,6 @@ main(int argc, char **argv)
XSetLocaleModifiers("");
setlocale(LC_ALL, NULL);
lang = setlocale(LC_MESSAGES, NULL);
/* I dont want any internationalisation of my numeric input & output */
setlocale(LC_NUMERIC, "C");
@ -260,15 +257,8 @@ main(int argc, char **argv)
docdir = strdup(argv[i]);
}
s = malloc(strlen(docdir) + strlen(docfile) + 2 + 20);
s[0] = '\0';
if ( lang != NULL && lang[0] != '\0' )
{
sprintf(s, "%s/%s.%s", docdir, docfile, lang );
if ( !exists(s) )
s[0] = '\0';
}
if ( !s[0] )
sprintf(s, "%s/%s", docdir, docfile );
findLocalizedFile(s);
#ifndef __EMX__
f = fopen(s, "r");
@ -426,18 +416,8 @@ main(int argc, char **argv)
exe = &(ll->name[6]);
if (exe[0] != '/')
{
char *lang;
tmp[0] = '\0';
lang = setlocale(LC_MESSAGES, NULL);
if ( lang != NULL && lang[0] != '\0' )
{
sprintf(tmp, "%s/%s.%s", docdir, exe, lang);
if ( !exists(tmp) )
tmp[0] = '\0';
}
if ( !tmp[0] )
sprintf(tmp, "%s/%s", docdir, exe);
findLocalizedFile(tmp);
exe = tmp;
}
p = popen(exe, "r");

View File

@ -225,6 +225,7 @@ char *fileof(char *s);
char *fullfileof(char *s);
char *pathtoexec(char *file);
char *pathtofile(char *file);
int findLocalizedFile(char *fname);
void AddPage(Object * obj);
void AddObject(Object * obj);

View File

@ -669,10 +669,10 @@ word_mb(char *s, int num, char *wd, int *spaceflag)
while (s[i])
{
int len, oldflg=0;
int len, oldflg=1;
len = mblen( s + i, strlen( s + i ) );
len = mblen( s + i, MB_CUR_MAX );
if ( len < 0 ) { i++; continue; }
/* Check multibyte character class */
@ -954,3 +954,42 @@ pathtofile(char *file)
}
return (NULL);
}
int
findLocalizedFile(char *fname)
{
#ifndef __EMX__
char *tmp, *lang, *p[3];
int i;
if (!(lang = setlocale(LC_MESSAGES, NULL)))
return 0;
tmp = strdup(fname);
lang = strdup(lang); /* lang may be in static space, thus it must
* be duplicated before we change it below */
p[0] = lang + strlen(lang);
p[1] = strchr(lang, '.');
p[2] = strchr(lang, '_');
for (i = 0; i < 3; i++)
{
if (p[i] == NULL)
continue;
*p[i] = '\0';
sprintf(fname, "%s.%s", tmp, lang);
if (exists(fname))
{
free(tmp);
free(lang);
return 1;
}
}
strcpy(fname, tmp);
free(tmp);
free(lang);
#endif
return 0;
}

View File

@ -544,16 +544,9 @@ RenderPage(Window win, int page_num, int w, int h)
if (pg->background)
{
char tmp[4096];
char *lang = setlocale(LC_MESSAGES, NULL);
tmp[0] = '\0';
if ( lang != NULL && lang[0] != '\0' )
{
sprintf(tmp, "%s/%s.%s", docdir, pg->background, lang);
if ( !exists(tmp) ) tmp[0] = '\0';
}
if ( !tmp[0] )
sprintf(tmp, "%s/%s", docdir, pg->background);
findLocalizedFile(tmp);
im = Imlib_load_image(id, tmp);
if (im)
{
@ -808,7 +801,7 @@ RenderPage(Window win, int page_num, int w, int h)
while (txt_disp[(point + cnt)])
{
len = mblen( txt_disp + point + cnt, strlen(txt_disp) - point - cnt);
len = mblen( txt_disp + point + cnt, MB_CUR_MAX);
if ( len < 0 )
{
cnt++;

View File

@ -72,17 +72,10 @@ TextStateLoadFont(TextState * ts)
ss = strchr(dup, '/');
if (ss)
{
char *lang = setlocale(LC_MESSAGES, NULL);
*ss = ' ';
word(dup, 1, w);
if ( lang != NULL && lang[0] != '\0' )
{
sprintf(s, "%s/%s.%s.ttf", docdir, w, lang);
if ( !exists(s) ) *s = '\0';
}
if ( !*s )
sprintf(s, "%s/%s.ttf", docdir, w);
findLocalizedFile(s);
word(dup, 2, w);
ts->efont = Efont_load(s, atoi(w));
if (ts->efont)

View File

@ -1074,7 +1074,6 @@ ways for you to change what your (Mandrake) message in ChangeLog shows up as,
as well as an easy entry point for you to add your own indent style
(see %names and %indents hashes)
-------------------------------------------------------------------------------
Wed Sep 1 14:40:22 PDT 1999
@ -1088,13 +1087,11 @@ as well as remembers to display the cvs commit as it happens.
Wed Sep 1 16:09:21 PDT 1999
(Raster)
-------------------------------------------------------------------------------
Wed Sep 1 16:09:47 PDT 1999
(Raster)
-------------------------------------------------------------------------------
Wed Sep 1 16:10:02 PDT 1999
@ -1720,8 +1717,6 @@ Added group borders to BrushedMetal, also made the groups be visualized when
they are switched in one of the groups dialogs. Apparently there's a bug
with imageclasses that use transparency, probably an Imlib issue.
-------------------------------------------------------------------------------
Tue Sep 14 10:53:14 PDT 1999
@ -1747,7 +1742,6 @@ Tue Sep 14 15:34:11 EDT 1999
Don't use the fallback border for group borders.
-------------------------------------------------------------------------------
Tue Sep 14 15:54:25 EDT 1999
@ -1757,7 +1751,6 @@ Ooops, the middle button in the titlebar did raise/lower and show/hide
group borders at the same time. Changed show/hide group borders
to shift-middleclick.
-------------------------------------------------------------------------------
Wed Sep 14 18:52:24 EDT 1999
@ -1765,7 +1758,6 @@ Wed Sep 14 18:52:24 EDT 1999
I hope this fixes the segfault that Technoir reported.
-------------------------------------------------------------------------------
Tue Sep 14 17:06:08 PDT 1999
@ -1832,7 +1824,6 @@ Thu Sep 16 16:33:08 EDT 1999
Don't snapshot group borders.
-------------------------------------------------------------------------------
Thu Sep 16 13:59:43 PDT 1999
@ -1895,7 +1886,6 @@ well, it would HELP if I used XA_STRING on those :)
MOST of the taskbar works now.
still have to do updates of title setting KWM_WIN_TITLE.
-------------------------------------------------------------------------------
Thu Sep 16 18:59:43 PDT 1999
@ -1906,7 +1896,6 @@ segfault.
Needs fixing. BIG bug. if you turn "kde off" in your eesh it will fix that,
or if you want kde support only use desktop 0 for now. 'nuff said.
-------------------------------------------------------------------------------
Fri Sep 17 08:57:02 PDT 1999
@ -2019,7 +2008,6 @@ minor fix that should keep kpanel win_add's from duplicating on map.
(hopefully) - this fixes the desktop change window duplication bugs, too. I
might have some stacking issues to deal with.
-------------------------------------------------------------------------------
Mon Sep 20 11:53:55 PDT 1999
@ -2054,7 +2042,6 @@ added important TODO item for kde support :
mandrake: um, don't use close from the kpanel menu right yet. that's a bad idea. in fact, I wouldn't use ANY of the kpanel windowops things yet. (nasty)
-------------------------------------------------------------------------------
Mon Sep 20 15:20:56 PDT 1999
@ -2078,7 +2065,6 @@ menu.
Added some group issues to TODO file. I hope I get to finish that
during this week.
-------------------------------------------------------------------------------
Mon Sep 20 19:41:17 PDT 1999
@ -2121,7 +2107,6 @@ weren't reset after closing some dialogs.
Tweaked the user name mapping in ecvs so that it works on my
lappy :)
-------------------------------------------------------------------------------
Tue Sep 21 17:06:31 EST 1999
@ -2189,7 +2174,6 @@ the remember dialog not coming up bug.. fixed.. :)
(shoudl restart correctly, exit correcttly, restart anotherwm correctly and
restart themes correctly)
-------------------------------------------------------------------------------
Wed Sep 22 13:39:22 PDT 1999
@ -2269,7 +2253,6 @@ multiple desktops and via the titlebar or the menu,
so group effects are limited to the current desktop
for now.
-------------------------------------------------------------------------------
Thu Sep 23 14:40:50 PDT 1999
@ -2367,7 +2350,6 @@ Fri Sep 24 16:43:48 EST 1999
Grrr. Added more bugs.
-------------------------------------------------------------------------------
Sat Sep 25 13:03:34 PDT 1999
@ -2390,7 +2372,6 @@ Sun Sep 26 19:37:30 PDT 1999
added patch from Martin Tyler <martin@boo.org>
fixes segfaults in modules loading with ipc.
-------------------------------------------------------------------------------
Sun Sep 26 19:45:58 PDT 1999
@ -2447,7 +2428,6 @@ Mon Sep 27 13:31:26 PDT 1999
oops, forgot an EDBUG init in those functions
-------------------------------------------------------------------------------
Mon Sep 27 23:54:54 PDT 1999
@ -2585,7 +2565,6 @@ Thu Sep 30 22:36:37 PDT 1999
added KDE Support config dialog
-------------------------------------------------------------------------------
Thu Sep 30 23:05:53 PDT 1999
@ -2682,7 +2661,6 @@ Fri Oct 1 16:17:41 PDT 1999
I can't reproduce the transparency issue bug.
-------------------------------------------------------------------------------
Fri Oct 1 16:19:08 PDT 1999
@ -2787,7 +2765,6 @@ xmms behavior patches)
Sat Oct 2 17:27:31 PDT 1999
(Raster)
add dialog to explain pagers and iconboxes arent part of a group... :)
-------------------------------------------------------------------------------
@ -3374,7 +3351,6 @@ entry for it. - I've redone a lot of this theme from the ground up. it still
has a ways to go - a little more eterm autotheme tinkering as well as redoing
the epplet config (which I just copied straight from brushed metal)
-------------------------------------------------------------------------------
Sun Oct 10 01:32:17 PDT 1999
@ -3561,7 +3537,6 @@ sed through and use a single reference point to build that at some point)
also fixed some of the EMX stuff
-------------------------------------------------------------------------------
Mon Oct 18 17:42:03 PDT 1999
@ -3639,7 +3614,6 @@ Wed Oct 20 11:38:40 PDT 1999
I broke a small portion of code in OS/2
-------------------------------------------------------------------------------
Wed Oct 20 11:43:14 PDT 1999
@ -3692,7 +3666,6 @@ Wed Oct 20 18:09:59 PDT 1999
updated man pages.
Now it should automatically build from the e/dox/E-docs/MAIN file
-------------------------------------------------------------------------------
Thu Oct 21 11:07:00 PDT 1999
@ -3781,7 +3754,6 @@ Wed Oct 27 15:02:57 EST 1999
New backgrounds for the dialogs, menus and the documentation.
I grew bored with the old ones. Opinions welcome :)
-------------------------------------------------------------------------------
Wed Oct 27 12:36:22 PDT 1999
@ -3820,7 +3792,6 @@ I can't think of why this would be segfaulting or how this code could have
gotten called if there were no border, but I think this must be the segfault
I received in email. *shrug*
-------------------------------------------------------------------------------
Thu Oct 28 13:07:01 PDT 1999
@ -3843,7 +3814,6 @@ Sat Oct 30 12:37:48 PDT 1999
fixed KDE from accidentally closing when we didn't mean to exit.
-------------------------------------------------------------------------------
Wed Nov 3 00:45:47 EST 1999
@ -3854,7 +3824,6 @@ the close button in groups dialogs. Hey who among the
gentlemen around here removed the apply button? He missed
that :)
-------------------------------------------------------------------------------
Fri Nov 5 14:24:02 PST 1999
@ -3864,7 +3833,6 @@ holy crap I can't believe I didn't see that bug sooner.
This should fix the "maximize seems to mess up when I have KDE support
enabled" bug.
-------------------------------------------------------------------------------
Sat Nov 6 10:51:24 PST 1999
@ -3872,7 +3840,6 @@ Sat Nov 6 10:51:24 PST 1999
removed two warnings when compiled with --disable-zoom
-------------------------------------------------------------------------------
Sat Nov 6 11:54:31 PST 1999
@ -3908,7 +3875,6 @@ fix some clipping code for arrage stuff...
Sat Nov 6 15:07:24 PST 1999
(Mandrake)
Fixed a bug in KDE support where windows would place themselves underneath the
kpanel occasionally. it shouldn't ever do that again :)
@ -3920,7 +3886,6 @@ Sat Nov 6 16:09:57 PST 1999
Fixed a bug where selecting a window on another desktop using kpanel wouldn't
change the current desktop in kpanel (workaround for kpanel bug)
-------------------------------------------------------------------------------
Sun Nov 7 18:20:16 PST 1999
@ -4105,7 +4070,6 @@ you can get an extended list using "window_list extended"
returns the following format:
"window_id : title :: desktop : area_x area_y : x_coordinate y_coordinate
-------------------------------------------------------------------------------
Tue Dec 21 22:29:49 PST 1999
@ -4197,7 +4161,6 @@ Fixed issues on platforms with unsigned chars.
Mon Jan 31 10:50:09 PST 2000
(Raster)
text compression works wiht multi-byte stuff now thanks to masahiko :)
-------------------------------------------------------------------------------
@ -4221,7 +4184,6 @@ Default behaviour is not changed, the setting is saved and loaded correctly.
*Clenches and awaits cl00batting*
-------------------------------------------------------------------------------
Sun Feb 20 18:10:30 GMT 2000
@ -4238,7 +4200,6 @@ and gkrellm etc out of it...
Feel free to revert the commit if it's inappropriate...
-------------------------------------------------------------------------------
Mon Feb 21 20:46:52 GMT 2000
@ -4254,7 +4215,6 @@ windows bring up root menus...
Lots of changes, so check for bugs =)
-------------------------------------------------------------------------------
Mon Feb 21 21:48:34 GMT 2000
@ -4262,7 +4222,6 @@ Mon Feb 21 21:48:34 GMT 2000
Warning removal. I was a bad boy.
-------------------------------------------------------------------------------
Mon Feb 21 21:50:20 GMT 2000
@ -4270,7 +4229,6 @@ Mon Feb 21 21:50:20 GMT 2000
and this.
-------------------------------------------------------------------------------
Sun Feb 27 14:55:54 GMT 2000
@ -4291,7 +4249,6 @@ remember windowid sticky command size ...
This streamlines epplets in particular, and speeds up Epplet_remember by a
factor of 8. (Significant on certain boxen).
-------------------------------------------------------------------------------
Sun Feb 27 15:39:37 GMT 2000
@ -4299,7 +4256,6 @@ Sun Feb 27 15:39:37 GMT 2000
*cough*. Now the remember ipc should actually *work*. Sorry ;)
-------------------------------------------------------------------------------
Sun Feb 27 15:54:11 GMT 2000
@ -4307,7 +4263,6 @@ Sun Feb 27 15:54:11 GMT 2000
remove a debugging printf
-------------------------------------------------------------------------------
Mon Feb 28 18:04:33 GMT 2000
@ -4319,7 +4274,6 @@ list options into one winop: "Skip Window Lists", and one remember option.
The actions are still defined to do stuff individually, but users have no
need of that sort of granularity. Much nicer now :)
-------------------------------------------------------------------------------
Mon Feb 28 19:39:46 GMT 2000
@ -4327,7 +4281,6 @@ Mon Feb 28 19:39:46 GMT 2000
64-bit fixes from Bob Arendt <rdarendt@cwcom.net>
-------------------------------------------------------------------------------
Tue Feb 29 19:44:59 GMT 2000
@ -4336,7 +4289,6 @@ Tue Feb 29 19:44:59 GMT 2000
Hehe. Typo stopped the list skip thing being loaded from the .snaps.x file.
Fixed.
-------------------------------------------------------------------------------
Tue Mar 14 18:57:38 CET 2000
@ -4344,3 +4296,11 @@ Tue Mar 14 18:57:38 CET 2000
Small fix for people who want to pop up
menus using their keyboard.
-------------------------------------------------------------------------------
Tue Mar 14 20:23:53 CET 2000
(Saur)
Added patch from Masahiko Mori <masa@cthulhu.engr.sgi.com>
to improve localization support (I modified the patch somewhat).

289
src/E.h
View File

@ -226,7 +226,7 @@ int Evsnprintf(char *str, size_t count, const char *fmt,
va_list args);
#ifdef HAVE_STDARGS
int Esnprintf(char *str, size_t count, const char *fmt, ...);
int Esnprintf(char *str, size_t count, const char *fmt,...);
#else
int Esnprintf(va_alist);
@ -535,16 +535,16 @@ typedef struct _iconbox Iconbox;
typedef struct _group Group;
typedef struct _icondef
{
{
char *title_match;
char *name_match;
char *class_match;
char *icon_file;
}
}
Icondef;
typedef struct _exid
{
{
Window parent;
Window win;
int x, y, w, h;
@ -555,29 +555,29 @@ typedef struct _exid
int depth;
Pixmap bgpmap;
int bgcol;
}
}
EXID;
typedef struct _actiontype
{
{
void *params;
struct _actiontype *Next;
int Type;
}
}
ActionType;
typedef struct _list
{
{
char *name;
int id;
void *item;
struct _list *next;
}
}
List;
typedef struct _client
{
{
char *name;
Window win;
char *msg;
@ -589,11 +589,11 @@ typedef struct _client
char *address;
char *info;
Pixmap pmap;
}
}
Client;
typedef struct _root
{
{
Window win;
Visual *vis;
int depth;
@ -601,28 +601,28 @@ typedef struct _root
int scr;
int w, h;
Window focuswin;
}
}
Root;
typedef struct _modcurve
{
{
int num;
unsigned char *px;
unsigned char *py;
unsigned char map[256];
}
}
ModCurve;
typedef struct _colormodifierclass
{
{
char *name;
ModCurve red, green, blue;
unsigned int ref_count;
}
}
ColorModifierClass;
typedef struct _imagestate
{
{
char *im_file;
char *real_file;
char unloadable;
@ -633,31 +633,31 @@ typedef struct _imagestate
ImlibColor bg, hi, lo, hihi, lolo;
int bevelstyle;
ColorModifierClass *colmod;
}
}
ImageState;
typedef struct _ImageStateArray
{
{
ImageState *normal;
ImageState *hilited;
ImageState *clicked;
ImageState *disabled;
}
}
ImageStateArray;
typedef struct _imageclass
{
{
char *name;
char external;
ImageStateArray norm, active, sticky, sticky_active;
ImlibBorder padding;
ColorModifierClass *colmod;
unsigned int ref_count;
}
}
ImageClass;
typedef struct _efont
{
{
TT_Engine engine;
TT_Face face;
TT_Instance instance;
@ -667,11 +667,11 @@ typedef struct _efont
TT_Raster_Map **glyphs_cached;
int max_descent;
int max_ascent;
}
}
Efont;
typedef struct _textstate
{
{
char *fontname;
FnlibStyle style;
FnlibFont *font;
@ -682,11 +682,11 @@ typedef struct _textstate
XFontStruct *xfont;
XFontSet xfontset;
int xfontset_ascent;
}
}
TextState;
typedef struct _textclass
{
{
char *name;
struct
{
@ -698,11 +698,11 @@ typedef struct _textclass
norm , active, sticky, sticky_active;
int justification;
unsigned int ref_count;
}
}
TextClass;
typedef struct _action
{
{
char event;
char anymodifier;
int modifiers;
@ -713,27 +713,27 @@ typedef struct _action
char *key_str;
char *tooltipstring;
ActionType *action;
}
}
Action;
typedef struct _actionclass
{
{
char *name;
int num;
Action **list;
char *tooltipstring;
unsigned int ref_count;
}
}
ActionClass;
typedef struct _constraints
{
{
int min, max;
}
}
Constraints;
typedef struct _winpoint
{
{
int originbox;
struct
{
@ -741,29 +741,29 @@ typedef struct _winpoint
int absolute;
}
x , y;
}
}
WinPoint;
typedef struct _geometry
{
{
Constraints width, height;
WinPoint topleft, bottomright;
}
}
Geometry;
typedef struct _ecursor
{
{
char *name;
ImlibColor fg, bg;
char *file;
Cursor cursor;
unsigned int ref_count;
char inroot;
}
}
ECursor;
typedef struct _winpart
{
{
Geometry geom;
ImageClass *iclass;
ActionClass *aclass;
@ -772,11 +772,11 @@ typedef struct _winpart
signed char ontop;
int flags;
char keep_for_shade;
}
}
WinPart;
typedef struct _border
{
{
char *name;
char *group_border_name;
ImlibBorder border;
@ -785,11 +785,11 @@ typedef struct _border
char changes_shape;
char shadedir;
unsigned int ref_count;
}
}
Border;
typedef struct _ewinbit
{
{
Window win;
int x, y, w, h;
int cx, cy, cw, ch;
@ -797,11 +797,11 @@ typedef struct _ewinbit
char expose;
char no_expose;
char left;
}
}
EWinBit;
typedef struct _winclient
{
{
Window win;
char *title;
int x, y, w, h, bw;
@ -843,11 +843,11 @@ typedef struct _winclient
char mwm_func_maximize;
char mwm_func_close;
unsigned int app_state;
}
}
WinClient;
typedef struct _ewin
{
{
Window win;
int x, y, w, h, reqx, reqy;
int lx, ly, lw, lh;
@ -900,11 +900,11 @@ typedef struct _ewin
int icon_pmap_w, icon_pmap_h;
Pixmap icon_pmap, icon_mask;
char kde_hint;
}
}
EWin;
typedef struct _groupconfig
{
{
char iconify;
char kill;
char move;
@ -913,27 +913,27 @@ typedef struct _groupconfig
char stick;
char shade;
char mirror;
}
}
GroupConfig;
struct _group
{
{
int index;
EWin **members;
int num_members;
GroupConfig cfg;
};
};
typedef struct _awaiticlass
{
{
Window client_win;
int ewin_bit;
ImageClass *iclass;
}
}
AwaitIclass;
typedef struct _bgeometry
{
{
Constraints width, height;
int xorigin, yorigin;
int xabs, xrel;
@ -941,14 +941,14 @@ typedef struct _bgeometry
int xsizerel, xsizeabs;
int ysizerel, ysizeabs;
char size_from_image;
}
}
BGeometry;
typedef struct _strip Strip;
typedef struct _stripjoint Stripjoint;
typedef struct _button
{
{
char *name;
BGeometry geom;
ImageClass *iclass;
@ -974,11 +974,11 @@ typedef struct _button
char destroy_inside_win;
char left;
unsigned int ref_count;
}
}
Button;
typedef struct _buttoncontainer
{
{
char *name;
ImageClass *iclass;
@ -989,11 +989,11 @@ typedef struct _buttoncontainer
char orientation;
Button **ButtonList;
int numofbuttonsinlist;
}
}
Container;
struct _strip
{
{
char *name;
int xabs, yabs;
int xrel, yrel;
@ -1016,10 +1016,10 @@ struct _strip
Window win;
int x, y, w, h;
int cx, cy, cw, ch;
};
};
typedef struct _background
{
{
char *name;
Pixmap pmap;
time_t last_viewed;
@ -1048,11 +1048,11 @@ typedef struct _background
ColorModifierClass *cmclass;
char keepim;
unsigned int ref_count;
}
}
Background;
typedef struct _desk
{
{
char viewable;
Window win;
int x, y;
@ -1062,11 +1062,11 @@ typedef struct _desk
Button *tag;
int current_area_x;
int current_area_y;
}
}
Desk;
typedef struct _desktops
{
{
int current;
Desk desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS];
int dragdir;
@ -1076,31 +1076,31 @@ typedef struct _desktops
char slidein;
int slidespeed;
char hiqualitybg;
}
}
Desktops;
typedef struct _sample
{
{
char *file;
int rate;
int format;
int samples;
unsigned char *data;
int id;
}
}
Sample;
typedef struct _soundclass
{
{
char *name;
char *file;
Sample *sample;
unsigned int ref_count;
}
}
SoundClass;
typedef struct _windowmatch
{
{
char *name;
char *win_title;
char *win_name;
@ -1115,11 +1115,11 @@ typedef struct _windowmatch
ImageClass *icon;
int desk;
char make_sticky;
}
}
WindowMatch;
typedef struct
{
{
char *name;
char direction;
int num_buttons;
@ -1128,11 +1128,11 @@ typedef struct
Window win;
Window from_win;
unsigned int ref_count;
}
}
Slideout;
typedef struct _emode
{
{
int mode;
int deskmode;
char place;
@ -1249,26 +1249,26 @@ typedef struct _emode
int pager_sel_button;
int pager_win_button;
int pager_menu_button;
}
}
EMode;
typedef struct _handlestruct
{
{
void (*func) (XEvent * ev);
}
}
HandleStruct;
typedef struct _IPCstruct
{
{
void (*func) (char *params, Client * c);
char *commandname;
char *help_text;
char *extended_help_text;
}
}
IPCStruct;
typedef struct _tooltip
{
{
char *name;
ImageClass *iclass;
@ -1281,11 +1281,11 @@ typedef struct _tooltip
char visible;
ImageClass *tooltippic;
unsigned int ref_count;
}
}
ToolTip;
typedef struct _qentry
{
{
char *name;
double in_time;
void (*func) (int val, void *data);
@ -1293,11 +1293,11 @@ typedef struct _qentry
int runtime_val;
void *runtime_data;
char just_added;
}
}
Qentry;
typedef struct _menustyle
{
{
char *name;
TextClass *tclass;
ImageClass *bg_iclass;
@ -1309,11 +1309,11 @@ typedef struct _menustyle
int maxy;
char *border_name;
unsigned int ref_count;
}
}
MenuStyle;
typedef struct _menuitem
{
{
ImageClass *icon_iclass;
char *text;
short act_id;
@ -1330,11 +1330,11 @@ typedef struct _menuitem
short text_h;
short text_x;
short text_y;
}
}
MenuItem;
struct _menu
{
{
char *name;
char *title;
MenuStyle *style;
@ -1350,10 +1350,10 @@ struct _menu
void *data;
Menu *ref_menu;
unsigned int ref_count;
};
};
typedef struct _progressbar
{
{
char *name;
int value;
int x;
@ -1365,11 +1365,11 @@ typedef struct _progressbar
Window p_win;
ImageClass *ic, *inc, *ipc;
TextClass *tc, *tnc;
}
}
Progressbar;
struct _snapshot
{
{
char *name;
char *win_title;
char *win_name;
@ -1401,7 +1401,7 @@ struct _snapshot
char skipfocus;
char use_neverfocus;
char neverfocus;
};
};
typedef struct _ditembutton DItemButton;
typedef struct _ditemcheckbutton DItemCheckButton;
@ -1415,7 +1415,7 @@ typedef struct _ditemarea DItemArea;
typedef struct _ditem DItem;
struct _ditemslider
{
{
char horizontal;
char numeric;
@ -1449,56 +1449,56 @@ struct _ditemslider
Window base_win;
Window knob_win;
Window border_win;
};
};
struct _ditemarea
{
{
Window area_win;
int w, h;
void (*event_func) (int val, void *data);
};
};
struct _ditembutton
{
{
char *text;
};
};
struct _ditemcheckbutton
{
{
char *text;
Window check_win;
int check_orig_w, check_orig_h;
char onoff;
char *onoff_ptr;
};
};
struct _ditemtext
{
{
char *text;
};
};
struct _ditemimage
{
{
char *image;
};
};
struct _ditemseparator
{
{
char horizontal;
};
};
struct _ditemtable
{
{
int num_columns;
char border;
char homogenous_h;
char homogenous_v;
int num_items;
DItem **items;
};
};
struct _ditemradiobutton
{
{
char *text;
Window radio_win;
int radio_orig_w, radio_orig_h;
@ -1507,7 +1507,7 @@ struct _ditemradiobutton
int *val_ptr;
DItem *next;
DItem *first;
};
};
#define DITEM_NONE 0
#define DITEM_BUTTON 1
@ -1521,7 +1521,7 @@ struct _ditemradiobutton
#define DITEM_AREA 9
struct _ditem
{
{
int type;
void (*func) (int val, void *data);
int val;
@ -1553,10 +1553,10 @@ struct _ditem
DItemArea area;
}
item;
};
};
typedef struct _dbutton
{
{
char *text;
void (*func) (int val, void *data);
Window win;
@ -1566,20 +1566,20 @@ typedef struct _dbutton
char close;
TextClass *tclass;
ImageClass *iclass;
}
}
DButton;
typedef struct _Dkeybind
{
{
KeyCode key;
int val;
void *data;
void (*func) (int val, void *data);
}
}
DKeyBind;
struct _dialog
{
{
char *name;
char *title;
char *text;
@ -1595,27 +1595,27 @@ struct _dialog
void *exit_data;
int num_bindings;
DKeyBind *keybindings;
};
};
typedef struct _PixImg
{
{
XImage *xim;
XShmSegmentInfo *shminfo;
Pixmap pmap;
GC gc;
}
}
PixImg;
typedef struct _Clone
{
{
char *name;
Window win;
EWin *ewin;
}
}
Clone;
struct _iconbox
{
{
/* user settings */
char *name;
char orientation;
@ -1667,10 +1667,10 @@ struct _iconbox
int bar_thickness;
int knob_length;
};
};
struct _pager
{
{
char *name;
Window win;
Pixmap pmap;
@ -1686,10 +1686,10 @@ struct _pager
char hi_visible;
Window hi_win;
EWin *hi_ewin;
};
};
typedef struct _drawqueue
{
{
Window win;
ImageClass *iclass;
int w, h, active, sticky, state, expose;
@ -1702,22 +1702,22 @@ typedef struct _drawqueue
Dialog *d;
DItem *di;
int x, y;
}
}
DrawQueue;
/* some kde hint enums here */
typedef enum
{
{
StickyFlag = (1 << 0),
MaximizedFlag = (1 << 1),
IconifiedFlag = (1 << 2),
AllFlags = 7
}
}
KStates;
typedef enum
{
{
AddWindow,
RemoveWindow,
FocusWindow,
@ -1725,7 +1725,7 @@ typedef enum
LowerWindow,
ChangedClient,
IconChange
}
}
KMessage;
/* function prototypes */
@ -1923,7 +1923,7 @@ Border *MatchEwinBorder(EWin * ewin, WindowMatch * b);
ImageClass *MatchEwinIcon(EWin * ewin, WindowMatch * b);
int MatchEwinDesktop(EWin * ewin, WindowMatch * b);
void *MatchEwinByFunction(EWin * ewin,
void *(*FunctionToTest) (EWin *,
void * (*FunctionToTest) (EWin *,
WindowMatch
*));
@ -2686,7 +2686,7 @@ __Erealloc(x, y, "<unknown>", 0)
char *duplicate(char *s);
void Alert(char *fmt, ...);
void Alert(char *fmt,...);
void InitStringList(void);
void AssignIgnoreFunction(int (*FunctionToAssign) (void *),
@ -2740,6 +2740,7 @@ char *FileExtension(char *file);
char *field(char *s, int field);
int fillfield(char *s, int field, char *buf);
void fword(char *s, int num, char *wd);
int findLocalizedFile(char *fname);
/* cursors.c functions */
ECursor *CreateECursor(char *name, char *image, ImlibColor * fg,
@ -2809,9 +2810,9 @@ void DialogDrawArea(Dialog * d, int x, int y, int w, int h);
void DialogRedraw(Dialog * d);
void ShowDialog(Dialog * d);
void DialogClose(Dialog * d);
void DialogSetParamText(Dialog * d, char *fmt, ...);
void DialogAlert(char *fmt, ...);
void DialogAlertOK(char *fmt, ...);
void DialogSetParamText(Dialog * d, char *fmt,...);
void DialogAlert(char *fmt,...);
void DialogAlertOK(char *fmt,...);
void DialogRestart(int val, void *data);
void DialogQuit(int val, void *data);
DItem *DialogInitItem(Dialog * d);

View File

@ -1395,9 +1395,8 @@ Config_Button(FILE * ConfigFile)
char ontop = 0;
int flags = 0, minw = 1, maxw = 99999, minh = 1;
int maxh = 99999, xo = 0, yo = 0, xa = 0;
int xr = 0, ya = 0, yr = 0, xsr = 0, xsa = 0, ysr = 0, ysa =
0;
int xr = 0, ya = 0, yr = 0;
int xsr = 0, xsa = 0, ysr = 0, ysa = 0;
char simg = 0;
int desk = 0;
char sticky = 0;
@ -3282,9 +3281,8 @@ int
LoadConfigFile(char *f)
{
FILE *ConfigFile;
char s[FILEPATH_LEN_MAX], s2[FILEPATH_LEN_MAX], *file,
*ppfile;
char s[FILEPATH_LEN_MAX], s2[FILEPATH_LEN_MAX];
char *file, *ppfile;
int i;
char notheme = 0;
@ -3528,14 +3526,9 @@ char *
FindFile(char *file)
{
char s[FILEPATH_LEN_MAX];
char *locale = NULL;
EDBUG(6, "FindFile");
#ifndef __EMX__
locale = setlocale(LC_MESSAGES, NULL);
#endif
/* if absolute path - and file exists - return it */
#ifndef __EMX__
if (file[0] == '/')
@ -3543,16 +3536,10 @@ FindFile(char *file)
if (_fnisabs(file))
#endif
{
if (locale)
{
Esnprintf(s, sizeof(s), "%s.%s", file, locale);
if (isfile(s))
strcpy(s, file);
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
}
if (isfile(file))
EDBUG_RETURN(duplicate(file));
}
#ifdef __EMX__
if (file[0] == '/')
{
@ -3560,43 +3547,28 @@ FindFile(char *file)
EDBUG_RETURN(duplicate(__XOS2RedirRoot(file)));
}
#endif
/* look in ~/.enlightenment first */
if (locale)
{
Esnprintf(s, sizeof(s), "%s/%s.%s", UserEDir(), file, locale);
if (isfile(s))
EDBUG_RETURN(duplicate(s));
}
Esnprintf(s, sizeof(s), "%s/%s", UserEDir(), file);
if (isfile(s))
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
/* look in theme dir */
if (locale)
{
Esnprintf(s, sizeof(s), "%s/%s.%s", themepath, file, locale);
if (isfile(s))
EDBUG_RETURN(duplicate(s));
}
Esnprintf(s, sizeof(s), "%s/%s", themepath, file);
if (isfile(s))
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
/* look in system config dir */
#ifndef __EMX__
if (locale)
{
Esnprintf(s, sizeof(s), "%s/config/%s.%s", ENLIGHTENMENT_ROOT, file,
locale);
if (isfile(s))
EDBUG_RETURN(duplicate(s));
}
Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file);
#else
Esnprintf(s, sizeof(s), "%s/config/%s",
__XOS2RedirRoot(ENLIGHTENMENT_ROOT), file);
#endif
if (isfile(s))
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
/* not found.... NULL */
EDBUG_RETURN(NULL);
}
@ -3605,14 +3577,9 @@ char *
FindNoThemeFile(char *file)
{
char s[FILEPATH_LEN_MAX];
char *locale = NULL;
EDBUG(6, "FindFile");
#ifndef __EMX__
locale = setlocale(LC_MESSAGES, NULL);
#endif
/* if absolute path - and file exists - return it */
#ifndef __EMX__
if (file[0] == '/')
@ -3620,16 +3587,10 @@ FindNoThemeFile(char *file)
if (_fnisabs(file))
#endif
{
if (locale)
{
Esnprintf(s, sizeof(s), "%s.%s", file, locale);
if (isfile(s))
strcpy(s, file);
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
}
if (isfile(file))
EDBUG_RETURN(duplicate(file));
}
#ifdef __EMX__
if (file[0] == '/')
{
@ -3637,32 +3598,22 @@ FindNoThemeFile(char *file)
EDBUG_RETURN(duplicate(__XOS2RedirRoot(file)));
}
#endif
/* look in ~/.enlightenment first */
if (locale)
{
Esnprintf(s, sizeof(s), "%s/%s.%s", UserEDir(), file, locale);
if (isfile(s))
EDBUG_RETURN(duplicate(s));
}
/* look in ~/.enlightenment first */
Esnprintf(s, sizeof(s), "%s/%s", UserEDir(), file);
if (isfile(s))
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
/* look in system config dir */
#ifndef __EMX__
if (locale)
{
Esnprintf(s, sizeof(s), "%s/config/%s.%s", ENLIGHTENMENT_ROOT, file,
locale);
if (isfile(s))
EDBUG_RETURN(duplicate(s));
}
Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file);
#else
Esnprintf(s, sizeof(s), "%s/config/%s",
__XOS2RedirRoot(ENLIGHTENMENT_ROOT), file);
#endif
if (isfile(s))
if (findLocalizedFile(s) || isfile(s))
EDBUG_RETURN(duplicate(s));
/* not found.... NULL */
EDBUG_RETURN(NULL);
}
@ -3741,7 +3692,8 @@ LoadEConfig(char *themelocation)
{
Progressbar *p = NULL;
int i;
char *config_files[] = {
char *config_files[] =
{
"init.cfg",
"control.cfg",
"textclasses.cfg",

View File

@ -263,7 +263,8 @@ cp(char *s, char *ss)
EDBUG_RETURN_;
}
time_t moddate(char *s)
time_t
moddate(char *s)
{
struct stat st;
@ -1079,3 +1080,42 @@ pathtofile(char *file)
#endif
EDBUG_RETURN(NULL);
}
int
findLocalizedFile(char *fname)
{
#ifndef __EMX__
char *tmp, *lang, *p[3];
int i;
if (!(lang = setlocale(LC_MESSAGES, NULL)))
return 0;
tmp = strdup(fname);
lang = strdup(lang); /* lang may be in static space, thus it must
* be duplicated before we change it below */
p[0] = lang + strlen(lang);
p[1] = strchr(lang, '.');
p[2] = strchr(lang, '_');
for (i = 0; i < 3; i++)
{
if (p[i] == NULL)
continue;
*p[i] = '\0';
sprintf(fname, "%s.%s", tmp, lang);
if (isfile(fname))
{
free(tmp);
free(lang);
return 1;
}
}
strcpy(fname, tmp);
free(tmp);
free(lang);
#endif
return 0;
}