put include guards around nsGCCache.h and inlined a few function sr=smfr

git-svn-id: svn://10.0.0.236/trunk@59910 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pavlov%netscape.com 2000-02-06 01:03:16 +00:00
parent 84204e9806
commit a18b01da9f
4 changed files with 29 additions and 41 deletions

View File

@ -135,13 +135,4 @@ GdkGC *nsGCCache::GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMa
}
}
GdkGC *nsGCCache::GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion)
{
return GetGCFromDW(window, gcv, flags, clipRegion);
}
GdkGC *nsGCCache::GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags)
{
return GetGCFromDW(window, gcv, flags, NULL);
}

View File

@ -24,6 +24,9 @@
#include <gdk/gdk.h>
#include <string.h>
#ifndef nsGCCache_h___
#define nsGCCache_h___
#define countof(x) (sizeof(x) / sizeof (*x))
struct GCData
@ -40,13 +43,18 @@ class nsGCCache
nsGCCache();
virtual ~nsGCCache();
void Flush(unsigned long flags);
GdkGC *GetGCFromDW(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion);
GdkGC *GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion);
GdkGC *GetClipGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags, GdkRegion *clipRegion) {
return GetGCFromDW(window, gcv, flags, clipRegion);
}
GdkGC *GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags);
GdkGC *GetGC(GdkWindow *window, GdkGCValues *gcv, GdkGCValuesMask flags) {
return GetGCFromDW(window, gcv, flags, NULL);
}
};
#endif

View File

@ -488,12 +488,6 @@ NS_IMETHODIMP nsRenderingContextGTK::SetClipRect(const nsRect& aRect,
return NS_OK;
}
GdkGC *nsRenderingContextGTK::GetGC()
{
return mGC;
}
void nsRenderingContextGTK::UpdateGC()
{
GdkGCValues values;
@ -1892,24 +1886,3 @@ nsRenderingContextGTK::GetBoundingMetrics(const PRUnichar* aString,
}
#endif /* FONT_SWITCHING */
#endif /* MOZ_MATHML */
NS_IMETHODIMP nsRenderingContextGTK::ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h )
{
if ( y < -32766 ) {
y = -32766;
}
if ( y + h > 32766 ) {
h = 32766 - y;
}
if ( x < -32766 ) {
x = -32766;
}
if ( x + w > 32766 ) {
w = 32766 - x;
}
return NS_OK;
}

View File

@ -163,7 +163,7 @@ public:
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);
GdkGC *GetGC();
GdkGC *GetGC() { return mGC; }
#ifdef MOZ_MATHML
/**
@ -215,7 +215,23 @@ private:
void UpdateGC();
// ConditionRect is used to fix coordinate overflow problems for
// rectangles after they are transformed to screen coordinates
NS_IMETHOD ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h );
void ConditionRect(nscoord &x, nscoord &y, nscoord &w, nscoord &h) {
if ( y < -32766 ) {
y = -32766;
}
if ( y + h > 32766 ) {
h = 32766 - y;
}
if ( x < -32766 ) {
x = -32766;
}
if ( x + w > 32766 ) {
w = 32766 - x;
}
}
};
#endif /* nsRenderingContextGTK_h___ */