Back to index

im-sdk  12.3.91
XlcPubI.h
Go to the documentation of this file.
00001 /* $Xorg: XlcPubI.h,v 1.4 2000/12/12 12:44:05 coskrey Exp $ */
00002 /*
00003  * Copyright 1992, 1993 by TOSHIBA Corp.
00004  *
00005  * Permission to use, copy, modify, and distribute this software and its
00006  * documentation for any purpose and without fee is hereby granted, provided
00007  * that the above copyright notice appear in all copies and that both that
00008  * copyright notice and this permission notice appear in supporting
00009  * documentation, and that the name of TOSHIBA not be used in advertising
00010  * or publicity pertaining to distribution of the software without specific,
00011  * written prior permission. TOSHIBA make no representations about the
00012  * suitability of this software for any purpose.  It is provided "as is"
00013  * without express or implied warranty.
00014  *
00015  * TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00016  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00017  * TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00018  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00019  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00020  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00021  * SOFTWARE.
00022  *
00023  * Author: Katsuhisa Yano   TOSHIBA Corp.
00024  *                          mopi@osa.ilab.toshiba.co.jp
00025  */
00026 /* $XFree86: xc/lib/X11/XlcPubI.h,v 3.9 2001/11/16 00:52:27 dawes Exp $ */
00027 
00028 #ifndef _XLCPUBLICI_H_
00029 #define _XLCPUBLICI_H_
00030 
00031 #include "XlcPublic.h"
00032 
00033 #define XLC_PUBLIC(lcd, x)  (((XLCdPublic) lcd->core)->pub.x)
00034 #define XLC_PUBLIC_PART(lcd)       (&(((XLCdPublic) lcd->core)->pub))
00035 #define XLC_PUBLIC_METHODS(lcd)    (&(((XLCdPublicMethods) lcd->methods)->pub))
00036 
00037 /*
00038  * XLCd public methods
00039  */
00040 
00041 typedef struct _XLCdPublicMethodsRec *XLCdPublicMethods;
00042 
00043 typedef XLCd (*XlcPubCreateProc)(
00044     const char*             name,
00045     XLCdMethods             methods
00046 );
00047 
00048 typedef Bool (*XlcPubInitializeProc)(
00049     XLCd             lcd
00050 );
00051 
00052 typedef void (*XlcPubDestroyProc)(
00053     XLCd             lcd
00054 );
00055 
00056 typedef char* (*XlcPubGetValuesProc)(
00057     XLCd             lcd,
00058     XlcArgList              args,
00059     int                     num_args
00060 );
00061 
00062 typedef void (*XlcPubGetResourceProc)(
00063     XLCd             lcd,
00064     const char*             category,
00065     const char*             _class,
00066     char***          value,
00067     int*             count
00068 );
00069 
00070 typedef struct _XLCdPublicMethodsPart {
00071     XLCdPublicMethods superclass;
00072     XlcPubCreateProc create;
00073     XlcPubInitializeProc initialize;
00074     XlcPubDestroyProc destroy;
00075     XlcPubGetValuesProc get_values;
00076     XlcPubGetResourceProc get_resource;
00077 } XLCdPublicMethodsPart;
00078 
00079 typedef struct _XLCdPublicMethodsRec {
00080     XLCdMethodsRec core;
00081     XLCdPublicMethodsPart pub;
00082 } XLCdPublicMethodsRec;
00083 
00084 /*
00085  * XLCd public data
00086  */
00087 
00088 typedef struct _XLCdPublicPart {
00089     char *siname;                  /* for _XlcMapOSLocaleName() */
00090     char *language;                /* language part of locale name */
00091     char *territory;               /* territory part of locale name */
00092     char *codeset;                 /* codeset part of locale name */
00093     char *encoding_name;           /* encoding name */
00094     int mb_cur_max;                /* ANSI C MB_CUR_MAX */
00095     Bool is_state_depend;          /* state-depend encoding */
00096     const char *default_string;           /* for XDefaultString() */
00097     XPointer xlocale_db;
00098 } XLCdPublicPart;
00099 
00100 typedef struct _XLCdPublicRec {
00101     XLCdCoreRec core;       
00102     XLCdPublicPart pub;
00103 } XLCdPublicRec, *XLCdPublic;
00104 
00105 extern XLCdMethods _XlcPublicMethods;
00106 
00107 _XFUNCPROTOBEGIN
00108 
00109 extern XLCd _XlcCreateLC(
00110     const char*             name,
00111     XLCdMethods             methods
00112 );
00113 
00114 extern void _XlcDestroyLC(
00115     XLCd             lcd
00116 );
00117 
00118 /* Fills into a freshly created XlcCharSet the fields that can be inferred
00119    from the ESC sequence. These are side, char_size, set_size. */
00120 extern Bool _XlcParseCharSet(
00121     XlcCharSet              charset
00122 );
00123 
00124 /* Creates a new XlcCharSet, given its name (including side suffix) and
00125    Compound Text ESC sequence (normally at most 4 bytes). */
00126 extern XlcCharSet _XlcCreateDefaultCharSet(
00127     const char*             name,
00128     const char*             ct_sequence
00129 );
00130 
00131 extern XlcCharSet _XlcAddCT(
00132     const char*             name,
00133     const char*             ct_sequence
00134 );
00135 
00136 extern Bool _XlcInitCTInfo (void);
00137 
00138 extern XrmMethods _XrmDefaultInitParseInfo(
00139     XLCd             lcd,
00140     XPointer*        state
00141 );
00142 
00143 extern int _XmbTextPropertyToTextList(
00144     XLCd             lcd,
00145     Display*         dpy,
00146     const XTextProperty* text_prop,
00147     char***          list_ret,
00148     int*             count_ret
00149 );
00150 
00151 extern int _XwcTextPropertyToTextList(
00152     XLCd             lcd,
00153     Display*         dpy,
00154     const XTextProperty* text_prop,
00155     wchar_t***              list_ret,
00156     int*             count_ret
00157 );
00158 
00159 extern int _Xutf8TextPropertyToTextList(
00160     XLCd             lcd,
00161     Display*         dpy,
00162     const XTextProperty* text_prop,
00163     char***          list_ret,
00164     int*             count_ret
00165 );
00166 
00167 extern int _XmbTextListToTextProperty(
00168 #if NeedFunctionPrototypes
00169     XLCd             /* lcd */,
00170     Display*         /* dpy */,
00171     char**           /* list */,
00172     int                     /* count */,
00173     XICCEncodingStyle       /* style */,
00174     XTextProperty*   /* text_prop */
00175 #endif
00176 );
00177 
00178 extern int _XwcTextListToTextProperty(
00179 #if NeedFunctionPrototypes
00180     XLCd             /* lcd */,
00181     Display*         /* dpy */,
00182     wchar_t**        /* list */,
00183     int                     /* count */,
00184     XICCEncodingStyle       /* style */,
00185     XTextProperty*   /* text_prop */
00186 #endif
00187 );
00188 
00189 extern int _Xutf8TextListToTextProperty(
00190 #if NeedFunctionPrototypes
00191     XLCd             /* lcd */,
00192     Display*         /* dpy */,
00193     char**           /* list */,
00194     int                     /* count */,
00195     XICCEncodingStyle       /* style */,
00196     XTextProperty*   /* text_prop */
00197 #endif
00198 );
00199 
00200 extern void _XwcFreeStringList(
00201 #if NeedFunctionPrototypes
00202     XLCd             /* lcd */,
00203     wchar_t**        /* list */
00204 #endif
00205 );
00206 
00207 extern int _XlcResolveLocaleName(
00208     const char*             lc_name,
00209     XLCdPublicPart*  pub
00210 );
00211 
00212 extern int _XlcResolveI18NPath(
00213     char*            buf,
00214     int                     buf_len
00215 );
00216 
00217 extern char *_XlcLocaleDirName(
00218 #if NeedFunctionPrototypes
00219      char*             /* dir_name */,
00220      char*             /* lc_name */
00221 #endif
00222 );
00223 
00224 extern XPointer _XlcCreateLocaleDataBase(
00225     XLCd             lcd
00226 );
00227 
00228 extern void _XlcDestroyLocaleDataBase(
00229     XLCd             lcd
00230 );
00231 
00232 extern void _XlcGetLocaleDataBase(
00233     XLCd             /* lcd */,
00234     const char*             /* category */,
00235     const char*             /* name */,
00236     char***          /* value */,
00237     int*             /* count */
00238 );
00239 
00240 _XFUNCPROTOEND
00241 
00242 #endif  /* _XLCPUBLICI_H_ */