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

Glyph <[email protected]> Fri, 21 Sep 2018 14:24:45 -0700
Newsgroups gmane.comp.python.pyobjc.devel,gmane.comp.python.apple
Message-ID <[email protected]>
--===============2051700724345330782==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_D5615D34-2216-40B5-8812-D5B4CCAB6237"


--Apple-Mail=_D5615D34-2216-40B5-8812-D5B4CCAB6237
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Sep 21, 2018, at 4:50 AM, Ronald Oussoren <[email protected]> =
wrote:
>=20
>=20
>=20
>> On 21 Sep 2018, at 05:59, Glyph <[email protected] =
<mailto:[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
>=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
>=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).

If there were a more modern solution I'd gladly use it rather than =
asking you to expose gross and ancient Carbon APIs :).  Which APIs that =
are already exposed can do this?

>> 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.
>=20
> 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.

Thanks!

>> -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?
>=20
> 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

Sure, sometime this weekend I'll try to write it up.


--Apple-Mail=_D5615D34-2216-40B5-8812-D5B4CCAB6237
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 Sep 21, 2018, at 4:50 AM, Ronald Oussoren &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br class=3D"Apple-interchange-newline"><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""><div class=3D"" =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><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 class=3D"" style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><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 =
class=3D"" style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;"><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 class=3D""><br =
class=3D""></div><div class=3D"">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 class=3D""><br =
class=3D""></div><div class=3D"">I=E2=80=99m open to adding bindings to =
interesting APIs, but note that =E2=80=9C<span class=3D"" =
style=3D"background-color: rgb(255, 255, 255);"><font color=3D"#222222" =
class=3D""><span class=3D"" style=3D"font-size: =
1.1em;">RegisterEventHotKey</span></font><font color=3D"#222222" =
size=3D"2" class=3D""><span class=3D"" style=3D"caret-color: rgb(34, 34, =
34);">=E2=80=9D</span></font><font color=3D"#222222" class=3D""><span =
class=3D"" style=3D"font-size: 1.1em;">&nbsp;is not documented on =
Apple</span><font size=3D"2" class=3D"">=E2=80=99</font><span class=3D"" =
style=3D"font-size: 1.1em;">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 class=3D"" style=3D"font-size: =
1.1em;">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 =
class=3D"" style=3D"font-size: =
1.1em;">&nbsp;functionality).</span></font></span></div></div></div></bloc=
kquote><div><br class=3D""></div><div>If there were a more modern =
solution I'd gladly use it rather than asking you to expose gross and =
ancient Carbon APIs :). &nbsp;Which APIs that are already exposed can do =
this?</div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D""><div style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D""><div class=3D"" style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><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 class=3D"" =
style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><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 =
class=3D""><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></blockquote><div><br =
class=3D""></div><div>Thanks!</div><br class=3D""><blockquote =
type=3D"cite" class=3D""><div style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D""><div class=3D"" style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><div class=3D""><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"" style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><div class=3D"" style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;">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></blockquote><br =
class=3D""></div><div>Sure, sometime this weekend I'll try to write it =
up.</div><br class=3D""></body></html>=

--Apple-Mail=_D5615D34-2216-40B5-8812-D5B4CCAB6237--


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


--===============2051700724345330782==
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

--===============2051700724345330782==--