Re: [Pythonmac-SIG] [ANN] PyObjC 5.0

Ronald Oussoren via Pyobjc-dev <[email protected]> Fri, 21 Sep 2018 13:50:23 +0200
Newsgroups gmane.comp.python.pyobjc.devel,gmane.comp.python.apple
Message-ID <[email protected]>
--===============8915986748297349189==
Content-type: multipart/alternative;
 boundary="Apple-Mail=_EAC5F368-6C42-4D02-AF88-3CF6B944F154"


--Apple-Mail=_EAC5F368-6C42-4D02-AF88-3CF6B944F154
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 21 Sep 2018, at 05:59, Glyph <[email protected]> wrote:
>=20
> On Sep 18, 2018, at 1:22 PM, Ronald Oussoren via Pythonmac-SIG =
<[email protected] <mailto:[email protected]>> wrote:
>>=20
>> PyObjC 5.0 is out
>=20
> Thanks again for your tireless (or at least apparently tireless) =
maintenance, Ronald!
>=20
>> * Added bindings for the =E2=80=9CCarbonCore=E2=80=9D subframework of =
the =E2=80=9CCoreServices=E2=80=9D framework.
>>=20
>> Most APIs in this subframework are not available to Python, only =
those APIs that are not deprecated and seem interesting are exposed.
>=20
> One thing I wondered about when I saw "carbon" here is that I wonder =
if the APIs that could make =
https://pythonhosted.org/pyobjc/examples/Cocoa/AppKit/HotKeyPython/index.h=
tml =
<https://pythonhosted.org/pyobjc/examples/Cocoa/AppKit/HotKeyPython/index.=
html> are exposed again? =20

The API used in that example is not exposed through PyObjC at this time =
(AFAIK it is part of =E2=80=9CCarbon.framework=E2=80=9D, not the =
CarbonCore sub framework of =E2=80=9CCoreServices.framework=E2=80=9D.=20

I=E2=80=99m open to adding bindings to interesting APIs, but note that =
=E2=80=9CRegisterEventHotKey=E2=80=9D is not documented on Apple=E2=80=99s=
 website and might not be the right solution for modern code. I don=E2=80=99=
t know yet what the right solution is though (a number of APIs that are =
exposed through PyObjC can be used to implement similar functionality).

> The cautions that the relevant Carbon APIs require 32-bit mode are =
inaccurate; =
https://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.htm=
l =
<https://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-cocoa.ht=
ml> explains that they're still supported in sandboxed Mac App Store =
apps, so they're just poorly documented, not deprecated.  (It seems that =
there's never been a proper Cocoa replacement for this functionality, =
just a couple of popular wrappers floating around out there=E2=80=A6)
>=20
> This is something I have wanted to do in Python many times, but never =
quite badly enough to figure out all the build gymnastics required to =
get the bindings for https://github.com/shpakovski/MASShortcut =
<https://github.com/shpakovski/MASShortcut> built and bundled with my =
application.

I=E2=80=99ll look into exposing this API for PyObjC 5.1, even if that =
means adding a very limited set of bindings for Carbon.framework.

>=20
> -glyph
>=20
> P.S.: speaking of build gymnastics, does anyone on this list happen to =
have a way to use CocoaPods or something similar to pull in open source =
Cocoa frameworks to a PyObjC application?

I haven=E2=80=99t looked into this yet.  I guess the hardest part is =
creating the metadata for constants and pointer arguments. Could you =
file and issue for this? =20

Ronald=

--Apple-Mail=_EAC5F368-6C42-4D02-AF88-3CF6B944F154
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 21 Sep 2018, at 05:59, Glyph &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><div class=3D"">On Sep =
18, 2018, at 1:22 PM, Ronald Oussoren via Pythonmac-SIG &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><div =
class=3D""><blockquote type=3D"cite" class=3D""><br class=3D""><div =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D""><b class=3D"">PyObjC =
5.0 is out</b><br class=3D""></div></div></blockquote><div class=3D""><br =
class=3D""></div><div class=3D"">Thanks again for your tireless (or at =
least apparently tireless) maintenance, Ronald!</div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;" class=3D""><div class=3D""><div class=3D""><div =
class=3D"">* Added bindings for the =E2=80=9CCarbonCore=E2=80=9D =
subframework of the =E2=80=9CCoreServices=E2=80=9D&nbsp;framework.</div><d=
iv class=3D""><br class=3D""></div><div class=3D"">Most APIs in this =
subframework are not available to Python, only those APIs that&nbsp;are =
not deprecated and seem interesting are exposed.<br =
class=3D""></div></div></div></div></div></blockquote><div class=3D""><br =
class=3D""></div><div class=3D"">One thing I wondered about when I saw =
"carbon" here is that I wonder if the APIs that could make&nbsp;<a =
href=3D"https://pythonhosted.org/pyobjc/examples/Cocoa/AppKit/HotKeyPython=
/index.html" =
class=3D"">https://pythonhosted.org/pyobjc/examples/Cocoa/AppKit/HotKeyPyt=
hon/index.html</a>&nbsp;are exposed again? =
&nbsp;</div></div></div></div></blockquote><div><br =
class=3D""></div><div>The API used in that example is not exposed =
through PyObjC at this time (AFAIK it is part of =E2=80=9CCarbon.framework=
=E2=80=9D, not the CarbonCore sub framework of =
=E2=80=9CCoreServices.framework=E2=80=9D.&nbsp;</div><div><br =
class=3D""></div><div>I=E2=80=99m open to adding bindings to interesting =
APIs, but note that =E2=80=9C<span style=3D"background-color: rgb(255, =
255, 255);" class=3D""><font color=3D"#222222" class=3D""><span =
style=3D"font-size: 1.1em;" =
class=3D"">RegisterEventHotKey</span></font><font color=3D"#222222" =
size=3D"2" class=3D""><span style=3D"caret-color: rgb(34, 34, 34);" =
class=3D"">=E2=80=9D</span></font><font color=3D"#222222" class=3D""><span=
 style=3D"font-size: 1.1em;" class=3D"">&nbsp;is not documented on =
Apple</span><font size=3D"2" class=3D"">=E2=80=99</font><span =
style=3D"font-size: 1.1em;" class=3D"">s website and might not be the =
right solution for modern code. I don</span><font size=3D"2" =
class=3D"">=E2=80=99</font><span style=3D"font-size: 1.1em;" class=3D"">t =
know yet what the right solution is though (a number of APIs that are =
exposed through PyObjC can be used to implement&nbsp;</span><font =
size=3D"2" class=3D"">similar</font><span style=3D"font-size: 1.1em;" =
class=3D"">&nbsp;functionality).</span></font></span></div><div><span =
style=3D"background-color: rgb(255, 255, 255);" class=3D""><font =
color=3D"#222222" class=3D""><span style=3D"font-size: 1.1em;" =
class=3D""><br class=3D""></span></font></span></div><blockquote =
type=3D"cite" class=3D""><div class=3D""><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D""><div class=3D""><div class=3D"">The cautions that the =
relevant Carbon APIs require 32-bit mode are inaccurate;&nbsp;<a =
href=3D"https://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-in-c=
ocoa.html" =
class=3D"">https://blog.shpakovski.com/2012/07/global-keyboard-shortcuts-i=
n-cocoa.html</a>&nbsp;explains that they're still supported in sandboxed =
Mac App Store apps, so they're just poorly documented, not deprecated. =
&nbsp;(It seems that there's never been a proper Cocoa replacement for =
this functionality, just a couple of popular wrappers floating around =
out there=E2=80=A6)</div></div></div></div></blockquote><blockquote =
type=3D"cite" class=3D""><div class=3D""><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D""><div class=3D""><div class=3D""><br class=3D""></div><div =
class=3D"">This is something I have wanted to do in Python many times, =
but never quite badly enough to figure out all the build gymnastics =
required to get the bindings for&nbsp;<a =
href=3D"https://github.com/shpakovski/MASShortcut" =
class=3D"">https://github.com/shpakovski/MASShortcut</a>&nbsp;built and =
bundled with my =
application.</div></div></div></div></blockquote><div><br =
class=3D""></div>I=E2=80=99ll look into exposing this API for PyObjC =
5.1, even if that means adding a very limited set of bindings for =
Carbon.framework.</div><div><br class=3D""></div><div><blockquote =
type=3D"cite" class=3D""><div class=3D""><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D""><div class=3D""><div class=3D""><br class=3D""></div><div =
class=3D"">-glyph</div><div class=3D""><br class=3D""></div><div =
class=3D"">P.S.: speaking of build gymnastics, does anyone on this list =
happen to have a way to use CocoaPods or something similar to pull in =
open source Cocoa frameworks to a PyObjC =
application?</div></div></div></div></blockquote></div><br class=3D""><div=
 class=3D"">I haven=E2=80=99t looked into this yet. &nbsp;I guess the =
hardest part is creating the metadata for constants and pointer =
arguments. Could you file and issue for this? &nbsp;</div><div =
class=3D""><br class=3D""></div><div class=3D"">Ronald</div></body></html>=

--Apple-Mail=_EAC5F368-6C42-4D02-AF88-3CF6B944F154--


--===============8915986748297349189==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8915986748297349189==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev

--===============8915986748297349189==--