summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-02-11 16:04:31 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-02-11 16:04:31 -0500
commit969cb45920c568aeebf145480b7beacb2a157bcf (patch)
tree63dfb29d5e0226b054094d88358bec6ede68c197 /indra/newview/llagent.h
parentd8f627d8bd45cc356583e2251500c23bed836b16 (diff)
parent413be91cf5044889ade97dcbec4b17fceff122e3 (diff)
merge
Diffstat (limited to 'indra/newview/llagent.h')
-rwxr-xr-xindra/newview/llagent.h46
1 files changed, 43 insertions, 3 deletions
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 0095c280fb..ecf4bdc272 100755
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -232,15 +232,54 @@ private:
LLVector3 mHomePosRegion;
//--------------------------------------------------------------------
- // Region
+ // Parcel
//--------------------------------------------------------------------
public:
+ void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary
+
+ // Register a boost callback to be called when the agent changes parcels
+ typedef boost::function<void()> parcel_changed_callback_t;
+ boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t);
+
+private:
+ typedef boost::signals2::signal<void()> parcel_changed_signal_t;
+ parcel_changed_signal_t mParcelChangedSignal;
+
+ //--------------------------------------------------------------------
+ // Region
+ //--------------------------------------------------------------------
+ public:
void setRegion(LLViewerRegion *regionp);
LLViewerRegion *getRegion() const;
LLHost getRegionHost() const;
BOOL inPrelude();
-private:
+
+ /**
+ * Register a boost callback to be called when the agent changes regions
+ * Note that if you need to access a capability for the region, you may need to wait
+ * for the capabilities to be received, since in some cases your region changed
+ * callback will be called before the capabilities have been received. Your callback
+ * may need to look something like:
+ *
+ * LLViewerRegion* region = gAgent.getRegion();
+ * if (region->capabilitiesReceived())
+ * {
+ * useCapability(region);
+ * }
+ * else // Need to handle via callback after caps arrive.
+ * {
+ * region->setCapabilitiesReceivedCallback(boost::bind(&useCapability,region,_1));
+ * // you may or may not want to remove that callback
+ * }
+ */
+ typedef boost::signals2::signal<void()> region_changed_signal_t;
+
+ boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb);
+ void removeRegionChangedCallback(boost::signals2::connection callback);
+
+ private:
LLViewerRegion *mRegionp;
+ region_changed_signal_t mRegionChangedSignal;
//--------------------------------------------------------------------
// History
@@ -640,9 +679,10 @@ private:
public:
bool canEditParcel() const { return mCanEditParcel; }
private:
+ static void setCanEditParcel();
bool mCanEditParcel;
- static void parcelChangedCallback();
+
/********************************************************************************
** **