2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable-group.h>
20 #include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-gradient.h>
21 #include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-linear-gradient.h>
22 #include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-picture.h>
23 #include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-radial-gradient.h>
24 #include <dali-toolkit/dali-toolkit.h>
25 #include <dali-toolkit/devel-api/controls/canvas-view/canvas-view.h>
28 #include <dali-csharp-binder/common/common.h>
31 using namespace Dali::Toolkit;
37 SWIGEXPORT void *SWIGSTDCALL
38 CSharp_Dali_CanvasView_New__SWIG_0(char *pViewBox) {
39 Dali::ImageDimensions viewBox;
40 Dali::Toolkit::CanvasView result;
43 SWIG_CSharpSetPendingExceptionArgument(
44 SWIG_CSharpArgumentNullException,
45 "Attempt to dereference null Dali::ImageDimensions", 0);
48 viewBox = *(Dali::ImageDimensions *)pViewBox;
51 result = Dali::Toolkit::CanvasView::New(
52 Vector2(viewBox.GetWidth(), viewBox.GetHeight()));
54 CALL_CATCH_EXCEPTION(0);
57 return new Dali::Toolkit::CanvasView(
58 (const Dali::Toolkit::CanvasView &)result);
61 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_CanvasView_New__SWIG_1() {
62 Dali::Toolkit::CanvasView result;
66 result = Dali::Toolkit::CanvasView::New();
68 CALL_CATCH_EXCEPTION(0);
71 return new Dali::Toolkit::CanvasView(
72 (const Dali::Toolkit::CanvasView &)result);
75 SWIGEXPORT bool SWIGSTDCALL
76 CSharp_Dali_CanvasView_AddDrawable(char *pCanvasView, char *pDrawable) {
77 Dali::Toolkit::CanvasView canvasView;
78 Dali::CanvasRenderer::Drawable drawable;
82 SWIG_CSharpSetPendingExceptionArgument(
83 SWIG_CSharpArgumentNullException,
84 "Attempt to dereference null Dali::Toolkit::CanvasView", 0);
87 canvasView = *(Dali::Toolkit::CanvasView *)pCanvasView;
90 SWIG_CSharpSetPendingExceptionArgument(
91 SWIG_CSharpArgumentNullException,
92 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
95 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
98 canvasView.AddDrawable(drawable);
100 CALL_CATCH_EXCEPTION(0);
106 SWIGEXPORT bool SWIGSTDCALL
107 CSharp_Dali_CanvasView_RemoveDrawable(char *pCanvasView, char *pDrawable) {
108 Dali::Toolkit::CanvasView canvasView;
109 Dali::CanvasRenderer::Drawable drawable;
113 SWIG_CSharpSetPendingExceptionArgument(
114 SWIG_CSharpArgumentNullException,
115 "Attempt to dereference null Dali::Toolkit::CanvasView", 0);
118 canvasView = *(Dali::Toolkit::CanvasView *)pCanvasView;
121 SWIG_CSharpSetPendingExceptionArgument(
122 SWIG_CSharpArgumentNullException,
123 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
126 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
129 canvasView.RemoveDrawable(drawable);
131 CALL_CATCH_EXCEPTION(0);
137 SWIGEXPORT void SWIGSTDCALL
138 CSharp_Dali_CanvasView_RemoveAllDrawables(char *pCanvasView) {
139 Dali::Toolkit::CanvasView canvasView;
140 Dali::CanvasRenderer::Drawable drawable;
143 SWIG_CSharpSetPendingExceptionArgument(
144 SWIG_CSharpArgumentNullException,
145 "Attempt to dereference null Dali::Toolkit::CanvasView", 0);
148 canvasView = *(Dali::Toolkit::CanvasView *)pCanvasView;
152 canvasView.RemoveAllDrawables();
154 CALL_CATCH_EXCEPTION();
158 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_CanvasView(void *pCanvasView) {
159 Dali::Toolkit::CanvasView *pTargetCanvasView = nullptr;
162 SWIG_CSharpSetPendingExceptionArgument(
163 SWIG_CSharpArgumentNullException,
164 "Attempt to dereference null Dali::Toolkit::CanvasView", 0);
167 pTargetCanvasView = (Dali::Toolkit::CanvasView *)pCanvasView;
170 if (pTargetCanvasView) {
171 delete pTargetCanvasView;
174 CALL_CATCH_EXCEPTION();
178 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_CanvasView_Property_VIEWBOX_get() {
179 return (int)Toolkit::CanvasView::Property::VIEW_BOX;
182 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_CanvasView_Property_SYNCHRONOUS_LOADING_get() {
183 return (int)Toolkit::CanvasView::Property::SYNCHRONOUS_LOADING;
186 // Dali::CanvasRenderer::Drawable Wrapper
188 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Drawable_SetOpacity(char *pDrawable,
190 Dali::CanvasRenderer::Drawable drawable;
193 SWIG_CSharpSetPendingExceptionArgument(
194 SWIG_CSharpArgumentNullException,
195 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
198 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
202 drawable.SetOpacity(opacity);
204 CALL_CATCH_EXCEPTION();
208 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Drawable_GetOpacity(char *pDrawable) {
209 Dali::CanvasRenderer::Drawable drawable;
210 float opacity = 0.0f;
213 SWIG_CSharpSetPendingExceptionArgument(
214 SWIG_CSharpArgumentNullException,
215 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
218 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
221 opacity = drawable.GetOpacity();
223 CALL_CATCH_EXCEPTION(0);
229 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_Translate(char *pDrawable,
231 Dali::CanvasRenderer::Drawable drawable;
235 SWIG_CSharpSetPendingExceptionArgument(
236 SWIG_CSharpArgumentNullException,
237 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
240 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
243 result = drawable.Translate(Vector2(x, y));
245 CALL_CATCH_EXCEPTION(false);
250 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_Scale(char *pDrawable,
252 Dali::CanvasRenderer::Drawable drawable;
256 SWIG_CSharpSetPendingExceptionArgument(
257 SWIG_CSharpArgumentNullException,
258 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
261 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
265 result = drawable.Scale(scale);
267 CALL_CATCH_EXCEPTION(false);
272 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_Rotate(char *pDrawable,
274 Dali::CanvasRenderer::Drawable drawable;
278 SWIG_CSharpSetPendingExceptionArgument(
279 SWIG_CSharpArgumentNullException,
280 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
283 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
286 result = drawable.Rotate(Dali::Degree(degree));
288 CALL_CATCH_EXCEPTION(false);
293 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_Transform(char *pDrawable,
295 Dali::CanvasRenderer::Drawable drawable;
299 SWIG_CSharpSetPendingExceptionArgument(
300 SWIG_CSharpArgumentNullException,
301 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
304 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
307 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
308 "Dali::Matrix3 const & type is null",
315 result = drawable.Transform(
316 Dali::Matrix3(pTransform[0], pTransform[1], pTransform[2],
317 pTransform[3], pTransform[4], pTransform[5],
318 pTransform[6], pTransform[7], pTransform[8]));
320 CALL_CATCH_EXCEPTION(0);
326 SWIGEXPORT void *SWIGSTDCALL
327 CSharp_Dali_Drawable_GetBoundingBox(char *pDrawable) {
328 Dali::CanvasRenderer::Drawable drawable;
329 Dali::Rect<float> result;
332 SWIG_CSharpSetPendingExceptionArgument(
333 SWIG_CSharpArgumentNullException,
334 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
337 drawable = *(Dali::CanvasRenderer::Shape *)pDrawable;
340 result = drawable.GetBoundingBox();
342 CALL_CATCH_EXCEPTION(0);
345 // Note: The float type Rectangle class is not ready yet.
346 // Therefore, it transmits data in Vector4 class.
347 // This type should later be changed to the appropriate data type.
348 return new Dali::Vector4(result.x, result.y, result.width, result.height);
351 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_SetClipPath(char *pDrawable,
353 Dali::CanvasRenderer::Drawable drawable;
354 Dali::CanvasRenderer::Drawable clip;
358 SWIG_CSharpSetPendingExceptionArgument(
359 SWIG_CSharpArgumentNullException,
360 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
363 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
366 SWIG_CSharpSetPendingExceptionArgument(
367 SWIG_CSharpArgumentNullException,
368 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
371 clip = *(Dali::CanvasRenderer::Drawable *)pClip;
375 result = drawable.SetClipPath(clip);
377 CALL_CATCH_EXCEPTION(0);
383 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Drawable_SetMask(char *pDrawable,
386 Dali::CanvasRenderer::Drawable drawable;
387 Dali::CanvasRenderer::Drawable mask;
391 SWIG_CSharpSetPendingExceptionArgument(
392 SWIG_CSharpArgumentNullException,
393 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
396 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
399 SWIG_CSharpSetPendingExceptionArgument(
400 SWIG_CSharpArgumentNullException,
401 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
404 mask = *(Dali::CanvasRenderer::Drawable *)pMask;
408 result = drawable.SetMask(
410 static_cast<Dali::CanvasRenderer::Drawable::MaskType>(maskType));
412 CALL_CATCH_EXCEPTION(0);
418 // Dali::CanvasRenderer::Picture Wrapper
420 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Picture_New() {
421 Dali::CanvasRenderer::Picture picture;
425 picture = Dali::CanvasRenderer::Picture::New();
427 CALL_CATCH_EXCEPTION(0);
430 return new Dali::CanvasRenderer::Picture(
431 (const Dali::CanvasRenderer::Picture &)picture);
434 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Picture_Load(char *pPicture,
436 Dali::CanvasRenderer::Picture picture;
440 SWIG_CSharpSetPendingExceptionArgument(
441 SWIG_CSharpArgumentNullException,
442 "Attempt to dereference null Dali::CanvasRenderer::Picture", 0);
445 picture = *(Dali::CanvasRenderer::Picture *)pPicture;
448 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
449 "Attempt to dereference null string",
453 std::string url(pUrl);
457 result = picture.Load(url);
459 CALL_CATCH_EXCEPTION(0);
465 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Picture_SetSize(char *pPicture,
467 Dali::CanvasRenderer::Picture picture;
471 SWIG_CSharpSetPendingExceptionArgument(
472 SWIG_CSharpArgumentNullException,
473 "Attempt to dereference null Dali::CanvasRenderer::Picture", 0);
476 picture = *(Dali::CanvasRenderer::Picture *)pPicture;
479 SWIG_CSharpSetPendingExceptionArgument(
480 SWIG_CSharpArgumentNullException,
481 "Attempt to dereference null Dali::Vector2", 0);
487 result = picture.SetSize(*(Dali::Vector2 *)pSize);
489 CALL_CATCH_EXCEPTION(0);
495 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Picture_GetSize(char *pPicture) {
496 Dali::CanvasRenderer::Picture picture;
497 Dali::Vector2 result;
500 SWIG_CSharpSetPendingExceptionArgument(
501 SWIG_CSharpArgumentNullException,
502 "Attempt to dereference null Dali::CanvasRenderer::Picture", 0);
505 picture = *(Dali::CanvasRenderer::Picture *)pPicture;
509 result = picture.GetSize();
511 CALL_CATCH_EXCEPTION(0);
514 return new Dali::Vector2((const Dali::Vector2 &)result);
517 // Dali::CanvasRenderer::Shape Wrapper
519 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Shape_New() {
520 Dali::CanvasRenderer::Shape shape;
524 shape = Dali::CanvasRenderer::Shape::New();
526 CALL_CATCH_EXCEPTION(0);
529 return new Dali::CanvasRenderer::Shape(
530 (const Dali::CanvasRenderer::Shape &)shape);
533 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddRect(char *pShape, float x,
534 float y, float width,
538 Dali::CanvasRenderer::Shape shape;
542 SWIG_CSharpSetPendingExceptionArgument(
543 SWIG_CSharpArgumentNullException,
544 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
547 shape = *(Dali::CanvasRenderer::Shape *)pShape;
551 result = shape.AddRect(Rect<float>(x, y, width, height),
552 Vector2(roundX, roundY));
554 CALL_CATCH_EXCEPTION(0);
560 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddCircle(char *pShape, float x,
561 float y, float radiusX,
563 Dali::CanvasRenderer::Shape shape;
567 SWIG_CSharpSetPendingExceptionArgument(
568 SWIG_CSharpArgumentNullException,
569 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
572 shape = *(Dali::CanvasRenderer::Shape *)pShape;
576 result = shape.AddCircle(Vector2(x, y), Vector2(radiusX, radiusY));
578 CALL_CATCH_EXCEPTION(0);
584 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddArc(char *pShape, float x,
585 float y, float radius,
587 float sweep, bool pie) {
588 Dali::CanvasRenderer::Shape shape;
592 SWIG_CSharpSetPendingExceptionArgument(
593 SWIG_CSharpArgumentNullException,
594 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
597 shape = *(Dali::CanvasRenderer::Shape *)pShape;
601 result = shape.AddArc(Vector2(x, y), radius, startAngle, sweep, pie);
603 CALL_CATCH_EXCEPTION(0);
609 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddMoveTo(char *pShape, float x,
611 Dali::CanvasRenderer::Shape shape;
615 SWIG_CSharpSetPendingExceptionArgument(
616 SWIG_CSharpArgumentNullException,
617 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
620 shape = *(Dali::CanvasRenderer::Shape *)pShape;
624 result = shape.AddMoveTo(Vector2(x, y));
626 CALL_CATCH_EXCEPTION(0);
632 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddLineTo(char *pShape, float x,
634 Dali::CanvasRenderer::Shape shape;
638 SWIG_CSharpSetPendingExceptionArgument(
639 SWIG_CSharpArgumentNullException,
640 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
643 shape = *(Dali::CanvasRenderer::Shape *)pShape;
647 result = shape.AddLineTo(Vector2(x, y));
649 CALL_CATCH_EXCEPTION(0);
655 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddCubicTo(
656 char *pShape, float controlPoint1X, float controlPoint1Y,
657 float controlPoint2X, float controlPoint2Y, float endPointX,
659 Dali::CanvasRenderer::Shape shape;
663 SWIG_CSharpSetPendingExceptionArgument(
664 SWIG_CSharpArgumentNullException,
665 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
668 shape = *(Dali::CanvasRenderer::Shape *)pShape;
672 result = shape.AddCubicTo(Vector2(controlPoint1X, controlPoint1Y),
673 Vector2(controlPoint2X, controlPoint2Y),
674 Vector2(endPointX, endPointY));
676 CALL_CATCH_EXCEPTION(0);
682 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_AddPath(char *pShape,
684 unsigned int commandCount,
686 unsigned int pointCount) {
687 Dali::CanvasRenderer::Shape shape;
691 SWIG_CSharpSetPendingExceptionArgument(
692 SWIG_CSharpArgumentNullException,
693 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
696 shape = *(Dali::CanvasRenderer::Shape *)pShape;
699 SWIG_CSharpSetPendingExceptionArgument(
700 SWIG_CSharpArgumentNullException,
701 "Attempt to dereference null Commands", 0);
706 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
707 "Attempt to dereference null Points",
714 Dali::CanvasRenderer::Shape::PathCommands pathCommands = {
715 (Dali::CanvasRenderer::Shape::PathCommandType *)pCommands,
716 commandCount, pPoints, pointCount};
718 result = shape.AddPath(pathCommands);
720 CALL_CATCH_EXCEPTION(0);
726 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_Close(char *pShape) {
727 Dali::CanvasRenderer::Shape shape;
731 SWIG_CSharpSetPendingExceptionArgument(
732 SWIG_CSharpArgumentNullException,
733 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
736 shape = *(Dali::CanvasRenderer::Shape *)pShape;
740 result = shape.Close();
742 CALL_CATCH_EXCEPTION(0);
748 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Shape_ResetPath(char *pShape) {
749 Dali::CanvasRenderer::Shape shape;
753 SWIG_CSharpSetPendingExceptionArgument(
754 SWIG_CSharpArgumentNullException,
755 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
758 shape = *(Dali::CanvasRenderer::Shape *)pShape;
762 result = shape.ResetPath();
764 CALL_CATCH_EXCEPTION(0);
770 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetFillColor(char *pShape,
772 Dali::CanvasRenderer::Shape shape;
776 SWIG_CSharpSetPendingExceptionArgument(
777 SWIG_CSharpArgumentNullException,
778 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
781 shape = *(Dali::CanvasRenderer::Shape *)pShape;
784 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
785 "Dali::Vector4 const & type is null",
789 color = *(Dali::Vector4 *)pColor;
793 shape.SetFillColor(color);
795 CALL_CATCH_EXCEPTION();
799 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Shape_GetFillColor(char *pShape) {
800 Dali::CanvasRenderer::Shape shape;
801 Dali::Vector4 result;
804 SWIG_CSharpSetPendingExceptionArgument(
805 SWIG_CSharpArgumentNullException,
806 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
809 shape = *(Dali::CanvasRenderer::Shape *)pShape;
813 result = shape.GetFillColor();
815 CALL_CATCH_EXCEPTION(0);
818 return new Dali::Vector4((const Dali::Vector4 &)result);
821 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetFillRule(char *pShape,
823 Dali::CanvasRenderer::Shape shape;
826 SWIG_CSharpSetPendingExceptionArgument(
827 SWIG_CSharpArgumentNullException,
828 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
831 shape = *(Dali::CanvasRenderer::Shape *)pShape;
836 static_cast<Dali::CanvasRenderer::Shape::FillRule>(rule));
838 CALL_CATCH_EXCEPTION();
842 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Shape_GetFillRule(char *pShape) {
843 Dali::CanvasRenderer::Shape shape;
844 Dali::CanvasRenderer::Shape::FillRule result;
847 SWIG_CSharpSetPendingExceptionArgument(
848 SWIG_CSharpArgumentNullException,
849 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
852 shape = *(Dali::CanvasRenderer::Shape *)pShape;
856 result = shape.GetFillRule();
858 CALL_CATCH_EXCEPTION(0);
864 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetStrokeWidth(char *pShape,
866 Dali::CanvasRenderer::Shape shape;
869 SWIG_CSharpSetPendingExceptionArgument(
870 SWIG_CSharpArgumentNullException,
871 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
874 shape = *(Dali::CanvasRenderer::Shape *)pShape;
878 shape.SetStrokeWidth(width);
880 CALL_CATCH_EXCEPTION();
884 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Shape_GetStrokeWidth(char *pShape) {
885 Dali::CanvasRenderer::Shape shape;
889 SWIG_CSharpSetPendingExceptionArgument(
890 SWIG_CSharpArgumentNullException,
891 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
894 shape = *(Dali::CanvasRenderer::Shape *)pShape;
898 result = shape.GetStrokeWidth();
900 CALL_CATCH_EXCEPTION(0);
906 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetStrokeColor(char *pShape,
908 Dali::CanvasRenderer::Shape shape;
912 SWIG_CSharpSetPendingExceptionArgument(
913 SWIG_CSharpArgumentNullException,
914 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
917 shape = *(Dali::CanvasRenderer::Shape *)pShape;
920 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
921 "Dali::Vector4 const & type is null",
925 color = *(Dali::Vector4 *)pColor;
928 shape.SetStrokeColor(color);
930 CALL_CATCH_EXCEPTION();
934 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Shape_GetStrokeColor(char *pShape) {
935 Dali::CanvasRenderer::Shape shape;
936 Dali::Vector4 result;
939 SWIG_CSharpSetPendingExceptionArgument(
940 SWIG_CSharpArgumentNullException,
941 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
944 shape = *(Dali::CanvasRenderer::Shape *)pShape;
947 result = shape.GetStrokeColor();
949 CALL_CATCH_EXCEPTION(0);
952 return new Dali::Vector4((const Dali::Vector4 &)result);
955 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetStrokeDash(
956 char *pShape, float *pDashPattern, unsigned int patternLength) {
957 Dali::CanvasRenderer::Shape shape;
960 SWIG_CSharpSetPendingExceptionArgument(
961 SWIG_CSharpArgumentNullException,
962 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
965 shape = *(Dali::CanvasRenderer::Shape *)pShape;
968 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
969 "Dash pattern is null", 0);
975 Vector<float> dashPattern;
976 for (unsigned int count = 0; count < patternLength; count++) {
977 dashPattern.PushBack(pDashPattern[count]);
979 shape.SetStrokeDash(dashPattern);
981 CALL_CATCH_EXCEPTION();
985 SWIGEXPORT unsigned int SWIGSTDCALL
986 CSharp_Dali_Shape_GetStrokeDashCount(char *pShape) {
987 Dali::CanvasRenderer::Shape shape;
991 SWIG_CSharpSetPendingExceptionArgument(
992 SWIG_CSharpArgumentNullException,
993 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
996 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1001 Dali::Vector<float> dashPattern = shape.GetStrokeDash();
1002 result = dashPattern.Size();
1004 CALL_CATCH_EXCEPTION(0);
1010 SWIGEXPORT float SWIGSTDCALL
1011 CSharp_Dali_Shape_GetStrokeDashIndexOf(char *pShape, unsigned int index) {
1012 Dali::CanvasRenderer::Shape shape;
1013 float result = 0.0f;
1016 SWIG_CSharpSetPendingExceptionArgument(
1017 SWIG_CSharpArgumentNullException,
1018 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1021 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1025 Dali::Vector<float> dashPattern = shape.GetStrokeDash();
1026 if (index >= dashPattern.Size()) {
1027 throw std::invalid_argument("invalid index");
1029 result = dashPattern[index];
1031 CALL_CATCH_EXCEPTION(0);
1037 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetStrokeCap(char *pShape,
1039 Dali::CanvasRenderer::Shape shape;
1042 SWIG_CSharpSetPendingExceptionArgument(
1043 SWIG_CSharpArgumentNullException,
1044 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1047 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1052 static_cast<Dali::CanvasRenderer::Shape::StrokeCap>(cap));
1054 CALL_CATCH_EXCEPTION();
1058 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Shape_GetStrokeCap(char *pShape) {
1059 Dali::CanvasRenderer::Shape shape;
1060 Dali::CanvasRenderer::Shape::StrokeCap result;
1063 SWIG_CSharpSetPendingExceptionArgument(
1064 SWIG_CSharpArgumentNullException,
1065 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1068 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1072 result = shape.GetStrokeCap();
1074 CALL_CATCH_EXCEPTION(0);
1080 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Shape_SetStrokeJoin(char *pShape,
1082 Dali::CanvasRenderer::Shape shape;
1085 SWIG_CSharpSetPendingExceptionArgument(
1086 SWIG_CSharpArgumentNullException,
1087 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1090 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1094 shape.SetStrokeJoin(
1095 static_cast<Dali::CanvasRenderer::Shape::StrokeJoin>(join));
1097 CALL_CATCH_EXCEPTION();
1101 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Shape_GetStrokeJoin(char *pShape) {
1102 Dali::CanvasRenderer::Shape shape;
1103 Dali::CanvasRenderer::Shape::StrokeJoin result;
1106 SWIG_CSharpSetPendingExceptionArgument(
1107 SWIG_CSharpArgumentNullException,
1108 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1111 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1114 result = shape.GetStrokeJoin();
1116 CALL_CATCH_EXCEPTION(0);
1122 SWIGEXPORT bool SWIGSTDCALL
1123 CSharp_Dali_Shapep_SetFillGradient(char *pShape, char *pGradient) {
1124 Dali::CanvasRenderer::Shape shape;
1125 Dali::CanvasRenderer::Gradient gradient;
1129 SWIG_CSharpSetPendingExceptionArgument(
1130 SWIG_CSharpArgumentNullException,
1131 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1134 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1137 SWIG_CSharpSetPendingExceptionArgument(
1138 SWIG_CSharpArgumentNullException,
1139 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1142 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1145 result = shape.SetFillGradient(gradient);
1147 CALL_CATCH_EXCEPTION(0);
1153 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Shapep_GetFillGradient(char *pShape) {
1154 Dali::CanvasRenderer::Shape shape;
1155 Dali::CanvasRenderer::Gradient gradient;
1158 SWIG_CSharpSetPendingExceptionArgument(
1159 SWIG_CSharpArgumentNullException,
1160 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1163 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1167 gradient = shape.GetFillGradient();
1169 CALL_CATCH_EXCEPTION(nullptr);
1172 return new Dali::CanvasRenderer::Gradient(
1173 (const Dali::CanvasRenderer::Gradient &)gradient);
1176 SWIGEXPORT bool SWIGSTDCALL
1177 CSharp_Dali_Shapep_SetStrokeGradient(char *pShape, char *pGradient) {
1178 Dali::CanvasRenderer::Shape shape;
1179 Dali::CanvasRenderer::Gradient gradient;
1183 SWIG_CSharpSetPendingExceptionArgument(
1184 SWIG_CSharpArgumentNullException,
1185 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1188 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1191 SWIG_CSharpSetPendingExceptionArgument(
1192 SWIG_CSharpArgumentNullException,
1193 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1196 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1199 shape.SetStrokeGradient(gradient);
1201 CALL_CATCH_EXCEPTION(0);
1207 SWIGEXPORT void *SWIGSTDCALL
1208 CSharp_Dali_Shapep_GetStrokeGradient(char *pShape) {
1209 Dali::CanvasRenderer::Shape shape;
1210 Dali::CanvasRenderer::Gradient gradient;
1213 SWIG_CSharpSetPendingExceptionArgument(
1214 SWIG_CSharpArgumentNullException,
1215 "Attempt to dereference null Dali::CanvasRenderer::Shape", 0);
1218 shape = *(Dali::CanvasRenderer::Shape *)pShape;
1222 gradient = shape.GetStrokeGradient();
1224 CALL_CATCH_EXCEPTION(nullptr);
1227 return new Dali::CanvasRenderer::Gradient(
1228 (const Dali::CanvasRenderer::Gradient &)gradient);
1231 // Dali::CanvasRenderer::DrawableGroup Wrapper
1233 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_DrawableGroup_New() {
1234 Dali::CanvasRenderer::DrawableGroup drawableGroup;
1238 drawableGroup = Dali::CanvasRenderer::DrawableGroup::New();
1240 CALL_CATCH_EXCEPTION(0);
1243 return new Dali::CanvasRenderer::DrawableGroup(
1244 (const Dali::CanvasRenderer::DrawableGroup &)drawableGroup);
1247 SWIGEXPORT bool SWIGSTDCALL
1248 CSharp_Dali_DrawableGroup_AddDrawable(char *pDrawableGroup, char *pDrawable) {
1249 Dali::CanvasRenderer::DrawableGroup drawableGroup;
1250 Dali::CanvasRenderer::Drawable drawable;
1253 if (!pDrawableGroup) {
1254 SWIG_CSharpSetPendingExceptionArgument(
1255 SWIG_CSharpArgumentNullException,
1256 "Attempt to dereference null Dali::CanvasRenderer::DrawableGroup", 0);
1259 drawableGroup = *(Dali::CanvasRenderer::DrawableGroup *)pDrawableGroup;
1262 SWIG_CSharpSetPendingExceptionArgument(
1263 SWIG_CSharpArgumentNullException,
1264 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
1267 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
1270 drawableGroup.AddDrawable(drawable);
1272 CALL_CATCH_EXCEPTION(0);
1278 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_DrawableGroup_RemoveDrawable(
1279 char *pDrawableGroup, char *pDrawable) {
1280 Dali::CanvasRenderer::DrawableGroup drawableGroup;
1281 Dali::CanvasRenderer::Drawable drawable;
1284 if (!pDrawableGroup) {
1285 SWIG_CSharpSetPendingExceptionArgument(
1286 SWIG_CSharpArgumentNullException,
1287 "Attempt to dereference null Dali::CanvasRenderer::DrawableGroup", 0);
1290 drawableGroup = *(Dali::CanvasRenderer::DrawableGroup *)pDrawableGroup;
1293 SWIG_CSharpSetPendingExceptionArgument(
1294 SWIG_CSharpArgumentNullException,
1295 "Attempt to dereference null Dali::CanvasRenderer::Drawable", 0);
1298 drawable = *(Dali::CanvasRenderer::Drawable *)pDrawable;
1301 drawableGroup.RemoveDrawable(drawable);
1303 CALL_CATCH_EXCEPTION(0);
1309 SWIGEXPORT bool SWIGSTDCALL
1310 CSharp_Dali_DrawableGroup_RemoveAllDrawables(char *pDrawableGroup) {
1311 Dali::CanvasRenderer::DrawableGroup drawableGroup;
1312 bool result = false;
1314 if (!pDrawableGroup) {
1315 SWIG_CSharpSetPendingExceptionArgument(
1316 SWIG_CSharpArgumentNullException,
1317 "Attempt to dereference null Dali::CanvasRenderer::DrawableGroup", 0);
1320 drawableGroup = *(Dali::CanvasRenderer::DrawableGroup *)pDrawableGroup;
1324 result = drawableGroup.RemoveAllDrawables();
1326 CALL_CATCH_EXCEPTION(0);
1332 // Dali::CanvasRenderer::Gradient Wrapper
1334 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Gradient_SetColorStops(
1335 char *pGradient, float *pStops, unsigned int stopsLength) {
1336 Dali::CanvasRenderer::Gradient gradient;
1339 SWIG_CSharpSetPendingExceptionArgument(
1340 SWIG_CSharpArgumentNullException,
1341 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1344 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1347 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException,
1348 "Stops is null", 0);
1354 Dali::CanvasRenderer::Gradient::ColorStops stops;
1355 for (unsigned int count = 0; count < stopsLength; count++) {
1356 Dali::CanvasRenderer::Gradient::ColorStop stop;
1357 stop.offset = pStops[count * 5];
1358 stop.color = Vector4(pStops[(count * 5) + 1], pStops[(count * 5) + 2],
1359 pStops[(count * 5) + 3], pStops[(count * 5) + 4]);
1360 stops.PushBack(stop);
1362 gradient.SetColorStops(stops);
1364 CALL_CATCH_EXCEPTION();
1368 SWIGEXPORT unsigned int SWIGSTDCALL
1369 CSharp_Dali_Gradient_GetColorStopsCount(char *pGradient) {
1370 Dali::CanvasRenderer::Gradient gradient;
1371 unsigned int result = 0;
1374 SWIG_CSharpSetPendingExceptionArgument(
1375 SWIG_CSharpArgumentNullException,
1376 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1379 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1383 Dali::CanvasRenderer::Gradient::ColorStops colorStops =
1384 gradient.GetColorStops();
1385 result = colorStops.Size();
1387 CALL_CATCH_EXCEPTION(0);
1393 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Gradient_GetColorStopsOffsetIndexOf(
1394 char *pGradient, unsigned int index) {
1395 Dali::CanvasRenderer::Gradient gradient;
1396 float result = 0.0f;
1399 SWIG_CSharpSetPendingExceptionArgument(
1400 SWIG_CSharpArgumentNullException,
1401 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1404 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1408 Dali::CanvasRenderer::Gradient::ColorStops colorStops =
1409 gradient.GetColorStops();
1410 if (index >= colorStops.Size()) {
1411 throw std::invalid_argument("invalid index");
1413 result = colorStops[index].offset;
1415 CALL_CATCH_EXCEPTION(0.0f);
1421 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_Gradient_GetColorStopsColorIndexOf(
1422 char *pGradient, unsigned int index) {
1423 Dali::CanvasRenderer::Gradient gradient;
1424 Dali::Vector4 result;
1427 SWIG_CSharpSetPendingExceptionArgument(
1428 SWIG_CSharpArgumentNullException,
1429 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1432 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1436 Dali::CanvasRenderer::Gradient::ColorStops colorStops =
1437 gradient.GetColorStops();
1438 if (index >= colorStops.Size()) {
1439 throw std::invalid_argument("invalid index");
1441 result = colorStops[index].color;
1443 CALL_CATCH_EXCEPTION(nullptr);
1446 return new Dali::Vector4((const Dali::Vector4 &)result);
1449 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Gradient_SetSpread(char *pGradient,
1451 Dali::CanvasRenderer::Gradient gradient;
1454 SWIG_CSharpSetPendingExceptionArgument(
1455 SWIG_CSharpArgumentNullException,
1456 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1459 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1464 static_cast<Dali::CanvasRenderer::Gradient::Spread>(spread));
1466 CALL_CATCH_EXCEPTION();
1470 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Gradient_GetSpread(char *pGradient) {
1471 Dali::CanvasRenderer::Gradient gradient;
1472 Dali::CanvasRenderer::Gradient::Spread result;
1475 SWIG_CSharpSetPendingExceptionArgument(
1476 SWIG_CSharpArgumentNullException,
1477 "Attempt to dereference null Dali::CanvasRenderer::Gradient", 0);
1480 gradient = *(Dali::CanvasRenderer::Gradient *)pGradient;
1484 result = gradient.GetSpread();
1486 CALL_CATCH_EXCEPTION(0);
1492 // Dali::CanvasRenderer::LinearGradient Wrapper
1494 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_LinearGradient_New() {
1495 Dali::CanvasRenderer::LinearGradient linearGradient;
1499 linearGradient = Dali::CanvasRenderer::LinearGradient::New();
1501 CALL_CATCH_EXCEPTION(0);
1504 return new Dali::CanvasRenderer::LinearGradient(
1505 (const Dali::CanvasRenderer::LinearGradient &)linearGradient);
1508 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_LinearGradient_SetBounds(
1509 char *pLinearGradient, void *pFirstPoint, void *pSecondPoint) {
1510 Dali::CanvasRenderer::LinearGradient linearGradient;
1511 bool result = false;
1513 if (!pLinearGradient) {
1514 SWIG_CSharpSetPendingExceptionArgument(
1515 SWIG_CSharpArgumentNullException,
1516 "Attempt to dereference null Dali::CanvasRenderer::LinearGradient", 0);
1519 linearGradient = *(Dali::CanvasRenderer::LinearGradient *)pLinearGradient;
1522 SWIG_CSharpSetPendingExceptionArgument(
1523 SWIG_CSharpArgumentNullException,
1524 "Attempt to dereference null Dali::Vector2", 0);
1528 if (!pSecondPoint) {
1529 SWIG_CSharpSetPendingExceptionArgument(
1530 SWIG_CSharpArgumentNullException,
1531 "Attempt to dereference null Dali::Vector2", 0);
1537 result = linearGradient.SetBounds(*(Dali::Vector2 *)pFirstPoint,
1538 *(Dali::Vector2 *)pSecondPoint);
1540 CALL_CATCH_EXCEPTION(false);
1545 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_LinearGradient_GetBounds(
1546 char *pLinearGradient, void *pFirstPoint, void *pSecondPoint) {
1547 Dali::CanvasRenderer::LinearGradient linearGradient;
1548 bool result = false;
1550 if (!pLinearGradient) {
1551 SWIG_CSharpSetPendingExceptionArgument(
1552 SWIG_CSharpArgumentNullException,
1553 "Attempt to dereference null Dali::CanvasRenderer::LinearGradient", 0);
1556 linearGradient = *(Dali::CanvasRenderer::LinearGradient *)pLinearGradient;
1559 SWIG_CSharpSetPendingExceptionArgument(
1560 SWIG_CSharpArgumentNullException,
1561 "Attempt to dereference null Dali::Vector2", 0);
1565 if (!pSecondPoint) {
1566 SWIG_CSharpSetPendingExceptionArgument(
1567 SWIG_CSharpArgumentNullException,
1568 "Attempt to dereference null Dali::Vector2", 0);
1574 result = linearGradient.GetBounds(*(Dali::Vector2 *)pFirstPoint,
1575 *(Dali::Vector2 *)pSecondPoint);
1577 CALL_CATCH_EXCEPTION(false);
1582 // Dali::CanvasRenderer::RadialGradient Wrapper
1584 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_RadialGradient_New() {
1585 Dali::CanvasRenderer::RadialGradient radialGradient;
1589 radialGradient = Dali::CanvasRenderer::RadialGradient::New();
1591 CALL_CATCH_EXCEPTION(0);
1594 return new Dali::CanvasRenderer::RadialGradient(
1595 (const Dali::CanvasRenderer::RadialGradient &)radialGradient);
1598 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_RadialGradient_SetBounds(
1599 char *pRadialGradient, void *pCenterPoint, float radius) {
1600 Dali::CanvasRenderer::RadialGradient radialGradient;
1601 bool result = false;
1603 if (!pRadialGradient) {
1604 SWIG_CSharpSetPendingExceptionArgument(
1605 SWIG_CSharpArgumentNullException,
1606 "Attempt to dereference null Dali::CanvasRenderer::RadialGradient", 0);
1609 radialGradient = *(Dali::CanvasRenderer::RadialGradient *)pRadialGradient;
1611 if (!pCenterPoint) {
1612 SWIG_CSharpSetPendingExceptionArgument(
1613 SWIG_CSharpArgumentNullException,
1614 "Attempt to dereference null Dali::Vector2", 0);
1620 result = radialGradient.SetBounds(*(Dali::Vector2 *)pCenterPoint, radius);
1622 CALL_CATCH_EXCEPTION(false);
1627 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_RadialGradient_GetBounds(
1628 char *pRadialGradient, void *pCenterPoint, void *radius) {
1629 Dali::CanvasRenderer::RadialGradient radialGradient;
1630 bool result = false;
1632 if (!pRadialGradient) {
1633 SWIG_CSharpSetPendingExceptionArgument(
1634 SWIG_CSharpArgumentNullException,
1635 "Attempt to dereference null Dali::CanvasRenderer::RadialGradient", 0);
1638 radialGradient = *(Dali::CanvasRenderer::RadialGradient *)pRadialGradient;
1640 if (!pCenterPoint) {
1641 SWIG_CSharpSetPendingExceptionArgument(
1642 SWIG_CSharpArgumentNullException,
1643 "Attempt to dereference null Dali::Vector2", 0);
1649 result = radialGradient.GetBounds(*(Dali::Vector2 *)pCenterPoint,
1652 CALL_CATCH_EXCEPTION(false);