Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / xquartz / darwin.h
CommitLineData
a09e091a
JB
1/*
2 * Copyright (C) 2008-2012 Apple, Inc.
3 * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Except as contained in this notice, the name(s) of the above copyright
24 * holders shall not be used in advertising or otherwise to promote the sale,
25 * use or other dealings in this Software without prior written authorization.
26 */
27
28#ifndef _DARWIN_H
29#define _DARWIN_H
30
31#include <IOKit/IOTypes.h>
32#include "inputstr.h"
33#include "scrnintstr.h"
34#include <X11/extensions/XKB.h>
35#include <asl.h>
36
37#include "darwinfb.h"
38
39// From darwin.c
40void
41DarwinPrintBanner(void);
42int
43DarwinParseModifierList(const char *constmodifiers, int separatelr);
44void
45DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
46
47#define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \
48 dixLookupPrivate(&pScreen->devPrivates, \
49 darwinScreenKey))
50
51/*
52 * Global variables from darwin.c
53 */
54extern DevPrivateKeyRec darwinScreenKeyRec;
55#define darwinScreenKey (&darwinScreenKeyRec)
56extern int darwinScreensFound;
57extern io_connect_t darwinParamConnect;
58extern int darwinEventReadFD;
59extern int darwinEventWriteFD;
60extern DeviceIntPtr darwinPointer;
61extern DeviceIntPtr darwinTabletCursor;
62extern DeviceIntPtr darwinTabletStylus;
63extern DeviceIntPtr darwinTabletEraser;
64extern DeviceIntPtr darwinKeyboard;
65
66// User preferences
67extern int darwinMouseAccelChange;
68extern int darwinFakeButtons;
69extern int darwinFakeMouse2Mask;
70extern int darwinFakeMouse3Mask;
71extern unsigned int darwinAppKitModMask;
72extern unsigned int windowItemModMask;
73extern int darwinSyncKeymap;
74extern int darwinDesiredDepth;
75
76// location of X11's (0,0) point in global screen coordinates
77extern int darwinMainScreenX;
78extern int darwinMainScreenY;
79
80// bundle-main.c
81extern char *bundle_id_prefix;
82
83_X_ATTRIBUTE_PRINTF(6, 7)
84extern void
85xq_asl_log(int level, const char *subsystem, const char *file,
86 const char *function, int line, const char *fmt,
87 ...);
88
89#define ASL_LOG(level, subsystem, msg, args ...) xq_asl_log(level, subsystem, \
90 __FILE__, \
91 __FUNCTION__, \
92 __LINE__, msg, \
93 ## args)
94#define DEBUG_LOG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, \
95 "XQuartz", msg, \
96 ## args)
97#define TRACE() DEBUG_LOG("TRACE")
98
99#endif /* _DARWIN_H */