Commits

Anonymous committed 24835f9

implemented minor task EXT-3454 Code improvements: Replace old-style calback with boost::function in the LLFloaterAvatarPicker

Comments (0)

Files changed (18)

indra/newview/llfloateravatarpicker.cpp

 #include "lluictrlfactory.h"
 #include "message.h"
 
-LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(callback_t callback, 
-												   void* userdata,
+LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
 												   BOOL allow_multiple,
 												   BOOL closeOnSelect)
 {
 	LLFloaterAvatarPicker* floater = 
 		LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
 	
-	floater->mCallback = callback;
-	floater->mCallbackUserdata = userdata;
+	floater->mSelectionCallback = callback;
 	floater->setAllowMultiple(allow_multiple);
 	floater->mNearMeListComplete = FALSE;
 	floater->mCloseOnSelect = closeOnSelect;
 LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
   : LLFloater(key),
 	mNumResultsReturned(0),
-	mCallback(NULL),
-	mCallbackUserdata(NULL),
 	mNearMeListComplete(FALSE),
 	mCloseOnSelect(FALSE)
 {
 
 BOOL LLFloaterAvatarPicker::postBuild()
 {
-	getChild<LLLineEditor>("Edit")->setKeystrokeCallback(editKeystroke, this);
+	getChild<LLLineEditor>("Edit")->setKeystrokeCallback( boost::bind(&LLFloaterAvatarPicker::editKeystroke, this, _1, _2),NULL);
 
-	childSetAction("Find", onBtnFind, this);
+	childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
 	childDisable("Find");
-	childSetAction("Refresh", onBtnRefresh, this);
-	childSetCommitCallback("near_me_range", onRangeAdjust, this);
+	childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this));
+	getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this));
 	
 	LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults");
-	searchresults->setDoubleClickCallback(onBtnSelect, this);
-	childSetCommitCallback("SearchResults", onList, this);
+	searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
+	searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
 	childDisable("SearchResults");
 	
 	LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe");
-	nearme->setDoubleClickCallback(onBtnSelect, this);
-	childSetCommitCallback("NearMe", onList, this);
+	nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
+	nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
 
 	LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends");
-	friends->setDoubleClickCallback(onBtnSelect, this);
-	childSetCommitCallback("Friends", onList, this);
+	friends->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
+	getChild<LLUICtrl>("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
 
-	childSetAction("ok_btn", onBtnSelect, this);
+	childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
 	childDisable("ok_btn");
-	childSetAction("cancel_btn", onBtnClose, this);
+	childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this));
 
 	childSetFocus("Edit");
 
 	gFocusMgr.releaseFocusIfNeeded( this );
 }
 
-void LLFloaterAvatarPicker::onBtnFind(void* userdata)
+void LLFloaterAvatarPicker::onBtnFind()
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
-	if(self) self->find();
+	find();
 }
 
 static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, std::vector<LLUUID>& avatar_ids)
 	}
 }
 
-void LLFloaterAvatarPicker::onBtnSelect(void* userdata)
+void LLFloaterAvatarPicker::onBtnSelect()
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
 
 	// If select btn not enabled then do not callback
-	if (!self || !self->isSelectBtnEnabled())
+	if (!isSelectBtnEnabled())
 		return;
 
-	if(self->mCallback)
+	if(mSelectionCallback)
 	{
 		std::string acvtive_panel_name;
 		LLScrollListCtrl* list =  NULL;
-		LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");
+		LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs");
 		if(active_panel)
 		{
 			acvtive_panel_name = active_panel->getName();
 		}
 		if(acvtive_panel_name == "SearchPanel")
 		{
-			list = self->getChild<LLScrollListCtrl>("SearchResults");
+			list = getChild<LLScrollListCtrl>("SearchResults");
 		}
 		else if(acvtive_panel_name == "NearMePanel")
 		{
-			list =self->getChild<LLScrollListCtrl>("NearMe");
+			list = getChild<LLScrollListCtrl>("NearMe");
 		}
 		else if (acvtive_panel_name == "FriendsPanel")
 		{
-			list =self->getChild<LLScrollListCtrl>("Friends");
+			list = getChild<LLScrollListCtrl>("Friends");
 		}
 
 		if(list)
 			std::vector<std::string>	avatar_names;
 			std::vector<LLUUID>			avatar_ids;
 			getSelectedAvatarData(list, avatar_names, avatar_ids);
-			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
+			mSelectionCallback(avatar_names, avatar_ids);
 		}
 	}
-	self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
-	self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
-	self->getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE);
-	if(self->mCloseOnSelect)
+	getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
+	getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
+	getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE);
+	if(mCloseOnSelect)
 	{
-		self->mCloseOnSelect = FALSE;
-		self->closeFloater();		
+		mCloseOnSelect = FALSE;
+		closeFloater();		
 	}
 }
 
-void LLFloaterAvatarPicker::onBtnRefresh(void* userdata)
+void LLFloaterAvatarPicker::onBtnRefresh()
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
-	if (!self)
-	{
-		return;
-	}
-	
-	self->getChild<LLScrollListCtrl>("NearMe")->deleteAllItems();
-	self->getChild<LLScrollListCtrl>("NearMe")->setCommentText(self->getString("searching"));
-	self->mNearMeListComplete = FALSE;
+	getChild<LLScrollListCtrl>("NearMe")->deleteAllItems();
+	getChild<LLScrollListCtrl>("NearMe")->setCommentText(getString("searching"));
+	mNearMeListComplete = FALSE;
 }
 
-void LLFloaterAvatarPicker::onBtnClose(void* userdata)
+void LLFloaterAvatarPicker::onBtnClose()
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
-	if(self) self->closeFloater();
+	closeFloater();
 }
 
-void LLFloaterAvatarPicker::onRangeAdjust(LLUICtrl* source, void* data)
+void LLFloaterAvatarPicker::onRangeAdjust()
 {
-	LLFloaterAvatarPicker::onBtnRefresh(data);
+	onBtnRefresh();
 }
 
-void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata)
+void LLFloaterAvatarPicker::onList()
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
-	if (self)
-	{
-		self->childSetEnabled("ok_btn", self->isSelectBtnEnabled());
-	}
+	childSetEnabled("ok_btn", isSelectBtnEnabled());
 }
 
 void LLFloaterAvatarPicker::populateNearMe()
 		childEnable("NearMe");
 		childEnable("ok_btn");
 		near_me_scroller->selectFirstItem();
-		onList(near_me_scroller, this);
+		onList();
 		near_me_scroller->setFocus(TRUE);
 	}
 
 	{
 		floater->childEnable("ok_btn");
 		search_results->selectFirstItem();
-		floater->onList(search_results, floater);
+		floater->onList();
 		search_results->setFocus(TRUE);
 	}
 }
 //static
 void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
 {
-	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data;
-	self->childSetEnabled("Find", caller->getText().size() >= 3);
+	childSetEnabled("Find", caller->getText().size() >= 3);
 }
 
 // virtual
 	{
 		if (childHasFocus("Edit"))
 		{
-			onBtnFind(this);
+			onBtnFind();
 		}
 		else
 		{
-			onBtnSelect(this);
+			onBtnSelect();
 		}
 		return TRUE;
 	}

indra/newview/llfloateravatarpicker.h

 	typedef boost::signals2::signal<bool(const std::vector<LLUUID>&), boost_boolean_combiner> validate_signal_t;
 	typedef validate_signal_t::slot_type validate_callback_t;
 
-	// Call this to select an avatar.
 	// The callback function will be called with an avatar name and UUID.
-	typedef void(*callback_t)(const std::vector<std::string>&, const std::vector<LLUUID>&, void*);
-	static LLFloaterAvatarPicker* show(callback_t callback, 
-									   void* userdata,
+	typedef boost::function<void (const std::vector<std::string>&, const std::vector<LLUUID>&)> select_callback_t;
+	// Call this to select an avatar.	
+	static LLFloaterAvatarPicker* show(select_callback_t callback, 
 									   BOOL allow_multiple = FALSE,
 									   BOOL closeOnSelect = FALSE);
 
 	static void processAvatarPickerReply(class LLMessageSystem* msg, void**);
 
 private:
-	static void editKeystroke(class LLLineEditor* caller, void* user_data);
+	void editKeystroke(class LLLineEditor* caller, void* user_data);
 
-	static void onBtnFind(void* userdata);
-	static void onBtnSelect(void* userdata);
-	static void onBtnRefresh(void* userdata);
-	static void onRangeAdjust(LLUICtrl* source, void* data);
-	static void onBtnClose(void* userdata);
-	static void onList(class LLUICtrl* ctrl, void* userdata);
-		   void onTabChanged();
-		   bool isSelectBtnEnabled();
+	void onBtnFind();
+	void onBtnSelect();
+	void onBtnRefresh();
+	void onRangeAdjust();
+	void onBtnClose();
+	void onList();
+	void onTabChanged();
+	bool isSelectBtnEnabled();
 
 	void populateNearMe();
 	void populateFriend();
 	BOOL				mNearMeListComplete;
 	BOOL				mCloseOnSelect;
 
-	void (*mCallback)(const std::vector<std::string>& name, const std::vector<LLUUID>& id, void* userdata);
-	void* mCallbackUserdata;
 	validate_signal_t mOkButtonValidateSignal;
+	select_callback_t mSelectionCallback;
 };
 
 #endif

indra/newview/llfloaterfriends.cpp

 
 // static
 void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names,
-									const std::vector<LLUUID>& ids,
-									void* )
+									const std::vector<LLUUID>& ids)
 {
 	if (names.empty()) return;
 	if (ids.empty()) return;
 {
 	LLPanelFriends* panelp = (LLPanelFriends*)user_data;
 	LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
-	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onPickAvatar, user_data, FALSE, TRUE);
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1,_2), FALSE, TRUE);
 	if (root_floater)
 	{
 		root_floater->addDependentFloater(picker);

indra/newview/llfloaterfriends.h

 	static void onSelectName(LLUICtrl* ctrl, void* user_data);
 	static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
 	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
-	static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
+	static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	static void onMaximumSelect();
 
 	static void onClickIM(void* user_data);

indra/newview/llfloatergodtools.cpp

 void LLPanelObjectTools::onClickSet()
 {
 	// grandparent is a floater, which can have a dependent
-	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, this));
+	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2)));
 }
 
 void LLPanelObjectTools::onClickSetBySelection(void* data)
 	panelp->childSetValue("target_avatar_name", name);
 }
 
-// static
-void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
+void LLPanelObjectTools::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
-	LLPanelObjectTools* object_tools = (LLPanelObjectTools*) data;
 	if (ids.empty() || names.empty()) return;
-	object_tools->mTargetAvatar = ids[0];
-	object_tools->childSetValue("target_avatar_name", names[0]);
-	object_tools->refresh();
+	mTargetAvatar = ids[0];
+	childSetValue("target_avatar_name", names[0]);
+	refresh();
 }
 
 void LLPanelObjectTools::onChangeAnything()

indra/newview/llfloatergodtools.h

 	void onChangeAnything();
 	void onApplyChanges();
 	void onClickSet();
-	static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
+	void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	void onClickDeletePublicOwnedBy();
 	void onClickDeleteAllScriptedOwnedBy();
 	void onClickDeleteAllOwnedBy();

indra/newview/llfloaterland.cpp

 	childSetCommitCallback("PriceSpin", onCommitAny, this);
 	childSetCommitCallback("HoursSpin", onCommitAny, this);
 
-	childSetAction("add_allowed", onClickAddAccess, this);
+	childSetAction("add_allowed", boost::bind(&LLPanelLandAccess::onClickAddAccess, this));
 	childSetAction("remove_allowed", onClickRemoveAccess, this);
-	childSetAction("add_banned", onClickAddBanned, this);
+	childSetAction("add_banned", boost::bind(&LLPanelLandAccess::onClickAddBanned, this));
 	childSetAction("remove_banned", onClickRemoveBanned, this);
 	
 	mListAccess = getChild<LLNameListCtrl>("AccessList");
 	self->refresh();
 }
 
-// static
-void LLPanelLandAccess::onClickAddAccess(void* data)
+void LLPanelLandAccess::onClickAddAccess()
 {
-	LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
-	if (panelp)
-	{
-		gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBAccess, data) );
-	}
+	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1,_2)) );
 }
 
-// static
-void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
+void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
-	LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
 	if (!names.empty() && !ids.empty())
 	{
 		LLUUID id = ids[0];
-		LLParcel* parcel = panelp->mParcel->getParcel();
+		LLParcel* parcel = mParcel->getParcel();
 		if (parcel)
 		{
 			parcel->addToAccessList(id, 0);
 			LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS);
-			panelp->refresh();
+			refresh();
 		}
 	}
 }
 }
 
 // static
-void LLPanelLandAccess::onClickAddBanned(void* data)
+void LLPanelLandAccess::onClickAddBanned()
 {
-	LLPanelLandAccess* panelp = (LLPanelLandAccess*)data;
-	gFloaterView->getParentFloater(panelp)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarCBBanned, data) );
+	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1,_2)));
 }
 
 // static
-void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
+void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
-	LLPanelLandAccess* panelp = (LLPanelLandAccess*)userdata;
 	if (!names.empty() && !ids.empty())
 	{
 		LLUUID id = ids[0];
-		LLParcel* parcel = panelp->mParcel->getParcel();
+		LLParcel* parcel = mParcel->getParcel();
 		if (parcel)
 		{
 			parcel->addToBanList(id, 0);
 			LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN);
-			panelp->refresh();
+			refresh();
 		}
 	}
 }

indra/newview/llfloaterland.h

 
 	static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
 	static void onCommitAny(LLUICtrl* ctrl, void *userdata);
-	static void onClickAddAccess(void*);
-	static void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
 	static void onClickRemoveAccess(void*);
-	static void onClickAddBanned(void*);
-	static void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
 	static void onClickRemoveBanned(void*);
 
 	virtual BOOL postBuild();
+	
+	void onClickAddAccess();
+	void onClickAddBanned();
+	void callbackAvatarCBBanned(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
+	void callbackAvatarCBAccess(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 
 protected:
 	LLNameListCtrl*		mListAccess;

indra/newview/llfloaterregioninfo.cpp

 	initCtrl("restrict_pushobject");
 	initCtrl("block_parcel_search_check");
 
-	childSetAction("kick_btn", onClickKick, this);
+	childSetAction("kick_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickKick, this));
 	childSetAction("kick_all_btn", onClickKickAll, this);
 	childSetAction("im_btn", onClickMessage, this);
 //	childSetAction("manage_telehub_btn", onClickManageTelehub, this);
 	return LLPanelRegionInfo::postBuild();
 }
 
-// static
-void LLPanelRegionGeneralInfo::onClickKick(void* userdata)
+void LLPanelRegionGeneralInfo::onClickKick()
 {
 	llinfos << "LLPanelRegionGeneralInfo::onClickKick" << llendl;
-	LLPanelRegionGeneralInfo* panelp = (LLPanelRegionGeneralInfo*)userdata;
 
 	// this depends on the grandparent view being a floater
 	// in order to set up floater dependency
-	LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
-	LLFloater* child_floater = LLFloaterAvatarPicker::show(onKickCommit, userdata, FALSE, TRUE);
+	LLFloater* parent_floater = gFloaterView->getParentFloater(this);
+	LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1,_2), FALSE, TRUE);
 	parent_floater->addDependentFloater(child_floater);
 }
 
-// static
-void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
+void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
 	if (names.empty() || ids.empty()) return;
 	if(ids[0].notNull())
 	{
-		LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata;
-		if(!self) return;
 		strings_t strings;
 		// [0] = our agent id
 		// [1] = target agent id
 		strings.push_back(strings_t::value_type(buffer));
 
 		LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
-		self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings);
+		sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings);
 	}
 }
 
 	initCtrl("disable_collisions_check");
 	initCtrl("disable_physics_check");
 
-	childSetAction("choose_avatar_btn", onClickChooseAvatar, this);
+	childSetAction("choose_avatar_btn", boost::bind(&LLPanelRegionDebugInfo::onClickChooseAvatar, this));
 	childSetAction("return_btn", onClickReturn, this);
 	childSetAction("top_colliders_btn", onClickTopColliders, this);
 	childSetAction("top_scripts_btn", onClickTopScripts, this);
 	return TRUE;
 }
 
-void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data)
+void LLPanelRegionDebugInfo::onClickChooseAvatar()
 {
-	LLFloaterAvatarPicker::show(callbackAvatarID, data, FALSE, TRUE);
+	LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionDebugInfo::callbackAvatarID, this, _1, _2), FALSE, TRUE);
 }
 
-// static
-void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
+
+void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
-	LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) data;
 	if (ids.empty() || names.empty()) return;
-	self->mTargetAvatar = ids[0];
-	self->childSetValue("target_avatar_name", LLSD(names[0]));
-	self->refreshFromRegion( gAgent.getRegion() );
+	mTargetAvatar = ids[0];
+	childSetValue("target_avatar_name", LLSD(names[0]));
+	refreshFromRegion( gAgent.getRegion() );
 }
 
 // static
 	LLUUID      mAgentID;
 };
 
-void LLPanelEstateInfo::onClickKickUser(void *user_data)
+void LLPanelEstateInfo::onClickKickUser()
 {
-	LLPanelEstateInfo* panelp = (LLPanelEstateInfo*)user_data;
-
 	// this depends on the grandparent view being a floater
 	// in order to set up floater dependency
-	LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
-	LLFloater* child_floater = LLFloaterAvatarPicker::show(LLPanelEstateInfo::onKickUserCommit, user_data, FALSE, TRUE);
+	LLFloater* parent_floater = gFloaterView->getParentFloater(this);
+	LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1, _2), FALSE, TRUE);
 	parent_floater->addDependentFloater(child_floater);
 }
 
-void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
+void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
 	if (names.empty() || ids.empty()) return;
 	
 		return;
 	}
 
-	LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata;
-	if(!self) return;
-
 	//keep track of what user they want to kick and other misc info
 	LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo();
-	kick_info->mEstatePanelp = self;
+	kick_info->mEstatePanelp = this;
 	kick_info->mAgentID     = ids[0];
 
 	//Bring up a confirmation dialog
 	args["EVIL_USER"] = names[0];
 	LLSD payload;
 	payload["agent_id"] = ids[0];
-	LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2));
+	LLNotificationsUtil::add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, this, _1, _2));
 
 }
 
 
 	LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
 	// avatar picker yes multi-select, yes close-on-select
-	LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE);
+	LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, _2, (void*)change_info), TRUE, TRUE);
 	return false;
 }
 
 	childSetAction("add_estate_manager_btn", onClickAddEstateManager, this);
 	childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this);
 	childSetAction("message_estate_btn", onClickMessageEstate, this);
-	childSetAction("kick_user_from_estate_btn", onClickKickUser, this);
+	childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this));
 
 	childSetAction("WLEditSky", onClickEditSky, this);
 	childSetAction("WLEditDayCycle", onClickEditDayCycle, this);

indra/newview/llfloaterregioninfo.h

 	
 protected:
 	virtual BOOL sendUpdate();
-	static void onClickKick(void* userdata);
-	static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
+	void onClickKick();
+	void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	static void onClickKickAll(void* userdata);
 	bool onKickAllCommit(const LLSD& notification, const LLSD& response);
 	static void onClickMessage(void* userdata);
 protected:
 	virtual BOOL sendUpdate();
 
-	static void onClickChooseAvatar(void*);
-	static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
+	void onClickChooseAvatar();
+	void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	static void onClickReturn(void *);
 	bool callbackReturn(const LLSD& notification, const LLSD& response);
 	static void onClickTopColliders(void*);
 	static void onClickRemoveBannedAgent(void* user_data);
 	static void onClickAddEstateManager(void* user_data);
 	static void onClickRemoveEstateManager(void* user_data);
-	static void onClickKickUser(void* userdata);
+	void onClickKickUser();
 
 	// Group picker callback is different, can't use core methods below
 	bool addAllowedGroup(const LLSD& notification, const LLSD& response);
 	// Send the actual EstateOwnerRequest "estateaccessdelta" message
 	static void sendEstateAccessDelta(U32 flags, const LLUUID& agent_id);
 
-	static void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
+	void onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	static void onClickMessageEstate(void* data);
 	bool onMessageCommit(const LLSD& notification, const LLSD& response);
 	

indra/newview/llfloaterreporter.cpp

 						std::string("tool_face_active.tga") );
 	childSetAction("pick_btn", onClickObjPicker, this);
 
-	childSetAction("select_abuser", onClickSelectAbuser, this);
+	childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this));
 
 	childSetAction("send_btn", onClickSend, this);
 	childSetAction("cancel_btn", onClickCancel, this);
 }
 
 
-// static
-void LLFloaterReporter::onClickSelectAbuser(void *userdata)
+void LLFloaterReporter::onClickSelectAbuser()
 {
-	LLFloaterReporter *self = (LLFloaterReporter *)userdata;
-
-	gFloaterView->getParentFloater(self)->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarID, userdata, FALSE, TRUE ));
+	gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE ));
 }
 
-// static
-void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
+void LLFloaterReporter::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
-	LLFloaterReporter* self = (LLFloaterReporter*) data;
-
 	if (ids.empty() || names.empty()) return;
 
-	self->childSetText("abuser_name_edit", names[0] );
+	childSetText("abuser_name_edit", names[0] );
 
-	self->mAbuserID = ids[0];
+	mAbuserID = ids[0];
 
-	self->refresh();
+	refresh();
 
 }
 

indra/newview/llfloaterreporter.h

 	static void onClickSend			(void *userdata);
 	static void onClickCancel		(void *userdata);
 	static void onClickObjPicker	(void *userdata);
-	static void onClickSelectAbuser (void *userdata);
+	void onClickSelectAbuser ();
 	static void closePickTool	(void *userdata);
 	static void uploadDoneCallback(const LLUUID &uuid, void* user_data, S32 result, LLExtStat ext_status);
 	static void addDescription(const std::string& description, LLMeanCollisionData *mcd = NULL);
 	void setPosBox(const LLVector3d &pos);
 	void enableControls(BOOL own_avatar);
 	void getObjectInfo(const LLUUID& object_id);
-	static void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
+	void callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 
 private:
 	EReportType		mReportType;

indra/newview/llfloatersellland.cpp

 	void setBadge(const char* id, Badge badge);
 
 	static void onChangeValue(LLUICtrl *ctrl, void *userdata);
-	static void doSelectAgent(void *userdata);
+	void doSelectAgent();
 	static void doCancel(void *userdata);
 	static void doSellLand(void *userdata);
 	bool onConfirmSale(const LLSD& notification, const LLSD& response);
 	static void doShowObjects(void *userdata);
 	static bool callbackHighlightTransferable(const LLSD& notification, const LLSD& response);
 
-	static void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data);
+	void callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 
 public:
 	virtual BOOL postBuild();
 	childSetCommitCallback("price", onChangeValue, this);
 	childSetPrevalidate("price", LLLineEditor::prevalidateNonNegativeS32);
 	childSetCommitCallback("sell_objects", onChangeValue, this);
-	childSetAction("sell_to_select_agent", doSelectAgent, this);
+	childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this));
 	childSetAction("cancel_btn", doCancel, this);
 	childSetAction("sell_btn", doSellLand, this);
 	childSetAction("show_objects", doShowObjects, this);
 		self->mSellToBuyer = true;
 		if (self->mAuthorizedBuyer.isNull())
 		{
-			doSelectAgent(self);
+			self->doSelectAgent();
 		}
 	}
 	else if (sell_to == "anyone")
 	self->refreshUI();
 }
 
-// static
-void LLFloaterSellLandUI::doSelectAgent(void *userdata)
+void LLFloaterSellLandUI::doSelectAgent()
 {
-	LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)userdata;
 	// grandparent is a floater, in order to set up dependency
-	floaterp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAvatarPick, floaterp, FALSE, TRUE));
+	addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE));
 }
 
-// static
-void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
+void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {	
-	LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data;
-	LLParcel* parcel = floaterp->mParcelSelection->getParcel();
+	LLParcel* parcel = mParcelSelection->getParcel();
 
 	if (names.empty() || ids.empty()) return;
 	
 	LLUUID id = ids[0];
 	parcel->setAuthorizedBuyerID(id);
 
-	floaterp->mAuthorizedBuyer = ids[0];
+	mAuthorizedBuyer = ids[0];
 
-	floaterp->childSetText("sell_to_agent", names[0]);
+	childSetText("sell_to_agent", names[0]);
 
-	floaterp->refreshUI();
+	refreshUI();
 }
 
 // static

indra/newview/llpanelblockedlist.cpp

 {
 	const BOOL allow_multiple = FALSE;
 	const BOOL close_on_select = TRUE;
-	/*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(callbackBlockPicked, this, allow_multiple, close_on_select);
+	/*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(boost::bind(&LLPanelBlockedList::callbackBlockPicked, this, _1, _2), allow_multiple, close_on_select);
 
 	// *TODO: mantipov: should LLFloaterAvatarPicker be closed when panel is closed?
 	// old Floater dependency is not enable in panel
 	LLFloaterGetBlockedObjectName::show(&LLPanelBlockedList::callbackBlockByName);
 }
 
-//static
-void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data)
+void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids)
 {
 	if (names.empty() || ids.empty()) return;
 	LLMute mute(ids[0], names[0], LLMute::AGENT);

indra/newview/llpanelblockedlist.h

 	void onPickBtnClick();
 	void onBlockByNameClick();
 
-	static void callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
+	void callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
 	static void callbackBlockByName(const std::string& text);
 
 private:

indra/newview/llpanelgroupinvite.cpp

 		LLFloater* parentp;
 
 		parentp = gFloaterView->getParentFloater(panelp);
-		parentp->addDependentFloater(LLFloaterAvatarPicker::show(callbackAddUsers,
-																 panelp->mImplementation,
+		parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, _2,
+																panelp->mImplementation),
 																 TRUE));
 	}
 }

indra/newview/llpanelpeople.cpp

 void LLPanelPeople::onAddFriendWizButtonClicked()
 {
 	// Show add friend wizard.
-	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE);
+	LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE);
 	// Need to disable 'ok' button when friend occurs in selection
 	if (picker)	picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1));
 	LLFloater* root_floater = gFloaterView->getParentFloater(this);
 // static
 void LLPanelPeople::onAvatarPicked(
 		const std::vector<std::string>& names,
-		const std::vector<LLUUID>& ids,
-		void*)
+		const std::vector<LLUUID>& ids)
 {
 	if (!names.empty() && !ids.empty())
 		LLAvatarActions::requestFriendshipDialog(ids[0], names[0]);

indra/newview/llpanelpeople.h

 	// misc callbacks
 	static void				onAvatarPicked(
 								const std::vector<std::string>& names,
-								const std::vector<LLUUID>& ids,
-								void*);
+								const std::vector<LLUUID>& ids);
 
 	void					onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list);