Comments (21)
Though, in this particular example, it doesn't matter.
from cef.swift.
thanks for spotting it, fixed it for branch 3202
from cef.swift.
In CEFDemo, in createApplication(), Nib stuff creates an unnecessary extra-window. Nib not needed here since top-level window is created by CEF.
from cef.swift.
Is that cef_application_mac_capi.h file really needed? I mean, can be moved into CEF.swift?
from cef.swift.
well so far I have been trying to keep the codebase free from AppKit (using Foundation only), but since the CEF framework already links against pretty much all the application frameworks (AppKit included), I guess I could move that file as well into the swift package
from cef.swift.
What about creating CEFDemo Helper in swift (as a dependency target for CEFDemo target)?
from cef.swift.
Makes sense, I've made some progress on it but got stuck with some module import issues. ETA probably this weekend.
from cef.swift.
Check out the 3202 branch which now has a CEFApplication
class that wraps the common required functionality for event dispatch, and also a CEFDemo Helper (Swift)
target in the sample project which makes it unnecessary to build the sample helpers in the CEF binary distribution. There is one caveat: if you implement the helper app in Swift, it gets packaged with the Swift standard libraries which means an additional 11 MB in the binary size. If you donβt do anything special in the render process, I recommend using the CEFDemo Helper (C)
target which does the exact same thing, just in 10 KB. :)
from cef.swift.
Elegant!
from cef.swift.
Things from cef_application_mac_capi.h can be absorbed in CEFApplication.swift, can't they? I mean @objc protocol ...
from cef.swift.
Agree, CEFDemo Helper (Swift) is currently worthless (and keeping it alongside (C) target is rather confusing ). Maybe Swift runtime will not be copied anymore in the future.
from cef.swift.
I use 10.13, why not ?
from cef.swift.
ok so can we close this issue now?
from cef.swift.
Few lines of code in CEFApplication.swift and cef_application_mac_capi.h not needed at all. CEFDemo.xcodeproj needs some tweaks.
It's up to you.
from cef.swift.
- You use 10.13 but others might not. There is no harm in having 10.9 as the deployment target
- Which lines do you think are not needed in
cef_application_mac_capi.h
?CefAppProtocol
conformance is a must for any NSApplication subclass to work properly with CEF
from cef.swift.
- Ok.
- My mistake: Put few lines of code in CEFApplication.swift and then cef_application_mac_capi.h file won't be needed at all.
May be these...
@objc protocol CrAppProtocol {
func isHandlingSendEvent() -> Bool
}
@objc protocol CrAppControlProtocol: CrAppProtocol {
func setHandlingSendEvent( handlingSendEvent: Bool)
}
protocol CefAppProtocol: CrAppControlProtocol {
}
P.S.
UnderlayOpenGLHostingWindow is kind of bogus.
from cef.swift.
I didn't think of that but it actually makes sense for the protocols. As for UnderlayOpenGLHostingWindow
, Swift doesn't support forward declarations but I can sneak it into the framework header so I can eventually skip the cef_application_mac_capi.h
hack. Thanks for the suggestion.
from cef.swift.
btw I have a PR for CEF (https://bitbucket.org/chromiumembedded/cef/pull-requests/129) that will make it possible to include the cef_application_mac.h
in the module, which will make the above workaround unnecessary.
from cef.swift.
Even better.
p.s. only to complete the workaround:
UnderlayOpenGLHostingWindow's implementation does nothing but checks in init that window's contentRect it's not zero width or height. (It seems it did more in the past.) And it's not exposed elsewhere. Presuming it won't change, it can be easily reimplemented in CEFApplication.swift or... simply neglected (It's more of convenience: keep in mind to use UnderlayOpenGLHostingWindow vs. be aware to check not zero.) So, no need to touch the framework header.
from cef.swift.
I think CEFDemo looks better now; can we close this issue?
(apart from some small tweaks in CEFDemo.xcodeproj)
from cef.swift.
How UnderlayOpenGLHostingWindow works and what it does is an implementation detail that CEF.swift should not know/care about. If the framework states that browser windows should inherit from it, CEF.swift should make that possible, even if the class is just an empty subclass. So I'm leaving it there for now.
from cef.swift.
Related Issues (20)
- Build CEF binary with flags HOT 1
- CEFResourceHandler does not seem to work as expected HOT 2
- Try to load local file with Request Interception HOT 1
- Started start at https domains other than .com
- Swift Helper HOT 1
- URL Request
- window.open() crashes CEFSwift
- Building Xcode project
- How to build the CEFswift with latest CEF 4606 binary? HOT 3
- Update to CEF 4606 (Chrome 94) HOT 2
- CEFSwift framework compiling issue in another project. HOT 1
- CEFSwift framework running issue.
- CEFSwift framework running issue.
- GPU process crashed when running the browser.
- CEF display issue.
- CEFDisplayHandler getting error when calling.
- Cookie manager not working from 85 to current
- Error when using windowless
- Support newer versions of CEF
- Swift 4 compatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cef.swift.