[PSDK][GDIPLUS] Further Pen work
[reactos.git] / reactos / sdk / include / psdk / gdipluspen.h
index 2001fe3..415d62b 100644 (file)
@@ -47,7 +47,9 @@ public:
 
   PenAlignment GetAlignment(VOID)
   {
-    return PenAlignmentCenter;
+    PenAlignment penAlignment;
+    SetStatus(DllExports::GdipGetPenMode(pen, &penAlignment));
+    return penAlignment;
   }
 
   Brush *GetBrush(VOID)
@@ -57,17 +59,23 @@ public:
 
   Status GetColor(Color *color)
   {
-    return NotImplemented;
+    ARGB argb;
+    Status status = SetStatus(DllExports::GdipGetPenColor(pen, &argb));
+    if (color)
+      color->SetValue(argb);
+    return status;
   }
 
   Status GetCompoundArray(REAL *compoundArray, INT count)
   {
-    return NotImplemented;
+    return NotImplemented;  // FIXME: not available: SetStatus(DllExports::GdipGetPenCompoundArray(pen, count));
   }
 
   INT GetCompoundArrayCount(VOID)
   {
-    return 0;
+    INT count;
+    SetStatus(DllExports::GdipGetPenCompoundCount(pen, &count));
+    return count;
   }
 
   Status GetCustomEndCap(CustomLineCap *customCap)
@@ -82,57 +90,75 @@ public:
 
   DashCap GetDashCap(VOID)
   {
-    return DashCapFlat;
+    DashCap dashCap;
+    SetStatus(DllExports::GdipGetPenDashCap197819(pen, &dashCap));
+    return dashCap;
   }
 
   REAL GetDashOffset(VOID)
   {
-    return 0;
+    REAL offset;
+    SetStatus(DllExports::GdipGetPenDashOffset(pen, &offset));
+    return offset;
   }
 
   Status GetDashPattern(REAL *dashArray, INT count)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipGetPenDashArray(pen, dashArray, count));
   }
 
   INT GetDashPatternCount(VOID)
   {
-    return 0;
+    INT count;
+    SetStatus(DllExports::GdipGetPenDashCount(pen, &count));
+    return count;
   }
 
   DashStyle GetDashStyle(VOID)
   {
-    return DashStyleSolid;
+    DashStyle dashStyle;
+    SetStatus(DllExports::GdipGetPenDashStyle(pen, &dashStyle));
+    return dashStyle;
   }
 
   LineCap GetEndCap(VOID)
   {
-    return LineCapFlat;
+    LineCap endCap;
+    SetStatus(DllExports::GdipGetPenEndCap(pen, &endCap));
+    return endCap;
   }
 
   Status GetLastStatus(VOID)
   {
-    return NotImplemented;
+    return status;
   }
 
   LineJoin GetLineJoin(VOID)
   {
-    return LineJoinMiter;
+    LineJoin lineJoin;
+    SetStatus(DllExports::GdipGetPenLineJoin(pen, &lineJoin));
+    return lineJoin;
   }
 
   REAL GetMiterLimit(VOID)
   {
-    return 0;
+    REAL miterLimit;
+    SetStatus(DllExports::GdipGetPenMiterLimit(pen, &miterLimit));
+    return miterLimit;
   }
 
   PenType GetPenType(VOID)
   {
-    return PenTypeSolidColor;
+    PenType type;
+    SetStatus(DllExports::GdipGetPenFillType(pen, &type));
+    return type;
   }
 
   LineCap GetStartCap(VOID)
   {
-    return LineCapFlat;
+    LineCap startCap;
+    SetStatus(DllExports::GdipGetPenStartCap(pen, &startCap));
+    return startCap;
   }
 
   Status GetTransform(Matrix *matrix)
@@ -142,47 +168,49 @@ public:
 
   REAL GetWidth(VOID)
   {
-    return 0;
+    REAL width;
+    SetStatus(DllExports::GdipGetPenWidth(pen, &width));
+    return width;
   }
 
   Status MultiplyTransform(Matrix *matrix, MatrixOrder order)
   {
-    return NotImplemented;
+    return NotImplemented;  // FIXME: not available: SetStatus(DllExports::GdipMultiplyPenTransform(pen, matrix ? matrix->matrix : NULL, order));
   }
 
   Status ResetTransform(VOID)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipResetPenTransform(pen));
   }
 
   Status RotateTransform(REAL angle, MatrixOrder order)
   {
-    return NotImplemented;
+    return NotImplemented;  // FIXME: not available: SetStatus(DllExports::GdipRotatePenTransform(pen, angle, order));
   }
 
   Status ScaleTransform(REAL sx, REAL sy, MatrixOrder order)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipScalePenTransform(pen, sx, sy, order));
   }
 
   Status SetAlignment(PenAlignment penAlignment)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenMode(pen, penAlignment));
   }
 
   Status SetBrush(const Brush *brush)
   {
-    return NotImplemented;
+    return NotImplemented;  // FIXME: Brush unimplemented SetStatus(DllExports::GdipSetPenBrushFill(pen, brush ? brush->brush : NULL));
   }
 
   Status SetColor(const Color &color)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenColor(pen, color.GetValue()));
   }
 
   Status SetCompoundArray(const REAL *compoundArray, INT count)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenCompoundArray(pen, compoundArray, count));
   }
 
   Status SetCustomEndCap(const CustomLineCap *customCap)
@@ -197,62 +225,72 @@ public:
 
   Status SetDashCap(DashCap dashCap)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenDashCap197819(pen, dashCap));
   }
 
   Status SetDashOffset(REAL dashOffset)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenDashOffset(pen, dashOffset));
   }
 
   Status SetDashPattern(const REAL *dashArray, INT count)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenDashArray(pen, dashArray, count));
   }
 
   Status SetDashStyle(DashStyle dashStyle)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenDashStyle(pen, dashStyle));
   }
 
   Status SetEndCap(LineCap endCap)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenEndCap(pen, endCap));
   }
 
   Status SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenLineCap197819(pen, startCap, endCap, dashCap));
   }
 
   Status SetLineJoin(LineJoin lineJoin)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenLineJoin(pen, lineJoin));
   }
 
   Status SetMiterLimit(REAL miterLimit)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenMiterLimit(pen, miterLimit));
   }
 
   Status SetStartCap(LineCap startCap)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenStartCap(pen, startCap));
   }
 
   Status SetTransform(const Matrix *matrix)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenTransform(pen, matrix ? matrix->matrix : NULL));
   }
 
   Status SetWidth(REAL width)
   {
-    return NotImplemented;
+    return SetStatus(DllExports::GdipSetPenWidth(pen, width));
   }
 
 private:
-  Status status;
   GpPen *pen;
+
+private:
+  mutable Status status;
+
+  Status SetStatus(Status status) const
+  {
+    if (status == Ok)
+      return status;
+    this->status = status;
+    return status;
+  }
 };
 
 #endif /* _GDIPLUSPEN_H */