manual nui merge 0.2.38
[platform/core/csapi/nui.git] / 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 using System;
32 using System.Runtime.InteropServices;
33
34
35     internal class GaussianBlurView : View {
36   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37
38   internal GaussianBlurView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.GaussianBlurView_SWIGUpcast(cPtr), cMemoryOwn) {
39     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40   }
41
42   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GaussianBlurView obj) {
43     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44   }
45
46   public override void Dispose() {
47     if (!Window.IsInstalled()) {
48       DisposeQueue.Instance.Add(this);
49       return;
50     }
51
52     lock(this) {
53       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
54         if (swigCMemOwn) {
55           swigCMemOwn = false;
56           NDalicPINVOKE.delete_GaussianBlurView(swigCPtr);
57         }
58         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
59       }
60       global::System.GC.SuppressFinalize(this);
61       base.Dispose();
62     }
63   }
64
65
66
67
68 public class FinishedEventArgs : EventArgs
69 {
70    private GaussianBlurView _gaussianBlurView;
71
72    public GaussianBlurView GaussianBlurView
73    {
74       get
75       {
76          return _gaussianBlurView;
77       }
78       set
79       {
80          _gaussianBlurView = value;
81       }
82    }
83 }
84
85   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
86   private delegate void FinishedEventCallbackDelegate(IntPtr application);
87   private DaliEventHandler<object,FinishedEventArgs> _gaussianFinishedEventHandler;
88   private FinishedEventCallbackDelegate _gaussianFinishedEventCallbackDelegate;
89
90   public event DaliEventHandler<object,FinishedEventArgs> Finished
91   {
92      add
93      {
94         lock(this)
95         {
96            // Restricted to only one listener
97            if (_gaussianFinishedEventHandler == null)
98            {
99               _gaussianFinishedEventHandler += value;
100
101               _gaussianFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
102               this.FinishedSignal().Connect(_gaussianFinishedEventCallbackDelegate);
103            }
104         }
105      }
106
107      remove
108      {
109         lock(this)
110         {
111            if (_gaussianFinishedEventHandler != null)
112            {
113               this.FinishedSignal().Disconnect(_gaussianFinishedEventCallbackDelegate);
114            }
115
116            _gaussianFinishedEventHandler -= value;
117         }
118      }
119   }
120
121   // Callback for GaussianBlurView FinishedSignal
122   private void OnFinished(IntPtr data)
123   {
124      FinishedEventArgs e = new FinishedEventArgs();
125
126      // Populate all members of "e" (FinishedEventArgs) with real data
127      e.GaussianBlurView = GaussianBlurView.GetGaussianBlurViewFromPtr(data);
128
129      if (_gaussianFinishedEventHandler != null)
130      {
131         //here we send all data to user event handlers
132         _gaussianFinishedEventHandler(this, e);
133      }
134   }
135
136  public static GaussianBlurView GetGaussianBlurViewFromPtr(global::System.IntPtr cPtr) {
137     GaussianBlurView ret = new GaussianBlurView(cPtr, false);
138     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139     return ret;
140   }
141
142
143   public GaussianBlurView () : this (NDalicPINVOKE.GaussianBlurView_New__SWIG_0(), true) {
144       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145
146   }
147   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) {
148       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149
150   }
151   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) {
152       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153
154   }
155   public GaussianBlurView(GaussianBlurView handle) : this(NDalicPINVOKE.new_GaussianBlurView__SWIG_1(GaussianBlurView.getCPtr(handle)), true) {
156     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157   }
158
159   public GaussianBlurView Assign(GaussianBlurView ZoomView) {
160     GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_Assign(swigCPtr, GaussianBlurView.getCPtr(ZoomView)), false);
161     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162     return ret;
163   }
164
165   public new static GaussianBlurView DownCast(BaseHandle handle) {
166     GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true);
167     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168     return ret;
169   }
170
171   public new void Add(View child) {
172     NDalicPINVOKE.GaussianBlurView_Add(swigCPtr, View.getCPtr(child));
173     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174   }
175
176   public new void Remove(View child) {
177     NDalicPINVOKE.GaussianBlurView_Remove(swigCPtr, View.getCPtr(child));
178     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179   }
180
181   public void Activate() {
182     NDalicPINVOKE.GaussianBlurView_Activate(swigCPtr);
183     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184   }
185
186   public void ActivateOnce() {
187     NDalicPINVOKE.GaussianBlurView_ActivateOnce(swigCPtr);
188     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189   }
190
191   public void Deactivate() {
192     NDalicPINVOKE.GaussianBlurView_Deactivate(swigCPtr);
193     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194   }
195
196   public void SetUserImageAndOutputRenderTarget(Image inputImage, FrameBufferImage outputRenderTarget) {
197     NDalicPINVOKE.GaussianBlurView_SetUserImageAndOutputRenderTarget(swigCPtr, Image.getCPtr(inputImage), FrameBufferImage.getCPtr(outputRenderTarget));
198     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199   }
200
201   public int GetBlurStrengthPropertyIndex() {
202     int ret = NDalicPINVOKE.GaussianBlurView_GetBlurStrengthPropertyIndex(swigCPtr);
203     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204     return ret;
205   }
206
207   public FrameBufferImage GetBlurredRenderTarget() {
208     FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.GaussianBlurView_GetBlurredRenderTarget(swigCPtr), true);
209     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210     return ret;
211   }
212
213   public new void SetBackgroundColor(Vector4 color) {
214     NDalicPINVOKE.GaussianBlurView_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
215     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216   }
217
218   public new Vector4 GetBackgroundColor() {
219     Vector4 ret = new Vector4(NDalicPINVOKE.GaussianBlurView_GetBackgroundColor(swigCPtr), true);
220     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221     return ret;
222   }
223
224   public GaussianBlurViewSignal FinishedSignal() {
225     GaussianBlurViewSignal ret = new GaussianBlurViewSignal(NDalicPINVOKE.GaussianBlurView_FinishedSignal(swigCPtr), false);
226     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227     return ret;
228   }
229
230 }
231
232 }