diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j
index 3af164570..19b38a2bd 100644
--- a/AppKit/CPTabView.j
+++ b/AppKit/CPTabView.j
@@ -78,7 +78,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1,
THe currently selected CPTabViewItem is the view that is displayed.
*/
@implementation CPTabView : CPView
-{
+{
CPView _labelsView;
CPView _backgroundView;
CPView _separatorView;
@@ -524,6 +524,55 @@ var CPTabViewDidSelectTabViewItemSelector = 1,
@end
+var CPTabViewItemsKey = "CPTabViewItemsKey",
+ CPTabViewSelectedItemKey = "CPTabViewSelectedItemKey",
+ CPTabViewTypeKey = "CPTabViewTypeKey",
+ CPTabViewDelegateKey = "CPTabViewDelegateKey";
+
+@implementation CPTabView (CPCoding)
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+ if (self = [super initWithCoder:aCoder])
+ {
+ _tabViewType = [aCoder decodeIntForKey:CPTabViewTypeKey];
+ _tabViewItems = [];
+
+ // FIXME: this is somewhat hacky
+ [self _createBezelBorder];
+
+ var items = [aCoder decodeObjectForKey:CPTabViewItemsKey];
+ for (var i = 0; items && i < items.length; i++)
+ [self insertTabViewItem:items[i] atIndex:i];
+
+ var selected = [aCoder decodeObjectForKey:CPTabViewSelectedItemKey];
+ if (selected)
+ [self selectTabViewItem:selected];
+
+ [self setDelegate:[aCoder decodeObjectForKey:CPTabViewDelegateKey]];
+ }
+
+ return self;
+}
+
+- (void)encodeWithCoder:(CPCoder)aCoder
+{
+ var actualSubviews = _subviews;
+ _subviews = [];
+ [super encodeWithCoder:aCoder];
+ _subviews = actualSubviews;
+
+ [aCoder encodeObject:_tabViewItems forKey:CPTabViewItemsKey];;
+ [aCoder encodeObject:_selectedTabViewItem forKey:CPTabViewSelectedItemKey];
+
+ [aCoder encodeInt:_tabViewType forKey:CPTabViewTypeKey];
+
+ [aCoder encodeConditionalObject:_delegate forKey:CPTabViewDelegateKey];
+}
+
+@end
+
+
var _CPTabLabelsViewBackgroundColor = nil,
_CPTabLabelsViewInsideMargin = 10.0,
_CPTabLabelsViewOutsideMargin = 15.0;
diff --git a/AppKit/CPTabViewItem.j b/AppKit/CPTabViewItem.j
index b1906576a..4f0bad495 100644
--- a/AppKit/CPTabViewItem.j
+++ b/AppKit/CPTabViewItem.j
@@ -162,3 +162,40 @@ CPPressedTab = 2;
}
@end
+
+var CPTabViewItemIdentifierKey = "CPTabViewItemIdentifierKey",
+ CPTabViewItemLabelKey = "CPTabViewItemLabelKey",
+ CPTabViewItemViewKey = "CPTabViewItemViewKey",
+ CPTabViewItemAuxViewKey = "CPTabViewItemAuxViewKey";
+
+
+@implementation CPTabViewItem (CPCoding)
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+ self = [super init];
+
+ if (self)
+ {
+ _identifier = [aCoder decodeObjectForKey:CPTabViewItemIdentifierKey];
+ _label = [aCoder decodeObjectForKey:CPTabViewItemLabelKey];
+
+ _view = [aCoder decodeObjectForKey:CPTabViewItemViewKey];
+ _auxiliaryView = [aCoder decodeObjectForKey:CPTabViewItemAuxViewKey];
+
+ CPLog.warn("_identifier="+_identifier+" _label="+_label+" _view="+_view+" _auxiliaryView="+_auxiliaryView);
+ }
+
+ return self;
+}
+
+- (void)encodeWithCoder:(CPCoder)aCoder
+{
+ [aCoder encodeObject:_identifier forKey:CPTabViewItemIdentifierKey];
+ [aCoder encodeObject:_label forKey:CPTabViewItemLabelKey];
+
+ [aCoder encodeObject:_view forKey:CPTabViewItemViewKey];
+ [aCoder encodeObject:_auxiliaryView forKey:CPTabViewItemAuxViewKey];
+}
+
+@end
diff --git a/Tools/nib2cib/NSAppKit.j b/Tools/nib2cib/NSAppKit.j
index 9a3f9a068..a55042af6 100644
--- a/Tools/nib2cib/NSAppKit.j
+++ b/Tools/nib2cib/NSAppKit.j
@@ -36,6 +36,8 @@
@import "NSResponder.j"
@import "NSSlider.j"
@import "NSSplitView.j"
+@import "NSTabView.j"
+@import "NSTabViewItem.j"
@import "NSTextField.j"
@import "NSToolbar.j"
@import "NSView.j"
diff --git a/Tools/nib2cib/NSTabView.j b/Tools/nib2cib/NSTabView.j
new file mode 100644
index 000000000..dd91abea1
--- /dev/null
+++ b/Tools/nib2cib/NSTabView.j
@@ -0,0 +1,67 @@
+/*
+ * NSTabView.j
+ * nib2cib
+ *
+ * Created by Thomas Robinson.
+ * Copyright 2008, 280 North, Inc.
+ *
+ * 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
+
+@import "NSTabViewItem.j"
+
+
+@implementation CPTabView (CPCoding)
+
+- (id)NS_initWithCoder:(CPCoder)aCoder
+{
+ if (self = [super NS_initWithCoder:aCoder])
+ {
+ var flags = [aCoder decodeObjectForKey:@"NSTvFlags"];
+
+ _tabViewType = flags & 0x7;
+
+ _tabViewItems = [aCoder decodeObjectForKey:@"NSTabViewItems"];
+ _selectedTabViewItem = [aCoder decodeObjectForKey:@"NSSelectedTabViewItem"];
+
+ //_delegate = [aCoder decodeObjectForKey:@""];
+
+ // not yet supported:
+ //_allowsTruncatedLabels = [aCoder decodeBoolForKey:@"NSAllowTruncatedLabels"];
+ //_drawsBackground = [aCoder decodeBoolForKey:@"NSDrawsBackground"];
+ }
+
+ return self;
+}
+
+@end
+
+@implementation NSTabView : CPTabView
+{
+}
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+ return [self NS_initWithCoder:aCoder];
+}
+
+- (Class)classForKeyedArchiver
+{
+ return [CPTabView class];
+}
+
+@end
diff --git a/Tools/nib2cib/NSTabViewItem.j b/Tools/nib2cib/NSTabViewItem.j
new file mode 100644
index 000000000..74d915fbf
--- /dev/null
+++ b/Tools/nib2cib/NSTabViewItem.j
@@ -0,0 +1,60 @@
+/*
+ * NSTabViewItem.j
+ * nib2cib
+ *
+ * Created by Thomas Robinson.
+ * Copyright 2008, 280 North, Inc.
+ *
+ * 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
+
+
+@implementation CPTabViewItem (CPCoding)
+
+- (id)NS_initWithCoder:(CPCoder)aCoder
+{
+ if (self = [super init])
+ {
+ _identifier = [aCoder decodeObjectForKey:"NSIdentifier"];
+ _label = [aCoder decodeObjectForKey:"NSLabel"];
+
+ _view = [aCoder decodeObjectForKey:"NSView"];
+
+ // doesn't exist in Cocoa
+ //_auxiliaryView = [aCoder decodeObjectForKey:CPTabViewItemAuxViewKey]
+ }
+
+ return self;
+}
+
+@end
+
+@implementation NSTabViewItem : CPTabViewItem
+{
+}
+
+- (id)initWithCoder:(CPCoder)aCoder
+{
+ return [self NS_initWithCoder:aCoder];
+}
+
+- (Class)classForKeyedArchiver
+{
+ return [CPTabViewItem class];
+}
+
+@end