XawIm.c File Reference

#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <X11/ShellP.h>
#include <X11/Xaw3d/TextP.h>
#include <X11/Xaw3d/MultiSrc.h>
#include <X11/Xaw3d/MultiSinkP.h>
#include <X11/Xaw3d/XawImP.h>
#include <X11/Xaw3d/VendorEP.h>
#include "XawI18n.h"
#include <ctype.h>
#include <varargs.h>

Include dependency graph for XawIm.c:

Go to the source code of this file.

Defines

#define Va_start(a, b)   va_start(a)
#define maxAscentOfFontSet(fontset)   ( - (XExtentsOfFontSet((fontset)))->max_logical_extent.y)
#define maxHeightOfFontSet(fontset)   ((XExtentsOfFontSet((fontset)))->max_logical_extent.height)
#define maxDescentOfFontSet(fontset)   (maxHeightOfFontSet(fontset) - maxAscentOfFontSet(fontset))
#define Offset(field)   (XtOffsetOf(XawIcTablePart, field))
#define xrmres   ((XrmResourceList) res)

Functions

static XawIcTableList CurrentSharedIcTable ()
static void DestroyIC ()
static void SetVaArg (XPointer *arg, XPointer value)
static VendorShellWidget SearchVendorShell (Widget w)
static XawVendorShellExtPartSetExtPart (VendorShellWidget w, XawVendorShellExtWidget vew)
static XawVendorShellExtPartGetExtPart (VendorShellWidget w)
static Boolean IsSharedIC (XawVendorShellExtPart *ve)
static XawIcTableList GetIcTableShared (Widget w, XawVendorShellExtPart *ve)
static XawIcTableList GetIcTable (Widget w, XawVendorShellExtPart *ve)
static XIMStyle GetInputStyleOfIC (XawVendorShellExtPart *ve)
static void ConfigureCB (Widget w, XtPointer closure, XEvent *event)
static Widget SetErrCnxt (Widget w, XIM xim)
static void CloseIM (XawVendorShellExtPart *ve)
static Dimension SetVendorShellHeight (XawVendorShellExtPart *ve, Dimension height)
static void DestroyAllIM (XawVendorShellExtPart *ve)
static void FreeAllDataOfVendorShell (XawVendorShellExtPart *ve, VendorShellWidget vw)
static void VendorShellDestroyed (Widget w, XtPointer cl_data, XtPointer ca_data)
static void OpenIM (XawVendorShellExtPart *ve)
static Boolean ResizeVendorShell_Core (VendorShellWidget vw, XawVendorShellExtPart *ve, XawIcTableList p)
static void ResizeVendorShell (VendorShellWidget vw, XawVendorShellExtPart *ve)
static XawIcTableList CreateIcTable (Widget w, XawVendorShellExtPart *ve)
static Boolean RegisterToVendorShell (Widget w, XawVendorShellExtPart *ve)
static void UnregisterFromVendorShell (Widget w, XawVendorShellExtPart *ve)
static void SetICValuesShared (Widget w, XawVendorShellExtPart *ve, XawIcTableList p, Boolean check)
static Boolean IsCreatedIC (Widget w, XawVendorShellExtPart *ve)
static void SizeNegotiation (XawIcTableList p, Dimension width, Dimension height)
static void CreateIC (Widget w, XawVendorShellExtPart *ve)
static void SetICValues (Widget w, XawVendorShellExtPart *ve, Boolean focus)
static void SharedICChangeFocusWindow (Widget w, XawVendorShellExtPart *ve, XawIcTableList p)
static XawIcTableList CurrentSharedIcTable (XawVendorShellExtPart *ve)
static void SetICFocus (Widget w, XawVendorShellExtPart *ve)
static void UnsetICFocus (Widget w, XawVendorShellExtPart *ve)
static void SetValues (Widget w, XawVendorShellExtPart *ve, ArgList args, Cardinal num_args)
static void SetFocus (Widget w, XawVendorShellExtPart *ve)
static void DestroyIC (Widget w, XawVendorShellExtPart *ve)
static void SetFocusValues (Widget inwidg, ArgList args, Cardinal num_args, Boolean focus)
static void UnsetFocus (Widget inwidg)
static Boolean IsRegistered (Widget w, XawVendorShellExtPart *ve)
static void Register (Widget inwidg, XawVendorShellExtPart *ve)
static Boolean NoRegistered (XawVendorShellExtPart *ve)
static void Unregister (Widget inwidg, XawVendorShellExtPart *ve)
static void AllCreateIC (XawVendorShellExtPart *ve)
static void Reconnect (XawVendorShellExtPart *ve)
static void CompileResourceList (XtResourceList res, unsigned int num_res)
static Boolean Initialize (VendorShellWidget vw, XawVendorShellExtPart *ve)
static void Destroy (Widget w, XawVendorShellExtPart *ve)
void _XawImResizeVendorShell (Widget w)
Dimension _XawImGetShellHeight (Widget w)
void _XawImRealize (Widget w)
void _XawImInitialize (Widget w, Widget ext)
void _XawImReconnect (Widget inwidg)
void _XawImRegister (Widget inwidg)
void _XawImUnregister (Widget inwidg)
void _XawImSetValues (Widget inwidg, ArgList args, Cardinal num_args)
void _XawImVASetValues (Widget inwidg, va_alist)
void _XawImSetFocusValues (Widget inwidg, ArgList args, Cardinal num_args)
void _XawImVASetFocusValues (Widget inwidg, va_alist)
void _XawImUnsetFocus (Widget inwidg)
int _XawImWcLookupString (Widget inwidg, XKeyPressedEvent *event, wchar_t *buffer_return, int bytes_buffer, KeySym *keysym_return, Status *status_return)
int _XawImGetImAreaHeight (Widget w)
void _XawImCallVendorShellExtResize (Widget w)
void _XawImDestroy (Widget w, Widget ext)

Variables

static XtResource resources []
static XContext extContext = (XContext)NULL
static XContext errContext = (XContext)NULL


Define Documentation

#define maxAscentOfFontSet ( fontset   )     ( - (XExtentsOfFontSet((fontset)))->max_logical_extent.y)

Definition at line 78 of file XawIm.c.

Referenced by CreateIC(), and SetICValues().

#define maxDescentOfFontSet ( fontset   )     (maxHeightOfFontSet(fontset) - maxAscentOfFontSet(fontset))

Definition at line 84 of file XawIm.c.

Referenced by CreateIC(), and SetICValues().

#define maxHeightOfFontSet ( fontset   )     ((XExtentsOfFontSet((fontset)))->max_logical_extent.height)

Definition at line 81 of file XawIm.c.

#define Offset ( field   )     (XtOffsetOf(XawIcTablePart, field))

Definition at line 87 of file XawIm.c.

#define Va_start ( a,
b   )     va_start(a)

Definition at line 75 of file XawIm.c.

Referenced by _XawImVASetFocusValues(), and _XawImVASetValues().

#define xrmres   ((XrmResourceList) res)

Referenced by CompileResourceList(), and SetValues().


Function Documentation

void _XawImCallVendorShellExtResize ( Widget  w  ) 

Definition at line 1681 of file XawIm.c.

References GetExtPart(), SearchVendorShell(), and XawVendorShellExtResize().

Referenced by AdjustPanedSize(), and GeometryManager().

01684 {
01685     XawVendorShellExtPart       *ve;
01686     VendorShellWidget           vw;
01687     extern void XawVendorShellExtResize();
01688 
01689     if ((vw = SearchVendorShell(w)) && (ve = GetExtPart(vw))) {
01690         XawVendorShellExtResize(vw);
01691     }
01692 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImDestroy ( Widget  w,
Widget  ext 
)

Definition at line 1706 of file XawIm.c.

References Destroy(), and GetExtPart().

Referenced by XawVendorShellExtDestroy().

01710 {
01711     XawVendorShellExtPart        *ve;
01712 
01713     if ( !XtIsVendorShell( w ) ) return;
01714     if ((ve = GetExtPart( (VendorShellWidget) w )))
01715         Destroy( w, ve );
01716 }

Here is the call graph for this function:

Here is the caller graph for this function:

int _XawImGetImAreaHeight ( Widget  w  ) 

Definition at line 1663 of file XawIm.c.

References _XawImPart::area_height, GetExtPart(), XawVendorShellExtPart::im, and SearchVendorShell().

Referenced by GeometryManager().

01666 {
01667     XawVendorShellExtPart       *ve;
01668     VendorShellWidget           vw;
01669 
01670     if ((vw = SearchVendorShell(w)) && (ve = GetExtPart(vw))) {
01671         return(ve->im.area_height);
01672     }
01673     return(0);
01674 }

Here is the call graph for this function:

Here is the caller graph for this function:

Dimension _XawImGetShellHeight ( Widget  w  ) 

Definition at line 1411 of file XawIm.c.

References _XawImPart::area_height, GetExtPart(), and XawVendorShellExtPart::im.

Referenced by XawVendorShellExtResize().

01414 {
01415     XawVendorShellExtPart *ve;
01416 
01417     if (!XtIsVendorShell( w ) ) return( w->core.height );
01418     if ((ve = GetExtPart( (VendorShellWidget) w ))) {
01419         return( w->core.height - ve->im.area_height );
01420     }
01421     return( w->core.height );
01422 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImInitialize ( Widget  w,
Widget  ext 
)

Definition at line 1450 of file XawIm.c.

References FALSE, Initialize(), NULL, SetExtPart(), and VendorShellDestroyed().

Referenced by XawVendorShellExtInitialize().

01453 {
01454     XawVendorShellExtPart       *ve;
01455 
01456     if ( !XtIsVendorShell( w ) ) return;
01457     if ((ve = SetExtPart( (VendorShellWidget) w, (XawVendorShellExtWidget)ext)) ) {
01458         if ( Initialize( (VendorShellWidget) w, ve ) == FALSE ) return;
01459         XtAddCallback( w, XtNdestroyCallback, VendorShellDestroyed,
01460                       (XtPointer) NULL );
01461     }
01462 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImRealize ( Widget  w  ) 

Definition at line 1429 of file XawIm.c.

References AllCreateIC(), FALSE, GetExtPart(), NULL, and XawVendorShellExtResize().

Referenced by Realize().

01432 {
01433     XawVendorShellExtPart       *ve;
01434     extern void XawVendorShellExtResize();
01435 
01436     if ( !XtIsRealized( w ) || !XtIsVendorShell( w ) ) return;
01437     if ((ve = GetExtPart( (VendorShellWidget) w ))) {
01438         XtAddEventHandler( w, (EventMask)StructureNotifyMask, FALSE,
01439                           XawVendorShellExtResize, (XtPointer)NULL );
01440         AllCreateIC(ve);
01441     }
01442 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImReconnect ( Widget  inwidg  ) 

Definition at line 1469 of file XawIm.c.

References GetExtPart(), NULL, Reconnect(), and SearchVendorShell().

Referenced by Reconnect().

01472 {
01473     XawVendorShellExtPart       *ve;
01474     VendorShellWidget           vw;
01475 
01476     if ((vw = SearchVendorShell(inwidg)) == NULL) return;
01477     if ((ve = GetExtPart(vw))) {
01478         Reconnect(ve);
01479     }
01480 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImRegister ( Widget  inwidg  ) 

Definition at line 1487 of file XawIm.c.

References GetExtPart(), NULL, Register(), and SearchVendorShell().

Referenced by Initialize().

01490 {
01491     XawVendorShellExtPart       *ve;
01492     VendorShellWidget           vw;
01493 
01494     if ((vw = SearchVendorShell(inwidg)) == NULL) return;
01495     if ((ve = GetExtPart(vw))) {
01496         Register(inwidg, ve);
01497     }
01498 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImResizeVendorShell ( Widget  w  ) 

Definition at line 1394 of file XawIm.c.

References GetExtPart(), XawVendorShellExtPart::im, ResizeVendorShell(), and _XawImPart::xim.

Referenced by XawVendorShellExtResize().

01397 {
01398     XawVendorShellExtPart *ve;
01399 
01400     if ( ( ve = GetExtPart( (VendorShellWidget) w ) ) && ve->im.xim ) {
01401         ResizeVendorShell( (VendorShellWidget) w, ve );
01402     }
01403 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImSetFocusValues ( Widget  inwidg,
ArgList  args,
Cardinal  num_args 
)

Definition at line 1569 of file XawIm.c.

References SetFocusValues(), and TRUE.

Referenced by _XawImVASetFocusValues(), TextEnterWindow(), and TextFocusIn().

01574 {
01575     SetFocusValues(inwidg, args, num_args, TRUE);
01576 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImSetValues ( Widget  inwidg,
ArgList  args,
Cardinal  num_args 
)

Definition at line 1525 of file XawIm.c.

References FALSE, and SetFocusValues().

Referenced by _XawImVASetValues(), _XawTextVScroll(), Initialize(), and InsertCursor().

01530 {
01531     SetFocusValues( inwidg, args, num_args, FALSE );
01532 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImUnregister ( Widget  inwidg  ) 

Definition at line 1505 of file XawIm.c.

References GetExtPart(), NULL, SearchVendorShell(), and Unregister().

Referenced by Destroy().

01508 {
01509     XawVendorShellExtPart       *ve;
01510     VendorShellWidget           vw;
01511 
01512     if ((vw = SearchVendorShell(inwidg)) == NULL) return;
01513     if ((ve = GetExtPart(vw))) {
01514         Unregister(inwidg, ve);
01515     }
01516 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImUnsetFocus ( Widget  inwidg  ) 

Definition at line 1611 of file XawIm.c.

References UnsetFocus().

Referenced by TextFocusOut(), and TextLeaveWindow().

01614 {
01615     UnsetFocus(inwidg);
01616 }

Here is the call graph for this function:

Here is the caller graph for this function:

void _XawImVASetFocusValues ( Widget  inwidg,
va_alist   
)

Definition at line 1582 of file XawIm.c.

References _XawImSetFocusValues(), NULL, and Va_start.

01586 {
01587     va_list             var;
01588     ArgList             args = NULL;
01589     Cardinal            num_args;
01590     int                 total_count, typed_count;
01591 
01592     Va_start(var, inwidg);
01593     _XtCountVaList(var, &total_count, &typed_count);
01594     va_end(var);
01595 
01596     Va_start(var,inwidg);
01597 
01598     _XtVaToArgList(inwidg, var, total_count, &args, &num_args);
01599     _XawImSetFocusValues(inwidg, args, num_args);
01600     if (args != NULL) {
01601         XtFree((XtPointer)args);
01602     }
01603     va_end(var);
01604 }

Here is the call graph for this function:

void _XawImVASetValues ( Widget  inwidg,
va_alist   
)

Definition at line 1538 of file XawIm.c.

References _XawImSetValues(), NULL, and Va_start.

01542 {
01543     va_list  var;
01544     ArgList  args = NULL;
01545     Cardinal num_args;
01546     int      total_count, typed_count;
01547 
01548     Va_start( var, inwidg );
01549     _XtCountVaList( var, &total_count, &typed_count );
01550     va_end( var );
01551 
01552     Va_start( var, inwidg );
01553 
01554     _XtVaToArgList( inwidg, var, total_count, &args, &num_args );
01555     _XawImSetValues( inwidg, args, num_args );
01556     if ( args != NULL ) {
01557         XtFree( (XtPointer) args );
01558     }
01559     va_end( var );
01560 }

Here is the call graph for this function:

int _XawImWcLookupString ( Widget  inwidg,
XKeyPressedEvent*  event,
wchar_t*  buffer_return,
int  bytes_buffer,
KeySym*  keysym_return,
Status*  status_return 
)

Definition at line 1628 of file XawIm.c.

References _Xaw_atowc(), GetExtPart(), GetIcTableShared(), i, XawVendorShellExtPart::im, p, SearchVendorShell(), and _XawImPart::xim.

Referenced by InsertChar().

01637 {
01638     XawVendorShellExtPart*      ve;
01639     VendorShellWidget           vw;
01640     XawIcTableList              p;
01641     int                         i, ret;
01642     char                        tmp_buf[64], *tmp_p;
01643     wchar_t*                    buf_p;
01644 
01645     if ((vw = SearchVendorShell(inwidg)) && (ve = GetExtPart(vw)) &&
01646         ve->im.xim && (p = GetIcTableShared(inwidg, ve)) && p->xic) {
01647           return(XwcLookupString(p->xic, event, buffer_return, bytes_buffer,
01648                                  keysym_return, status_return));
01649     }
01650     ret = XLookupString( event, tmp_buf, 64, keysym_return,
01651                          (XComposeStatus*) status_return );
01652     for ( i = 0, tmp_p = tmp_buf, buf_p = buffer_return; i < ret; i++ ) {
01653         *buf_p++ = _Xaw_atowc(*tmp_p++);
01654     }
01655     return( ret );
01656 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void AllCreateIC ( XawVendorShellExtPart ve  )  [static]

Definition at line 1265 of file XawIm.c.

References CreateIC(), IsSharedIC(), NULL, p, and SetICFocus().

Referenced by _XawImRealize(), and Reconnect().

01267 {
01268     XawIcTableList p;
01269 
01270     if (ve->im.xim == NULL) return;
01271     if (IsSharedIC(ve) && ve->ic.ic_table[0].widget) {
01272         p = ve->ic.shared_ic_table;
01273         if (p->xic == NULL)
01274             CreateIC(ve->ic.ic_table[0].widget, ve);
01275         SetICFocus(ve->ic.ic_table[0].widget, ve);
01276         return;
01277     }
01278     for (p = ve->ic.ic_table; p; p = p->next) {
01279         if (p->xic == NULL)
01280             CreateIC(p->widget, ve);
01281     }
01282     for (p = ve->ic.ic_table; p; p = p->next) {
01283         SetICFocus(p->widget, ve);
01284     }
01285 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void CloseIM ( XawVendorShellExtPart ve  )  [static]

Definition at line 284 of file XawIm.c.

Referenced by DestroyAllIM(), and Unregister().

00286 {
00287     if (ve->im.xim)
00288         XCloseIM(ve->im.xim);
00289 }

Here is the caller graph for this function:

static void CompileResourceList ( XtResourceList  res,
unsigned int  num_res 
) [static]

Definition at line 1313 of file XawIm.c.

References count, and xrmres.

Referenced by Initialize().

01316 {
01317     unsigned int count;
01318 
01319 #define xrmres  ((XrmResourceList) res)
01320     for (count = 0; count < num_res; res++, count++) {
01321         xrmres->xrm_name         = XrmPermStringToQuark(res->resource_name);
01322         xrmres->xrm_class        = XrmPermStringToQuark(res->resource_class);
01323         xrmres->xrm_type         = XrmPermStringToQuark(res->resource_type);
01324         xrmres->xrm_offset      = -res->resource_offset - 1;
01325         xrmres->xrm_default_type = XrmPermStringToQuark(res->default_type);
01326     }
01327 #undef xrmres
01328 }

Here is the caller graph for this function:

static void ConfigureCB ( Widget  w,
XtPointer  closure,
XEvent *  event 
) [static]

Definition at line 227 of file XawIm.c.

References _XawTextMargin::bottom, GetExtPart(), GetIcTableShared(), IsSharedIC(), _XawTextMargin::left, NULL, p, _XawTextMargin::right, SearchVendorShell(), and _XawTextMargin::top.

Referenced by CreateIC(), and DestroyIC().

00231 {
00232     XawIcTableList              p;
00233     XawVendorShellExtPart       *ve;
00234     VendorShellWidget           vw;
00235     XVaNestedList               pe_attr;
00236     XRectangle                  pe_area;
00237     XawTextMargin               *margin;
00238 
00239     if (event->type != ConfigureNotify) return;
00240 
00241     if ((vw = SearchVendorShell(w)) == NULL) return;
00242 
00243     if ((ve = GetExtPart(vw))) {
00244         if (IsSharedIC(ve)) return;
00245         if ((ve->im.xim == NULL) ||
00246             ((p = GetIcTableShared(w, ve)) == NULL) ||
00247             (p->xic == NULL) || !(p->input_style & XIMPreeditPosition)) return;
00248         pe_area.x = 0;
00249         pe_area.y = 0;
00250         pe_area.width = w->core.width;
00251         pe_area.height = w->core.height;
00252         margin = &(((TextWidget)w)->text.margin);
00253         pe_area.x += margin->left;
00254         pe_area.y += margin->top;
00255         pe_area.width -= (margin->left + margin->right - 1);
00256         pe_area.height -= (margin->top + margin->bottom - 1);
00257 
00258         pe_attr = XVaCreateNestedList(0, XNArea, &pe_area, NULL);
00259         XSetICValues(p->xic, XNPreeditAttributes, pe_attr, NULL);
00260         XtFree(pe_attr);
00261     }
00262 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void CreateIC ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 727 of file XawIm.c.

References _XawMultiSinkPosToXY(), _XawTextMargin::bottom, CIBg, CIBgPixmap, CICursorP, CIFg, CIFontSet, CILineS, ConfigureCB(), FALSE, GetIcTableShared(), GetInputStyleOfIC(), height, XawVendorShellExtPart::im, IsSharedIC(), _XawTextMargin::left, maxAscentOfFontSet, maxDescentOfFontSet, NULL, p, XawVendorShellExtPart::parent, _XawTextMargin::right, SetICValuesShared(), SetVaArg(), SetVendorShellHeight(), SizeNegotiation(), _XawTextMargin::top, and _XawImPart::xim.

Referenced by AllCreateIC(), Register(), and SetFocusValues().

00730 {
00731     XawIcTableList      p;
00732     XPoint              position;
00733     XRectangle          pe_area, st_area;
00734     XVaNestedList       pe_attr = NULL, st_attr = NULL;
00735     XPointer            ic_a[20], pe_a[20], st_a[20];
00736     Dimension           height = 0;
00737     int                 ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
00738     XawTextMargin       *margin;
00739 
00740     if (!XtIsRealized(w)) return;
00741     if (((ve->im.xim == NULL) || (p = GetIcTableShared(w, ve)) == NULL) ||
00742         p->xic || (p->openic_error != FALSE)) return;
00743 
00744     p->input_style = GetInputStyleOfIC(ve);
00745 
00746     if (IsSharedIC(ve)) SetICValuesShared(w, ve, p, FALSE);
00747     XFlush(XtDisplay(w));
00748     
00749     if (p->input_style & (XIMPreeditArea|XIMPreeditPosition|XIMStatusArea)) {
00750         if (p->flg & CIFontSet) {
00751             SetVaArg( &pe_a[pe_cnt], (XPointer) XNFontSet); pe_cnt++;
00752             SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
00753             SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
00754             SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
00755             height = maxAscentOfFontSet(p->font_set)
00756                    + maxDescentOfFontSet(p->font_set);
00757             height = SetVendorShellHeight(ve, height);
00758         }
00759         if (p->flg & CIFg) {
00760             SetVaArg( &pe_a[pe_cnt], (XPointer) XNForeground); pe_cnt++;
00761             SetVaArg( &pe_a[pe_cnt], (XPointer) p->foreground); pe_cnt++;
00762             SetVaArg( &st_a[st_cnt], (XPointer) XNForeground); st_cnt++;
00763             SetVaArg( &st_a[st_cnt], (XPointer) p->foreground); st_cnt++;
00764         }
00765         if (p->flg & CIBg) {
00766             SetVaArg( &pe_a[pe_cnt], (XPointer) XNBackground); pe_cnt++;
00767             SetVaArg( &pe_a[pe_cnt], (XPointer) p->background); pe_cnt++;
00768             SetVaArg( &st_a[st_cnt], (XPointer) XNBackground); st_cnt++;
00769             SetVaArg( &st_a[st_cnt], (XPointer) p->background); st_cnt++;
00770         }
00771         if (p->flg & CIBgPixmap) {
00772             SetVaArg( &pe_a[pe_cnt], (XPointer) XNBackgroundPixmap); pe_cnt++;
00773             SetVaArg( &pe_a[pe_cnt], (XPointer) p->bg_pixmap); pe_cnt++;
00774             SetVaArg( &st_a[st_cnt], (XPointer) XNBackgroundPixmap); st_cnt++;
00775             SetVaArg( &st_a[st_cnt], (XPointer) p->bg_pixmap); st_cnt++;
00776         }
00777         if (p->flg & CILineS) {
00778             SetVaArg( &pe_a[pe_cnt], (XPointer) XNLineSpace); pe_cnt++;
00779             SetVaArg( &pe_a[pe_cnt], (XPointer) p->line_spacing); pe_cnt++;
00780             SetVaArg( &st_a[st_cnt], (XPointer) XNLineSpace); st_cnt++;
00781             SetVaArg( &st_a[st_cnt], (XPointer) p->line_spacing); st_cnt++;
00782         }
00783     }
00784     if (p->input_style & XIMPreeditArea) {
00785         pe_area.x = 0;
00786         pe_area.y = ve->parent->core.height - height;
00787         pe_area.width = ve->parent->core.width;
00788         pe_area.height = height;
00789         SetVaArg( &pe_a[pe_cnt], (XPointer) XNArea); pe_cnt++;
00790         SetVaArg( &pe_a[pe_cnt], (XPointer) &pe_area); pe_cnt++;
00791     }
00792     if (p->input_style & XIMPreeditPosition) {
00793         pe_area.x = 0;
00794         pe_area.y = 0;
00795         pe_area.width = w->core.width;
00796         pe_area.height = w->core.height;
00797         margin = &(((TextWidget)w)->text.margin);
00798         pe_area.x += margin->left;
00799         pe_area.y += margin->top;
00800         pe_area.width -= (margin->left + margin->right - 1);
00801         pe_area.height -= (margin->top + margin->bottom - 1);
00802         SetVaArg( &pe_a[pe_cnt], (XPointer) XNArea); pe_cnt++;
00803         SetVaArg( &pe_a[pe_cnt], (XPointer) &pe_area); pe_cnt++;
00804         if (p->flg & CICursorP) {
00805             _XawMultiSinkPosToXY(w, p->cursor_position, &position.x, &position.y);
00806         } else {
00807             position.x = position.y = 0;
00808         }
00809         SetVaArg( &pe_a[pe_cnt], (XPointer) XNSpotLocation); pe_cnt++;
00810         SetVaArg( &pe_a[pe_cnt], (XPointer) &position); pe_cnt++;
00811     }
00812     if (p->input_style & XIMStatusArea) {
00813         st_area.x = 0;
00814         st_area.y = ve->parent->core.height - height;
00815         st_area.width = ve->parent->core.width;
00816         st_area.height = height;
00817         SetVaArg( &st_a[st_cnt], (XPointer) XNArea); st_cnt++;
00818         SetVaArg( &st_a[st_cnt], (XPointer) &st_area); st_cnt++;
00819     }
00820 
00821     SetVaArg( &ic_a[ic_cnt], (XPointer) XNInputStyle); ic_cnt++;
00822     SetVaArg( &ic_a[ic_cnt], (XPointer) p->input_style); ic_cnt++;
00823     SetVaArg( &ic_a[ic_cnt], (XPointer) XNClientWindow); ic_cnt++;
00824     SetVaArg( &ic_a[ic_cnt], (XPointer) XtWindow(ve->parent)); ic_cnt++;
00825     SetVaArg( &ic_a[ic_cnt], (XPointer) XNFocusWindow); ic_cnt++;
00826     SetVaArg( &ic_a[ic_cnt], (XPointer) XtWindow(w)); ic_cnt++;
00827 
00828     if (pe_cnt > 0) {
00829         SetVaArg( &pe_a[pe_cnt], (XPointer) NULL);
00830         pe_attr = XVaCreateNestedList(0, pe_a[0], pe_a[1], pe_a[2], pe_a[3],
00831                                    pe_a[4], pe_a[5], pe_a[6], pe_a[7], pe_a[8],
00832                                    pe_a[9], pe_a[10], pe_a[11], pe_a[12],
00833                                    pe_a[13], pe_a[14], pe_a[15], pe_a[16],
00834                                    pe_a[17], pe_a[18],  pe_a[19]);
00835         SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++;
00836         SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++;
00837     }
00838 
00839     if (st_cnt > 0) {
00840         SetVaArg( &st_a[st_cnt], (XPointer) NULL);
00841         st_attr = XVaCreateNestedList(0, st_a[0], st_a[1], st_a[2], st_a[3],
00842                                    st_a[4], st_a[5], st_a[6], st_a[7], st_a[8],
00843                                    st_a[9], st_a[10], st_a[11], st_a[12],
00844                                    st_a[13], st_a[14], st_a[15], st_a[16],
00845                                    st_a[17], st_a[18],  st_a[19]);
00846         SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++;
00847         SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++;
00848     }
00849     SetVaArg( &ic_a[ic_cnt], (XPointer) NULL);
00850 
00851     p->xic = XCreateIC(ve->im.xim, ic_a[0], ic_a[1], ic_a[2], ic_a[3],
00852                        ic_a[4], ic_a[5], ic_a[6], ic_a[7], ic_a[8], ic_a[9],
00853                        ic_a[10], ic_a[11], ic_a[12], ic_a[13], ic_a[14],
00854                        ic_a[15], ic_a[16], ic_a[17], ic_a[18], ic_a[19]);
00855     if (pe_attr) XtFree(pe_attr);
00856     if (st_attr) XtFree(st_attr);
00857 
00858     if (p->xic == NULL) {
00859         p->openic_error = True;
00860         return;
00861     }
00862 
00863     SizeNegotiation(p, ve->parent->core.width, ve->parent->core.height);
00864 
00865     p->flg &= ~(CIFontSet | CIFg | CIBg | CIBgPixmap | CICursorP | CILineS);
00866 
00867     if (!IsSharedIC(ve)) {
00868         if (p->input_style & XIMPreeditPosition) {
00869             XtAddEventHandler(w, (EventMask)StructureNotifyMask, FALSE,
00870                               (XtEventHandler)ConfigureCB, (Opaque)NULL);
00871         }
00872     }
00873 }

Here is the call graph for this function:

Here is the caller graph for this function:

static XawIcTableList CreateIcTable ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 556 of file XawIm.c.

References FALSE, NULL, and table.

Referenced by Initialize(), and RegisterToVendorShell().

00559 {
00560     XawIcTableList      table;
00561 
00562     table = (XawIcTableList) XtMalloc(sizeof(XawIcTablePart));
00563     if (table == NULL) return(NULL);
00564     table->widget = w;
00565     table->xic = NULL;
00566     table->flg = table->prev_flg = 0;
00567     table->font_set = NULL;
00568     table->foreground = table->background = 0xffffffff;
00569     table->bg_pixmap = 0;
00570     table->cursor_position = 0xffff;
00571     table->line_spacing = 0;
00572     table->ic_focused = FALSE;
00573     table->openic_error = FALSE;
00574     return(table);
00575 }

Here is the caller graph for this function:

static XawIcTableList CurrentSharedIcTable ( XawVendorShellExtPart ve  )  [static]

Definition at line 1022 of file XawIm.c.

01024 {
01025     return(ve->ic.current_ic_table);
01026 }

static XawIcTableList CurrentSharedIcTable (  )  [static]

Referenced by SetICFocus(), SetICValuesShared(), and UnsetICFocus().

Here is the caller graph for this function:

static void Destroy ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1360 of file XawIm.c.

References errContext, extContext, XawVendorShellExtPart::im, NULL, _XawImPart::resources, and _XawImPart::xim.

01363 {
01364     contextDataRec *contextData;
01365     contextErrDataRec *contextErrData;
01366 
01367     if (!XtIsVendorShell( w ) )
01368         return;
01369     XtFree( (char*) ve->im.resources );
01370 
01371     if (extContext != (XContext)NULL && 
01372         !XFindContext (XtDisplay (w), (Window)w, 
01373                        extContext, (XPointer*)&contextData))
01374         XtFree( (char*) contextData );
01375 
01376     if (errContext != (XContext)NULL && 
01377         !XFindContext (XDisplayOfIM( ve->im.xim ), (Window) ve->im.xim, 
01378                        errContext, (XPointer*) &contextErrData))
01379         XtFree( (char*) contextErrData );
01380 }

static void DestroyAllIM ( XawVendorShellExtPart ve  )  [static]

Definition at line 307 of file XawIm.c.

References CloseIM(), DestroyIC(), FALSE, IsSharedIC(), NULL, p, SetVendorShellHeight(), and void().

Referenced by VendorShellDestroyed().

00309 {
00310     XawIcTableList      p;
00311     contextErrDataRec *contextErrData;
00312 
00313     /*
00314      * Destory all ICs
00315      */
00316     if (IsSharedIC(ve)) {
00317         if ((p = ve->ic.shared_ic_table) && p->xic) {
00318             DestroyIC(p->widget, ve);
00319             p->xic = NULL;
00320             p->ic_focused = FALSE;
00321         }
00322     } else {
00323         for (p = ve->ic.ic_table; p; p = p->next) {
00324             if (p->xic == NULL) continue;
00325             DestroyIC(p->widget, ve);
00326             p->xic = NULL;
00327             p->ic_focused = FALSE;
00328         }
00329     }
00330     if (!ve->im.xim) return;
00331     /*
00332      * Close Input Method
00333      */
00334     CloseIM(ve);
00335     if (!XFindContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext,
00336                       (XPointer*)&contextErrData)) {
00337         if (contextErrData) XtFree((char *)contextErrData);
00338     }
00339     XDeleteContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext);
00340     ve->im.xim = NULL;
00341 
00342     /*
00343      * resize vendor shell to core size
00344      */
00345     (void) SetVendorShellHeight(ve, 0);
00346     /*
00347     XawVendorShellExtResize(vw);
00348     */
00349     return;
00350 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void DestroyIC ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1134 of file XawIm.c.

References ConfigureCB(), _XawIcPart::current_ic_table, FALSE, GetIcTable(), GetIcTableShared(), XawVendorShellExtPart::ic, XawVendorShellExtPart::im, IsSharedIC(), NULL, p, UnsetICFocus(), and _XawImPart::xim.

01137 {
01138     XawIcTableList      p;
01139 
01140     if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
01141         (p->xic == NULL)) return;
01142     if (IsSharedIC(ve)) {
01143         if (GetIcTable(w, ve) == ve->ic.current_ic_table) {
01144             UnsetICFocus(w, ve);
01145         }
01146         return;
01147     }
01148     XDestroyIC(p->xic);
01149     if (!IsSharedIC(ve)) {
01150         if (p->input_style & XIMPreeditPosition) {
01151             XtRemoveEventHandler(w, (EventMask)StructureNotifyMask, FALSE,
01152                                  (XtEventHandler)ConfigureCB, (Opaque)NULL);
01153         }
01154     }
01155 }

Here is the call graph for this function:

static void DestroyIC (  )  [static]

Referenced by DestroyAllIM(), and Unregister().

Here is the caller graph for this function:

static void FreeAllDataOfVendorShell ( XawVendorShellExtPart ve,
VendorShellWidget  vw 
) [static]

Definition at line 352 of file XawIm.c.

References p.

Referenced by VendorShellDestroyed().

00355 {
00356     XawIcTableList       p, next;
00357     contextErrDataRec *contextErrData;
00358 
00359     if (!XFindContext(XtDisplay(vw), (Window)vw, extContext,
00360                       (XPointer*)&contextErrData)) {
00361         if (contextErrData) XtFree((char *)contextErrData);
00362     }
00363     XDeleteContext(XtDisplay(vw), (Window)vw, extContext);
00364     if (ve->ic.shared_ic_table)
00365         XtFree((char *)ve->ic.shared_ic_table);
00366     if (ve->im.resources) XtFree((char *)ve->im.resources);
00367     for (p = ve->ic.ic_table; p; p = next) {
00368         next = p->next;
00369         XtFree((char *)p);
00370     }
00371 }

Here is the caller graph for this function:

static XawVendorShellExtPart* GetExtPart ( VendorShellWidget  w  )  [static]

Definition at line 167 of file XawIm.c.

References NULL, and XawVendorShellExtRec::vendor_ext.

Referenced by _XawImCallVendorShellExtResize(), _XawImDestroy(), _XawImGetImAreaHeight(), _XawImGetShellHeight(), _XawImRealize(), _XawImReconnect(), _XawImRegister(), _XawImResizeVendorShell(), _XawImUnregister(), _XawImWcLookupString(), ConfigureCB(), SetFocusValues(), UnsetFocus(), and VendorShellDestroyed().

00169 {
00170     contextDataRec *contextData;
00171     XawVendorShellExtWidget vew;
00172 
00173     if (XFindContext(XtDisplay(w), (Window)w, extContext,
00174                       (XPointer*)&contextData)) {
00175         return(NULL);
00176     }
00177     vew = (XawVendorShellExtWidget)contextData->ve;
00178     return(&(vew->vendor_ext));
00179 }

Here is the caller graph for this function:

static XawIcTableList GetIcTable ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 205 of file XawIm.c.

References XawVendorShellExtPart::ic, _XawIcPart::ic_table, NULL, and p.

Referenced by DestroyIC(), SetICValuesShared(), SetValues(), and SharedICChangeFocusWindow().

00208 {
00209     XawIcTableList      p;
00210 
00211     for (p = ve->ic.ic_table; p; p = p->next) {
00212         if (p->widget == w) {
00213             return(p);
00214         }
00215     }
00216     return(NULL);
00217 }

Here is the caller graph for this function:

static XawIcTableList GetIcTableShared ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 187 of file XawIm.c.

References XawVendorShellExtPart::ic, _XawIcPart::ic_table, IsSharedIC(), NULL, and p.

Referenced by _XawImWcLookupString(), ConfigureCB(), CreateIC(), DestroyIC(), IsCreatedIC(), SetFocus(), SetICFocus(), SetICValues(), UnsetFocus(), and UnsetICFocus().

00190 {
00191     XawIcTableList      p;
00192 
00193     for (p = ve->ic.ic_table; p; p = p->next) {
00194         if (p->widget == w) {
00195             if (IsSharedIC(ve)) {
00196                 return(ve->ic.shared_ic_table);
00197             } else {
00198                 return(p);
00199             }
00200         }
00201     }
00202     return(NULL);
00203 }

Here is the call graph for this function:

Here is the caller graph for this function:

static XIMStyle GetInputStyleOfIC ( XawVendorShellExtPart ve  )  [static]

Definition at line 219 of file XawIm.c.

Referenced by CreateIC().

00221 {
00222 
00223     if (!ve) return((XIMStyle)0);
00224     return(ve->ic.input_style);
00225 }

Here is the caller graph for this function:

static Boolean Initialize ( VendorShellWidget  vw,
XawVendorShellExtPart ve 
) [static]

Definition at line 1330 of file XawIm.c.

References _XawImPart::area_height, CompileResourceList(), CreateIcTable(), _XawIcPart::current_ic_table, FALSE, i, XawVendorShellExtPart::ic, _XawIcPart::ic_table, XawVendorShellExtPart::im, memcpy(), NULL, _XawImPart::num_resources, XawVendorShellExtPart::parent, resources, _XawImPart::resources, _XawIcPart::shared_ic_table, TRUE, and _XawImPart::xim.

01333 {
01334     int         i;
01335 
01336     if (!XtIsVendorShell((Widget)vw)) return(FALSE);
01337     ve->parent = (Widget)vw;
01338     ve->im.xim = NULL;
01339     ve->im.area_height = 0;
01340     ve->im.resources = (XrmResourceList)XtMalloc(sizeof(resources));
01341     if (ve->im.resources == NULL) return(FALSE);
01342     memcpy((char *)ve->im.resources, (char *)resources, sizeof(resources));
01343     ve->im.num_resources = XtNumber(resources);
01344     CompileResourceList( (XtResourceList) ve->im.resources,
01345                            ve->im.num_resources );
01346     if ((ve->ic.shared_ic_table = CreateIcTable( (Widget)vw, ve)) == NULL)
01347         return(FALSE);
01348     ve->ic.current_ic_table = NULL;
01349     ve->ic.ic_table = NULL;
01350     return(TRUE);
01351 }

Here is the call graph for this function:

static Boolean IsCreatedIC ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 642 of file XawIm.c.

References FALSE, GetIcTableShared(), XawVendorShellExtPart::im, NULL, p, TRUE, and _XawImPart::xim.

Referenced by SetFocusValues().

00645 {
00646     XawIcTableList      p;
00647 
00648     if (ve->im.xim == NULL) return(FALSE);
00649     if ((p = GetIcTableShared(w, ve)) == NULL) return(FALSE);
00650     if (p->xic == NULL) return(FALSE);
00651     return(TRUE);
00652 }

Here is the call graph for this function:

Here is the caller graph for this function:

static Boolean IsRegistered ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1202 of file XawIm.c.

References FALSE, XawVendorShellExtPart::ic, _XawIcPart::ic_table, p, and TRUE.

Referenced by Register(), and Unregister().

01205 {
01206     XawIcTableList      p;
01207 
01208     for (p = ve->ic.ic_table; p; p = p->next)
01209         {
01210             if (p->widget == w) return(TRUE);
01211         }
01212     return(FALSE);
01213 }

Here is the caller graph for this function:

static Boolean IsSharedIC ( XawVendorShellExtPart ve  )  [static]

Definition at line 181 of file XawIm.c.

Referenced by AllCreateIC(), ConfigureCB(), CreateIC(), DestroyAllIM(), DestroyIC(), GetIcTableShared(), Reconnect(), ResizeVendorShell(), SetFocus(), SetICFocus(), SetICValues(), and UnsetICFocus().

00183 {
00184     return( ve->ic.shared_ic );
00185 }

Here is the caller graph for this function:

static Boolean NoRegistered ( XawVendorShellExtPart ve  )  [static]

Definition at line 1237 of file XawIm.c.

References FALSE, NULL, and TRUE.

Referenced by Unregister().

01239 {
01240     if (ve->ic.ic_table == NULL) return(TRUE);
01241     return(FALSE);
01242 }

Here is the caller graph for this function:

static void OpenIM ( XawVendorShellExtPart ve  )  [static]

Definition at line 389 of file XawIm.c.

References buf, i, len, NULL, p, s, SetErrCnxt(), and strchr().

Referenced by Reconnect(), and Register().

00391 {
00392     int         i;
00393     char        *p, *s, *ns, *end, *pbuf, buf[32];
00394     XIM         xim = NULL;
00395     XIMStyles   *xim_styles;
00396     XIMStyle    input_style = 0;
00397     Boolean     found;
00398 
00399     if (ve->im.open_im == False) return;
00400     ve->im.xim = NULL;
00401     if (ve->im.input_method == NULL) {
00402         if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
00403             xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
00404     } else {
00405         /* no fragment can be longer than the whole string */
00406         int     len = strlen (ve->im.input_method) + 5;
00407 
00408         if (len < sizeof buf) pbuf = buf;
00409         else pbuf = XtMalloc (len);
00410 
00411         if (pbuf == NULL) return;
00412 
00413         for(ns=s=ve->im.input_method; ns && *s;) {
00414             /* skip any leading blanks */
00415             while (*s && isspace(*s)) s++;
00416             if (!*s) break;
00417             if ((ns = end = strchr(s, ',')) == NULL)
00418                 end = s + strlen(s);
00419             /* strip any trailing blanks */
00420             while (isspace(*end)) end--;
00421 
00422             strcpy (pbuf, "@im=");
00423             strncat (pbuf, s, end - s);
00424             pbuf[end - s + 4] = '\0';
00425 
00426             if ((p = XSetLocaleModifiers(pbuf)) != NULL && *p
00427                 && (xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL)) != NULL)
00428                 break;
00429 
00430             s = ns + 1;
00431         }
00432 
00433         if (pbuf != buf) XtFree (pbuf);
00434     }
00435     if (xim == NULL) {
00436         if ((p = XSetLocaleModifiers("")) != NULL) {
00437             xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
00438         }
00439     }
00440     if (xim == NULL) {
00441         XtAppWarning(XtWidgetToApplicationContext(ve->parent),
00442             "Input Method Open Failed");
00443         return;
00444     }
00445     if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL)
00446         || !xim_styles) {
00447         XtAppWarning(XtWidgetToApplicationContext(ve->parent), 
00448             "input method doesn't support any style");
00449         XCloseIM(xim);
00450         return;
00451     }
00452     found = False;
00453     for(ns = s = ve->im.preedit_type; s && !found;) {
00454         while (*s && isspace(*s)) s++;
00455         if (!*s) break;
00456         if ((ns = end = strchr(s, ',')) == NULL)
00457             end = s + strlen(s);
00458         while (isspace(*end)) end--;
00459 
00460         if (!strncmp(s, "OverTheSpot", end - s)) {
00461             input_style = (XIMPreeditPosition | XIMStatusArea);
00462         } else if (!strncmp(s, "OffTheSpot", end - s)) {
00463             input_style = (XIMPreeditArea | XIMStatusArea);
00464         } else if (!strncmp(s, "Root", end - s)) {
00465             input_style = (XIMPreeditNothing | XIMStatusNothing);
00466         }
00467         for (i = 0; (unsigned short)i < xim_styles->count_styles; i++)
00468             if (input_style == xim_styles->supported_styles[i]) {
00469                 ve->ic.input_style = input_style;
00470                 SetErrCnxt(ve->parent, xim);
00471                 ve->im.xim = xim;
00472                 found = True;
00473                 break;
00474             }
00475 
00476         s = ns + 1;
00477     }
00478     XFree(xim_styles);
00479 
00480     if (!found) {
00481         XCloseIM(xim);
00482         XtAppWarning(XtWidgetToApplicationContext(ve->parent),
00483                      "input method doesn't support my input style");
00484     }
00485 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Reconnect ( XawVendorShellExtPart ve  )  [static]

Definition at line 1288 of file XawIm.c.

References AllCreateIC(), FALSE, IsSharedIC(), NULL, OpenIM(), and p.

01290 {
01291     XawIcTableList      p;
01292 
01293     ve->im.open_im = True;
01294     if (ve->im.xim == NULL) {
01295         OpenIM(ve);
01296     }
01297     if (ve->im.xim == NULL) return;
01298 
01299     if (IsSharedIC(ve)) {
01300         p = ve->ic.shared_ic_table;
01301         p->flg = p->prev_flg;
01302         p->openic_error = FALSE;
01303     } else {
01304         for (p = ve->ic.ic_table; p; p = p->next) {
01305             p->flg = p->prev_flg;
01306             p->openic_error = FALSE;
01307         }
01308     }
01309     AllCreateIC(ve);
01310 }

Here is the call graph for this function:

static void Register ( Widget  inwidg,
XawVendorShellExtPart ve 
) [static]

Definition at line 1215 of file XawIm.c.

References CreateIC(), FALSE, XawVendorShellExtPart::im, IsRegistered(), NULL, OpenIM(), XawVendorShellExtPart::parent, RegisterToVendorShell(), SetICFocus(), and _XawImPart::xim.

Referenced by _XawImRegister().

01218 {
01219     if (ve->im.xim == NULL)
01220         {
01221             OpenIM(ve);
01222         }
01223 
01224     if (IsRegistered(inwidg, ve)) return;
01225 
01226     if (RegisterToVendorShell(inwidg, ve) == FALSE) return;
01227 
01228     if (ve->im.xim == NULL) return;
01229 
01230     if (XtIsRealized(ve->parent))
01231         {
01232             CreateIC(inwidg, ve);
01233             SetICFocus(inwidg, ve);
01234         }
01235 }

Here is the call graph for this function:

Here is the caller graph for this function:

static Boolean RegisterToVendorShell ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 577 of file XawIm.c.

References CreateIcTable(), FALSE, XawVendorShellExtPart::ic, _XawIcPart::ic_table, NULL, table, and TRUE.

Referenced by Register().

00580 {
00581     XawIcTableList      table;
00582 
00583     if ((table = CreateIcTable(w, ve)) == NULL) return(FALSE);
00584     table->next = ve->ic.ic_table;
00585     ve->ic.ic_table = table;
00586     return(TRUE);
00587 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void ResizeVendorShell ( VendorShellWidget  vw,
XawVendorShellExtPart ve 
) [static]

Definition at line 538 of file XawIm.c.

References FALSE, XawVendorShellExtPart::ic, _XawIcPart::ic_table, IsSharedIC(), NULL, p, ResizeVendorShell_Core(), and _XawIcPart::shared_ic_table.

Referenced by _XawImResizeVendorShell().

00541 {
00542     XawIcTableList               p;
00543 
00544     if (IsSharedIC(ve)) {
00545         p = ve->ic.shared_ic_table;
00546         if (p->xic == NULL) return;
00547         ResizeVendorShell_Core(vw, ve, p);
00548         return;
00549     }
00550     for (p = ve->ic.ic_table; p; p = p->next) {
00551         if (p->xic == NULL) continue;
00552         if (ResizeVendorShell_Core(vw, ve, p) == FALSE) return;
00553     }
00554 }

Here is the call graph for this function:

Here is the caller graph for this function:

static Boolean ResizeVendorShell_Core ( VendorShellWidget  vw,
XawVendorShellExtPart ve,
XawIcTableList  p 
) [static]

Definition at line 487 of file XawIm.c.

References _XawImPart::area_height, FALSE, XawVendorShellExtPart::im, NULL, p, and TRUE.

Referenced by ResizeVendorShell().

00491 {
00492     XVaNestedList               pe_attr, st_attr;
00493     XRectangle                  pe_area, st_area;
00494     XRectangle                  *get_pe_area = NULL, *get_st_area = NULL;
00495 
00496     st_area.width = 0;
00497     if (p->input_style & XIMStatusArea) {
00498         st_attr = XVaCreateNestedList(0, XNArea, &get_st_area, NULL);
00499         XGetICValues(p->xic, XNStatusAttributes, st_attr, NULL);
00500         XFree(st_attr);
00501         if (p->xic == NULL) {
00502             return(FALSE);
00503         }
00504         st_area.x = 0;
00505         st_area.y = vw->core.height - ve->im.area_height;
00506         st_area.width = get_st_area->width;
00507         st_area.height = get_st_area->height;
00508         XFree(get_st_area);
00509         st_attr = XVaCreateNestedList(0, XNArea, &st_area, NULL);
00510         XSetICValues(p->xic, XNStatusAttributes, st_attr, NULL);
00511         XFree(st_attr);
00512         if (p->xic == NULL) {
00513             return(FALSE);
00514         }
00515     }
00516     if (p->input_style & XIMPreeditArea) {
00517         pe_attr = XVaCreateNestedList(0, XNArea, &get_pe_area, NULL);
00518         XGetICValues(p->xic, XNPreeditAttributes, pe_attr, NULL);
00519         XFree(pe_attr);
00520         if (p->xic == NULL) {
00521             return(FALSE);
00522         }
00523         pe_area.x = st_area.width;
00524         pe_area.y = vw->core.height - ve->im.area_height;
00525         pe_area.width = vw->core.width;
00526         pe_area.height = get_pe_area->height;
00527         if (p->input_style & XIMStatusArea) {
00528             pe_area.width -= st_area.width;
00529         }
00530         XFree(get_pe_area);
00531         pe_attr = XVaCreateNestedList(0, XNArea, &pe_area, NULL);
00532         XSetICValues(p->xic, XNPreeditAttributes, pe_attr, NULL);
00533         XFree(pe_attr);
00534     }
00535     return(TRUE);
00536 }

Here is the caller graph for this function:

static VendorShellWidget SearchVendorShell ( Widget  w  )  [static]

Definition at line 140 of file XawIm.c.

References NULL.

Referenced by _XawImCallVendorShellExtResize(), _XawImGetImAreaHeight(), _XawImReconnect(), _XawImRegister(), _XawImUnregister(), _XawImWcLookupString(), ConfigureCB(), SetFocusValues(), and UnsetFocus().

00142 {
00143     while(w && !XtIsShell(w)) w = XtParent(w);
00144     if (w && XtIsVendorShell(w)) return((VendorShellWidget)w);
00145     return(NULL);
00146 }

Here is the caller graph for this function:

static Widget SetErrCnxt ( Widget  w,
XIM  xim 
) [static]

Definition at line 266 of file XawIm.c.

References NULL, _contextErrDataRec::widget, and _contextErrDataRec::xim.

Referenced by OpenIM().

00269 {
00270     contextErrDataRec *contextErrData;
00271 
00272     if (errContext == (XContext)NULL) errContext = XUniqueContext();
00273 
00274     contextErrData = XtNew(contextErrDataRec);
00275     contextErrData->widget = w;
00276     contextErrData->xim = xim;
00277     if (XSaveContext(XtDisplay(w), (Window)xim, errContext,
00278         (char *)contextErrData)) {
00279         return(NULL);
00280     }
00281     return(contextErrData->widget);
00282 }

Here is the caller graph for this function:

static XawVendorShellExtPart* SetExtPart ( VendorShellWidget  w,
XawVendorShellExtWidget  vew 
) [static]

Definition at line 150 of file XawIm.c.

References NULL, _contextDataRec::parent, _contextDataRec::ve, and XawVendorShellExtRec::vendor_ext.

Referenced by _XawImInitialize().

00153 {
00154     contextDataRec *contextData;
00155 
00156     if (extContext == (XContext)NULL) extContext = XUniqueContext();
00157 
00158     contextData = XtNew(contextDataRec);
00159     contextData->parent = (Widget)w;
00160     contextData->ve = (Widget)vew;
00161     if (XSaveContext(XtDisplay(w), (Window)w, extContext, (char *)contextData)) {
00162         return(NULL);
00163     }
00164     return(&(vew->vendor_ext));
00165 }

Here is the caller graph for this function:

static void SetFocus ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1121 of file XawIm.c.

References CIICFocus, FALSE, GetIcTableShared(), IsSharedIC(), NULL, and p.

Referenced by ChangeCursorWhenScilabIsReady(), initgraphic(), MenuButtonProc(), ON_WND_CONSOLE_WM_COMMAND(), ON_WND_CONSOLE_WM_SETFOCUS(), ON_WND_GRAPH_WM_COMMAND(), ON_WND_PARENTGRAPH_WM_COMMAND(), ON_WND_PARENTGRAPH_WM_SETFOCUS(), SetFocusValues(), and TextInit().

01124 {
01125     XawIcTableList      p;
01126     if ((p = GetIcTableShared(w, ve)) == NULL) return;
01127 
01128     if ( p->ic_focused == FALSE || IsSharedIC(ve)) {
01129         p->flg |= CIICFocus;
01130     }
01131     p->prev_flg |= p->flg;
01132 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetFocusValues ( Widget  inwidg,
ArgList  args,
Cardinal  num_args,
Boolean  focus 
) [static]

Definition at line 1157 of file XawIm.c.

References CreateIC(), FALSE, GetExtPart(), XawVendorShellExtPart::im, IsCreatedIC(), NULL, SearchVendorShell(), SetFocus(), SetICFocus(), SetICValues(), SetValues, and _XawImPart::xim.

Referenced by _XawImSetFocusValues(), and _XawImSetValues().

01162 {
01163     XawVendorShellExtPart       *ve;
01164     VendorShellWidget           vw;
01165 
01166     if ((vw = SearchVendorShell(inwidg)) == NULL) return;
01167     if ((ve = GetExtPart(vw))) {
01168         if (num_args > 0) SetValues(inwidg, ve, args, num_args);
01169         if (focus) SetFocus(inwidg, ve);
01170         if (XtIsRealized((Widget)vw) && ve->im.xim) {
01171             if (IsCreatedIC(inwidg, ve)) {
01172                 SetICValues(inwidg, ve, FALSE);
01173                 if (focus) SetICFocus(inwidg, ve);
01174             } else {
01175                 CreateIC(inwidg, ve);
01176                 SetICFocus(inwidg, ve);
01177             }
01178         }
01179     }
01180 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetICFocus ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1028 of file XawIm.c.

References CIICFocus, CurrentSharedIcTable(), FALSE, GetIcTableShared(), XawVendorShellExtPart::im, IsSharedIC(), NULL, p, pp, SharedICChangeFocusWindow(), TRUE, and _XawImPart::xim.

Referenced by AllCreateIC(), Register(), and SetFocusValues().

01031 {
01032     XawIcTableList      p, pp;
01033 
01034     if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
01035         (p->xic == NULL)) return;
01036 
01037     if (IsSharedIC(ve)) {
01038         pp = CurrentSharedIcTable(ve);
01039         if (pp == NULL || pp->widget != w) {
01040             SharedICChangeFocusWindow(w, ve, p);
01041         }
01042     }
01043     if (p->flg & CIICFocus && p->ic_focused == FALSE) {
01044         p->ic_focused = TRUE;
01045         XSetICFocus(p->xic);
01046     }
01047     p->flg &= ~CIICFocus;
01048 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetICValues ( Widget  w,
XawVendorShellExtPart ve,
Boolean  focus 
) [static]

Definition at line 875 of file XawIm.c.

References _XawMultiSinkPosToXY(), _XawTextMargin::bottom, CIBg, CIBgPixmap, CICursorP, CIFg, CIFontSet, CIICFocus, CILineS, FALSE, GetIcTableShared(), height, XawVendorShellExtPart::im, IsSharedIC(), _XawTextMargin::left, maxAscentOfFontSet, maxDescentOfFontSet, NULL, p, XawVendorShellExtPart::parent, _XawTextMargin::right, SetICValuesShared(), SetVaArg(), SetVendorShellHeight(), SizeNegotiation(), _XawTextMargin::top, TRUE, and _XawImPart::xim.

Referenced by SetFocusValues(), and SharedICChangeFocusWindow().

00879 {
00880     XawIcTableList      p;
00881     XPoint              position;
00882     XRectangle          pe_area;
00883     XVaNestedList       pe_attr = NULL, st_attr = NULL;
00884     XPointer            ic_a[20], pe_a[20], st_a[20];
00885     int                 ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
00886     XawTextMargin       *margin;
00887     int                 height;
00888 
00889     if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
00890         (p->xic == NULL)) return;
00891 
00892     if (IsSharedIC(ve)) SetICValuesShared(w, ve, p, TRUE);
00893     XFlush(XtDisplay(w));
00894     if (focus == FALSE &&
00895         !(p->flg & (CIFontSet | CIFg | CIBg |
00896                     CIBgPixmap | CICursorP | CILineS))) return;
00897 #ifdef SPOT
00898     if ((p->input_style & XIMPreeditPosition)
00899         && ((!IsSharedIC(ve) && ((p->flg & ~CIICFocus) == CICursorP))
00900             || (IsSharedIC(ve) && p->flg == CICursorP))) {
00901         _XawMultiSinkPosToXY(w, p->cursor_position, &position.x, &position.y);
00902         _XipChangeSpot(p->xic, position.x, position.y);
00903         p->flg &= ~CICursorP;
00904         return;
00905     }
00906 #endif
00907 
00908     if (p->input_style & (XIMPreeditArea|XIMPreeditPosition|XIMStatusArea)) {
00909         if (p->flg & CIFontSet) {
00910             SetVaArg( &pe_a[pe_cnt], (XPointer) XNFontSet); pe_cnt++;
00911             SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
00912             SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
00913             SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
00914             height = maxAscentOfFontSet(p->font_set)
00915                    + maxDescentOfFontSet(p->font_set);
00916             height = SetVendorShellHeight(ve, height);
00917         }
00918         if (p->flg & CIFg) {
00919             SetVaArg( &pe_a[pe_cnt], (XPointer) XNForeground); pe_cnt++;
00920             SetVaArg( &pe_a[pe_cnt], (XPointer) p->foreground); pe_cnt++;
00921             SetVaArg( &st_a[st_cnt], (XPointer) XNForeground); st_cnt++;
00922             SetVaArg( &st_a[st_cnt], (XPointer) p->foreground); st_cnt++;
00923         }
00924         if (p->flg & CIBg) {
00925             SetVaArg( &pe_a[pe_cnt], (XPointer) XNBackground); pe_cnt++;
00926             SetVaArg( &pe_a[pe_cnt], (XPointer) p->background); pe_cnt++;
00927             SetVaArg( &st_a[st_cnt], (XPointer) XNBackground); st_cnt++;
00928             SetVaArg( &st_a[st_cnt], (XPointer) p->background); st_cnt++;
00929         }
00930         if (p->flg & CIBgPixmap) {
00931             SetVaArg( &pe_a[pe_cnt], (XPointer) XNBackgroundPixmap); pe_cnt++;
00932             SetVaArg( &pe_a[pe_cnt], (XPointer) p->bg_pixmap); pe_cnt++;
00933             SetVaArg( &st_a[st_cnt], (XPointer) XNBackgroundPixmap); st_cnt++;
00934             SetVaArg( &st_a[st_cnt], (XPointer) p->bg_pixmap); st_cnt++;
00935         }
00936         if (p->flg & CILineS) {
00937             SetVaArg( &pe_a[pe_cnt], (XPointer) XNLineSpace); pe_cnt++;
00938             SetVaArg( &pe_a[pe_cnt], (XPointer) p->line_spacing); pe_cnt++;
00939             SetVaArg( &st_a[st_cnt], (XPointer) XNLineSpace); st_cnt++;
00940             SetVaArg( &st_a[st_cnt], (XPointer) p->line_spacing); st_cnt++;
00941         }
00942     }
00943     if (p->input_style & XIMPreeditPosition) {
00944         if (p->flg & CICursorP) {
00945             _XawMultiSinkPosToXY(w, p->cursor_position, &position.x, &position.y);
00946             SetVaArg( &pe_a[pe_cnt], (XPointer) XNSpotLocation); pe_cnt++;
00947             SetVaArg( &pe_a[pe_cnt], (XPointer) &position); pe_cnt++;
00948         }
00949     }
00950     if (IsSharedIC(ve)) {
00951         if (p->input_style & XIMPreeditPosition) {
00952             pe_area.x = 0;
00953             pe_area.y = 0;
00954             pe_area.width = w->core.width;
00955             pe_area.height = w->core.height;
00956             margin = &(((TextWidget)w)->text.margin);
00957             pe_area.x += margin->left;
00958             pe_area.y += margin->top;
00959             pe_area.width -= (margin->left + margin->right - 1);
00960             pe_area.height -= (margin->top + margin->bottom - 1);
00961             SetVaArg( &pe_a[pe_cnt], (XPointer) XNArea); pe_cnt++;
00962             SetVaArg( &pe_a[pe_cnt], (XPointer) &pe_area); pe_cnt++;
00963         }
00964     }
00965 
00966     if (pe_cnt > 0) {
00967         SetVaArg( &pe_a[pe_cnt], (XPointer) NULL);
00968         pe_attr = XVaCreateNestedList(0, pe_a[0], pe_a[1], pe_a[2], pe_a[3],
00969                                       pe_a[4], pe_a[5], pe_a[6], pe_a[7],
00970                                       pe_a[8], pe_a[9], pe_a[10], pe_a[11],
00971                                       pe_a[12], pe_a[13], pe_a[14], pe_a[15],
00972                                       pe_a[16], pe_a[17], pe_a[18],  pe_a[19]);
00973         SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++;
00974         SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++;
00975     }
00976     if (st_cnt > 0) {
00977         SetVaArg( &st_a[st_cnt], (XPointer) NULL);
00978         st_attr = XVaCreateNestedList(0, st_a[0], st_a[1], st_a[2], st_a[3],
00979                                       st_a[4], st_a[5], st_a[6], st_a[7],
00980                                       st_a[8], st_a[9], st_a[10], st_a[11],
00981                                       st_a[12], st_a[13], st_a[14], st_a[15],
00982                                       st_a[16], st_a[17], st_a[18],  st_a[19]);
00983         SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++;
00984         SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++;
00985     }
00986     if (focus == TRUE) {
00987         SetVaArg( &ic_a[ic_cnt], (XPointer) XNFocusWindow); ic_cnt++;
00988         SetVaArg( &ic_a[ic_cnt], (XPointer) XtWindow(w)); ic_cnt++;
00989     }
00990     if (ic_cnt > 0) {
00991         SetVaArg( &ic_a[ic_cnt], (XPointer) NULL);
00992         XSetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4],
00993                      ic_a[5], ic_a[6], ic_a[7], ic_a[8], ic_a[9], ic_a[10],
00994                      ic_a[11], ic_a[12], ic_a[13], ic_a[14], ic_a[15],
00995                      ic_a[16], ic_a[17], ic_a[18], ic_a[19]);
00996         if (pe_attr) XtFree(pe_attr);
00997         if (st_attr) XtFree(st_attr);
00998     }
00999 
01000     if (IsSharedIC(ve) && p->flg & CIFontSet)
01001         SizeNegotiation(p, ve->parent->core.width, ve->parent->core.height);
01002 
01003     p->flg &= ~(CIFontSet | CIFg | CIBg | CIBgPixmap | CICursorP | CILineS);
01004 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetICValuesShared ( Widget  w,
XawVendorShellExtPart ve,
XawIcTableList  p,
Boolean  check 
) [static]

Definition at line 605 of file XawIm.c.

References CIBg, CIBgPixmap, CICursorP, CIFg, CIFontSet, CILineS, CurrentSharedIcTable(), GetIcTable(), NULL, p, pp, and TRUE.

Referenced by CreateIC(), and SetICValues().

00610 {
00611     XawIcTableList      pp;
00612 
00613     if ((pp = GetIcTable(w, ve)) == NULL) return;
00614     if (check == TRUE && CurrentSharedIcTable(ve) != pp) return;
00615 
00616     if (pp->prev_flg & CICursorP && p->cursor_position != pp->cursor_position) {
00617         p->cursor_position = pp->cursor_position;
00618         p->flg |= CICursorP;
00619     }
00620     if (pp->prev_flg & CIFontSet && p->font_set != pp->font_set) {
00621         p->font_set = pp->font_set;
00622         p->flg |= (CIFontSet|CICursorP);
00623     }
00624     if (pp->prev_flg & CIFg && p->foreground != pp->foreground) {
00625         p->foreground = pp->foreground;
00626         p->flg |= CIFg;
00627     }
00628     if (pp->prev_flg & CIBg && p->background != pp->background) {
00629         p->background = pp->background;
00630         p->flg |= CIBg;
00631     }
00632     if (pp->prev_flg & CIBgPixmap && p->bg_pixmap != pp->bg_pixmap) {
00633         p->bg_pixmap = pp->bg_pixmap;
00634         p->flg |= CIBgPixmap;
00635     }
00636     if (pp->prev_flg & CILineS && p->line_spacing != pp->line_spacing) {
00637         p->line_spacing = pp->line_spacing;
00638         p->flg |= CILineS;
00639     }
00640 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetVaArg ( XPointer *  arg,
XPointer  value 
) [static]

Definition at line 134 of file XawIm.c.

Referenced by CreateIC(), SetICValues(), and SizeNegotiation().

00136 {
00137     *arg = value;
00138 }

Here is the caller graph for this function:

static void SetValues ( Widget  w,
XawVendorShellExtPart ve,
ArgList  args,
Cardinal  num_args 
) [static]

Definition at line 1071 of file XawIm.c.

References GetIcTable(), i, XawVendorShellExtPart::im, memcpy(), NULL, p, _XawImPart::resources, and xrmres.

01076 {
01077     ArgList     arg;
01078 
01079     XrmName     argName;
01080     XrmResourceList     xrmres;
01081     int i;
01082     XawIcTablePart      *p, save_tbl;
01083 
01084     if ((p = GetIcTable(w, ve)) == NULL) return;
01085 
01086     memcpy(&save_tbl, p, sizeof(XawIcTablePart));
01087 
01088     for (arg = args ; num_args != 0; num_args--, arg++) {
01089         argName = XrmStringToName(arg->name);
01090         for (xrmres = (XrmResourceList)ve->im.resources, i = 0;
01091              i < ve->im.num_resources; i++, xrmres++) {
01092             if (argName == xrmres->xrm_name) {
01093                 _XtCopyFromArg(arg->value,
01094                                (char *)p - xrmres->xrm_offset - 1,
01095                                xrmres->xrm_size);
01096                 break;
01097             }
01098         }
01099     }
01100     if (p->font_set != save_tbl.font_set) {
01101         p->flg |= CIFontSet;
01102     }
01103     if (p->foreground != save_tbl.foreground) {
01104         p->flg |= CIFg;
01105     }
01106     if (p->background !=save_tbl.background) {
01107         p->flg |= CIBg;
01108     }
01109     if (p->bg_pixmap != save_tbl.bg_pixmap) {
01110         p->flg |= CIBgPixmap;
01111     }
01112     if (p->cursor_position != save_tbl.cursor_position) {
01113         p->flg |= CICursorP;
01114     }
01115     if (p->line_spacing != save_tbl.line_spacing) {
01116         p->flg |= CILineS;
01117     }
01118     p->prev_flg |= p->flg;
01119 }

Here is the call graph for this function:

static Dimension SetVendorShellHeight ( XawVendorShellExtPart ve,
Dimension  height 
) [static]

Definition at line 291 of file XawIm.c.

References args, and i.

Referenced by CreateIC(), DestroyAllIM(), SetICValues(), and Unregister().

00294 {
00295     Arg                 args[2];
00296     Cardinal            i = 0;
00297 
00298    if (ve->im.area_height < height || height == 0) {
00299        XtSetArg(args[i], XtNheight,
00300                 (ve->parent->core.height + height - ve->im.area_height));
00301        ve->im.area_height = height;
00302        XtSetValues(ve->parent, args, 1);
00303    }
00304    return(ve->im.area_height);
00305 }

Here is the caller graph for this function:

static void SharedICChangeFocusWindow ( Widget  w,
XawVendorShellExtPart ve,
XawIcTableList  p 
) [static]

Definition at line 1006 of file XawIm.c.

References _XawIcPart::current_ic_table, GetIcTable(), XawVendorShellExtPart::ic, NULL, pp, SetICValues(), and TRUE.

Referenced by SetICFocus(), and UnsetICFocus().

01010 {
01011     XawIcTableList      pp;
01012 
01013     if (w == NULL) {
01014         ve->ic.current_ic_table = NULL;
01015         return;
01016     }
01017     if ((pp = GetIcTable(w, ve)) == NULL) return;
01018     ve->ic.current_ic_table = pp;
01019     SetICValues(w, ve, TRUE);
01020 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void SizeNegotiation ( XawIcTableList  p,
Dimension  width,
Dimension  height 
) [static]

Definition at line 654 of file XawIm.c.

References NULL, and SetVaArg().

Referenced by CreateIC(), and SetICValues().

00657 {
00658     XRectangle          pe_area, st_area;
00659     XVaNestedList       pe_attr = NULL, st_attr = NULL;
00660     int                 ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
00661     XRectangle          *pe_area_needed = NULL, *st_area_needed = NULL;
00662     XPointer            ic_a[5];
00663 
00664     if (p->input_style & XIMPreeditArea) {
00665         pe_attr = XVaCreateNestedList(0, XNAreaNeeded, &pe_area_needed, NULL);
00666         SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++;
00667         SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++;
00668     }
00669     if (p->input_style & XIMStatusArea) {
00670         st_attr = XVaCreateNestedList(0, XNAreaNeeded, &st_area_needed, NULL);
00671         SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++;
00672         SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++;
00673     }
00674     SetVaArg( &ic_a[ic_cnt], (XPointer) NULL);
00675 
00676     if (ic_cnt > 0) {
00677         XGetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4]);
00678         if (pe_attr) XFree(pe_attr);
00679         if (st_attr) XFree(st_attr);
00680         if (p->xic == NULL) {
00681             p->openic_error = True;
00682             return;
00683         }
00684         pe_attr = st_attr = NULL;
00685         ic_cnt = pe_cnt = st_cnt = 0;
00686         if (p->input_style & XIMStatusArea) {
00687             st_area.height = st_area_needed->height;
00688             st_area.x = 0;
00689             st_area.y = height - st_area.height;
00690             if (p->input_style & XIMPreeditArea) {
00691                 st_area.width = st_area_needed->width;
00692             } else {
00693                 st_area.width = width;
00694             }
00695 
00696             XFree(st_area_needed);
00697             st_attr = XVaCreateNestedList(0, XNArea, &st_area, NULL);
00698             SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++;
00699             SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++;
00700         }
00701         if (p->input_style & XIMPreeditArea) {
00702             if (p->input_style & XIMStatusArea) {
00703                 pe_area.x = st_area.width;
00704                 pe_area.width = width - st_area.width;
00705             } else {
00706                 pe_area.x = 0;
00707                 pe_area.width = width;
00708             }
00709             pe_area.height = pe_area_needed->height;
00710             XFree(pe_area_needed);
00711             pe_area.y = height - pe_area.height;
00712             pe_attr = XVaCreateNestedList(0, XNArea, &pe_area, NULL);
00713             SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++;
00714             SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++;
00715         }
00716         SetVaArg( &ic_a[ic_cnt], (XPointer) NULL);
00717         XSetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4]);
00718         if (pe_attr) XFree(pe_attr);
00719         if (st_attr) XFree(st_attr);
00720         if (p->xic == NULL) {
00721             p->openic_error = True;
00722             return;
00723         }
00724     }
00725 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void Unregister ( Widget  inwidg,
XawVendorShellExtPart ve 
) [static]

Definition at line 1244 of file XawIm.c.

References CloseIM(), DestroyIC(), IsRegistered(), NoRegistered(), NULL, SetVendorShellHeight(), UnregisterFromVendorShell(), and void().

Referenced by _XawImUnregister().

01247 {
01248     if (!IsRegistered(inwidg, ve)) return;
01249 
01250     DestroyIC(inwidg, ve);
01251 
01252     UnregisterFromVendorShell(inwidg, ve);
01253 
01254     if (NoRegistered(ve))
01255         {
01256             CloseIM(ve);
01257             ve->im.xim = NULL;
01258             /*
01259              * resize vendor shell to core size
01260             */
01261             (void) SetVendorShellHeight(ve, 0);
01262         }
01263 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void UnregisterFromVendorShell ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 589 of file XawIm.c.

References XawVendorShellExtPart::ic, _XawIcPart::ic_table, and p.

Referenced by Unregister().

00592 {
00593     XawIcTableList      *prev, p;
00594 
00595     for (prev = &ve->ic.ic_table; (p = *prev); prev = &p->next) {
00596         if (p->widget == w) {
00597             *prev = p->next;
00598             XtFree((char *)p);
00599             break;
00600         }
00601     }
00602     return;
00603 }

Here is the caller graph for this function:

static void UnsetFocus ( Widget  inwidg  )  [static]

Definition at line 1182 of file XawIm.c.

References CIICFocus, GetExtPart(), GetIcTableShared(), XawVendorShellExtPart::im, NULL, p, SearchVendorShell(), UnsetICFocus(), and _XawImPart::xim.

Referenced by _XawImUnsetFocus().

01184 {
01185     XawVendorShellExtPart       *ve;
01186     VendorShellWidget           vw;
01187     XawIcTableList              p;
01188 
01189     if ((vw = SearchVendorShell(inwidg)) == NULL) return;
01190     if ((ve = GetExtPart(vw))) {
01191         if ((p = GetIcTableShared(inwidg, ve)) == NULL) return;
01192         if (p->flg & CIICFocus) {
01193             p->flg &= ~CIICFocus;
01194         }
01195         p->prev_flg &= ~CIICFocus;
01196         if (ve->im.xim && XtIsRealized((Widget)vw) && p->xic) {
01197             UnsetICFocus(inwidg, ve);
01198         }
01199     }
01200 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void UnsetICFocus ( Widget  w,
XawVendorShellExtPart ve 
) [static]

Definition at line 1050 of file XawIm.c.

References CurrentSharedIcTable(), FALSE, GetIcTableShared(), XawVendorShellExtPart::im, IsSharedIC(), NULL, p, pp, SharedICChangeFocusWindow(), TRUE, and _XawImPart::xim.

Referenced by DestroyIC(), and UnsetFocus().

01053 {
01054     XawIcTableList      p, pp;
01055 
01056     if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
01057         (p->xic == NULL)) return;
01058 
01059     if (IsSharedIC(ve) && (pp = CurrentSharedIcTable(ve))) {
01060         if (pp->widget != w) {
01061             return;
01062         }
01063         SharedICChangeFocusWindow(NULL, ve, p);
01064     }
01065     if (p->ic_focused == TRUE) {
01066         XUnsetICFocus(p->xic);
01067         p->ic_focused = FALSE;
01068     }
01069 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void VendorShellDestroyed ( Widget  w,
XtPointer  cl_data,
XtPointer  ca_data 
) [static]

Definition at line 373 of file XawIm.c.

References DestroyAllIM(), FreeAllDataOfVendorShell(), GetExtPart(), and NULL.

Referenced by _XawImInitialize().

00376 {
00377     XawVendorShellExtPart       *ve;
00378 
00379     if ( ( ve = GetExtPart( (VendorShellWidget) w ) ) == NULL ) return;
00380     DestroyAllIM( ve );
00381     FreeAllDataOfVendorShell( ve, (VendorShellWidget) w );
00382     return;
00383 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

XContext errContext = (XContext)NULL [static]

Definition at line 264 of file XawIm.c.

Referenced by Destroy().

XContext extContext = (XContext)NULL [static]

Definition at line 148 of file XawIm.c.

Referenced by Destroy().

XtResource resources[] [static]

Initial value:

{
    {
        XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
        Offset (font_set), XtRString, XtDefaultFontSet
    },
    {
        XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
        Offset (foreground), XtRString, (XtPointer)"XtDefaultForeground"
    },
    {
        XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
        Offset (background), XtRString, (XtPointer)"XtDefaultBackground"
    },
    {
        XtNbackgroundPixmap, XtCPixmap, XtRPixmap, sizeof(Pixmap),
        Offset (bg_pixmap), XtRImmediate, (XtPointer) XtUnspecifiedPixmap
    },
    {
        XtNinsertPosition, XtCTextPosition, XtRInt, sizeof (XawTextPosition),
        Offset (cursor_position), XtRImmediate, (XtPointer) 0
    }
}

Definition at line 108 of file XawIm.c.


Generated on Sun Mar 4 16:03:22 2007 for Scilab [trunk] by  doxygen 1.5.1