initial commit

This commit is contained in:
Jeena 2014-01-21 23:30:22 +01:00
parent ba9027c7ff
commit c8dd3d393b
7 changed files with 79 additions and 52 deletions

View file

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4439" systemVersion="13A451" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4439"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="Document">
<connections>
<outlet property="textView" destination="AO8-68-5ch" id="Te1-1h-f2k"/>
<outlet property="window" destination="5" id="18"/>
</connections>
</customObject>
@ -13,26 +14,51 @@
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" wantsToBeColor="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="133" y="235" width="507" height="413"/>
<rect key="contentRect" x="133" y="235" width="631" height="484"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1418"/>
<value key="minSize" type="size" width="94" height="86"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="507" height="413"/>
<rect key="frame" x="0.0" y="0.0" width="631" height="484"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="20">
<rect key="frame" x="120" y="195" width="266" height="22"/>
<scrollView focusRingType="none" appearanceType="lightContent" misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cmv-HN-XSZ">
<rect key="frame" x="-1" y="-1" width="633" height="486"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Your document contents here" id="100020">
<font key="font" metaFont="system" size="18"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<clipView key="contentView" focusRingType="none" misplaced="YES" id="ahN-hw-bJE">
<rect key="frame" x="1" y="1" width="631" height="484"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView focusRingType="none" importsGraphics="NO" richText="NO" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" smartInsertDelete="YES" id="AO8-68-5ch">
<rect key="frame" x="0.0" y="0.0" width="631" height="484"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="631" height="484"/>
<size key="maxSize" width="10000000" height="10000000"/>
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="631" height="484"/>
<size key="maxSize" width="10000000" height="10000000"/>
<connections>
<binding destination="-2" name="attributedString" keyPath="self.stringModel" id="qPe-H9-THh"/>
</connections>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="CQZ-4e-bVe">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="nR6-Xx-I6j">
<rect key="frame" x="617" y="1" width="15" height="484"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
<constraints>
<constraint firstItem="20" firstAttribute="centerX" secondItem="6" secondAttribute="centerX" id="100025"/>
<constraint firstItem="20" firstAttribute="centerY" secondItem="6" secondAttribute="centerY" id="100026"/>
<constraint firstItem="Cmv-HN-XSZ" firstAttribute="leading" secondItem="6" secondAttribute="leading" id="JuA-gY-xTl"/>
<constraint firstAttribute="bottom" secondItem="Cmv-HN-XSZ" secondAttribute="bottom" id="P1s-Nm-ME6"/>
<constraint firstItem="Cmv-HN-XSZ" firstAttribute="top" secondItem="6" secondAttribute="top" id="vnl-7x-Khx"/>
<constraint firstAttribute="trailing" secondItem="Cmv-HN-XSZ" secondAttribute="trailing" id="zrP-9m-HiW"/>
</constraints>
</view>
<connections>
@ -40,5 +66,6 @@
</connections>
</window>
<customObject id="-3" userLabel="Application"/>
<userDefaultsController representsSharedInstance="YES" id="T2B-US-Gnt"/>
</objects>
</document>

View file

@ -8,6 +8,11 @@
#import <Cocoa/Cocoa.h>
@interface Document : NSDocument
@interface Document : NSDocument {
NSAttributedString *stringModel;
}
@property (unsafe_unretained) IBOutlet NSTextView *textView;
@property (nonatomic, readwrite) NSAttributedString *stringModel;
@end

View file

@ -9,6 +9,8 @@
#import "Document.h"
@implementation Document
@synthesize textView;
@synthesize stringModel;
- (id)init
{
@ -29,6 +31,7 @@
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
{
[super windowControllerDidLoadNib:aController];
[self.textView setFont:[NSFont userFixedPitchFontOfSize:16]];
// Add any code here that needs to be executed once the windowController has loaded the document's window.
}
@ -39,21 +42,20 @@
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
// Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.
// You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
@throw exception;
return nil;
NSData *data = [[self.textView.textStorage string] dataUsingEncoding:NSUTF8StringEncoding];
[self.textView breakUndoCoalescing];
if (!data && outError) {
*outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:nil];
}
return data;
}
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
// Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
// If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.
NSException *exception = [NSException exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
@throw exception;
return YES;
self.stringModel = [[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:[data bytes]]];
return !!self.stringModel;
}
@end

BIN
TextEd/Icon.icns Normal file

Binary file not shown.

View file

@ -28,9 +28,9 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<string>Icon.icns</string>
<key>CFBundleIdentifier</key>
<string>net.jeena.${PRODUCT_NAME:rfc1034identifier}</string>
<string>nu.jabs.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -43,6 +43,8 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>

View file

@ -1,29 +1,16 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\f0\b\fs24 \cf0 TextEd.app
\b0 is here to replace Apples TextEdit.app since it doesn't start right away anymore and can not be used as a notepad anymore, the startup time is just too slow.\
\
\b Human Interface Design:
\b0 \
Some other people\
It doesn't work with RDF, only with plain text. Therefor a monospace font is used.\
\
\b Testing:
\b0 \
Hopefully not nobody\
Jabs Nu <http://jabs.nu>\
\
\b Documentation:
\b0 \
Whoever\
\
\b With special thanks to:
\b0 \
Mom\
}
Thanks to
\i Yellow Icon Design
\i0 for the icon <http://www.yellowicon.com/>}