зеркало из https://github.com/mozilla/pjs.git
Removal of nsCaretProperties
This commit is contained in:
Родитель
354fb225c9
Коммит
815c2ea4f3
|
@ -22,6 +22,7 @@
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsITimerCallback.h"
|
#include "nsITimerCallback.h"
|
||||||
|
|
||||||
|
#include "nsIComponentManager.h"
|
||||||
#include "nsIFrameSelection.h"
|
#include "nsIFrameSelection.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsIDOMNode.h"
|
#include "nsIDOMNode.h"
|
||||||
|
@ -35,21 +36,23 @@
|
||||||
#include "nsIView.h"
|
#include "nsIView.h"
|
||||||
#include "nsIViewManager.h"
|
#include "nsIViewManager.h"
|
||||||
#include "nsIPresContext.h"
|
#include "nsIPresContext.h"
|
||||||
|
#include "nsILookAndFeel.h"
|
||||||
#include "nsCaretProperties.h"
|
#include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID
|
||||||
|
|
||||||
#include "nsCaret.h"
|
#include "nsCaret.h"
|
||||||
|
|
||||||
|
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIDOMSelectionIID, NS_IDOMSELECTION_IID);
|
|
||||||
static NS_DEFINE_IID(kICaretID, NS_ICARET_IID);
|
static NS_DEFINE_IID(kICaretID, NS_ICARET_IID);
|
||||||
|
|
||||||
|
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
nsCaret::nsCaret()
|
nsCaret::nsCaret()
|
||||||
: mPresShell(nsnull)
|
: mPresShell(nsnull)
|
||||||
, mBlinkTimer(nsnull)
|
, mBlinkTimer(nsnull)
|
||||||
, mBlinkRate(500)
|
, mBlinkRate(500)
|
||||||
|
, mCaretWidth(20)
|
||||||
, mVisible(PR_FALSE)
|
, mVisible(PR_FALSE)
|
||||||
, mReadOnly(PR_TRUE)
|
, mReadOnly(PR_TRUE)
|
||||||
, mDrawn(PR_FALSE)
|
, mDrawn(PR_FALSE)
|
||||||
|
@ -68,19 +71,26 @@ nsCaret::~nsCaret()
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties)
|
NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
|
||||||
{
|
{
|
||||||
if (!inPresShell)
|
if (!inPresShell)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
if (!inCaretProperties)
|
|
||||||
return NS_ERROR_NULL_POINTER;
|
|
||||||
|
|
||||||
mPresShell = inPresShell; // the presshell owns us, so no addref
|
mPresShell = inPresShell; // the presshell owns us, so no addref
|
||||||
|
|
||||||
mBlinkRate = inCaretProperties->GetCaretBlinkRate();
|
nsILookAndFeel* touchyFeely;
|
||||||
mCaretWidth = inCaretProperties->GetCaretWidth();
|
if (NS_SUCCEEDED(nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, nsILookAndFeel::GetIID(), (void**)&touchyFeely)))
|
||||||
|
{
|
||||||
|
PRInt32 tempInt;
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(touchyFeely->GetMetric(nsILookAndFeel::eMetric_CaretWidthTwips, tempInt)))
|
||||||
|
mCaretWidth = (nscoord)tempInt;
|
||||||
|
if (NS_SUCCEEDED(touchyFeely->GetMetric(nsILookAndFeel::eMetric_CaretBlinkTime, tempInt)))
|
||||||
|
mBlinkRate = (PRUint32)tempInt;
|
||||||
|
|
||||||
|
NS_RELEASE(touchyFeely);
|
||||||
|
}
|
||||||
|
|
||||||
// get the selection from the pres shell, and set ourselves up as a selection
|
// get the selection from the pres shell, and set ourselves up as a selection
|
||||||
// listener
|
// listener
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "nsICaret.h"
|
#include "nsICaret.h"
|
||||||
|
|
||||||
class nsITimer;
|
class nsITimer;
|
||||||
class nsCaretProperties;
|
|
||||||
class nsIView;
|
class nsIView;
|
||||||
class nsIRenderingContext;
|
class nsIRenderingContext;
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ class nsCaret : public nsICaret,
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// nsICaret interface
|
// nsICaret interface
|
||||||
NS_IMETHOD Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties);
|
NS_IMETHOD Init(nsIPresShell *inPresShell);
|
||||||
|
|
||||||
NS_IMETHOD SetCaretVisible(PRBool inMakeVisible);
|
NS_IMETHOD SetCaretVisible(PRBool inMakeVisible);
|
||||||
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
||||||
|
|
|
@ -22,14 +22,12 @@
|
||||||
#define NS_ICARET_IID \
|
#define NS_ICARET_IID \
|
||||||
{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||||
|
|
||||||
class nsCaretProperties;
|
|
||||||
|
|
||||||
class nsICaret: public nsISupports
|
class nsICaret: public nsISupports
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; }
|
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; }
|
||||||
|
|
||||||
NS_IMETHOD Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties) = 0;
|
NS_IMETHOD Init(nsIPresShell *inPresShell) = 0;
|
||||||
|
|
||||||
/** SetCaretVisible will set the visibility of the caret
|
/** SetCaretVisible will set the visibility of the caret
|
||||||
* @param inMakeVisible PR_TRUE to show the caret, PR_FALSE to hide it
|
* @param inMakeVisible PR_TRUE to show the caret, PR_FALSE to hide it
|
||||||
|
|
|
@ -51,7 +51,6 @@
|
||||||
#include "nsIEventQueueService.h"
|
#include "nsIEventQueueService.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsICaret.h"
|
#include "nsICaret.h"
|
||||||
#include "nsCaretProperties.h"
|
|
||||||
#include "nsIDOMHTMLDocument.h"
|
#include "nsIDOMHTMLDocument.h"
|
||||||
#include "nsIXMLDocument.h"
|
#include "nsIXMLDocument.h"
|
||||||
#include "nsIScrollableView.h"
|
#include "nsIScrollableView.h"
|
||||||
|
@ -650,19 +649,13 @@ PresShell::Init(nsIDocument* aDocument,
|
||||||
return result;
|
return result;
|
||||||
// Important: this has to happen after the selection has been set up
|
// Important: this has to happen after the selection has been set up
|
||||||
#ifdef SHOW_CARET
|
#ifdef SHOW_CARET
|
||||||
nsCaretProperties *caretProperties = NewCaretProperties();
|
|
||||||
|
|
||||||
// make the caret
|
// make the caret
|
||||||
nsresult err = NS_NewCaret(getter_AddRefs(mCaret));
|
nsresult err = NS_NewCaret(getter_AddRefs(mCaret));
|
||||||
if (NS_SUCCEEDED(err))
|
if (NS_SUCCEEDED(err))
|
||||||
{
|
{
|
||||||
mCaret->Init(this, caretProperties);
|
mCaret->Init(this);
|
||||||
}
|
}
|
||||||
delete caretProperties;
|
|
||||||
caretProperties = nsnull;
|
|
||||||
|
|
||||||
// do this when we have a way of figuring out how to tell chrome
|
|
||||||
// from content
|
|
||||||
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
||||||
#endif
|
#endif
|
||||||
//set up selection to be displayed in document
|
//set up selection to be displayed in document
|
||||||
|
|
|
@ -27,7 +27,6 @@ MODULE=layout
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nslayout.h \
|
nslayout.h \
|
||||||
nsICaret.h \
|
nsICaret.h \
|
||||||
nsCaretProperties.h \
|
|
||||||
nsIContent.h \
|
nsIContent.h \
|
||||||
nsIContentIterator.h \
|
nsIContentIterator.h \
|
||||||
nsIDiskDocument.h \
|
nsIDiskDocument.h \
|
||||||
|
|
|
@ -20,7 +20,6 @@ DEPTH=..\..\..
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nslayout.h \
|
nslayout.h \
|
||||||
nsICaret.h \
|
nsICaret.h \
|
||||||
nsCaretProperties.h \
|
|
||||||
nsIContent.h \
|
nsIContent.h \
|
||||||
nsIContentIterator.h \
|
nsIContentIterator.h \
|
||||||
nsIDiskDocument.h \
|
nsIDiskDocument.h \
|
||||||
|
|
|
@ -22,14 +22,12 @@
|
||||||
#define NS_ICARET_IID \
|
#define NS_ICARET_IID \
|
||||||
{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
{ 0xa6cf90e1, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||||
|
|
||||||
class nsCaretProperties;
|
|
||||||
|
|
||||||
class nsICaret: public nsISupports
|
class nsICaret: public nsISupports
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; }
|
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; }
|
||||||
|
|
||||||
NS_IMETHOD Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties) = 0;
|
NS_IMETHOD Init(nsIPresShell *inPresShell) = 0;
|
||||||
|
|
||||||
/** SetCaretVisible will set the visibility of the caret
|
/** SetCaretVisible will set the visibility of the caret
|
||||||
* @param inMakeVisible PR_TRUE to show the caret, PR_FALSE to hide it
|
* @param inMakeVisible PR_TRUE to show the caret, PR_FALSE to hide it
|
||||||
|
|
|
@ -29,7 +29,6 @@ MODULE=layout
|
||||||
# Alphabetical list of source files
|
# Alphabetical list of source files
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
nsCaret.cpp \
|
nsCaret.cpp \
|
||||||
nsCaretProperties_$(MOZ_WIDGET_TOOLKIT).cpp \
|
|
||||||
nsCommentNode.cpp \
|
nsCommentNode.cpp \
|
||||||
nsContentIterator.cpp \
|
nsContentIterator.cpp \
|
||||||
nsContentList.cpp \
|
nsContentList.cpp \
|
||||||
|
|
|
@ -57,7 +57,6 @@ CPPSRCS = \
|
||||||
nsLayoutAtoms.cpp \
|
nsLayoutAtoms.cpp \
|
||||||
nsLayoutDebugger.cpp \
|
nsLayoutDebugger.cpp \
|
||||||
nsCaret.cpp \
|
nsCaret.cpp \
|
||||||
nsCaretProperties_windows.cpp \
|
|
||||||
nsRange.cpp \
|
nsRange.cpp \
|
||||||
nsTextNode.cpp \
|
nsTextNode.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -100,7 +99,6 @@ CPP_OBJS= \
|
||||||
.\$(OBJDIR)\nsLayoutAtoms.obj \
|
.\$(OBJDIR)\nsLayoutAtoms.obj \
|
||||||
.\$(OBJDIR)\nsLayoutDebugger.obj \
|
.\$(OBJDIR)\nsLayoutDebugger.obj \
|
||||||
.\$(OBJDIR)\nsCaret.obj \
|
.\$(OBJDIR)\nsCaret.obj \
|
||||||
.\$(OBJDIR)\nsCaretProperties_windows.obj \
|
|
||||||
.\$(OBJDIR)\nsRange.obj \
|
.\$(OBJDIR)\nsRange.obj \
|
||||||
.\$(OBJDIR)\nsTextNode.obj \
|
.\$(OBJDIR)\nsTextNode.obj \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsITimerCallback.h"
|
#include "nsITimerCallback.h"
|
||||||
|
|
||||||
|
#include "nsIComponentManager.h"
|
||||||
#include "nsIFrameSelection.h"
|
#include "nsIFrameSelection.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsIDOMNode.h"
|
#include "nsIDOMNode.h"
|
||||||
|
@ -35,21 +36,23 @@
|
||||||
#include "nsIView.h"
|
#include "nsIView.h"
|
||||||
#include "nsIViewManager.h"
|
#include "nsIViewManager.h"
|
||||||
#include "nsIPresContext.h"
|
#include "nsIPresContext.h"
|
||||||
|
#include "nsILookAndFeel.h"
|
||||||
#include "nsCaretProperties.h"
|
#include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID
|
||||||
|
|
||||||
#include "nsCaret.h"
|
#include "nsCaret.h"
|
||||||
|
|
||||||
|
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kIDOMSelectionIID, NS_IDOMSELECTION_IID);
|
|
||||||
static NS_DEFINE_IID(kICaretID, NS_ICARET_IID);
|
static NS_DEFINE_IID(kICaretID, NS_ICARET_IID);
|
||||||
|
|
||||||
|
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
nsCaret::nsCaret()
|
nsCaret::nsCaret()
|
||||||
: mPresShell(nsnull)
|
: mPresShell(nsnull)
|
||||||
, mBlinkTimer(nsnull)
|
, mBlinkTimer(nsnull)
|
||||||
, mBlinkRate(500)
|
, mBlinkRate(500)
|
||||||
|
, mCaretWidth(20)
|
||||||
, mVisible(PR_FALSE)
|
, mVisible(PR_FALSE)
|
||||||
, mReadOnly(PR_TRUE)
|
, mReadOnly(PR_TRUE)
|
||||||
, mDrawn(PR_FALSE)
|
, mDrawn(PR_FALSE)
|
||||||
|
@ -68,19 +71,26 @@ nsCaret::~nsCaret()
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties)
|
NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell)
|
||||||
{
|
{
|
||||||
if (!inPresShell)
|
if (!inPresShell)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
if (!inCaretProperties)
|
|
||||||
return NS_ERROR_NULL_POINTER;
|
|
||||||
|
|
||||||
mPresShell = inPresShell; // the presshell owns us, so no addref
|
mPresShell = inPresShell; // the presshell owns us, so no addref
|
||||||
|
|
||||||
mBlinkRate = inCaretProperties->GetCaretBlinkRate();
|
nsILookAndFeel* touchyFeely;
|
||||||
mCaretWidth = inCaretProperties->GetCaretWidth();
|
if (NS_SUCCEEDED(nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, nsILookAndFeel::GetIID(), (void**)&touchyFeely)))
|
||||||
|
{
|
||||||
|
PRInt32 tempInt;
|
||||||
|
|
||||||
|
if (NS_SUCCEEDED(touchyFeely->GetMetric(nsILookAndFeel::eMetric_CaretWidthTwips, tempInt)))
|
||||||
|
mCaretWidth = (nscoord)tempInt;
|
||||||
|
if (NS_SUCCEEDED(touchyFeely->GetMetric(nsILookAndFeel::eMetric_CaretBlinkTime, tempInt)))
|
||||||
|
mBlinkRate = (PRUint32)tempInt;
|
||||||
|
|
||||||
|
NS_RELEASE(touchyFeely);
|
||||||
|
}
|
||||||
|
|
||||||
// get the selection from the pres shell, and set ourselves up as a selection
|
// get the selection from the pres shell, and set ourselves up as a selection
|
||||||
// listener
|
// listener
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "nsICaret.h"
|
#include "nsICaret.h"
|
||||||
|
|
||||||
class nsITimer;
|
class nsITimer;
|
||||||
class nsCaretProperties;
|
|
||||||
class nsIView;
|
class nsIView;
|
||||||
class nsIRenderingContext;
|
class nsIRenderingContext;
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ class nsCaret : public nsICaret,
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// nsICaret interface
|
// nsICaret interface
|
||||||
NS_IMETHOD Init(nsIPresShell *inPresShell, nsCaretProperties *inCaretProperties);
|
NS_IMETHOD Init(nsIPresShell *inPresShell);
|
||||||
|
|
||||||
NS_IMETHOD SetCaretVisible(PRBool inMakeVisible);
|
NS_IMETHOD SetCaretVisible(PRBool inMakeVisible);
|
||||||
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsHTMLParts.h"
|
#include "nsHTMLParts.h"
|
||||||
#include "nsINameSpaceManager.h"
|
#include "nsINameSpaceManager.h"
|
||||||
#include "nsCaretProperties.h"
|
|
||||||
|
|
||||||
void XXXNeverCalled()
|
void XXXNeverCalled()
|
||||||
{
|
{
|
||||||
|
@ -53,5 +52,4 @@ void XXXNeverCalled()
|
||||||
nsINameSpaceManager* nsm;
|
nsINameSpaceManager* nsm;
|
||||||
NS_NewNameSpaceManager(&nsm);
|
NS_NewNameSpaceManager(&nsm);
|
||||||
NS_CreateHTMLElement(nsnull, "");
|
NS_CreateHTMLElement(nsnull, "");
|
||||||
NewCaretProperties();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@
|
||||||
#include "nsIEventQueueService.h"
|
#include "nsIEventQueueService.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsICaret.h"
|
#include "nsICaret.h"
|
||||||
#include "nsCaretProperties.h"
|
|
||||||
#include "nsIDOMHTMLDocument.h"
|
#include "nsIDOMHTMLDocument.h"
|
||||||
#include "nsIXMLDocument.h"
|
#include "nsIXMLDocument.h"
|
||||||
#include "nsIScrollableView.h"
|
#include "nsIScrollableView.h"
|
||||||
|
@ -650,19 +649,13 @@ PresShell::Init(nsIDocument* aDocument,
|
||||||
return result;
|
return result;
|
||||||
// Important: this has to happen after the selection has been set up
|
// Important: this has to happen after the selection has been set up
|
||||||
#ifdef SHOW_CARET
|
#ifdef SHOW_CARET
|
||||||
nsCaretProperties *caretProperties = NewCaretProperties();
|
|
||||||
|
|
||||||
// make the caret
|
// make the caret
|
||||||
nsresult err = NS_NewCaret(getter_AddRefs(mCaret));
|
nsresult err = NS_NewCaret(getter_AddRefs(mCaret));
|
||||||
if (NS_SUCCEEDED(err))
|
if (NS_SUCCEEDED(err))
|
||||||
{
|
{
|
||||||
mCaret->Init(this, caretProperties);
|
mCaret->Init(this);
|
||||||
}
|
}
|
||||||
delete caretProperties;
|
|
||||||
caretProperties = nsnull;
|
|
||||||
|
|
||||||
// do this when we have a way of figuring out how to tell chrome
|
|
||||||
// from content
|
|
||||||
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
||||||
#endif
|
#endif
|
||||||
//set up selection to be displayed in document
|
//set up selection to be displayed in document
|
||||||
|
|
Двоичные данные
layout/macbuild/layout.mcp
Двоичные данные
layout/macbuild/layout.mcp
Двоичный файл не отображается.
|
@ -918,10 +918,6 @@ SOURCE=..\..\..\dist\include\nsCardDataSource.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\dist\include\nsCaretProperties.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\..\..\dist\include\nsCCapsManager.h
|
SOURCE=..\..\..\dist\include\nsCCapsManager.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Загрузка…
Ссылка в новой задаче