From 1f369b47d782aef92d43c6c4e7fe013434f01968 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Mon, 23 Mar 2015 13:06:22 -0700 Subject: [PATCH] Added hierarchy for nib2cib of a CPTextView. NSTextViewSharedData is a object to retrieve attributes of the CPTextView --- Tools/nib2cib/NSAppKit.j | 5 +- Tools/nib2cib/NSLayoutManager.j | 60 +++++++++++++++++++++ Tools/nib2cib/NSText.j | 61 +++++++++++++++++++++ Tools/nib2cib/NSTextContainer.j | 2 + Tools/nib2cib/NSTextStorage.j | 59 +++++++++++++++++++++ Tools/nib2cib/NSTextView.j | 6 ++- Tools/nib2cib/NSTextViewSharedData.j | 79 ++++++++++++++++++++++++++++ 7 files changed, 269 insertions(+), 3 deletions(-) create mode 100644 Tools/nib2cib/NSLayoutManager.j create mode 100644 Tools/nib2cib/NSText.j create mode 100644 Tools/nib2cib/NSTextStorage.j create mode 100644 Tools/nib2cib/NSTextViewSharedData.j diff --git a/Tools/nib2cib/NSAppKit.j b/Tools/nib2cib/NSAppKit.j index b5c44ac21..24944fb0b 100644 --- a/Tools/nib2cib/NSAppKit.j +++ b/Tools/nib2cib/NSAppKit.j @@ -45,6 +45,7 @@ @import "NSImage.j" @import "NSImageView.j" @import "NSLayoutConstraint.j" +@import "NSLayoutManager.j" @import "NSLevelIndicator.j" @import "NSMatrix.j" @import "NSMenu.j" @@ -72,9 +73,12 @@ @import "NSTableView.j" @import "NSTabView.j" @import "NSTabViewItem.j" +@import "NSText.j" @import "NSTextContainer.j" @import "NSTextField.j" +@import "NSTextStorage.j" @import "NSTextView.j" +@import "NSTextViewSharedData.j" @import "NSTokenField.j" @import "NSToolbar.j" @import "NSToolbarFlexibleSpaceItem.j" @@ -91,7 +95,6 @@ @import "NSPopover.j" @import "NSProgressIndicator.j" - function CP_NSMapClassName(aClassName) { if (aClassName.indexOf("NS") === 0) diff --git a/Tools/nib2cib/NSLayoutManager.j b/Tools/nib2cib/NSLayoutManager.j new file mode 100644 index 000000000..53757bcd1 --- /dev/null +++ b/Tools/nib2cib/NSLayoutManager.j @@ -0,0 +1,60 @@ +/* + * NSText.j + * nib2cib + * + * Created by Alexendre Wilhelm. + * Copyright 2014 The Cappuccino Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + +@class Nib2Cib + +@implementation CPLayoutManager (NSCoding) + +- (id)NS_initWithCoder:(CPCoder)aCoder +{ + self = [super init]; + + return self; +} + +@end + +@implementation NSLayoutManager : CPLayoutManager +{ + +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [self NS_initWithCoder:aCoder]; + + if (self) + { + var textStorage = [aCoder decodeObjectForKey:@"NSTextStorage"]; + } + + return self; +} + +- (Class)classForKeyedArchiver +{ + return [CPLayoutManager class]; +} + +@end diff --git a/Tools/nib2cib/NSText.j b/Tools/nib2cib/NSText.j new file mode 100644 index 000000000..9aa4c1c43 --- /dev/null +++ b/Tools/nib2cib/NSText.j @@ -0,0 +1,61 @@ +/* + * NSText.j + * nib2cib + * + * Created by Alexendre Wilhelm. + * Copyright 2014 The Cappuccino Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + +@class Nib2Cib + +@implementation CPText (NSCoding) + +- (id)NS_initWithCoder:(CPCoder)aCoder +{ + if (self = [super NS_initWithCoder:aCoder]) + { + } + + return self; +} + +@end + +@implementation NSText : CPText +{ + +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [self NS_initWithCoder:aCoder]; + + if (self) + { + } + + return self; +} + +- (Class)classForKeyedArchiver +{ + return [CPText class]; +} + +@end diff --git a/Tools/nib2cib/NSTextContainer.j b/Tools/nib2cib/NSTextContainer.j index fd8ebdeeb..e4d80a039 100644 --- a/Tools/nib2cib/NSTextContainer.j +++ b/Tools/nib2cib/NSTextContainer.j @@ -46,6 +46,8 @@ if (self) { _size = CGSizeMake([aCoder decodeIntForKey:@"NSWidth"], 1e7); + + var layoutManager = [aCoder decodeObjectForKey:@"NSLayoutManager"]; } return self; diff --git a/Tools/nib2cib/NSTextStorage.j b/Tools/nib2cib/NSTextStorage.j new file mode 100644 index 000000000..27e4614b4 --- /dev/null +++ b/Tools/nib2cib/NSTextStorage.j @@ -0,0 +1,59 @@ +/* + * NSTextStorage.j + * nib2cib + * + * Created by Alexendre Wilhelm. + * Copyright 2014 The Cappuccino Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + +@class Nib2Cib + +@implementation CPTextStorage (NSCoding) + +- (id)NS_initWithCoder:(CPCoder)aCoder +{ + self = [super init]; + + return self; +} + +@end + +@implementation NSTextStorage : CPTextStorage +{ +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [self NS_initWithCoder:aCoder]; + + if (self) + { + + } + + return self; +} + +- (Class)classForKeyedArchiver +{ + return [CPTextStorage class]; +} + +@end diff --git a/Tools/nib2cib/NSTextView.j b/Tools/nib2cib/NSTextView.j index d3febea6a..8ebd8d6dc 100644 --- a/Tools/nib2cib/NSTextView.j +++ b/Tools/nib2cib/NSTextView.j @@ -22,6 +22,8 @@ @import +@import "NSTextViewSharedData.j" + @class Nib2Cib @implementation CPTextView (NSCoding) @@ -40,7 +42,7 @@ @implementation NSTextView : CPTextView { - + CPTextViewSharedData _textViewSharedData; } - (id)initWithCoder:(CPCoder)aCoder @@ -49,7 +51,7 @@ if (self) { - var flags = [aCoder decodeIntForKey:@"NSTVFlags"]; + _textViewSharedData = [aCoder decodeObjectForKey:@"NSSharedData"]; } return self; diff --git a/Tools/nib2cib/NSTextViewSharedData.j b/Tools/nib2cib/NSTextViewSharedData.j new file mode 100644 index 000000000..ace8b9cfb --- /dev/null +++ b/Tools/nib2cib/NSTextViewSharedData.j @@ -0,0 +1,79 @@ +/* + * NSTextView.j + * nib2cib + * + * Created by Alexendre Wilhelm. + * Copyright 2014 The Cappuccino Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +@import + +@class Nib2Cib + +@implementation CPTextViewSharedData : CPObject +{ +} + +- (id)init +{ + if(self = [super init]) + { + + } + return self; +} + +@end + + +@implementation CPTextViewSharedData (NSCoding) + +- (id)NS_initWithCoder:(CPCoder)aCoder +{ + if (self = [super init]) + { + var flags = [aCoder decodeIntForKey:@"NSFlags"]; + } + + return self; +} + +@end + +@implementation NSTextViewSharedData : CPTextViewSharedData +{ + +} + +- (id)initWithCoder:(CPCoder)aCoder +{ + self = [self NS_initWithCoder:aCoder]; + + if (self) + { + + } + + return self; +} + +- (Class)classForKeyedArchiver +{ + return [CPTextViewSharedData class]; +} + +@end