void
 ListHookedPointing::apply(const Params_ScrollWheelEventCallback& params)
 {
   ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced());
   if (p) {
     p->apply(params);
   }
 }
  void
  ListHookedPointing::apply(const Params_ScrollWheelEventCallback& params)
  {
    IOLockWrapper::ScopedLock lk(list_lock_);
    if (! lk) return;

    ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced_nolock());
    if (p) {
      p->apply(params);
    }
  }
void ListHookedPointing::apply(const Params_RelativePointerEventCallback& params) {
  // if all button are released, send event for all devices.
  if (params.buttons == Buttons(0) &&
      params.dx == 0 &&
      params.dy == 0) {
    for (Item* p = static_cast<Item*>(list_.safe_front()); p; p = static_cast<Item*>(p->getnext())) {
      if (!p->isReplaced()) continue;

      p->apply(params);
    }

  } else {
    ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced());
    if (p) {
      p->apply(params);
    }
  }
}
  void
  ListHookedPointing::apply(const Params_RelativePointerEventCallback& params)
  {
    IOLockWrapper::ScopedLock lk(list_lock_);
    if (! lk) return;

    // if all button are released, send event for all devices.
    if (params.buttons == Buttons(0) &&
        params.dx == 0 &&
        params.dy == 0) {
      for (Item* p = static_cast<Item*>(list_->front()); p; p = static_cast<Item*>(p->getnext())) {
        if (! p->isReplaced()) continue;

        p->apply(params);
      }

    } else {
      ListHookedPointing::Item* p = static_cast<ListHookedPointing::Item*>(get_replaced_nolock());
      if (p) {
        p->apply(params);
      }
    }
  }