Commit 50bfb5bc authored by Vibhoothi's avatar Vibhoothi

macosx:Introduce VLCMainWindowCollectionViewItem cocoa class with XIB for implementing LibraryView

The following files are newly introduced
- VLCMainWindowCollectionViewItem.xib : An Interface for showing collectionView items.
- VLCMainWindowCollectionViewItem.h   : Header file for defining instance and instance variables
- VLCMainWindowCollectionViewItem.m   : Cococa class which contains implementation of instance and representation of objects
parent 1dbf5e3e
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainWindowCollectionViewItem">
<connections>
<outlet property="VLCItemImageView" destination="LRe-wn-Y2z" id="HPo-O1-7R6"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY" userLabel="Library View">
<rect key="frame" x="0.0" y="0.0" width="171" height="193"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LRe-wn-Y2z">
<rect key="frame" x="47" y="97" width="77" height="76"/>
<constraints>
<constraint firstAttribute="width" constant="77" id="6QU-dx-4YT"/>
<constraint firstAttribute="height" constant="76" id="VTi-R7-Kzg"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="VLC" id="szu-Su-VAK"/>
</imageView>
</subviews>
<constraints>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="47" id="YGY-ey-fbH"/>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" constant="-38.5" id="hyO-mR-8Jc"/>
</constraints>
<point key="canvasLocation" x="-94.5" y="129.5"/>
</customView>
</objects>
<resources>
<image name="VLC" width="512" height="512"/>
</resources>
</document>
/*****************************************************************************
* VLCMainWindowCollectionView.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2018 VLC authors and VideoLAN
* $Id $
*
* Authors: Vibhoothi <vibhoothiiaanand -at- googlemail dot com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCMainWindowCollectionViewItem : NSCollectionViewItem
@property (weak) IBOutlet NSImageView *VLCItemImageView;
@end
/*****************************************************************************
* VLCMainWindowCollectionView.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2018 VLC authors and VideoLAN
* $Id $
*
* Authors: Vibhoothi <vibhoothiiaanand -at- googlemail dot com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "VLCMainWindowCollectionViewItem.h"
@interface VLCMainWindowCollectionViewItem ()
@end
@implementation VLCMainWindowCollectionViewItem
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
}
-(void)setRepresentedObject:(id)representedObject{
[super setRepresentedObject:representedObject];
if (representedObject !=nil)
{
NSLog(@"Loaded %@",[representedObject valueForKey:@"itemImage"]);
[self.VLCItemImageView setImage:[[NSBundle mainBundle] imageForResource:[representedObject valueForKey:@"itemImage"]]];
}
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment