mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
adding input
git-svn-id: http://xni.googlecode.com/svn/XNI@32 ac433895-eea3-a490-d80a-17149a75e588
This commit is contained in:
parent
54923fd932
commit
cb41b574bf
20
Classes/Retronator/Xni/Framework/Input/Touch/Enums.h
Normal file
20
Classes/Retronator/Xni/Framework/Input/Touch/Enums.h
Normal file
@ -0,0 +1,20 @@
|
||||
typedef enum {
|
||||
TouchLocationStateInvalid,
|
||||
TouchLocationStateMoved,
|
||||
TouchLocationStatePressed,
|
||||
TouchLocationStateReleased
|
||||
} TouchLocationState;
|
||||
|
||||
typedef enum {
|
||||
GestureTypeNone = 0,
|
||||
GestureTypeTap = 1,
|
||||
GestureTypeDoubleTap = 2,
|
||||
GestureTypeHold = 4,
|
||||
GestureTypeHorizontalDrag = 8,
|
||||
GestureTypeVerticalDrag = 16,
|
||||
GestureTypeFreeDrag = 32,
|
||||
GestureTypePinch = 64,
|
||||
GestureTypeFlick = 128,
|
||||
GestureTypeDragComplete = 256,
|
||||
GestureTypePinchComplete = 512
|
||||
} GestureType;
|
30
Classes/Retronator/Xni/Framework/Input/Touch/GestureSample.h
Normal file
30
Classes/Retronator/Xni/Framework/Input/Touch/GestureSample.h
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// GestureSample.h
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Retronator.Xni.Framework.classes.h"
|
||||
#import "Retronator.Xni.Framework.Input.Touch.classes.h"
|
||||
|
||||
@interface GestureSample : NSObject {
|
||||
Vector2 *delta;
|
||||
Vector2 *delta2;
|
||||
GestureType gestureType;
|
||||
Vector2 *position;
|
||||
Vector2 *position2;
|
||||
NSTimeInterval timestamp;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) Vector2 *delta;
|
||||
@property (nonatomic, readonly) Vector2 *delta2;
|
||||
@property (nonatomic, readonly) GestureType gestureType;
|
||||
@property (nonatomic, readonly) Vector2 *position;
|
||||
@property (nonatomic, readonly) Vector2 *position2;
|
||||
@property (nonatomic, readonly) NSTimeInterval timestamp;
|
||||
|
||||
@end
|
21
Classes/Retronator/Xni/Framework/Input/Touch/GestureSample.m
Normal file
21
Classes/Retronator/Xni/Framework/Input/Touch/GestureSample.m
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// GestureSample.m
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GestureSample.h"
|
||||
|
||||
|
||||
@implementation GestureSample
|
||||
|
||||
@synthesize delta;
|
||||
@synthesize delta2;
|
||||
@synthesize gestureType;
|
||||
@synthesize position;
|
||||
@synthesize position2;
|
||||
@synthesize timestamp;
|
||||
|
||||
@end
|
@ -0,0 +1,5 @@
|
||||
#import "Enums.h"
|
||||
|
||||
@class TouchPanel, TouchCollection, TouchLocation;
|
||||
|
||||
@class GestureSample;
|
@ -0,0 +1,7 @@
|
||||
#import "Enums.h"
|
||||
|
||||
#import "TouchPanel.h"
|
||||
#import "TouchCollection.h"
|
||||
#import "TouchLocation.h"
|
||||
|
||||
#import "GestureSample.h"
|
@ -0,0 +1,22 @@
|
||||
//
|
||||
// TouchCollection.h
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Retronator.Xni.Framework.Input.Touch.classes.h"
|
||||
|
||||
@interface TouchCollection : NSObject {
|
||||
NSMutableArray *collection;
|
||||
}
|
||||
|
||||
- (int) count;
|
||||
- (TouchLocation*)objectAtIndex:(NSUInteger)index;
|
||||
- (void)addObject:(TouchLocation*)anObject;
|
||||
- (void)insertObject:(TouchLocation*)anObject atIndex:(NSUInteger)index;
|
||||
|
||||
@end
|
@ -0,0 +1,40 @@
|
||||
//
|
||||
// TouchCollection.m
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TouchCollection.h"
|
||||
|
||||
#import "Retronator.Xni.Framework.Input.Touch.h"
|
||||
|
||||
@implementation TouchCollection
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
collection = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int) count {
|
||||
return [collection count];
|
||||
}
|
||||
|
||||
- (TouchLocation*)objectAtIndex:(NSUInteger)index {
|
||||
return (TouchLocation*)[collection objectAtIndex:index];
|
||||
}
|
||||
|
||||
- (void)addObject:(TouchLocation*)anObject {
|
||||
[collection addObject:anObject];
|
||||
}
|
||||
|
||||
- (void)insertObject:(TouchLocation*)anObject atIndex:(NSUInteger)index {
|
||||
[collection insertObject:anObject atIndex:index];
|
||||
}
|
||||
|
||||
@end
|
24
Classes/Retronator/Xni/Framework/Input/Touch/TouchLocation.h
Normal file
24
Classes/Retronator/Xni/Framework/Input/Touch/TouchLocation.h
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// TouchLocation.h
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Retronator.Xni.Framework.classes.h"
|
||||
#import "Retronator.Xni.Framework.Input.Touch.classes.h"
|
||||
|
||||
@interface TouchLocation : NSObject {
|
||||
int id;
|
||||
Vector2 *position;
|
||||
TouchLocationState state;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) int id;
|
||||
@property (nonatomic, readonly) Vector2 *position;
|
||||
@property (nonatomic, readonly) TouchLocationState state;
|
||||
|
||||
@end
|
18
Classes/Retronator/Xni/Framework/Input/Touch/TouchLocation.m
Normal file
18
Classes/Retronator/Xni/Framework/Input/Touch/TouchLocation.m
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// TouchLocation.m
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TouchLocation.h"
|
||||
|
||||
|
||||
@implementation TouchLocation
|
||||
|
||||
@synthesize id;
|
||||
@synthesize position;
|
||||
@synthesize state;
|
||||
|
||||
@end
|
34
Classes/Retronator/Xni/Framework/Input/Touch/TouchPanel.h
Normal file
34
Classes/Retronator/Xni/Framework/Input/Touch/TouchPanel.h
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// TouchPanel.h
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "Retronator.Xni.Framework.classes.h"
|
||||
#import "Retronator.Xni.Framework.Input.Touch.classes.h"
|
||||
|
||||
@interface TouchPanel : NSObject {
|
||||
|
||||
}
|
||||
|
||||
+ (int) getDisplayWidth;
|
||||
+ (void) setDisplayWidth:(int)value;
|
||||
|
||||
+ (int) getDisplayHeight;
|
||||
+ (void) setDisplayHeight:(int)value;
|
||||
|
||||
+ (DisplayOrientation) getDisplayOrientation;
|
||||
+ (void) setDisplayOrientation:(DisplayOrientation)value;
|
||||
|
||||
+ (GestureType) getEnabledGestures;
|
||||
+ (void) setEnabledGestures:(GestureType)value;
|
||||
|
||||
+ (BOOL) isGestureAvailable;
|
||||
+ (TouchCollection*) getState;
|
||||
+ (GestureSample*) readGesture;
|
||||
|
||||
@end
|
51
Classes/Retronator/Xni/Framework/Input/Touch/TouchPanel.m
Normal file
51
Classes/Retronator/Xni/Framework/Input/Touch/TouchPanel.m
Normal file
@ -0,0 +1,51 @@
|
||||
//
|
||||
// TouchPanel.m
|
||||
// XNI
|
||||
//
|
||||
// Created by Matej Jan on 29.9.10.
|
||||
// Copyright 2010 Retronator. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TouchPanel.h"
|
||||
|
||||
#import "Retronator.Xni.Framework.Input.Touch.h"
|
||||
|
||||
@implementation TouchPanel
|
||||
|
||||
+ (int) getDisplayWidth {
|
||||
}
|
||||
|
||||
+ (void) setDisplayWidth:(int)value{
|
||||
}
|
||||
|
||||
+ (int) getDisplayHeight{
|
||||
}
|
||||
|
||||
+ (void) setDisplayHeight:(int)value{
|
||||
}
|
||||
|
||||
+ (DisplayOrientation) getDisplayOrientation{
|
||||
}
|
||||
|
||||
+ (void) setDisplayOrientation:(DisplayOrientation)value{
|
||||
}
|
||||
|
||||
+ (GestureType) getEnabledGestures{
|
||||
}
|
||||
|
||||
+ (void) setEnabledGestures:(GestureType)value{
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL) isGestureAvailable{
|
||||
}
|
||||
|
||||
+ (TouchCollection*) getState{
|
||||
|
||||
}
|
||||
|
||||
+ (GestureSample*) readGesture{
|
||||
}
|
||||
|
||||
|
||||
@end
|
Loading…
x
Reference in New Issue
Block a user