[Haiku-commits] r31140 - in haiku/trunk: headers/os/interface src/kits/interface

stippi at mail.berlios.de stippi at mail.berlios.de
Sat Jun 20 17:47:29 CEST 2009


Author: stippi
Date: 2009-06-20 17:47:28 +0200 (Sat, 20 Jun 2009)
New Revision: 31140
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31140&view=rev

Modified:
   haiku/trunk/headers/os/interface/View.h
   haiku/trunk/src/kits/interface/View.cpp
   haiku/trunk/src/kits/interface/Window.cpp
Log:
Reverted my change to usage of _get_object_token_(), it already means to use
a cached token... doh! Thanks Axel!


Modified: haiku/trunk/headers/os/interface/View.h
===================================================================
--- haiku/trunk/headers/os/interface/View.h	2009-06-20 15:37:33 UTC (rev 31139)
+++ haiku/trunk/headers/os/interface/View.h	2009-06-20 15:47:28 UTC (rev 31140)
@@ -622,7 +622,8 @@
 			void 			_PrintToStream();
 			void			_PrintTree();
 
-			int32			fServerToken;
+			int32			_unused_int1;
+
 			uint32			fFlags;
 			BPoint			fParentOffset;
 			BWindow*		fOwner;

Modified: haiku/trunk/src/kits/interface/View.cpp
===================================================================
--- haiku/trunk/src/kits/interface/View.cpp	2009-06-20 15:37:33 UTC (rev 31139)
+++ haiku/trunk/src/kits/interface/View.cpp	2009-06-20 15:47:28 UTC (rev 31140)
@@ -1000,7 +1000,7 @@
 
 	ViewSetViewCursorInfo info;
 	info.cursorToken = cursor->fServerToken;
-	info.viewToken = fServerToken;
+	info.viewToken = _get_object_token_(this);
 	info.sync = sync;
 
 	BPrivate::AppServerLink link;
@@ -3906,7 +3906,7 @@
 	if (owner != NULL && !fTopLevelView) {
 		// the top level view is deleted by the app_server automatically
 		owner->fLink->StartMessage(AS_VIEW_DELETE);
-		owner->fLink->Attach<int32>(fServerToken);
+		owner->fLink->Attach<int32>(_get_object_token_(this));
 	}
 
 	parent->InvalidateLayout();
@@ -4302,7 +4302,7 @@
 			BView::GetHeightForWidth(data->width, &data->min, &data->max,
 				&data->preferred);
 			return B_OK;
-}
+		}
 		case PERFORM_CODE_SET_LAYOUT:
 		{
 			perform_data_set_layout* data = (perform_data_set_layout*)_data;
@@ -4645,7 +4645,6 @@
 
 	fParentOffset.Set(frame.left, frame.top);
 
-	fServerToken = _get_object_token_(this);
 	fOwner = NULL;
 	fParent = NULL;
 	fNextSibling = NULL;
@@ -4902,7 +4901,7 @@
 	else
  		fOwner->fLink->StartMessage(AS_VIEW_CREATE);
 
-	fOwner->fLink->Attach<int32>(fServerToken);
+	fOwner->fLink->Attach<int32>(_get_object_token_(this));
 	fOwner->fLink->AttachString(Name());
 	fOwner->fLink->Attach<BRect>(Frame());
 	fOwner->fLink->Attach<BPoint>(LeftTop());
@@ -4915,7 +4914,7 @@
 	if (fTopLevelView)
 		fOwner->fLink->Attach<int32>(B_NULL_TOKEN);
 	else
-		fOwner->fLink->Attach<int32>(fParent->fServerToken);
+		fOwner->fLink->Attach<int32>(_get_object_token_(fParent));
 	fOwner->fLink->Flush();
 
 	_CheckOwnerLockAndSwitchCurrent();
@@ -5123,7 +5122,7 @@
 		if (fOwner->fLastMouseMovedView == this)
 			fOwner->fLastMouseMovedView = NULL;
 
-		if (fOwner->fLastViewToken == fServerToken)
+		if (fOwner->fLastViewToken == _get_object_token_(this))
 			fOwner->fLastViewToken = B_NULL_TOKEN;
 
 		_SetOwner(NULL);
@@ -5340,12 +5339,14 @@
 void
 BView::_SwitchServerCurrentView() const
 {
-	if (fOwner->fLastViewToken != fServerToken) {
-		STRACE(("contacting app_server... sending token: %ld\n", fServerToken));
+	int32 serverToken = _get_object_token_(this);
+
+	if (fOwner->fLastViewToken != serverToken) {
+		STRACE(("contacting app_server... sending token: %ld\n", serverToken));
 		fOwner->fLink->StartMessage(AS_SET_CURRENT_VIEW);
-		fOwner->fLink->Attach<int32>(fServerToken);
+		fOwner->fLink->Attach<int32>(serverToken);
 
-		fOwner->fLastViewToken = fServerToken;
+		fOwner->fLastViewToken = serverToken;
 	} else {
 		STRACE(("quiet2\n"));
 	}
@@ -5504,7 +5505,7 @@
 	fNextSibling ? fNextSibling->Name() : "NULL",
 	fPreviousSibling ? fPreviousSibling->Name() : "NULL",
 	fOwner ? fOwner->Name() : "NULL",
-	fServerToken,
+	_get_object_token_(this),
 	fFlags,
 	fParentOffset.x, fParentOffset.y,
 	fBounds.left, fBounds.top, fBounds.right, fBounds.bottom,

Modified: haiku/trunk/src/kits/interface/Window.cpp
===================================================================
--- haiku/trunk/src/kits/interface/Window.cpp	2009-06-20 15:37:33 UTC (rev 31139)
+++ haiku/trunk/src/kits/interface/Window.cpp	2009-06-20 15:47:28 UTC (rev 31140)
@@ -2905,7 +2905,7 @@
 	fTopView->fTopLevelView = true;
 
 	//inhibit check_lock()
-	fLastViewToken = fTopView->fServerToken;
+	fLastViewToken = _get_object_token_(fTopView);
 
 	// set fTopView's owner, add it to window's eligible handler list
 	// and also set its next handler to be this window.
@@ -3089,7 +3089,7 @@
 			cookie.focus_token = _get_object_token_(*_target);
 
 		if (fLastMouseMovedView != NULL && cookie.message->what == B_MOUSE_MOVED)
-			cookie.last_view_token = fLastMouseMovedView->fServerToken;
+			cookie.last_view_token = _get_object_token_(fLastMouseMovedView);
 
 		*_usePreferred = false;
 	}




More information about the Haiku-commits mailing list