Merge "DALi C# Tizen GBS build: - currently GBS full auto building is impossible...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / automatic / csharp / Image.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10
11 namespace Dali {
12
13 using System;
14 using System.Runtime.InteropServices;
15
16
17 public class Image : BaseHandle {
18   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19
20   internal Image(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Image_SWIGUpcast(cPtr), cMemoryOwn) {
21     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22   }
23
24   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Image obj) {
25     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26   }
27
28   ~Image() {
29     Dispose();
30   }
31
32   public override void Dispose() {
33     lock(this) {
34       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
35         if (swigCMemOwn) {
36           swigCMemOwn = false;
37           NDalicPINVOKE.delete_Image(swigCPtr);
38         }
39         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40       }
41       global::System.GC.SuppressFinalize(this);
42       base.Dispose();
43     }
44   }
45
46
47
48 /**
49   * @brief Event arguments that passed via Uploaded signal
50   *
51   */
52 public class UploadedEventArgs : EventArgs
53 {
54    private Image _image;
55    /**
56      * @brief Image - is the image data that gets uploaded to GL.
57      *
58      */
59    public Image Image
60    {
61       get
62       {
63          return _image;
64       }
65       set
66       {
67          _image = value;
68       }
69    }
70 }
71
72   [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73   private delegate void UploadedEventCallbackDelegate(IntPtr image);
74   private DaliEventHandler<object,UploadedEventArgs> _imageUploadedEventHandler;
75   private UploadedEventCallbackDelegate _imageUploadedEventCallbackDelegate;
76
77   /**
78     * @brief Event for Uploaded signal which can be used to subscribe/unsubscribe the event handler
79     * (in the type of UploadedEventHandler-DaliEventHandler<object,UploadedEventArgs>) 
80     * provided by the user. Uploaded signal is emitted when the image data gets uploaded to GL.
81     */
82   public event DaliEventHandler<object,UploadedEventArgs> Uploaded
83   {
84      add
85      {
86         lock(this)
87         {
88            // Restricted to only one listener
89            if (_imageUploadedEventHandler == null)
90            {
91               _imageUploadedEventHandler += value;
92
93               _imageUploadedEventCallbackDelegate = new UploadedEventCallbackDelegate(OnUploaded);
94               this.UploadedSignal().Connect(_imageUploadedEventCallbackDelegate);
95            }
96         }
97      }
98
99      remove
100      {
101         lock(this)
102         {
103            if (_imageUploadedEventHandler != null)
104            {
105               this.UploadedSignal().Disconnect(_imageUploadedEventCallbackDelegate);
106            }
107
108            _imageUploadedEventHandler -= value;
109         }
110      }
111   }
112
113   // Callback for Image UploadedSignal
114   private void OnUploaded(IntPtr data)
115   {
116      UploadedEventArgs e = new UploadedEventArgs();
117
118      // Populate all members of "e" (UploadedEventArgs) with real data
119      e.Image = Image.GetImageFromPtr(data);
120
121      if (_imageUploadedEventHandler != null)
122      {
123         //here we send all data to user event handlers
124         _imageUploadedEventHandler(this, e);
125      }
126   }
127
128
129 public static Image GetImageFromPtr(global::System.IntPtr cPtr) {
130     Image ret = new Image(cPtr, false);
131    if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132     return ret;
133   }
134
135
136   public Image() : this(NDalicPINVOKE.new_Image__SWIG_0(), true) {
137     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138   }
139
140   public Image(Image handle) : this(NDalicPINVOKE.new_Image__SWIG_1(Image.getCPtr(handle)), true) {
141     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142   }
143
144   public Image Assign(Image rhs) {
145     Image ret = new Image(NDalicPINVOKE.Image_Assign(swigCPtr, Image.getCPtr(rhs)), false);
146     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147     return ret;
148   }
149
150   public static Image DownCast(BaseHandle handle) {
151     Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true);
152     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153     return ret;
154   }
155
156   public uint GetWidth() {
157     uint ret = NDalicPINVOKE.Image_GetWidth(swigCPtr);
158     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159     return ret;
160   }
161
162   public uint GetHeight() {
163     uint ret = NDalicPINVOKE.Image_GetHeight(swigCPtr);
164     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165     return ret;
166   }
167
168   public ImageSignal UploadedSignal() {
169     ImageSignal ret = new ImageSignal(NDalicPINVOKE.Image_UploadedSignal(swigCPtr), false);
170     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171     return ret;
172   }
173
174 }
175
176 }