CEF.swift icon indicating copy to clipboard operation
CEF.swift copied to clipboard

Some extra classes

Open infrom-software opened this issue 6 years ago • 15 comments

I badly need CefMessageRouter.

infrom-software avatar Nov 17 '17 07:11 infrom-software

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

lvsti avatar Nov 17 '17 20:11 lvsti

Yep.

infrom-software avatar Nov 17 '17 20:11 infrom-software

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

lvsti avatar Nov 17 '17 20:11 lvsti

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

infrom-software avatar Nov 17 '17 21:11 infrom-software

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

lvsti avatar Nov 17 '17 21:11 lvsti

Oh, I see. CefMessageRouter implies renderer in swift.

infrom-software avatar Nov 17 '17 21:11 infrom-software

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

  • modifying CEF a bit
  • creating a C API for the C++ classes
  • restructuring CEF.swift
  • wrapping the C API with a swift library

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

lvsti avatar Nov 19 '17 21:11 lvsti

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.

lvsti avatar Nov 19 '17 21:11 lvsti

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

infrom-software avatar Nov 19 '17 21:11 infrom-software

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. :)

SyberToto avatar May 03 '19 14:05 SyberToto

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 avatar May 06 '19 21:05 lvsti

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

lvsti avatar May 23 '19 21:05 lvsti

@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.

SyberToto avatar May 24 '19 02:05 SyberToto

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

lvsti avatar May 24 '19 06:05 lvsti

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

lvsti avatar May 25 '19 17:05 lvsti