Back to index

im-sdk  12.3.91
Defines | Functions | Variables
XAuxMethods.c File Reference
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/Xutil.h>
#include <X11/Xcms.h>
#include <X11/Xprotostr.h>
#include <assert.h>
#include <locale.h>
#include <dlfcn.h>
#include <thread.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <Xm/XmAll.h>
#include "XSunExt.h"
#include "XSunIMProt.h"
#include "XSunIMMthd.h"
#include "GeneType.h"
#include "XAuxMethods.h"

Go to the source code of this file.

Defines

#define SKB_SYMBSCIENT   0
#define SKB_SERIESONE   1
#define SKB_SERIESTWO   2
#define SKB_SERIESTHREE   3
#define SKB_SERIESFOUR   4
#define SKB_GREECE   5
#define SKB_RUSSIAN   6
#define SKB_PYSYM   7
#define SKB_JAPPIN   8
#define SKB_JAPPIAN   9
#define SKB_TABSYMB   10
#define SKB_GBKEXTSYM1   11
#define SKB_GBKEXTSYM2   12
#define SKB_HALFWID   13
#define SKB_FULLWID   14
#define TOTAL_SKB   15
#define PUNCT_CHINESE   0
#define PUNCT_ENGLISH   1
#define TOTAL_PUNCT   2

Functions

static XAux_SesDspParaNodePrefixNewNode (int nIcID)
static XAux_SesDspParaNodeGetNodeAddressByIcID (int nIcID)
static BOOL DestroyNode (int nIcID)
static BOOL SetAuxNodeValues (XAux_SesDspParaNode *pThisSdpn, XAuxAttribute *pAttrArray, int nArraySize)
static BOOL GetAuxNodeValues (XAux_SesDspParaNode *pThisSdpn, XAuxAttribute *pAttrArray, int nArraySize)
static BOOL CreateGUI (XAux_SesDspParaNode *pThisSdpn)
static BOOL MapGUI (XAux_SesDspParaNode *pThisSdpn)
static BOOL UnmapGUI (XAux_SesDspParaNode *pThisSdpn)
static void aux_event_handler (Display *pDsp, Window wnd, XEvent *pEvent, void *pvCallData)
static void ListXwaStruct (XWindowAttributes *pXwa)
static void UpdateWndBmp1 (XAux_SesDspParaNode *pThisSdpn)
static void UpdateWndBmp2 (XAux_SesDspParaNode *pThisSdpn)
BOOL XAux_Create (int nIcID, XAuxAttribute *pAttrArray, int nArraySize)
BOOL XAux_Start (int nIcID, XIMAuxStartCallbackStruct *pAcbs)
BOOL XAux_Draw (int nIcID, XIMAuxDrawCallbackStruct *pAcbs)
BOOL XAux_Done (int nIcID, XIMAuxDoneCallbackStruct *pAcbs)
BOOL XAux_SetFocus (int nIcID)
BOOL XAux_UnsetFocus (int nIcID)
BOOL XAux_SetValues (int nIcID, XAuxAttribute *pAttrArray, int nArraySize)
BOOL XAux_GetValues (int nIcID, XAuxAttribute *pAttrArray, int nArraySize)
BOOL XAux_Destroy (int nIcID)
void cancel_cb (Widget w, XtPointer clientData, XtPointer callData)
void start_cb (Widget, XtPointer, XtPointer)
void start_aux2 (Widget)
static void * accept_loop (void *client_data)

Variables

const int PUNCTUATION_STATUS = 1
const int SOFTKEYBOARD_LAYOUT = 2
const int BUTTON_NUMBER = 3
static int nDebugInt = 0
xaux_methods_t xaux_methods
XAux_SesDspParaNodepgAuxSdpnList = NULL
Widget toplevel
Widget main_window
Widget aux2_dialog
Widget startbutton
Widget sendbutton
Widget donebutton
Widget form
Widget rc
XtAppContext app_context
Widget label

Define Documentation

#define PUNCT_CHINESE   0

Definition at line 92 of file XAuxMethods.c.

#define PUNCT_ENGLISH   1

Definition at line 93 of file XAuxMethods.c.

#define SKB_FULLWID   14

Definition at line 88 of file XAuxMethods.c.

#define SKB_GBKEXTSYM1   11

Definition at line 85 of file XAuxMethods.c.

#define SKB_GBKEXTSYM2   12

Definition at line 86 of file XAuxMethods.c.

#define SKB_GREECE   5

Definition at line 79 of file XAuxMethods.c.

#define SKB_HALFWID   13

Definition at line 87 of file XAuxMethods.c.

#define SKB_JAPPIAN   9

Definition at line 83 of file XAuxMethods.c.

#define SKB_JAPPIN   8

Definition at line 82 of file XAuxMethods.c.

#define SKB_PYSYM   7

Definition at line 81 of file XAuxMethods.c.

#define SKB_RUSSIAN   6

Definition at line 80 of file XAuxMethods.c.

#define SKB_SERIESFOUR   4

Definition at line 78 of file XAuxMethods.c.

#define SKB_SERIESONE   1

Definition at line 75 of file XAuxMethods.c.

#define SKB_SERIESTHREE   3

Definition at line 77 of file XAuxMethods.c.

#define SKB_SERIESTWO   2

Definition at line 76 of file XAuxMethods.c.

#define SKB_SYMBSCIENT   0

Definition at line 74 of file XAuxMethods.c.

#define SKB_TABSYMB   10

Definition at line 84 of file XAuxMethods.c.

#define TOTAL_PUNCT   2

Definition at line 95 of file XAuxMethods.c.

#define TOTAL_SKB   15

Definition at line 90 of file XAuxMethods.c.


Function Documentation

static void * accept_loop ( void *  client_data) [static]

Definition at line 948 of file XAuxMethods.c.

{
printf("accept_loo\n");
    XtAppMainLoop((XtAppContext)app_context);
printf("accept_loop exit\n");
    return 0;
}

Here is the caller graph for this function:

static void aux_event_handler ( Display *  pDsp,
Window  wnd,
XEvent *  pEvent,
void *  pvCallData 
) [static]

Here is the caller graph for this function:

void cancel_cb ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)

Definition at line 786 of file XAuxMethods.c.

{
    if (clientData) {
        XtUnrealizeWidget((Widget) clientData);
    }
}

Here is the caller graph for this function:

static BOOL CreateGUI ( XAux_SesDspParaNode pThisSdpn) [static]

Definition at line 804 of file XAuxMethods.c.

{
#ifdef notdef
       Display  *pDsp;
       Window    wndHttWin;
       int       nScreenNum;
       int       nStatus;
       Window    wndRoot, wndParent, *pwndChilds;
       UINT      nNumChild;
       
       XWindowAttributes *pXwa;

       pDsp       = pThisSdpn->pDsp;      
       wndHttWin  = pThisSdpn->wndHttWin;
       nScreenNum = DefaultScreen(pDsp);
       
       if (pThisSdpn->pDsp != NULL)
       {
              nStatus = XQueryTree(pDsp, wndHttWin, &wndRoot, &wndParent, &pwndChilds, &nNumChild);
              if (nStatus != 0)
              {
                     XGetWindowAttributes(pDsp, wndParent, pXwa);
/*
                     ListXwaStruct(pXwa);
*/
                     pThisSdpn->wndParent = wndParent;
              }
              else
              {
                     printf("Error: XAuxMethods failed in XQueryTree()!\n");
                     return FALSE;
              }
       }
       
       /* This Window has nothing to do!! */
       pThisSdpn->wndIM = XCreateSimpleWindow(pDsp, wndHttWin,
                            pThisSdpn->rectArea.x,
                            pThisSdpn->rectArea.y,
                            pThisSdpn->rectArea.width,
                            pThisSdpn->rectArea.height,
                            0,                    /* Border Width */
                            pThisSdpn->bgPix,     /* Border Pixel */
                            pThisSdpn->bgPix);    /* Background Pixel */
       
       XMapWindow(pDsp, pThisSdpn->wndIM);
       
       
       /* Create and Map Bitmap1 Window */
       pThisSdpn->wndBmp1 = XCreateSimpleWindow (pDsp, wndParent,
                            (pXwa->width) - 50, 2,
                            16,        /* Width */
                            16,        /* Height */
                            0,
                            WhitePixel(pDsp, nScreenNum),
                            WhitePixel(pDsp, nScreenNum));
       
       XSelectInput (pDsp, pThisSdpn->wndBmp1, ExposureMask | ButtonPressMask | VisibilityChangeMask);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp1, Expose, Expose,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp1, ButtonPress, ButtonPress,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp1, VisibilityNotify, VisibilityNotify,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
/*     XMapWindow(pDsp, pThisSdpn->wndBmp1);*/
       
       /* Create and Map Bitmap2 Window */
       pThisSdpn->wndBmp2 = XCreateSimpleWindow (pDsp, wndParent,
                   (pXwa->width) - 30, 2,
                   16,
                   16,
                   0,
                   WhitePixel(pDsp, nScreenNum),
                   WhitePixel(pDsp, nScreenNum));

       XSelectInput (pDsp, pThisSdpn->wndBmp2, ExposureMask | ButtonPressMask | VisibilityChangeMask);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp2, Expose, Expose,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp2, ButtonPress, ButtonPress,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
       _XRegisterFilterByType (pDsp, pThisSdpn->wndBmp2, VisibilityNotify, VisibilityNotify,
                              (BOOL(*)())aux_event_handler, (void *)pThisSdpn);
/*     XMapWindow(pDsp, pThisSdpn->wndBmp2); */
       
       XFree(pXwa);
#else
    {
    thread_t tid;
    int argc = 0;
    char **argv = 0;
    Arg args[20];
    int i;
    XtToolkitThreadInitialize();
    XtSetLanguageProc(NULL, NULL, NULL);
    toplevel = XtVaAppInitialize(&app_context,
                             "test",
                             NULL, NULL,
                             &argc, argv,
                             NULL, NULL);
    main_window = XmCreateMainWindow(toplevel, "mainw", NULL, 0);
    XtManageChild(main_window);
    i = 0;
    XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNleftOffset, 10); i++;
    XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNrightOffset, 10); i++;
    XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNtopOffset, 10); i++;
    XtSetArg(args[i], XmNorientation, XmHORIZONTAL); i++;
    rc = XmCreateRowColumn(main_window, "rowc", args, i);
    XtManageChild(rc);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Add Word", XmSTRING_DEFAULT_CHARSET));
    i++;
    startbutton = XmCreatePushButton(rc, "addword", args, i);
    XtAddCallback(startbutton, XmNactivateCallback, start_cb, main_window);
    XtManageChild(startbutton);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Send Data To Engine", XmSTRING_DEFAULT_CHARSET));
    i++;
    sendbutton = XmCreatePushButton(rc, "sendbutton", args, i);
    XtManageChild(sendbutton);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Done", XmSTRING_DEFAULT_CHARSET));
    i++;
    donebutton = XmCreatePushButton(rc, "donebutton", args, i);
    XtManageChild(donebutton);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("DISPLAY RECEIVED DATA", XmSTRING_DEFAULT_CHARSET));
    i++;
    label = XmCreateLabel(rc, "label", args, i);
    XtManageChild(label);

    thr_create(NULL, 0, accept_loop, 0, THR_BOUND, &tid);
    }
#endif
       
    return TRUE;
}

Here is the call graph for this function:

static BOOL DestroyNode ( int  nIcID) [static]

Definition at line 246 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       XAux_SesDspParaNode  *pPrevNext;
       int   nFoundFlag;
       
       /* None node in pgAuxSdpnList */
       if (pgAuxSdpnList == NULL)
              return FALSE;
              
       /* The first node is just this one */
       pThisSdpn = pgAuxSdpnList;
       if (pThisSdpn->nIcID == nIcID)
       {
              pgAuxSdpnList = pThisSdpn->next;
              free (pThisSdpn);
              return TRUE;
       }
              
       /* Else, start directly from the 2th node in list */
       pThisSdpn  = pgAuxSdpnList->next;
       pPrevNext  = pgAuxSdpnList;
       nFoundFlag = FALSE;
       
       while (pThisSdpn)
       {
              if (pThisSdpn->nIcID == nIcID)
              {
                     pPrevNext->next = pThisSdpn->next;
                     free (pThisSdpn);
                     nFoundFlag = TRUE;
                     break;
              }
              else
              {
                     pThisSdpn = pThisSdpn->next;
                     pPrevNext = pPrevNext->next;
              }
       }
       
       return nFoundFlag;
}

Here is the caller graph for this function:

static BOOL GetAuxNodeValues ( XAux_SesDspParaNode pThisSdpn,
XAuxAttribute pAttrArray,
int  nArraySize 
) [static]

Definition at line 398 of file XAuxMethods.c.

{
       XAuxAttribute   *pTmpAttr;
       
       for( ; nArraySize > 0; nArraySize--)
       {
              pTmpAttr = &(pAttrArray[nArraySize - 1]);
/*
#ifndef NDEBUG
              if ((pTmpAttr->nAttrID >= 1) && (pTmpAttr->nAttrID <= 17))
              {
                     printf ("   ==+++> GetAuxNodeValues [%02d] %s\n", 
                             pTmpAttr->nAttrID, szAttrNames[pTmpAttr->nAttrID - 1]);
              }
              else
                     printf ("   ==+++> GetAuxNodeValues [%02d] %s\n", 
                             pTmpAttr->nAttrID, "???????");
#endif
*/
              
              switch (pTmpAttr->nAttrID)
              {
              case XAUX_DISPLAY :
                     pTmpAttr->pvValue      = (void *)(pThisSdpn->pDsp);
                     pTmpAttr->nLenValue    = sizeof(Display*);
                     break;
                     
              case XAUX_SCREENNUM :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->nScreenNum);
                     pTmpAttr->nLenValue    = sizeof(int);
                     break;

              case XAUX_HTTWINDOW :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->wndHttWin);
                     pTmpAttr->nLenValue    = sizeof(Window);
                     break;
                     
              case XAUX_FONTSET :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->xfsFontSet);
                     pTmpAttr->nLenValue    = sizeof(XFontSet);
                     break;
                     
              case XAUX_AREA :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->rectArea);
                     pTmpAttr->nLenValue    = sizeof(XRectangle);
                     break;
                     
              case XAUX_AREANEEDED :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->rectNeeded);
                     pTmpAttr->nLenValue    = sizeof(XRectangle);
                     break;
                     
              case XAUX_COLORMAP :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->cmap);
                     pTmpAttr->nLenValue    = sizeof(Colormap);
                     break;

              case XAUX_STDCOLORMAP :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->cmapStd);
                     pTmpAttr->nLenValue    = sizeof(Colormap);
                     break;

              case XAUX_FOREGROUND :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->fgPix);
                     pTmpAttr->nLenValue    = sizeof(unsigned long);
                     break;

              case XAUX_BACKGROUND :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->bgPix);
                     pTmpAttr->nLenValue    = sizeof(unsigned long);
                     break;
                     
              case XAUX_LOCATION :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->xyPointLoc);
                     pTmpAttr->nLenValue    = sizeof(xPoint);
                     break;
                     
              case XAUX_FONTNAME:
                     pTmpAttr->pvValue      = (void *)(pThisSdpn->pszFontName);
                     pTmpAttr->nLenValue    = sizeof(char *);
                     break;
                     
              case XAUX_REPLYCALLBACK :
                     pTmpAttr->pvValue      = (void *)(pThisSdpn->fpReplyCb);
                     pTmpAttr->nLenValue    = sizeof(void (*)());
                     break;
                     
              case XAUX_REPLYCLIENTDATA :
                     pTmpAttr->pvValue      = (void *)(pThisSdpn->pbReplyData);
                     pTmpAttr->nLenValue    = sizeof(void *);
                     break;
                     
              case XAUX_GC :
                     pTmpAttr->pvValue      = (void *)&(pThisSdpn->gc);
                     pTmpAttr->nLenValue    = sizeof(GC);
                     break;
                     
              default :
                     break;
              }
       }
       
       return True;
}

Here is the caller graph for this function:

static XAux_SesDspParaNode * GetNodeAddressByIcID ( int  nIcID) [static]

Definition at line 212 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       XAux_SesDspParaNode  *pTmpSdpn;
       
       pThisSdpn = NULL;
       pTmpSdpn  = pgAuxSdpnList;
       
       while (pTmpSdpn)
       {
              if (pTmpSdpn->nIcID == nIcID)
              {
                     pThisSdpn = pTmpSdpn;
                     break;
              }
              else
                     pTmpSdpn  = pTmpSdpn->next;
       }
       
       return pThisSdpn;
}

Here is the caller graph for this function:

static void ListXwaStruct ( XWindowAttributes *  pXwa) [static]
static BOOL MapGUI ( XAux_SesDspParaNode pThisSdpn) [static]

Definition at line 761 of file XAuxMethods.c.

{
#ifdef notdef
       UpdateWndBmp1(pThisSdpn);
       UpdateWndBmp2(pThisSdpn);
#else
        XtRealizeWidget(toplevel);
        XtMapWidget(main_window);
#endif
       return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static XAux_SesDspParaNode * PrefixNewNode ( int  nIcID) [static]

Definition at line 165 of file XAuxMethods.c.

{
       XAux_SesDspParaNode   *pNewSdpNode;
       
       /*
        * It is necessary to determine has this icID already existed in List?
        * If yes, don't allocate any more memory. Just move this node to the
        * front of this list. Notice: change ->next correctly.
        * Not implemented yet! ==> Scott Ma 98-05-29
        */
       pNewSdpNode = GetNodeAddressByIcID(nIcID);
       if (pNewSdpNode != NULL)
       {
              fprintf(stderr, "Warning:  PrefixNewNode() this node already existed!\n");
              return pNewSdpNode;
       }
       
       pNewSdpNode     = (XAux_SesDspParaNode*)malloc(sizeof(XAux_SesDspParaNode));
       if (pNewSdpNode == NULL)
       {
              fprintf(stderr, "htt: Failed to malloc() in PrefixNewNode().\n");
              exit(False);
       }
       memset(pNewSdpNode, 0x00, sizeof(XAux_SesDspParaNode));
       
       pNewSdpNode->nPuncState = PUNCT_CHINESE;
       pNewSdpNode->nSkbState  = SKB_HALFWID;
       
       pNewSdpNode->nIcID = nIcID;
       pNewSdpNode->next  = NULL;     /* Null */
       
       /* Update pgAuxSdpnList after memory allocation */
       pNewSdpNode->next = pgAuxSdpnList; /* Place this node in the front of List */
       pgAuxSdpnList     = pNewSdpNode;   /* Added by Scott Ma. 98-05-29 */
       
       /*
        *  Return the full list whose first node is pNewSdpNode. 
        *  Notice: return pgAuxSdpnList is also right!!
        */
       return pNewSdpNode;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL SetAuxNodeValues ( XAux_SesDspParaNode pThisSdpn,
XAuxAttribute pAttrArray,
int  nArraySize 
) [static]

Definition at line 293 of file XAuxMethods.c.

{
       XAuxAttribute   *pTmpAttr;

       for( ; nArraySize > 0; nArraySize--)
       {
              pTmpAttr = &(pAttrArray[nArraySize - 1]);
              
/*
#ifndef NDEBUG
              if ((pTmpAttr->nAttrID >= 1) && (pTmpAttr->nAttrID <= 17))
              {
                     printf ("   ==> SetAuxNodeValues [%02d] %s\n", 
                             pTmpAttr->nAttrID, szAttrNames[pTmpAttr->nAttrID - 1]);

              }
              else
                     printf ("   ==> SetAuxNodeValues [%02d] %s\n", 
                             pTmpAttr->nAttrID, "???????");
#endif
*/
              
              switch (pTmpAttr->nAttrID)
              {
              case XAUX_DISPLAY :
                     pThisSdpn->pDsp        = (Display *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_SCREENNUM :
                     pThisSdpn->nScreenNum  = *(int *)(pTmpAttr->pvValue);
                     break;

              case XAUX_HTTWINDOW :
                     pThisSdpn->wndHttWin   = *(Window *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_FONTSET :
                     pThisSdpn->xfsFontSet  = *(XFontSet *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_AREA :
                     pThisSdpn->rectArea    = *(XRectangle *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_AREANEEDED :
                     pThisSdpn->rectNeeded  = *(XRectangle *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_COLORMAP :
                     pThisSdpn->cmap        = *(Colormap *)(pTmpAttr->pvValue);
                     break;

              case XAUX_STDCOLORMAP :
                     pThisSdpn->cmapStd     = *(Colormap *)(pTmpAttr->pvValue);
                     break;

              case XAUX_FOREGROUND :
                     pThisSdpn->fgPix       = *(unsigned long *)(pTmpAttr->pvValue);
                     break;

              case XAUX_BACKGROUND :
                     pThisSdpn->bgPix       = *(unsigned long *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_LOCATION :
                     pThisSdpn->xyPointLoc  = *(xPoint *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_FONTNAME:
                     pThisSdpn->pszFontName = (char *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_REPLYCALLBACK :
                     pThisSdpn->fpReplyCb   = (void (*)())(pTmpAttr->pvValue);      
                     break;
                     
              case XAUX_REPLYCLIENTDATA :
                     pThisSdpn->pbReplyData = (void *)(pTmpAttr->pvValue);
                     break;
                     
              case XAUX_GC :
                     pThisSdpn->gc          = *(GC *)(pTmpAttr->pvValue);
                     break;
                     
              default :
                     break;
              }
       }
       
       return True;
}

Here is the caller graph for this function:

void start_aux2 ( Widget  parent)

Definition at line 1075 of file XAuxMethods.c.

{
    Widget button1, button2, rc;
    Widget label1, label2;
    Widget text1, text2;
    Arg args[20];
    int i;

    if (aux2_dialog) {
       XtManageChild(aux2_dialog);
       XtRealizeWidget(aux2_dialog);
       return;
    }
    i = 0;
    XtSetArg(args[i], XmNtitle, "AUX2 DICTIONALY TOOL");
    i++;
    aux2_dialog = XmCreateFormDialog(parent, "dict_dialog", args, i);

    i = 0;
    XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM); i++;
    XtSetArg(args[i], XmNorientation, XmHORIZONTAL); i++;
    rc = XmCreateRowColumn(aux2_dialog, "rowc", args, i);
    XtManageChild(rc);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("String:", XmSTRING_DEFAULT_CHARSET)); i++;
    label1 = XmCreateLabel(rc, "label1", args, i);
    XtManageChild(label1);

    i = 0;
    XtSetArg(args[i], XmNcolumns, 15);
    i++;
    text1 = XmCreateTextField(rc, "textfield1", args, i);
    XtManageChild(text1);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Japanese:", XmSTRING_DEFAULT_CHARSET));
    i++;
    label2 = XmCreateLabel(rc, "label2", args, i);
    XtManageChild(label2);

    i = 0;
    XtSetArg(args[i], XmNcolumns, 15);
    i++;
    text2 = XmCreateTextField(rc, "textfield2", args, i);
    XtManageChild(text2);

    i = 0;
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Add", XmSTRING_DEFAULT_CHARSET));
    i++;
    button1 = XmCreatePushButton(rc, "button1", args, i);
    XtManageChild(button1);

    i = 0;
    XtManageChild(button1);
    XtSetArg(args[i], XmNlabelString, XmStringCreate("Cancel", XmSTRING_DEFAULT_CHARSET));
    i++;
    button2 = XmCreatePushButton(rc, "button2", args, i);
    XtAddCallback(button2, XmNactivateCallback, cancel_cb, aux2_dialog);
    XtManageChild(button2);

    XtManageChild(aux2_dialog);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void start_cb ( Widget  w,
XtPointer  clientData,
XtPointer  callData 
)

Definition at line 1064 of file XAuxMethods.c.

{
    start_aux2((Widget) clientData);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL UnmapGUI ( XAux_SesDspParaNode pThisSdpn) [static]

Definition at line 774 of file XAuxMethods.c.

{
#ifdef notdef
       XUnmapWindow(pThisSdpn->pDsp, pThisSdpn->wndBmp1);
       XUnmapWindow(pThisSdpn->pDsp, pThisSdpn->wndBmp2);
#else
        XtUnmapWidget(main_window);
#endif
       return TRUE;
}

Here is the caller graph for this function:

static void UpdateWndBmp1 ( XAux_SesDspParaNode pThisSdpn) [static]

Here is the caller graph for this function:

static void UpdateWndBmp2 ( XAux_SesDspParaNode pThisSdpn) [static]

Here is the caller graph for this function:

BOOL XAux_Create ( int  nIcID,
XAuxAttribute pAttrArray,
int  nArraySize 
)

Definition at line 514 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       
printf("Creating...nIcID[%d]\n", nIcID);

       pThisSdpn = GetNodeAddressByIcID(nIcID);
       /* Not existed, alloc memory for it */
       if(pThisSdpn == NULL)
       {
              pThisSdpn  = PrefixNewNode(nIcID);
              if (pThisSdpn == NULL)
                     return FALSE;
       }
                     
       SetAuxNodeValues(pThisSdpn, pAttrArray, nArraySize);
       /* Create GUI, and set ->wndIM, wndBmp1, wndBmp2 ... */

printf("Creating GUI\n");
       CreateGUI(pThisSdpn);

       pThisSdpn->nWndStatus = FALSE;
       
       return TRUE;
}

Here is the call graph for this function:

BOOL XAux_Destroy ( int  nIcID)

Definition at line 748 of file XAuxMethods.c.

{
       BOOL    status;
       
/*
printf("Destroying...nIcID\n", nIcID);
*/
       /* remove specified node */
       /* Should Destroy Windows for this nIcID */
       status = DestroyNode (nIcID);
       return status;
}

Here is the call graph for this function:

BOOL XAux_Done ( int  nIcID,
XIMAuxDoneCallbackStruct *  pAcbs 
)

Definition at line 636 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;

/*
printf("Done...nIcID[%d]\n", nIcID);
*/
       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL) return FALSE;

       UnmapGUI(pThisSdpn);
       pThisSdpn->nWndStatus = FALSE;

       if(pAcbs != NULL) free(pAcbs);
       return TRUE;
}

Here is the call graph for this function:

BOOL XAux_Draw ( int  nIcID,
XIMAuxDrawCallbackStruct *  pAcbs 
)

Definition at line 571 of file XAuxMethods.c.

{
       int i;
       XAux_SesDspParaNode  *pThisSdpn;
       int num_int, num_str;
       int * int_ptr;
    XIMText * str_ptr;
    int int_val;
    int str_val;

       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL) return FALSE;

printf("Drawing...nIcID[%d]\n", nIcID);

    num_int = pAcbs->count_integer_values;
    num_str = pAcbs->count_string_values;
    int_ptr = pAcbs->integer_values;
    str_ptr = pAcbs->string_values;

printf("num_int=%d\n", num_int);
printf("num_str=%d\n", num_str);

for(i=0;i<num_int;i++){
       printf("int[%d]=%d\n", i, int_ptr[i]);
}

#ifdef notdef
    while (num_int--) {
        int_val = *int_ptr;
        switch (int_val) {
            case 1:
                str_val = *(char *)(str_ptr -> string.multi_byte);
              pThisSdpn->nPuncState = str_val;
                break;
            case 2:
                str_val = *(char *)(str_ptr -> string.multi_byte);
              pThisSdpn->nSkbState = str_val;
                break;
           case 3:
              break;
        }
        int_ptr++;
        str_ptr++;
    }
/*
printf("pThisSdpn->nPuncState = %d, pThisSdpn->nSkbState = %d\n",pThisSdpn->nPuncState, pThisSdpn->nSkbState);
*/
       MapGUI(pThisSdpn);
       pThisSdpn->nWndStatus = TRUE;
       
       free(pAcbs->integer_values);
       free(pAcbs->string_values);
       free(pAcbs);
       /* parse the call_data and do accordingly */
#endif
       return TRUE;
}

Here is the call graph for this function:

BOOL XAux_GetValues ( int  nIcID,
XAuxAttribute pAttrArray,
int  nArraySize 
)

Definition at line 727 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       BOOL    status;
       
printf("GetValues...nIcID\n", nIcID);

       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL)
              return FALSE;
              
       status = GetAuxNodeValues(pThisSdpn, pAttrArray, nArraySize);
       return status;
}

Here is the call graph for this function:

BOOL XAux_SetFocus ( int  nIcID)

Definition at line 657 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
/*
printf("SetFocus...nIcID[%d]\n", nIcID);
*/
       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL) return FALSE;
              
       if(pThisSdpn->nWndStatus == TRUE) MapGUI(pThisSdpn);
       else UnmapGUI(pThisSdpn);

       /* parse the call_data and do something accordingly */
       return True;
}

Here is the call graph for this function:

BOOL XAux_SetValues ( int  nIcID,
XAuxAttribute pAttrArray,
int  nArraySize 
)

Definition at line 700 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       BOOL    status;
       
printf("SetValues...NIcID\n", nIcID);

#ifdef notdef
       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL)
              return FALSE;
       
       status = SetAuxNodeValues(pThisSdpn, pAttrArray, nArraySize);
#endif
       return status;
}

Here is the call graph for this function:

BOOL XAux_Start ( int  nIcID,
XIMAuxStartCallbackStruct *  pAcbs 
)

Definition at line 545 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;

printf("Starting...nIcID[%d]\n", nIcID);

       MapGUI(pThisSdpn);

#ifdef notdef
       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL) return FALSE;

       UnmapGUI(pThisSdpn);
       pThisSdpn->nWndStatus = FALSE;

       if(pAcbs != NULL) free(pAcbs);
#endif

       return TRUE;
}

Here is the call graph for this function:

BOOL XAux_UnsetFocus ( int  nIcID)

Definition at line 677 of file XAuxMethods.c.

{
       XAux_SesDspParaNode  *pThisSdpn;
       
/*
printf("UnsetFocus...nIcID[%d]\n", nIcID);
*/
       pThisSdpn = GetNodeAddressByIcID(nIcID);
       if (pThisSdpn == NULL)
              return FALSE;

/*     UnmapGUI(pThisSdpn);

       pThisSdpn->nWndStatus = FALSE;*/
              
       return TRUE;
}

Here is the call graph for this function:


Variable Documentation

XtAppContext app_context

Definition at line 799 of file XAuxMethods.c.

Widget aux2_dialog

Definition at line 156 of file XAuxMethods.c.

const int BUTTON_NUMBER = 3

Definition at line 72 of file XAuxMethods.c.

Widget donebutton

Definition at line 157 of file XAuxMethods.c.

Widget form

Definition at line 157 of file XAuxMethods.c.

Widget label

Definition at line 800 of file XAuxMethods.c.

Widget main_window

Definition at line 156 of file XAuxMethods.c.

int nDebugInt = 0 [static]

Definition at line 97 of file XAuxMethods.c.

Definition at line 135 of file XAuxMethods.c.

const int PUNCTUATION_STATUS = 1

Definition at line 70 of file XAuxMethods.c.

Widget rc

Definition at line 157 of file XAuxMethods.c.

Widget sendbutton

Definition at line 157 of file XAuxMethods.c.

const int SOFTKEYBOARD_LAYOUT = 2

Definition at line 71 of file XAuxMethods.c.

Widget startbutton

Definition at line 157 of file XAuxMethods.c.

Widget toplevel

Definition at line 156 of file XAuxMethods.c.