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