Declares using HTMLViewer.Handle with renderer set to WebKit

Has anyone actually been able to create a declare to manipulate the HTMLViewer when the renderer is set to WebKit?

In recent MBS Plugin update I added functions for Chromium.

It maybe doable with declares, too.
HTMLViewer.Handle gives cef_browser_t* and you need to lookup declarations (of right version), calculate offsets and pick your function pointers from virtual method table.

Yeah, that is the part I am having difficulty with… I think I might just learn how to write a plugin to access the functionality… I would use your plugin, but I need to be able to include the full source of everything I am using… I will fire off some bug reports against the Windows CEF HTMLViewer and hopefully Xojo will get around to updating it before I finish learning Qt :wink:

Well, you could of course email me and discuss with me a source code license of this plugin part.
But maybe ask your boss if that is really required for such a small feature of your app?

I am my boss :wink: Unless you are willing your code to be released openly, even a source code license won’t work for the project… Nothing personal, but I only code for fun and once this is done the source is will be released to the public domain so I need anyone interested in downloading it to be able to run it without issues of dependancies… Of course, having to write declares and/or use plugins to get cross-platform functionality is kind of sad…

Well, I would consider my plugin collection being a standard add-on for Xojo, so I would simply as Xojo user require it :slight_smile:

Ah, just found a snippet:

Dim mb As MemoryBlock = Ptr(HTMLViewer1.Handle)
Dim reloadDelegate As New CefReload( mb.Ptr(44) )
reloadDelegate.Invoke(mb)

This will reload current page.

Thanks a bunch… But what is “CefReload”?

a delegate with right parameters. In this case just takes a ptr as parameter.

Thanks, will post any results :slight_smile:

good luck. I still prefer the plugin way :slight_smile:

Yeah, and I would recommend anyone else to use your plugins as well… I am still thinking of looking at writing a plugin to use ChromiumEmbedded on all three platforms to get rid of these little issues, but if the help you have provided can get me past the little hurdles I have with Windows, then no need to do so in the immediate future (yet something else on my “to-do list”)…

It’s of course welcome if you build a cross platform Chromium plugin :slight_smile:

Sure, try to make me learn more :wink: I am able to get the virtual methods of the cef_browser_t structure working thanks to your help… Just wondering if I am on the right path with thinking that I can get cef_frame_t structure pointer and then do the same thing in there as with the cef_browser_t ?

Of course you can. The plugin does similar things.

k… I will see what I able to do… A big hug for all your help…

Thanks so much Christian, got the few things I needed to work… Looks like I can put off that cross-platform CEF plugin for a bit phew :wink:

All of this work is for a HTMLViewer sub-class to add in features that are missing from the built-in one…

Hello

Please may I ask:

What reference document / header file contains the list of offsets of function pointers within the cef_browser_t structure?

For example, the fact that pointer to the Reload function is at offset 44.

Could you provide a link?

Thanks!

you have to download chromium source code in right version and take a look at the header files there.

the offset 44 is in the virtual function table of the class.
That’s very specific and can change from version to version!

Thanks Christian.