Ejemplo n.º 1
0
 /// <summary>Constructor for ModelChangedEvent.</summary>
 /// <param name="Current">The newly set model.</param>;
 /// <param name="Previous">The previously set model.</param>;
 public ModelChangedEvent(
     Efl.IModel Current  = default(Efl.IModel),
     Efl.IModel Previous = default(Efl.IModel))
 {
     this.Current  = Current;
     this.Previous = Previous;
 }
Ejemplo n.º 2
0
            /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
            /// <param name="model">Efl model</param>
            /// <param name="parent">Efl canvas</param>
            /// <returns>Created UI object</returns>
            public Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent)
            {
                var _ret_var = Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_create_ptr.Value.Delegate(this.NativeHandle, model, parent);

                Eina.Error.RaiseIfUnhandledException();
                return(_ret_var);
            }
Ejemplo n.º 3
0
    internal Eina.Future ManagedCb(Efl.FilterModel parent, Efl.IModel child)
    {
        var _ret_var = _cb(_cb_data, parent, child);

        Eina.Error.RaiseIfUnhandledException();
        return(_ret_var);
    }
Ejemplo n.º 4
0
                private static Efl.IModel model_get(System.IntPtr obj, System.IntPtr pd)
                {
                    Eina.Log.Debug("function efl_ui_view_model_get was called");

                    var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);

                    if (ws != null)
                    {
                        Efl.IModel _ret_var = default(Efl.IModel);
                        try
                        {
                            _ret_var = ((IView)ws.Target).GetModel();
                        }
                        catch (Exception e)
                        {
                            Eina.Log.Warning($"Callback error: {e.ToString()}");
                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                        }

                        return(_ret_var);
                    }
                    else
                    {
                        return(efl_ui_view_model_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))));
                    }
                }
Ejemplo n.º 5
0
            /// <summary>Create a UI object from the necessary properties in the specified model.</summary>
            /// <param name="model">Efl model</param>
            /// <param name="parent">Efl canvas</param>
            /// <returns>Created UI object</returns>
            virtual public Eina.Future Create(Efl.IModel model, Efl.Gfx.IEntity parent)
            {
                var _ret_var = Efl.Ui.IFactoryConcrete.NativeMethods.efl_ui_factory_create_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), model, parent);

                Eina.Error.RaiseIfUnhandledException();
                return(_ret_var);
            }
Ejemplo n.º 6
0
 ///<summary>Constructor for FactoryItemCreatedEvent.</summary>
 public FactoryItemCreatedEvent(
     Efl.IModel Model     = default(Efl.IModel),
     Efl.Gfx.IEntity Item = default(Efl.Gfx.IEntity))
 {
     this.Model = Model;
     this.Item  = Item;
 }
Ejemplo n.º 7
0
        /// <summary>Sets the properties of the <paramref name="child"/> from the properties of the given object
        /// <paramref name="o"/>.</summary>
        static internal void SetProperties <T>(T o, Efl.IModel child)
        {
            var properties = typeof(T).GetProperties();

            foreach (var prop in properties)
            {
                child.SetProperty(prop.Name, ValueFromProperty(o, prop));
            }
        }
Ejemplo n.º 8
0
        /// <summary>Sets the properties of <paramref name="o"/> from the properties of <paramref name="child"/>.</summary>
        static internal void GetProperties <T>(T o, Efl.IModel child)
        {
            var properties = typeof(T).GetProperties();

            foreach (var prop in properties)
            {
                using (var v = child.GetProperty(prop.Name))
                {
                    SetPropertyFromValue(o, prop, v);
                }
            }
        }
Ejemplo n.º 9
0
 ///<summary>Creates a new instance.</summary>
 ///<param name="parent">Parent instance.</param>
 ///<param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel"/></param>
 ///<param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex"/></param>
 public ExactModel(Efl.Object parent
                   , Efl.IModel model, uint?index = null) :
     base(efl_ui_exact_model_class_get(), typeof(ExactModel), parent)
 {
     if (Efl.Eo.Globals.ParamHelperCheck(model))
     {
         SetModel(Efl.Eo.Globals.GetParamHelper(model));
     }
     if (Efl.Eo.Globals.ParamHelperCheck(index))
     {
         SetIndex(Efl.Eo.Globals.GetParamHelper(index));
     }
     FinishInstantiation();
 }
Ejemplo n.º 10
0
 ///<summary>Creates a new instance.</summary>
 ///<param name="parent">Parent instance.</param>
 ///<param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel"/></param>
 ///<param name="childrenBind">Define if we will intercept all childrens object reference and bind them through the ViewModel with the same property logic as this one. Be careful of recursivity. See <see cref="Efl.ViewModel.SetChildrenBind"/></param>
 ///<param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex"/></param>
 public ViewModel(Efl.Object parent
                  , Efl.IModel model, bool?childrenBind = null, uint?index = null) :
     base(efl_view_model_class_get(), typeof(ViewModel), parent)
 {
     if (Efl.Eo.Globals.ParamHelperCheck(model))
     {
         SetModel(Efl.Eo.Globals.GetParamHelper(model));
     }
     if (Efl.Eo.Globals.ParamHelperCheck(childrenBind))
     {
         SetChildrenBind(Efl.Eo.Globals.GetParamHelper(childrenBind));
     }
     if (Efl.Eo.Globals.ParamHelperCheck(index))
     {
         SetIndex(Efl.Eo.Globals.GetParamHelper(index));
     }
     FinishInstantiation();
 }
Ejemplo n.º 11
0
 private static void model_set(System.IntPtr obj, System.IntPtr pd, Efl.IModel model)
 {
     Eina.Log.Debug("function efl_ui_view_model_set was called");
     Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
     if (wrapper != null)
     {
         try {
             ((IView)wrapper).SetModel(model);
         } catch (Exception e) {
             Eina.Log.Warning($"Callback error: {e.ToString()}");
             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
         }
     }
     else
     {
         efl_ui_view_model_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model);
     }
 }
Ejemplo n.º 12
0
 ///<summary>Constructor for ListViewLayoutItem.</summary>
 public ListViewLayoutItem(
     Efl.Ui.Layout Layout       = default(Efl.Ui.Layout),
     Eina.Future Layout_request = default(Eina.Future),
     Efl.IModel Children        = default(Efl.IModel),
     int Index_offset           = default(int),
     System.IntPtr Tree_node    = default(System.IntPtr),
     Eina.Size2D Min            = default(Eina.Size2D),
     Eina.Size2D Size           = default(Eina.Size2D),
     Eina.Position2D Pos        = default(Eina.Position2D))
 {
     this.Layout         = Layout;
     this.Layout_request = Layout_request;
     this.Children       = Children;
     this.Index_offset   = Index_offset;
     this.Tree_node      = Tree_node;
     this.Min            = Min;
     this.Size           = Size;
     this.Pos            = Pos;
 }
Ejemplo n.º 13
0
        /// <summary>Initializes a new instance of the <see cref="FilterModel"/> class.</summary>
        /// <param name="parent">Parent instance.</param>
        /// <param name="filterSet">Set a filter function that will catch children from the composited model. See <see cref="Efl.FilterModel.SetFilter" /></param>
        /// <param name="model">Model that is/will be See <see cref="Efl.Ui.IView.SetModel" /></param>
        /// <param name="index">Position of this object in the parent model. See <see cref="Efl.CompositeModel.SetIndex" /></param>
        public FilterModel(Efl.Object parent
                           , EflFilterModel filterSet, Efl.IModel model, uint?index = null) : base(efl_filter_model_class_get(), parent)
        {
            if (Efl.Eo.Globals.ParamHelperCheck(filterSet))
            {
                SetFilter(Efl.Eo.Globals.GetParamHelper(filterSet));
            }

            if (Efl.Eo.Globals.ParamHelperCheck(model))
            {
                SetModel(Efl.Eo.Globals.GetParamHelper(model));
            }

            if (Efl.Eo.Globals.ParamHelperCheck(index))
            {
                SetIndex(Efl.Eo.Globals.GetParamHelper(index));
            }

            FinishInstantiation();
        }
Ejemplo n.º 14
0
        private static Eina.Future create(System.IntPtr obj, System.IntPtr pd, Efl.IModel model, Efl.Gfx.IEntity parent)
        {
            Eina.Log.Debug("function efl_ui_factory_create was called");

            Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
            if (wrapper != null)
            {
                Eina.Future _ret_var = default(Eina.Future);
                try {
                    _ret_var = ((IFactory)wrapper).Create(model, parent);
                } catch (Exception e) {
                    Eina.Log.Warning($"Callback error: {e.ToString()}");
                    Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                }
                return(_ret_var);
            }
            else
            {
                return(efl_ui_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model, parent));
            }
        }
Ejemplo n.º 15
0
            private static void model_set(System.IntPtr obj, System.IntPtr pd, Efl.IModel model)
            {
                Eina.Log.Debug("function efl_ui_view_model_set was called");
                var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);

                if (ws != null)
                {
                    try
                    {
                        ((ModelProvider)ws.Target).SetModel(model);
                    }
                    catch (Exception e)
                    {
                        Eina.Log.Warning($"Callback error: {e.ToString()}");
                        Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                    }
                }
                else
                {
                    efl_ui_view_model_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model);
                }
            }
Ejemplo n.º 16
0
 /// <summary>Async wrapper for <see cref="Create" />.</summary>
 /// <param name="model">Efl model</param>
 /// <param name="parent">Efl canvas</param>
 /// <param name="token">Token to notify the async operation of external request to cancel.</param>
 /// <returns>An async task wrapping the result of the operation.</returns>
 public System.Threading.Tasks.Task <Eina.Value> CreateAsync(Efl.IModel model, Efl.Gfx.IEntity parent, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
 {
     Eina.Future future = Create(model, parent);
     return(Efl.Eo.Globals.WrapAsync(future, token));
 }
Ejemplo n.º 17
0
 /// <summary>Creates a new model wrapping <c>model</c>.</summary>
 public GenericModel(Efl.IModel model, Efl.Object parent = null) : base(parent)
 {
     this.model = model;
 }
Ejemplo n.º 18
0
 /// <summary>Adds a new child to the model wrapping the properties of <c>o</c>
 ///
 /// <para>Reflection is used to instantiate a new <see cref="Efl.IModel" />-based class for this child and
 /// set the mirroring properties correctly.</para>
 /// </summary>
 ///
 /// <param name="o">The user model instance to be added to this model.</param>
 public void Add(T o)
 {
     Efl.IModel child = (Efl.IModel) this.AddChild();
     ModelHelper.SetProperties(o, child);
 }
Ejemplo n.º 19
0
 /// <summary>Model that is/will be</summary>
 /// <param name="model">Efl model</param>
 /// <returns></returns>
 public void SetModel(Efl.IModel model)
 {
     Efl.Ui.IViewNativeInherit.efl_ui_view_model_set_ptr.Value.Delegate(this.NativeHandle, model);
     Eina.Error.RaiseIfUnhandledException();
 }
Ejemplo n.º 20
0
 /// <summary>Model that is/will be</summary>
 /// <param name="model">Efl model</param>
 virtual public void SetModel(Efl.IModel model)
 {
     Efl.Ui.IViewConcrete.NativeMethods.efl_ui_view_model_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)), model);
     Eina.Error.RaiseIfUnhandledException();
 }
Ejemplo n.º 21
0
    [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Eina.FutureMarshaler))]    internal static Eina.Future Cb(IntPtr cb_data, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Efl.Eo.MarshalEo <Efl.Eo.NonOwnTag>))] Efl.FilterModel parent, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Efl.Eo.MarshalEo <Efl.Eo.NonOwnTag>))] Efl.IModel child)
    {
        GCHandle handle = GCHandle.FromIntPtr(cb_data);

        EflFilterModel cb = (EflFilterModel)handle.Target;

        Eina.Future _ret_var = default(Eina.Future);
        try {
            _ret_var = cb(parent, child);
        } catch (Exception e) {
            Eina.Log.Warning($"Callback error: {e.ToString()}");
            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
        }
        return(_ret_var);
    }
 /// <summary>Model that is/will be</summary>
 /// <param name="model">Efl model</param>
 /// <returns></returns>
 virtual public void SetModel(Efl.IModel model)
 {
     Efl.Ui.IListViewRelayoutNativeInherit.efl_ui_list_view_relayout_model_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), model);
     Eina.Error.RaiseIfUnhandledException();
 }