FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
BlockBackground Class Reference
Inheritance diagram for BlockBackground:
Collaboration diagram for BlockBackground:

Instance Methods

(void) - addToMainWindow:
 
(void) - reduceAlphaIfEmpty
 
(void) - removeView:
 

Class Methods

(BlockBackground *) + sharedInstance
 

Properties

UIImage * backgroundImage
 
BOOL vignetteBackground
 

Detailed Description

Definition at line 11 of file BlockBackground.h.

Method Documentation

◆ addToMainWindow:

- (void) addToMainWindow: (UIView *)  view

Definition at line 16 of file BlockBackground.m.

147 :(UIView *)view
148{
149 [self setRotation:nil];
150
151 if ([self.subviews containsObject:view])
152 return;
153
154 if (self.hidden)
155 {
156 _previousKeyWindow = [[[UIApplication sharedApplication] keyWindow] retain];
157 self.alpha = 0.0f;
158 self.hidden = NO;
159 self.userInteractionEnabled = YES;
160 [self makeKeyWindow];
161 }
162
163 if (self.subviews.count > 0)
164 {
165 ((UIView *)[self.subviews lastObject]).userInteractionEnabled = NO;
166 }
167
168 if (_backgroundImage)
169 {
170 UIImageView *backgroundView = [[UIImageView alloc] initWithImage:_backgroundImage];
171 backgroundView.frame = self.bounds;
172 backgroundView.contentMode = UIViewContentModeScaleToFill;
173 [self addSubview:backgroundView];
174 [backgroundView release];
175 [_backgroundImage release];
176 _backgroundImage = nil;
177 }
178
179 [self addSubview:view];
180}

◆ reduceAlphaIfEmpty

- (void) reduceAlphaIfEmpty

Definition at line 16 of file BlockBackground.m.

183{
184 if (self.subviews.count == 1 ||
185 (self.subviews.count == 2 &&
186 [[self.subviews objectAtIndex:0] isKindOfClass:[UIImageView class]]))
187 {
188 self.alpha = 0.0f;
189 self.userInteractionEnabled = NO;
190 }
191}

◆ removeView:

- (void) removeView: (UIView *)  view

Definition at line 16 of file BlockBackground.m.

193 :(UIView *)view
194{
195 [view removeFromSuperview];
196
197 UIView *topView = [self.subviews lastObject];
198 if ([topView isKindOfClass:[UIImageView class]])
199 {
200 // It's a background. Remove it too
201 [topView removeFromSuperview];
202 }
203
204 if (self.subviews.count == 0)
205 {
206 self.hidden = YES;
207 [_previousKeyWindow makeKeyWindow];
208 [_previousKeyWindow release];
209 _previousKeyWindow = nil;
210 }
211 else
212 {
213 ((UIView *)[self.subviews lastObject]).userInteractionEnabled = YES;
214 }
215}

◆ sharedInstance

+ (BlockBackground *) sharedInstance

Definition at line 16 of file BlockBackground.m.

19{
20 if (_sharedInstance != nil)
21 {
22 return _sharedInstance;
23 }
24
25 @synchronized(self)
26 {
27 if (_sharedInstance == nil)
28 {
29 [[[self alloc] init] autorelease];
30 }
31 }
32
33 return _sharedInstance;
34}

Property Documentation

◆ backgroundImage

- (UIImage*) backgroundImage
readwritenonatomicretain

Definition at line 23 of file BlockBackground.h.

◆ vignetteBackground

- (BOOL) vignetteBackground
readwritenonatomicassign

Definition at line 24 of file BlockBackground.h.


The documentation for this class was generated from the following files: