GUI control via Cef-prefixed functions

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Tue Dec 17, 2013 11:21 pm

Hello there!

Since CEF runs on 3 different OSes, it of course leads to the thing where one has to maintain one GUI code for each independent OS. Therefore, I was wondering why there was no "unified" way?

Example:

Code: Select all
class CefGUI {
    public:
    addButton(...)
    addMenuEntry(...)
    // snip
);


That would make it A LOT easier to maintain the main() function across OSes, as it would simplify the way of designing a CEF app. Currently, to modify my CEF client to work across the different OSes, I have to go thru each of the files that contain main() and change them independently - thus having to test it on each OS of course.

Kind regards,
Ingwie
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby magreenblatt » Wed Dec 18, 2013 12:08 am

It's pretty strait-forward to create an abstract GUI framework that can be shared on Windows and Linux -- Chromium has done this with views, and there are other projects like qt, wxWidgets, .Net/mono, etc. Unfortunately OS X has very different requirements for app creation with Cocoa so afaik there is no (good) single GUI framework that can span all 3 platforms and provide native look and feel. We can abstract some behaviors, as CEF does with popup windows, context menus and JS/file dialogs, but I generally prefer to make CEF-based applications as lightweight as possible on the native side (basically just a container that creates a browser window). Most UI can then be built using web technologies in the browser window.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Wed Dec 18, 2013 6:47 am

I was thinking about taking advantage of ObjC++. I mean, we dont need all widgets that Cocoa provide, so we could define a class in one of the typical header files, and within something like CefGUI.mm, we can create the declaration.

That would result in basically three declaration files: for windows, for linux, and for mac. And then we could just compile the one file for the os, and ignore the other two. That'd result in fully declared and usable classes that'd span over all three OSes.

An alternative is indeed wxWidgets. It works nicely on OS X as well - okay, the Cocoa port does not support all widgets, but it supports all the basic ones that CEF needs.

i have also seen an ultra basic GUI toolkit called FLTK, or similar. And that made me think: can CEF be spawned with every and each tookit, or just specific ones?
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby magreenblatt » Wed Dec 18, 2013 7:26 pm

CEF supports native windows and off-screen rendering on all 3 platforms so most frameworks can integrate it using one approach or the other. Creating other widget types (buttons, text fields, etc) is currently outside the project's scope.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Fri Dec 20, 2013 3:41 pm

Well, which GUI frameworks are confirmed to work with CEF then? That'd make overall development a lot easier for me. ^^
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby magreenblatt » Fri Dec 20, 2013 4:35 pm

IngwiePhoenix wrote:Well, which GUI frameworks are confirmed to work with CEF then? That'd make overall development a lot easier for me. ^^

See https://code.google.com/p/chromiumembed ... l_Projects. There's also wxWebViewChromium.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: GUI control via Cef-prefixed functions

Postby Czarek » Fri Dec 20, 2013 5:37 pm

IngwiePhoenix wrote:Well, which GUI frameworks are confirmed to work with CEF then? That'd make overall development a lot easier for me. ^^

CEF Python has examples of integrating with wx, Qt, Gtk, Panda3d and Kivy framework.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Sun Dec 22, 2013 9:28 am

Oh! Well I can suit myself with wx ^^. Thanks for the help :3
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby IngwiePhoenix » Tue Dec 24, 2013 10:45 am

wxWebViewChromium does only work on Windows and not on the other platforms such as OS X.
I can not use Python - mainly because I would have to learn it off the ground.

What is the very basic requirement to have CEF spawn in a window? Do I just use the current window I created and give it to CEF - or how do I do that?
I currently, to be honest, don't understand how CEF appears - probably because I am not a real GUI coder so far. :I
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: GUI control via Cef-prefixed functions

Postby Czarek » Tue Dec 24, 2013 11:31 am

IngwiePhoenix wrote:What is the very basic requirement to have CEF spawn in a window? Do I just use the current window I created and give it to CEF - or how do I do that?

Create a window and then pass window handle to CreateBrowser().
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Next

Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 15 guests