Blame synfig-osx/launcher/darwin.h

Carlos Lopez a09598
/*
Carlos Lopez a09598
 * Copyright (c) 2001 Torrey T. Lyons. All Rights Reserved.
Carlos Lopez a09598
 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
Carlos Lopez a09598
 *
Carlos Lopez a09598
 * Permission is hereby granted, free of charge, to any person obtaining a
Carlos Lopez a09598
 * copy of this software and associated documentation files (the "Software"),
Carlos Lopez a09598
 * to deal in the Software without restriction, including without limitation
Carlos Lopez a09598
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Carlos Lopez a09598
 * and/or sell copies of the Software, and to permit persons to whom the
Carlos Lopez a09598
 * Software is furnished to do so, subject to the following conditions:
Carlos Lopez a09598
 *
Carlos Lopez a09598
 * The above copyright notice and this permission notice shall be included in
Carlos Lopez a09598
 * all copies or substantial portions of the Software.
Carlos Lopez a09598
 *
Carlos Lopez a09598
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Carlos Lopez a09598
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Carlos Lopez a09598
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
Carlos Lopez a09598
 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
Carlos Lopez a09598
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Carlos Lopez a09598
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Carlos Lopez a09598
 * DEALINGS IN THE SOFTWARE.
Carlos Lopez a09598
 *
Carlos Lopez a09598
 * Except as contained in this notice, the name(s) of the above copyright
Carlos Lopez a09598
 * holders shall not be used in advertising or otherwise to promote the sale,
Carlos Lopez a09598
 * use or other dealings in this Software without prior written authorization.
Carlos Lopez a09598
 */
Carlos Lopez a09598
/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.11 2002/03/28 02:21:08 torrey Exp $ */
Carlos Lopez a09598
Carlos Lopez a09598
#ifndef _DARWIN_H
Carlos Lopez a09598
#define _DARWIN_H
Carlos Lopez a09598
Carlos Lopez a09598
#include "inputstr.h"
Carlos Lopez a09598
#include "screenint.h"
Carlos Lopez a09598
#include "scrnintstr.h"
Carlos Lopez a09598
#include "extensions/XKB.h"
Carlos Lopez a09598
Carlos Lopez a09598
typedef struct {
Carlos Lopez a09598
    void                *framebuffer;
Carlos Lopez a09598
    int                 x;
Carlos Lopez a09598
    int                 y;
Carlos Lopez a09598
    int                 width;
Carlos Lopez a09598
    int                 height;
Carlos Lopez a09598
    int                 pitch;
Carlos Lopez a09598
    int                 bitsPerPixel;
Carlos Lopez a09598
    int			componentCount;
Carlos Lopez a09598
    int			bitsPerComponent;
Carlos Lopez a09598
    int                 colorBitsPerPixel;
Carlos Lopez a09598
    unsigned int	redMask, greenMask, blueMask;
Carlos Lopez a09598
} DarwinFramebufferRec, *DarwinFramebufferPtr;
Carlos Lopez a09598
Carlos Lopez a09598
/* From darwinKeyboard.c */
Carlos Lopez a09598
int DarwinModifierNXKeyToNXKeycode(int key, int side);
Carlos Lopez a09598
void DarwinKeyboardInit(DeviceIntPtr pDev);
Carlos Lopez a09598
void DarwinKeyboardReload (DeviceIntPtr pDev);
Carlos Lopez a09598
Carlos Lopez a09598
/* from darwin-new-keymap.c */
Carlos Lopez a09598
unsigned int DarwinSystemKeymapSeed (void);
Carlos Lopez a09598
Carlos Lopez a09598
/* from darwin-input.c */
Carlos Lopez a09598
void DarwinEnqueueEvent (const xEvent *e);
Carlos Lopez a09598
Bool DarwinDequeueEvent (xEvent *e);
Carlos Lopez a09598
void DarwinInputInit (void);
Carlos Lopez a09598
void DarwinInputPreInit (void);
Carlos Lopez a09598
int DarwinMouseProc(DeviceIntPtr pPointer, int what);
Carlos Lopez a09598
int DarwinKeybdProc(DeviceIntPtr pDev, int onoff);
Carlos Lopez a09598
Carlos Lopez a09598
#undef assert
Carlos Lopez a09598
#define assert(x) { if ((x) == 0) \
Carlos Lopez a09598
    FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
Carlos Lopez a09598
#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
Carlos Lopez a09598
    FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
Carlos Lopez a09598
                __LINE__, __FILE__, x); }
Carlos Lopez a09598
#define SCREEN_PRIV(pScreen) \
Carlos Lopez a09598
    ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
Carlos Lopez a09598
Carlos Lopez a09598
#define MIN_KEYCODE XkbMinLegalKeyCode     // unfortunately, this isn't 0...
Carlos Lopez a09598
Carlos Lopez a09598
extern void DarwinEnqueuePointerEvent (xEvent *xe);
Carlos Lopez a09598
extern void DarwinAdjustScreenOrigins (ScreenInfo *pScreenInfo);
Carlos Lopez a09598
Carlos Lopez a09598
/* Global variables from darwin.c */
Carlos Lopez a09598
extern int darwinScreenIndex; // index into pScreen.devPrivates
Carlos Lopez a09598
extern int darwinScreensFound;
Carlos Lopez a09598
Carlos Lopez a09598
/* User preferences used by generic Darwin X server code */
Carlos Lopez a09598
extern Bool darwinSwapAltMeta;
Carlos Lopez a09598
extern int darwinFakeButtons;
Carlos Lopez a09598
extern char *darwinKeymapFile;
Carlos Lopez a09598
extern Bool darwinSyncKeymap;
Carlos Lopez a09598
Carlos Lopez a09598
/* location of X11's (0,0) point in global screen coordinates */
Carlos Lopez a09598
extern int darwinMainScreenX;
Carlos Lopez a09598
extern int darwinMainScreenY;
Carlos Lopez a09598
Carlos Lopez a09598
/* Client message event type ranges. */
Carlos Lopez a09598
enum {
Carlos Lopez a09598
    kXdarwinFirstEvent = 1,
Carlos Lopez a09598
    kXdarwinLastEvent = kXdarwinFirstEvent + 99,
Carlos Lopez a09598
    kXquartzFirstEvent = kXdarwinLastEvent + 1,
Carlos Lopez a09598
    kXquartzLastEvent = kXquartzFirstEvent + 99,
Carlos Lopez a09598
};
Carlos Lopez a09598
Carlos Lopez a09598
/* "Darwin" client message types */
Carlos Lopez a09598
enum {
Carlos Lopez a09598
    kXdarwinQuit = kXdarwinFirstEvent,
Carlos Lopez a09598
};
Carlos Lopez a09598
Carlos Lopez a09598
extern char *DarwinFindLibraryFile (const char *file, const char *pathext);
Carlos Lopez a09598
extern void DarwinForeachLibraryFile (const char *dir,
Carlos Lopez a09598
				      void (*callback) (const char *dir,
Carlos Lopez a09598
							const char *file,
Carlos Lopez a09598
							void *data),
Carlos Lopez a09598
				      void *data);
Carlos Lopez a09598
Carlos Lopez a09598
extern void DarwinSetFakeButtons (const char *mod2, const char *mod3);
Carlos Lopez a09598
Carlos Lopez a09598
#endif	/* _DARWIN_H */