@@ -56,12 +56,12 @@ -(NSString*)moduleId
56
56
- (void )styleSheetFromFilePathWithOrigin : (id )args
57
57
{
58
58
ENSURE_SINGLE_ARG (args, NSDictionary );
59
-
59
+
60
60
NSString *aFilePath = [TiUtils stringValue: [args valueForKey: @" filename" ]];
61
61
int origin = [TiUtils intValue: [args valueForKey: @" origin" ]];
62
-
62
+
63
63
PXStylesheet *pxs = [Pixate styleSheetFromFilePath: aFilePath withOrigin: origin];
64
-
64
+
65
65
if ([args valueForKey: @" monitor" ] != nil )
66
66
{
67
67
[pxs setMonitorChanges: [TiUtils boolValue: [args valueForKey: @" monitor" ]]];
@@ -71,10 +71,10 @@ - (void)styleSheetFromFilePathWithOrigin:(id)args
71
71
- (void )styleSheetFromSourceWithOrigin : (id )args
72
72
{
73
73
ENSURE_SINGLE_ARG (args, NSDictionary );
74
-
74
+
75
75
NSString *source = [TiUtils stringValue: [args valueForKey: @" source" ]];
76
76
int origin = [TiUtils intValue: [args valueForKey: @" origin" ]];
77
-
77
+
78
78
[Pixate styleSheetFromSource: source withOrigin: origin];
79
79
}
80
80
@@ -162,7 +162,7 @@ + (void)swizzleMethod:(SEL)orig_sel withMethod:(SEL)alt_sel
162
162
Class c = self;
163
163
Method origMethod = class_getInstanceMethod (c, orig_sel);
164
164
Method altMethod = class_getInstanceMethod (c, alt_sel);
165
-
165
+
166
166
if (class_addMethod (c, orig_sel, method_getImplementation (altMethod), method_getTypeEncoding (altMethod)))
167
167
{
168
168
class_replaceMethod (c, alt_sel, method_getImplementation (origMethod), method_getTypeEncoding (origMethod));
@@ -209,21 +209,21 @@ - (void)px_setLayoutInfo:(NSValue *)frame transform:(NSValue *)transform
209
209
CGPoint origin_ = frame_.origin ;
210
210
CGSize size_ = frame_.size ;
211
211
CGAffineTransform transform_ = CGAffineTransformIdentity;
212
-
212
+
213
213
[transform getValue: &transform_];
214
-
214
+
215
215
if (CGAffineTransformIsIdentity (transform_) == NO ) // && [self isKindOfClass:[UIView class]])
216
216
{
217
217
[self setTransform_: [[Ti2DMatrix alloc ] initWithMatrix: CGAffineTransformIdentity]];
218
218
}
219
-
219
+
220
220
// use Ti API to get to proxy
221
221
TiProxy *tiProxy = self.proxy ;
222
-
222
+
223
223
if ([tiProxy isKindOfClass: [TiViewProxy class ]])
224
224
{
225
225
TiViewProxy *viewProxy = (TiViewProxy *)tiProxy;
226
-
226
+
227
227
// Use Ti API to set the 4 settings
228
228
if (origin_.x != MAXFLOAT)
229
229
{
@@ -246,7 +246,7 @@ - (void)px_setLayoutInfo:(NSValue *)frame transform:(NSValue *)transform
246
246
// [proxy performSelector:@selector(setHeight:) withObject:[NSNumber numberWithFloat:context.height]];
247
247
}
248
248
}
249
-
249
+
250
250
if (CGAffineTransformIsIdentity (transform_) == NO ) // && [self isKindOfClass:[UIView class]])
251
251
{
252
252
[self setTransform_: [[Ti2DMatrix alloc ] initWithMatrix: transform_]];
@@ -260,7 +260,7 @@ -(void)startup
260
260
// this method is called when the module is first loaded
261
261
// you *must* call the superclass
262
262
[super startup ];
263
-
263
+
264
264
NSLog (@" [INFO] %@ loaded" ,self);
265
265
}
266
266
@@ -269,12 +269,12 @@ -(void)shutdown:(id)sender
269
269
// this method is called when the module is being unloaded
270
270
// typically this is during shutdown. make sure you don't do too
271
271
// much processing here or the app will be quit forceably
272
-
272
+
273
273
// you *must* call the superclass
274
274
[super shutdown: sender];
275
275
}
276
276
277
- #pragma mark Cleanup
277
+ #pragma mark Cleanup
278
278
279
279
-(void )dealloc
280
280
{
@@ -291,44 +291,4 @@ -(void)didReceiveMemoryWarning:(NSNotification*)notification
291
291
[super didReceiveMemoryWarning: notification];
292
292
}
293
293
294
- #pragma mark Listener Notifications
295
-
296
- -(void )_listenerAdded : (NSString *)type count : (int )count
297
- {
298
- if (count == 1 && [type isEqualToString: @" my_event" ])
299
- {
300
- // the first (of potentially many) listener is being added
301
- // for event named 'my_event'
302
- }
303
- }
304
-
305
- -(void )_listenerRemoved : (NSString *)type count : (int )count
306
- {
307
- if (count == 0 && [type isEqualToString: @" my_event" ])
308
- {
309
- // the last listener called for event named 'my_event' has
310
- // been removed, we can optionally clean up any resources
311
- // since no body is listening at this point for that event
312
- }
313
- }
314
-
315
- #pragma Public APIs
316
-
317
- -(id )example : (id )args
318
- {
319
- // example method
320
- return @" hello world" ;
321
- }
322
-
323
- -(id )exampleProp
324
- {
325
- // example property getter
326
- return @" hello world" ;
327
- }
328
-
329
- -(void )setExampleProp : (id )value
330
- {
331
- // example property setter
332
- }
333
-
334
294
@end
0 commit comments