int32_t PListViewSwapItems(void *pobject, void *in, void *out, void *extraData) { if (!pobject || !in || !out) return B_ERROR; PView *parent = static_cast<PView*>(pobject); if (!parent) return B_BAD_TYPE; BListView *backend = (BListView*)parent->GetView(); PArgs *inArgs = static_cast<PArgs*>(in); PArgs *outArgs = static_cast<PArgs*>(out); int32 first; if (inArgs->FindInt32("first", &first) != B_OK) return B_ERROR; int32 second; if (inArgs->FindInt32("second", &second) != B_OK) return B_ERROR; if (backend->Window()) backend->Window()->Lock(); bool outValue1; outValue1 = backend->SwapItems(first, second); if (backend->Window()) backend->Window()->Unlock(); outArgs->MakeEmpty(); return B_OK; }