source: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEESetServicesMenu.m@ 184

Last change on this file since 184 was 182, checked in by Nicholas Riley, 19 years ago

English.lproj/APEInfo.rtfd: Partial documentation update for 1.4.2;
fixed many instances of outdated and incorrect information.

ICeCoffEE.m: Removed completed "to do" comments - that's what
OmniOutliner and Trac are for. Fixed delimiters to make more sense.
Redid ICCF_ParseURL() to make more sense and strip invalid characters
from beginning of URL. Added note about deprecated getCString:.
Fixed ICCF_ServicesMenuItem() to work on Tiger; moved menu population
logic (where services menu delegate used) to new
ICCF_SetServicesMenu() in ICeCoffEESetServicesMenu.[hm]. Remove key
equivalents from services in ICCF_ConsolidateServicesMenu(). First
pass at a workaround for discontiguous selection: only trigger if
there is no selection. This will be fixed to use a timer.

ICeCoffEEServicePrefController: Fixed service population to work on
Tiger, though keyboard equivalents are not provided; will need to
switch to parsing output of CFServiceControllerCopyServicesEntries()
for that one.

ICeCoffEEWebKit.m: Removed Safari 1.0-1.2 support. Fixed incorrect
comment about -selectionRect only being in Safari
1.1-1.2.

ICeCoffEESetServicesMenu.[hm]: Handle getting a usable services menu
for Panther and Tiger.

File size: 1.1 KB
Line 
1//
2// ICeCoffEESetServicesMenu.m
3// ICeCoffEE APE
4//
5// Created by Nicholas Riley on 5/10/05.
6// Copyright 2005 Nicholas Riley. All rights reserved.
7//
8
9#import "ICeCoffEESetServicesMenu.h"
10
11
12void ICCF_SetServicesMenu(NSMenu *servicesMenu) {
13 // in 10.3, this populates the menu; in 10.4, it attaches a delegate (NSServiceMaster)
14 [[NSApplication sharedApplication] setServicesMenu: servicesMenu];
15 id delegate;
16 if ( (delegate = [servicesMenu delegate]) != nil) {
17 // populate menu so we have something to filter
18 if ([delegate respondsToSelector: @selector(menuNeedsUpdate:)]) {
19 [delegate menuNeedsUpdate: servicesMenu];
20 }
21 if ([delegate respondsToSelector: @selector(menu:updateItem:atIndex:shouldCancel:)]) {
22 int itemCount = [delegate numberOfItemsInMenu: servicesMenu];
23 for (int i = 0 ; i < itemCount ; i++) {
24 [servicesMenu addItemWithTitle: @"" action: NULL keyEquivalent: @""];
25 }
26 for (int i = 0 ; i < itemCount ; i++) {
27 if (![delegate menu: servicesMenu updateItem: (NSMenuItem *)[servicesMenu itemAtIndex: i] atIndex: i shouldCancel: NO])
28 break;
29 }
30 }
31 }
32}
Note: See TracBrowser for help on using the repository browser.