コード例 #1
0
        /// <summary>Writes data from a pre-populated buffer.
        /// This operation will be executed immediately and may or may not block the caller thread for some time. The details of blocking behavior is defined by the implementation and may be subject to other parameters such as non-blocking flags, maximum timeout or even retry attempts.
        ///
        /// You can understand this method as write(2) libc function.
        /// 1.19</summary>
        /// <param name="slice">Provides a pre-populated memory to be used up to slice.len. The returned slice will be adapted as length will be set to the actually used amount of bytes, which can be smaller than the request.
        /// 1.19</param>
        /// <param name="remaining">Convenience to output the remaining parts of slice that was not written. If the full slice was written, this will be a slice of zero-length.
        /// 1.19</param>
        /// <returns>0 on succeed, a mapping of errno otherwise
        /// 1.19</returns>
        public Eina.Error Write(ref Eina.Slice slice, ref Eina.Slice remaining)
        {
            var _ret_var = Efl.Io.WriterNativeInherit.efl_io_writer_write_ptr.Value.Delegate(this.NativeHandle, ref slice, ref remaining);

            Eina.Error.RaiseIfUnhandledException();
            return(_ret_var);
        }
コード例 #2
0
ファイル: efl_ui_dnd.eo.cs プロジェクト: gbalykov/TizenFX
            /// <summary>Start a drag and drop process at the drag side. During dragging, there are three events emitted as belows: - EFL_UI_DND_EVENT_DRAG_POS - EFL_UI_DND_EVENT_DRAG_ACCEPT - EFL_UI_DND_EVENT_DRAG_DONE</summary>
            /// <param name="format">The data format</param>
            /// <param name="data">The drag data</param>
            /// <param name="action">Action when data is transferred</param>
            /// <param name="icon_func">Function pointer to create icon</param>
            /// <param name="seat">Specified seat for multiple seats case.</param>
            public void DragStart(Efl.Ui.SelectionFormat format, Eina.Slice data, Efl.Ui.SelectionAction action, Efl.Dnd.DragIconCreate icon_func, uint seat)
            {
                GCHandle icon_func_handle = GCHandle.Alloc(icon_func);

                Efl.Ui.IDndConcrete.NativeMethods.efl_ui_dnd_drag_start_ptr.Value.Delegate(this.NativeHandle, format, data, action, GCHandle.ToIntPtr(icon_func_handle), Efl.Dnd.DragIconCreateWrapper.Cb, Efl.Eo.Globals.free_gchandle, seat);
                Eina.Error.RaiseIfUnhandledException();
            }
コード例 #3
0
                private static Eina.Error write(System.IntPtr obj, System.IntPtr pd, ref Eina.Slice slice, ref Eina.Slice remaining)
                {
                    Eina.Log.Debug("function efl_io_writer_write was called");
                    var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);

                    if (ws != null)
                    {
                        remaining = default(Eina.Slice);                            Eina.Error _ret_var = default(Eina.Error);
                        try
                        {
                            _ret_var = ((IWriter)ws.Target).Write(ref slice, ref remaining);
                        }
                        catch (Exception e)
                        {
                            Eina.Log.Warning($"Callback error: {e.ToString()}");
                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                        }

                        return(_ret_var);
                    }
                    else
                    {
                        return(efl_io_writer_write_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), ref slice, ref remaining));
                    }
                }
コード例 #4
0
 ///<summary>Constructor for SelectionData.</summary>
 public SelectionData(
     Eina.Position2D Pos           = default(Eina.Position2D),
     Efl.Ui.SelectionFormat Format = default(Efl.Ui.SelectionFormat),
     Eina.Slice Content            = default(Eina.Slice),
     Efl.Ui.SelectionAction Action = default(Efl.Ui.SelectionAction),
     Efl.Object Item = default(Efl.Object))
 {
     this.Pos     = Pos;
     this.Format  = Format;
     this.Content = Content;
     this.Action  = Action;
     this.Item    = Item;
 }
コード例 #5
0
ファイル: EinaTestData.cs プロジェクト: marcelhollerbach/efl
        override public bool EinaSliceOut(ref Eina.Slice slice)
        {
            slice_out_flag = true;

            slice_out_seq    = (byte[])BaseSequence.Values();
            slice_out_pinned = GCHandle.Alloc(slice_out_seq, GCHandleType.Pinned);
            IntPtr ptr = slice_out_pinned.AddrOfPinnedObject();

            slice.Mem = ptr;
            slice.Len = (UIntPtr)slice_out_seq.Length;

            return(true);
        }
コード例 #6
0
 eina_binbuf_insert_slice(IntPtr buf, Eina.Slice slice, UIntPtr pos);
コード例 #7
0
 eina_binbuf_append_slice(IntPtr buf, Eina.Slice slice);
コード例 #8
0
 /// <summary>
 ///    Inserts a slice into the buffer, reallocating as necessary.
 /// <para>Since EFL 1.23.</para>
 /// </summary>
 /// <param name="slice">The slice to appended.</param>
 /// <param name="pos">The position to insert the string.</param>
 /// <returns>true on success, false if data could not be appended.</returns>
 public bool Insert(Eina.Slice slice, uint pos)
 {
     return(0 != eina_binbuf_insert_slice(Handle, slice, (UIntPtr)pos));
 }
コード例 #9
0
 /// <summary>
 ///  Appends a slice to the buffer, reallocating as necessary.
 /// <para>Since EFL 1.23.</para>
 /// </summary>
 /// <param name="slice">The slice to appended.</param>
 /// <returns>true on success, false if data could not be appended.</returns>
 public bool Append(Eina.Slice slice)
 {
     return(0 != eina_binbuf_append_slice(Handle, slice));
 }
コード例 #10
0
ファイル: efl_ui_dnd.eo.cs プロジェクト: gbalykov/TizenFX
                private static void drag_start(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionFormat format, Eina.Slice data, Efl.Ui.SelectionAction action, IntPtr icon_func_data, Efl.Dnd.DragIconCreateInternal icon_func, EinaFreeCb icon_func_free_cb, uint seat)
                {
                    Eina.Log.Debug("function efl_ui_dnd_drag_start was called");
                    var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);

                    if (ws != null)
                    {
                        Efl.Dnd.DragIconCreateWrapper icon_func_wrapper = new Efl.Dnd.DragIconCreateWrapper(icon_func, icon_func_data, icon_func_free_cb);

                        try
                        {
                            ((IDndConcrete)ws.Target).DragStart(format, data, action, icon_func_wrapper.ManagedCb, seat);
                        }
                        catch (Exception e)
                        {
                            Eina.Log.Warning($"Callback error: {e.ToString()}");
                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                        }
                    }
                    else
                    {
                        efl_ui_dnd_drag_start_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), format, data, action, icon_func_data, icon_func, icon_func_free_cb, seat);
                    }
                }
コード例 #11
0
        private static Eina.Future selection_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat)
        {
            Eina.Log.Debug("function efl_ui_selection_set was called");

            Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
            if (wrapper != null)
            {
                Eina.Future _ret_var = default(Eina.Future);
                try {
                    _ret_var = ((ISelectionConcrete)wrapper).SetSelection(type, format, data, seat);
                } catch (Exception e) {
                    Eina.Log.Warning($"Callback error: {e.ToString()}");
                    Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                }
                return(_ret_var);
            }
            else
            {
                return(efl_ui_selection_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, format, data, seat));
            }
        }
コード例 #12
0
 public System.Threading.Tasks.Task <Eina.Value> SetSelectionAsync(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
 {
     Eina.Future future = SetSelection(type, format, data, seat);
     return(Efl.Eo.Globals.WrapAsync(future, token));
 }
コード例 #13
0
        /// <summary>Set the selection data to the object</summary>
        /// <param name="type">Selection Type</param>
        /// <param name="format">Selection Format</param>
        /// <param name="data">Selection data</param>
        /// <param name="seat">Specified seat for multiple seats case.</param>
        /// <returns>Future for tracking when the selection is lost</returns>
        public Eina.Future SetSelection(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat)
        {
            var _ret_var = Efl.Ui.ISelectionNativeInherit.efl_ui_selection_set_ptr.Value.Delegate(this.NativeHandle, type, format, data, seat);

            Eina.Error.RaiseIfUnhandledException();
            return(_ret_var);
        }
コード例 #14
0
ファイル: EinaTestData.cs プロジェクト: marcelhollerbach/efl
 override public bool EinaSliceIn(Eina.Slice slice)
 {
     slice_in_flag = true;
     return(slice.GetBytes().SequenceEqual(BaseSequence.Values()));
 }