2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FGrpCanvas.cpp
20 * @brief This is the implementation file for Canvas class.
26 #include <FGrpCanvas.h>
28 #include <FBaseSysLog.h>
30 #include "FGrp_CanvasImpl.h"
31 #include "util/FGrp_Util.h"
34 #define CHECK_INSTANCE \
35 SysTryReturnResult(NID_GRP, this->__pImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Fails to allocate memory.")
37 #define CHECK_INSTANCE_EX(_result) \
38 SysTryReturn(NID_GRP, this->__pImpl, _result, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Fails to allocate memory.")
40 #define CHECK_INSTANCE_VOID \
41 SysTryReturnVoidResult(NID_GRP, this->__pImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Fails to allocate memory.")
44 #define CHECK_NOT_CONSTRUCTED \
47 SysAssertf(!this->__pImpl->IsConstructed(), \
48 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class");
50 #define CHECK_CONSTRUCTED \
52 SysAssertf((this->__pImpl != null) && this->__pImpl->IsConstructed(), \
53 "Not yet constructed. Construct() should be called before use.");
55 #define CHECK_CONSTRUCTED_EX(_result) \
57 SysAssertf((this->__pImpl != null) && this->__pImpl->IsConstructed(), \
58 "Not yet constructed. Construct() should be called before use.");
60 #define CHECK_CONSTRUCTED_VOID \
62 SysAssertf((this->__pImpl != null) && this->__pImpl->IsConstructed(), \
63 "Not yet constructed. Construct() should be called before use.");
66 namespace Tizen { namespace Graphics
72 __pImpl = new (std::nothrow) _CanvasImpl;
81 Canvas::Construct(void)
83 CHECK_NOT_CONSTRUCTED;
85 result r = this->__pImpl->Construct();
87 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
93 Canvas::Construct(const Rectangle& vcRect)
95 CHECK_NOT_CONSTRUCTED;
97 result r = this->__pImpl->Construct(vcRect);
99 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
105 Canvas::Construct(const FloatRectangle& vcRect)
107 CHECK_NOT_CONSTRUCTED;
109 result r = this->__pImpl->Construct(vcRect);
111 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
117 Canvas::Construct(const BufferInfo& bufferInfo)
119 CHECK_NOT_CONSTRUCTED;
121 result r = this->__pImpl->Construct(bufferInfo);
123 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
133 result r = this->__pImpl->Clear();
135 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
141 Canvas::Clear(const Rectangle& vcRect)
145 result r = this->__pImpl->Clear(vcRect);
147 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
153 Canvas::Clear(const FloatRectangle& vcRect)
157 result r = this->__pImpl->Clear(vcRect);
159 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
165 Canvas::Copy(const Point& vcDestPoint, const Canvas& canvas, const Rectangle& vcSrcRect)
169 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n");
171 const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl;
173 result r = this->__pImpl->Copy(vcDestPoint, impl, vcSrcRect);
175 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
181 Canvas::Copy(const FloatPoint& vcDestPoint, const Canvas& canvas, const FloatRectangle& vcSrcRect)
185 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n");
187 const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl;
189 result r = this->__pImpl->Copy(vcDestPoint, impl, vcSrcRect);
191 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
197 Canvas::Copy(const Rectangle& vcDestRect, const Canvas& canvas, const Rectangle& vcSrcRect)
201 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n");
203 const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl;
205 result r = this->__pImpl->Copy(vcDestRect, impl, vcSrcRect);
207 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
213 Canvas::Copy(const FloatRectangle& vcDestRect, const Canvas& canvas, const FloatRectangle& vcSrcRect)
217 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&canvas), E_INVALID_ARG, "The source canvas is invalid.\n");
219 const Tizen::Graphics::_CanvasImpl& impl = *canvas.__pImpl;
221 result r = this->__pImpl->Copy(vcDestRect, impl, vcSrcRect);
223 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
229 Canvas::DrawArc(const Rectangle& vcBounds, int startAngle, int endAngle, ArcStyle arcStyle)
233 result r = this->__pImpl->DrawArc(vcBounds, startAngle, endAngle, arcStyle);
235 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
241 Canvas::DrawArc(const FloatRectangle& vcBounds, float startAngle, float endAngle, ArcStyle arcStyle)
245 result r = this->__pImpl->DrawArc(vcBounds, startAngle, endAngle, arcStyle);
247 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
253 Canvas::DrawBitmap(const Rectangle& vcRect, const Bitmap& bitmap)
257 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
259 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
261 result r = this->__pImpl->DrawBitmap(vcRect, impl);
263 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
269 Canvas::DrawBitmap(const FloatRectangle& vcRect, const Bitmap& bitmap)
273 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
275 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
277 result r = this->__pImpl->DrawBitmap(vcRect, impl);
279 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
285 Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap)
289 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
291 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
293 result r = this->__pImpl->DrawBitmap(vcPoint, impl);
295 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
301 Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap)
305 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
307 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
309 result r = this->__pImpl->DrawBitmap(vcPoint, impl);
311 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
317 Canvas::DrawBitmap(const Rectangle& vcDestRect, const Bitmap& srcBitmap, const Rectangle& vcSrcRect)
321 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&srcBitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
323 const Tizen::Graphics::_BitmapImpl& impl = *srcBitmap.__pImpl;
325 result r = this->__pImpl->DrawBitmap(vcDestRect, impl, vcSrcRect);
327 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
333 Canvas::DrawBitmap(const FloatRectangle& vcDestRect, const Bitmap& srcBitmap, const FloatRectangle& vcSrcRect)
337 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&srcBitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
339 const Tizen::Graphics::_BitmapImpl& impl = *srcBitmap.__pImpl;
341 result r = this->__pImpl->DrawBitmap(vcDestRect, impl, vcSrcRect);
343 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
349 Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, FlipDirection dir)
353 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
355 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
357 result r = this->__pImpl->DrawBitmap(vcPoint, impl, dir);
359 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
365 Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap, FlipDirection dir)
369 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
371 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
373 result r = this->__pImpl->DrawBitmap(vcPoint, impl, dir);
375 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
381 Canvas::DrawBitmap(const Point& vcPoint, const Bitmap& bitmap, const Point& vcPivot, int degree)
385 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
387 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
389 result r = this->__pImpl->DrawBitmap(vcPoint, impl, vcPivot, degree);
391 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
397 Canvas::DrawBitmap(const FloatPoint& vcPoint, const Bitmap& bitmap, const FloatPoint& vcPivot, float degree)
401 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
403 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
405 result r = this->__pImpl->DrawBitmap(vcPoint, impl, vcPivot, degree);
407 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
413 Canvas::DrawNinePatchedBitmap(const Rectangle& vcRect, const Bitmap& bitmap)
417 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
419 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
421 result r = this->__pImpl->DrawNinePatchedBitmap(vcRect, impl);
423 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
429 Canvas::DrawNinePatchedBitmap(const FloatRectangle& vcRect, const Bitmap& bitmap)
433 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&bitmap), E_INVALID_ARG, "The source bitmap is invalid.\n");
435 const Tizen::Graphics::_BitmapImpl& impl = *bitmap.__pImpl;
437 result r = this->__pImpl->DrawNinePatchedBitmap(vcRect, impl);
439 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
445 Canvas::DrawEllipse(const Rectangle& vcBounds)
449 result r = this->__pImpl->DrawEllipse(vcBounds);
451 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
457 Canvas::DrawEllipse(const FloatRectangle& vcBounds)
461 result r = this->__pImpl->DrawEllipse(vcBounds);
463 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
469 Canvas::DrawLine(const Point& vcPoint1, const Point& vcPoint2)
473 result r = this->__pImpl->DrawLine(vcPoint1, vcPoint2);
475 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
481 Canvas::DrawLine(const FloatPoint& vcPoint1, const FloatPoint& vcPoint2)
485 result r = this->__pImpl->DrawLine(vcPoint1, vcPoint2);
487 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
493 Canvas::DrawPolygon(const Tizen::Base::Collection::IList& vcPoints)
497 result r = this->__pImpl->DrawPolygon(vcPoints);
499 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
505 Canvas::DrawPolyline(const Tizen::Base::Collection::IList& vcPoints)
509 result r = this->__pImpl->DrawPolyline(vcPoints);
511 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
517 Canvas::DrawRectangle(const Rectangle& vcRect)
521 result r = this->__pImpl->DrawRectangle(vcRect);
523 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
529 Canvas::DrawRectangle(const FloatRectangle& vcRect)
533 result r = this->__pImpl->DrawRectangle(vcRect);
535 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
541 Canvas::DrawRoundRectangle(const Rectangle& vcRect, const Dimension& vcArcDim)
545 result r = this->__pImpl->DrawRoundRectangle(vcRect, vcArcDim);
547 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
553 Canvas::DrawRoundRectangle(const FloatRectangle& vcRect, const FloatDimension& vcArcDim)
557 result r = this->__pImpl->DrawRoundRectangle(vcRect, vcArcDim);
559 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
565 Canvas::DrawTriangle(const Point& vcPoint1, const Point& vcPoint2, const Point& vcPoint3)
569 result r = this->__pImpl->DrawTriangle(vcPoint1, vcPoint2, vcPoint3);
571 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
577 Canvas::DrawTriangle(const FloatPoint& vcPoint1, const FloatPoint& vcPoint2, const FloatPoint& vcPoint3)
581 result r = this->__pImpl->DrawTriangle(vcPoint1, vcPoint2, vcPoint3);
583 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
589 Canvas::FillEllipse(const Color& color, const Rectangle& vcBounds)
593 result r = this->__pImpl->FillEllipse(color, vcBounds);
595 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
601 Canvas::FillEllipse(const Color& color, const FloatRectangle& vcBounds)
605 result r = this->__pImpl->FillEllipse(color, vcBounds);
607 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
613 Canvas::FillPolygon(const Color& color, const Tizen::Base::Collection::IList& vcPoints)
617 result r = this->__pImpl->FillPolygon(color, vcPoints);
619 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
625 Canvas::FillRectangle(const Color& color, const Rectangle& vcRect)
629 result r = this->__pImpl->FillRectangle(color, vcRect);
631 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
637 Canvas::FillRectangle(const Color& color, const FloatRectangle& vcRect)
641 result r = this->__pImpl->FillRectangle(color, vcRect);
643 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
649 Canvas::FillRoundRectangle(const Color& color, const Rectangle& vcRect, const Dimension& vcArcDim)
653 result r = this->__pImpl->FillRoundRectangle(color, vcRect, vcArcDim);
655 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
661 Canvas::FillRoundRectangle(const Color& color, const FloatRectangle& vcRect, const FloatDimension& vcArcDim)
665 result r = this->__pImpl->FillRoundRectangle(color, vcRect, vcArcDim);
667 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
673 Canvas::FillTriangle(const Color& color, const Point& vcPoint1, const Point& vcPoint2, const Point& vcPoint3)
677 result r = this->__pImpl->FillTriangle(color, vcPoint1, vcPoint2, vcPoint3);
679 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
685 Canvas::FillTriangle(const Color& color, const FloatPoint& vcPoint1, const FloatPoint& vcPoint2, const FloatPoint& vcPoint3)
689 result r = this->__pImpl->FillTriangle(color, vcPoint1, vcPoint2, vcPoint3);
691 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
697 Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text)
701 result r = this->__pImpl->DrawText(vcPoint, text);
703 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
709 Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text)
713 result r = this->__pImpl->DrawText(vcPoint, text);
715 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
721 Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int length)
725 result r = this->__pImpl->DrawText(vcPoint, text, 0, length);
727 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
733 Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, int length)
737 result r = this->__pImpl->DrawText(vcPoint, text, 0, length);
739 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
745 Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, const Color& outlineColor)
749 result r = this->__pImpl->DrawText(vcPoint, text, 0, outlineColor);
751 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
757 Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, const Color& outlineColor)
761 result r = this->__pImpl->DrawText(vcPoint, text, 0, outlineColor);
763 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
769 Canvas::DrawText(const Point& vcPoint, const Tizen::Base::String& text, int length, const Color& outlineColor)
773 result r = this->__pImpl->DrawText(vcPoint, text, 0, length, outlineColor);
775 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
781 Canvas::DrawText(const FloatPoint& vcPoint, const Tizen::Base::String& text, int length, const Color& outlineColor)
785 result r = this->__pImpl->DrawText(vcPoint, text, 0, length, outlineColor);
787 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
793 Canvas::DrawText(const Point& vcPoint, const EnrichedText& etext)
797 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&etext), E_INVALID_ARG, "The source enriched text is invalid.\n");
799 result r = this->__pImpl->DrawText(vcPoint, etext);
801 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
807 Canvas::DrawText(const FloatPoint& vcPoint, const EnrichedText& etext)
811 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&etext), E_INVALID_ARG, "The source enriched text is invalid.\n");
813 result r = this->__pImpl->DrawText(vcPoint, etext);
815 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
821 Canvas::GetBounds(void) const
823 CHECK_CONSTRUCTED_EX(Rectangle());
825 return this->__pImpl->GetBounds();
829 Canvas::GetBoundsF(void) const
831 CHECK_CONSTRUCTED_EX(FloatRectangle());
833 return this->__pImpl->GetBoundsF();
837 Canvas::GetActualBounds(void) const
839 CHECK_CONSTRUCTED_EX(FloatRectangle());
841 return this->__pImpl->GetActualBounds();
845 Canvas::GetLineStyle() const
847 CHECK_CONSTRUCTED_EX(LINE_STYLE_MAX);
849 return this->__pImpl->GetLineStyle();
853 Canvas::GetLineWidth() const
855 CHECK_CONSTRUCTED_EX(-1);
857 return this->__pImpl->GetLineWidth();
861 Canvas::GetLineWidthF() const
863 CHECK_CONSTRUCTED_EX(-1);
865 return this->__pImpl->GetLineWidthF();
869 Canvas::SetLineStyle(LineStyle style)
873 result r = this->__pImpl->SetLineStyle(style);
875 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
881 Canvas::SetLineWidth(int vcWidth)
885 result r = this->__pImpl->SetLineWidth(vcWidth);
887 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
893 Canvas::SetLineWidth(float vcWidth)
897 result r = this->__pImpl->SetLineWidth(vcWidth);
899 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
905 Canvas::GetDashPattern(Tizen::Base::Collection::IListT<int>& pattern, int& offset) const
909 result r = this->__pImpl->GetDashPattern(pattern, offset);
911 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
917 Canvas::GetDashPattern(Tizen::Base::Collection::IListT<float>& pattern, float& offset) const
921 result r = this->__pImpl->GetDashPattern(pattern, offset);
923 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
929 Canvas::SetDashPattern(const Tizen::Base::Collection::IListT<int>& pattern, int offset)
933 result r = this->__pImpl->SetDashPattern(pattern, offset);
935 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
941 Canvas::SetDashPattern(const Tizen::Base::Collection::IListT<float>& pattern, float offset)
945 result r = this->__pImpl->SetDashPattern(pattern, offset);
947 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
953 Canvas::GetLineCapStyle(void) const
955 CHECK_CONSTRUCTED_EX(LINE_CAP_STYLE_ROUND);
957 return this->__pImpl->GetLineCapStyle();
961 Canvas::SetLineCapStyle(LineCapStyle lineCapStyle)
965 result r = this->__pImpl->SetLineCapStyle(lineCapStyle);
967 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
973 Canvas::GetLineJoinStyle(void) const
975 CHECK_CONSTRUCTED_EX(LINE_JOIN_STYLE_ROUND);
977 return this->__pImpl->GetLineJoinStyle();
981 Canvas::SetLineJoinStyle(LineJoinStyle lineJoinStyle)
985 result r = this->__pImpl->SetLineJoinStyle(lineJoinStyle);
987 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
992 #if 0 // Not public feature yet
995 Canvas::SetDrawingQuality(BitmapDrawingQuality quality)
999 result r = this->__pImpl->SetDrawingQuality(quality);
1001 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r,"[%s] Propagating.", GetErrorMessage(r));
1006 BitmapDrawingQuality
1007 Canvas::GetDrawingQuality(void) const
1009 CHECK_CONSTRUCTED_EX(BITMAP_DRAWING_QUALITY_LOW);
1011 return this->__pImpl->GetDrawingQuality();
1017 Canvas::GetPixel(const Point& vcPoint, Color& color) const
1021 result r = this->__pImpl->GetPixel(vcPoint, color);
1023 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1029 Canvas::GetPixel(const FloatPoint& vcPoint, Color& color) const
1033 result r = this->__pImpl->GetPixel(vcPoint, color);
1035 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1041 Canvas::SetPixel(const Point& vcPoint)
1045 result r = this->__pImpl->SetPixel(vcPoint);
1047 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1053 Canvas::SetPixel(const FloatPoint& vcPoint)
1057 result r = this->__pImpl->SetPixel(vcPoint);
1059 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1069 result r = this->__pImpl->Show();
1071 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1077 Canvas::Show(const Rectangle& vcRect)
1081 result r = this->__pImpl->Show(vcRect);
1083 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1089 Canvas::SetFont(const Font& font)
1093 SysTryReturnResult(NID_GRP, _Util::CheckValidity(&font), E_INVALID_ARG, "The source font is invalid.\n");
1095 result r = this->__pImpl->SetFont(font);
1097 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1103 Canvas::GetFontN(void) const
1105 CHECK_CONSTRUCTED_EX(null);
1107 Font* pReturnFont = this->__pImpl->GetFontN();
1109 if (pReturnFont == null)
1111 result r = GetLastResult();
1113 SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
1122 Canvas::SetClipBounds(const Rectangle& vcRect)
1126 result r = this->__pImpl->SetClipBounds(vcRect);
1128 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1134 Canvas::SetClipBounds(const FloatRectangle& vcRect)
1138 result r = this->__pImpl->SetClipBounds(vcRect);
1140 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1146 Canvas::GetClipBounds(void) const
1148 CHECK_CONSTRUCTED_EX(Rectangle());
1150 return this->__pImpl->GetClipBounds();
1154 Canvas::GetClipBoundsF(void) const
1156 CHECK_CONSTRUCTED_EX(FloatRectangle());
1158 return this->__pImpl->GetClipBoundsF();
1162 Canvas::Lock(BufferInfo& info, long timeout)
1166 result r = this->__pImpl->Lock(info, timeout);
1168 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1178 result r = this->__pImpl->Unlock();
1180 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1186 Canvas::SetForegroundColor(const Color& fgColor)
1188 CHECK_CONSTRUCTED_VOID;
1190 return this->__pImpl->SetForegroundColor(fgColor);
1194 Canvas::GetForegroundColor(void) const
1196 CHECK_CONSTRUCTED_EX(Color::GetColor(COLOR_ID_BLACK));
1198 return this->__pImpl->GetForegroundColor();
1202 Canvas::SetBackgroundColor(const Color& bgColor)
1204 CHECK_CONSTRUCTED_VOID;
1206 return this->__pImpl->SetBackgroundColor(bgColor);
1210 Canvas::GetBackgroundColor(void) const
1212 CHECK_CONSTRUCTED_EX(Color::GetColor(COLOR_ID_BLACK));
1214 return this->__pImpl->GetBackgroundColor();
1218 Canvas::SetPosition(const Point& vcPoint)
1222 result r = this->__pImpl->SetPosition(vcPoint);
1224 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1230 Canvas::SetPosition(int vcX, int vcY)
1234 result r = this->__pImpl->SetPosition(vcX, vcY);
1236 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1242 Canvas::SetCompositeMode(CompositeMode compositeMode)
1246 result r = this->__pImpl->SetCompositeMode(compositeMode);
1248 SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1254 Canvas::GetCompositeMode(void) const
1256 CHECK_CONSTRUCTED_EX(COMPOSITE_MODE_SRC_OVER);
1258 return this->__pImpl->GetCompositeMode();
1261 }} // Tizen::Graphics