removing the TOOLBAR_DD #ifdef's.

This commit is contained in:
pinkerton%netscape.com 1999-08-04 20:16:31 +00:00
Родитель 33f8f58cdc
Коммит c888de1a4c
7 изменённых файлов: 6 добавлений и 52 удалений

Просмотреть файл

@ -75,10 +75,7 @@
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsDocument.h"
#ifdef TOOLBAR_DD
#include "nsToolbarItemFrame.h"
#endif
nsresult
NS_NewTabFrame ( nsIFrame** aNewFrame );
@ -2974,12 +2971,10 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
processChildren = PR_TRUE;
rv = NS_NewToolbarFrame(&newFrame);
}
#ifdef TOOLBAR_DD
else if (aTag == nsXULAtoms::toolbaritem) {
processChildren = PR_TRUE;
rv = NS_NewToolbarItemFrame(&newFrame);
}
#endif
// End of TOOLBAR CONSTRUCTION logic
// PROGRESS METER CONSTRUCTION

Просмотреть файл

@ -75,10 +75,7 @@
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsDocument.h"
#ifdef TOOLBAR_DD
#include "nsToolbarItemFrame.h"
#endif
nsresult
NS_NewTabFrame ( nsIFrame** aNewFrame );
@ -2974,12 +2971,10 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
processChildren = PR_TRUE;
rv = NS_NewToolbarFrame(&newFrame);
}
#ifdef TOOLBAR_DD
else if (aTag == nsXULAtoms::toolbaritem) {
processChildren = PR_TRUE;
rv = NS_NewToolbarItemFrame(&newFrame);
}
#endif
// End of TOOLBAR CONSTRUCTION logic
// PROGRESS METER CONSTRUCTION

Просмотреть файл

@ -307,9 +307,8 @@ nsToolbarDragListener::DragOver(nsIDOMEvent* aDragEvent)
PRBool onChild = IsOnToolbarItem(aDragEvent, xLoc, isLegalChild);
if (xLoc != mCurrentDropLoc) {
#ifdef TOOLBAR_DD
mToolbar->SetDropfeedbackLocation(xLoc);
#endif
// force the toolbar frame to redraw
ForceDrawFrame(mToolbar);
@ -342,9 +341,7 @@ nsToolbarDragListener::DragExit(nsIDOMEvent* aDragEvent)
nsCOMPtr<nsIDragSession> dragSession(do_QueryInterface(dragService));
nsAutoString toolbarItemFlavor(TOOLBARITEM_MIME);
if (dragSession && NS_OK == dragSession->IsDataFlavorSupported(&toolbarItemFlavor)) {
#ifdef TOOLBAR_DD
mToolbar->SetDropfeedbackLocation(-1); // clears drawing of marker
#endif
ForceDrawFrame(mToolbar);
rv = NS_ERROR_BASE; // consume event
}
@ -363,9 +360,8 @@ nsToolbarDragListener::DragExit(nsIDOMEvent* aDragEvent)
nsresult
nsToolbarDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
{
#ifdef TOOLBAR_DD
mToolbar->SetDropfeedbackLocation(-1); // clears drawing of marker
#endif
// XXX At the moment toolbar drags contain "text"
// in the future they will probably contain some form of content
// that will be translated into some RDF form

Просмотреть файл

@ -64,9 +64,7 @@ NS_NewToolbarFrame ( nsIFrame** aNewFrame )
nsToolbarFrame :: nsToolbarFrame ( )
{
//*** anything?
#ifdef TOOLBAR_DD
mXDropLoc = -1;
#endif
}
@ -91,7 +89,6 @@ nsToolbarFrame::Init(nsIPresContext& aPresContext,
{
nsresult rv = nsBoxFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
#ifdef TOOLBAR_DD
//nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mContent));
nsCOMPtr<nsIContent> content;
GetContent(getter_AddRefs(content));
@ -115,7 +112,6 @@ nsToolbarFrame::Init(nsIPresContext& aPresContext,
// nsCOMPtr<nsIDOMEventListener> eventListener = do_QueryInterface(popupListener);
// AddEventListener("mousedown", eventListener, PR_FALSE);
#endif
return rv;
}
@ -166,7 +162,6 @@ nsToolbarFrame :: Paint ( nsIPresContext& aPresContext,
nsresult res = nsBoxFrame::Paint ( aPresContext, aRenderingContext, aDirtyRect, aWhichLayer );
#ifdef TOOLBAR_DD
if (mXDropLoc != -1) {
//printf("mXDropLoc: %d\n", mXDropLoc);
// XXX this is temporary
@ -187,7 +182,7 @@ nsToolbarFrame :: Paint ( nsIPresContext& aPresContext,
aRenderingContext.SetColor(color);
aRenderingContext.DrawLine(mXDropLoc, 0, mXDropLoc, mRect.height);
}
#endif
return res;
} // Paint
@ -245,11 +240,9 @@ nsToolbarFrame :: HandleEvent ( nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus)
{
#ifdef TOOLBAR_DD
if(mDragListener) {
mDragListener->SetPresContext(&aPresContext); // not ref counted
}
#endif
if ( !aEvent )
return nsEventStatus_eIgnore;
@ -257,24 +250,20 @@ nsToolbarFrame :: HandleEvent ( nsIPresContext& aPresContext,
switch (aEvent->message) {
case NS_DRAGDROP_ENTER:
#ifdef TOOLBAR_DD
if (!mMarkerStyle) {
nsCOMPtr<nsIAtom> atom ( getter_AddRefs(NS_NewAtom(":-moz-drop-marker")) );
aPresContext.ProbePseudoStyleContextFor(mContent, atom, mStyleContext,
PR_FALSE,
getter_AddRefs(mMarkerStyle));
}
#endif
break;
case NS_DRAGDROP_OVER:
break;
case NS_DRAGDROP_EXIT:
#ifdef TOOLBAR_DD
mMarkerStyle = do_QueryInterface(nsnull);
// remove drop feedback
#endif
break;
case NS_DRAGDROP_DROP:

Просмотреть файл

@ -46,14 +46,10 @@
#include "nsCOMPtr.h"
#include "nsBoxFrame.h"
#ifdef TOOLBAR_DD
#include "nsIStyleContext.h"
#endif
#ifdef TOOLBAR_DD
class nsToolbarDragListener;
class nsToolbarMouseMotionListener;
#endif
class nsToolbarFrame : public nsBoxFrame
{
@ -87,9 +83,7 @@ public:
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange);
#ifdef TOOLBAR_DD
void SetDropfeedbackLocation(nscoord aX) { mXDropLoc = aX; }
#endif
protected:
nsToolbarFrame();
@ -100,11 +94,9 @@ protected:
nsToolbarFrame ( const nsToolbarFrame& aFrame ) ; // DO NOT IMPLEMENT
nsToolbarFrame& operator= ( const nsToolbarFrame& aFrame ) ; // DO NOT IMPLEMENT
#ifdef TOOLBAR_DD
nsToolbarDragListener * mDragListener;
PRInt32 mXDropLoc;
nsCOMPtr<nsIStyleContext> mMarkerStyle;
#endif
}; // class nsToolbarFrame

Просмотреть файл

@ -39,7 +39,6 @@
#include "nsIWidget.h"
#include "nsINameSpaceManager.h"
#ifdef TOOLBAR_DD
#include "nsIServiceManager.h"
#include "nsWidgetsCID.h"
#include "nsIDragService.h"
@ -62,7 +61,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
#include "nsISupportsArray.h"
#endif
//
// NS_NewToolboxFrame
@ -121,13 +120,11 @@ NS_IMPL_RELEASE(nsToolboxFrame)
nsresult
nsToolboxFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
#ifdef TOOLBAR_DD
if (aIID.Equals(kIDOMEventReceiverIID)) {
*aInstancePtr = (void*)(nsIDOMEventListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
#endif
if (aIID.Equals(nsIDOMDragListener::GetIID())) {
*aInstancePtr = (void*)(nsIDOMDragListener*)this;
NS_ADDREF_THIS();
@ -195,7 +192,6 @@ nsToolboxFrame::Init(nsIPresContext& aPresContext,
nsresult rv = nsBoxFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
UpdateStyles(&aPresContext);
#ifdef TOOLBAR_DD
nsCOMPtr<nsIContent> content;
GetContent(getter_AddRefs(content));
@ -205,8 +201,6 @@ nsToolboxFrame::Init(nsIPresContext& aPresContext,
printf("Toolbar registered as Drag Listener\n");
}
#endif
return rv;
}
@ -744,8 +738,6 @@ nsToolboxFrame :: ExpandToolbar ( TabInfo & inTab )
} // ExpandToolbar
#ifdef TOOLBAR_DD
////////////////////////////////////////////////////////////////////////
nsresult
nsToolboxFrame::HandleEvent(nsIDOMEvent* aEvent)
@ -882,4 +874,5 @@ nsToolboxFrame::DragDrop(nsIDOMEvent* aMouseEvent)
return NS_ERROR_BASE; // consume the event;
}
#endif

Просмотреть файл

@ -48,11 +48,7 @@
#include "nsBoxFrame.h"
#ifdef TOOLBAR_DD
class nsToolboxFrame : public nsBoxFrame, public nsIDOMDragListener
#else
class nsToolboxFrame : public nsBoxFrame
#endif
{
public:
friend nsresult NS_NewToolboxFrame(nsIFrame** aNewFrame);
@ -88,7 +84,6 @@ public:
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame);
#ifdef TOOLBAR_DD
/*BEGIN implementations of dragevent handler interface*/
virtual nsresult HandleEvent(nsIDOMEvent* aEvent);
public:
@ -97,7 +92,6 @@ public:
virtual nsresult DragExit(nsIDOMEvent* aDragEvent);
virtual nsresult DragDrop(nsIDOMEvent* aDragEvent);
/*END implementations of dragevent handler interface*/
#endif
protected:
enum { kGrippyWidthInPixels = 10, kCollapsedGrippyHeightInPixels = 10, kCollapsedGrippyWidthInPixels = 50 } ;