This commit is contained in:
michaelp 1998-05-18 22:24:20 +00:00
Родитель fd2fc3f698
Коммит 45091a02b2
9 изменённых файлов: 176 добавлений и 2 удалений

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

@ -36,6 +36,6 @@ EXPORTS=nsColor.h nsColorNames.h nsCoord.h nsFont.h nsRect.h nsPoint.h \
nsSize.h nsMargin.h nsTransform2D.h nsIRenderingContext.h \
nsIFontMetrics.h nsIImageManager.h nsIImageGroup.h nsIImageRequest.h \
nsIImageObserver.h nsIDeviceContext.h nsIFontCache.h nsIImage.h \
nsGfxCIID.h
nsGfxCIID.h nsIRegion.h
include $(DEPTH)/config/rules.mk

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

@ -35,7 +35,7 @@ EXPORTS=nsColor.h nsColorNames.h nsCoord.h nsFont.h nsRect.h nsPoint.h \
nsSize.h nsMargin.h nsTransform2D.h nsIRenderingContext.h \
nsIFontMetrics.h nsIImageManager.h nsIImageGroup.h nsIImageRequest.h \
nsIImageObserver.h nsIDeviceContext.h nsIFontCache.h nsIImage.h \
nsGfxCIID.h
nsGfxCIID.h nsIRegion.h
CPP_OBJS=.\$(OBJDIR)\nsColor.obj .\$(OBJDIR)\nsColorNames.obj \
.\$(OBJDIR)\nsColorNamesRGB.obj .\$(OBJDIR)\nsFont.obj \

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

@ -39,4 +39,8 @@
{ 0x6049b263, 0xc1e6, 0x11d1, \
{ 0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
#define NS_REGION_CID \
{ 0xe12752f0, 0xee9a, 0x11d1, \
{ 0xa8, 0x2a, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
#endif

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

@ -20,6 +20,7 @@
#define nsIRegion_h___
#include "nscore.h"
#include "nsISupports.h"
#include "nsRect.h"
// Function type passed into nsIRegion::forEachRect, invoked

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

@ -32,6 +32,7 @@ OBJS = \
.\$(OBJDIR)\nsRenderingContextWin.obj \
.\$(OBJDIR)\nsFontMetricsWin.obj \
.\$(OBJDIR)\nsImageWin.obj \
.\$(OBJDIR)\nsRegionWin.obj \
.\$(OBJDIR)\nsGfxFactoryWin.obj \
$(NULL)

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

@ -24,11 +24,13 @@
#include "nsRenderingContextWin.h"
#include "nsImageWin.h"
#include "nsDeviceContextWin.h"
#include "nsRegionWin.h"
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
static NS_DEFINE_IID(kCDeviceContext, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kCRegion, NS_REGION_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
@ -130,6 +132,9 @@ nsresult nsGfxFactoryWin::CreateInstance(nsISupports *aOuter,
else if (mClassID.Equals(kCImage)) {
inst = (nsISupports *)new nsImageWin();
}
else if (mClassID.Equals(kCRegion)) {
inst = (nsISupports *)new nsRegionWin();
}
if (inst == NULL) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsRegionWin.h"
static NS_DEFINE_IID(kRegionIID, NS_IREGION_IID);
nsRegionWin :: nsRegionWin()
{
NS_INIT_REFCNT();
mRegion = NULL;
}
nsRegionWin :: ~nsRegionWin()
{
mRegion = NULL;
}
NS_IMPL_QUERY_INTERFACE(nsRegionWin, kRegionIID)
NS_IMPL_ADDREF(nsRegionWin)
NS_IMPL_RELEASE(nsRegionWin)
nsresult nsRegionWin :: Init(void)
{
return NS_OK;
}
void nsRegionWin :: SetTo(const nsIRegion &aRegion)
{
}
void nsRegionWin :: SetTo(const nsRect &aRect)
{
}
void nsRegionWin :: Intersect(const nsIRegion &aRegion)
{
}
void nsRegionWin :: Intersect(const nsRect &aRect)
{
}
void nsRegionWin :: Union(const nsIRegion &aRegion)
{
}
void nsRegionWin :: Union(const nsRect &aRect)
{
}
void nsRegionWin :: Subtract(const nsIRegion &aRegion)
{
}
PRBool nsRegionWin :: IsEmpty(void)
{
return PR_TRUE;
}
PRBool nsRegionWin :: IsEqual(const nsIRegion &aRegion)
{
return PR_FALSE;
}
void nsRegionWin :: GetBoundingBox(nsRect &aRect)
{
}
void nsRegionWin :: Offset(nscoord aXOffset, nscoord aYOffset)
{
}
PRBool nsRegionWin :: ContainsRect(const nsRect &aRect)
{
return PR_FALSE;
}
PRBool nsRegionWin :: ForEachRect(nsRectInRegionFunc *func, void *closure)
{
return PR_FALSE;
}
HRGN nsRegionWin :: GetHRGN(void)
{
return mRegion;
}

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

@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsRegionWin_h___
#define nsRegionWin_h___
#include "nsIRegion.h"
#include "windows.h"
class nsRegionWin : public nsIRegion
{
public:
nsRegionWin();
NS_DECL_ISUPPORTS
virtual nsresult Init();
virtual void SetTo(const nsIRegion &aRegion);
virtual void SetTo(const nsRect &aRect);
virtual void Intersect(const nsIRegion &aRegion);
virtual void Intersect(const nsRect &aRect);
virtual void Union(const nsIRegion &aRegion);
virtual void Union(const nsRect &aRect);
virtual void Subtract(const nsIRegion &aRegion);
virtual PRBool IsEmpty(void);
virtual PRBool IsEqual(const nsIRegion &aRegion);
virtual void GetBoundingBox(nsRect &aRect);
virtual void Offset(nscoord aXOffset, nscoord aYOffset);
virtual PRBool ContainsRect(const nsRect &aRect);
virtual PRBool ForEachRect(nsRectInRegionFunc *func, void *closure);
//windows specific
HRGN GetHRGN(void);
private:
~nsRegionWin();
HRGN mRegion;
};
#endif // nsRegionWin_h___

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

@ -645,11 +645,13 @@ WinMain(HANDLE instance, HANDLE prevInstance, LPSTR cmdParam, int nCmdShow)
static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID);
static NS_DEFINE_IID(kCRegionIID, NS_REGION_CID);
NSRepository::RegisterFactory(kCRenderingContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCDeviceContextIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCFontMetricsIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCImageIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
NSRepository::RegisterFactory(kCRegionIID, GFXWIN_DLL, PR_FALSE, PR_FALSE);
static NS_DEFINE_IID(kCViewManagerCID, NS_VIEW_MANAGER_CID);
static NS_DEFINE_IID(kCViewCID, NS_VIEW_CID);