[NUI] set default theme for TV profile
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Application / NUIApplication.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 #if !PROFILE_TV
18 #define ExternalThemeEnabled
19 #endif
20
21 using System;
22 using System.ComponentModel;
23 using System.Diagnostics.CodeAnalysis;
24 using System.Threading;
25 using System.Reflection;
26 using Tizen.Applications;
27 using Tizen.Applications.CoreBackend;
28 using Tizen.NUI.Xaml;
29
30 namespace Tizen.NUI
31 {
32
33     /// <summary>
34     /// Represents an application that have a UI screen. The NUIApplication class has a default stage.
35     /// </summary>
36     /// <since_tizen> 3 </since_tizen>
37     public class NUIApplication : CoreApplication
38     {
39         /// <summary>
40         /// The instance of ResourceManager.
41         /// </summary>
42         private static System.Resources.ResourceManager resourceManager = null;
43         private static string currentLoadedXaml = null;
44
45         /// <summary>
46         /// The border window
47         /// </summary>
48         private bool borderEnabled = false;
49         private IBorderInterface borderInterface = null;
50
51         /// <summary>
52         /// Xaml loaded delegate.
53         /// </summary>
54         [EditorBrowsable(EditorBrowsableState.Never)]
55         public delegate void XamlLoadedHandler(string xamlName);
56
57         static NUIApplication()
58         {
59             Registry.Instance.SavedApplicationThread = Thread.CurrentThread;
60         }
61
62         /// <summary>
63         /// The default constructor.
64         /// </summary>
65         /// <since_tizen> 3 </since_tizen>
66         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
67         public NUIApplication() : base(new NUICoreBackend())
68         {
69         }
70
71         /// <summary>
72         /// The constructor with window size and position.
73         /// </summary>
74         /// <param name="windowSize">The window size.</param>
75         /// <param name="windowPosition">The window position.</param>
76         /// <since_tizen> 5 </since_tizen>
77         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
78         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
79         [EditorBrowsable(EditorBrowsableState.Never)]
80         public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
81         {
82         }
83
84         /// <summary>
85         /// The constructor with a stylesheet.
86         /// </summary>
87         /// <param name="styleSheet">The styleSheet url.</param>
88         /// <since_tizen> 3 </since_tizen>
89         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
90         public NUIApplication(string styleSheet) : base(new NUICoreBackend(styleSheet))
91         {
92         }
93
94         /// <summary>
95         /// The constructor with a stylesheet, window size, and position.
96         /// </summary>
97         /// <param name="styleSheet">The styleSheet URL.</param>
98         /// <param name="windowSize">The window size.</param>
99         /// <param name="windowPosition">The window position.</param>
100         /// <since_tizen> 5 </since_tizen>
101         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
102         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
103         [EditorBrowsable(EditorBrowsableState.Never)]
104         public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, WindowMode.Opaque, windowSize, windowPosition))
105         {
106         }
107
108         /// <summary>
109         /// The constructor with a stylesheet and window mode.
110         /// </summary>
111         /// <param name="styleSheet">The styleSheet url.</param>
112         /// <param name="windowMode">The windowMode.</param>
113         /// <since_tizen> 3 </since_tizen>
114         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
115         public NUIApplication(string styleSheet, WindowMode windowMode) : base(new NUICoreBackend(styleSheet, windowMode))
116         {
117         }
118
119         /// <summary>
120         /// The constructor with a stylesheet, window mode, window size, and position.
121         /// </summary>
122         /// <param name="styleSheet">The styleSheet URL.</param>
123         /// <param name="windowMode">The windowMode.</param>
124         /// <param name="windowSize">The window size.</param>
125         /// <param name="windowPosition">The window position.</param>
126         /// <since_tizen> 5 </since_tizen>
127         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
128         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
129         [EditorBrowsable(EditorBrowsableState.Never)]
130         public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
131         {
132         }
133
134         /// <summary>
135         /// Internal inhouse constructor with Graphics Backend Type
136         /// </summary>
137         /// <param name="backend"></param>
138         /// <param name="windowMode"></param>
139         /// <param name="windowSize"></param>
140         /// <param name="windowPosition"></param>
141         /// <param name="styleSheet"></param>
142         /// InhouseAPI, this could be opened in NextTizen
143         [Obsolete("Do not use! This will be deprecated!")]
144         [EditorBrowsable(EditorBrowsableState.Never)]
145         public NUIApplication(Graphics.BackendType backend, WindowMode windowMode = WindowMode.Opaque, Size2D windowSize = null, Position2D windowPosition = null, string styleSheet = "") : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
146         {
147             //windowMode and styleSheet will be added later. currently it's not working as expected.
148             Graphics.Backend = backend;
149             Tizen.Log.Error("NUI", "Plaese DO NOT set graphical backend type with this constructor! This will give no effect!");
150         }
151
152         /// <summary>
153         /// The constructor with theme option.
154         /// </summary>
155         /// <param name="option">The theme option.</param>
156         [EditorBrowsable(EditorBrowsableState.Never)]
157         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
158         public NUIApplication(ThemeOptions option) : base(new NUICoreBackend())
159         {
160             ApplyThemeOption(option);
161         }
162
163         /// <summary>
164         /// The constructor with window size and position and theme option.
165         /// </summary>
166         /// <param name="windowSize">The window size.</param>
167         /// <param name="windowPosition">The window position.</param>
168         /// <param name="option">The theme option.</param>
169         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
170         [EditorBrowsable(EditorBrowsableState.Never)]
171         public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
172         {
173             ApplyThemeOption(option);
174         }
175
176         /// <summary>
177         /// The constructor with a stylesheet, window mode and default window type.
178         /// It is the only way to create an IME window.
179         /// </summary>
180         /// <param name="styleSheet">The styleSheet URL.</param>
181         /// <param name="windowMode">The windowMode.</param>
182         /// <param name="type">The default window type.</param>
183         /// <since_tizen> 9 </since_tizen>
184         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
185         public NUIApplication(string styleSheet, WindowMode windowMode, WindowType type) : base(new NUICoreBackend(styleSheet, windowMode, type))
186         {
187             ExternalThemeManager.Initialize();
188         }
189
190         /// <summary>
191         /// The constructor with a stylesheet, size, position, boderInterface and window mode
192         /// </summary>
193         /// <param name="styleSheet">The styleSheet URL.</param>
194         /// <param name="windowSize">The window size.</param>
195         /// <param name="windowPosition">The window position.</param>
196         /// <param name="borderInterface"><see cref="Tizen.NUI.IBorderInterface"/>If borderInterface is null, defaultBorder is enabled.</param>
197         /// <param name="windowMode">The windowMode.</param>
198         [EditorBrowsable(EditorBrowsableState.Never)]
199         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
200         public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition, IBorderInterface borderInterface, WindowMode windowMode = WindowMode.Opaque) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition))
201         {
202             EnableBorder(borderInterface);
203         }
204
205         /// <summary>
206         /// The constructor with theme option and borderInterface.
207         /// </summary>
208         /// <param name="option">The theme option.</param>
209         /// <param name="borderInterface"><see cref="Tizen.NUI.IBorderInterface"/>If borderInterface is null, defaultBorder is enabled.</param>
210         [EditorBrowsable(EditorBrowsableState.Never)]
211         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
212         public NUIApplication(ThemeOptions option, IBorderInterface borderInterface) : base(new NUICoreBackend())
213         {
214             EnableBorder(borderInterface);
215             ApplyThemeOption(option);
216         }
217
218         /// <summary>
219         /// The constructor with window size, position, theme option and borderInterface.
220         /// </summary>
221         /// <param name="windowSize">The window size.</param>
222         /// <param name="windowPosition">The window position.</param>
223         /// <param name="option">The theme option.</param>
224         /// <param name="borderInterface"><see cref="Tizen.NUI.IBorderInterface"/>If borderInterface is null, defaultBorder is enabled.</param>
225         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
226         [EditorBrowsable(EditorBrowsableState.Never)]
227         public NUIApplication(Size2D windowSize, Position2D windowPosition, ThemeOptions option, IBorderInterface borderInterface) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition))
228         {
229             EnableBorder(borderInterface);
230             ApplyThemeOption(option);
231         }
232
233         /// <summary>
234         /// The constructor with a stylesheet, window mode, coretask
235         /// </summary>
236         /// <note>
237         /// There is the UI thread feature.
238         /// UI thread is an additional thread that an Application object creates. The thread is for UI events.
239         /// To enable the UI Thread, you have to pass CoreTask object using this contructor.
240         /// When the UI thread feature is enabled, The methods of CoreTask are emitted on the main thread,
241         /// and the NUIApplication's events are emitted on the UI thread.
242         /// If you want to handle windows or actors in cases like when the memory level of the device is low, you have to use the NUIApplication events, not the CoreTask methods.
243         /// The CoreTask is not for handling GUI.
244         /// Callbacks of the all events in NUIApplication except the CoreTask are emitted on the UI thread.
245         /// </note>
246         /// <param name="styleSheet">The styleSheet URL.</param>
247         /// <param name="windowMode">The windowMode.</param>
248         /// <param name="task">True If app creates a UI Thread</param>
249         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
250         [EditorBrowsable(EditorBrowsableState.Never)]
251         public NUIApplication(string styleSheet, WindowMode windowMode, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode), task)
252         {
253         }
254
255         /// <summary>
256         /// The constructor with a stylesheet, window mode, window size, position, coretask
257         /// </summary>
258         /// <param name="styleSheet">The styleSheet URL.</param>
259         /// <param name="windowMode">The windowMode.</param>
260         /// <param name="windowSize">The window size.</param>
261         /// <param name="windowPosition">The window position.</param>
262         /// <param name="task">True If app creates a UI Thread</param>
263         [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")]
264         [EditorBrowsable(EditorBrowsableState.Never)]
265         public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition, CoreTask task) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition), task)
266         {
267         }
268
269         /// <summary>
270         /// Occurs whenever the application is resumed.
271         /// </summary>
272         /// <since_tizen> 4 </since_tizen>
273         public event EventHandler Resumed;
274
275         /// <summary>
276         /// Occurs whenever the application is paused.
277         /// </summary>
278         /// <since_tizen> 4 </since_tizen>
279         public event EventHandler Paused;
280
281         /// <summary>
282         /// Xaml loaded event.
283         /// </summary>
284         [EditorBrowsable(EditorBrowsableState.Never)]
285         public static event XamlLoadedHandler XamlLoaded;
286
287         /// <summary>
288         /// Enumeration for deciding whether a NUI application window is opaque or transparent.
289         /// </summary>
290         /// <since_tizen> 3 </since_tizen>
291         public enum WindowMode
292         {
293             /// <summary>
294             /// Opaque
295             /// </summary>
296             /// <since_tizen> 3 </since_tizen>
297             Opaque = 0,
298             /// <summary>
299             /// Transparent
300             /// </summary>
301             /// <since_tizen> 3 </since_tizen>
302             Transparent = 1
303         }
304
305         /// <summary>
306         /// Enumeration for theme options of the NUIApplication.
307         /// </summary>
308         [Flags]
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public enum ThemeOptions : int
311         {
312             /// <summary>
313             /// No option specified.
314             /// </summary>
315             [EditorBrowsable(EditorBrowsableState.Never)]
316             None = 0,
317
318             /// <summary>
319             /// Enable platform theme.
320             /// When this option is on, all views in the NUIApplication is affected by platform theme (e.g. light/dark).
321             /// </summary>
322             [EditorBrowsable(EditorBrowsableState.Never)]
323             PlatformThemeEnabled = 1 << 0,
324
325             /// <summary>
326             /// Sets the default value of View.ThemeChangeSensitive.
327             /// when this option is on, all views are made sensitive on theme changing by default.
328             /// </summary>
329             [EditorBrowsable(EditorBrowsableState.Never)]
330             ThemeChangeSensitive = 1 << 1,
331         };
332
333         /// <summary>
334         /// Current loaded xaml's full name.
335         /// </summary>
336         [EditorBrowsable(EditorBrowsableState.Never)]
337         public static string CurrentLoadedXaml
338         {
339             get
340             {
341                 return currentLoadedXaml;
342             }
343             set
344             {
345                 if (currentLoadedXaml != value)
346                 {
347                     currentLoadedXaml = value;
348                     XamlLoaded?.Invoke(value);
349                 }
350             }
351         }
352
353         /// <summary>
354         /// ResourceManager to handle multilingual.
355         /// </summary>
356         /// <since_tizen> 4 </since_tizen>
357         public static System.Resources.ResourceManager MultilingualResourceManager
358         {
359             get
360             {
361                 return resourceManager;
362             }
363             set
364             {
365                 resourceManager = value;
366             }
367         }
368
369         /// <summary>
370         /// Gets the window instance.
371         /// </summary>
372         /// <since_tizen> 3 </since_tizen>
373         [Obsolete("Do not use! This will be deprecated!")]
374         [EditorBrowsable(EditorBrowsableState.Never)]
375         public Window Window
376         {
377             get
378             {
379                 return GetDefaultWindow();
380             }
381         }
382
383         /// <summary>
384         /// Gets the Application Id.
385         /// </summary>
386         /// <since_tizen> 6 </since_tizen>
387         [EditorBrowsable(EditorBrowsableState.Never)]
388         public string AppId
389         {
390             get
391             {
392                 return Tizen.Applications.Application.Current.ApplicationInfo.ApplicationId;
393             }
394         }
395
396         /// <summary>
397         /// Gets the default window.
398         /// </summary>
399         /// <returns>The default Window.</returns>
400         /// <since_tizen> 6 </since_tizen>
401         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
402         [EditorBrowsable(EditorBrowsableState.Never)]
403         public static Window GetDefaultWindow()
404         {
405             return Window.Instance;
406         }
407
408         internal Application ApplicationHandle
409         {
410             get
411             {
412                 return ((NUICoreBackend)this.Backend).ApplicationHandle;
413             }
414         }
415
416         /// <summary>
417         /// Register the assembly to XAML.
418         /// </summary>
419         /// <since_tizen> 5 </since_tizen>
420         public static void RegisterAssembly(Assembly assembly)
421         {
422             XamlParser.s_assemblies.Add(assembly);
423         }
424
425         /// <summary>
426         /// Runs the NUIApplication.
427         /// </summary>
428         /// <param name="args">Arguments from commandline.</param>
429         /// <since_tizen> 4 </since_tizen>
430         public override void Run(string[] args)
431         {
432             Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
433             Backend.AddEventHandler(EventType.Resumed, OnResume);
434             Backend.AddEventHandler(EventType.Paused, OnPause);
435             base.Run(args);
436         }
437
438         /// <summary>
439         /// Exits the NUIApplication.
440         /// </summary>
441         /// <since_tizen> 4 </since_tizen>
442         public override void Exit()
443         {
444             base.Exit();
445         }
446
447         /// <summary>
448         /// Ensures that the function passed in is called from the main loop when it is idle.
449         /// </summary>
450         /// <param name="func">The function to call</param>
451         /// <returns>true if added successfully, false otherwise</returns>
452         /// <since_tizen> 4 </since_tizen>
453         public bool AddIdle(System.Delegate func)
454         {
455             return ((NUICoreBackend)this.Backend).AddIdle(func);
456         }
457
458         /// <summary>
459         /// Sets the number of frames per render.
460         /// </summary>
461         /// <param name="numberOfVSyncsPerRender">The number of vsyncs between successive renders.</param>
462         /// <remarks>
463         /// Suggest this is a power of two:
464         /// 1 - render each vsync frame.
465         /// 2 - render every other vsync frame.
466         /// 4 - render every fourth vsync frame.
467         /// 8 - render every eighth vsync frame. <br />
468         /// For example, if an application runs on 60 FPS and SetRenderRefreshRate(2) is called, the frames per second will be changed to 30.
469         ///</remarks>
470         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
471         [EditorBrowsable(EditorBrowsableState.Never)]
472         public static void SetRenderRefreshRate(uint numberOfVSyncsPerRender)
473         {
474             Adaptor.Instance.SetRenderRefreshRate(numberOfVSyncsPerRender);
475         }
476
477         /// <summary>
478         /// Overrides this method if you want to handle behavior.
479         /// </summary>
480         /// <since_tizen> 3 </since_tizen>
481         protected override void OnLocaleChanged(LocaleChangedEventArgs e)
482         {
483             base.OnLocaleChanged(e);
484         }
485
486         /// <summary>
487         /// Overrides this method if you want to handle behavior.
488         /// </summary>
489         /// <since_tizen> 3 </since_tizen>
490         protected override void OnLowBattery(LowBatteryEventArgs e)
491         {
492             base.OnLowBattery(e);
493         }
494
495         /// <summary>
496         /// Overrides this method if you want to handle behavior.
497         /// </summary>
498         /// <since_tizen> 3 </since_tizen>
499         protected override void OnLowMemory(LowMemoryEventArgs e)
500         {
501             base.OnLowMemory(e);
502         }
503
504         /// <summary>
505         /// Overrides this method if you want to handle behavior.
506         /// </summary>
507         /// <since_tizen> 3 </since_tizen>
508         protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
509         {
510             base.OnRegionFormatChanged(e);
511         }
512
513         /// <summary>
514         /// Overrides this method if you want to handle behavior.
515         /// </summary>
516         /// <since_tizen> 3 </since_tizen>
517         protected override void OnTerminate()
518         {
519             base.OnTerminate();
520         }
521
522         /// <summary>
523         /// Overrides this method if you want to handle behavior.
524         /// </summary>
525         /// <since_tizen> 3 </since_tizen>
526         protected virtual void OnPause()
527         {
528             Paused?.Invoke(this, EventArgs.Empty);
529         }
530
531         /// <summary>
532         /// Overrides this method if you want to handle behavior.
533         /// </summary>
534         /// <since_tizen> 3 </since_tizen>
535         protected virtual void OnResume()
536         {
537             Resumed?.Invoke(this, EventArgs.Empty);
538         }
539
540         /// <summary>
541         /// Overrides this method if you want to handle behavior.
542         /// </summary>
543         /// <since_tizen> 3 </since_tizen>
544         protected virtual void OnPreCreate()
545         {
546             Tizen.Tracer.Begin("[NUI] OnPreCreate()");
547
548             if (borderEnabled)
549             {
550                 GetDefaultWindow().EnableBorder(borderInterface, new Window.BorderCloseDelegate(Exit));
551             }
552
553             Tizen.Tracer.End();
554         }
555
556         /// <summary>
557         /// Overrides this method if you want to handle behavior.
558         /// </summary>
559         /// <since_tizen> 3 </since_tizen>
560         protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
561         {
562             if (e != null)
563             {
564                 Log.Info("NUI", "OnAppControlReceived() is called! ApplicationId=" + e.ReceivedAppControl.ApplicationId);
565                 Log.Info("NUI", "CallerApplicationId=" + e.ReceivedAppControl.CallerApplicationId + "   IsReplyRequest=" + e.ReceivedAppControl.IsReplyRequest);
566             }
567             base.OnAppControlReceived(e);
568         }
569
570         /// <summary>
571         /// Overrides this method if you want to handle behavior.
572         /// </summary>
573         /// <since_tizen> 3 </since_tizen>
574         protected override void OnCreate()
575         {
576             Tizen.Tracer.Begin("[NUI] OnCreate()");
577
578             base.OnCreate();
579
580             Tizen.Tracer.End();
581         }
582
583         /// <summary>
584         /// This is used to improve application launch performance.
585         /// </summary>
586         [EditorBrowsable(EditorBrowsableState.Never)]
587         static public void Preload()
588         {
589             Interop.Application.PreInitialize();
590 #if ExternalThemeEnabled
591             ThemeManager.Preload();
592 #endif
593             IsPreload = true;
594         }
595
596         /// <summary>
597         /// Check if it is loaded as dotnet-loader-nui.
598         /// </summary>
599         static internal bool IsPreload { get; set; }
600
601         private void ApplyThemeOption(ThemeOptions option)
602         {
603             if ((option & ThemeOptions.PlatformThemeEnabled) != 0)
604             {
605                 ThemeManager.PlatformThemeEnabled = true;
606             }
607
608             if ((option & ThemeOptions.ThemeChangeSensitive) != 0)
609             {
610                 ThemeManager.ApplicationThemeChangeSensitive = true;
611             }
612         }
613
614         private void EnableBorder(IBorderInterface borderInterface)
615         {
616             borderEnabled = true;
617             this.borderInterface = borderInterface;
618         }
619     }
620
621     /// <summary>
622     /// Graphics Backend Type.
623     /// </summary>
624     [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")]
625     [EditorBrowsable(EditorBrowsableState.Never)]
626     [Obsolete("Do not use! This will be deprecated!")]
627     public class Graphics
628     {
629         /// <summary>
630         /// Graphics Backend Type.
631         /// </summary>
632         public enum BackendType
633         {
634             /// <summary>
635             /// The GLES backend.
636             /// </summary>
637             Gles,
638             /// <summary>
639             /// The Vulkan backend.
640             /// </summary>
641             Vulkan
642         }
643
644         /// <summary>
645         /// The backend used by the NUIApplication.
646         /// </summary>
647         [EditorBrowsable(EditorBrowsableState.Never)]
648         internal static BackendType Backend = BackendType.Gles;
649
650         internal const string GlesCSharpBinder = NDalicPINVOKE.Lib;
651         internal const string VulkanCSharpBinder = "libdali-csharp-binder-vk.so";
652     }
653 }