Exemplo n.º 1
0
 protected override SciterXDef.LoadResult OnLoadData(SciterXDef.SCN_LOAD_DATA sld)
 {
     if (sld.uri.StartsWith("archive://app/"))
     {
         // load resource from SciterArchive
         string path = sld.uri.Substring(14);
         byte[] data = _archive.Get(path);
         if (data != null)
             _api.SciterDataReady(_wnd._hwnd, sld.uri, data, (uint)data.Length);
     }
     return SciterXDef.LoadResult.LOAD_OK;
 }
Exemplo n.º 2
0
        protected override SciterXDef.LoadResult OnLoadData(SciterXDef.SCN_LOAD_DATA sld)
        {
            SciterRequest rq = new SciterRequest(sld.requestId);
            string r1 = rq.Url;
            string r2 = rq.ContentUrl;
            var r3 = rq.RequestedType;

            if(sld.uri.StartsWith("archive://app/"))
            {
                // load resource from SciterArchive
                string path = sld.uri.Substring(14);
                byte[] data = _archive.Get(path);
                if(data != null)
                    _api.SciterDataReady(_wnd._hwnd, sld.uri, data, (uint)data.Length);
            }
            return base.OnLoadData(sld);
        }
Exemplo n.º 3
0
		/// <summary>
		/// Creates the Sciter window and returns the native handle
		/// </summary>
		/// <param name="frame">Rectangle of the window</param>
		/// <param name="creationFlags">Flags for the window creation, defaults to SW_MAIN | SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_ENABLE_DEBUG</param>
		public void CreateWindow(PInvokeUtils.RECT frame = new PInvokeUtils.RECT(), SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags, IntPtr parent = new IntPtr())
		{
			Debug.Assert(_hwnd == IntPtr.Zero);
			_hwnd = _api.SciterCreateWindow(
				creationFlags,
				ref frame,
				_proc,
				IntPtr.Zero,
				parent
			);
			Debug.Assert(_hwnd != IntPtr.Zero);

			if(_hwnd == IntPtr.Zero)
				throw new Exception("CreateWindow() failed");

#if GTKMONO
			_gtkwindow = PInvokeGTK.gtk_widget_get_toplevel(_hwnd);
			Debug.Assert(_gtkwindow != IntPtr.Zero);
#elif OSX
			_nsview = new OSXView(_hwnd);
#endif
		}
Exemplo n.º 4
0
 protected override void OnOutput(SciterXDef.OUTPUT_SUBSYTEM subsystem, SciterXDef.OUTPUT_SEVERITY severity, string text)
 {
     Debug.WriteLine(text);
 }
Exemplo n.º 5
0
		public bool SetSciterOption(SciterXDef.SCITER_RT_OPTIONS option, IntPtr value)
		{
			Debug.Assert(_hwnd != IntPtr.Zero);
			return _api.SciterSetOption(_hwnd, option, value);
		}
Exemplo n.º 6
0
		public void CreateOwnedWindow(IntPtr owner, int width, int height, SciterXDef.SCITER_CREATE_WINDOW_FLAGS creationFlags = DefaultCreateFlags)
		{
			PInvokeUtils.RECT frame = new PInvokeUtils.RECT();
			frame.right = width;
			frame.bottom = height;
			CreateWindow(frame, creationFlags, owner);
		}
Exemplo n.º 7
0
 protected override void OnOutput(SciterXDef.OUTPUT_SUBSYTEM subsystem, SciterXDef.OUTPUT_SEVERITY severity, string text)
 {
     Debug.WriteLine(String.Format("{0} ({1}, {2})", text.Trim(), subsystem, severity));
 }
Exemplo n.º 8
0
 protected override void OnOutput(SciterXDef.OUTPUT_SUBSYTEM subsystem, SciterXDef.OUTPUT_SEVERITY severity, string text)
 {
     msgs.Add(Tuple.Create(subsystem, severity, text));
 }
 protected abstract void OnOutput(SciterXDef.OUTPUT_SUBSYTEM subsystem, SciterXDef.OUTPUT_SEVERITY severity, string text);
Exemplo n.º 10
0
 // Overridables
 protected virtual SciterXDef.LoadResult OnLoadData(SciterXDef.SCN_LOAD_DATA sld)
 {
     // Do default loading of lib_console
     if(_lc_files.ContainsKey(sld.uri))
     {
         Debug.Assert(_hwnd != IntPtr.Zero, "Call SciterHost.SetupWindow() first");
         _api.SciterDataReady(_hwnd, sld.uri, _lc_files[sld.uri], (uint)_lc_files[sld.uri].Length);
     }
     return (uint)SciterXDef.LoadResult.LOAD_OK;
 }
Exemplo n.º 11
0
 protected virtual void OnDataLoaded(SciterXDef.SCN_DATA_LOADED sdl)
 {
 }