Example #1
0
 public static void FlutterNotifyAppIsPaused(FlutterWindowControllerHandle window)
 {
     if (IsTizen40)
     {
         Tizen40Embedder.FlutterNotifyAppIsPaused(window);
     }
     else
     {
         DefaultEmbedder.FlutterNotifyAppIsPaused(window);
     }
 }
Example #2
0
 public static void FlutterNotifyLocaleChange(FlutterWindowControllerHandle window)
 {
     if (IsTizen40)
     {
         Tizen40Embedder.FlutterNotifyLocaleChange(window);
     }
     else
     {
         DefaultEmbedder.FlutterNotifyLocaleChange(window);
     }
 }
Example #3
0
 public static void FlutterNotifyLowMemoryWarning(FlutterWindowControllerHandle window)
 {
     if (IsTizen40)
     {
         Tizen40Embedder.FlutterNotifyLowMemoryWarning(window);
     }
     else
     {
         DefaultEmbedder.FlutterNotifyLowMemoryWarning(window);
     }
 }
Example #4
0
 public static void FlutterDestoryWindow(FlutterWindowControllerHandle window)
 {
     if (IsTizen40)
     {
         Tizen40Embedder.FlutterDestoryWindow(window);
     }
     else
     {
         DefaultEmbedder.FlutterDestoryWindow(window);
     }
 }
Example #5
0
 public static IntPtr FlutterDesktopGetPluginRegistrar(
     FlutterWindowControllerHandle window, string plugin_name)
 {
     if (IsTizen40)
     {
         return(Tizen40Embedder.FlutterDesktopGetPluginRegistrar(window, plugin_name));
     }
     else
     {
         return(DefaultEmbedder.FlutterDesktopGetPluginRegistrar(window, plugin_name));
     }
 }
Example #6
0
        protected override void OnCreate()
        {
            base.OnCreate();

            // Read engine arguments passed from the tool.
            ParseEngineArgs();
            InternalLog.Info(LogTag, $"switches: {string.Join(" ", EngineArgs)}");

            // Get the screen size of the currently running device.
            if (!Information.TryGetValue("http://tizen.org/feature/screen.width", out int width) ||
                !Information.TryGetValue("http://tizen.org/feature/screen.height", out int height))
            {
                InternalLog.Error(LogTag, "Could not obtain the screen size.");
                return;
            }
            var windowProperties = new FlutterWindowProperties
            {
                width  = width,
                height = height
            };

            // Get paths to resources required for launch.
            string resPath     = Current.DirectoryInfo.Resource;
            string assetsPath  = $"{resPath}/flutter_assets";
            string icuDataPath = $"{resPath}/icudtl.dat";
            string arch        = RuntimeInformation.ProcessArchitecture switch
            {
                Architecture.X86 => "x86",
                Architecture.X64 => "x64",
                Architecture.Arm => "arm",
                Architecture.Arm64 => "aarch64",
                _ => "",
            };
            string aotLibPath = $"{resPath}/../lib/{arch}/libapp.so";

            using var switches = new StringArray(EngineArgs);
            var engineProperties = new FlutterEngineProperties
            {
                assets_path      = assetsPath,
                icu_data_path    = icuDataPath,
                aot_library_path = aotLibPath,
                switches         = switches.Handle,
                switches_count   = (uint)switches.Length,
            };

            Handle = FlutterCreateWindow(ref windowProperties, ref engineProperties);
            if (Handle.IsInvalid)
            {
                throw new Exception("Could not launch a Flutter application.");
            }
        }
Example #7
0
 public static extern IntPtr FlutterDesktopGetPluginRegistrar(
     FlutterWindowControllerHandle window, string plugin_name);
Example #8
0
 public static extern void FlutterNotifyAppIsPaused(
     FlutterWindowControllerHandle window);
Example #9
0
 public static extern void FlutterNotifyLowMemoryWarning(
     FlutterWindowControllerHandle window);
Example #10
0
 public static extern void FlutterNotifyLocaleChange(
     FlutterWindowControllerHandle window);
Example #11
0
 public static extern void FlutterDestoryWindow(
     FlutterWindowControllerHandle window);
Example #12
0
        protected override void OnCreate()
        {
            base.OnCreate();

            // Read the current platform version and choose a Tizen 4.0 embedder if applicable.
            Information.TryGetValue("http://tizen.org/feature/platform.version", out PlatformVersion);

            // Read engine arguments passed from the tool.
            ParseEngineArgs();
            InternalLog.Info(LogTag, $"switches: {string.Join(" ", EngineArgs)}");

            // Get the screen size of the currently running device.
            if (!Information.TryGetValue("http://tizen.org/feature/screen.width", out int width) ||
                !Information.TryGetValue("http://tizen.org/feature/screen.height", out int height))
            {
                InternalLog.Error(LogTag, "Could not obtain the screen size.");
                return;
            }
            var windowProperties = new FlutterWindowProperties
            {
                width  = width,
                height = height
            };

            // Get paths to resources required for launch.
            string resPath     = Current.DirectoryInfo.Resource;
            string assetsPath  = $"{resPath}/flutter_assets";
            string icuDataPath = $"{resPath}/icudtl.dat";
            string arch        = RuntimeInformation.ProcessArchitecture switch
            {
                Architecture.X86 => "x86",
                Architecture.X64 => "x64",
                Architecture.Arm => "arm",
                Architecture.Arm64 => "aarch64",
                _ => "",
            };
            string aotLibPath = $"{resPath}/../lib/{arch}/libapp.so";

            using var switches = new StringArray(EngineArgs);
            var engineProperties = new FlutterEngineProperties
            {
                assets_path      = assetsPath,
                icu_data_path    = icuDataPath,
                aot_library_path = aotLibPath,
                switches         = switches.Handle,
                switches_count   = (uint)switches.Length,
            };

            // This check is not actually required, but we want to make sure that libflutter_engine.so is loaded
            // before a call to FlutterCreateWindow() is made to avoid library loading issues on TV emulator.
            if (FlutterEngineRunsAOTCompiledDartCode())
            {
                InternalLog.Debug(LogTag, "Running in AOT mode.");
            }

            Handle = FlutterCreateWindow(ref windowProperties, ref engineProperties);
            if (Handle.IsInvalid)
            {
                throw new Exception("Could not launch a Flutter application.");
            }
        }
Example #13
0
 public static extern void FlutterRotateWindow(
     [In] FlutterWindowControllerHandle window,
     [In] int degree);
Example #14
0
 public static extern void FlutterNotifyAppIsResumed(
     [In] FlutterWindowControllerHandle window);