public
Last active

  • Download Gist
gistfile1.m
Objective-C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
//
// CHSymbolButtonImageAdditions.m
// Chocolat
//
// Created by Alex Gordon on 15/03/2011.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
 
#import "CHSymbolButtonImageAdditions.h"
#import "CHSymbolButtonImage.h"
 
@implementation CHSymbolButtonImage (Additions)
 
+ (NSArray *)symbolButtonImageFromIndexClass:(NSString *)indexClass drawBorder:(BOOL)drawBorder
{
CHSymbolButtonImageMask m = 0;
if (!drawBorder)
m |= CHSymbolButtonDontDrawBorder;
NSMutableDictionary *mappings = [NSMutableDictionary dictionary];
#define IMAPP(a, b) else if ([indexClass isEqual:a]) m |= CHSymbolButton##b
if (0);
//IMAPP(@"augroup", asm); // autocommand groups
//IMAPP(@"block data", asm); // block data
//IMAPP(@"chapter", asm); // chapters
IMAPP(@"class", ObjcClass); // classes
//IMAPP(@"command", asm); // user-defined commands
//IMAPP(@"common", asm); // common blocks
IMAPP(@"component", Variable | CHSymbolButtonInstanceScope); // type and structure components
IMAPP(@"constant", Constant); // constants (define, parameter, specparam)
IMAPP(@"Constructor", ObjcMethod); // A constructor
//IMAPP(@"cursor", asm); // cursors
IMAPP(@"define", Define); // defines
//IMAPP(@"domain", asm); // domains
//IMAPP(@"entity", asm); // entity declarations
//IMAPP(@"entry", asm); // entry points
IMAPP(@"enum constant", Constant | CHSymbolButtonInstanceScope); // enum constants
IMAPP(@"enum", Enum); // enum types
IMAPP(@"enumerator", Constant | CHSymbolButtonInstanceScope); // enumerators (values inside an enumeration)
IMAPP(@"event", Notification); // events
//IMAPP(@"Exception", asm); // An exception
//IMAPP(@"exception", asm); // exception declarations
IMAPP(@"externvar", Variable | CHSymbolButtonGlobalScope); // external and forward variable declarations
//IMAPP(@"feature", asm); // features
IMAPP(@"field", Variable | CHSymbolButtonInstanceScope); // fields
//IMAPP(@"format", asm); // formats
//IMAPP(@"fragment", asm); // fragment definitions
IMAPP(@"function", Function); // function definitions
IMAPP(@"functor", Function); // functor definitions
//IMAPP(@"index", asm); // indexes
IMAPP(@"interface", ObjcInterface); // interface contents, generic names, and operators
//IMAPP(@"label", asm); // block label
IMAPP(@"local", Variable | CHSymbolButtonLocalScope); // local, common block, and namelist variables
IMAPP(@"macro", Macro); // macro definitions
//IMAPP(@"map", asm); // maps
IMAPP(@"member", Variable | CHSymbolButtonInstanceScope); // class, struct, and union members
IMAPP(@"method", ObjcMethod); // methods
IMAPP(@"module", CppNamespace); // modules
//IMAPP(@"mxtag", asm); // mxtags
//IMAPP(@"namelist", asm); // namelists
IMAPP(@"namespace", CppNamespace); // imports
//IMAPP(@"net", asm); // net data types
IMAPP(@"package", CppNamespace); // package definitions
//IMAPP(@"paragraph", asm); // paragraphs
//IMAPP(@"part", asm); // parts
//IMAPP(@"pattern", asm); // all patterns
//IMAPP(@"port", asm); // ports
IMAPP(@"procedure", Function); // procedure prototypes and declarations
IMAPP(@"program", Function); // programs
IMAPP(@"property", ObjcProperty); // properties
IMAPP(@"prototype", Function); // function prototypes
//IMAPP(@"publication", asm); // publications
IMAPP(@"Record field", Constant | CHSymbolButtonInstanceScope); // A 'structure' field
IMAPP(@"record", Constant | CHSymbolButtonInstanceScope); // record definitions
//IMAPP(@"register", asm); // register data types
//IMAPP(@"section", asm); // sections
//IMAPP(@"service", asm); // services
//IMAPP(@"set", asm); // sets
IMAPP(@"signature", ObjcInterface); // signature declarations
IMAPP(@"singleton method", ObjcMethod | CHSymbolButtonStaticScope); // singleton methods
//IMAPP(@"slot", asm); // slots (fragment uses)
IMAPP(@"struct", Struct); // structure names
IMAPP(@"structure", Struct); // structure declarations
//IMAPP(@"subparagraph", asm); // subparagraphs
IMAPP(@"subroutine declaration", Function); // subroutine declarations
IMAPP(@"subroutine", Function); // subroutines
//IMAPP(@"subsection", asm); // subsections
//IMAPP(@"subsubsection", asm); // subsubsections
IMAPP(@"subtype", Typedef); // subtype definitions
//IMAPP(@"synonym", asm); // synonyms
//IMAPP(@"table", asm); // tables
//IMAPP(@"task", asm); // tasks
//IMAPP(@"trigger", asm); // triggers
IMAPP(@"type", Typedef); // derived types and structures
IMAPP(@"typedef", Typedef); // typedefs
IMAPP(@"union", Union); // union names
IMAPP(@"value", Constant); // value bindings
IMAPP(@"var", Variable | CHSymbolButtonGlobalScope); // Global variable
IMAPP(@"variable", Variable | CHSymbolButtonGlobalScope); // global variables
//IMAPP(@"view", asm); // views
//IMAPP(@"virtual", asm); // patterns (virtual or rebound)
if (m)
return [self symbolImageWithMask:m];
return nil;
}
 
@end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.