Giter Site home page Giter Site logo

Adapt for OSX about cefpython HOT 38 CLOSED

magicyuuu avatar magicyuuu commented on July 20, 2024
Adapt for OSX

from cefpython.

Comments (38)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I currently only know Python but if there is anything I can do to help in this 
effort please let me know. 

Original comment by [email protected] on 24 Oct 2012 at 12:47

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I do have a fair amount of experience working with PyObjC if that helps. 

Original comment by [email protected] on 24 Oct 2012 at 12:49

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
It is required to know a bit of C++, Cython and Objective-C to create an OSX 
port. It should be an easier task then the linux port as there are ready 
binaries:

http://code.google.com/p/chromiumembedded/downloads/detail?name=cef_binary_1.118
0.832_macosx.zip

I am not yet sure about the objective-C stuff, how to do this in Cython, I am 
now looking at macosx binary /cefclient/cefclient_mac.mm and have no idea of 
how to port this objective-c code to c/c++ in Cython.

The other problem is that I don't own any Mac. Here in Poland a Mac is a rare 
thing, I ever saw one a few years ago, only because my friend was a Ruby On 
Rails fanatic and bought one. Though I'm flying to Canada to my uncle in a few 
days, he's a computer hobbyist, maybe he owns a mac thing, I will be staying 
there for a while.

Original comment by [email protected] on 24 Oct 2012 at 6:29

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I've been googling for "cython cocoa" and found only this tip useful:

https://groups.google.com/d/msg/cython-users/Je1o6zQkPuY/s4on7ar7yoQJ

Original comment by [email protected] on 24 Oct 2012 at 8:11

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
My feeling is that PyObjC is the right tool for the job. It's supposed to be a 
bidirectional bridge, so you can call Python from ObjC and vice versa, but I've 
only ever written Python that called ObjC. I'm not 100% sure what a project 
like this entails, though, so I can't say for sure if this will do everything 
needed. 

Have a great trip to Canada! Beautiful country. 

I once went to an Apple store and asked how I could get an older operating 
system (10.6, Snow Leoapard -- not that old, still in widespread use) and the 
salesperson told me I should just torrent it and use a Virtual Machine; Apple 
doesn't sell the Snow Leopard OS anymore. So you might have some luck that way?

Are there any resources you might recommend for me to wrap my head around how 
projects like this work? I tried browsing the source but didn't really know 
where to start. 

Thanks!

Original comment by [email protected] on 24 Oct 2012 at 1:37

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I've looked over pyobjc examples and every time I see a setup.py, I hope it is 
possible to run pyobjc as pure python without compilation, then it might work.

>how projects like this work?

My way of doing this is a lot of googling, struggling with documentation, 
finding good examples, learning by trial and error. I've started with baby 
steps and it just growed. Try doing some simple thing, one thing at a time.

Original comment by [email protected] on 24 Oct 2012 at 2:19

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Yes, I run PyObjc without compilation as "pure" python (links down to PyObjC, 
of course, which runs ObjC)

Haha thanks, that does indeed seem to be the way to learn this kind of thing. 

Original comment by [email protected] on 24 Oct 2012 at 2:22

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Cython can be sometimes hard to debug after some big refactoring, compiler 
errors are obfuscated, so better to avoid this, I try to compile it often.

Original comment by [email protected] on 24 Oct 2012 at 2:25

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Some guys let me know they ported cefpython to CEF 3 (single process mode), 
they also have a Mac version. I've looked over the sources, the problem with 
OSX specific code can be solved by using wxPython or Tkinter to create windows, 
then there isn't much code to write for OSX, there is one .mm file with only 3 
functions:

void CefWindowInfo_SetAsChild(CefWindowInfo *_self, CefWindowHandle parent);
void MacInit();
void MacShutdown();

There are some other minor differences, the conversion between python string <> 
cef string in functions PyStringToCefString and CefStringToPyString needs to be 
done in a different way, by using PyUnicode_DecodeUTF32 / PyUnicode_DecodeUTF16 
as char size on mac is 4 bytes.

Another issue is Auth Dialog for http authentication, how do we create that 
dialog? Using wxPython (that would need a delegate) or do we call OSX-specific 
functions?

I still don't have a mac so this issue will have to wait.

Original comment by [email protected] on 14 Nov 2012 at 3:37

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Wow, that doesn't look bad at all, I hope. 
As for the Auth Dialog, I'm not sure. I currently use PyQt for my desktop GUIs. 
I know it isn't hard to make a dialog in PyObjC; if the auth dialog is minor, 
it probably isn't more than 20 lines of code (I don't know anything about the 
http auth though). I know small dialogues on wxPython are very trivial; I've 
heard awful things about tkinter in general but never worked with it myself. 

I don't know enough about how cef / cefpython work to answer well though (for 
example, is cefpython basically just a better webview embedded in another 
(wxpython/pyqt/tkinter) app?. If you're not familiar with desktop gui's, I can 
send you some of my code for my main pyqt desktop gui, which also wraps a 
webview. 

Original comment by [email protected] on 14 Nov 2012 at 4:20

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Cefpython is just a webview, you pass a window handle to CreateBrowser() and 
that's all cef needs to know. 

I think that we can create the http auth dialog using tkinter, as I remember 
from the Issue 1 discussion it comes by default with any python so there are no 
dependencies, after googling "tkinter dialog example" I have this:

http://www.pythonware.com/library/tkinter/introduction/dialog-windows.htm

> Figure 10-1. running the dialog2.py script

This is exactly what we need, 2 inputs and OK/Cancel, that should work.

Original comment by [email protected] on 14 Nov 2012 at 10:49

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
The http auth window needs to be modal, googling "tkinter modal dialog" shows 
some solutions. Maybe we could even get rid of that c++ code for the windows 
platform, I've created an issue for that: Issue 26.

Original comment by [email protected] on 14 Nov 2012 at 11:05

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
What is the status of the Mac port?

Original comment by [email protected] on 4 Mar 2013 at 3:09

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I haven't yet started working on it, I still don't own any Mac machine,
there were only general improvements in the code to prepare for Linux 
and OSX ports.

Original comment by [email protected] on 4 Mar 2013 at 3:25

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Is there any chance you could invite the developers who worked on one to come 
and post their code? Even as a one off code drop, it would give others (such as 
myself) a nice point to work from.

Original comment by [email protected] on 4 Mar 2013 at 3:30

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Alex, The Mac code I was shared with cannot be made public, though I could
share with you portions of the code that are Mac-specific, first I would
need to find and extract it. I am here to help you with my advice on the
cefpython code, but I would need some declaration from your side that you
will share the code back with the community.

Original comment by [email protected] on 4 Mar 2013 at 4:07

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
CEF 1 does not support Retina displays, but CEF 3 does, see this topic:
http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10620
I think that we should port only CEF 3 to Mac.

Original comment by [email protected] on 2 May 2013 at 1:36

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024

Original comment by [email protected] on 13 Jun 2013 at 7:29

  • Added labels: CEF3

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hi, if you could share the mac code you have I would be willing to take a look 
and contribute back to cefpython. 

I completely agree with only port CEF3 to mac.

Original comment by [email protected] on 4 Sep 2013 at 1:10

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
After a second thought, I don't think using the code I was referring to is
a good idea, it's not open sourced, so we better don't look at it. 

I have a general idea of what to do, so if you're stuck or need help with
anything, just ask, here or on the CEF Python Forum.

Original comment by [email protected] on 4 Sep 2013 at 7:54

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Just wanted to say that i LOVE this project and am excited to use the mac 
build!  

Original comment by [email protected] on 8 Nov 2013 at 5:40

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
That said, what is the status of the mac port now?  I too would love to 
contribute my time if you can give me some suggestions for where to start.

Original comment by [email protected] on 8 Nov 2013 at 6:24

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hi Czarek, currently fetching chromium src on OSX.  You said above that you 
have a general idea of what to do, may I hear your thoughts?

Original comment by [email protected] on 6 Dec 2013 at 12:04

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
#24 mikemahony
If you have any specific questions, I'm glad to answer these.

Original comment by [email protected] on 16 Jan 2014 at 10:04

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hi, has any got this working?

Original comment by [email protected] on 19 Jun 2014 at 3:40

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
if anyone could port to mac, sincerely appreciate it!

Original comment by pianoboysai on 30 Aug 2014 at 5:00

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hello Czarek,

+1 I also looking for (and trying for a couple hour) Mac OSX port, could you 
please let me know when will be public release?

Best regards.

Original comment by [email protected] on 7 Sep 2014 at 4:40

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024

Original comment by [email protected] on 7 Sep 2014 at 7:11

  • Added labels: Restrict-AddIssueComment-Commit

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
The cefpython module compiles fine on Mac. See revision 32846e1f20e1. Created 
the BuildOnMac wiki page. Still to do: a wxpython.py example.

Original comment by [email protected] on 9 Jan 2015 at 11:52

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Added the wxpython.py example in revision e07d0bd04ab4.

There are two problems to be fixed on Mac (Issue 156):
1. Mouse context menu is currently disabled, as it crashes app
2. <select> controls crash app too

Everything else works fine.

Original comment by [email protected] on 10 Jan 2015 at 5:37

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Currently CEF builds on Mac are with tcmalloc memory allocator and this 
requires for the cefpython library to be imported very first in a program 
before any others like wx. Issue 155 is to provide CEF builds for Mac with 
tcmalloc disabled.

Original comment by [email protected] on 10 Jan 2015 at 5:46

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
There are several differences in the wxpython.py example across different 
platforms. Created Issue 159 that tries to list these differences. The goal is 
to provide a single wxpython.py that runs on all platforms.

Original comment by [email protected] on 11 Jan 2015 at 5:27

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Errors when accessing mouse context menu and <select> controls were fixed, see 
Issue 156 for details.

There is still an another minor issue to be fixed: Copy/Paste keyboard 
shortcuts don't work. See Issue 161 for details.

Next tasks on the list:
 * Build with CEF 64-bit binaries
 * Provide Python Wheel binary packages on PyPI for both 32bit and 64bit

Original comment by [email protected] on 11 Jan 2015 at 7:04

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Porting to Mac is complete. Package can be installed using the pip package 
manager:

  pip install cefpython3

The python wheel package that installs contains fat binaries and can run on 
both 32bit and 64bit.

See also the Download wiki page for Mac and the examples section: 
https://code.google.com/p/cefpython/wiki/Download_CEF3_Mac

64bit builds fixed in revision b37e9b39a133.
Installer scripts added in revision 15dc5746e099.

Original comment by [email protected] on 13 Jan 2015 at 7:57

  • Changed state: Fixed

from cefpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.