4bde8c3da8c12909bb7e49376679d10dba98bf65
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / GaussianBlurView.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 using Tizen.NUI.BaseComponents;
28
29 namespace Tizen.NUI
30 {
31
32     using System;
33     using System.Runtime.InteropServices;
34
35
36     internal class GaussianBlurView : View
37     {
38         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
39
40         internal GaussianBlurView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.GaussianBlurView_SWIGUpcast(cPtr), cMemoryOwn)
41         {
42             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43             // By default, we do not want the position to use the anchor point
44             PositionUsesAnchorPoint = false;
45         }
46
47         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GaussianBlurView obj)
48         {
49             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50         }
51
52         protected override void Dispose(DisposeTypes type)
53         {
54             if (disposed)
55             {
56                 return;
57             }
58
59             if (type == DisposeTypes.Explicit)
60             {
61                 //Called by User
62                 //Release your own managed resources here.
63                 //You should release all of your own disposable objects here.
64
65             }
66
67             //Release your own unmanaged resources here.
68             //You should not access any managed member here except static instance.
69             //because the execution order of Finalizes is non-deterministic.
70
71             if (swigCPtr.Handle != global::System.IntPtr.Zero)
72             {
73                 if (swigCMemOwn)
74                 {
75                     swigCMemOwn = false;
76                     NDalicPINVOKE.delete_GaussianBlurView(swigCPtr);
77                 }
78                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
79             }
80
81             base.Dispose(type);
82         }
83
84
85
86         public class FinishedEventArgs : EventArgs
87         {
88             private GaussianBlurView _gaussianBlurView;
89
90             public GaussianBlurView GaussianBlurView
91             {
92                 get
93                 {
94                     return _gaussianBlurView;
95                 }
96                 set
97                 {
98                     _gaussianBlurView = value;
99                 }
100             }
101         }
102
103         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
104         private delegate void FinishedEventCallbackDelegate(IntPtr application);
105         private DaliEventHandler<object, FinishedEventArgs> _gaussianFinishedEventHandler;
106         private FinishedEventCallbackDelegate _gaussianFinishedEventCallbackDelegate;
107
108         public event DaliEventHandler<object, FinishedEventArgs> Finished
109         {
110             add
111             {
112                 lock (this)
113                 {
114                     // Restricted to only one listener
115                     if (_gaussianFinishedEventHandler == null)
116                     {
117                         _gaussianFinishedEventHandler += value;
118
119                         _gaussianFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
120                         this.FinishedSignal().Connect(_gaussianFinishedEventCallbackDelegate);
121                     }
122                 }
123             }
124
125             remove
126             {
127                 lock (this)
128                 {
129                     if (_gaussianFinishedEventHandler != null)
130                     {
131                         this.FinishedSignal().Disconnect(_gaussianFinishedEventCallbackDelegate);
132                     }
133
134                     _gaussianFinishedEventHandler -= value;
135                 }
136             }
137         }
138
139         // Callback for GaussianBlurView FinishedSignal
140         private void OnFinished(IntPtr data)
141         {
142             FinishedEventArgs e = new FinishedEventArgs();
143
144             // Populate all members of "e" (FinishedEventArgs) with real data
145             e.GaussianBlurView = Registry.GetManagedBaseHandleFromNativePtr(data) as GaussianBlurView;
146
147             if (_gaussianFinishedEventHandler != null)
148             {
149                 //here we send all data to user event handlers
150                 _gaussianFinishedEventHandler(this, e);
151             }
152         }
153
154         public GaussianBlurView() : this(NDalicPINVOKE.GaussianBlurView_New__SWIG_0(), true)
155         {
156             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157
158         }
159         public GaussianBlurView(uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale, bool blurUserImage) : this(NDalicPINVOKE.GaussianBlurView_New__SWIG_1(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale, blurUserImage), true)
160         {
161             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162
163         }
164         public GaussianBlurView(uint numSamples, float blurBellCurveWidth, PixelFormat renderTargetPixelFormat, float downsampleWidthScale, float downsampleHeightScale) : this(NDalicPINVOKE.GaussianBlurView_New__SWIG_2(numSamples, blurBellCurveWidth, (int)renderTargetPixelFormat, downsampleWidthScale, downsampleHeightScale), true)
165         {
166             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167
168         }
169         public GaussianBlurView(GaussianBlurView handle) : this(NDalicPINVOKE.new_GaussianBlurView__SWIG_1(GaussianBlurView.getCPtr(handle)), true)
170         {
171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172         }
173
174         public GaussianBlurView Assign(GaussianBlurView ZoomView)
175         {
176             GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_Assign(swigCPtr, GaussianBlurView.getCPtr(ZoomView)), false);
177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178             return ret;
179         }
180
181         public new static GaussianBlurView DownCast(BaseHandle handle)
182         {
183             GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true);
184             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185             return ret;
186         }
187
188         public new void Add(View child)
189         {
190             NDalicPINVOKE.GaussianBlurView_Add(swigCPtr, View.getCPtr(child));
191             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192         }
193
194         public new void Remove(View child)
195         {
196             NDalicPINVOKE.GaussianBlurView_Remove(swigCPtr, View.getCPtr(child));
197             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198         }
199
200         public void Activate()
201         {
202             NDalicPINVOKE.GaussianBlurView_Activate(swigCPtr);
203             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204         }
205
206         public void ActivateOnce()
207         {
208             NDalicPINVOKE.GaussianBlurView_ActivateOnce(swigCPtr);
209             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210         }
211
212         public void Deactivate()
213         {
214             NDalicPINVOKE.GaussianBlurView_Deactivate(swigCPtr);
215             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216         }
217
218         public void SetUserImageAndOutputRenderTarget(Image inputImage, FrameBufferImage outputRenderTarget)
219         {
220             NDalicPINVOKE.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Image.getCPtr(inputImage), FrameBufferImage.getCPtr(outputRenderTarget));
221             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222         }
223
224         public int GetBlurStrengthPropertyIndex()
225         {
226             int ret = NDalicPINVOKE.GaussianBlurView_GetBlurStrengthPropertyIndex(swigCPtr);
227             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228             return ret;
229         }
230
231         public FrameBufferImage GetBlurredRenderTarget()
232         {
233             FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.GaussianBlurView_GetBlurredRenderTarget(swigCPtr), true);
234             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235             return ret;
236         }
237
238         public new void SetBackgroundColor(Vector4 color)
239         {
240             NDalicPINVOKE.GaussianBlurView_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
241             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242         }
243
244         public new Vector4 GetBackgroundColor()
245         {
246             Vector4 ret = new Vector4(NDalicPINVOKE.GaussianBlurView_GetBackgroundColor(swigCPtr), true);
247             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248             return ret;
249         }
250
251         public GaussianBlurViewSignal FinishedSignal()
252         {
253             GaussianBlurViewSignal ret = new GaussianBlurViewSignal(NDalicPINVOKE.GaussianBlurView_FinishedSignal(swigCPtr), false);
254             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255             return ret;
256         }
257
258     }
259
260 }