AmphetaDesk::OS::MacOSX - GUI routines for Mac OS X (CLI or GUI)


    gui_init();          # start the gui.
    gui_listen();        # listen for gui events.
    gui_note("text");    # send log info to the GUI.
    open_url();          # open a browser to a preset URL.


This module handles all the GUI routines for Mac OS X, either for the CLI (ie. someone's running it from the Terminal) or the Cocoa wrapper (which duplicates the Win32 GUI window). The Cocoa wrapper merely starts up an AmphetaDesk CLI daemon, which then communicates back and forth via CAPITAL commands, like REFRESH, GUI_CMD OPEN_URL, and so forth. Thanks to l.m. orchard for that setup (although we've yet to explore the shell ObjC, or even AppleScript Studio applications).


This routine loads specific libraries specific to the OS and attempts to do everything necessary to start up a GUI window. Under Mac OS X, this routine sets reading of from STDIN to non-blocking - a prerequisite to setting up our interaction with the Cocoa wrapper (this has no affect for the CLI). This routine always returns 1.
This routine checks the GUI's event queue to see if there is anything that needs to be done. If so, it does them (wow!). Under Mac OS X, we're looking for commands passed by our Cocoa wrapper that prefix with CMD. If we find any, then we run that matching routine. For now, we only listen to CMD_ REFRESH, which forces a refresh of the channel subscriptions. This routine always returns 1.
Much like AmphetaDesk::Utilities::note, only this routine specifically handles sending the $text to the GUI window. Under Mac OS X, we just spit to STDOUT which is picked up by the Cocoa wrapper. Routine always returns 1.
This routine uses OS specific code to open the user's default or specified browser with the standard AmphetaDesk URL. For OS X, we spit out a message to the CLI about opening the browser or, if the user is running under the Cocoa wrapper, we spit out a special GUI_CMD OPEN_URL that is interpreted by said wrapper as a Cocoa "open default browser" request.



Morbus Iff, <>


Copyright 2000-2004 Morbus Iff <>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.