#ifndef _DARWIN_H
#define _DARWIN_H
#include "inputstr.h"
#include "screenint.h"
#include "scrnintstr.h"
#include "extensions/XKB.h"
typedef struct {
void *framebuffer;
int x;
int y;
int width;
int height;
int pitch;
int bitsPerPixel;
int componentCount;
int bitsPerComponent;
int colorBitsPerPixel;
unsigned int redMask, greenMask, blueMask;
} DarwinFramebufferRec, *DarwinFramebufferPtr;
int DarwinModifierNXKeyToNXKeycode(int key, int side);
void DarwinKeyboardInit(DeviceIntPtr pDev);
void DarwinKeyboardReload (DeviceIntPtr pDev);
unsigned int DarwinSystemKeymapSeed (void);
void DarwinEnqueueEvent (const xEvent *e);
Bool DarwinDequeueEvent (xEvent *e);
void DarwinInputInit (void);
void DarwinInputPreInit (void);
int DarwinMouseProc(DeviceIntPtr pPointer, int what);
int DarwinKeybdProc(DeviceIntPtr pDev, int onoff);
#undef assert
#define assert(x) { if ((x) == 0) \
FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
__LINE__, __FILE__, x); }
#define SCREEN_PRIV(pScreen) \
((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
extern void DarwinEnqueuePointerEvent (xEvent *xe);
extern void DarwinAdjustScreenOrigins (ScreenInfo *pScreenInfo);
extern int darwinScreenIndex; extern int darwinScreensFound;
extern Bool darwinSwapAltMeta;
extern int darwinFakeButtons;
extern char *darwinKeymapFile;
extern Bool darwinSyncKeymap;
extern int darwinMainScreenX;
extern int darwinMainScreenY;
enum {
kXdarwinFirstEvent = 1,
kXdarwinLastEvent = kXdarwinFirstEvent + 99,
kXquartzFirstEvent = kXdarwinLastEvent + 1,
kXquartzLastEvent = kXquartzFirstEvent + 99,
};
enum {
kXdarwinQuit = kXdarwinFirstEvent,
};
extern char *DarwinFindLibraryFile (const char *file, const char *pathext);
extern void DarwinForeachLibraryFile (const char *dir,
void (*callback) (const char *dir,
const char *file,
void *data),
void *data);
extern void DarwinSetFakeButtons (const char *mod2, const char *mod3);
#endif