зеркало из https://github.com/mozilla/pjs.git
Disabled widget&view for now; render the object so that people know code is coming
This commit is contained in:
Родитель
22f5a6d6c1
Коммит
27ffd2eb94
|
@ -31,6 +31,9 @@
|
||||||
#include "nsIContentViewerContainer.h"
|
#include "nsIContentViewerContainer.h"
|
||||||
#include "prmem.h"
|
#include "prmem.h"
|
||||||
|
|
||||||
|
// XXX For temporary paint code
|
||||||
|
#include "nsIStyleContext.h"
|
||||||
|
|
||||||
#define nsObjectFrameSuper nsLeafFrame
|
#define nsObjectFrameSuper nsLeafFrame
|
||||||
|
|
||||||
class nsObjectFrame : public nsObjectFrameSuper {
|
class nsObjectFrame : public nsObjectFrameSuper {
|
||||||
|
@ -41,9 +44,11 @@ public:
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsReflowState& aReflowState,
|
const nsReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||||
nsDidReflowStatus aStatus);
|
nsDidReflowStatus aStatus);
|
||||||
|
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||||
|
nsIRenderingContext& aRenderingContext,
|
||||||
|
const nsRect& aDirtyRect);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~nsObjectFrame();
|
virtual ~nsObjectFrame();
|
||||||
|
@ -189,6 +194,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
// XXX deal with border and padding the usual way...wrap it up!
|
// XXX deal with border and padding the usual way...wrap it up!
|
||||||
|
|
||||||
|
#if XXX
|
||||||
// Create view if necessary
|
// Create view if necessary
|
||||||
nsIView* view;
|
nsIView* view;
|
||||||
GetView(view);
|
GetView(view);
|
||||||
|
@ -248,6 +254,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
else {
|
else {
|
||||||
NS_RELEASE(view);
|
NS_RELEASE(view);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -272,6 +279,31 @@ nsObjectFrame::DidReflow(nsIPresContext& aPresContext,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsObjectFrame::Paint(nsIPresContext& aPresContext,
|
||||||
|
nsIRenderingContext& aRenderingContext,
|
||||||
|
const nsRect& aDirtyRect)
|
||||||
|
{
|
||||||
|
const nsStyleFont* font =
|
||||||
|
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
|
||||||
|
|
||||||
|
aRenderingContext.SetFont(font->mFont);
|
||||||
|
aRenderingContext.SetColor(NS_RGB(192, 192, 192));
|
||||||
|
aRenderingContext.FillRect(0, 0, mRect.width, mRect.height);
|
||||||
|
aRenderingContext.SetColor(NS_RGB(0, 0, 0));
|
||||||
|
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
||||||
|
float p2t = aPresContext.GetPixelsToTwips();
|
||||||
|
nscoord px3 = nscoord(3 * p2t);
|
||||||
|
nsAutoString tmp;
|
||||||
|
nsIAtom* atom = mContent->GetTag();
|
||||||
|
if (nsnull != atom) {
|
||||||
|
atom->ToString(tmp);
|
||||||
|
NS_RELEASE(atom);
|
||||||
|
aRenderingContext.DrawString(tmp, px3, px3, 0);
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewObjectFrame(nsIFrame*& aFrameResult, nsIContent* aContent,
|
NS_NewObjectFrame(nsIFrame*& aFrameResult, nsIContent* aContent,
|
||||||
nsIFrame* aParentFrame)
|
nsIFrame* aParentFrame)
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#include "nsIContentViewerContainer.h"
|
#include "nsIContentViewerContainer.h"
|
||||||
#include "prmem.h"
|
#include "prmem.h"
|
||||||
|
|
||||||
|
// XXX For temporary paint code
|
||||||
|
#include "nsIStyleContext.h"
|
||||||
|
|
||||||
#define nsObjectFrameSuper nsLeafFrame
|
#define nsObjectFrameSuper nsLeafFrame
|
||||||
|
|
||||||
class nsObjectFrame : public nsObjectFrameSuper {
|
class nsObjectFrame : public nsObjectFrameSuper {
|
||||||
|
@ -41,9 +44,11 @@ public:
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsReflowState& aReflowState,
|
const nsReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||||
nsDidReflowStatus aStatus);
|
nsDidReflowStatus aStatus);
|
||||||
|
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||||
|
nsIRenderingContext& aRenderingContext,
|
||||||
|
const nsRect& aDirtyRect);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~nsObjectFrame();
|
virtual ~nsObjectFrame();
|
||||||
|
@ -189,6 +194,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
// XXX deal with border and padding the usual way...wrap it up!
|
// XXX deal with border and padding the usual way...wrap it up!
|
||||||
|
|
||||||
|
#if XXX
|
||||||
// Create view if necessary
|
// Create view if necessary
|
||||||
nsIView* view;
|
nsIView* view;
|
||||||
GetView(view);
|
GetView(view);
|
||||||
|
@ -248,6 +254,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
|
||||||
else {
|
else {
|
||||||
NS_RELEASE(view);
|
NS_RELEASE(view);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
aStatus = NS_FRAME_COMPLETE;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -272,6 +279,31 @@ nsObjectFrame::DidReflow(nsIPresContext& aPresContext,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsObjectFrame::Paint(nsIPresContext& aPresContext,
|
||||||
|
nsIRenderingContext& aRenderingContext,
|
||||||
|
const nsRect& aDirtyRect)
|
||||||
|
{
|
||||||
|
const nsStyleFont* font =
|
||||||
|
(const nsStyleFont*)mStyleContext->GetStyleData(eStyleStruct_Font);
|
||||||
|
|
||||||
|
aRenderingContext.SetFont(font->mFont);
|
||||||
|
aRenderingContext.SetColor(NS_RGB(192, 192, 192));
|
||||||
|
aRenderingContext.FillRect(0, 0, mRect.width, mRect.height);
|
||||||
|
aRenderingContext.SetColor(NS_RGB(0, 0, 0));
|
||||||
|
aRenderingContext.DrawRect(0, 0, mRect.width, mRect.height);
|
||||||
|
float p2t = aPresContext.GetPixelsToTwips();
|
||||||
|
nscoord px3 = nscoord(3 * p2t);
|
||||||
|
nsAutoString tmp;
|
||||||
|
nsIAtom* atom = mContent->GetTag();
|
||||||
|
if (nsnull != atom) {
|
||||||
|
atom->ToString(tmp);
|
||||||
|
NS_RELEASE(atom);
|
||||||
|
aRenderingContext.DrawString(tmp, px3, px3, 0);
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewObjectFrame(nsIFrame*& aFrameResult, nsIContent* aContent,
|
NS_NewObjectFrame(nsIFrame*& aFrameResult, nsIContent* aContent,
|
||||||
nsIFrame* aParentFrame)
|
nsIFrame* aParentFrame)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче