Exemple #1
0
            //what follows are 3 private functions to boot up the internals of efl
            private static void Init(Efl.Csharp.Components component)
            {
                Eina.Config.Init();
                Efl.Eo.Config.Init();
                ecore_init();
                evas_init();
                //eldbus.Config.Init();

                if (component == Components.Ui)
                {
                    // TODO Support elm command line arguments
#if WIN32       // Not a native define, we define it in our build system
                    // Ecore_Win32 uses OleInitialize, which requires single thread apartments
                    if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
                    {
                        throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
                    }
#endif
                    elm_init(0, IntPtr.Zero);

                    // TIZEN_ONLY(20190425) Use efl-sharp-theme.edj on EflSharp
                    Efl.Ui.Theme.GetDefault().AddOverlay("/usr/share/efl-sharp/efl-sharp-theme.edj");
                    //

                    Efl.Ui.Win.ExitOnAllWindowsClosed = new Eina.Value(0);
                }

                initComponent = component;
            }
Exemple #2
0
        /// <summary>
        ///   Initialize the Efl.
        /// <para>Since EFL 1.23.</para>
        /// </summary>
        /// <param name="components">The <see cref="Efl.Csharp.Components" /> that initialize the Efl.</param>
        public static void Init(Efl.Csharp.Components components = Efl.Csharp.Components.Basic)
        {
            if (components == Efl.Csharp.Components.None)
            {
                return;
            }

            initComponents = components;

            if ((initComponents & Efl.Csharp.Components.Basic)
                == Efl.Csharp.Components.Basic)
            {
                Eina.Config.Init();
                Efl.Eo.Config.Init();
                ecore_init();
                ecore_init_ex(0, IntPtr.Zero);
                evas_init();
                eldbus.Config.Init();
            }

            if ((initComponents & Efl.Csharp.Components.Ui)
                == Efl.Csharp.Components.Ui)
            {
                Efl.Ui.Config.Init();
            }
            Monitor.Enter(InitLock);
            MainLoopInitialized = true;
            Monitor.Exit(InitLock);
        }
Exemple #3
0
            /// <summary>
            /// This function initializices everything in EFL and runs your application.
            /// This call will result in a call to OnInitialize(), which you application should override.
            /// </summary>
            public void Launch(Efl.Csharp.Components components = Components.Ui)
            {
                Init(components);
                Efl.App             app          = Efl.App.AppMain;
                Eina.Array <String> command_line = new Eina.Array <String>();
                command_line.Append(Environment.GetCommandLineArgs());
#if EFL_BETA
                app.SetCommandArray(command_line);
#endif
                app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) =>
                {
                    if (evt.arg.Initialization)
                    {
                        OnInitialize(evt.arg.Argv);
                    }

                    OnArguments(evt.arg);
                };
                app.PauseEvt += (object sender, EventArgs e) =>
                {
                    OnPause();
                };
                app.ResumeEvt += (object sender, EventArgs e) =>
                {
                    OnResume();
                };
                app.TerminateEvt += (object sender, EventArgs e) =>
                {
                    OnTerminate();
                };
                app.Begin();
                Shutdown();
            }
            //what follows are 3 private functions to boot up the internals of efl
            private static void Init(Efl.Csharp.Components component)
            {
                Eina.Config.Init();
                Efl.Eo.Config.Init();
                ecore_init();
                evas_init();
                eldbus.Config.Init();

                if (component == Components.Ui)
                {
                    // TODO Support elm command line arguments
#if WIN32       // Not a native define, we define it in our build system
                    // Ecore_Win32 uses OleInitialize, which requires single thread apartments
                    if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
                    {
                        throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
                    }
#endif
                    elm_init(0, IntPtr.Zero);

                    elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden);
                }

                initComponent = component;
            }
Exemple #5
0
        public static void Init(Efl.Csharp.Components components = Efl.Csharp.Components.Basic)
        {
            Eina.Config.Init();
            Efl.Eo.Config.Init();
            ecore_init();
            evas_init();
            eldbus.Config.Init();

            if (components == Efl.Csharp.Components.Ui)
            {
                Efl.Ui.Config.Init();
                InitializedUi = true;
            }
        }
Exemple #6
0
        public static void Init(Efl.Csharp.Components components = Efl.Csharp.Components.Basic)
        {
            Eina.Config.Init();
            Efl.Eo.Config.Init();
            ecore_init();
            evas_init();

            if (components == Efl.Csharp.Components.Ui)
            {
                Efl.Ui.Config.Init();
                InitializedUi = true;
            }
            Monitor.Enter(InitLock);
            MainLoopInitialized = true;
            Monitor.Exit(InitLock);
        }
Exemple #7
0
        /// <summary>
        /// This function initializices everything in EFL and runs your application.
        /// This call will result in a call to OnInitialize(), which you application should override.
        /// <para>Since EFL 1.23.</para>
        /// </summary>
        /// <param name="components">The <see cref="Efl.Csharp.Components" /> to run the application.</param>
        public void Launch(Efl.Csharp.Components components = Components.All)
        {
            Init(components);
            Efl.App app          = Efl.App.AppMain;
            var     command_line = new Eina.Array <Eina.Stringshare>();

            //command_line.Add(List.ConvertAll(Environment.GetCommandLineArgs(), s => (Eina.Stringshare)s));
            //command_line.AddRange(Environment.GetCommandLineArgs());
#if EFL_BETA
            app.SetCommandArray(command_line);
#endif
            app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) =>
            {
                if (evt.arg.Initialization)
                {
                    var evtArgv = evt.arg.Argv;
                    int n       = evtArgv.Count;
                    var argv    = new string[n];
                    for (int i = 0; i < n; ++i)
                    {
                        argv[i] = evtArgv[i];
                    }

                    OnInitialize(argv);
                }

                OnArguments(evt.arg);
            };
            app.PauseEvent += (object sender, EventArgs e) =>
            {
                OnPause();
            };
            app.ResumeEvent += (object sender, EventArgs e) =>
            {
                OnResume();
            };
            app.TerminateEvent += (object sender, EventArgs e) =>
            {
                OnTerminate();
            };
            app.Begin();
            command_line.Dispose();
            Shutdown();
        }
Exemple #8
0
        //what follows are 3 private functions to boot up the internals of efl
        private static void Init(Efl.Csharp.Components components = Components.All)
        {
            if (components == Components.None)
            {
                return;
            }

            initComponents = components;

            if ((initComponents & Components.Basic) == Components.Basic)
            {
                Eina.Config.Init();
                Efl.Eo.Config.Init();
                ecore_init();
                ecore_init_ex(0, IntPtr.Zero);
                evas_init();
                eldbus.Config.Init();
            }

            if ((initComponents & Components.Ui) == Components.Ui)
            {
#if WIN32
                // TODO Support elm command line arguments
                // Not a native define, we define it in our build system
                // Ecore_Win32 uses OleInitialize, which requires single thread apartments
                if (System.Threading.Thread.CurrentThread.GetApartmentState()
                    != ApartmentState.STA)
                {
                    throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()");
                }
#endif
                elm_init(0, IntPtr.Zero);

                Efl.Ui.Win.ExitOnAllWindowsClosed = new Eina.Value(0);
            }
        }