2 * Copyright(c) 2019 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.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
24 /// An Adaptor object is used to initialize and control how Dali runs.
26 /// It provides the lifecycle interface that allows the application
27 /// writer to provide their own main loop and other platform related
30 /// The Adaptor class provides a means for initialising the resources required by the Dali::Core.
32 /// When dealing with platform events, the application writer must ensure that DALi is called in a
33 /// thread-safe manner.
35 /// As soon as the Adaptor class is created and started, the application writer can initialise their
36 /// view objects straight away or as required by the main loop they intend to use (there is no
37 /// need to wait for an initialize signal as per the Tizen.NUI.Application class).
40 /// <since_tizen> 4 </since_tizen>
41 [Obsolete("Deprecated in API8, will be removed in API10. This is not used anymore, please do not use.")]
42 public class Adaptor : Disposable
44 private static readonly Adaptor instance = Adaptor.Get();
46 internal Adaptor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
51 /// Returns a reference to the instance of the adaptor used by the current thread.
53 /// <remarks>The adaptor has been initialized. This is only valid in the main thread.</remarks>
54 /// <since_tizen> 4 </since_tizen>
55 [Obsolete("Deprecated in API8, will be removed in API10. This is not used anymore, please do not use.")]
56 public static Adaptor Instance
65 /// Feeds a wheel event to the adaptor.
67 /// <param name="wheelEvent">The wheel event.</param>
68 /// <since_tizen> 4 </since_tizen>
69 [Obsolete("Deprecated in API8, will be removed in API10. This is not used anymore, please do not use.")]
70 public void FeedWheelEvent(Wheel wheelEvent)
72 Interop.Adaptor.FeedWheelEvent(SwigCPtr, Wheel.getCPtr(wheelEvent));
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 /// Feeds a key event to the adaptor.
79 /// <param name="keyEvent">The key event holding the key information.</param>
80 /// <since_tizen> 4 </since_tizen>
81 [Obsolete("Deprecated in API8, will be removed in API10. This is not used anymore, please do not use.")]
82 public void FeedKeyEvent(Key keyEvent)
84 Interop.Adaptor.FeedKeyEvent(SwigCPtr, Key.getCPtr(keyEvent));
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 internal static Adaptor Get()
90 Adaptor ret = new Adaptor(Interop.Adaptor.Get(), false);
91 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96 /// Sets the number of frames per render.
98 /// <param name="numberOfVSyncsPerRender">The number of vsyncs between successive renders.</param>
100 /// Suggest this is a power of two:
101 /// 1 - render each vsync frame.
102 /// 2 - render every other vsync frame.
103 /// 4 - render every fourth vsync frame.
104 /// 8 - render every eighth vsync frame.
106 internal void SetRenderRefreshRate(uint numberOfVSyncsPerRender)
108 Interop.Adaptor.SetRenderRefreshRate(SwigCPtr, numberOfVSyncsPerRender);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 /// <param name="swigCPtr"></param>
116 [Obsolete("Deprecated in API8, will be removed in API10. This is not used anymore, please do not use.")]
117 // This will not be public opened.
118 [EditorBrowsable(EditorBrowsableState.Never)]
119 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
121 Interop.Adaptor.DeleteAdaptor(swigCPtr);