Ignore:
Timestamp:
11/13/09 21:53:16 (14 years ago)
Author:
Nicholas Riley
Message:

Use Cocoa instead of CPS to show all/hide other applications.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/appswitch/appswitch/main.m

    r352 r592  
    33 Nicholas Riley <appswitch@sabi.net>
    44
    5  Copyright (c) 2003-07, Nicholas Riley
     5 Copyright (c) 2003-09, Nicholas Riley
    66 All rights reserved.
    77
     
    2222#include <sys/ioctl.h>
    2323#include <ApplicationServices/ApplicationServices.h>
    24 #include "CPS.h"
     24#import <AppKit/AppKit.h>
    2525
    2626const char *APP_NAME;
    2727
    28 #define VERSION "1.1"
     28#define VERSION "1.1.1d1"
    2929
    3030struct {
     
    467467        case ACTION_NONE: break;
    468468        // no Process Manager equivalents - rdar://problem/4808397
    469         case ACTION_SHOW_ALL: err = CPSPostShowAllReq(&psn); verb = "show all"; break;
    470         case ACTION_HIDE_OTHERS: err = CPSPostHideMostReq(&psn); verb = "hide other"; break;
     469        case ACTION_SHOW_ALL:
     470            [[NSAutoreleasePool alloc] init];
     471            [[NSApplication sharedApplication] unhideAllApplications: nil];
     472            err = noErr;
     473            verb = "show all";
     474            break;
     475        case ACTION_HIDE_OTHERS:
     476            [[NSAutoreleasePool alloc] init];
     477            [[NSApplication sharedApplication] hideOtherApplications: nil];
     478            err = noErr;
     479            verb = "hide other";
     480            break;
    471481        default:
    472482            errexit("internal error: invalid action");
Note: See TracChangeset for help on using the changeset viewer.