Exemplo n.º 1
0
        internal void NotifyCloseBw()
        {
            this.Stop();
            //
            JsValue ret;
            JsValue a0 = new JsValue();
            JsValue a1 = new JsValue();

            Cef3Binder.MyCefBwCall2(_myCefBw.ptr, (int)CefBwCallMsg.CefBw_CloseBw, out ret, ref a0, ref a1);
        }
Exemplo n.º 2
0
        public Auto.CefFrame GetMainFrame()
        {
            JsValue ret;
            JsValue a1 = new JsValue();
            JsValue a2 = new JsValue();

            Cef3Binder.MyCefBwCall2(ptr,
                                    (int)CefBwCallMsg.CefBw_GetMainFrame,
                                    out ret, ref a1, ref a2);
            return(new Auto.CefFrame(ret.Ptr));
        }
Exemplo n.º 3
0
        public Auto.CefBrowser GetBrowser()
        {
            JsValue ret;
            JsValue a1 = new JsValue();
            JsValue a2 = new JsValue();

            Cef3Binder.MyCefBwCall2(ptr,
                                    (int)CefBwCallMsg.CefBw_GetCefBrowser,
                                    out ret, ref a1, ref a2);
            return(new Auto.CefBrowser(ret.Ptr));
        }
Exemplo n.º 4
0
        public void SetSize(int w, int h)
        {
            JsValue a0 = new JsValue();

            a0.I32 = w;
            JsValue a1 = new JsValue();

            a1.I32 = h;
            JsValue ret;

            Cef3Binder.MyCefBwCall2(_myCefBw.ptr, (int)CefBwCallMsg.CefBw_SetSize, out ret, ref a0, ref a1);
        }
Exemplo n.º 5
0
        public void PostData2(string url, byte[] data, int len)
        {
            //CefRefPtr<CefRequest> request(CefRequest::Create());
            //MyCefStringHolder* url = (MyCefStringHolder*)v1->ptr;
            //request->SetURL(url->value);
            ////Add post data to request, the correct method and content-type header will be set by CEF
            //CefRefPtr<CefPostDataElement> postDataElement(CefPostDataElement::Create());


            //char* buffer1 = new char[v2->i32];
            //memcpy_s(buffer1, v2->i32, v2->ptr, v2->i32);
            //postDataElement->SetToBytes(v2->i32, buffer1);
            ////------

            //CefRefPtr<CefPostData> postData(CefPostData::Create());
            //postData->AddElement(postDataElement);
            //request->SetPostData(postData);

            ////add custom header (for test)
            //CefRequest::HeaderMap headerMap;
            //headerMap.insert(
            //    std::make_pair("X-My-Header", "My Header Value"));
            //request->SetHeaderMap(headerMap);

            ////load request
            //myBw->bwWindow->GetBrowser()->GetMainFrame()->LoadRequest(request);

            //delete buffer1;
            JsValue a0 = new JsValue();
            JsValue a1 = new JsValue();
            JsValue ret;

            var v_url = NativeMyCefStringHolder.CreateHolder(url);

            a0.Ptr = v_url.nativePtr;
            //
            unsafe
            {
                fixed(byte *buffer = &data[0])
                {
                    a1.Ptr = new IntPtr(buffer);
                    a1.I32 = data.Length;

                    Cef3Binder.MyCefBwCall2(_myCefBw.ptr, (int)CefBwCallMsg.CefBw_PostData, out ret, ref a0, ref a1);
                }
            }


            v_url.Dispose();
        }
Exemplo n.º 6
0
        public void PostData(string url, byte[] data, int len)
        {
            JsValue a0 = new JsValue();
            JsValue a1 = new JsValue();
            JsValue ret;

            var v_url = NativeMyCefStringHolder.CreateHolder(url);

            a0.Ptr = v_url.nativePtr;
            //
            unsafe
            {
                fixed(byte *buffer = &data[0])
                {
                    a1.Ptr = new IntPtr(buffer);
                    a1.I32 = data.Length;

                    Cef3Binder.MyCefBwCall2(_myCefBw.ptr, (int)CefBwCallMsg.CefBw_PostData, out ret, ref a0, ref a1);
                }
            }


            v_url.Dispose();
        }