Skip to content

Commit d25be93

Browse files
committed
merging
1 parent 12abe3a commit d25be93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+272
-3587
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
Headers
3+
LatexSugar.esproj
4+
*.pbxuser
5+
*.mode1v3
6+
.DS_Store

Code/Itemizers/LTXInputItem.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// LTXInputItem.h
3+
// Latex
4+
//
5+
// Created by Stefan on 22.04.10.
6+
// Copyright 2010 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import <EspressoItemizer.h>
11+
12+
@interface LTXInputItem : ESBaseItem {
13+
NSString *name;
14+
}
15+
16+
@end

Code/Itemizers/LTXInputItem.m

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
//
2+
// LTXInputItem.m
3+
// Latex
4+
//
5+
// Created by Stefan on 22.04.10.
6+
// Copyright 2010 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import "LTXInputItem.h"
10+
11+
12+
@implementation LTXInputItem
13+
14+
- (void)initializeWithCapturedZones:(NSDictionary *)captures recipeInfo:(NSDictionary *)recipeInfo
15+
{
16+
[super initializeWithCapturedZones:captures recipeInfo:recipeInfo];
17+
18+
name = [[[captures objectForKey:@"name"] text] retain];
19+
NSLog(@"captures: %@", captures);
20+
NSLog(@"capture zone: %@", name);
21+
}
22+
23+
- (void)dealloc
24+
{
25+
[name release];
26+
name = nil;
27+
[super dealloc];
28+
}
29+
30+
- (BOOL)transformIntoItem:(LTXInputItem *)otherItem
31+
{
32+
// Note: the passed argument can actually be any item class, but casting it to this specific class makes it easy to write the transformation code. The default (super) implementation takes care of checking the class, so this is perfectly valid.
33+
if (![super transformIntoItem:otherItem])
34+
return NO;
35+
36+
// Clean up our own old values
37+
[name release];
38+
name = nil;
39+
40+
// Take over the new values from the other item
41+
name = [otherItem->name retain];
42+
43+
return YES;
44+
}
45+
46+
- (BOOL)isDecorator
47+
{
48+
return YES;
49+
}
50+
51+
- (CEItemDecorationType)decorationType
52+
{
53+
return CEItemDecorationDefault;
54+
}
55+
56+
- (NSColor *)backgroundColor
57+
{
58+
return [NSColor yellowColor];
59+
}
60+
61+
- (NSImage *)image
62+
{
63+
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"page_white_go" ofType:@"png"];
64+
NSImage *image = [[NSImage alloc] initWithContentsOfFile:path];
65+
[image autorelease];
66+
return image;
67+
}
68+
69+
- (BOOL)isTextualizer
70+
{
71+
return YES;
72+
}
73+
74+
- (NSString *)title
75+
{
76+
return name;
77+
}
78+
79+
@end

Code/Itemizers/LTXSectionItem.m

+16-3
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,22 @@ - (BOOL)isDecorator
5050

5151
- (CEItemDecorationType)decorationType
5252
{
53-
return CEItemDecorationDefault;
53+
// return CEItemDecorationDefault;
54+
return CEItemDecorationDynamicTag;
5455
}
5556

5657
- (NSColor *)backgroundColor
5758
{
58-
return [NSColor yellowColor];
59+
return [NSColor blueColor];
5960
}
6061

6162
- (NSImage *)image
6263
{
6364
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"page_white_go" ofType:@"png"];
6465
NSImage *image = [[NSImage alloc] initWithContentsOfFile:path];
6566
[image autorelease];
66-
return image;
67+
// return image;
68+
return nil;
6769
}
6870

6971
- (BOOL)isTextualizer
@@ -75,4 +77,15 @@ - (NSString *)title
7577
{
7678
return name;
7779
}
80+
81+
//- (NSString *)secondaryDescription
82+
//{
83+
// return name;
84+
//}
85+
86+
//- (BOOL)shouldAppendSecondaryDescriptionToTitle
87+
//{
88+
// return YES;
89+
//}
90+
7891
@end

Code/Itemizers/LTXSubSectionItem.h

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// LTXSubSectionItem.h
3+
// Latex
4+
//
5+
// Created by Stefan on 22.04.10.
6+
// Copyright 2010 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
#import <EspressoItemizer.h>
11+
12+
13+
@interface LTXSubSectionItem : ESBaseItem {
14+
NSString *name;
15+
}
16+
17+
@end

Code/Itemizers/LTXSubSectionItem.m

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
//
2+
// LTXSubSectionItem.m
3+
// Latex
4+
//
5+
// Created by Stefan on 22.04.10.
6+
// Copyright 2010 __MyCompanyName__. All rights reserved.
7+
//
8+
9+
#import "LTXSubSectionItem.h"
10+
11+
12+
@implementation LTXSubSectionItem
13+
14+
- (void)initializeWithCapturedZones:(NSDictionary *)captures recipeInfo:(NSDictionary *)recipeInfo
15+
{
16+
[super initializeWithCapturedZones:captures recipeInfo:recipeInfo];
17+
18+
name = [[[captures objectForKey:@"name"] text] retain];
19+
NSLog(@"captures: %@", captures);
20+
NSLog(@"capture zone: %@", name);
21+
}
22+
23+
- (void)dealloc
24+
{
25+
[name release];
26+
name = nil;
27+
[super dealloc];
28+
}
29+
30+
- (BOOL)transformIntoItem:(LTXSubSectionItem *)otherItem
31+
{
32+
// Note: the passed argument can actually be any item class, but casting it to this specific class makes it easy to write the transformation code. The default (super) implementation takes care of checking the class, so this is perfectly valid.
33+
if (![super transformIntoItem:otherItem])
34+
return NO;
35+
36+
// Clean up our own old values
37+
[name release];
38+
name = nil;
39+
40+
// Take over the new values from the other item
41+
name = [otherItem->name retain];
42+
43+
return YES;
44+
}
45+
46+
- (BOOL)isDecorator
47+
{
48+
return YES;
49+
}
50+
51+
- (CEItemDecorationType)decorationType
52+
{
53+
// return CEItemDecorationDefault;
54+
return CEItemDecorationDynamicTag;
55+
}
56+
57+
- (NSColor *)backgroundColor
58+
{
59+
return [NSColor yellowColor];
60+
}
61+
62+
- (NSImage *)image
63+
{
64+
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"page_white_go" ofType:@"png"];
65+
NSImage *image = [[NSImage alloc] initWithContentsOfFile:path];
66+
[image autorelease];
67+
// return image;
68+
return nil;
69+
}
70+
71+
- (BOOL)isTextualizer
72+
{
73+
return YES;
74+
}
75+
76+
- (NSString *)title
77+
{
78+
return name;
79+
}
80+
81+
//- (BOOL)shouldAppendSecondaryDescriptionToTitle
82+
//{
83+
// return YES;
84+
//}
85+
86+
@end

CodeSenseProviders/Latex.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<codesense>
33
<provider>
4-
<selector>text.latex</selector>
4+
<selector>text.latex > *</selector>
55

66
<completions>net.texasexpat.latex.simple</completions>
77
<completions>net.texasexpat.latex.functions</completions>

Itemizers/Itemizers.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</subrecipes>
1010
</recipe>
1111
<recipe name="structural.header.sub">
12-
<class>ESBaseItem</class>
12+
<class>LTXSubSectionItem</class>
1313
<start-selector>sub > sub:capture(name)</start-selector>
1414
<end-selector>sub > sub:capture(name)</end-selector>
1515
<subrecipes>
@@ -25,7 +25,7 @@
2525
</subrecipes>
2626
</recipe>
2727
<recipe name="structural.header.input">
28-
<class>ESBaseItem</class>
28+
<class>LTXInputItem</class>
2929
<selector>input > input:capture(name)</selector>
3030
</recipe>
3131
<recipe name="structural.header.paragraph">

Latex.xcodeproj/project.pbxproj

+23-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
1212
F8055A74117FB022003E133D /* page_white_go.png in Resources */ = {isa = PBXBuildFile; fileRef = F8055A73117FB022003E133D /* page_white_go.png */; };
1313
F8055A86117FB05A003E133D /* LTXSectionItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F8055A85117FB05A003E133D /* LTXSectionItem.m */; };
14+
F843F56111808B0500070EA8 /* LTXSubSectionItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F843F56011808B0500070EA8 /* LTXSubSectionItem.m */; };
15+
F843F5991180931800070EA8 /* LTXInputItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F843F5981180931800070EA8 /* LTXInputItem.m */; };
1416
F8552AE0117E5BC9006DF6F5 /* Latex.sugar in Copy To Espresso */ = {isa = PBXBuildFile; fileRef = 8D5B49B6048680CD000E48DA /* Latex.sugar */; };
1517
F8552AFA117E5C4D006DF6F5 /* CodeSenseLibraries in Resources */ = {isa = PBXBuildFile; fileRef = F8552AE4117E5C4D006DF6F5 /* CodeSenseLibraries */; };
1618
F8552AFB117E5C4D006DF6F5 /* CodeSenseProviders in Resources */ = {isa = PBXBuildFile; fileRef = F8552AE7117E5C4D006DF6F5 /* CodeSenseProviders */; };
@@ -74,6 +76,10 @@
7476
F8055A73117FB022003E133D /* page_white_go.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = page_white_go.png; sourceTree = "<group>"; };
7577
F8055A84117FB05A003E133D /* LTXSectionItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTXSectionItem.h; sourceTree = "<group>"; };
7678
F8055A85117FB05A003E133D /* LTXSectionItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTXSectionItem.m; sourceTree = "<group>"; };
79+
F843F55F11808B0500070EA8 /* LTXSubSectionItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTXSubSectionItem.h; sourceTree = "<group>"; };
80+
F843F56011808B0500070EA8 /* LTXSubSectionItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTXSubSectionItem.m; sourceTree = "<group>"; };
81+
F843F5971180931800070EA8 /* LTXInputItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTXInputItem.h; sourceTree = "<group>"; };
82+
F843F5981180931800070EA8 /* LTXInputItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTXInputItem.m; sourceTree = "<group>"; };
7783
F8552AE4117E5C4D006DF6F5 /* CodeSenseLibraries */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CodeSenseLibraries; sourceTree = "<group>"; };
7884
F8552AE7117E5C4D006DF6F5 /* CodeSenseProviders */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CodeSenseProviders; sourceTree = "<group>"; };
7985
F8552AEA117E5C4D006DF6F5 /* ContextualSettings */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ContextualSettings; sourceTree = "<group>"; };
@@ -173,6 +179,7 @@
173179
F8055A82117FB05A003E133D /* Code */ = {
174180
isa = PBXGroup;
175181
children = (
182+
F843F54D1180846900070EA8 /* FileActions */,
176183
F8055A83117FB05A003E133D /* Itemizers */,
177184
);
178185
path = Code;
@@ -183,10 +190,21 @@
183190
children = (
184191
F8055A84117FB05A003E133D /* LTXSectionItem.h */,
185192
F8055A85117FB05A003E133D /* LTXSectionItem.m */,
193+
F843F55F11808B0500070EA8 /* LTXSubSectionItem.h */,
194+
F843F56011808B0500070EA8 /* LTXSubSectionItem.m */,
195+
F843F5971180931800070EA8 /* LTXInputItem.h */,
196+
F843F5981180931800070EA8 /* LTXInputItem.m */,
186197
);
187198
path = Itemizers;
188199
sourceTree = "<group>";
189200
};
201+
F843F54D1180846900070EA8 /* FileActions */ = {
202+
isa = PBXGroup;
203+
children = (
204+
);
205+
name = FileActions;
206+
sourceTree = "<group>";
207+
};
190208
F8552A3F117E592E006DF6F5 /* XML Based */ = {
191209
isa = PBXGroup;
192210
children = (
@@ -268,6 +286,8 @@
268286
buildActionMask = 2147483647;
269287
files = (
270288
F8055A86117FB05A003E133D /* LTXSectionItem.m in Sources */,
289+
F843F56111808B0500070EA8 /* LTXSubSectionItem.m in Sources */,
290+
F843F5991180931800070EA8 /* LTXInputItem.m in Sources */,
271291
);
272292
runOnlyForDeploymentPostprocessing = 0;
273293
};
@@ -324,7 +344,7 @@
324344
isa = XCBuildConfiguration;
325345
buildSettings = {
326346
APPLICATION_PATH = /Applications/Espresso.app;
327-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
347+
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
328348
BUNDLE_LOADER = "$(APPLICATION_PATH)/Contents/MacOS/Espresso";
329349
GCC_C_LANGUAGE_STANDARD = gnu99;
330350
GCC_OPTIMIZATION_LEVEL = 0;
@@ -334,14 +354,15 @@
334354
ONLY_ACTIVE_ARCH = YES;
335355
PREBINDING = NO;
336356
SDKROOT = macosx10.6;
357+
USER_HEADER_SEARCH_PATHS = "";
337358
};
338359
name = Debug;
339360
};
340361
1DEB914008733D840010E9CD /* Release */ = {
341362
isa = XCBuildConfiguration;
342363
buildSettings = {
343364
APPLICATION_PATH = /Applications/Espresso.app;
344-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
365+
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
345366
BUNDLE_LOADER = "$(APPLICATION_PATH)/Contents/MacOS/Espresso";
346367
GCC_C_LANGUAGE_STANDARD = gnu99;
347368
GCC_WARN_ABOUT_RETURN_TYPE = YES;

0 commit comments

Comments
 (0)