Back to index

im-sdk  12.3.91
xaux_object_common.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <limits.h>
00003 #include <unistd.h>
00004 #include <wait.h>
00005 
00006 #include <X11/Xlib.h>
00007 #include <X11/Xatom.h>
00008 
00009 #ifdef HAVE_CONFIG_H
00010 #include "config.h"
00011 #endif
00012 
00013 #include "xaux_object.h"
00014 
00015 /* workaround for "stored reference to aux_t is corrupred" problem */
00016 static void (*aux_setvalue)(aux_t *, const unsigned char *, int);
00017 static unsigned char *(*compose)(const aux_data_t *, int *);
00018 static aux_t aux_tmp;
00019 
00020 static Bool xaux_object_event_filter(Display *display, Window window, XEvent *event, XPointer pointer);
00021 static Bool xaux_object_get_extwin(xaux_class_t *xc, Display *display);
00022 static Bool xaux_object_launch_ext(xaux_class_t *xc, Display *display);
00023 
00024 static Bool xaux_object_init_class(Display *display, Window window, xaux_class_t *xc);
00025 void xaux_object_print(xaux_object_t *xaux_object);
00026 
00027 extern xaux_class_t xaux_classes[];
00028 
00029 xaux_object_t *xaux_object_new()
00030 {
00031        xaux_object_t *xaux_object;
00032 
00033        xaux_object = (xaux_object_t *)calloc(1, sizeof(xaux_object_t));
00034        if (xaux_object == NULL)
00035               return NULL;
00036 
00037        return xaux_object;
00038 }
00039 
00040 Bool xaux_object_init(xaux_object_t *xaux_object, aux_t *aux, char *classname, xaux_class_t *xaux_classes)
00041 {
00042        Display *display;
00043        xaux_class_t *p;
00044 
00045        if (!aux)
00046               return False;
00047 
00048        if (!classname || !*classname)
00049               return False;
00050 
00051        if (!xaux_classes)
00052               return False;
00053 
00054        /* workaround for "stored reference to aux_t is corrupred" problem */
00055        aux_tmp.ic = aux->ic;
00056        aux_setvalue = aux->service->aux_setvalue;
00057        compose = aux->service->compose;
00058 
00059        display = aux->service->display(aux);
00060 
00061        xaux_object->display = display;
00062 
00063        xaux_object->classname = classname;
00064        xaux_object->atom_classname = XInternAtom(display, classname, False);
00065 
00066        xaux_object->window = XCreateSimpleWindow(display, RootWindow(display, 0),
00067                    0, 0, 1, 1, 0, 0, 0);
00068 
00069        if (xaux_object->window == None) {
00070               DEBUG_printf("xaux_object_new: creating window failed.\n");
00071               return False;
00072        }
00073 
00074        XSetSelectionOwner(display,
00075               xaux_object->atom_classname, xaux_object->window, CurrentTime);
00076 
00077         XSelectInput(display, xaux_object->window, PropertyChangeMask);
00078 
00079         aux->service->register_X_filter(display, xaux_object->window,
00080               ClientMessage, ClientMessage,
00081               xaux_object_event_filter, NULL);
00082 
00083        xaux_object->xaux_classes = xaux_classes;
00084        p = xaux_classes;
00085        while(p->classname != NULL) {
00086               xaux_object_init_class(display, xaux_object->window, p);
00087               p++;
00088        }
00089 
00090        xaux_object_print(xaux_object);
00091 
00092        return (True);
00093 }
00094 
00095 void xaux_object_destroy(xaux_object_t *xaux_object)
00096 {
00097        if (xaux_object == NULL ||
00098            xaux_object->display ||
00099            xaux_object->window == None)
00100               return;
00101 
00102        XDestroyWindow(xaux_object->display, xaux_object->window);
00103 
00104        return;
00105 }
00106 
00107 void xaux_object_print(xaux_object_t *xaux_object)
00108 {
00109 #ifdef DEBUG
00110        xaux_class_t *p;
00111 
00112        if (xaux_object == NULL ||
00113            xaux_object->display ||
00114            xaux_object->window == None)
00115               return;
00116 
00117        printf("xaux_object: %p\n", xaux_object);
00118        printf("  classname: %s\n", xaux_object->classname);
00119        printf("  window: %d\n", xaux_object->window);
00120 
00121        p = xaux_object->xaux_classes;
00122        while(p->classname != NULL) {
00123               printf(" class: %s\n", p->classname);
00124               p++;
00125        }
00126 #endif
00127        return;
00128 }
00129 
00130 /************************************************************
00131     functions to process xaux_class_t and aux messages
00132 ************************************************************/
00133 static Bool xaux_object_init_class(Display *display, Window window, xaux_class_t *xc)
00134 {
00135        char          buf[XAUX_MAXCLASSNAMELEN + XAUX_MAXSUFFIXLEN + 1];
00136        int           i;
00137        int           len;
00138 
00139        if (xc == NULL)
00140               return False;
00141 
00142        DEBUG_printf("xaux_object_init_class ===\n");
00143        if (access(xc->extexec, X_OK) != 0) {
00144               DEBUG_printf("executable \"%s\" not found\n", xc->extexec);
00145               return False;
00146        }
00147 
00148        if (xc->classname == NULL) {
00149               return False;
00150        }
00151 
00152        xc->atom_classname = XInternAtom(display, xc->classname, False);
00153 
00154        len = XAUX_MAXCLASSNAMELEN + XAUX_MAXSUFFIXLEN + 1;
00155        snprintf(buf, len, "%s%s", xc->classname, XAUX_SOWIN_SUFFIX);
00156        xc->atom_sowin = XInternAtom(display, buf, False);
00157 
00158        snprintf(buf, len, "%s%s", xc->classname, XAUX_EXTWIN_SUFFIX);
00159        xc->atom_extwin = XInternAtom(display, buf, False);
00160 
00161        for (i = 0; i < XAUX_SX_NATOMS; i++) {
00162               snprintf(buf, len, "%s%s_%d",
00163                      xc->classname, XAUX_SX_SUFFIX, i);
00164               xc->atom_sx[i] = XInternAtom(display, buf, False);
00165        }
00166        xc->atom_sx_idx = 1;
00167 
00168        for (i = 0; i < XAUX_XS_NATOMS; i++) {
00169               snprintf(buf, len, "%s%s_%d",
00170                      xc->classname, XAUX_XS_SUFFIX, i);
00171               xc->atom_xs[i] = XInternAtom(display, buf, False);
00172        }
00173        xc->atom_xs_idx = 1;
00174 
00175        xc->extwin = (Window)0;
00176 
00177        if (xaux_object_launch_ext(xc, display) == False)
00178               return (False);
00179 
00180        i = 0;
00181        while (xaux_object_get_extwin(xc, display) == False) {
00182               DEBUG_printf("classname: %s, retry number: %d, sleep: %d um\n", xc->classname, i, XAUX_RETRYINT_EXTWIN);
00183               if (i++ > XAUX_MAXRETRY_EXTWIN)
00184                      break;
00185               usleep(XAUX_RETRYINT_EXTWIN);
00186        }
00187 
00188        return True;
00189 }
00190 
00191 char *xaux_object_get_classname_from_utfname(CARD16 *utf_name, int utf_name_len)
00192 {
00193        int i;
00194        char *classname = NULL;
00195 
00196        if (!utf_name || !*utf_name)
00197               return (NULL);
00198 
00199        classname = (char *)calloc(utf_name_len + 1, sizeof(char));
00200        if (classname == NULL) return (NULL);
00201 
00202        for (i = 0; i < utf_name_len; i++) {
00203               classname[i] = utf_name[i] & 0xff;
00204        }
00205 
00206        return (classname);
00207 }
00208 
00209 static xaux_class_t *xaux_object_get_class_from_name(xaux_object_t *xaux_object, char *classname)
00210 {
00211        xaux_class_t *aux_class;
00212        Display *display;
00213        Window owner;
00214 
00215        Atom atom_classname = (Atom)None;
00216 
00217        if (xaux_object == NULL || classname == NULL)
00218               return (NULL);
00219 
00220        display = xaux_object->display;
00221        atom_classname = XInternAtom(display, classname, True);
00222 
00223        /* check whether the classname is registered by the owner */
00224        DEBUG_printf("classname: %s, atom_classname: %p\n", classname, atom_classname);
00225        if (atom_classname == (Atom)None)
00226               return (NULL);
00227 
00228        /* check whether the classname is for the binary aux module */
00229        for (aux_class = xaux_object->xaux_classes; aux_class->classname; aux_class++) {
00230               if (!strcasecmp(classname, aux_class->classname))
00231                      return (aux_class);
00232        }
00233 
00234        /* check whether the classname is launched by an aux manager */
00235        owner = XGetSelectionOwner(display, atom_classname);
00236        if (owner == (Window)None)
00237               return (NULL);
00238 
00239        for (aux_class = xaux_object->xaux_classes; aux_class->classname; aux_class++) {
00240               if (aux_class->extwin == owner)
00241                      return (aux_class);
00242        }
00243 
00244        return (NULL);
00245 }
00246 
00247 static Bool xaux_object_get_extwin(xaux_class_t *xc, Display *display)
00248 {
00249        if (xc->atom_extwin == (Atom)None)
00250               return False;
00251 
00252        xc->extwin = XGetSelectionOwner(display, xc->atom_extwin);
00253        if (xc->extwin == None) {
00254               return False;
00255        }
00256        return True;
00257 }
00258 
00259 static void xaux_object_signal_child_handler(int sig, siginfo_t * info, void * ucontext)
00260 {
00261     pid_t   pid;
00262     int     status;
00263 
00264     while ((pid = waitpid(info->si_pid, &status, WNOHANG|WUNTRACED)) > 0) {
00265         printf("pid %d: die\n", pid);
00266     }
00267 }
00268 
00269 static void xaux_object_register_signal_child_handler()
00270 {
00271     struct sigaction act;
00272 
00273     act.sa_handler = NULL;
00274     act.sa_sigaction = xaux_object_signal_child_handler;
00275     sigfillset(&act.sa_mask);
00276     act.sa_flags = SA_SIGINFO;
00277 
00278     sigaction(SIGCHLD, &act, NULL);
00279 }
00280 
00281 static Bool xaux_object_launch_ext(xaux_class_t *xc, Display *display)
00282 {
00283        pid_t         pid;
00284 
00285        if (xc->atom_extwin == (Atom)None)
00286               return False;
00287 
00288        if (xaux_object_get_extwin(xc, display) == True) {
00289               return True;
00290        }
00291 
00292        xaux_object_register_signal_child_handler();
00293 
00294 #ifdef sun
00295        pid = fork1();
00296 #else
00297        pid = fork();
00298 #endif
00299 
00300        if (pid == (pid_t)(-1)) { /* fork failed */
00301               return False;
00302        } else if (0 == pid) { /* child */
00303 #ifdef DEBUG_XAUX
00304               chdir("/tmp");
00305 #endif
00306               execl(xc->extexec, xc->classname, NULL);
00307               _exit(1);
00308        }
00309        
00310        /* parent */
00311        return True;
00312 }
00313 
00314 static char *xaux_object_compose_aux_data(aux_t *aux, xaux_class_t *xc, aux_data_t *aux_data, int type, int *string_len)
00315 {
00316        XPoint        point;
00317        char *        string_buf;
00318        size_t        i;
00319        int           *ip;
00320        char          *sp;
00321        size_t        total;
00322        size_t        len;
00323 
00324        /* estimate enough size for string_buf */
00325 
00326        /* size for header */
00327        total = SX_SIZE_PROP_HEADER_DRAW;
00328 
00329        /* add size for integer_values */
00330        total += (sizeof (CARD32) * aux_data->integer_count);
00331 
00332        /* add size for string_values */
00333        if (aux_data->string_count > 0) {
00334               for (i = 0; i < aux_data->string_count; i++) {
00335                      /* number of bytes */
00336                      len = aux_data->string_list[i].length;
00337 
00338                      /* consider padding */
00339                      total +=
00340                      ((sizeof (CARD16) + len + 3) / 4) * 4;
00341               }
00342        }
00343 
00344        if ((string_buf = (char *)calloc(total, sizeof(char))) == NULL) {
00345               return NULL;
00346        }
00347 
00348        SX_PROP_ATOM_AUX_NAME(string_buf) = xc->atom_classname;
00349        SX_PROP_TYPE(string_buf) = type;
00350        SX_PROP_INDEX(string_buf) = xc->index;
00351        SX_PROP_IMID(string_buf) = aux_data->im;
00352        SX_PROP_ICID(string_buf) = aux_data->ic;
00353        SX_PROP_SOWIN(string_buf) = xc->sowin;
00354 
00355        SX_PROP_CLIENTWIN(string_buf) = aux->service->client_window(aux);
00356 
00357        aux->service->point(aux, &point);
00358        SX_PROP_POSX(string_buf) = point.x;
00359        SX_PROP_POSY(string_buf) = point.y;
00360 
00361        SX_PROP_FOCUSWIN(string_buf) = aux->service->window(aux);
00362 
00363        SX_PROP_INT_COUNT(string_buf) = aux_data->integer_count;
00364        SX_PROP_STR_COUNT(string_buf) = aux_data->string_count;
00365 
00366        ip = (int *)SX_PROP_INT_LIST(string_buf);
00367 
00368        if (aux_data->integer_count > 0) {
00369               for (i = 0; i < aux_data->integer_count; i++) {
00370                      *ip++ = aux_data->integer_list[i];
00371               }
00372        }
00373 
00374        sp = (char *)SX_PROP_STR_LIST(string_buf);
00375 
00376        if (aux_data->string_count > 0) {
00377               char *        ob;
00378               size_t        obl;
00379 
00380               ob = sp;
00381 
00382               for (i = 0; i < aux_data->string_count; i++) {
00383                      int           pn;
00384                      unsigned char *p;
00385                      size_t        j;
00386 
00387                      len = aux_data->string_list[i].length;
00388                      p = aux_data->string_list[i].ptr;
00389 
00390                      *(CARD16 *)ob = len;
00391                      ob += sizeof (CARD16);
00392 
00393                      for (j = 0; j < len; j++) {
00394                             *ob++ = *p++;
00395                      }
00396                             
00397                      pn = padding[(sizeof (CARD16) + len) % 4];
00398 
00399                      /* padding */
00400                      for (j = 0; j < pn; j++) {
00401                             *ob++ = 0U;
00402                      }
00403                      sp = ob;
00404               }
00405        }
00406 
00407        *string_len = sp - &(string_buf[0]);
00408        return (string_buf);
00409 }
00410 
00411 aux_data_t *xaux_object_decompose_from_string(xaux_class_t *xc, unsigned char *string_buf)
00412 {
00413        aux_data_t *  aux_data;
00414        int           i;
00415 
00416        aux_data = (aux_data_t *)calloc(1, sizeof(aux_data_t));
00417        if (aux_data == NULL)
00418               return (NULL);
00419 
00420        /* header */
00421        aux_data->type = AUX_DATA_SETVALUE;
00422        aux_data->im = XS_PROP_IMID(string_buf);
00423        aux_data->ic = XS_PROP_ICID(string_buf);
00424        aux_data->aux_index = xc->index;
00425        aux_data->aux_name = (unsigned char *)xc->utfname;
00426        aux_data->aux_name_length = strlen(xc->classname)*sizeof(CARD16);
00427 
00428        /* int values */
00429        aux_data->integer_count = XS_PROP_INT_COUNT(string_buf);
00430 
00431        if (aux_data->integer_count > 0) {
00432               aux_data->integer_list = (int *)XS_PROP_INT_LIST(string_buf);
00433        } else {
00434               aux_data->integer_list = NULL;
00435        }
00436 
00437        /* string values */
00438        aux_data->string_count = XS_PROP_STR_COUNT(string_buf);
00439        if (aux_data->string_count > 0) {
00440               unsigned char * prop_str = XS_PROP_STR_LIST(string_buf);
00441 
00442               if ((aux_data->string_list = (aux_string_t *)calloc(aux_data->string_count, 
00443                                           sizeof (aux_string_t))) == NULL) {
00444                      free ((char *)aux_data);
00445                      return NULL;
00446               }
00447 
00448               for (i = 0; i < aux_data->string_count; i++) {
00449                      int    j;
00450                      int    pn;
00451                      size_t len;
00452 
00453                      len = *((CARD16 *)(prop_str));
00454                      prop_str += sizeof (CARD16);
00455                      aux_data->string_list[i].ptr = prop_str;
00456                      aux_data->string_list[i].length = len;
00457                      prop_str += len;
00458                      pn = padding[(sizeof(CARD16) + len) % 4];
00459                      for (j = 0; j < pn; j++) {
00460                             *prop_str++ = 0U;
00461                      }
00462               }
00463        } else {
00464               aux_data->string_list = NULL;
00465        }
00466 
00467        aux_data->string_ptr = NULL;
00468 
00469        return aux_data;
00470 }
00471 
00472 /************************************************************
00473     Send messages to aux modules
00474 ************************************************************/
00475 Bool xaux_object_send_message(
00476        aux_t *              aux,
00477        xaux_class_t *       xc,
00478        int           im_id,
00479        int           ic_id,
00480        aux_data_type_t      type,
00481        Atom          atom_client,
00482        Atom          atom_data)
00483 {
00484        Display *            display;
00485        XClientMessageEvent  event;
00486 
00487        display = aux->service->display(aux);
00488 
00489        if (xaux_object_get_extwin(xc, display) == False)
00490               return False;
00491 
00492        event.type = ClientMessage;
00493        event.serial = 0;
00494        event.send_event = True;
00495        event.display = display;
00496        event.window = xc->extwin;
00497        event.message_type = atom_client;
00498        event.format = 32;
00499 
00500        event.data.l[0] = xc->atom_classname;
00501        event.data.l[1] = ((CARD32)im_id << 16) | ((CARD32)ic_id & 0xffff);
00502        event.data.l[2] = xc->index;
00503        event.data.l[3] = type; /* CREATE, DONE, ... */
00504        event.data.l[4] = atom_data;
00505 
00506        XSendEvent(display, xc->extwin, True, 0, (XEvent *)(&event));
00507 
00508        /* needed in en_US.UTF-8 */
00509         XFlush(display);
00510 
00511        return True;
00512 }
00513 
00514 Bool xaux_object_send_property(
00515        aux_t *                     aux,
00516        xaux_class_t *              xc,
00517        const unsigned char *       p,
00518        int                  len,
00519        Atom                 atom_client)
00520 {
00521        Display *     display;
00522        int           i = 1;
00523        Bool          rv;
00524        Window        win;
00525 
00526        display = aux->service->display(aux);
00527 
00528        if (xaux_object_get_extwin(xc, display) == False)
00529               return False;
00530 
00531        win = xc->extwin;
00532 
00533        XChangeProperty(display, win,
00534               xc->atom_sx[xc->atom_sx_idx], XA_STRING,
00535               8, PropModeReplace, (unsigned char *)p, len);
00536 
00537        if (xaux_object_send_message(aux, xc,
00538               aux->service->im_id(aux), aux->service->ic_id(aux),
00539               AUX_DATA_DRAW, atom_client, xc->atom_sx[xc->atom_sx_idx]) == False) {
00540                      return False;
00541        }
00542 
00543        /* XFlush() has been called in xaux_object_send_message() */
00544        
00545        if (++xc->atom_sx_idx == XAUX_SX_NATOMS)
00546               xc->atom_sx_idx = 1;
00547        
00548        return True;
00549 }
00550 
00551 Bool xaux_object_draw_aux_module(xaux_object_t *xaux_object, aux_t *aux, 
00552 char *classname, aux_data_t *aux_data, int type)
00553 {
00554        char *        string_buf;
00555        int           string_len;
00556        Bool          rv = True;
00557        Display *     display;
00558        Atom          atom_client;
00559 
00560        xaux_class_t *       xc;
00561 
00562        DEBUG_printf("aux_tmp: %p, aux_setvalue: %p, compose: %p\n", &aux_tmp, aux_setvalue, compose);
00563 
00564        display = aux->service->display(aux);
00565 
00566        /* make the aux_object as the current focused aux object */
00567        XSetSelectionOwner(display,
00568               xaux_object->atom_classname, xaux_object->window, CurrentTime);
00569 
00570        xc = xaux_object_get_class_from_name(xaux_object, classname);
00571        DEBUG_printf("xaux_object_get_class_from_name, return: xc: %p\n", xc);
00572        if (xc == NULL)
00573               return False;
00574 
00575        if (xaux_object_get_extwin(xc, display) == False)
00576               return False;
00577 
00578        /* workaround for "stored reference to aux_t is corrupred" problem */
00579        aux_tmp.ic = aux->ic;
00580 
00581        atom_client = XInternAtom(display, classname, True);
00582 
00583        if (type == AUX_DATA_START || type == AUX_DATA_DONE) {
00584               rv = xaux_object_send_message(aux, xc, aux_data->im, aux_data->ic, type, atom_client, (Atom)None);
00585        } else if (type == AUX_DATA_DRAW) {
00586               string_buf = (char *)xaux_object_compose_aux_data(aux, xc, aux_data, type, &string_len);
00587 
00588               DEBUG_printf("so_Draw[%s] im:0x%x ic:0x%x in=%d sn=%d\n",
00589                      xc->classname, aux_data->im, aux_data->ic,
00590                      aux_data->integer_count, aux_data->string_count);
00591               DEBUG_printf("total = %d\n", string_len);
00592 
00593               if (string_buf != NULL) {
00594                      rv = xaux_object_send_property(aux, xc,
00595                             (unsigned char *)string_buf, string_len, atom_client);
00596                      free(string_buf);
00597               }
00598        }
00599 
00600        return (rv);
00601 }
00602 
00603 /************************************************************
00604     Receive messages from aux modules
00605 ************************************************************/
00606 static Bool
00607 xaux_object_process_property_update(
00608        Display       *             display,
00609        Window               window,
00610        Atom                 atom,
00611        xaux_class_t *              xc)
00612 {
00613        Atom          actual_type_return;
00614        int           actual_format_return;
00615        unsigned long nitem_return;
00616        unsigned long bytes_after_return;
00617        unsigned char *prop_return;
00618        int           r;
00619        char          *atom_name;
00620        aux_data_t    *aux_data;
00621        int           size;
00622        unsigned char   *p;
00623 
00624        atom_name = XGetAtomName (display, atom);
00625        DEBUG_printf("xaux_object_process_property_update: atom_name: %s\n", atom_name);
00626        DEBUG_printf("aux_tmp: %p, aux_setvalue: %p, compose: %p\n", &aux_tmp, aux_setvalue, compose);
00627 
00628        r = XGetWindowProperty(display, window,
00629                             atom, 0, INT_MAX, False,
00630                             AnyPropertyType, &actual_type_return,
00631                             &actual_format_return, &nitem_return,
00632                             &bytes_after_return, &prop_return);
00633 
00634        if (r != Success) {
00635               return False;
00636        }
00637 
00638        aux_data = xaux_object_decompose_from_string(xc, prop_return);
00639        if (aux_data == NULL) {
00640               XFree(prop_return);
00641               return False;
00642        }
00643 
00644        /* compose and send message to engine */
00645 
00646        /* workaround for "stored reference to aux_t is corrupred" problem */
00647        if ((p = /*ic->aux->service->*/compose(aux_data, &size)) == NULL) {
00648               free(aux_data->string_list);
00649               free(aux_data);
00650               XFree(prop_return);
00651               return False;
00652        }
00653 
00654        DEBUG_printf("so_SetValue[%s] im:0x%x ic:0x%x in=%d sn=%d\n",
00655                      xc->classname, aux_data->im, aux_data->ic,
00656                      aux_data->integer_count, aux_data->string_count);
00657 
00658        /* workaround for "stored reference to aux_t is corrupred" problem */
00659        /*ic->aux->service->*/aux_setvalue(/*ic->aux*/&aux_tmp, p, size);
00660 
00661        free(p);
00662        free(aux_data->string_list);
00663        free(aux_data);
00664 
00665        XFree(prop_return);
00666 
00667        return True;
00668 }
00669 
00670 static Bool xaux_object_process_client_message(Display *display, Window window, XClientMessageEvent *event)
00671 {
00672        aux_data_t    aux_data_;
00673        aux_data_t    *aux_data = &(aux_data_);
00674        aux_data_type_t      type;
00675        xaux_class_t  *xc;
00676 
00677        xc = &xaux_classes[0];
00678 
00679        aux_data->im = ((CARD32)(event->data.l[1])) >> 16;
00680        aux_data->ic = ((CARD32)(event->data.l[1])) & 0xffff;
00681        aux_data->aux_index = (CARD32)(event->data.l[2]);
00682 
00683        type = (CARD32)(event->data.l[3]);
00684 
00685        switch (type) {
00686        case AUX_DATA_SETVALUE:
00687               return xaux_object_process_property_update(display, window,
00688                             (Atom)(event->data.l[4]), xc);
00689        default:
00690               return False;
00691        }
00692 }
00693 
00694 static Bool xaux_object_event_filter(Display *display, Window window, XEvent *event, XPointer pointer)
00695 {
00696        switch (event->type) {
00697        case ClientMessage:
00698               return (xaux_object_process_client_message(display, window,
00699                      (XClientMessageEvent *)event));
00700        }
00701        return False;
00702 }