i don't remember what i changed. i hate windows. windows sucks. its makefile and dlldep crap can kiss my ass

This commit is contained in:
pavlov%netscape.com 2001-01-11 04:34:43 +00:00
Родитель a5c4926483
Коммит 5c22ffc05d
6 изменённых файлов: 32 добавлений и 413 удалений

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

@ -1,85 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation.
* All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#ifndef NSMARGIN_H
#define NSMARGIN_H
#include "gfxtypes.h"
struct nsMargin2 {
gfx_coord left, top, right, bottom;
// Constructors
nsMargin2() {}
nsMargin2(const nsMargin2& aMargin) {*this = aMargin;}
nsMargin2(gfx_coord aLeft, gfx_coord aTop, gfx_coord aRight, gfx_coord aBottom) {
left = aLeft; top = aTop;
right = aRight; bottom = aBottom;
}
void SizeTo(gfx_coord aLeft, gfx_coord aTop,
gfx_coord aRight, gfx_coord aBottom) {
left = aLeft; top = aTop;
right = aRight; bottom = aBottom;
}
void SizeBy(gfx_coord aLeft, gfx_coord aTop,
gfx_coord aRight, gfx_coord aBottom) {
left += aLeft; top += aTop;
right += aRight; bottom += aBottom;
}
// Overloaded operators. Note that '=' isn't defined so we'll get the
// compiler generated default assignment operator
PRBool operator==(const nsMargin2& aMargin) const {
return (PRBool) ((left == aMargin.left) && (top == aMargin.top) &&
(right == aMargin.right) && (bottom == aMargin.bottom));
}
PRBool operator!=(const nsMargin2& aMargin) const {
return (PRBool) ((left != aMargin.left) || (top != aMargin.top) ||
(right != aMargin.right) || (bottom != aMargin.bottom));
}
nsMargin2 operator+(const nsMargin2& aMargin) const {
return nsMargin2(left + aMargin.left, top + aMargin.top,
right + aMargin.right, bottom + aMargin.bottom);
}
nsMargin2 operator-(const nsMargin2& aMargin) const {
return nsMargin2(left - aMargin.left, top - aMargin.top,
right - aMargin.right, bottom - aMargin.bottom);
}
nsMargin2& operator+=(const nsMargin2& aMargin) {
left += aMargin.left;
top += aMargin.top;
right += aMargin.right;
bottom += aMargin.bottom;
return *this;
}
nsMargin2& operator-=(const nsMargin2& aMargin) {
left -= aMargin.left;
top -= aMargin.top;
right -= aMargin.right;
bottom -= aMargin.bottom;
return *this;
}
};
#endif /* NSMARGIN_H */

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

@ -21,8 +21,8 @@
* Stuart Parmenter <pavlov@netscape.com>
*/
#ifndef NSPOINT_H
#define NSPOINT_H
#ifndef NSPOINT2_H
#define NSPOINT2_H
#include "gfxtypes.h"
@ -100,4 +100,4 @@ struct nsPathPoint: public nsPoint2{
};
#endif /* NSPOINT_H */
#endif /* NSPOINT2_H */

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

@ -1,219 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation.
* All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#ifndef NSRECT_H
#define NSRECT_H
#include <stdio.h>
#include "gfxtypes.h"
#include "nsPoint2.h"
#include "nsSize2.h"
#include "nsUnitConverters.h"
struct nsMargin2;
/**
* nsRect2
*
* @version 1.1
**/
struct nsRect2 {
gfx_coord x, y;
gfx_dimension width, height;
// Constructors
nsRect2() : x(0), y(0), width(0), height(0) {}
nsRect2(const nsRect2& aRect) {
*this = aRect;
}
nsRect2(const nsPoint2& aOrigin, const nsSize2 &aSize) {
x = aOrigin.x; y = aOrigin.y;
width = aSize.width; height = aSize.height;
}
nsRect2(gfx_coord aX, gfx_coord aY, gfx_dimension aWidth, gfx_dimension aHeight) {
x = aX; y = aY;
width = aWidth; height = aHeight;
}
// Emptiness. An empty rect is one that has no area, i.e. its width or height
// is <= 0
PRBool IsEmpty() const {
return (PRBool) ((width <= 0) || (height <= 0));
}
void Empty() {width = height = 0;}
/**
* Contains \a aRect
* @overload
*
* @param aRect
* @return TRUE if \a aRect is contained inside of 'this'.
*/
PRBool Contains(const nsRect2& aRect) const;
/**
* Contains the point (\a aX, \a aY)
* @overload
*
* @param aX
* @param aY
* @return TRUE if (\a aX, \a aY) is contained inside of 'this'.
*/
PRBool Contains(gfx_coord aX, gfx_coord aY) const;
/**
* Contains the point \a aPoint
* @overload
*
* @param aPoint
* @return TRUE if \a aPoint is contained inside of 'this'.
*/
PRBool Contains(const nsPoint2& aPoint) const {
return Contains(aPoint.x, aPoint.y);
}
/**
* Intersect 'this' and \a aRect
* @param aRect The rectangle to intersect 'this' with.
* @return TRUE if the receiver overlaps \a aRect and FALSE otherwise.
*/
PRBool Intersects(const nsRect2& aRect) const;
/**
* Computes the area in which \a aRect1 and \a aRect2 overlap, and fills 'this' with
* the result.
*
* @param aRect1
* @param aRect2
*
* @return FALSE if the rectangles don't intersect, and sets 'this'
* rect to be an empty rect.
*
* @note 'this' can be the same object as either \a aRect1 or \a aRect2
*/
PRBool IntersectRect(const nsRect2& aRect1, const nsRect2& aRect2);
/**
* Computes the smallest rectangle that contains both \a aRect1 and \a aRect2 and
* fills 'this' with the result.
*
* @param aRect1
* @param aRect2
*
* @return FALSE and sets 'this' rect to be an empty rect if both
* \a aRect1 and \a aRect2 are empty
*
* @note 'this' can be the same object as either aRect1 or aRect2
*/
PRBool UnionRect(const nsRect2& aRect1, const nsRect2& aRect2);
// Accessors
void SetRect(gfx_coord aX, gfx_coord aY, gfx_dimension aWidth, gfx_dimension aHeight) {
x = aX; y = aY; width = aWidth; height = aHeight;
}
void MoveTo(gfx_coord aX, gfx_coord aY) {
x = aX; y = aY;
}
void MoveTo(const nsPoint2& aPoint) {
x = aPoint.x; y = aPoint.y;
}
void MoveBy(gfx_coord aDx, gfx_coord aDy) {
x += aDx; y += aDy;
}
void SizeTo(gfx_dimension aWidth, gfx_dimension aHeight) {
width = aWidth; height = aHeight;
}
void SizeTo(const nsSize2& aSize) {
SizeTo(aSize.width, aSize.height);
}
void SizeBy(gfx_coord aDeltaWidth, gfx_coord aDeltaHeight) {
width += aDeltaWidth;
height += aDeltaHeight;
}
// Inflate the rect by the specified width/height or margin
void Inflate(gfx_coord aDx, gfx_coord aDy);
void Inflate(const nsSize2& aSize) {
Inflate(aSize.width, aSize.height);
}
void Inflate(const nsMargin2& aMargin);
// Deflate the rect by the specified width/height or margin
void Deflate(gfx_coord aDx, gfx_coord aDy);
void Deflate(const nsSize2& aSize) {
Deflate(aSize.width, aSize.height);
}
void Deflate(const nsMargin2& aMargin);
// Overloaded operators. Note that '=' isn't defined so we'll get the
// compiler generated default assignment operator.
PRBool operator==(const nsRect2& aRect) const {
return (PRBool) ((IsEmpty() && aRect.IsEmpty()) ||
((x == aRect.x) && (y == aRect.y) &&
(width == aRect.width) && (height == aRect.height)));
}
PRBool operator!=(const nsRect2& aRect) const {
return (PRBool) !operator==(aRect);
}
nsRect2 operator+(const nsRect2& aRect) const {
return nsRect2(x + aRect.x, y + aRect.y,
width + aRect.width, height + aRect.height);
}
nsRect2 operator-(const nsRect2& aRect) const {
return nsRect2(x - aRect.x, y - aRect.y,
width - aRect.width, height - aRect.height);
}
nsRect2& operator+=(const nsPoint2& aPoint) {
x += aPoint.x; y += aPoint.y; return *this;
}
nsRect2& operator-=(const nsPoint2& aPoint) {
x -= aPoint.x; y -= aPoint.y; return *this;
}
nsRect2& operator*=(const float aScale) {
x = x * aScale;
y = y * aScale;
width = width * aScale;
height = height * aScale;
return *this;
}
nsRect2& ScaleRoundOut(const float aScale);
nsRect2& ScaleRoundIn(const float aScale);
// Helper methods for computing the extents
gfx_coord XMost() const {
return x + width;
}
gfx_coord YMost() const {
return y + height;
}
};
#ifdef DEBUG_RECT
// Diagnostics
extern NS_GFX FILE* operator<<(FILE* out, const nsRect2& rect);
#endif
#endif /* NSRECT_H */

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

@ -1,74 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-2000 Netscape Communications Corporation.
* All Rights Reserved.
*
* Contributor(s):
* Stuart Parmenter <pavlov@netscape.com>
*/
#ifndef NSSIZE_H
#define NSSIZE_H
#include "gfxtypes.h"
// Maximum allowable size
#define NS_MAXSIZE nscoord(1 << 30)
/**
* nsSize2
*
* @version 0.0
**/
struct nsSize2 {
gfx_dimension width;
gfx_dimension height;
// Constructors
nsSize2() {}
nsSize2(const nsSize2& aSize) {width = aSize.width; height = aSize.height;}
nsSize2(gfx_dimension aWidth, gfx_dimension aHeight) {width = aWidth; height = aHeight;}
void SizeTo(gfx_dimension aWidth, gfx_dimension aHeight) {width = aWidth; height = aHeight;}
void SizeBy(gfx_dimension aDeltaWidth, gfx_dimension aDeltaHeight) {
width += aDeltaWidth;
height += aDeltaHeight;
}
// Overloaded operators. Note that '=' isn't defined so we'll get the
// compiler generated default assignment operator
PRBool operator==(const nsSize2& aSize) const {
return (PRBool) ((width == aSize.width) && (height == aSize.height));
}
PRBool operator!=(const nsSize2& aSize) const {
return (PRBool) ((width != aSize.width) || (height != aSize.height));
}
nsSize2 operator+(const nsSize2& aSize) const {
return nsSize2(width + aSize.width, height + aSize.height);
}
nsSize2 operator-(const nsSize2& aSize) const {
return nsSize2(width - aSize.width, height - aSize.height);
}
nsSize2& operator+=(const nsSize2& aSize) {width += aSize.width;
height += aSize.height;
return *this;}
nsSize2& operator-=(const nsSize2& aSize) {width -= aSize.width;
height -= aSize.height;
return *this;}
};
#endif /* NSSIZE_H */

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

@ -24,25 +24,28 @@
DEPTH = ..\..
include <$(DEPTH)/config/config.mak>
MODULE = gfx2
LIBRARY_NAME= gfx_base
DLLNAME = gfx_base
OBJS = \
.\$(OBJDIR)\nsRect.obj \
$(NULL)
MAKE_OBJ_TYPE = DLL
DLL=.\$(OBJDIR)\$(DLLNAME).dll
#MODULE = gfx2
#LIBRARY_NAME= gfx2
#DLL = $(OBJDIR)\$(LIBRARY_NAME).dll
#MAKE_OBJ_TYPE = DLL
DIRS = windows
#OBJS = \
# .\$(OBJDIR)\nsRect.obj \
# $(NULL)
#LLIBS = \
# $(DIST)\lib\gfx2_s.lib \
# $(DIST)\lib\xpcom.lib \
# $(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
#install:: $(DLL)
# $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
rm -f $(PDBFILE).pdb
#clobber::
# rm -f $(DIST)\bin\components\$(LIBRARY_NAME).dll
# rm -f $(PDBFILE).pdb

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

@ -25,33 +25,27 @@ DEPTH=..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = gfx2
LIBRARY_NAME = gfx2
LIBRARY_NAME= gfx2 #_s
DLL = $(OBJDIR)\$(LIBRARY_NAME).dll
MAKE_OBJ_TYPE = DLL
OBJS = \
.\$(OBJDIR)\nsDrawable.obj \
.\$(OBJDIR)\nsPixmap.obj \
.\$(OBJDIR)\nsRegion.obj \
.\$(OBJDIR)\nsWindow.obj \
.\$(OBJDIR)\nsChildWindow.obj \
.\$(OBJDIR)\nsPopupWindow.obj \
.\$(OBJDIR)\nsTopLevelWindow.obj \
.\$(OBJDIR)\nsRect.obj \
.\$(OBJDIR)\nsImage.obj \
.\$(OBJDIR)\nsGfxFactory.obj \
.\$(OBJDIR)\nsRunAppRun.obj \
$(NULL)
LLIBS= \
$(LLIBS) \
$(DIST)\lib\gfx_base.lib \
LLIBS = \
$(DIST)\lib\xpcom.lib \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(LIBRARY_NAME).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(LIBRARY_NAME).lib $(DIST)\lib
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
#install:: $(LIBRARY)
# $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\bin\$(LIBRARY_NAME).dll
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib