/* $XConsortium: XawIm.c,v 1.5 94/04/17 20:13:30 kaleb Exp $ */
/*
* Copyright 1991 by OMRON Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of OMRON not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. OMRON makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* OMRON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*
* Author: Seiji Kuwari OMRON Corporation
* kuwa@omron.co.jp
* kuwa%omron.co.jp@uunet.uu.net
*/
/*
Copyright (c) 1994 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include "XawImP.h"
#include <X11/VarargsI.h>
#include "XawI18n.h"
#include <ctype.h>
# include <stdarg.h>
#else
# include <varargs.h>
#endif
/*****************************************************
*
* Forward reference prototypes
*
*****************************************************/
static XawIcTableList CurrentSharedIcTable(
XawVendorShellExtPart* /* ve */
#endif
);
static void DestroyIC(
Widget /* w */,
XawVendorShellExtPart* /* ve */
#endif
);
{
{
},
{
},
{
},
{
},
{
}
};
{
}
Widget w;
{
if (w && XtIsVendorShell(w)) return((VendorShellWidget)w);
return(NULL);
}
{
return(NULL);
}
return(&(vew->vendor_ext));
}
{
(XPointer*)&contextData)) {
return(NULL);
}
return(&(vew->vendor_ext));
}
{
}
Widget w;
{
if (p->widget == w) {
if (IsSharedIC(ve)) {
} else {
return(p);
}
}
}
return(NULL);
}
Widget w;
{
if (p->widget == w) {
return(p);
}
}
return(NULL);
}
{
}
String p;
{
if (!p || !*p)
return((XIMStyle)0);
if (!strcmp(p, "OverTheSpot")) {
return((XIMPreeditPosition | XIMStatusArea));
} else if (!strcmp(p, "OffTheSpot")) {
return((XIMPreeditArea | XIMStatusArea));
} else if (!strcmp(p, "Root")) {
return((XIMPreeditNothing | XIMStatusNothing));
} else {
return((XIMStyle)0);
}
}
Widget w;
{
if (IsSharedIC(ve)) return;
pe_area.x = 0;
pe_area.y = 0;
}
}
Widget w;
{
contextErrData->widget = w;
(char *)contextErrData)) {
return(NULL);
}
return(contextErrData->widget);
}
{
(XPointer*)&contextErrData)) {
return(NULL);
}
return(contextErrData->widget);
}
{
}
{
Cardinal i = 0;
}
}
{
/*
* Destory all ICs
*/
if (IsSharedIC(ve)) {
p->ic_focused = FALSE;
}
} else {
p->ic_focused = FALSE;
}
}
/*
* Close Input Method
*/
(XPointer*)&contextErrData)) {
}
/*
* resize vendor shell to core size
*/
(void) SetVendorShellHeight(ve, 0);
/*
XawVendorShellExtResize(vw);
*/
return;
}
{
(XPointer*)&contextErrData)) {
}
}
}
}
}
Widget w;
{
DestroyAllIM( ve );
return;
}
{
return(0);
}
/*
* Attempt to open an input method
*/
{
int i, j;
} else {
break;
}
}
}
}
"we can not open any input method");
return;
}
|| !xim_styles) {
"input method doesn't support any style");
return;
}
if (input_style == (XIMStyle)0) continue;
for (i = 0; (unsigned short)i < xim_styles->count_styles; i++) {
/* _XipSetIOErrorHandler(IOErrorHandler); */
return;
}
}
}
"input method doesn't support my input style");
}
{
if (p->input_style & XIMStatusArea) {
return(FALSE);
}
st_area.x = 0;
return(FALSE);
}
}
if (p->input_style & XIMPreeditArea) {
return(FALSE);
}
if (p->input_style & XIMStatusArea) {
}
}
return(TRUE);
}
{
if (IsSharedIC(ve)) {
return;
}
}
}
Widget w;
{
table->line_spacing = 0;
return(table);
}
Widget w;
{
return(TRUE);
}
Widget w;
{
if (p->widget == w) {
XtFree((char *)p);
break;
}
}
return;
}
Widget w;
{
}
}
}
}
p->flg |= CIBgPixmap;
}
}
}
Widget w;
{
return(TRUE);
}
{
if (p->input_style & XIMPreeditArea) {
}
if (p->input_style & XIMStatusArea) {
}
if (ic_cnt > 0) {
p->openic_error = True;
return;
}
if (p->input_style & XIMStatusArea) {
st_area.x = 0;
if (p->input_style & XIMPreeditArea) {
} else {
}
}
if (p->input_style & XIMPreeditArea) {
if (p->input_style & XIMStatusArea) {
} else {
pe_area.x = 0;
}
}
p->openic_error = True;
return;
}
}
}
Widget w;
{
if (!XtIsRealized(w)) return;
+ maxDescentOfFontSet(p->font_set);
}
}
}
if (p->flg & CIBgPixmap) {
}
}
}
if (p->input_style & XIMPreeditArea) {
pe_area.x = 0;
}
if (p->input_style & XIMPreeditPosition) {
pe_area.x = 0;
pe_area.y = 0;
} else {
}
}
if (p->input_style & XIMStatusArea) {
st_area.x = 0;
}
if (pe_cnt > 0) {
}
if (st_cnt > 0) {
}
p->openic_error = True;
return;
}
if (!IsSharedIC(ve)) {
if (p->input_style & XIMPreeditPosition) {
}
}
}
Widget w;
{
int height;
#ifdef SPOT
if ((p->input_style & XIMPreeditPosition)
return;
}
#endif
+ maxDescentOfFontSet(p->font_set);
}
}
}
if (p->flg & CIBgPixmap) {
}
}
}
if (p->input_style & XIMPreeditPosition) {
}
}
if (IsSharedIC(ve)) {
if (p->input_style & XIMPreeditPosition) {
pe_area.x = 0;
pe_area.y = 0;
}
}
if (pe_cnt > 0) {
}
if (st_cnt > 0) {
}
}
if (ic_cnt > 0) {
}
}
Widget w;
{
if (w == NULL) {
return;
}
}
{
}
Widget w;
{
if (IsSharedIC(ve)) {
SharedICChangeFocusWindow(w, ve, p);
}
}
p->ic_focused = TRUE;
XSetICFocus(p->xic);
}
}
Widget w;
{
return;
}
}
if (p->ic_focused == TRUE) {
XUnsetICFocus(p->xic);
p->ic_focused = FALSE;
}
}
Widget w;
{
int i;
break;
}
}
}
}
}
}
p->flg |= CIBgPixmap;
}
}
}
}
Widget w;
{
}
}
Widget w;
{
if (IsSharedIC(ve)) {
UnsetICFocus(w, ve);
}
return;
}
XDestroyIC(p->xic);
if (!IsSharedIC(ve)) {
if (p->input_style & XIMPreeditPosition) {
}
}
}
{
} else {
}
}
}
}
{
}
}
}
}
Widget w;
{
{
}
return(FALSE);
}
{
{
}
{
}
}
{
return(FALSE);
}
{
if (NoRegistered(ve))
{
/*
* resize vendor shell to core size
*/
(void) SetVendorShellHeight(ve, 0);
}
}
{
return;
}
}
}
}
{
}
if (IsSharedIC(ve)) {
p->openic_error = FALSE;
} else {
p->openic_error = FALSE;
}
}
}
unsigned int num_res;
{
unsigned int count;
}
}
char* p;
int* num;
{
int i = 0;
*num = 0;
if (!p || !*p) return ((char **)NULL);
while (*p && isspace(*p)) p++;
if (!*p) return ((char **)NULL);
strcpy(s, p);
save_s = s;
while(1) {
list[i] = s;
if (!ss) {
} else {
}
*end = '\0';
i++;
if (!ss) break;
s = ss + 1;
while (*s && isspace(*s)) p++;
if (!*s) break;
}
return((char **)NULL);
}
*num = i;
return(lp);
}
{
int i;
return(FALSE);
return(TRUE);
}
/* Destroy()
*
* This frees all (most?) of the resources malloced by XawIm.
* It is called by _XawImDestroy, which is called by Vendor.c's
* VendorExt's Destroy method. Sheeran, Omron KK, 93/08/05 */
Widget w;
{
if (!XtIsVendorShell( w ) )
return;
XtFree( (char*) contextData );
XtFree( (char*) contextErrData );
}
/*********************************************
*
* SEMI-PRIVATE FUNCTIONS
* For use by other Xaw modules
*
********************************************/
void
Widget w )
#else
Widget w;
#endif
{
}
}
Widget w )
#else
_XawImGetShellHeight( w )
Widget w;
#endif
{
}
}
void
Widget w )
#else
_XawImRealize( w )
Widget w;
#endif
{
extern void XawVendorShellExtResize();
if ( !XtIsRealized( w ) || !XtIsVendorShell( w ) ) return;
}
}
void
Widget w,
#else
_XawImInitialize( w, ext )
#endif
{
if ( !XtIsVendorShell( w ) ) return;
}
}
void
#else
#endif
{
}
}
void
#else
#endif
{
}
}
void
#else
#endif
{
}
}
void
#else
#endif
{
}
void
#else
#endif
{
}
}
void
#else
#endif
{
}
void
#else
#endif
{
}
}
void
#else
#endif
{
}
int
int bytes_buffer,
#else
int bytes_buffer;
#endif
{
int i, ret;
}
(XComposeStatus*) status_return );
}
return( ret );
}
int
Widget w)
#else
Widget w;
#endif
{
}
return(0);
}
void
Widget w)
#else
Widget w;
#endif
{
extern void XawVendorShellExtResize();
}
}
/* _XawImDestroy()
*
* This should be called by the VendorExt from its
* core Destroy method. Sheeran, Omron KK 93/08/05 */
void
Widget w,
#else
_XawImDestroy( w, ext )
Widget w;
#endif
{
if ( !XtIsVendorShell( w ) ) return;
}