profile
viewpoint
Yury pravic C++/Rust/Python. Low-level, network, cross-platform software development. Reverse engineering as an option.

sciter-sdk/go-sciter 1889

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development

pravic/winapi-kmd-rs 355

Windows Kernel-Mode Drivers written in Rust

sciter-sdk/pysciter 235

Python bindings for Sciter

pravic/rust-gfx-sciter 16

Rust GFX examples with Sciter UI.

pravic/kmd-env-rs 15

Rust environment for the Windows Kernel-Mode Drivers

g-k/cargo-show 9

cargo subcommand to print package metadata like pip show, apt-cache show, npm view, gem query, etc.

pravic/sciter-wxwidgets-sample 4

Sciter integration for wxWidgets

sciter-sdk/json-value-visualizer 4

sciter::value visualizer for Visual Studio

pravic/zoomquilt 2

Zoomquilt Sciter sample

pravic/eyeleo 1

EyeLeo applet for Sciter

issue commentsciter-sdk/rust-sciter

How to embed into GameMaker window?

It's not immediately clear to me how this allows me to route window events to Sciter, but is it at least possible?

Something like this:

let hwnd = window_handle as sciter::types:_HWINDOW;
hook_messages(hwnd);
let mut frame = sciter::Window::attach(hwnd);
fn hook_messages(hwnd: HWINDOW) {
	use sciter::types::*;

	#[link(name="user32")]
	extern "system"
	{
		fn SetWindowLongPtrW(hwnd: HWINDOW, index: i32, new_data: WndProc) -> WndProc;
		fn CallWindowProcW(prev: WndProc, hwnd: HWINDOW, msg: UINT, wp: WPARAM, lp: LPARAM) -> LRESULT;
	}

	type WndProc = extern "system" fn (hwnd: HWINDOW, msg: UINT, wp: WPARAM, lp: LPARAM) -> LRESULT;
	type PrevProcs = std::collections::HashMap<HWINDOW, WndProc>;

	thread_local! {
		static PREV_PROC: std::cell::RefCell<PrevProcs> = Default::default();
	}

	// https://sciter.com/developers/embedding-principles/
	extern "system" fn wnd_proc(hwnd: HWINDOW, msg: UINT, wp: WPARAM, lp: LPARAM) -> LRESULT {
		// first, pass the message to Sciter.
		let mut handled = false as BOOL;
		let lr = (_API.SciterProcND)(hwnd, msg, wp, lp, &mut handled);

		// if it was handled by Sciter, we're done here.
		if handled != 0 {
			return lr;
		}

		// if not, call the original window proc.
		let mut lr: LRESULT = 0;
		PREV_PROC.with(|procs| {
			let prev_proc = *procs.borrow().get(&hwnd).expect("An unregistered WindowProc is called somehow.");
			lr = unsafe { CallWindowProcW(prev_proc, hwnd, msg, wp, lp) }
		});

		// and return its result
		lr
	}

	// Subclass the window in order to receive its messages.
	const GWLP_WNDPROC: i32 = -4;
	let prev_proc = unsafe { SetWindowLongPtrW(hwnd, GWLP_WNDPROC, wnd_proc) };
	PREV_PROC.with(|procs| {
		procs.borrow_mut().insert(hwnd, prev_proc);
	});



}
GirkovArpa

comment created time in a day

issue commentsciter-sdk/rust-sciter

How to embed into GameMaker window?

I will add that replacing frame.run_app() with frame.run_loop() makes no difference at all.

  1. No, you don't need run_app() - it runs its own message loop and the host application (GameMaker) will be frozen at that time. Or will behave like this:

Also, using sciter::Window::new() instead of sciter::Window::attach() before the program's own window is displayed, causes the Sciter window to be displayed, and the GameMaker window doesn't appear until after the Sciter window is closed.

  1. Window.attach is about attaching Sciter (as an HTML engine) to an existing native window.

Window.create creates a new native window and then attaches Sciter to it. So, the difference is about who creates a native window.

In any case, you have to route some WinAPI messages to Sciter in order to get UI working. And it can be done via SciterProcND - apparently, I haven't exposed it properly in Rust bindings, need to do.

So, you have to intercept messages in an existing window (for example, via SetWindowLongPtrW + GWLP_WNDPROC) and route messages to Sciter. Check out this article about some details.

Feel free to ask questions. Also, you can share your code or tell how you are trying to use that GameMaker, perhaps there is a better way.

GirkovArpa

comment created time in 3 days

delete branch sciter-sdk/rust-sciter

delete branch : clippy-warnings

delete time in 14 days

push eventsciter-sdk/rust-sciter

pravic

commit sha 6758752f4de931f4232be4d32fd2dac5b88bb80b

fix: Fix clippy warnings.

view details

push time in 14 days

PR merged sciter-sdk/rust-sciter

Fix clippy warnings.
+17 -12

0 comment

3 changed files

pravic

pr closed time in 14 days

issue commentsciter-sdk/rust-sciter

How to embed into GameMaker window?

I believe the issue is with the difference in pumping messages. Do you attach from a different thread?

GirkovArpa

comment created time in 14 days

issue commentsciter-sdk/rust-sciter

How to embed into GameMaker window?

What's GameMaker?

GirkovArpa

comment created time in 14 days

pull request commentsciter-sdk/go-sciter

Workaround for issue #245

A reminder for me to test this.

shumatech

comment created time in 25 days

issue closedsciter-sdk/go-sciter

Issue in getting the package...

When I run the command "go get -x github.com/sciter-sdk/go-sciter" it is giving me error "cannot use _cgo1 (type *_Ctype_HWINDOW) as type **_Ctype_struct__GtkWidget in argument to _Cfunc_SciterGetElementHwnd" How to resolve it?

closed time in a month

harshaldhone

issue commentsciter-sdk/go-sciter

Issue in getting the package...

#245

harshaldhone

comment created time in a month

PR opened sciter-sdk/rust-sciter

Fix clippy warnings.
+17 -12

0 comment

3 changed files

pr created time in a month

create barnchsciter-sdk/rust-sciter

branch : clippy-warnings

created branch time in a month

starteddwmkerr/hacker-laws

started time in a month

pull request commentmozilla-services/syncstorage-rs

Chore/update 202009

skipping audit pending https://github.com/bodil/sized-chunks/issues/11

There's cargo audit --ignore ADVISORY_ID that might help.

jrconlin

comment created time in a month

issue commentsciter-sdk/go-sciter

sample build report error under macOS; go is 1.15

Indeed

skydig

comment created time in 2 months

issue commentsciter-sdk/go-sciter

No longer compiles OSX after go 1.15 released

Does anybody have any idea what is wrong with cgo in 1.15?

psiservices-scohen

comment created time in 2 months

issue closedsciter-sdk/go-sciter

Cant installl on linux

Im getting this error when i run go get -x github.com/sciter-sdk/go-sciter

cgo1.go $WORK/b001/utils.cgo1.go $WORK/b001/_cgo_import.go

github.com/sciter-sdk/go-sciter

../../../go/src/github.com/sciter-sdk/go-sciter/sciter.go:1052:142: cannot use _cgo1 (type *_Ctype_HWINDOW) as type **_Ctype_struct__GtkWidget in argument to _Cfunc_SciterGetElementHwnd

closed time in 2 months

hcharlie1201

issue commentsciter-sdk/go-sciter

Cant installl on linux

#245

hcharlie1201

comment created time in 2 months

issue openeddeprecrated/net2-rs

github.com/deprecated-rs maybe?

Why github.com/deprecated? Should this namespace cover other languages than Rust?

If Rust only, then it's better to name it github.com/deprecated-rs.

created time in 2 months

starteddtolnay/cxx

started time in 2 months

issue commentsciter-sdk/rust-sciter

How to obtain current GL context under X11?

No preferences. Feel free to decide)

sztomi

comment created time in 2 months

issue commentsciter-sdk/go-sciter

No longer compiles OSX after go 1.15 released

A problem indeed but I haven't looked on Go 1.15 yet.

psiservices-scohen

comment created time in 2 months

issue closedsciter-sdk/go-sciter

”go get -x github.com/sciter-sdk/go-sciter“ is error in “cgo”

Hello, I have encountered the following error:

/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p github.com/sciter-sdk/go-sciter -buildid 1Kajp57NcmyFvaNCGAVK/1Kajp57NcmyFvaNCGAVK -goversion go1.15 -D "" -importcfg $WORK/b001/importcfg -pack -c=4 ./generate.go ./types_string.go ./value.go ./wrapper.go $WORK/b001/_cgo_gotypes.go $WORK/b001/sciter.cgo1.go $WORK/b001/sciter_linux.cgo1.go $WORK/b001/types.cgo1.go $WORK/b001/utils.cgo1.go $WORK/b001/_cgo_import.go
# github.com/sciter-sdk/go-sciter
go/pkg/mod/github.com/sciter-sdk/go-sciter@v0.5.0/sciter.go:1025:142: cannot use _cgo1 (type *_Ctype_HWINDOW) as type **_Ctype_struct__GtkWidget in argument to _Cfunc_SciterGetElementHwnd

微信图片_20200819140212

go version:

go version go1.15 linux/amd64

closed time in 2 months

xiaonaoer

issue commentsciter-sdk/rust-sciter

How to obtain current GL context under X11?

https://sciter.com/forums/topic/porting-opengl-behavior-to-linux-rust/

Isn't Rust-specific.

sztomi

comment created time in 2 months

issue commentsharkdp/dbg-macro

Isatty detection on Windows

Sorry for the confusion.

I was talking about Windows support: GetConsoleMode (and a workaround for msys via GetFileInformationByHandleEx).

pravic

comment created time in 2 months

pull request commentsciter-sdk/go-sciter

fix SYS INFO is not available in demo9.go

Thanks!

Awezome

comment created time in 2 months

push eventsciter-sdk/go-sciter

Awezome

commit sha 43da399191e2ff21fbb86e13d116a97eab0fd5ef

fix SYS INFO is not available in demo9.go

view details

push time in 2 months

issue openedsharkdp/dbg-macro

Isatty detection on Windows

Is here: https://github.com/softprops/atty/blob/master/src/lib.rs#L66

created time in 3 months

issue commentsciter-sdk/go-sciter

stdout.println() doesn't work

SciterSetupDebugOutput is supposed to print the output. I'll check it.

WinXaito

comment created time in 3 months

issue commentsciter-sdk/go-sciter

Demonstrate 04 code button 1 will cause a crash How to fix it?

Was fixed already. See #239.

Aquarian-Age

comment created time in 3 months

release sciter-sdk/rust-sciter

0.5.53

released time in 3 months

created tagsciter-sdk/rust-sciter

tag0.5.52

Rust bindings for Sciter

created time in 3 months

created tagsciter-sdk/rust-sciter

tag0.5.53

Rust bindings for Sciter

created time in 3 months

created tagsciter-sdk/rust-sciter

tag0.5.51

Rust bindings for Sciter

created time in 3 months

more