Exemplo n.º 1
0
        static SKManagedStream()
        {
            fRead        = new read_delegate(ReadInternal);
            fPeek        = new peek_delegate(PeekInternal);
            fIsAtEnd     = new isAtEnd_delegate(IsAtEndInternal);
            fRewind      = new rewind_delegate(RewindInternal);
            fGetPosition = new getPosition_delegate(GetPositionInternal);
            fSeek        = new seek_delegate(SeekInternal);
            fMove        = new move_delegate(MoveInternal);
            fGetLength   = new getLength_delegate(GetLengthInternal);
            fCreateNew   = new createNew_delegate(CreateNewInternal);
            fDestroy     = new destroy_delegate(DestroyInternal);

            SkiaApi.sk_managedstream_set_delegates(
                Marshal.GetFunctionPointerForDelegate(fRead),
                Marshal.GetFunctionPointerForDelegate(fPeek),
                Marshal.GetFunctionPointerForDelegate(fIsAtEnd),
                Marshal.GetFunctionPointerForDelegate(fRewind),
                Marshal.GetFunctionPointerForDelegate(fGetPosition),
                Marshal.GetFunctionPointerForDelegate(fSeek),
                Marshal.GetFunctionPointerForDelegate(fMove),
                Marshal.GetFunctionPointerForDelegate(fGetLength),
                Marshal.GetFunctionPointerForDelegate(fCreateNew),
                Marshal.GetFunctionPointerForDelegate(fDestroy));
        }
Exemplo n.º 2
0
		static SKManagedStream()
		{
			fRead = new read_delegate(ReadInternal);
			fPeek = new peek_delegate(PeekInternal);
			fIsAtEnd = new isAtEnd_delegate(IsAtEndInternal);
			fRewind = new rewind_delegate(RewindInternal);
			fGetPosition = new getPosition_delegate(GetPositionInternal);
			fSeek = new seek_delegate(SeekInternal);
			fMove = new move_delegate(MoveInternal);
			fGetLength = new getLength_delegate(GetLengthInternal);
			fCreateNew = new createNew_delegate(CreateNewInternal);
			fDestroy = new destroy_delegate(DestroyInternal);

			SkiaApi.sk_managedstream_set_delegates(
				Marshal.GetFunctionPointerForDelegate(fRead), 
				Marshal.GetFunctionPointerForDelegate(fPeek), 
				Marshal.GetFunctionPointerForDelegate(fIsAtEnd), 
				Marshal.GetFunctionPointerForDelegate(fRewind),
				Marshal.GetFunctionPointerForDelegate(fGetPosition),
				Marshal.GetFunctionPointerForDelegate(fSeek),
				Marshal.GetFunctionPointerForDelegate(fMove),
				Marshal.GetFunctionPointerForDelegate(fGetLength),
				Marshal.GetFunctionPointerForDelegate(fCreateNew),
				Marshal.GetFunctionPointerForDelegate(fDestroy));
		}
Exemplo n.º 3
0
        public static int seek(cef_stream_writer_t *self, long offset, int whence)
        {
            seek_delegate d;
            var           p = self->_seek;

            if (p == _p4)
            {
                d = _d4;
            }
            else
            {
                d = (seek_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(seek_delegate));
                if (_p4 == IntPtr.Zero)
                {
                    _d4 = d; _p4 = p;
                }
            }
            return(d(self, offset, whence));
        }
 public static int seek(cef_stream_reader_t* self, long offset, int whence)
 {
     seek_delegate d;
     var p = self->_seek;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (seek_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(seek_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self, offset, whence);
 }