Commit e0a23443 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

linux build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59037 954022d7-b5bf-4e40-9824-e11837661b57
parent e0fa0566
#pragma once
namespace Gdiplus
{
enum DashStyle
{
DashStyleSolid, // 0
DashStyleDash, // 1
DashStyleDot, // 2
DashStyleDashDot, // 3
DashStyleDashDotDot, // 4
DashStyleCustom // 5
};
class RectF
{
public:
RectF()
{
X = Y = Width = Height = 0.0f;
}
RectF(REAL x,
REAL y,
REAL width,
REAL height)
{
X = x;
Y = y;
Width = width;
Height = height;
}
/*RectF(const PointF& location,
const SizeF& size)
{
X = location.X;
Y = location.Y;
Width = size.Width;
Height = size.Height;
}*/
RectF* Clone() const
{
return new RectF(X, Y, Width, Height);
}
/*VOID GetLocation(PointF* point) const
{
point->X = X;
point->Y = Y;
}*/
/*VOID GetSize(SizeF* size) const
{
size->Width = Width;
size->Height = Height;
}*/
VOID GetBounds(RectF* rect) const
{
rect->X = X;
rect->Y = Y;
rect->Width = Width;
rect->Height = Height;
}
REAL GetLeft() const
{
return X;
}
REAL GetTop() const
{
return Y;
}
REAL GetRight() const
{
return X+Width;
}
REAL GetBottom() const
{
return Y+Height;
}
BOOL IsEmptyArea() const
{
return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON);
}
BOOL Equals(const RectF & rect) const
{
return X == rect.X &&
Y == rect.Y &&
Width == rect.Width &&
Height == rect.Height;
}
BOOL Contains(REAL x,
REAL y) const
{
return x >= X && x < X+Width &&
y >= Y && y < Y+Height;
}
/* BOOL Contains(const PointF& pt) const
{
return Contains(pt.X, pt.Y);
}*/
BOOL Contains(const RectF& rect) const
{
return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
(Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
}
VOID Inflate(REAL dx, REAL dy)
{
X -= dx;
Y -= dy;
Width += 2*dx;
Height += 2*dy;
}
/*VOID Inflate(const PointF& point)
{
Inflate(point.X, point.Y);
}
*/
BOOL Intersect(const RectF& rect)
{
return Intersect(*this, *this, rect);
}
static BOOL Intersect(RectF& c, const RectF& a, const RectF& b)
{
REAL right = min(a.GetRight(), b.GetRight());
REAL bottom = min(a.GetBottom(), b.GetBottom());
REAL left = max(a.GetLeft(), b.GetLeft());
REAL top = max(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
BOOL IntersectsWith(const RectF& rect) const
{
return (GetLeft() < rect.GetRight() &&
GetTop() < rect.GetBottom() &&
GetRight() > rect.GetLeft() &&
GetBottom() > rect.GetTop());
}
static BOOL Union(RectF& c, const RectF& a, const RectF& b)
{
REAL right = max(a.GetRight(), b.GetRight());
REAL bottom = max(a.GetBottom(), b.GetBottom());
REAL left = min(a.GetLeft(), b.GetLeft());
REAL top = min(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
/* VOID Offset(const PointF& point)
{
Offset(point.X, point.Y);
}
*/
VOID Offset(REAL dx, REAL dy)
{
X += dx;
Y += dy;
}
public:
REAL X;
REAL Y;
REAL Width;
REAL Height;
};
}
\ No newline at end of file
......@@ -4,187 +4,7 @@
#include <atlcoll.h>
#include <gdiplus.h>
#else
namespace Gdiplus
{
class RectF
{
public:
RectF()
{
X = Y = Width = Height = 0.0f;
}
RectF(REAL x,
REAL y,
REAL width,
REAL height)
{
X = x;
Y = y;
Width = width;
Height = height;
}
/*RectF(const PointF& location,
const SizeF& size)
{
X = location.X;
Y = location.Y;
Width = size.Width;
Height = size.Height;
}*/
RectF* Clone() const
{
return new RectF(X, Y, Width, Height);
}
/*VOID GetLocation(PointF* point) const
{
point->X = X;
point->Y = Y;
}*/
/*VOID GetSize(SizeF* size) const
{
size->Width = Width;
size->Height = Height;
}*/
VOID GetBounds(RectF* rect) const
{
rect->X = X;
rect->Y = Y;
rect->Width = Width;
rect->Height = Height;
}
REAL GetLeft() const
{
return X;
}
REAL GetTop() const
{
return Y;
}
REAL GetRight() const
{
return X+Width;
}
REAL GetBottom() const
{
return Y+Height;
}
BOOL IsEmptyArea() const
{
return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON);
}
BOOL Equals(const RectF & rect) const
{
return X == rect.X &&
Y == rect.Y &&
Width == rect.Width &&
Height == rect.Height;
}
BOOL Contains(REAL x,
REAL y) const
{
return x >= X && x < X+Width &&
y >= Y && y < Y+Height;
}
/* BOOL Contains(const PointF& pt) const
{
return Contains(pt.X, pt.Y);
}*/
BOOL Contains(const RectF& rect) const
{
return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
(Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
}
VOID Inflate(REAL dx, REAL dy)
{
X -= dx;
Y -= dy;
Width += 2*dx;
Height += 2*dy;
}
/*VOID Inflate(const PointF& point)
{
Inflate(point.X, point.Y);
}
*/
BOOL Intersect(const RectF& rect)
{
return Intersect(*this, *this, rect);
}
static BOOL Intersect(RectF& c, const RectF& a, const RectF& b)
{
REAL right = min(a.GetRight(), b.GetRight());
REAL bottom = min(a.GetBottom(), b.GetBottom());
REAL left = max(a.GetLeft(), b.GetLeft());
REAL top = max(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
BOOL IntersectsWith(const RectF& rect) const
{
return (GetLeft() < rect.GetRight() &&
GetTop() < rect.GetBottom() &&
GetRight() > rect.GetLeft() &&
GetBottom() > rect.GetTop());
}
static BOOL Union(RectF& c, const RectF& a, const RectF& b)
{
REAL right = max(a.GetRight(), b.GetRight());
REAL bottom = max(a.GetBottom(), b.GetBottom());
REAL left = min(a.GetLeft(), b.GetLeft());
REAL top = min(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
/* VOID Offset(const PointF& point)
{
Offset(point.X, point.Y);
}
*/
VOID Offset(REAL dx, REAL dy)
{
X += dx;
Y += dy;
}
public:
REAL X;
REAL Y;
REAL Width;
REAL Height;
};
}
#include "../../ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/linux_gdiplus.h"
#endif
#include "Metric.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment