Merge pull request #2371 from primalmotion/CPVisualEffectView

CPVisualEffectView & CPAppearance
This commit is contained in:
Alexandre Wilhelm committed 2015-08-18 15:15:03 -07:00
commit ab61aef985
25 files changed
+1649 -11

No files matched your search

+2
View File
@@ -88,6 +88,8 @@
@import "NSSortDescriptor.j"
@import "NSPopover.j"
@import "NSProgressIndicator.j"
@import "NSAppearance.j"
@import "NSVisualEffectView.j"
function CP_NSMapClassName(aClassName)
+52
View File
@@ -0,0 +1,52 @@
/*
* NSAppearance.j
* nib2cib
*
* Created by Antoine Mercadal.
* Copyright 2015, Cappuccino Project
*
* 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 <AppKit/CPAppearance.j>
@implementation CPAppearance (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
if (self = [super init])
{
_name = [aCoder decodeObjectForKey:@"NSAppearanceName"].replace(/^NS/, "CP");
}
return self;
}
@end
@implementation NSAppearance : CPAppearance
- (id)initWithCoder:(CPCoder)aCoder
{
return [self NS_initWithCoder:aCoder];
}
- (Class)classForKeyedArchiver
{
return [CPAppearance class];
}
@end
+1
View File
@@ -52,6 +52,7 @@ var NSViewAutoresizingMask = 0x3F,
_window = [aCoder decodeObjectForKey:@"NSWindow"];
_superview = [aCoder decodeObjectForKey:@"NSSuperview"];
_subviews = [aCoder decodeObjectForKey:@"NSSubviews"];
_appearance = [aCoder decodeObjectForKey:@"NSAppearance"];
_hierarchyScaleSize = CGSizeMake(1.0 , 1.0);
_scaleSize = CGSizeMake(1.0, 1.0);
+57
View File
@@ -0,0 +1,57 @@
/*
* NSVisualEffectView.j
* nib2cib
*
* Created by Antoine Mercadal.
* Copyright 2015, Cappuccino Project
*
* 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 <AppKit/CPVisualEffectView.j>
@implementation CPVisualEffectView (NSCoding)
- (id)NS_initWithCoder:(CPCoder)aCoder
{
if (self = [super NS_initWithCoder:aCoder])
{
_material = [aCoder decodeObjectForKey:@"NSVisualEffectViewMaterial"];
_state = [aCoder decodeObjectForKey:@"NSVisualEffectViewState"];
// this is not supported
// _blendingMode = [aCoder decodeObjectForKey:@"NSVisualEffectViewBlendingMode"];
_blendingMode = CPVisualEffectBlendingModeWithinWindow;
}
return self;
}
@end
@implementation NSVisualEffectView : CPVisualEffectView
- (id)initWithCoder:(CPCoder)aCoder
{
return [self NS_initWithCoder:aCoder];
}
- (Class)classForKeyedArchiver
{
return [CPVisualEffectView class];
}
@end
+3 -1
View File
@@ -604,5 +604,7 @@ var NSClasses = {
"NSWindow" : YES,
"NSWindowController" : YES,
"NSWorkspace" : YES,
"NSPopover": YES
"NSPopover": YES,
"NSAppearance" : YES,
"NSVisualEffectView" : YES,
};