SELF_DIR=$(cd "$(dirname "$0")" ; pwd -P)
EVENT_DATA_FILE=${SELF_DIR}/hideventdata.plist

cat > ${SELF_DIR}/../HID/HIDEventAccessors.h <<EOM
//
//  HIDEventAccessors.h
//

//
// DO NOT EDIT THIS FILE. IT IS AUTO-GENERATED
//

#ifndef HIDEventAccessors_h
#define HIDEventAccessors_h

#import <Foundation/Foundation.h>
#import <HID/HIDEvent.h>

typedef uint32_t IOHIDGenericGestureType;
typedef uint8_t IOHIDEventColorSpace;

NS_ASSUME_NONNULL_BEGIN

EOM

python ${SELF_DIR}/hideventdata.py  -t eventAccessorHeaders -f ${EVENT_DATA_FILE}  >> ${SELF_DIR}/../HID/HIDEventAccessors.h

cat >> ${SELF_DIR}/../HID/HIDEventAccessors.h <<EOM
NS_ASSUME_NONNULL_END

#endif /* HIDEventAccessors_h */

EOM

cat > ${SELF_DIR}/../HID/HIDEventAccessors_Private.h <<EOM
//
//  HIDEventAccessors_Private.h
//

//
// DO NOT EDIT THIS FILE. IT IS AUTO-GENERATED
//

#ifndef HIDEventAccessors_Private_h
#define HIDEventAccessors_Private_h

#import <Foundation/Foundation.h>
#import <HID/HIDEvent.h>
#import <HID/HIDEventAccessors.h>

typedef uint32_t IOHIDGenericGestureType;
typedef uint8_t IOHIDEventColorSpace;

NS_ASSUME_NONNULL_BEGIN

EOM

python ${SELF_DIR}/hideventdata.py  -t eventAccessorHeadersPrivate -f ${EVENT_DATA_FILE}  >> ${SELF_DIR}/../HID/HIDEventAccessors_Private.h

cat >> ${SELF_DIR}/../HID/HIDEventAccessors_Private.h <<EOM
NS_ASSUME_NONNULL_END

#endif /* HIDEventAccessors_Private_h */

EOM

cat > ${SELF_DIR}/../HID/HIDEventAccessors.m <<EOM
//
//  HIDEventAccessors.m
//

//
// DO NOT EDIT THIS FILE. IT IS AUTO-GENERATED
//

#import "HIDEvent.h"
#import <IOKit/hid/IOHIDEventPrivate.h>
#import <IOKit/hid/IOHIDEventData.h>

EOM

python ${SELF_DIR}/hideventdata.py  -t eventAccessors       -f ${EVENT_DATA_FILE}  >> ${SELF_DIR}/../HID/HIDEventAccessors.m