Archive for the 'Carbon' Category

A handy UTI tip

Monday, July 31st, 2006

I found this by accident, when I wrote this code while tired:

UTTypeConformsTo(type, CFSTR(“kUTTypeText”))

That’s wrong. It should be either kUTTypeText or CFSTR("public.text"). But it works anyway.

The real question is whether CFSTR("kUTTypeText") works in Panther (the global constant kUTTypeText was introduced in Tiger). In any case, I’ll just use CFSTR("public.text") and keep Panther compatibility.

Technorati tags: Uniform type identifiers, Launch Services.

Report-an-Apple-bug Friday! 39

Friday, May 5th, 2006

This bug is Reason parameter to SystemSound API functions. It was filed on 2006-05-05 at 00:23 PDT.


Summary:

SystemSound API should have functions that take a reason (expressed as a CFString) for the beep.

Steps to Reproduce:

  1. Open .

Expected Results:

One or more functions exist that take a CFString parameter called inReason.

Actual Results:

No such functions exist.

Regression:

None.

Notes:

One of the most annoying things that can happen in the Mac environment is when a beep occurs, with no explanation. Sometimes this is the result of a processing delay, with the application beeping multiple seconds after the event that triggered the beep (by which time the user has moved on to some parallel task). Other times, the app is just broken, only beeping when it should also display a dialog or when it should use a Growl notification instead (some apps beep at the completion of a task, optionally or otherwise).

This can be solved by adding new functions to SystemSound (and, for convenience, AppKit — NSBeepWithReason, say) that take a reason for the beep. This reason would be logged to the Console (example format: “Beeped (Reason: ^0)”), and if the user so desires, displayed to the user in a bezel (or, better yet, a Growl notification). Existing functions, or the new functions with reason=NULL, would use a localized “No reason was supplied” message.

Example Console.log line:

2006-05-04 22:52:15.974 Safari[252] Beeped (Reason: Quit playing online games and get back to work!).

2006-05-04 22:52:16.974 AppThatDoesNotSupplyAReason[253] Beeped (no reason supplied).

Even if no reason is supplied, the log message is still useful, because it at least says which app beeped.

A Growl notification could have “APPNAME beeped” as the title and the reason as the description. Separate notifications should exist for reason and no reason, with the with-reason notification turned on by default, and the no-reason notification turned off by default.


Technorati tags: ,

Report-an-Apple-bug Friday! 14

Friday, March 24th, 2006

This bug is Symbols listed in File Manager Reference, not defined in header. It was filed on 2006-03-24 at 23:00 PST.


Summary:

The File Manager Reference contains 394 symbols that are not actually defined in any current header.

Steps to Reproduce:

  1. Open the File Manager Reference.
  2. Scroll.
  3. Scroll.
  4. Scroll.
  5. Scroll.

Expected Results:

No signature and file-type constants are ever encountered, because no such constants are defined in the headers.

Actual Results:

You eventually arrive at 394 file type and signature constants, listed in eight sections in the Constants section.

Regression:

This wasn’t a problem back when these constants were actually defined.

Notes:

I constructed a header file from the header excerpts shown in the docs. It is attached.


Technorati tags: , .

Report-an-Apple-bug Friday! 13

Friday, March 24th, 2006

This bug is IPA support in Speech Synthesis Manager. It was filed on 2006-03-24 at 00:36 PST.


Summary:

Speech Synthesis Manager does not support IPA (International Phonetic Alphabet).

Steps to Reproduce:

  1. Call a function such as CreateIPAStringFromString, which converts natural-language text into IPA.
  2. Call a function such as SpeakIPAString, which speaks the text represented in IPA aloud.

Expected Results:

CreateIPAStringFromString returns a CFString containing the IPA version of the text.

SpeakIPAString parses the IPA text in the CFString passed in, and speaks it.

Actual Results:

The program fails to compile because Speech Synthesis Manager has no such functions.

Regression:

None known.

Notes:

IPA is a standard alphabet for representing pronunciation. It has its own block in Unicode, making CFString a natural fit. Thus, this report extends #4489914, “Speech Managers do not support Unicode” [see Apple bug Friday! 12 —the Bored Zo].

IPA used in this context would be a substitute for the phoneme syntax currently used in Speech Synthesis Manager (specifically, TextToPhonemes and SpeakBuffer).


At 04:11, I added the following:

I should clarify that I simply made up the names CreateIPAStringFromString and SpeakIPAString. I am not under a belief that those functions are supposed to already exist. I’m requesting functions that do those things, whatever they end up named.


Technorati tags: , .

Apple bug Friday! 12

Friday, March 24th, 2006

This bug is Speech Managers do not support Unicode. It was filed on 2006-03-23 at 23:07 PST.


Summary:

Neither the Speech Synthesis Manager nor the Speech Recognition Manager has support for Unicode text (CFStrings).

Steps to Reproduce:

  1. Attempt to speak Unicode text using Speech Synthesis Manager.
  2. Attempt to receive Unicode text from the Speech Recognition Manager.

Expected Results:

The Unicode text is successfully spoken, and speech from the user is successfully received as Unicode text.

Actual Results:

No results, because it is impossible to write such an application. Neither Manager supports Unicode.

Regression:

None known.

Notes:

Since Mac OS X now has CFStrings, the Speech Managers should at the very least support using these for input and output, even if actual parsing and recognition are limited to ASCII or MacRoman.

This could be extended in a future version of Mac OS X, with better support for other languages and accents using a broader range of the Unicode character set. Hard, I know — it would be a major feature, not a relatively-minor API enhancement like simply supporting CFStrings. CFString support is simply a first step in that direction.


Technorati tags: , , .