lvsti / CEF.swift

Swift bindings for the Chromium Embedded Framework
BSD 3-Clause "New" or "Revised" License
94 stars 29 forks source link

Some extra classes #26

Open infrom-software opened 6 years ago

infrom-software commented 6 years ago

I badly need CefMessageRouter.

lvsti commented 6 years ago

well, that's gonna be tricky since that class is part of libcef_dll_wrapper which is a pure C++ API...

infrom-software commented 6 years ago

Yep.

lvsti commented 6 years ago

do you want to use swift in the renderer process as well?

infrom-software commented 6 years ago

I'm not sure this affects Helper, i.e. it has not to be modified (in C).

lvsti commented 6 years ago

based on what I see in the documentation in cef_message_router.h, you'll need to set up both sides of the channel yourself

infrom-software commented 6 years ago

Oh, I see. CefMessageRouter implies renderer in swift.

lvsti commented 6 years ago

I've done some research, it's not impossible but it involves:

I'm planning to carry this out gradually but due to the size of the task I'd rather not fix any ETA.

lvsti commented 6 years ago

Oh, I see. CefMessageRouter implies renderer in swift. (solution to getting rid of duplicate swift std libs needed)

Even if you use CefMessageRouter, you can have Swift on one side (browser process) and C++ on the other (render process), it doesn't have to be the same language.

infrom-software commented 6 years ago

At first sight I thought that a direct swift port might be possible, using extant CEF.swift classes.

SyberToto commented 5 years ago

Hi @lvsti , I also want CefMessageRouter badly. With this pull request, I assume that the modification for CEF is done. Is there any other progress with CefMessageRouter? Although I'm not experienced with this C/C++/Swift translation, it will be my pleasure if I can help with this issue as I really want CefMessageRouter. :)

lvsti commented 5 years ago

Bridging the wrapper classes is indeed feasible but I always tried to avoid dumping them into the CEFswift module itself because I felt that they didn't belong there. On the other hand, I didn't manage to rearrange the source in a way that allowed both the existing CEFswift and a separate (and preferably optional) CEFswift.Wrappers submodule, so I abandoned that branch some weeks later.

I'll take another look at the impact of shoving everything into CEFswift and let you know what I decided.

lvsti commented 5 years ago

I've made some progress with the message router, hopefully I can get it to work on a branch around the weekend.

SyberToto commented 5 years ago

@lvsti Thanks for following up. Actually, I've added the message router to CEF.swift myself. It's not perfect but it's working. I'd like to have some discussion through email if you are interested, but I cannot find your email address on your Github home page.

lvsti commented 5 years ago

@SyberToto I've created a gitter room for this discussion: https://gitter.im/CEF-swift/wrapper-classes

lvsti commented 5 years ago

here is where I am with it: https://github.com/lvsti/CEF.swift/tree/wrapper-classes-redux