Re: Non-AppKit equivalent for NSWorkspace and/or future-proof poseAsClass?

  • >
    > 1. Can I get the same NSWorkspace notifications from somewhere else?
    > I've
    > nosed through /System/Library/Frameworks without stumbling across
    > anything
    > obvious but I may just be blind.

    Carbon events seems a good way to go:

    See kEventClassApplication in CarbonEvents.h

    Matt Gough
  • Le 9 janv. 08 à 14:13, Matt Gough a écrit :

    >>
    >> 1. Can I get the same NSWorkspace notifications from somewhere
    >> else? I've
    >> nosed through /System/Library/Frameworks without stumbling across
    >> anything
    >> obvious but I may just be blind.
    >
    > Carbon events seems a good way to go:
    >
    > See kEventClassApplication in CarbonEvents.h
    >
    > Matt Gough

    "Carbon events" have the same drawback than NSWorkspace, so it will
    not solve the Window Server connection issue.
  • On 1/9/08 2:13 PM, Matt Gough said:

    >> 1. Can I get the same NSWorkspace notifications from somewhere else?
    >> I've
    >> nosed through /System/Library/Frameworks without stumbling across
    >> anything
    >> obvious but I may just be blind.
    >
    > Carbon events seems a good way to go:
    >
    > See kEventClassApplication in CarbonEvents.h

    I'm not sure I'd recommend Carbon Events for new code.  Apple decided to
    kill 64 bit Carbon, and if you look through CarbonEvents.h you'll see
    that most APIs are 32 bit only.

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • On Jan 9, 2008, at 9:25 AM, Sean McBride wrote:

    > On 1/9/08 2:13 PM, Matt Gough said:
    >
    >>> 1. Can I get the same NSWorkspace notifications from somewhere else?
    >>> I've
    >>> nosed through /System/Library/Frameworks without stumbling across
    >>> anything
    >>> obvious but I may just be blind.
    >>
    >> Carbon events seems a good way to go:
    >>
    >> See kEventClassApplication in CarbonEvents.h
    >
    > I'm not sure I'd recommend Carbon Events for new code.  Apple
    > decided to
    > kill 64 bit Carbon, and if you look through CarbonEvents.h you'll see
    > that most APIs are 32 bit only.

    Bad advice; there is still a definite need for Carbon.  I would thus
    recommend that it is indeed used for new code when necessary.  For
    example, to get better support for speech synthesis, speech
    recognition and Ink, I've had to rely upon the Carbon APIs.  Cocoa
    APIs do exist for some of these areas, but do not expose all the
    capabilities of the underlying APIs.

    If/when Apple decides to obsolete Carbon, I'm sure Cocoa APIs will be
    added to ensure apps will still have the necessary functionality.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
  • On 1/9/08 3:23 PM, Ricky Sharp said:

    >>> Carbon events seems a good way to go:
    >>>
    >>> See kEventClassApplication in CarbonEvents.h
    >>
    >> I'm not sure I'd recommend Carbon Events for new code.  Apple
    >> decided to
    >> kill 64 bit Carbon, and if you look through CarbonEvents.h you'll see
    >> that most APIs are 32 bit only.
    >
    > Bad advice; there is still a definite need for Carbon.  I would thus
    > recommend that it is indeed used for new code when necessary.

    Notice I said "I'm not sure I'd recommend Carbon _Events_ for new code"
    not "I'm not sure I'd recommend Carbon for new code".

    > example, to get better support for speech synthesis, speech
    > recognition and Ink, I've had to rely upon the Carbon APIs.  Cocoa
    > APIs do exist for some of these areas, but do not expose all the
    > capabilities of the underlying APIs.

    The APIs in Ink.h, SpeechRecognition.h, and SpeechSynthesis.h are
    available in 64 bit; the APIs in CarbonEvents.h (largely) are 32 bit only.

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • On Jan 9, 2008, at 2:42 PM, Sean McBride wrote:

    > The APIs in Ink.h, SpeechRecognition.h, and SpeechSynthesis.h are
    > available in 64 bit; the APIs in CarbonEvents.h (largely) are 32 bit
    > only.

    As I learned earlier, some of the APIs in CarbonEvents.h were marked
    as 32-bit only apparently by accident. They're actually present in 64-
    bit. The main things that really got dropped from 64-bit Carbon were a
    number of UI drawing areas (HIView, etc.) and a lot of obsolete stuff
    (QuickDraw, Internet Config, etc.).

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On Jan 9, 2008, at 3:42 PM, Sean McBride wrote:

    > On 1/9/08 3:23 PM, Ricky Sharp said:
    >
    >>>> Carbon events seems a good way to go:
    >>>>
    >>>> See kEventClassApplication in CarbonEvents.h
    >>>
    >>> I'm not sure I'd recommend Carbon Events for new code.  Apple
    >>> decided to
    >>> kill 64 bit Carbon, and if you look through CarbonEvents.h you'll
    >>> see
    >>> that most APIs are 32 bit only.
    >>
    >> Bad advice; there is still a definite need for Carbon.  I would thus
    >> recommend that it is indeed used for new code when necessary.
    >
    > Notice I said "I'm not sure I'd recommend Carbon _Events_ for new
    > code"
    > not "I'm not sure I'd recommend Carbon for new code".

    Sorry I wasn't more specific, but for Ink, that makes full use of
    carbon events.  But, as Nick just pointed out, the event APIs are
    actually in 64-bit, so all is well.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
  • On 1/9/08 3:19 PM, Nick Zitzmann said:

    > As I learned earlier, some of the APIs in CarbonEvents.h were marked
    > as 32-bit only apparently by accident. They're actually present in 64-
    > bit.

    That'll teach me to trust documentation! :)

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • On Jan 9, 2008, at 5:23 PM, Sean McBride wrote:

    > On 1/9/08 3:19 PM, Nick Zitzmann said:
    >
    >> As I learned earlier, some of the APIs in CarbonEvents.h were marked
    >> as 32-bit only apparently by accident. They're actually present in
    >> 64-
    >> bit.
    >
    > That'll teach me to trust documentation! :)

    The only case for which this is true is GetApplicationEventTarget,
    however. All other APIs in CarbonEvents.h that are marked 32-bit
    should really only be used in 32-bit.

    -eric
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today