| 481 | } |
| 482 | |
| 483 | static void |
| 484 | do_SelectionNotify (FILE* out_f, XEvent *eventp, Display* dpy) |
| 485 | { |
| 486 | XSelectionEvent *e = (XSelectionEvent *) eventp; |
| 487 | char *sname = NULL; |
| 488 | char *tname = NULL; |
| 489 | char *pname = NULL; |
| 490 | |
| 491 | if (dpy != NULL) { |
| 492 | sname = XGetAtomName (dpy, e->selection); |
| 493 | tname = XGetAtomName (dpy, e->target); |
| 494 | pname = XGetAtomName (dpy, e->property); |
| 495 | } |
| 496 | |
| 497 | fprintf(out_f," selection 0x%lx (%s), target 0x%lx (%s),\n", |
| 498 | e->selection, sname ? sname : Unknown, e->target, |
| 499 | tname ? tname : Unknown); |
| 500 | fprintf(out_f," property 0x%lx (%s), time %lu\n", |
| 501 | e->property, pname ? pname : Unknown, e->time); |
| 502 | |
| 503 | if (sname) XFree (sname); |
| 504 | if (tname) XFree (tname); |
| 505 | if (pname) XFree (pname); |
| 506 | } |
| 507 | |
| 508 | static void |
| 509 | do_ColormapNotify (FILE* out_f, XEvent *eventp) |