[PATCH] libX11: allow inclusion of system level compose files

Alan Coopersmith Alan.Coopersmith at Sun.COM
Wed Oct 21 07:29:23 PDT 2009


It's an interesting patch, and I'd like to consider it once we're done
with the X11R7.5 release that's being finished off now - it's too late
in the release cycle for something this big in 7.5 I think though.

	-alan-

Marko Myllynen wrote:
> Ping?
> 
> Marko Myllynen wrote:
>> Hi,
>>
>> with the release of XFree86 4.4 an inclusion system of compose files was
>> added to Xlib to allow inclusion of the default compose file (with %L),
>> any compose files from user's home directory (with %H), or a compose
>> file with a hard coded path [1]. However, even today including system
>> level compose files is not possible in a platform independent manner
>> although the machinery for including compose files and overriding
>> previously defined compositions is already in place.
>>
>> With the ability to include system level compose files one could greatly
>> reduce the need for compose file rule duplication and the work needed to
>> propagate changes in one compose file to others. For example, currently
>> the Finnish compose file fi_FI.UTF-8 weights over 5000 lines [2] but it
>> is almost identical with en_US.UTF-8 except for perhaps half a dozen
>> compositions.
>>
>> Please consider something like the patch below to allow one to include
>> system level compose files with the following kind of syntax:
>>
>> include "%S/en_US.UTF-8/Compose"
>>
>> 1) http://www.xfree86.org/4.4.0/RELNOTES5.html#42
>> 2)
>> http://cgit.freedesktop.org/xorg/lib/libX11/tree/nls/fi_FI.UTF-8/Compose.pre
>>
>>
>> Signed-off-by: Marko Myllynen <myllynen at redhat.com>
>>
>>
>> --- a/modules/im/ximcp/imLcPrs.c
>> +++ b/modules/im/ximcp/imLcPrs.c
>> @@ -44,6 +44,13 @@ OR PERFORMANCE OF THIS SOFTWARE.
>>  #include <sys/stat.h>
>>  #include <stdio.h>
>>
>> +#define XLC_BUFSIZE 256
>> +
>> +extern void xlocaledir(
>> +    char *buf,
>> +    int buf_len
>> +);
>> +
>>  extern int _Xmbstowcs(
>>      wchar_t	*wstr,
>>      char	*str,
>> @@ -304,6 +311,7 @@ static char*
>>  TransFileName(Xim im, char *name)
>>  {
>>     char *home = NULL, *lcCompose = NULL;
>> +   char dir[XLC_BUFSIZE];
>>     char *i = name, *ret, *j;
>>     int l = 0;
>>
>> @@ -324,6 +332,10 @@ TransFileName(Xim im, char *name)
>>                   if (lcCompose)
>>                       l += strlen(lcCompose);
>>     	         break;
>> +   	      case 'S':
>> +                 xlocaledir(dir, XLC_BUFSIZE);
>> +                 l += strlen(dir);
>> +   	         break;
>>     	  }
>>        } else {
>>        	  l++;
>> @@ -355,6 +367,10 @@ TransFileName(Xim im, char *name)
>>                      Xfree(lcCompose);
>>                   }
>>     	         break;
>> +   	      case 'S':
>> +                 strcpy(j, dir);
>> +                 j += strlen(dir);
>> +   	         break;
>>     	  }
>>            i++;
>>        } else {
>>
>> --- a/src/xlibi18n/lcFile.c
>> +++ b/src/xlibi18n/lcFile.c
>> @@ -219,7 +219,7 @@ _XlcParsePath(
>>  #define XLOCALEDIR "/usr/lib/X11/locale"
>>  #endif
>>
>> -static void
>> +void
>>  xlocaledir(
>>      char *buf,
>>      int buf_len)
>>
>>
> 

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list