------------------------------------------------------------------------------
| 474 | |
| 475 | //------------------------------------------------------------------------------ |
| 476 | void vtkXRenderWindowInteractor::Enable() |
| 477 | { |
| 478 | // avoid cycles of calling Initialize() and Enable() |
| 479 | if (this->Enabled) |
| 480 | { |
| 481 | return; |
| 482 | } |
| 483 | // When we're attached to an offscreen render window, |
| 484 | // there is no real X Display or X Window. |
| 485 | if (!this->WindowId || !this->DisplayId) |
| 486 | { |
| 487 | this->Enabled = 1; |
| 488 | this->Modified(); |
| 489 | return; |
| 490 | } |
| 491 | |
| 492 | // Add the event handler to the system. |
| 493 | // If we change the types of events processed by this handler, then |
| 494 | // we need to change the Disable() routine to match. In order for Disable() |
| 495 | // to work properly, both the callback function AND the client data |
| 496 | // passed to XtAddEventHandler and XtRemoveEventHandler must MATCH |
| 497 | // PERFECTLY |
| 498 | vtkXSelectInput(this->DisplayId, this->WindowId, |
| 499 | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ExposureMask | |
| 500 | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | PointerMotionHintMask | |
| 501 | PointerMotionMask); |
| 502 | |
| 503 | // Setup for capturing the window deletion |
| 504 | this->KillAtom = vtkXInternAtom(this->DisplayId, "WM_DELETE_WINDOW", False); |
| 505 | vtkXSetWMProtocols(this->DisplayId, this->WindowId, &this->KillAtom, 1); |
| 506 | |
| 507 | // Enable drag and drop |
| 508 | Atom xdndAwareAtom = vtkXInternAtom(this->DisplayId, "XdndAware", False); |
| 509 | vtkXChangeProperty( |
| 510 | this->DisplayId, this->WindowId, xdndAwareAtom, XA_ATOM, 32, PropModeReplace, &XDND_VERSION, 1); |
| 511 | this->XdndURIListAtom = vtkXInternAtom(this->DisplayId, "text/uri-list", False); |
| 512 | this->XdndTypeListAtom = vtkXInternAtom(this->DisplayId, "XdndTypeList", False); |
| 513 | this->XdndEnterAtom = vtkXInternAtom(this->DisplayId, "XdndEnter", False); |
| 514 | this->XdndPositionAtom = vtkXInternAtom(this->DisplayId, "XdndPosition", False); |
| 515 | this->XdndDropAtom = vtkXInternAtom(this->DisplayId, "XdndDrop", False); |
| 516 | this->XdndActionCopyAtom = vtkXInternAtom(this->DisplayId, "XdndActionCopy", False); |
| 517 | this->XdndStatusAtom = vtkXInternAtom(this->DisplayId, "XdndStatus", False); |
| 518 | this->XdndFinishedAtom = vtkXInternAtom(this->DisplayId, "XdndFinished", False); |
| 519 | |
| 520 | this->Enabled = 1; |
| 521 | |
| 522 | this->Modified(); |
| 523 | } |
| 524 | |
| 525 | //------------------------------------------------------------------------------ |
| 526 | void vtkXRenderWindowInteractor::Disable() |
no test coverage detected