Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:tomcool420/SMFramework

  • Loading branch information...
commit 8a4da763556212ec965c4952a7fdcf8cd0a5e499 2 parents 1ee2ef1 + cfda17e
@tomcool420 authored
Showing with 1,476 additions and 187 deletions.
  1. +1 −0  .gitignore
  2. +5 −4 Makefile
  3. +26 −0 SMFAnimation.h
  4. +137 −0 SMFAnimation.m
  5. +4 −2 SMFComplexDropShadowControl.h
  6. +59 −10 SMFComplexDropShadowControl.mm
  7. +2 −0  SMFDefines.h
  8. +30 −0 SMFDropShadowControl.h
  9. +261 −0 SMFDropShadowControl.m
  10. +12 −0 SMFListDropShadowControl.h
  11. +205 −4 SMFListDropShadowControl.m
  12. +4 −0 SMFMenuItem.h
  13. +14 −1 SMFMenuItem.m
  14. +22 −0 SMFMockMenuItem.h
  15. +16 −0 SMFMockMenuItem.m
  16. +9 −9 SMFMoviePreviewController.m
  17. +2 −2 SMFPopup.mm
  18. +1 −1  SMFScreenCapture.h
  19. +7 −0 SMFScreenCapture.m
  20. +2 −2 SMFTextDropShadowControl.h
  21. +8 −8 SMFTextDropShadowControl.mm
  22. +24 −0 SMFramework.xcodeproj/project.pbxproj
  23. +2 −2 _/DEBIAN/control
  24. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/BRMenuItem_SMF.h
  25. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFBaseAsset.h
  26. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFCenteredMenuController.h
  27. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFClockController.h
  28. +56 −25 _/Library/Frameworks/SMFramework.framework/Headers/SMFCommonTools.h
  29. +6 −6 _/Library/Frameworks/SMFramework.framework/Headers/SMFController.h
  30. +2 −0  _/Library/Frameworks/SMFramework.framework/Headers/SMFDefines.h
  31. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFEvent.h
  32. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFEventConfiguration.h
  33. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFEventManager.h
  34. +44 −40 _/Library/Frameworks/SMFramework.framework/Headers/SMFFolderBrowser.h
  35. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFFolderDelegate.h
  36. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFInvocationCenteredMenuController.h
  37. +34 −16 _/Library/Frameworks/SMFramework.framework/Headers/SMFMediaMenuController.h
  38. +68 −4 _/Library/Frameworks/SMFramework.framework/Headers/SMFMediaPreview.h
  39. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFMenuController.h
  40. +5 −1 _/Library/Frameworks/SMFramework.framework/Headers/SMFMenuItem.h
  41. +61 −5 _/Library/Frameworks/SMFramework.framework/Headers/SMFPasscodeController.h
  42. +110 −13 _/Library/Frameworks/SMFramework.framework/Headers/SMFPhotoMethods.h
  43. +1 −1  _/Library/Frameworks/SMFramework.framework/Headers/SMFProgressBarControl.h
  44. +7 −2 _/Library/Frameworks/SMFramework.framework/Headers/SMFQueryMenu.h
  45. +2 −2 _/Library/Frameworks/SMFramework.framework/Headers/SMFScreenCapture.h
  46. +196 −12 _/Library/Frameworks/SMFramework.framework/Headers/SMFThemeInfo.h
  47. +16 −2 _/Library/Frameworks/SMFramework.framework/Headers/SMFramework.h
  48. BIN  _/Library/Frameworks/SMFramework.framework/SMFramework
  49. BIN  _/Library/MobileSubstrate/DynamicLibraries/EventCatcher.dylib
  50. +2 −0  atvTwo_Prefix.pch
  51. +1 −1  control
  52. +2 −2 eventcatcher/Makefile
  53. BIN  eventcatcher/obj/EventCatcher.dylib
  54. BIN  eventcatcher/obj/Tweak.xm.o
  55. 0  obj/.stamp
  56. BIN  obj/BRMenuItem_SMF.m.o
  57. BIN  obj/SMFBaseAsset.m.o
  58. BIN  obj/SMFCenteredMenuController.m.o
  59. BIN  obj/SMFClockController.m.o
  60. BIN  obj/SMFEvent.m.o
  61. BIN  obj/SMFEventConfiguration.m.o
  62. BIN  obj/SMFEventManager.m.o
  63. BIN  obj/SMFFolderBrowser.m.o
  64. BIN  obj/SMFInvocationCenteredMenuController.m.o
  65. BIN  obj/SMFMediaMenuController.m.o
  66. BIN  obj/SMFMediaPreview.mm.o
  67. BIN  obj/SMFMenuController.m.o
  68. BIN  obj/SMFMenuItem.m.o
  69. BIN  obj/SMFPasscodeController.m.o
  70. BIN  obj/SMFPhotoMethods.mm.o
  71. BIN  obj/SMFProgressBarControl.m.o
  72. BIN  obj/SMFQueryMenu.m.o
  73. BIN  obj/SMFScreenCapture.m.o
  74. BIN  obj/SMFThemeInfo.m.o
  75. BIN  obj/SMFramework
View
1  .gitignore
@@ -1,3 +1,4 @@
+obj
build
._*
*.deb
View
9 Makefile
@@ -1,7 +1,7 @@
GO_EASY_ON_ME=1
-SDKVERSION=5.0
-FW_DEVICE_IP=test.local
-#FW_DEVICE_IP=appletv.local
+SDKVERSION=4.3
+#FW_DEVICE_IP=test.local
+FW_DEVICE_IP=appletv.local
first: clean package install
include $(THEOS)/makefiles/common.mk
@@ -16,6 +16,7 @@ SMFramework_FILES += SMFMoviePreviewController.m SMFControlFactory.m SMFAssetPr
SMFramework_FILES += SMFBookcaseController.m SMFComplexDropShadowControl.mm SMFComplexProcessDropShadowControl.m SMFPrefsMenuItem.m
SMFramework_FILES += SMFDictionaryEditor.m SMFDictionaryObjectEditor.m SMFCustomQueryMenu.m SMFPrefsSelectionItem.m
SMFramework_FILES += BRMediaShelfView_SMF.m
+SMFramework_FILES += SMFDropShadowControl.m SMFMockMenuItem.m SMFAnimation.m
SMFramework_FILES += Example/SMFExamples.m Example/SMFMoviePreviewDelegateAndDatasourceExample.m Example/SMFBookcaseDelegateAndDatasourceExample.m Example/SMFGridController.m
@@ -45,4 +46,4 @@ after-SMFramework-stage::
cp Backrow/*.h "$(FW_SHARED_BUNDLE_RESOURCE_PATH)/Headers/Backrow/"
rm -rf ../ATV2Includes/SMFramework
mkdir ../ATV2Includes/SMFramework
- cp -rf Headers/ ../ATV2Includes/SMFramework/
+ cp -rf Headers/ ../ATV2Includes/SMFramework/
View
26 SMFAnimation.h
@@ -0,0 +1,26 @@
+//
+// SMFAnimation.h
+// SMFramework
+//
+// Created by Kevin Bradley on 9/18/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+
+@interface SMFAnimation : NSObject {
+
+}
+
+
++ (CAAnimationGroup *)zoomOutFadedToRect:(CGRect)outRect;
++ (CAAnimationGroup *)zoomInFadedToRect:(CGRect)inRect;
++ (CABasicAnimation *)fadeInAnimation;
++ (CABasicAnimation *)fadeOutAnimation;
++ (CABasicAnimation *)zoomOutToRect:(CGRect)outRect;
++ (CABasicAnimation *)zoomInToRect:(CGRect)inRect;
+
+ //deprecated
++ (CABasicAnimation *)zoomOutAnimation:(CATransform3D)zoomTransform;
++ (CABasicAnimation *)zoomInAnimation:(CATransform3D)zoomTransform;
+
+@end
View
137 SMFAnimation.m
@@ -0,0 +1,137 @@
+//
+// SMFAnimation.m
+// SMFramework
+//
+// Created by Kevin Bradley on 9/18/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+#import "SMFAnimation.h"
+
+#define ZOOM_TO_BOUNDS CGRectMake(0, 0, 108, 108)
+#define ZOOM_TO_POINT CGPointMake(591.5999755859375, 284.39999389648438)
+
+/*
+
+ This class kind of a lazy convience "work in progress", the animations are geared solely to the SMFDropShadowControl classes/subclasses
+
+ you also need to account for - (void)setZoomInPosition when zooming in and out manually, to see an implementation of these animations take a look at SMFDropShadowControl in
+
+ -(void)addToController:(BRController *)ctrl and - (void)removeFromParent
+
+ this is far from elegant right now, but works quite nicely.
+
+ */
+
+
+@implementation SMFAnimation
+
+
++ (CAAnimationGroup *)zoomOutFadedToRect:(CGRect)outRect
+{
+ CAAnimationGroup *outAnimation = [CAAnimationGroup animation];
+ [outAnimation setAnimations:[NSArray arrayWithObjects:[SMFAnimation zoomOutToRect:outRect], [SMFAnimation fadeOutAnimation], nil]];
+ outAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
+ outAnimation.fillMode = kCAFillModeForwards; //if you dont set this it reverts to its old mode before removing and looks really stupid.
+ outAnimation.removedOnCompletion = NO;
+ return outAnimation;
+
+}
+
++ (CAAnimationGroup *)zoomInFadedToRect:(CGRect)inRect
+{
+ CAAnimationGroup *outAnimation = [CAAnimationGroup animation];
+ [outAnimation setAnimations:[NSArray arrayWithObjects:[SMFAnimation zoomInToRect:inRect], [SMFAnimation fadeInAnimation], nil]];
+ outAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
+ outAnimation.fillMode = kCAFillModeForwards; //if you dont set this it reverts to its old mode before removing and looks really stupid.
+ outAnimation.removedOnCompletion = NO;
+ return outAnimation;
+
+}
+
++ (CABasicAnimation *)fadeInAnimation
+{
+ CABasicAnimation *theAnimation =[CABasicAnimation animationWithKeyPath:@"opacity"];
+ theAnimation.fromValue=[NSNumber numberWithFloat:0.0];
+ theAnimation.toValue=[NSNumber numberWithFloat:1.0];
+ return theAnimation;
+}
+
++ (CABasicAnimation *)fadeOutAnimation
+{
+ CABasicAnimation *theAnimation =[CABasicAnimation animationWithKeyPath:@"opacity"];
+ theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
+ theAnimation.toValue=[NSNumber numberWithFloat:0.0];
+ return theAnimation;
+}
+
+
++ (CABasicAnimation *)zoomOutToRect:(CGRect)outRect
+{
+ CABasicAnimation *zoomOutAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ zoomOutAnimation.fromValue = [NSNumber numberWithInt:1.0];
+ if (CGRectEqualToRect(outRect, CGRectZero))
+ {
+ zoomOutAnimation.toValue = [NSValue valueWithCGRect:ZOOM_TO_BOUNDS];
+
+ } else {
+
+ zoomOutAnimation.toValue = [NSValue valueWithCGRect:outRect];
+
+ }
+
+ //zoomOutAnimation.duration = 0.25f;
+ return zoomOutAnimation;
+}
+
++ (CABasicAnimation *)zoomInToRect:(CGRect)inRect
+{
+ CABasicAnimation *zoomInAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ if (CGRectEqualToRect(inRect, CGRectZero))
+ {
+ zoomInAnimation.fromValue = [NSValue valueWithCGRect:ZOOM_TO_BOUNDS];
+
+ } else {
+
+ zoomInAnimation.fromValue = [NSValue valueWithCGRect:inRect];
+ }
+
+ zoomInAnimation.toValue = [NSNumber numberWithInt:1.0];
+ return zoomInAnimation;
+}
+
+
+/*
+
+ deprecated code left in for posterity / laziness (in case we ever decide to grapple with transforms, a refresher/reminder
+
+ */
+
++ (CABasicAnimation *)zoomOutAnimation:(CATransform3D)zoomTransform //edits the transform directly, so this cant be properly paired with other animations - deprecated
+{
+
+ CABasicAnimation *zoomOutAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ //[zoomOutAnimation setDelegate:SMFAnimation];
+ zoomOutAnimation.repeatCount = 0;
+ zoomOutAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
+ zoomOutAnimation.toValue = [NSValue valueWithCATransform3D:zoomTransform];
+ zoomOutAnimation.fillMode = kCAFillModeForwards;
+ zoomOutAnimation.removedOnCompletion = NO;
+ return zoomOutAnimation;
+
+}
+
+
++ (CABasicAnimation *)zoomInAnimation:(CATransform3D)zoomTransform
+{
+
+ CABasicAnimation *zoomInAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ zoomInAnimation.fromValue = [NSValue valueWithCATransform3D:zoomTransform];
+ zoomInAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
+ return zoomInAnimation;
+
+}
+
+
+
+@end
View
6 SMFComplexDropShadowControl.h
@@ -8,8 +8,9 @@
#import "Backrow/AppleTV.h"
#import "SMFProgressBarControl.h"
+#import "SMFDropShadowControl.h"
-@interface SMFComplexDropShadowControl : BRDropShadowControl {
+@interface SMFComplexDropShadowControl : SMFDropShadowControl {
BRControl *_bg;
BRScrollingTextBoxControl *_scrolling;
BRWaitSpinnerControl *_spinner;
@@ -35,7 +36,7 @@
@property(readwrite,assign)NSObject *delegate;
-(void)appendToText:(NSString *)t;
--(void)addToController:(BRController *)ctrl;
+ //-(void)addToController:(BRController *)ctrl;
-(void)setShowsProgressBar:(BOOL)shows;
-(void)setShowsWaitSpinner:(BOOL)spinner;
@@ -46,5 +47,6 @@
-(BOOL)blocking;
-(id)attributedStringForString:(NSString*)s;
-(void)updateHeader;
+- (void)removeBlueLozenge;
@end
View
69 SMFComplexDropShadowControl.mm
@@ -11,6 +11,9 @@
#import "SMFDefines.h"
#import <substrate.h>
+#define SHRINK_RECT CGRectMake(270.0,85.0,730.0,530.0)
+
+
@implementation SMFComplexDropShadowControl
@synthesize title=_title;
@synthesize subtitle=_subtitle;
@@ -23,14 +26,18 @@ -(id)init
CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
[self setFrame:f];
_bg=[[BRControl alloc] init];
+
_progress=[[SMFProgressBarControl alloc]init];
_titleControl=[[BRMetadataTitleControl alloc]init];
_scrolling=[[BRScrollingTextBoxControl alloc]init];
_list=MSHookIvar<BRListControl *>(_scrolling, "_list");
+ [_list setSelectionLozengeStyle:0];
+ _list.avoidsCursor = TRUE;
+ _list.displaysSelectionWidget = FALSE;
self.backgroundColor=[[SMFThemeInfo sharedTheme]blackColor];
self.borderColor=[[SMFThemeInfo sharedTheme] whiteColor];
self.borderWidth=3.0;
- self.title=@"Installing SMFramework";
+ self.title=@" ";
self.subtitle=@" ";
[self setContent:_bg];
_text=[[NSMutableString alloc] initWithString:@" "];
@@ -38,26 +45,34 @@ -(id)init
[self addObserver:self forKeyPath:@"subtitle" options:0 context:nil];
return self;
}
--(void)addToController:(BRController *)ctrl
+
+void logFrame(CGRect frame)
{
+ NSLog(@"{{%f, %f},{%f,%f}}",frame.origin.x,frame.origin.y,frame.size.width,frame.size.height);
+}
- CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
- [self setFrame:f];
- [ctrl addControl:self];
- [ctrl setFocusedControl:self];
- [ctrl _setFocus:self];
+ //this is taken care of by the superclass now
-}
+//-(void)addToController:(BRController *)ctrl
+//{
+//
+// CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
+// [self setFrame:f];
+// [ctrl addControl:self];
+// [ctrl setFocusedControl:self];
+// [ctrl _setFocus:self];
+//
+//}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)o change:(NSDictionary *)change context:(void *)context
{
if (o==self && [keyPath isEqualToString:@"title"]) {
- NSLog(@"changing title");
+ // NSLog(@"changing title");
[_titleControl setTitle:_title];
[_titleControl layoutSubcontrols];
}
else if(o==self && [keyPath isEqualToString:@"subtitle"])
{
- NSLog(@"changing subtitle");
+ // NSLog(@"changing subtitle");
[_titleControl setTitleSubtext:_subtitle];
[_titleControl layoutSubcontrols];
}
@@ -77,6 +92,7 @@ -(void)reload
[_scrolling setFrame:CGRectMake(0.0, pf.size.height*0.11, pf.size.width, pf.size.height*0.75f)];
[_scrolling setText:[self attributedStringForString:_text]];
[_bg addControl:_scrolling];
+
}
-(id)attributedStringForString:(NSString*)s
@@ -92,10 +108,43 @@ -(void)appendToText:(NSString *)t
[_scrolling setText:[self attributedStringForString:_text]];
[_list setSelection:([_list dataCount]-1)];
[_scrolling layoutSubcontrols];
+ [self _setFocus:nil];
+ [self setFocusedControl:nil];
+}
+
+- (void)removeBlueLozenge //thats (sort of) the weird thing going on when you use this controller in conjunction w/ SMFMoviePreviewController
+{
+ NSEnumerator *controlEnum = [[_list controls] objectEnumerator];
+ id current = nil;
+ while ((current = [controlEnum nextObject]))
+ {
+ NSString *currentClass = NSStringFromClass([current class]);
+ if ([currentClass isEqualToString:@"BRBlueGlowSelectionLozengeLayer"])
+ {
+
+ [current removeFromParent];
+
+ [_list layoutSubcontrols];
+ }
+ }
}
+
+
+//- (CGRect)focusCursorFrame
+//{
+// //right now i am just shrinking the rect down so its only noticable during its exit animation (which was a default animation that we have nothing to do w/)
+// return SHRINK_RECT;
+//}
+
-(void)controlWasActivated
{
[super controlWasActivated];
+ //NSArray *listControls = [_list controls];
+// if ([listControls count] > 1)
+// {
+// [self removeBlueLozenge];
+// }
+
[self reload];
}
-(void)setShowsProgressBar:(BOOL)shows
View
2  SMFDefines.h
@@ -32,3 +32,5 @@ typedef enum {
kBREventRemoteActionHoldUp,
kBREventRemoteActionHoldDown,
} BREventRemoteAction;
+
+#define LOG_SELF NSLog(@"%@ %s", self, _cmd)
View
30 SMFDropShadowControl.h
@@ -0,0 +1,30 @@
+//
+// SMFDropShadowControl.h
+// SMFramework
+//
+// Created by Kevin Bradley on 9/13/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+#import "Backrow/AppleTV.h"
+
+
+@interface SMFDropShadowControl : BRDropShadowControl {
+
+ BOOL isAnimated;
+ id sender;
+
+}
+
+@property (readwrite, assign) BOOL isAnimated;
+@property (nonatomic, retain) id sender;
+
+- (void)setZoomInPosition;
+- (void)setZoomOutPosition;
+
+- (void)updateSender;
+- (id)getListFromMenuItem:(id)menuItem;
+- (id)synthesizeMockItemFrom:(id)theSender withX:(float)xValue;
+- (id)synthesizeMockItem;
+
+@end
View
261 SMFDropShadowControl.m
@@ -0,0 +1,261 @@
+//
+// SMFDropShadowControl.m
+// SMFramework
+//
+// Created by Kevin Bradley on 9/13/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+#import "SMFDropShadowControl.h"
+#import "SMFDefines.h"
+#import "SMFMockMenuItem.h"
+#import "SMFAnimation.h"
+
+#define ZOOM_TO_POINT CGPointMake(591.5999755859375, 284.39999389648438)
+
+/*
+
+ if you are sending from a BRMenuItem there is a proper way to get the current menu item selection
+
+ id selectedObject = [[self list] selectedObject];
+
+ (keeping in mind this is from your controller you are adding a pop over to)
+
+ you also need to set isAnimation to TRUE before adding the controller.
+
+ i.e.
+
+ SMFListDropShadowControl *c = [[SMFListDropShadowControl alloc]init];
+
+ [c setCDelegate:me]; (me being the controller attached to)
+ [c setSender:sender];
+ [c setCDatasource:me];
+ [c setIsAnimated:TRUE];
+ [c addToController:me];
+
+
+ note: there are a lot of repeat functions between here and SMFListDropShadowControl, hopefully at some point that can become a subclass of this as well
+ and that code can be pruned out.
+
+
+ this class should NEVER be called directly, its sole purpose is for all other SMFDropShadow subclasses to easily subclass and retain the animation goodness.
+
+ */
+
+@implementation SMFDropShadowControl
+
+@synthesize isAnimated, sender;
+
+-(id)init
+{
+ self =[super init];
+ if (self!=nil) {
+
+ self.isAnimated = FALSE; //up to you, can be false by default if you dont like it
+ }
+ return self;
+}
+
+
+- (void)setZoomInPosition
+{
+ CABasicAnimation *pos = [CABasicAnimation animationWithKeyPath:@"position"];
+ if (sender != nil)
+ {
+ pos.fromValue = [NSValue valueWithCGPoint:[sender position]];
+ } else {
+ pos.fromValue = [NSValue valueWithCGPoint:ZOOM_TO_POINT]; //
+ }
+
+ pos.toValue = [NSValue valueWithCGPoint:CGPointMake(640.0, 360.0)];
+ pos.fillMode = kCAFillModeForwards;
+ [[self layer] addAnimation:pos forKey:@"position"];
+}
+
+- (void)setZoomOutPosition
+{
+ CABasicAnimation *pos = [CABasicAnimation animationWithKeyPath:@"position"];
+ pos.fromValue = [NSValue valueWithCGPoint:CGPointMake(640.0, 360.0)]; //
+ if (sender != nil)
+ {
+ pos.toValue = [NSValue valueWithCGPoint:[sender position]];
+ } else {
+ pos.toValue = [NSValue valueWithCGPoint:ZOOM_TO_POINT];
+ }
+
+ pos.fillMode = kCAFillModeForwards;
+ [[self layer] addAnimation:pos forKey:@"position"];
+}
+
+-(BOOL)avoidsCursor //of course it was easier than i was making it!!
+{
+ return TRUE;
+}
+
+- (void)removeFromParent
+{
+ if (self.isAnimated == TRUE)
+ {
+ //CATransform3D zoomTransform = CATransform3DMakeScale(0.1, 0.1, 1.0);
+ CAAnimationGroup *zoomOutAnimation = nil;
+ if (sender != nil)
+ zoomOutAnimation = [SMFAnimation zoomOutFadedToRect:[sender bounds]];
+ else
+ zoomOutAnimation = [SMFAnimation zoomOutFadedToRect:CGRectZero];
+
+ [zoomOutAnimation setDelegate:self];
+ [self setZoomOutPosition];
+ [zoomOutAnimation setValue:@"removeFromParent" forKey:@"Name"];
+ [[self layer] addAnimation:zoomOutAnimation forKey:@"removeFromParent"];
+
+ } else {
+
+
+ [super removeFromParent];
+ }
+
+}
+
+-(void)addToController:(BRController *)ctrl
+{
+ CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
+ [self setFrame:f];
+
+ if (self.isAnimated == TRUE)
+ {
+ CAAnimationGroup *zoomInAnimation = nil;
+
+ if (sender != nil)
+ {
+ [self updateSender]; //fixes the sender to have a proper X value for purposes of zooming in and out
+
+ zoomInAnimation = [SMFAnimation zoomInFadedToRect:[sender bounds]];
+ } else {
+ zoomInAnimation = [SMFAnimation zoomInFadedToRect:CGRectZero];
+ }
+
+
+ [self setZoomInPosition]; //wish there was some way for me to implement this into the animation class, but its specific to self
+ [zoomInAnimation setValue:@"zoomInAnimation" forKey:@"Name"];
+ [zoomInAnimation setDelegate:self];
+
+ [self addAnimation:zoomInAnimation forKey:@"zoomInAnimation"];
+
+ }
+
+ [ctrl addControl:self];
+ [ctrl setFocusedControl:self];
+ //[ctrl _setControlFocused:TRUE];
+ [ctrl _setFocus:self];
+}
+
+
+- (void)animationDidStart:(CAAnimation *)anim
+{
+
+ //NSLog(@"animationDidStart: %@", anim);
+}
+
+- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
+{
+
+ NSString *animationName = [anim valueForKey:@"Name"];
+
+ if ([animationName isEqualToString:@"removeFromParent"])
+ {
+
+ [super removeFromParent];
+ }
+ [self removeAnimationForKey:animationName];
+
+}
+
+
+/*
+
+ if we are a BRMenuItem there are very minimal chances that you will get a usable position and bounds from it for zooming purposes
+ here are all the functions where i handle what is mentioned at the top (the comments about sender)
+
+ */
+
+- (void)updateSender
+{
+ if ([sender isKindOfClass:[BRMenuItem class]]) //is or descends from BRMenuItem
+ {
+ id newSender = [self synthesizeMockItem]; //create our stub menu item that has 2 variables total.
+ if (newSender != nil)
+ {
+ // NSLog(@"setting new sender to: %@", newSender);
+
+ sender = newSender;
+ //NSLog(@"sender check: %@", sender);
+ }
+
+ }
+
+}
+
+ // find the list given the BRMenuItem (or said subclass of BRMenuItem)
+
+- (id)getListFromMenuItem:(id)menuItem
+{
+ id listControl = [[[menuItem parent] parent] parent]; //parent = BRGridControl, grand parent = BRScrollControl, great grand parent = BRListControl
+ NSString *class = NSStringFromClass([listControl class]);
+ if (![class isEqualToString:@"BRListControl"])
+ {
+ NSLog(@"cant find list control!!!, found %@ instead!", class); //bail!!!
+ return nil;
+ }
+ return listControl;
+}
+
+ //given the BRBlueGlowSelectionLozengeLayer control, spit out our stub class with the proper positioning.
+
+- (id)synthesizeMockItemFrom:(id)theSender withX:(float)xValue
+{
+
+ SMFMockMenuItem *menuItem = [[SMFMockMenuItem alloc] init];
+ CGPoint newPosition = [theSender position];
+ newPosition.x = xValue; //said attitude adjustment, without setting this x variable properly, all hell breaks loose.
+
+ [menuItem setBounds:[theSender bounds]];
+ [menuItem setPosition:newPosition];
+
+ return menuItem;
+
+}
+
+- (id)synthesizeMockItem
+{
+ id theList = [self getListFromMenuItem:sender];
+ if (theList == nil)
+ return nil;
+
+ CGPoint listPosition = [theList position];
+ float xValue = listPosition.x;
+ NSEnumerator *controlEnum = [[theList controls] objectEnumerator];
+ id current = nil;
+ while ((current = [controlEnum nextObject]))
+ {
+ NSString *currentClass = NSStringFromClass([current class]);
+ if ([currentClass isEqualToString:@"BRBlueGlowSelectionLozengeLayer"])
+ {
+
+ return [self synthesizeMockItemFrom:current withX:xValue];
+
+ }
+ }
+ return nil;
+}
+
+
+
+-(void)dealloc
+{
+ [sender release];
+ self.sender = nil;
+ [super dealloc];
+}
+
+
+@end
View
12 SMFListDropShadowControl.h
@@ -31,6 +31,8 @@
NSObject<SMFListDropShadowDelegate> * cDelegate;
NSObject<SMFListDropShadowDatasource>* cDatasource;
BRListControl *list;
+ BOOL isAnimated;
+ id sender;
}
/*
* Simply calls [list reload]
@@ -50,7 +52,17 @@
* To remove it: you can call: -(void)removeFromParent
*/
-(void)addToController:(BRController *)ctrl;
+- (void)setZoomInPosition;
+- (void)setZoomOutPosition;
+
+- (void)updateSender;
+- (id)getListFromMenuItem:(id)menuItem;
+- (id)synthesizeMockItemFrom:(id)theSender withX:(float)xValue;
+- (id)synthesizeMockItem;
+
@property (retain) NSObject<SMFListDropShadowDelegate>* cDelegate;
@property (retain) NSObject<SMFListDropShadowDatasource>* cDatasource;
@property (retain) BRListControl *list;
+@property (readwrite, assign) BOOL isAnimated;
+@property (nonatomic, retain) id sender;
@end
View
209 SMFListDropShadowControl.m
@@ -6,22 +6,39 @@
// Copyright 2011 tomcool.org. All rights reserved.
//
+#define ZOOM_TO_POINT CGPointMake(591.5999755859375, 284.39999389648438)
+
+
#import "SMFListDropShadowControl.h"
#import "SMFThemeInfo.h"
#import "SMFMenuItem.h"
#import "SMFDefines.h"
+#import "SMFMockMenuItem.h"
+#import "SMFAnimation.h"
+
+/*
+
+ sender is a new variable to determine the bounds and position for zoom animations, if it descends from BRMenuItem we synthesize a stub class
+ that only has position and bounds variables, i can't figure out how to get the proper bounds/position from BRListControl from and standard BRMenuController
+ so what i do is take the blue lozenge from the list grab its position and modify the x value (the y variables are accurate here, only X needs an attitude adjustment)
+
+
+ */
+
@implementation SMFListDropShadowControl
-@synthesize cDelegate, cDatasource, list;
+@synthesize cDelegate, cDatasource, list, isAnimated, sender;
-(id)init
{
self =[super init];
if (self!=nil) {
self.list = [[[BRListControl alloc]init]autorelease];
[self.list setDatasource:self];
-
- self.backgroundColor=[[SMFThemeInfo sharedTheme]blackColor];
+ self.isAnimated = FALSE; //up to you, can be false by default if you dont like it
+ self.backgroundColor=[[SMFThemeInfo sharedTheme]blackColor];
self.borderColor=[[SMFThemeInfo sharedTheme] whiteColor];
self.borderWidth=3.0;
+ self.inhibitsFocusForChildren = TRUE;
+ self.avoidsCursor = TRUE;
[self setContent:self.list];
}
return self;
@@ -30,10 +47,33 @@ -(void)reloadList
{
[list reload];
}
+
+
-(void)addToController:(BRController *)ctrl
{
CGRect f = [self rectForSize:CGSizeMake(528., 154.)];
+
[self setFrame:f];
+
+ if (self.isAnimated == TRUE)
+ {
+ CAAnimationGroup *zoomInAnimation = nil;
+
+ if (sender != nil)
+ {
+ [self updateSender];
+ zoomInAnimation = [SMFAnimation zoomInFadedToRect:[sender bounds]];
+ } else {
+ zoomInAnimation = [SMFAnimation zoomInFadedToRect:CGRectZero];
+ }
+
+ [self setZoomInPosition]; //if we dont set this the position goes haywire
+
+ [zoomInAnimation setValue:@"zoomInAnimation" forKey:@"Name"];
+ [zoomInAnimation setDelegate:self];
+ [self addAnimation:zoomInAnimation forKey:@"zoomInAnimation"];
+
+ }
[ctrl addControl:self];
[ctrl setFocusedControl:self];
[ctrl _setFocus:self];
@@ -41,7 +81,7 @@ -(void)addToController:(BRController *)ctrl
-(void)controlWasActivated
{
// [list setSelection:0];
- [self setFocusedControl:list];
+ [self setFocusedControl:list];
[self _setFocus:list];
[super controlWasActivated];
}
@@ -99,6 +139,35 @@ -(void)itemSelected:(long)selected
[self removeFromParent];
}
}
+
+- (void)removeFromParent
+{
+ if (self.isAnimated == TRUE)
+ {
+ [self setZoomOutPosition];
+
+ CAAnimationGroup *zoomOutAnimation = nil;
+ if (sender != nil)
+ zoomOutAnimation = [SMFAnimation zoomOutFadedToRect:[sender bounds]];
+ else
+ zoomOutAnimation = [SMFAnimation zoomOutFadedToRect:CGRectZero];
+
+ [zoomOutAnimation setDelegate:self];
+ [zoomOutAnimation setValue:@"removeFromParent" forKey:@"Name"];
+ [[self layer] addAnimation:zoomOutAnimation forKey:@"removeFromParent"];
+
+ } else {
+
+
+ [super removeFromParent];
+ }
+
+}
+
+- (void)actuallyRemove //deprecated
+
+{ [super removeFromParent]; }
+
-(BOOL)brEventAction:(BREvent*)event
{
@@ -133,8 +202,140 @@ -(CGRect)rectForSize:(CGSize)s
r.origin.x=(windowSize.width-r.size.width)/2.0f;
return r;
}
+
+# pragma mark animation stuff
+
+- (void)animationDidStart:(CAAnimation *)anim
+{
+
+ //NSLog(@"animationDidStart: %@", anim);
+}
+
+- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
+{
+ NSString *animationName = [anim valueForKey:@"Name"];
+ if ([animationName isEqualToString:@"removeFromParent"])
+ {
+
+ [super removeFromParent];
+ }
+ [self removeAnimationForKey:animationName];
+
+}
+
+
+- (void)setZoomInPosition
+{
+ CABasicAnimation *pos = [CABasicAnimation animationWithKeyPath:@"position"];
+ if (sender != nil)
+ {
+ pos.fromValue = [NSValue valueWithCGPoint:[sender position]];
+ } else {
+ pos.fromValue = [NSValue valueWithCGPoint:ZOOM_TO_POINT]; //
+ }
+
+ pos.toValue = [NSValue valueWithCGPoint:CGPointMake(640.0, 360.0)];
+ pos.fillMode = kCAFillModeForwards;
+ [[self layer] addAnimation:pos forKey:@"position"];
+}
+
+- (void)setZoomOutPosition
+{
+ CABasicAnimation *pos = [CABasicAnimation animationWithKeyPath:@"position"];
+ pos.fromValue = [NSValue valueWithCGPoint:CGPointMake(640.0, 360.0)];
+ if (sender != nil)
+ {
+ pos.toValue = [NSValue valueWithCGPoint:[sender position]];
+ } else {
+ pos.toValue = [NSValue valueWithCGPoint:ZOOM_TO_POINT];
+ }
+
+ pos.fillMode = kCAFillModeForwards;
+ [[self layer] addAnimation:pos forKey:@"position"];
+}
+
+/*
+
+if we are a BRMenuItem there are very minimal chances that you will get a usable position and bounds from it for zooming purposes
+here are all the functions where i handle what is mentioned at the top (the comments about sender)
+
+ */
+
+- (void)updateSender
+{
+ if ([sender isKindOfClass:[BRMenuItem class]]) //is or descends from BRMenuItem
+ {
+ id newSender = [self synthesizeMockItem]; //create our stub menu item that has 2 variables total.
+ if (newSender != nil)
+ {
+ // NSLog(@"setting new sender to: %@", newSender);
+
+ sender = newSender;
+ //NSLog(@"sender check: %@", sender);
+ }
+
+ }
+
+}
+
+ // find the list given the BRMenuItem (or said subclass of BRMenuItem)
+
+- (id)getListFromMenuItem:(id)menuItem
+{
+ id listControl = [[[menuItem parent] parent] parent]; //parent = BRGridControl, grand parent = BRScrollControl, great grand parent = BRListControl
+ NSString *class = NSStringFromClass([listControl class]);
+ if (![class isEqualToString:@"BRListControl"])
+ {
+ NSLog(@"cant find list control!!!, found %@ instead!", class); //bail!!!
+ return nil;
+ }
+ return listControl;
+}
+
+ //given the BRBlueGlowSelectionLozengeLayer control, spit out our stub class with the proper positioning.
+
+- (id)synthesizeMockItemFrom:(id)theSender withX:(float)xValue
+{
+
+ SMFMockMenuItem *menuItem = [[SMFMockMenuItem alloc] init];
+ CGPoint newPosition = [theSender position];
+ newPosition.x = xValue; //said attitude adjustment, without setting this x variable properly, all hell breaks loose.
+
+ [menuItem setBounds:[theSender bounds]];
+ [menuItem setPosition:newPosition];
+
+ return menuItem;
+
+}
+
+- (id)synthesizeMockItem
+{
+ id theList = [self getListFromMenuItem:sender];
+ if (theList == nil)
+ return nil;
+
+ CGPoint listPosition = [theList position];
+ float xValue = listPosition.x;
+ NSEnumerator *controlEnum = [[theList controls] objectEnumerator];
+ id current = nil;
+ while ((current = [controlEnum nextObject]))
+ {
+ NSString *currentClass = NSStringFromClass([current class]);
+ if ([currentClass isEqualToString:@"BRBlueGlowSelectionLozengeLayer"])
+ {
+
+ return [self synthesizeMockItemFrom:current withX:xValue];
+
+ }
+ }
+ return nil;
+}
+
+
-(void)dealloc
{
+ [sender release];
+ self.sender = nil;
self.cDelegate=nil;
self.cDatasource=nil;
self.list=nil;
View
4 SMFMenuItem.h
@@ -10,6 +10,8 @@
#import "Backrow/AppleTV.h"
@class BRMenuItem;
@interface SMFMenuItem : BRMenuItem {
+
+ BOOL centered;
}
/*
@@ -41,4 +43,6 @@
* shift the text and looks like apple's
*/
-(void)setSelectedImage:(BOOL)b;
+
+@property (assign) BOOL centered;
@end
View
15 SMFMenuItem.m
@@ -10,6 +10,9 @@
#import "Backrow/AppleTV.h"
@implementation SMFMenuItem
+
+@synthesize centered;
+
+(SMFMenuItem *)folderMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
@@ -66,7 +69,17 @@ +(SMFMenuItem *)computerMenuItem
}
-(void)setTitle:(NSString *)title
{
- [self setText:title withAttributes:[[BRThemeInfo sharedTheme]menuItemTextAttributes]];
+ if (centered == TRUE)
+ {
+ [self setText:title withAttributes:[self centeredTextAttributes]];
+
+
+ } else {
+
+ [self setText:title withAttributes:[[BRThemeInfo sharedTheme]menuItemTextAttributes]];
+ }
+
+
}
-(void)setRightText:(NSString *)txt
{
View
22 SMFMockMenuItem.h
@@ -0,0 +1,22 @@
+//
+// SMFMockMenuItem.h
+//
+//
+// Created by Kevin Bradley on 9/17/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface SMFMockMenuItem : NSObject {
+
+ CGPoint position;
+ CGRect bounds;
+
+}
+
+@property(assign) CGPoint position;
+@property(assign) CGRect bounds;
+
+@end
View
16 SMFMockMenuItem.m
@@ -0,0 +1,16 @@
+//
+// SMFMockMenuItem.m
+//
+//
+// Created by Kevin Bradley on 9/17/11.
+// Copyright 2011 nito, LLC. All rights reserved.
+//
+
+#import "SMFMockMenuItem.h"
+
+
+@implementation SMFMockMenuItem
+
+@synthesize bounds, position;
+
+@end
View
18 SMFMoviePreviewController.m
@@ -69,9 +69,9 @@ -(NSMutableDictionary *)getInformation
@"",kSMFMoviePreviewPosterPath,
@"pg",kSMFMoviePreviewRating,
nil];
- NSLog(@"get information %@",self.datasource);
+ //NSLog(@"get information %@",self.datasource);
if (self.datasource!=nil /*&& [self.datasource conformsToProtocol:@protocol(SMFMoviePreviewControllerDatasource)]*/) {
- NSLog(@"conforms to protocol");
+ //NSLog(@"conforms to protocol");
NSString *t = [self.datasource title];
if (t!=nil) {[d setObject:t forKey:kSMFMoviePreviewTitle];}
t = [self.datasource subtitle];
@@ -157,7 +157,7 @@ -(void)reload
/*
* The Title
*/
- NSLog(@"1");
+ // NSLog(@"1");
checkNil(_metadataTitleControl);
_metadataTitleControl=[[BRMetadataTitleControl alloc]init];
[_metadataTitleControl setTitle:[_info objectForKey:kSMFMoviePreviewTitle]];
@@ -224,7 +224,7 @@ -(void)reload
[_hideList addObject:div2];
[div2 release];
- NSLog(@"2");
+ //NSLog(@"2");
/*
* Headers for information
@@ -233,7 +233,7 @@ -(void)reload
float increment = (mtcf.size.width/masterFrame.size.width)/(float)[headers count];
//int counter=0;
float lastOriginY=0.0f;
- NSLog(@"obj: %@",headers);
+ //NSLog(@"obj: %@",headers);
for(int counter=0;counter<[headers count];counter++)
{
BRTextControl *head = [[BRTextControl alloc]init];
@@ -253,7 +253,7 @@ -(void)reload
/*
* Main Information
*/
- NSLog(@"3");
+ //NSLog(@"3");
NSArray *objects = [_info objectForKey:kSMFMoviePreviewColumns];
for (int counter=0; counter<[objects count]; counter++) {
NSArray *current = [objects objectAtIndex:counter];
@@ -373,7 +373,7 @@ -(void)reload
}
}
- NSLog(@"buttons");
+ //NSLog(@"buttons");
checkNil(_buttons);
_buttons=[[NSMutableArray alloc]init];
@@ -484,7 +484,7 @@ -(void)reload
}
}
}
- NSLog(@"end buttons");
+ //NSLog(@"end buttons");
BRTextControl *moviesControl =[[BRTextControl alloc] init];
NSString *title=@"";
@@ -549,7 +549,7 @@ -(void)reloadShelf
_provider=[[self getProviderForShelf] retain];
_adap = [[NSClassFromString(@"BRProviderDataSourceAdapter") alloc] init];
[_adap setProviders:[NSArray arrayWithObject:_provider]];
- NSLog(@"Provider: %@ %@",_provider,_provider.controlFactory);
+ //NSLog(@"Provider: %@ %@",_provider,_provider.controlFactory);
[_provider.controlFactory setDefaultImage:[[BRThemeInfo sharedTheme]appleTVIcon]];
[_adap setGridColumnCount:8];
if ([_shelfControl respondsToSelector:@selector(setColumnCount:)]) {
View
4 SMFPopup.mm
@@ -1,4 +1,4 @@
-#line 1 "/Users/tomcool/DVLP/ATV2/SMFramework/SMFPopup.xm"
+#line 1 "/Users/kevinbradley/DVLP/SMFramework/SMFPopup.xm"
@@ -19,7 +19,7 @@
#include <substrate.h>
@class SMFPopupInfo; @class BRTrackInfoControl;
static Class $SMFPopupInfo;
-#line 18 "/Users/tomcool/DVLP/ATV2/SMFramework/SMFPopup.xm"
+#line 18 "/Users/kevinbradley/DVLP/SMFramework/SMFPopup.xm"
static id (*__ungrouped$SMFPopupInfo$_fetchCoverArt)(SMFPopupInfo*, SEL);static id $_ungrouped$SMFPopupInfo$_fetchCoverArt(SMFPopupInfo* self, SEL _cmd) {
View
2  SMFScreenCapture.h
@@ -18,5 +18,5 @@
+(NSData *)pngScreenData;
+(NSData *)controlPlaneData;
-(NSArray *)reportIOSurfaces;
-
++ (BRImage *)imageScreenData;
@end
View
7 SMFScreenCapture.m
@@ -85,6 +85,13 @@ +(void)saveScreenToFile:(NSString *)path
CGColorSpaceRelease(rgb);
}
+
++ (BRImage *)imageScreenData
+{
+ NSData *png = [SMFScreenCapture pngScreenData];
+ return [BRImage imageWithData:png];
+}
+
+(NSData *)pngScreenData
{
View
4 SMFTextDropShadowControl.h
@@ -7,9 +7,9 @@
//
#import "Backrow/AppleTV.h"
+#import "SMFDropShadowControl.h"
-
-@interface SMFTextDropShadowControl : BRDropShadowControl {
+@interface SMFTextDropShadowControl : SMFDropShadowControl {
NSMutableString *_text;
NSMutableAttributedString *_att;
BRScrollingTextBoxControl *_scrolling;
View
16 SMFTextDropShadowControl.mm
@@ -39,14 +39,14 @@ -(id)init
[ic autorelease];
return self;
}
--(void)addToController:(BRController *)ctrl
-{
- CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
- [self setFrame:f];
- [ctrl addControl:self];
- [ctrl setFocusedControl:self];
- [ctrl _setFocus:self];
-}
+//-(void)addToController:(BRController *)ctrl
+//{
+// CGRect f = CGRectMake(256.0,72.0,768.0,576.0);//(s.width*0.2, s.height*0.1, s.width*0.6, s.height*0.8);
+// [self setFrame:f];
+// [ctrl addControl:self];
+// [ctrl setFocusedControl:self];
+// [ctrl _setFocus:self];
+//}
-(void)dealloc
{
self.text=nil;
View
24 SMFramework.xcodeproj/project.pbxproj
@@ -65,6 +65,12 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 3226AD541424897C0014943B /* SMFMockMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 3226AD521424897C0014943B /* SMFMockMenuItem.m */; };
+ 3226AD551424897C0014943B /* SMFMockMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3226AD531424897C0014943B /* SMFMockMenuItem.h */; };
+ 32CCA6AE1425D45D00037D7D /* SMFAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 32CCA6AC1425D45D00037D7D /* SMFAnimation.h */; };
+ 32CCA6AF1425D45D00037D7D /* SMFAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CCA6AD1425D45D00037D7D /* SMFAnimation.m */; };
+ 32D6E288142053AD00325EBE /* SMFDropShadowControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 32D6E286142053AD00325EBE /* SMFDropShadowControl.h */; };
+ 32D6E289142053AD00325EBE /* SMFDropShadowControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 32D6E287142053AD00325EBE /* SMFDropShadowControl.m */; };
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
DD002E5D1301DD52003EA17E /* SMFAssetPreviewController.h in Headers */ = {isa = PBXBuildFile; fileRef = DD002E5B1301DD52003EA17E /* SMFAssetPreviewController.h */; };
DD002E5E1301DD52003EA17E /* SMFAssetPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD002E5C1301DD52003EA17E /* SMFAssetPreviewController.m */; };
@@ -1211,6 +1217,12 @@
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 3226AD521424897C0014943B /* SMFMockMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMFMockMenuItem.m; sourceTree = "<group>"; };
+ 3226AD531424897C0014943B /* SMFMockMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMFMockMenuItem.h; sourceTree = "<group>"; };
+ 32CCA6AC1425D45D00037D7D /* SMFAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMFAnimation.h; sourceTree = "<group>"; };
+ 32CCA6AD1425D45D00037D7D /* SMFAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMFAnimation.m; sourceTree = "<group>"; };
+ 32D6E286142053AD00325EBE /* SMFDropShadowControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMFDropShadowControl.h; sourceTree = "<group>"; };
+ 32D6E287142053AD00325EBE /* SMFDropShadowControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMFDropShadowControl.m; sourceTree = "<group>"; };
32DBCF630370AF2F00C91783 /* atvTwo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atvTwo_Prefix.pch; sourceTree = "<group>"; };
875A8249126FFF1F00ECADC2 /* BackRowExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BackRowExtras.h; path = Classes/BackRowExtras.h; sourceTree = "<group>"; };
875A8425126FFF6500ECADC2 /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
@@ -2582,6 +2594,8 @@
DD145D9F12B4A5AB00FA8984 /* MenuItems */ = {
isa = PBXGroup;
children = (
+ 3226AD521424897C0014943B /* SMFMockMenuItem.m */,
+ 3226AD531424897C0014943B /* SMFMockMenuItem.h */,
DDA302A71274EFD000B0AE9C /* BRMenuItem_SMF.h */,
DDA302A81274EFD000B0AE9C /* BRMenuItem_SMF.m */,
DD3136CB1277CFFC00042510 /* SMFMenuItem.h */,
@@ -2615,6 +2629,10 @@
DD5FD68B131C8B9D004A6D5C /* ShadowPopups */ = {
isa = PBXGroup;
children = (
+ 32CCA6AC1425D45D00037D7D /* SMFAnimation.h */,
+ 32CCA6AD1425D45D00037D7D /* SMFAnimation.m */,
+ 32D6E286142053AD00325EBE /* SMFDropShadowControl.h */,
+ 32D6E287142053AD00325EBE /* SMFDropShadowControl.m */,
DD57778912EA39B300449D5F /* SMFListDropShadowControl.h */,
DD57778A12EA39B300449D5F /* SMFListDropShadowControl.m */,
DDACF745131B2E9400D10DB7 /* SMFTextDropShadowControl.h */,
@@ -4808,6 +4826,9 @@
DDCC4AC013CE3D300099DFED /* SMFExamples.h in Headers */,
DDCC4AC213CE3D300099DFED /* SMFMoviePreviewDelegateAndDatasourceExample.h in Headers */,
DDCC4AC613CE98AD0099DFED /* SMFCompatibility.h in Headers */,
+ 32D6E288142053AD00325EBE /* SMFDropShadowControl.h in Headers */,
+ 3226AD551424897C0014943B /* SMFMockMenuItem.h in Headers */,
+ 32CCA6AE1425D45D00037D7D /* SMFAnimation.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5026,6 +5047,9 @@
DDCC4AC113CE3D300099DFED /* SMFExamples.m in Sources */,
DDCC4AC313CE3D300099DFED /* SMFMoviePreviewDelegateAndDatasourceExample.m in Sources */,
DDCC4AC713CE98AD0099DFED /* SMFCompatibility.m in Sources */,
+ 32D6E289142053AD00325EBE /* SMFDropShadowControl.m in Sources */,
+ 3226AD541424897C0014943B /* SMFMockMenuItem.m in Sources */,
+ 32CCA6AF1425D45D00037D7D /* SMFAnimation.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 _/DEBIAN/control
@@ -1,9 +1,9 @@
Package: org.tomcool.smframework
Name: SMFramework
-Version: 0.7.0-14
+Version: 0.7.8-1
Architecture: iphoneos-arm
Description: Framework for most packages written by me
Maintainer: Thomas Cool <thomas.cool@me.com>
Author: Thomas Cool <thomas.cool@me.com>
Section: Development
-Installed-Size: 572
+Installed-Size: 740
View
2  _/Library/Frameworks/SMFramework.framework/Headers/BRMenuItem_SMF.h
@@ -7,7 +7,7 @@
//
//NOTE: should note be used ... use SMFMenuItem instead
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface BRMenuItem (SMFExtensions)
+(BRMenuItem *)smfFolderMenuItem;
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFBaseAsset.h
@@ -6,7 +6,7 @@
// Copyright 2010 Thomas Cool. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface SMFBaseAsset : BRXMLMediaAsset {
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFCenteredMenuController.h
@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SMFMediaMenuController.h"
#import "SMFMenuController.h"
#import "SMFDefines.h"
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFClockController.h
@@ -6,7 +6,7 @@
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import <UIKit/UIColor.h>
@interface SMFClockController : BRTextControl {
View
81 _/Library/Frameworks/SMFramework.framework/Headers/SMFCommonTools.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 11/4/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
typedef enum _popupPosition{
kSMFPopupCenterLeft =0,
@@ -15,48 +15,79 @@ typedef enum _popupPosition{
kSMFPopupTopFarLeft =5,
kSMFPopupBottomFarLeft =6
} PopupPosition;
+/**
+ *A Compilation of methods to use for popups and other stuff
+ */
@interface SMFCommonTools : NSObject {
}
+///---
+///@name getting the shared object
+///---
+/**
+ *@return the shared objectec
+ */
+(SMFCommonTools *)sharedInstance;
-
-/*
- * Returns a SMFPopupInfo to show using showPopup
- * @arg1: an NSArray with 1-3 NSStrings inside (can be nil)
- * @arg2: a BRImage (cannot be nil)
+///---
+///@name Popups
+///---
+/**
+ *@return an SMFPopupInfo object to show using showPopup
+ *@param array an NSArray with 1-3 NSStrings inside (can be nil)
+ *@param image a BRImage (cannot be nil)
+ *@note Important: image must not be nil
+ *@see showPopup:
*/
+(id)popupControlWithLines:(NSArray *)array andImage:(BRImage *)image;
-/*
- * Displays a popup using the BRPopupManager
- * @arg1: a popup created using popupControlwithLines:andImage:
+/**
+ *@returns a SMFPopupInfo to show using showPopup
+ *@param dict a NSDictionary with keys `@"Image"` (BRImage) and `@"Lines"` (NSArray of NSStrings)
+ *@see showPopup:
+ */
++(id)popupControlWithDictionary:(NSDictionary *)dict;
+
+
+/**
+ *Displays a popup using the BRPopupManager
+ *@param popup a popup created using popupControlwithLines:andImage: or popupControlWithDictionary:
+ *Calls `[SMFCommonTools showPopup:popup withTimeout:8 withPosition:6 withSize:CGSizeMake(0.9,0.15)];`
+ *@see showPopup:withTimeout:withPosition:withSize:
+ *
*/
+(void)showPopup:(id)popup;
-/*
- * Displays a popup using the BRPopupManager
- * adds more customizability to the +(void)showPopup: method
- * @arg1: a popup created using popupControlwithLines:andImage:
- * @arg2: timeout in seconds
- * @arg3: a position integer (needs more detail)
- * @arg4: CGSize (relative size)
+/**
+ *Displays a popup using the BRPopupManager
+ *adds more customizability to the +(void)showPopup: method
+ *
+ *@param popup a popup created using popupControlwithLines:andImage:
+ *@param timeout display duration in seconds (integer)
+ *@param position a position integer
+ *@param size CGSize confusing
+ *
*/
+(void)showPopup:(id)popup withTimeout:(int)timeout withPosition:(PopupPosition)position withSize:(CGSize)size;
-/*
+/**
* Displays a popup using the BRPopupManager
* adds more customizability to the +(void)showPopup: method
- * @arg1: a popup created using popupControlwithLines:andImage:
- * @arg2: timeout in seconds
- * @arg3: a position integer (needs more detail)
- * @arg4: width
- * @arg5: height
+ *@param popup a popup created using popupControlwithLines:andImage:
+ *@param timeout display duration in seconds
+ *@param position a position integer (see showPopup:withTimeout:withPosition:withSize:)
+ *@param width a relative width
+ *@param height a relative height
+ *@see showPopup:withTimeout:withPosition:withSize:
*/
+(void)showPopup:(id)popup withTimeout:(int)timeout withPosition:(PopupPosition)position withWidth:(float)width withHeight:(float)height;
-/*
+
+///---
+///@name Processes
+///---
+/**
* Runs a task with popen parsing the output
- * @arg1: the call to be passed. eg: @"/usr/bin/screencapture -s 10"
- * @return: returns the output text from the call seperated into lines into an array
+ *@param call the call to be passed. eg: @"/usr/bin/screencapture -s 10"
+ * @return the output text from the call seperated into lines into an array
*/
-(NSArray *)returnForProcess:(NSString *)call;
View
12 _/Library/Frameworks/SMFramework.framework/Headers/SMFController.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 11/30/09.
// Copyright 2009 Thomas Cool. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface BRController (Compat)
-(CGRect)frame;
@@ -23,11 +23,11 @@
BRImage * _image;
BRImageControl * _imageControl;
}
-/*
- * Used to disable the screen
- */
-- (void) disableScreenSaver;
-- (void) enableScreenSaver;
+///*
+// * Used to disable the screen
+// */
+//- (void) disableScreenSaver;
+//- (void) enableScreenSaver;
/*
* getMasterFrame returns the Controller frame actually used to add the controls to.
*/
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFDefines.h
@@ -32,3 +32,5 @@ typedef enum {
kBREventRemoteActionHoldUp,
kBREventRemoteActionHoldDown,
} BREventRemoteAction;
+
+#define LOG_SELF NSLog(@"%@ %s", self, _cmd)
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFEvent.h
@@ -6,7 +6,7 @@
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface SMFEvent : NSObject {
NSString *key;
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFEventConfiguration.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 11/4/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SMFMediaMenuController.h"
#import "SMFEventManager.h"
@interface SMFEventConfiguration : SMFMediaMenuController {
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFEventManager.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 10/31/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SynthesizeSingleton.h"
#import "SMFEvent.h"
@protocol SMFEventDelegate
View
84 _/Library/Frameworks/SMFramework.framework/Headers/SMFFolderBrowser.h
@@ -5,51 +5,19 @@
// Created by Thomas on 4/19/09.
// Copyright 2009 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SMFMediaMenuController.h"
#import "SMFPreferences.h"
#import "SMFPhotoMethods.h"
-@class SMFFolderBrowser;
-@protocol SMFFolderBrowserDelegate
-/*
- * Checks to see if the delegate can handle this file
- */
--(BOOL)hasActionForFile:(NSString *)path;
+#import "SMFFolderBrowserDelegate.h"
-@optional
-/*
- * Standard default action execution
- */
--(void)browser:(SMFFolderBrowser *)b executeActionForFile:(NSString *)path;
-/*
- * Pressing the right arrow
- */
--(void)browser:(SMFFolderBrowser *)b executeRightActionForFile:(NSString *)path;
-/*
- * Pressing the left arrow
- */
--(void)browser:(SMFFolderBrowser *)b executeLeftActionForFile:(NSString *)path;
-/*
- * Pressing the select button ... disabled for now
- */
--(void)browser:(SMFFolderBrowser *)b executeSelectActionForFile:(NSString *)path;
-/*
- * Pressing the play pause button on the new remote
- */
--(void)browser:(SMFFolderBrowser *)b executePlayPauseActionForFile:(NSString *)path;
-/*
- * Deprecated Methods
+/**
+ * SMFFolderBrowser is a subclass of SMFMediaMenuController that enables easily browsing through the file system
+ *
+ * It uses a delegate to make it easily extensible. This Delegate needs to conform to SMFFolderBrowserDelegate protocol
+ *
*/
--(void)executeActionForFile:(NSString *)path;
--(void)executeRightActionForFile:(NSString *)path;
--(void)executeLeftActionForFile:(NSString *)path;
--(void)executeSelectActionForFile:(NSString *)path;
--(void)executePlayPauseActionForFile:(NSString *)path;
-
-
-@end
-
@interface SMFFolderBrowser : SMFMediaMenuController
{
@@ -70,15 +38,51 @@
+ (void)setString:(NSString *)inputString forKey:(NSString *)theKey inDomain:(NSString *)theDomain;
+ (NSString *)stringForKey:(NSString *)theKey inDomain:(NSString *)theDomain;
+
+/**
+ *set the path of a folder to browse
+ *If the path is `nil`, does not exist or is not a folder, the browser wil be empty but it will not crash
+ *@param thePath Path to browse. (example: `@"/private/var/mobile"`)
+ *
+ */
-(void)setPath:(NSString *)thePath;
+/**
+ *Reloads the folder in case the files have changed
+ */
+
-(void)reloadFiles;
+
+/**
+ *Create a new instance with a defined path
+ *
+ *use this method instead of simply init
+ *
+ *@param thePath Path to browse.
+ * @see setPath:
+ */
+
-(id)initWithPath:(NSString *)thePath;
+/**
+ *Defines if the folders are seperated from the files
+ */
+
@property (assign) BOOL separate;
+/**
+ *Show hidden files (starting with .)
+ */
@property (assign) BOOL showHidden;
+/**
+ *Ignore files and only show folders
+ */
@property (assign) BOOL showOnlyFolders;
-
+/**
+ *The delegate handling all the commands
+ */
@property (retain) NSObject<SMFFolderBrowserDelegate>* delegate;
+/**
+ *The path that is currently browsed
+ */
@property (retain) NSString *fpath;
@end
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFFolderDelegate.h
@@ -6,7 +6,7 @@
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface SMFFolderDelegate : NSObject {
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFInvocationCenteredMenuController.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 2/27/10.
// Copyright 2010 Thomas Cool. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SMFCenteredMenuController.h"
@class SMFCenteredMenuController;
View
50 _/Library/Frameworks/SMFramework.framework/Headers/SMFMediaMenuController.h
@@ -5,24 +5,31 @@
// Created by Thomas Cool on 10/22/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import <Foundation/Foundation.h>
#import "SMFDefines.h"
+/**
+ *Default Menu Controller. what should be subclassed to create simple menu. Examples are provided in the .m file
+ *
+ *
+ */
@interface SMFMediaMenuController : BRMediaMenuController <BRMenuListItemProvider> {
NSMutableArray *_items;
NSMutableArray *_options;
BRDropShadowControl * popupControl;
}
-/*
- * A PopupControl
+/**
+ * a instance of BRDropShadowControl
*/
@property (retain) BRDropShadowControl * popupControl;
-/*
- * If using an SMFMediaMenuController, popups can easily be hidden or shown using
- * the following two methods
+/**
+ *Method used to show the popupControl
*/
-(void)showPopup;
+/**
+ *Method used to hide the popupControl
+ */
-(void)hidePopup;
@@ -40,33 +47,44 @@
*/
-(long)rowForTitle:(id)title;
-/*
- * Something that is called everytime wasExhumed, [list reload], activated is called
+/**
+ * Something that is called everytime wasExhumed, reload or controlWasActivated is.
*/
--(id)everyLoad;
+-(void)everyLoad;
-/*
- * A method used to check which row the list is on
+/**
+ *A method used to check which row the list is on
+ *@return index of item selected
*/
-(int)getSelection;
-/*
+/**
* A method used to change the list selection
+ *@param sel index of item to select
*/
- (void)setSelection:(int)sel;
-/*
+/**
* Action Called Every Time someone Presses on Left Arrow
+ *@param row index of the row selected when the left arrow was pressed
+ *@note this method should never be called manually. instead it should be overwritten in
+ * subclasses
*/
-(void)leftActionForRow:(long)row;
-/*
+/**
* Action Called Every Time someone Presses on Right Arrow
+ *@param row index of the row selected when the right arrow was pressed
+ *@note this method should never be called manually. instead it should be overwritten in
+ * subclasses
*/
-(void)rightActionForRow:(long)row;
-/*
- * Action Called Every Time someone Presses on play pause button on new remote
+/**
+ * Action Called Every Time someone Presses on Play Pause (silver remote)
+ *@param row index of the row selected when the play-pause buttom was pressed
+ *@note this method should never be called manually. instead it should be overwritten in
+ * subclasses
*/
-(void)playPauseActionForRow:(long)row;
View
72 _/Library/Frameworks/SMFramework.framework/Headers/SMFMediaPreview.h
@@ -5,26 +5,90 @@
// Created by Thomas Cool on 11/9/09.
// Copyright 2009 Thomas Cool. All rights reserved.
//
-#import <Backrow/Backrow.h>
+/**
+ * SMFMediaPreview is a high level class to be used in conjunction with SMFBaseAsset and it subclasses
+ * It is used to display metadata in media menus (Subclasses of BRmediaMenuController and SMFMediaMenuController)
+ *
+ *
+ *
+ */
+#import "Backrow/AppleTV.h"
+#import <Foundation/Foundation.h>
#define METADATA_IMAGE_URL @"ImageURL"
#define METADATA_TITLE @"Name"
#define METADATA_SUMMARY @"Summary"
#define METADATA_CUSTOM_KEYS @"KeysArray"
#define METADATA_CUSTOM_OBJECTS @"ObjectsArray"
-@class SMFBaseAsset;
+@class SMFBaseAsset, BRMetadataPreviewControl;
@interface SMFMediaPreview : BRMetadataPreviewControl{
BRImage *image;
}
-/*
- * A nice and simple autoreleased media preview already populated with an asset
+
+/**
+ *Creating a quick media preview that does not require the creation of an SMFBaseAsset.
+ *
+ *A BRBase Asset is created internaly. it is equivalent to creating this Asset, and adding
+ *using mediaPreviewWithAsset:
+ *
+ *Adding an asset will overwrite the information generated using this method
+ *@param title title for the preview
+ * An NSString representing the title.
+ * It will be put in bold over the top line of the preview
+ *@param summary text summary (longish text)
+ * General summary, description, or other informative text, newlines are ignored.
+ *@param img a BRImage representing the poster
+ *@see mediaPreviewWithAsset:
*/
+(SMFMediaPreview *)simplePreviewWithTitle:(NSString *)title withSummary:(NSString *)summary withImage:(BRImage *)img;
+/**
+ *Creates an autoreleased SMFMediaPreview with an asset.
+ *
+ *Cannot use a BRBaseAsset subclass. It has to be a SMFBaseAsset
+ *@param a the asset to be used;
+ *@return autoreleased instance of SMFMediaPreview with the Asset set
+ *@see mediaPreview
+ *@see setAsset:
+ */
+(SMFMediaPreview *)mediaPreviewWithAsset:(SMFBaseAsset *)a;
+
+/**
+ *Creates an autoreleased SMFMediaPreview.
+ *
+ *Cannot use a BRBaseAsset subclass. It has to be a SMFBaseAsset
+ *@return autoreleased instance of SMFMediaPreview with no Asset
+ *@see mediaPreviewWithAsset:
+ *@see simplePreviewWithTitle:withSummary:withImage:
+ */
+(SMFMediaPreview *)mediaPreview;
- (id)coverArtForPath;
- (void)setImage:(BRImage *)currentImage;
- (void)setImagePath:(NSString *)path;
+///**
+// *Add an Asset (SMFBaseAsset) to the preview.
+// *
+// *@param a the instance of SMFBaseAsset to add to the preview
+// *@see asset
+// */
+//-(void)setAsset:(SMFBaseAsset *)a;
+///**
+// *The Asset containing all the information used to draw the preview
+// *
+// *@return the saved Asset
+// *@see setAsset:
+// */
+//-(SMFBaseAsset *)asset;
+
+
+-(void)setTopRightImage:(BRImage *)i;
+
+-(void)setCopyright:(id)i;
+
+-(void)setRating:(NSString *)i;
+
+-(void)setStarRating:(id)i;
+
+-(void)setUserRating:(id)i;
@end
View
2  _/Library/Frameworks/SMFramework.framework/Headers/SMFMenuController.h
@@ -5,7 +5,7 @@
// Created by Thomas Cool on 10/22/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import <Foundation/Foundation.h>
#import "SMFDefines.h"
@interface SMFMenuController : BRMenuController <BRMenuListItemProvider> {
View
6 _/Library/Frameworks/SMFramework.framework/Headers/SMFMenuItem.h
@@ -6,9 +6,11 @@
// Copyright 2010 tomcool.org. All rights reserved.
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@interface SMFMenuItem : BRMenuItem {
+
+ BOOL centered;
}
/*
@@ -40,4 +42,6 @@
* shift the text and looks like apple's
*/
-(void)setSelectedImage:(BOOL)b;
+
+@property (assign) BOOL centered;
@end
View
66 _/Library/Frameworks/SMFramework.framework/Headers/SMFPasscodeController.h
@@ -6,15 +6,35 @@
// Copyright 2009,2010 Thomas Cool. All rights reserved.
//
#import <Foundation/Foundation.h>
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
@class BRHeaderControl, BRTextControl,BRScrollingTextControl, BRImageControl, BRPasscodeEntryControl, BRDisplayManager;
+/**
+ *Delegate protocol for SMFPasscodeController
+ */
@protocol SMFPasscodeControllerDelegate
-- (void) textDidEndEditing: (id) sender;
+/**
+ *Message sent when the user selects "enter" on the passcode
+ *@param sender an object to with -(NSString *)stringValue can be called on
+ *@see passcodeTextDidChange:
+ */
+- (void) passcodeTextDidEndEditing:(id)sender;
+
@optional
-- (void) textDidChange: (id) sender;
-@end
+/**
+ *Message sent anytime something changes
+ *@param sender an object to with -(NSString *)stringValue can be called on
+ *@see passcodeTextDidEndEditing:
+ */
+- (void) passcodeTextDidChange: (id) sender;
+- (void) textDidChange: (id) sender DEPRECATED_ATTRIBUTE;
+- (void) textDidEndEditing: (id) sender DEPRECATED_ATTRIBUTE;
+@end
+
+/**
+ *A simple way to have passcode boxes shown on screen. It comes with multiple ways to save/ check the data but setting a delegate is the recommened way
+ */
@interface SMFPasscodeController : BRController
{
int padding[16];
@@ -28,6 +48,15 @@
int initialValue;
}
- (id)initWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withKey:(NSString *)k withDomain:(NSString *)dom;
+/**
+ *Recommended way to create a SMFPasscodeController
+ *@param t the title shown at the top of the screen
+ *@param desc short description explaining why this is passcode is required (may be nil)
+ *@param b the number of boxes to show (typically 4-6)
+ *@param del the delegate to which the selected passcode will be returned
+ *@return autoreleased instance of SMFPasscodeController with set parameters
+ *
+ */
+ (SMFPasscodeController *)passcodeWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withDelegate:(id)del;
+ (SMFPasscodeController *)passcodeWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withKey:(NSString *)k withDomain:(NSString *)dom;
@@ -35,14 +64,41 @@
-
+/**
+ * Delegate conforming to protocol: SMFPasscodeControllerDelegate
+ */
@property (assign) id delegate;
+/**
+ * The key to which you see the passcode in the Domain selected in domain
+ *@note requires both domain and key to be set and delegate to be nil
+ *@see domain
+ */
@property (retain) NSString * key;
+/**
+ *The domain in which you set the passcode
+ *@note requires both domain and key
+ *@see key
+ */
@property (retain) NSString * domain;
+/**
+ *The initial value selected
+ */
@property (assign) int initialValue;
+/**
+ * short description explaining why this is passcode is required (may be nil)
+ */
@property (retain) NSString *description;
+/**
+ * the number of boxes to show (typically 4-6)
+ */
@property (assign) int boxes;
+/**
+ * Icon to show next to the title
+ */
@property (retain) BRImage * icon;
+/**
+ * Title of the controller
+ */
@property (retain) NSString *title;
@end
View
123 _/Library/Frameworks/SMFramework.framework/Headers/SMFPhotoMethods.h
@@ -7,33 +7,130 @@
//
-#import <Backrow/Backrow.h>
+#import "Backrow/AppleTV.h"
#import "SMFControlFactory.h"
+/**
+ *Convenience methods to work with pictures on ATV 2
+ */
@interface SMFPhotoMethods : NSObject {
}
+///-----------------------------------
+/// @name Checks
+///-----------------------------------
+/**
+ *Checks if the file extention is that of a readable image (png,jpeg,tiff,bmp,gif,jpg)
+ *@return `YES` if it is. `NO` otherwise
+ *@todo check if it exists
+ *@param path of file to check
+ */
+(BOOL)isImageAtPath:(NSString *)path;
-/*
- * returns an NSArray filled with BRPhotoMediaAssets corresponding
- * to the different images in folder
+
+/**
+ *@param path the path to a FOLDER
+ *@return the number of image in the folder given by path
*/
-+(NSArray *)mediaAssetsForPath:(id)path;
++(int)imagesCountForPath:(NSString *)path;
+///------------------------------------
+/// @name Getting Image Paths
+///------------------------------------
-+(NSArray *)photoPathsForPath:(id)path showHidden:(BOOL)hidden;
-/*
- * returns an NSArray with all the photos in the path
+/**
+ *@param path the path to a FOLDER
+ *@param hidden include hidden images?
+ *@return an NSArray filled with NSStrings corresponding
+ * to the different images in folder
+ *@see mediaAssetsForPath:
+ */
++(NSArray *)photoPathsForPath:(NSString *)path showHidden:(BOOL)hidden;
+/**
+ *@param path the path to a FOLDER
+ *@return an NSArray filled with NSStrings corresponding
+ * to the different images in folder
+ *@see photoPathsForPath:showHidden:
+ *@note calls photoPathsForPath:showHidden with `hidden=YES`
*/
-+(NSArray *)photoPathsForPath:(id)path;
++(NSArray *)photoPathsForPath:(NSString *)path;
+
+///-----------------------------------
+/// @name Loading Images
+///-----------------------------------
+/**
+ *@param path path to a FOLDER
+ *@return an NSArray filled with BRXMLImageProxy instances
+ * corresponding to the images in the folder
+ *@see imageProxiesForPath:nbImages:
+ *@note calls imagesProxiesForPath:nbImages: with nb=-1
+ */
+(NSArray *)imageProxiesForPath:(NSString *)path;
-+(NSMutableArray *)loadImagePathsForPath:(NSString *)path;
+/**
+ *@param path path to a FOLDER
+ *@param nb number of images to load
+ * - if -1, load all images
+ * - if greater than number of images, load maximum available
+ *@return an NSArray filled with BRXMLImageProxy instances
+ * corresponding to the images in the folder
+ *@see imageProxiesForPath:
+ */
++(NSArray *)imageProxiesForPath:(NSString *)path nbImages:(NSInteger)nb;
+
+
+/**
+ *@param path the path to a FOLDER
+ *@return an NSArray filled with BRPhotoMediaAssets corresponding
+ * to the different images in folder excluding hidden pictures
+ *@see assetForPhotoFile:
+ */
++(NSArray *)mediaAssetsForPath:(id)path;
+
+/**
+ *@param path the path to a FOLDER
+ *@returns a BRImage with the first image (alphabetical) in the folder
+ */
+(BRImage *)firstPhotoForPath:(NSString *)path;
-+(id)photoCollectionForPath:(NSString *)path;
+/**
+ *Creates a SMFPhotoMediaCollection (BRPhotoMediaCollection subclass) populated with the images
+ * from path and returns it
+ *@param path The path to a FOLDER
+ *@return the Collection
+ */
++(BRPhotoMediaCollection *)photoCollectionForPath:(NSString *)path;
+/**
+ *Create a BRDataStore for Assets (BRBaseAsset subclasses)
+ *@param assets NSArray containing BRBaseAsset objects
+ *@return a BRDataStore object
+ */
+(BRDataStore *)dataStoreForAssets:(NSArray *)assets;
+/**
+ *Create a BRDataStore for a Path
+ *@param path to a FOLDER containing images
+ *@return a BRDataStore object
+ *@note calls mediaAssetsForPath: and dataStoreForAssets:
+ *@see mediaAssetsForPath:
+ *@see dataStoreForAssets:
+ */
+(BRDataStore *)dataStoreForPath:(NSString *)path;
+/**
+ *creates a BRPhotoMediaAsset with a picture file
+ *@param pathToPhoto path to a picture
+ *@return a BRPhotoMediaAsset with picture data in it
+ *@see assetForPhotoFile:
+ *
+ */
+(BRPhotoMediaAsset *)assetForPhotoFile:(NSString *)pathToPhoto;
-+(NSArray *)imageProxiesForPath:(NSString *)path nbImages:(NSInteger)nb;
-+(int)imagesCountForPath:(NSString *)path;
+
+
+
+
+///-----------------------
+/// @name deprecated
+///-----------------------
+/**
+ *Same as photoPathsForPath:
+ *@bug Warning: deprecated
+ */
++(NSMutableArray *)loadImagePathsForPath:(NSString *)path;