Added factory CID and impl to create instances of nsIFrameUtil

This commit is contained in:
kipp%netscape.com 1998-12-10 18:04:37 +00:00
parent 7edc4891a0
commit c057adba78
3 changed files with 14 additions and 3 deletions

View File

@ -59,7 +59,7 @@ LCFLAGS = \
$(DEFINES) \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom -I$(PUBLIC)\js -I..\..\style\src -I..\html\base\src
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom -I$(PUBLIC)\js -I..\..\style\src -I..\html\base\src -I..\base\src
# These are the libraries we need to link with to create the dll
LLIBS= \

View File

@ -43,6 +43,10 @@
0xd6008c40, 0x4dad, 0x11d2, \
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
/* a6cf90d5-15b3-11d2-932e-00805f8add32 */
#define NS_FRAME_UTIL_CID \
{ 0xa6cf90d5, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
// XXX This should really be factored into a style-specific DLL so
// that all the HTML, generic layout, and style stuff isn't munged

View File

@ -25,6 +25,7 @@
#include "nsICollection.h"
#include "nsIPresShell.h"
#include "nsISelection.h"
#include "nsIFrameUtil.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLParts.h"
@ -51,12 +52,12 @@ static NS_DEFINE_IID(kCRangeCID, NS_RANGE_CID);
static NS_DEFINE_CID(kPresShellCID, NS_PRESSHELL_CID);
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
static NS_DEFINE_CID(kSelectionCID, NS_SELECTION_CID);
static NS_DEFINE_CID(kFrameUtilCID, NS_FRAME_UTIL_CID);
nsresult NS_NewRangeList(nsICollection **);
nsresult NS_NewRange(nsIDOMRange **);
extern nsresult NS_NewFrameUtil(nsIFrameUtil** aResult);
class HTMLImageElementFactory : public nsIDOMHTMLImageElementFactory {
public:
@ -266,6 +267,12 @@ nsresult nsLayoutFactory::CreateInstance(nsISupports *aOuter,
return res;
refCounted = PR_TRUE;
}
else if (mClassID.Equals(kFrameUtilCID)) {
// XXX ibid
if (NS_FAILED(res = NS_NewFrameUtil((nsIFrameUtil**) &inst)))
return res;
refCounted = PR_TRUE;
}
else
{
return NS_NOINTERFACE;