Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Galonsky authored and Alex Galonsky committed Nov 9, 2009
1 parent 40f81ca commit 10e4fca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 26 deletions.
18 changes: 16 additions & 2 deletions Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@interface Controller : NSObject {

}

typedef struct { float x,y; } mtPoint;
Expand All @@ -29,8 +29,22 @@ typedef struct {
float unk2;
} Finger;

BOOL needToClick;
typedef int MTDeviceRef;
typedef int (*MTContactCallbackFunction)(int,Finger*,int,double,int);

MTDeviceRef MTDeviceCreateDefault();
void MTRegisterContactFrameCallback(MTDeviceRef, MTContactCallbackFunction);
void MTDeviceStart(MTDeviceRef);
CFMutableArrayRef MTDeviceCreateList(void); //returns a CFMutableArrayRef array of all multitouch devices

NSDate *touchStartTime;
float middleclickX, middleclickY;
float middleclickX2, middleclickY2;
MTDeviceRef dev;

BOOL needToClick;
BOOL maybeMiddleClick;
BOOL pressed;

int callback(int device, Finger *data, int nFingers, double timestamp, int frame);
- (void) start;
Expand Down
18 changes: 1 addition & 17 deletions Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,13 @@
#import "WakeObserver.h"


typedef int MTDeviceRef;
typedef int (*MTContactCallbackFunction)(int,Finger*,int,double,int);

MTDeviceRef MTDeviceCreateDefault();
void MTRegisterContactFrameCallback(MTDeviceRef, MTContactCallbackFunction);
void MTDeviceStart(MTDeviceRef);
CFMutableArrayRef MTDeviceCreateList(void); //returns a CFMutableArrayRef array of all multitouch devices

BOOL maybeMiddleClick;
NSDate *touchStartTime;
float middleclickX, middleclickY;
float middleclickX2, middleclickY2;
MTDeviceRef dev;
BOOL pressed = NO;




@implementation Controller

- (void) start
{
pressed = NO;
needToClick = YES;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
Expand Down Expand Up @@ -71,7 +56,6 @@ - (void) start
- (void)toggleMode
{
needToClick = !needToClick;
NSLog(@"foo");
}

int callback(int device, Finger *data, int nFingers, double timestamp, int frame) {
Expand Down
8 changes: 1 addition & 7 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
// Created by Clem on 21.06.09.
//

#import <Cocoa/Cocoa.h>
#import "TrayMenu.h"
#include <math.h>
#include <unistd.h>
#include <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import "WakeObserver.h"

#import "Controller.h"

Controller *con;
Expand Down

0 comments on commit 10e4fca

Please sign in to comment.