[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 913
Date       : Fri Apr 28 11:15:33 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/main3.cpp
   M /Trunk/XaraLX/Kernel/nodebmp.cpp
   M /Trunk/XaraLX/Kernel/sgbitmap.cpp
   M /Trunk/XaraLX/Kernel/sgbitmap.h
   M /Trunk/XaraLX/wxOil/Makefile.am
   M /Trunk/XaraLX/wxOil/dragbmp.cpp
   M /Trunk/XaraLX/wxOil/dragmgr.cpp

Bitmap gallery drags work, but do not (yet) render correctly during dragging.


Diff:
Index: Trunk/XaraLX/Kernel/nodebmp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodebmp.cpp	(revision 912)
+++ Trunk/XaraLX/Kernel/nodebmp.cpp	(revision 913)
@@ -523,6 +523,7 @@
 
 	BOOL ok = TRUE;
 
+PORTNOTE("liveeffects", "XPE menu option disabled")
 #ifndef EXCLUDE_FROM_XARALX
 	ok = ok && pMenu->BuildCommand(OPTOKEN_XPE_EDIT, FALSE);
 #endif
@@ -2673,18 +2674,17 @@
 {
 	BOOL ok = FALSE;
 
-PORTNOTE("other","OpCreateNodeBitmap::DoWithParam - User intraction")
-#ifndef EXCLUDE_FROM_XARALX
 	ERROR3IF(pOpParam == NULL, "NULL OpParam passed to OpCreateNodeBitmap"); 
 
-	KernelBitmap* KernelBmp = (KernelBitmap*)pOpParam->Param1;
-	PageDropInfo* pDropInfo = (PageDropInfo*)pOpParam->Param2;
+	KernelBitmap* KernelBmp = (KernelBitmap*)(void *)pOpParam->Param1;
+	PageDropInfo* pDropInfo = (PageDropInfo*)(void *)pOpParam->Param2;
 
-	Document* pDoc 		= pDropInfo->pDoc;
+//	Document* pDoc 		= pDropInfo->pDoc;
 	Spread* pSpread		= pDropInfo->pSpread;
 	DocCoord DropPos 	= pDropInfo->DropPos;
 
 	DocRect BoundsRect;
+	BitmapInfo Info;
 
 	NodeBitmap* pNodeBitmap = new NodeBitmap();
 	if ((pNodeBitmap == NULL) || (!pNodeBitmap->SetUpPath(12,12)))
@@ -2699,7 +2699,6 @@
 	}
 
 	
-	BitmapInfo Info;
 	pNodeBitmap->GetBitmap()->ActualBitmap->GetInfo(&Info);
 
 	BoundsRect.lo.x = DropPos.x - (Info.RecommendedWidth/2);
@@ -2722,12 +2721,9 @@
 		delete pNodeBitmap;
 		goto EndOp;
 	} 
-#endif
 	ok = TRUE;
 
-#ifndef EXCLUDE_FROM_XARALX
 EndOp:
-#endif
 	if (!ok)
 		FailAndExecute();
 
Index: Trunk/XaraLX/Kernel/sgbitmap.h
===================================================================
--- Trunk/XaraLX/Kernel/sgbitmap.h	(revision 912)
+++ Trunk/XaraLX/Kernel/sgbitmap.h	(revision 913)
@@ -116,8 +116,6 @@
 class BmpDlgParam;
 class SGDisplayKernelBitmap;
 
-PORTNOTE("other", "Disable GalleryBitmapDragInfo")
-#ifndef EXCLUDE_FROM_XARALX
 /********************************************************************************************
 
 >	class GalleryBitmapDragInfo : public BitmapDragInformation
@@ -157,7 +155,6 @@
 
 	KernelBitmap*			m_pDragBmp;
 };
-#endif
 
 /*********************************************************************************************
 
Index: Trunk/XaraLX/Kernel/main3.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main3.cpp	(revision 912)
+++ Trunk/XaraLX/Kernel/main3.cpp	(revision 913)
@@ -202,10 +202,9 @@
 			OpNudge::Init() &&					// Init the nudge ops
 			OpCombineShapes::Init() &&			// init the shape combining ops
 
-#ifndef EXCLUDE_FROM_XARALX
 			OpMenuSelectPathPoints::Init() &&
 			OpCreateNodeBitmap::Init() &&
-#endif
+
 			ColourListComponentClass::Init() && // Init & register the colour list component
 			BitmapListComponentClass::Init() && // Init & register the bitmap list component
 			UnitListComponentClass::Init()	 && // Init & register the units component
Index: Trunk/XaraLX/Kernel/sgbitmap.cpp
===================================================================
--- Trunk/XaraLX/Kernel/sgbitmap.cpp	(revision 912)
+++ Trunk/XaraLX/Kernel/sgbitmap.cpp	(revision 913)
@@ -120,7 +120,7 @@
 //#include "resource.h"	// For _R(IDS_CANCEL)
 
 #include "dragmgr.h"
-//nclude "dragbmp.h"
+#include "dragbmp.h"
 //nclude "viewrc.h"		// FOR _R(IDC_CANDROPONPAGE)
 
 #include "docview.h"
@@ -171,10 +171,7 @@
 CC_IMPLEMENT_DYNCREATE(OpDisplayBitmapGallery,Operation);
 CC_IMPLEMENT_DYNAMIC(SGBitmapDragTarget, SGListDragTarget);
 
-PORTNOTE("other", "Disabled GalleryBitmapDragInfo")
-#ifndef EXCLUDE_FROM_XARALX
 CC_IMPLEMENT_DYNCREATE(GalleryBitmapDragInfo, BitmapDragInformation)
-#endif
 
 // Enable Background redraw in the bitmap gallery...
 //#define SGBITMAP_BACKGROUND_REDRAW
@@ -273,8 +270,6 @@
 	return(FALSE);
 }
 
-PORTNOTE ("other", "Removed GalleryBitmapDragInfo class")
-#ifndef EXCLUDE_FROM_XARALX
 /********************************************************************************************
 
 >	void GalleryBitmapDragInfo::GalleryBitmapDragInfo() 
@@ -574,7 +569,8 @@
 			OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_BACKGROUND);
 
 			// Invoke the operation, passing in our parameters
-			pOpDesc->Invoke(&Param);		 
+			if (pOpDesc)
+				pOpDesc->Invoke(&Param);		 
 		}
 		else
 		{
@@ -583,16 +579,18 @@
 			// Obtain a pointer to the op descriptor for the create operation 
 			OpDescriptor* OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpCreateNodeBitmap));
 
-			// Invoke the operation, passing DocView and Pos as parameters
-			OpParam param((void *)BitmapToApply,(void *)&ThePageDropInfo);
-			OpDesc->Invoke(&param);		 
+			if (OpDesc)
+			{
+				// Invoke the operation, passing DocView and Pos as parameters
+				OpParam param((void *)BitmapToApply,(void *)&ThePageDropInfo);
+				OpDesc->Invoke(&param);		 
+			}
 		}
 	}
 
 	return TRUE;
 }
 
-#endif // EXCLUDE_FROM_XARALX
 
 /***********************************************************************************************
 
@@ -1378,8 +1376,6 @@
 					}
 					else
 					{
-PORTNOTE("other", "Disabled GalleryBitmapDragInfo")
-#ifndef EXCLUDE_FROM_XARALX
 						DefaultPreDragHandler(Mouse, MiscInfo);
 
 						GalleryBitmapDragInfo *DragBmp;
@@ -1387,7 +1383,6 @@
 															Mouse->MenuClick);
 						if (DragBmp != NULL)
 							DragManagerOp::StartDrag(DragBmp);
-#endif
 					}
 
 					return(TRUE);		// Claim this event - nobody else can own this click
@@ -2877,14 +2872,11 @@
 
 void BitmapSGallery::HandleDragStart(DragMessage *DragMsg)
 {
-PORTNOTE("other", "Disable GalleryBitmapDragInfo")
-#ifndef EXCLUDE_FROM_XARALX
 	// If it's a bitmap drag, add a target for our window. If not, let the base class
 	// have a look at it (to see if it is a gallery item being dragged)
 	if (DragMsg->pInfo->IsKindOf(CC_RUNTIME_CLASS(GalleryBitmapDragInfo)))
 		/* SGBitmapDragTarget *NewTarget =*/ new SGBitmapDragTarget(this, GetListGadgetID());
 	else
-#endif
 		SuperGallery::HandleDragStart(DragMsg);
 }
 
Index: Trunk/XaraLX/wxOil/dragbmp.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dragbmp.cpp	(revision 912)
+++ Trunk/XaraLX/wxOil/dragbmp.cpp	(revision 913)
@@ -353,7 +353,7 @@
 
 UINT32 BitmapDragInformation::GetCursorID(DragTarget* pDragTarget)
 {
-	return NULL;
+	return 0;
 }
 
 /********************************************************************************************
@@ -1038,7 +1038,7 @@
 >	static BOOL BitmapDragInformation::Init()
 
 	Author:		Will_Cowling (Xara Group Ltd) <camelotdev@xxxxxxxx>
-	Created:	19/3/95		  
+	Created:	19/3/95
 	Returns:	-
 	Purpose:	Initialise any Bitmap Drag stuff. (eg. ini file preferences).
 	SeeAlso:	-
@@ -1048,9 +1048,9 @@
 BOOL BitmapDragInformation::Init()
 {
 	// Setup preference for drag transparency
-	if (GetApplication()->DeclareSection("Dragging", 1))
+	if (GetApplication()->DeclareSection(_T("Dragging"), 1))
 	{
-		GetApplication()->DeclarePref( NULL, "BitmapDragTransparency", 
+		GetApplication()->DeclarePref( NULL, _T("BitmapDragTransparency"), 
 								&DragTransparency, 0, 100);
 	}
 
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am	(revision 912)
+++ Trunk/XaraLX/wxOil/Makefile.am	(revision 913)
@@ -42,7 +42,7 @@
 	ctrllist.cpp dlgcol.cpp thumb.cpp dragmgr.cpp ccolbar.cpp dragcol.cpp \
 	drawctl.cpp filedlgs.cpp fileutil.cpp ktimer.cpp \
 	outptdib.cpp outptpng.cpp outptgif.cpp gpalopt.cpp bmpfiltr.cpp giffiltr.cpp \
-	fontbase.cpp ftfonts.cpp textfuns.cpp \
+	fontbase.cpp ftfonts.cpp textfuns.cpp dragbmp.cpp \
 	resources.cpp
 
 # Keep resources.cpp (the autogenerated resource file) on a separate line.
Index: Trunk/XaraLX/wxOil/dragmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dragmgr.cpp	(revision 912)
+++ Trunk/XaraLX/wxOil/dragmgr.cpp	(revision 913)
@@ -395,8 +395,8 @@
 		}
 #endif
 	    // clean up the dc
-	    MaskDC.SetBrush(wxNullBrush);
-		MaskDC.SetPen(wxNullPen);
+	    MaskDC.SetBrush(*wxTRANSPARENT_BRUSH);
+		MaskDC.SetPen(*wxTRANSPARENT_PEN);
 		MaskDC.SelectObject(wxNullBitmap);
 	}
 	else


Xara