Skip to content

Commit

Permalink
merge r82
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R-packages/trunk/Mac-GUI@5707 694ef91d-65df-0310-b7bb-92e67a308ead
  • Loading branch information
s-u committed Mar 14, 2011
1 parent 6a39859 commit b9452bc
Show file tree
Hide file tree
Showing 35 changed files with 127 additions and 148 deletions.
24 changes: 12 additions & 12 deletions AMPrefs/AMPrefPaneIconView.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ - (void)calculateGeometry

NSEnumerator *listEnumerator = [iconListList objectEnumerator];
NSMutableArray *iconList;
while (iconList = [listEnumerator nextObject]) { // loop over categories
while ((iconList = [listEnumerator nextObject])) { // loop over categories
int column = 0;

NSEnumerator *iconEnumerator = [iconList objectEnumerator];
AMPrefPaneIcon *icon;
while (icon = [iconEnumerator nextObject]) { // loop over icons
while ((icon = [iconEnumerator nextObject])) { // loop over icons
column++;
if (column > columns) {
column = 1;
Expand Down Expand Up @@ -274,10 +274,10 @@ - (void)sortCategories
if (categorySortOrder) {
NSEnumerator *sortOrderEnumerator = [categorySortOrder objectEnumerator];
NSString *category;
while (category = [sortOrderEnumerator nextObject]) {
while ((category = [sortOrderEnumerator nextObject])) {
NSEnumerator *enumerator = [iconListList objectEnumerator];
NSArray *iconList;
while (iconList = [enumerator nextObject]) {
while ((iconList = [enumerator nextObject])) {
if ([[(AMPrefPaneIcon *)[iconList objectAtIndex:0] category] isEqualToString:category]) {
[newIconListList addObject:iconList];
break;
Expand All @@ -286,8 +286,8 @@ - (void)sortCategories
}
NSEnumerator *enumerator = [iconListList objectEnumerator];
NSArray *iconList;
while (iconList = [enumerator nextObject]) {
if (![newIconListList containsObject:iconList]) {
while ((iconList = [enumerator nextObject])) {
if ((![newIconListList containsObject:iconList])) {
[newIconListList addObject:iconList];
}
}
Expand All @@ -306,7 +306,7 @@ - (void)rebuild
NSMutableDictionary *categoryIndex = [[[NSMutableDictionary alloc] init] autorelease];
NSEnumerator *enumerator = [icons objectEnumerator];
AMPrefPaneIcon *icon;
while (icon = [enumerator nextObject]) {
while ((icon = [enumerator nextObject])) {
id key = [icon category];
if (key == nil) {
key = [NSNull null];
Expand All @@ -322,7 +322,7 @@ - (void)rebuild
}
enumerator = [iconListList objectEnumerator];
NSMutableArray *iconList;
while (iconList = [enumerator nextObject]) {
while ((iconList = [enumerator nextObject])) {
[iconList sortUsingSelector:@selector(caseInsensitiveCompare:)];
}
[self sortCategories];
Expand Down Expand Up @@ -445,15 +445,15 @@ - (AMPrefPaneIcon *)iconAt:(NSPoint)point categoryIndex:(int *)categoryIndex ico
int cIndex = 0;
NSEnumerator *enumerator = [iconListList objectEnumerator];
NSArray *iconList;
while (iconList = [enumerator nextObject]) {
while ((iconList = [enumerator nextObject])) {
NSRect frame = [self frameForCategoryWithIndex:cIndex];
if (NSPointInRect(point, frame)) {
// hit - find icon
// we ignore the category caption for now ...
int iIndex = 0;
NSEnumerator *iconEnumerator = [iconList objectEnumerator];
AMPrefPaneIcon *icon;
while (icon = [iconEnumerator nextObject]) {
while ((icon = [iconEnumerator nextObject])) {
NSRect imageFrame = [self imageFrameForIconInCategoryWithIndex:cIndex atIndex:iIndex];
NSRect labelFrame = [self labelFrameForIconInCategoryWithIndex:cIndex atIndex:iIndex];
if (NSPointInRect(point, imageFrame) || NSPointInRect(point, labelFrame)) {
Expand Down Expand Up @@ -510,14 +510,14 @@ - (void)drawRect:(NSRect)rect
offset.y += AMPrefPaneIconViewTopGroupPadding+AMPrefPaneIconViewTopPadding;
NSEnumerator *enumerator = [iconListList objectEnumerator];
NSArray *iconList;
while (iconList = [enumerator nextObject]) {
while ((iconList = [enumerator nextObject])) {
[self drawBackgroundForCategoryWithIndex:i++];
int row = 0;
int column = 0;
offset.x = (horizontalPadding+iconSpacing)/2.0;
NSEnumerator *iconEnumerator = [iconList objectEnumerator];
AMPrefPaneIcon *icon;
while (icon = [iconEnumerator nextObject]) {
while ((icon = [iconEnumerator nextObject])) {
if (column == columns) {
row++;
column = 0;
Expand Down
2 changes: 1 addition & 1 deletion AMPrefs/AMPreferencePane.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ - (void)setPluginBundle:(NSBundle *)newPluginBundle
NSString* pluginPrincipalClass = [pluginBundle objectForInfoDictionaryKey:NSPrincipalClassKey];
Class pluginClass = [pluginBundle classNamed:pluginPrincipalClass];
NSObject <AMPrefPaneProtocol>* newPrefPane = nil;
if (newPrefPane = [[[pluginClass alloc] initWithBundle:pluginBundle] autorelease]) {
if ((newPrefPane = [[[pluginClass alloc] initWithBundle:pluginBundle] autorelease])) {
[self setPrefPane:newPrefPane];
if ([prefPane respondsToSelector:@selector(loadMainView)])
[prefPane loadMainView];
Expand Down
19 changes: 10 additions & 9 deletions AMPrefs/AMPreferenceWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ - (void)addPluginsOfType:(NSString *)extension fromPath:(NSString *)path
- (BOOL)addPane:(id<AMPrefPaneProtocol>)newPane withIdentifier:(NSString *)identifier
{
BOOL result;
if (result = ([prefPanes objectForKey:identifier] == nil)) {
if ((result = ([prefPanes objectForKey:identifier] == nil))) {
if ([delegate respondsToSelector:@selector(shouldLoadPreferencePane:)]) {
result = [delegate shouldLoadPreferencePane:identifier];
}
Expand All @@ -227,7 +227,7 @@ - (void)addPluginFromPath:(NSString *)path
} else { // loaded successfully
NSLog(@"loaded: %@", [pluginBundle bundlePath]);
NSString* prefPaneIdentifier;
if (prefPaneIdentifier = [pluginBundle objectForInfoDictionaryKey:CFBundleIdentifierKey]) {
if ((prefPaneIdentifier = [pluginBundle objectForInfoDictionaryKey:CFBundleIdentifierKey])) {
if ([prefPanes objectForKey:prefPaneIdentifier]) {
// pane with same identifier exists
NSLog(@"pref pane already loaded %@", prefPaneIdentifier);
Expand All @@ -238,7 +238,7 @@ - (void)addPluginFromPath:(NSString *)path
}
if (load) {
AMPreferencePane *newPane;
if (newPane = [[AMPreferencePane alloc] initWithBundle:pluginBundle]) {
if ((newPane = [[AMPreferencePane alloc] initWithBundle:pluginBundle])) {
if (newPane)
[self addPane:newPane withIdentifier:prefPaneIdentifier];
}
Expand Down Expand Up @@ -345,7 +345,7 @@ - (NSArray *)categories
NSMutableDictionary *categories = [NSMutableDictionary dictionary];
NSEnumerator *enumerator = [[prefPanes allValues] objectEnumerator];
AMPreferencePane *prefPane;
while (prefPane = [enumerator nextObject]) {
while ((prefPane = [enumerator nextObject])) {
NSString *category = [prefPane category];
if (_am_delegateRespondsToCategoryForPreferencePane) {
category = [delegate performSelector:@selector(categoryForPreferencePane:defaultCategory:) withObject:[prefPane identifier] withObject:category];
Expand Down Expand Up @@ -444,7 +444,7 @@ - (void)createIconViewPane
NSMutableArray *icons = [NSMutableArray array];
NSEnumerator *enumerator = [prefPanes objectEnumerator];
AMPreferencePane *prefPane;
while (prefPane = [enumerator nextObject]) {
while ((prefPane = [enumerator nextObject])) {
if ([prefPane respondsToSelector:@selector(mainView)] && [prefPane mainView]) {
[icons addObject:[self iconForPrefPane:prefPane]];
}
Expand Down Expand Up @@ -472,7 +472,7 @@ - (NSArray *)validPrefPaneIdentifiers
NSMutableArray *result = [NSMutableArray array];
NSEnumerator *enumerator = [prefPanes objectEnumerator];
AMPreferencePane *pane;
while (pane = [enumerator nextObject]) {
while ((pane = [enumerator nextObject])) {
if ([pane respondsToSelector:@selector(mainView)] && [pane mainView]) {
[result addObject:[pane identifier]];
}
Expand Down Expand Up @@ -510,22 +510,23 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString
NSToolbarItem *result = nil;
AMPreferencePane *pane = nil;
if ([itemIdentifier isEqualToString:AMPPToolbarShowAllItemIdentifier]) {
if (result = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]) {
if ((result = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier])) {
[result setTarget:self];
[result setAction:@selector(toolbarShowAll)];
[result setEnabled:YES];
[result setImage:[NSImage imageNamed:@"Prefs"]];
[result setLabel:NLS(@"Show All")];
}
} else if (pane = [prefPanes objectForKey:itemIdentifier]) {
if (result = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]) {
} else if ((pane = [prefPanes objectForKey:itemIdentifier])) {
if ((result = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier])) {
[result setTarget:self];
[result setAction:@selector(toolbarShowPane:)];
[result setEnabled:YES];
[result setImage:[pane icon]];
[result setLabel:[pane label]];
}
}
if (result) [result autorelease];
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion PrefPanes/ColorsPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ @implementation ColorsPrefPane

- (id)initWithIdentifier:(NSString *)theIdentifier label:(NSString *)theLabel category:(NSString *)theCategory
{
if (self = [super init]) {
if ((self = [super init])) {
[self setIdentifier:theIdentifier];
[self setLabel:theLabel];
[self setCategory:theCategory];
Expand Down
2 changes: 1 addition & 1 deletion PrefPanes/EditorPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ @implementation EditorPrefPane

- (id)initWithIdentifier:(NSString *)theIdentifier label:(NSString *)theLabel category:(NSString *)theCategory
{
if (self = [super init]) {
if ((self = [super init])) {
[self setIdentifier:theIdentifier];
[self setLabel:theLabel];
[self setCategory:theCategory];
Expand Down
2 changes: 1 addition & 1 deletion PrefPanes/MiscPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ @implementation MiscPrefPane

- (id)initWithIdentifier:(NSString *)theIdentifier label:(NSString *)theLabel category:(NSString *)theCategory
{
if (self = [super init]) {
if ((self = [super init])) {
[self setIdentifier:theIdentifier];
[self setLabel:theLabel];
[self setCategory:theCategory];
Expand Down
3 changes: 2 additions & 1 deletion PrefPanes/QuartzPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ @implementation QuartzPrefPane

- (id)initWithIdentifier:(NSString *)theIdentifier label:(NSString *)theLabel category:(NSString *)theCategory
{
if (self = [super init]) {
if ((self = [super init])) {
[self setIdentifier:theIdentifier];
[self setLabel:theLabel];
[self setCategory:theCategory];
Expand Down Expand Up @@ -260,6 +260,7 @@ - (IBAction) changeQuartzPrefPaneLocation:(id)sender {
NSNumber *ival = [[NSNumber alloc] initWithInt:[quartzPrefPaneLocation indexOfSelectedItem]];
[Preferences setKey:quartzPrefPaneLocationKey withObject:val];
[Preferences setKey:quartzPrefPaneLocationIntKey withObject:ival];
[ival release];
}

- (void) changeQuartzPrefPaneFont:(id)sender {
Expand Down
2 changes: 1 addition & 1 deletion PrefPanes/SyntaxColorsPrefPane.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ @implementation SyntaxColorsPrefPane

- (id)initWithIdentifier:(NSString *)theIdentifier label:(NSString *)theLabel category:(NSString *)theCategory
{
if (self = [super init]) {
if ((self = [super init])) {
[self setIdentifier:theIdentifier];
[self setLabel:theLabel];
[self setCategory:theCategory];
Expand Down
2 changes: 1 addition & 1 deletion Preferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ - (void) notifyDependents
if (!insideNotify) {
NSEnumerator *enumerator = [dependents objectEnumerator];
id<PreferencesDependent> dep;
while (dep = (id<PreferencesDependent>) [enumerator nextObject]) {
while ((dep = (id<PreferencesDependent>) [enumerator nextObject])) {
insideNotify = dep;
[dep updatePreferences];
}
Expand Down
2 changes: 1 addition & 1 deletion Quartz/devQuartz.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ char* RGUI_Quartz_TranslateFontFamily(char* family, int face, char *devfamily) {
if (strlen(family) > 0) {
int found = 0;
for (i=0; i<nfonts && !found; i++) {
char* fontFamily = CHAR(STRING_ELT(fontnames, i));
const char* fontFamily = CHAR(STRING_ELT(fontnames, i));
if (strcmp(family, fontFamily) == 0) {
found = 1;
result = SaveFontSpec(VECTOR_ELT(fontdb, i), face-1);
Expand Down
Loading

0 comments on commit b9452bc

Please sign in to comment.