/* * Cryptographic API. * * RIPEMD-128 - RACE Integrity Primitives Evaluation Message Digest. * * Based on the reference implementation by Antoon Bosselaers, ESAT-COSIC * * Copyright (c) 2008 Adrian-Ken Rueegsegger * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ #include #include #include #include #include #include #include "ripemd.h" struct rmd128_ctx { u64 byte_count; u32 state[4]; __le32 buffer[16]; }; #define K1 RMD_K1 #define K2 RMD_K2 #define K3 RMD_K3 #define K4 RMD_K4 #define KK1 RMD_K6 #define KK2 RMD_K7 #define KK3 RMD_K8 #define KK4 RMD_K1 #define F1(x, y, z) (x ^ y ^ z) /* XOR */ #define F2(x, y, z) (z ^ (x & (y ^ z))) /* x ? y : z */ #define F3(x, y, z) ((x | ~y) ^ z) #define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */ #define ROUND(a, b, c, d, f, k, x, s) { \ (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \ (a) = rol32((a), (s)); \ } static void rmd128_transform(u32 *state, const __le32 *in) { u32 aa, bb, cc, dd, aaa, bbb, ccc, ddd; /* Initialize left lane */ aa = state[0]; bb = state[1]; cc = state[2]; dd = state[3]; /* Initialize right lane */ aaa = state[0]; bbb = state[1]; ccc = state[2]; ddd = state[3]; /* round 1: left lane */ ROUND(aa, bb, cc, dd, F1, K1, in[0], 11); ROUND(dd, aa, bb, cc, F1, K1, in[1], 14); ROUND(cc, dd, aa, bb, F1, K1, in[2], 15); ROUND(bb, cc, dd, aa, F1, K1, in[3], 12); ROUND(aa, bb, cc, dd, F1, K1, in[4], 5); ROUND(dd, aa, bb, cc, F1, K1, in[5], 8); ROUND(cc, dd, aa, bb, F1, K1, in[6], 7); ROUND(bb, cc, dd, aa, F1, K1, in[7], 9); ROUND(aa, bb, cc, dd, F1, K1, in[8], 11); ROUND(dd, aa, bb, cc, F1, K1, in[9], 13); ROUND(cc, dd, aa, bb, F1, K1, in[10], 14); ROUND(bb, cc, dd, aa, F1, K1, in[11], 15); ROUND(aa, bb, cc, dd, F1, K1, in[12], 6); ROUND(dd, aa, bb, cc, F1, K1, in[13], 7); ROUND(cc, dd, aa, bb, F1, K1, in[14], 9); ROUND(bb, cc, dd, aa, F1, K1, in[15], 8); /* round 2: left lane */ ROUND(aa, bb, cc, dd, F2, K2, in[7], 7); ROUND(dd, aa, bb, cc, F2, K2, in[4], 6); ROUND(cc, dd, aa, bb, F2, K2, in[13], 8); ROUND(bb, cc, dd, aa, F2, K2, in[1], 13); ROUND(aa, bb, cc, dd, F2, K2, in[10], 11); ROUND(dd, aa, bb, cc, F2, K2, in[6], 9); ROUND(cc, dd, aa, bb, F2, K2, in[15], 7); ROUND(bb, cc, dd, aa, F2, K2, in[3], 15); ROUND(aa, bb, cc, dd, F2, K2, in[12], 7); ROUND(dd, aa, bb, cc, F2, K2, in[0], 12); ROUND(cc, dd, aa, bb, F2, K2, in[9], 15); ROUND(bb, cc, dd, aa, F2, K2, in[5], 9); ROUND(aa, bb, cc, dd, F2, K2, in[2], 11); ROUND(dd, aa, bb, cc, F2, K2, in[14], 7); ROUND(cc, dd, aa, bb, F2, K2, in[11], 13); ROUND(bb, cc, dd, aa, F2, K2, in[8], 12); /* round 3: left lane */ ROUND(aa, bb, cc, dd, F3, K3, in[3], 11); ROUND(dd, aa, bb, cc, F3, K3, in[10], 13); ROUND(cc, dd, aa, bb, F3, K3, in[14], 6); ROUND(bb, cc, dd, aa, F3, K3, in[4], 7); ROUND(aa, bb, cc, dd, F3, K3, in[9], 14); ROUND(dd, aa, bb, cc, F3, K3, in[15], 9); ROUND(cc, dd, aa, bb, F3, K3, in[8], 13); ROUND(bb, cc, dd, aa, F3, K3, in[1], 15); ROUND(aa, bb, cc, dd, F3, K3, in[2], 14); ROUND(dd, aa, bb, cc, F3, K3, in[7], 8); ROUND(cc, dd, aa, bb, F3, K3, in[0], 13); ROUND(bb, cc, dd, aa, F3, K3, in[6], 6); ROUND(aa, bb, cc, dd, F3, K3, in[13], 5); ROUND(dd, aa, bb, cc, F3, K3, in[11], 12); ROUND(cc, dd, aa, bb, F3, K3, in[5], 7); ROUND(bb, cc, dd, aa, F3, K3, in[12], 5); /* round 4: left lane */ ROUND(aa, bb, cc, dd, F4, K4, in[1], 11); ROUND(dd, aa, bb, cc, F4, K4, in[9], 12); ROUND(cc, dd, aa, bb, F4, K4, in[11], 14); ROUND(bb, cc, dd, aa, F4, K4, in[10], 15); ROUND(aa, bb, cc, dd, F4, K4, in[0], 14); ROUND(dd, aa, bb, cc, F4, K4, in[8], 15); ROUND(cc, dd, aa, bb, F4, K4, in[12], 9); ROUND(bb, cc, dd, aa, F4, K4, in[4], 8); ROUND(aa, bb, cc, dd, F4, K4, in[13], 9); ROUND(dd, aa, bb, cc, F4, K4, in[3], 14); ROUND(cc, dd, aa, bb, F4, K4, in[7], 5); ROUND(bb, cc, dd, aa, F4, K4, in[15], 6); ROUND(aa, bb, cc, dd, F4, K4, in[14], 8); ROUND(dd, aa, bb, cc, F4, K4, in[5], 6); ROUND(cc, dd, aa, bb, F4, K4, in[6], 5); ROUND(bb, cc, dd, aa, F4, K4, in[2], 12); /* round 1: right lane */ ROUND(aaa, bbb, ccc, ddd, F4, KK1, in[5], 8); ROUND(ddd, aaa, bbb, ccc, F4, KK1, in[14], 9); ROUND(ccc, ddd, aaa, bbb, F4, KK1, in[7], 9); ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[0], 11); ROUND(aaa, bbb, ccc, ddd, F4, KK1, in[9], 13); ROUND(ddd, aaa, bbb, ccc, F4, KK1, in[2], 15); ROUND(ccc, ddd, aaa, bbb, F4, KK1, in[11], 15); ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[4], 5); ROUND(aaa, bbb, ccc, ddd, F4, KK1, in[13], 7); ROUND(ddd, aaa, bbb, ccc, F4, KK1, in[6], 7); ROUND(ccc, ddd, aaa, bbb, F4, KK1, in[15], 8); ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[8], 11); ROUND(aaa, bbb, ccc, ddd, F4, KK1, in[1], 14); ROUND(ddd, aaa, bbb, ccc, F4, KK1, in[10], 14); ROUND(ccc, ddd, aaa, bbb, F4, KK1, in[3], 12); ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[12], 6); /* round 2: right lane */ ROUND(aaa, bbb, ccc, ddd, F3, KK2, in[6], 9); ROUND(ddd, aaa, bbb, ccc, F3, KK2, in[11], 13); ROUND(ccc, ddd, aaa, bbb, F3, KK2, in[3], 15); ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[7], 7); ROUND(aaa, bbb, ccc, ddd, F3, KK2, in[0], 12); ROUND(ddd, aaa, bbb, ccc, F3, KK2, in[13], 8); ROUND(ccc, ddd, aaa, bbb, F3, KK2, in[5], 9); ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[10], 11); ROUND(aaa, bbb, ccc, ddd, F3, KK2, in[14], 7); ROUND(ddd, aaa, bbb, ccc, F3, KK2, in[15], 7); ROUND(ccc, ddd, aaa, bbb, F3, KK2, in[8], 12); ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[12], 7); ROUND(aaa, bbb, ccc, ddd, F3, KK2, in[4], 6); ROUND(ddd, aaa, bbb, ccc, F3, KK2, in[9], 15); ROUND(ccc, ddd, aaa, bbb, F3, KK2, in[1], 13); ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[2], 11); /* round 3: right lane */ ROUND(aaa, bbb, ccc, ddd, F2, KK3, in[15], 9); ROUND(ddd, aaa, bbb, ccc, F2, KK3, in[5], 7); ROUND(ccc, ddd, aaa, bbb, F2, KK3, in[1], 15); ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[3], 11); ROUND(aaa, bbb, ccc, ddd, F2, KK3, in[7], 8); ROUND(ddd, aaa, bbb, ccc, F2, KK3, in[14], 6); ROUND(ccc, ddd, aaa, bbb, F2, KK3, in[6], 6); ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[9], 14); ROUND(aaa, bbb, ccc, ddd, F2, KK3, in[11], 12); ROUND(ddd, aaa, bbb, ccc, F2, KK3, in[8], 13); ROUND(ccc, ddd, aaa, bbb, F2, KK3, in[12], 5); ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[2], 14); ROUND(aaa, bbb, ccc, ddd, F2, KK3, in[10], 13); ROUND(ddd, aaa, bbb, ccc, F2, KK3, in[0], 13); ROUND(ccc, ddd, aaa, bbb, F2, KK3, in[4], 7); ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[13], 5); /* round 4: right lane */ ROUND(aaa, bbb, ccc, ddd, F1, KK4, in[8], 15); ROUND(ddd, aaa, bbb, ccc, F1, KK4, in[6], 5); ROUND(ccc, ddd, aaa, bbb, F1, KK4, in[4], 8); ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[1], 11); ROUND(aaa, bbb, ccc, ddd, F1, KK4, in[3], 14); ROUND(ddd, aaa, bbb, ccc, F1, KK4, in[11], 14); ROUND(ccc, ddd, aaa, bbb, F1, KK4, in[15], 6); ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[0], 14); ROUND(aaa, bbb, ccc, ddd, F1, KK4, in[5], 6); ROUND(ddd, aaa, bbb, ccc, F1, KK4, in[12], 9); ROUND(ccc, ddd, aaa, bbb, F1, KK4, in[2], 12); ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[13], 9); ROUND(aaa, bbb, ccc, ddd, F1, KK4, in[9], 12); ROUND(ddd, aaa, bbb, ccc, F1, KK4, in[7], 5); ROUND(ccc, ddd, aaa, bbb, F1, KK4, in[10], 15); ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[14], 8); /* combine results */ ddd += cc + state[1]; /* final result for state[0] */ state[1] = state[2] + dd + aaa; state[2] = state[3] + aa + bbb; state[3] = state[0] + bb + ccc; state[0] = ddd; return; } static int rmd128_init(struct shash_desc *desc) { struct rmd128_ctx *rctx = shash_desc_ctx(desc); rctx->byte_count = 0; rctx->state[0] = RMD_H0; rctx->state[1] = RMD_H1; rctx->state[2] = RMD_H2; rctx->state[3] = RMD_H3; memset(rctx->buffer, 0, sizeof(rctx->buffer)); return 0; } static int rmd128_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct rmd128_ctx *rctx = shash_desc_ctx(desc); const u32 avail = sizeof(rctx->buffer) - (rctx->byte_count & 0x3f); rctx->byte_count += len; /* Enough space in buffer? If so copy and we're done */ if (avail > len) { memcpy((char *)rctx->buffer + (sizeof(rctx->buffer) - avail), data, len); goto out; } memcpy((char *)rctx->buffer + (sizeof(rctx->buffer) - avail), data, avail); rmd128_transform(rctx->state, rctx->buffer); data += avail; len -= avail; while (len >= sizeof(rctx->buffer)) { memcpy(rctx->buffer, data, sizeof(rctx->buffer)); rmd128_transform(rctx->state, rctx->buffer); data += sizeof(rctx->buffer); len -= sizeof(rctx->buffer); } memcpy(rctx->buffer, data, len); out: return 0; } /* Add padding and return the message digest. */ static int rmd128_final(struct shash_desc *desc, u8 *out) { struct rmd128_ctx *rctx = shash_desc_ctx(desc); u32 i, index, padlen; __le64 bits; __le32 *dst = (__le32 *)out; static const u8 padding[64] = { 0x80, }; bits = cpu_to_le64(rctx->byte_count << 3); /* Pad out to 56 mod 64 */ index = rctx->byte_count & 0x3f; padlen = (index < 56) ? (56 - index) : ((64+56) - index); rmd128_update(desc, padding, padlen); /* Append length */ rmd128_update(desc, (const u8 *)&bits, sizeof(bits)); /* Store state in digest */ for (i = 0; i < 4; i++) dst[i] = cpu_to_le32p(&rctx->state[i]); /* Wipe context */ memset(rctx, 0, sizeof(*rctx)); return 0; } static struct shash_alg alg = { .digestsize = RMD128_DIGEST_SIZE, .init = rmd128_init, .update = rmd128_update, .final = rmd128_final, .descsize = sizeof(struct rmd128_ctx), .base = { .cra_name = "rmd128", .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = RMD128_BLOCK_SIZE, .cra_module = THIS_MODULE, } }; static int __init rmd128_mod_init(void) { return crypto_register_shash(&alg); } static void __exit rmd128_mod_fini(void) { crypto_unregister_shash(&alg); } module_init(rmd128_mod_init); module_exit(rmd128_mod_fini); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Adrian-Ken Rueegsegger "); MODULE_DESCRIPTION("RIPEMD-128 Message Digest"); 3a776'>hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nibbin0 -> 21843 bytes-rw-r--r--hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp1
-rw-r--r--hw/darwin/bundle/English.lproj/Credits.rtf138
-rw-r--r--hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp5
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings23
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin0 -> 20327 bytes-rw-r--r--hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/French.lproj/Credits.rtf123
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin0 -> 1486 bytes-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nibbin0 -> 22289 bytes-rw-r--r--hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp107
-rw-r--r--hw/darwin/bundle/German.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin0 -> 1452 bytes-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nibbin0 -> 22218 bytes-rw-r--r--hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp90
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Credits.rtf135
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin0 -> 1146 bytes-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nibbin0 -> 21423 bytes-rw-r--r--hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp149
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Credits.rtf139
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin0 -> 1498 bytes-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nibbin0 -> 20861 bytes-rw-r--r--hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp216
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin0 -> 1474 bytes-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nibbin0 -> 21989 bytes-rw-r--r--hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp116
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin0 -> 1458 bytes-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nibbin0 -> 20444 bytes-rw-r--r--hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp108
-rw-r--r--hw/darwin/bundle/XDarwin.icnsbin0 -> 35134 bytes-rw-r--r--hw/darwin/bundle/ko.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin0 -> 1326 bytes-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nibbin0 -> 21010 bytes-rw-r--r--hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/startXClients.cpp24
-rw-r--r--hw/darwin/darwin.c1025
-rw-r--r--hw/darwin/darwin.h106
-rw-r--r--hw/darwin/darwinClut8.h532
-rw-r--r--hw/darwin/darwinEvents.c438
-rw-r--r--hw/darwin/darwinKeyboard.c805
-rw-r--r--hw/darwin/quartz/Preferences.h107
-rw-r--r--hw/darwin/quartz/Preferences.m530
-rw-r--r--hw/darwin/quartz/XApplication.h47
-rw-r--r--hw/darwin/quartz/XApplication.m47
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj1683
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c165
-rw-r--r--hw/darwin/quartz/XDarwinStartup.man75
-rw-r--r--hw/darwin/quartz/XServer.h112
-rw-r--r--hw/darwin/quartz/XServer.m1029
-rw-r--r--hw/darwin/quartz/pseudoramiX.c420
-rw-r--r--hw/darwin/quartz/pseudoramiX.h10
-rw-r--r--hw/darwin/quartz/quartz.c305
-rw-r--r--hw/darwin/quartz/quartz.h50
-rw-r--r--hw/darwin/quartz/quartzAudio.c342
-rw-r--r--hw/darwin/quartz/quartzAudio.h41
-rw-r--r--hw/darwin/quartz/quartzCocoa.m198
-rw-r--r--hw/darwin/quartz/quartzCommon.h98
-rw-r--r--hw/darwin/quartz/quartzCursor.c653
-rw-r--r--hw/darwin/quartz/quartzCursor.h43
-rw-r--r--hw/darwin/quartz/quartzPasteboard.c150
-rw-r--r--hw/darwin/quartz/quartzPasteboard.h45
-rw-r--r--hw/darwin/quartz/quartzStartup.c233
-rw-r--r--hw/darwin/utils/README.txt111
-rw-r--r--hw/darwin/utils/dumpkeymap.c1453
-rw-r--r--hw/darwin/utils/dumpkeymap.man1004
79 files changed, 14838 insertions, 0 deletions
diff --git a/hw/darwin/XDarwin.man b/hw/darwin/XDarwin.man
new file mode 100644
index 000000000..a718e41ce
--- /dev/null
+++ b/hw/darwin/XDarwin.man
@@ -0,0 +1,205 @@
+.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.4 2002/01/09 18:01:58 torrey Exp $
+.\"
+.TH XDARWIN 1 __vendorversion__
+.SH NAME
+XDarwin \- X window system server for Darwin operating system
+.SH SYNOPSIS
+.B XDarwin
+[ options ] ...
+.SH DESCRIPTION
+#ifdef DARWIN_WITH_QUARTZ
+.I XDarwin
+is the X window server for Mac OS X and the Darwin operating system
+provided by the XFree86 Project.
+.I XDarwin
+can run in three different modes. On Mac OS X,
+.I XDarwin
+runs in parallel with Aqua in full screen or rootless modes. These modes
+are called Quartz modes, named after the Quartz 2D compositing engine used
+by Aqua. XDarwin can also be run from the Darwin text console in IOKit mode.
+.PP
+When running from the console,
+.I XDarwin
+acts as the window server and uses IOKit services to access the display
+framebuffer, mouse and keyboard and to provide a layer of hardware
+abstraction. In console mode,
+.I XDarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+.PP
+When running with the Mac OS X Aqua GUI,
+.I XDarwin
+will normally be started by launching from the Finder, but it may also be
+started from the command line with the \fB\-quartz\fP, \fB\-fullscreen\fP, or
+\fB\-rootless\fP options. Note that the defaults for various command line
+options are set by the
+.I XDarwin
+application preferences in the Quartz modes.
+.PP
+In full screen Quartz mode, when the X Window System is active, it takes over
+the entire screen. CoreGraphics is used to capture and draw to the screen. The
+.I XDarwin
+application allows easy switching between the Mac OS X and X window
+desktops. More information is available in the Help menu of the
+.I XDarwin
+application.
+.PP
+In rootless mode, the X window system and Aqua share your display. The root
+window of the X11 display is the size of the screen and contains all the
+other windows. The X11 root window is not displayed in rootless mode as Aqua
+handles the desktop background.
+#else
+.I XDarwin
+is the X window server for Mac OS X and the Darwin operating system
+provided by the XFree86 Project. This version of
+.I XDarwin
+can only be started from the Darwin text console. The Mac OS X Aqua GUI, if
+present, must be shut down.
+.I XDarwin
+uses IOKit services to access the display
+framebuffer, mouse and keyboard and to provide a layer of hardware
+abstraction.
+.I XDarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+#endif
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXDarwin\fP accepts the following command line switches:
+.TP 8
+.B \-fakebuttons
+Emulates a 3 button mouse using modifier keys. By default, the Command modifier
+is used to emulate button 2 and Option is used for button 3. Thus, clicking the
+first mouse button while holding down Command will act like clicking
+button 2. Holding down Option will simulate button 3.
+.TP 8
+.B \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-fakemouse2 \fImodifiers\fP"
+Change the modifier keys used to emulate the second mouse button. By default,
+Command is used to emulate the second button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse2 """Option,Shift""
+will set holding Option, Shift and clicking on button one as equivalent to
+clicking the second mouse button.
+.TP 8
+.B "\-fakemouse3 \fImodifiers\fP"
+Change the modifier keys used to emulate the third mouse button. By default,
+Option is used to emulate the third button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse3 """Control,Shift""
+will set holding Control, Shift and clicking on button one as equivalent to
+clicking the third mouse button.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
+The default is to read this keymapping from USA.keymapping. With this option
+the keymapping will be read from \fIfile\fP instead. If the file's path is
+not specified, it will be searched for in Library/Keyboards/ underneath the
+following directories (in order): ~, /, /Network, /System.
+.TP 8
+.B \-nokeymap
+On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
+With this option XDarwin queries the kernel for the current keymapping
+instead of reading it from a file. This will often fail on newer kernels.
+#ifdef DARWIN_WITH_QUARTZ
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screen resolution for the X server to use.
+Ignored in rootless mode.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+Ignored in rootless mode.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+Ignored in rootless mode.
+.TP 8
+.B \-fullscreen
+Run full screen in parallel with Mac OS X Aqua GUI.
+.TP 8
+.B \-rootless
+Run rootless inside Mac OS X Aqua GUI.
+.TP 8
+.B \-quartz
+Run in parallel with the Mac OS X Aqua GUI using the default mode.
+#else
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screen resolution for the X server to use.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+#endif
+.TP 8
+.B \-showconfig
+Print out the server version and patchlevel.
+.TP 8
+.B \-version
+Same as \fB\-showconfig\fP.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), XFree86(1), Xserver(1), xdm(1), xinit(1)
+.SH BUGS
+.I XDarwin
+and this man page still have many limitations. Some of the more obvious
+ones are:
+.br
+- The display mode cannot be changed once the X server has started.
+.br
+- A screen saver is not supported.
+.PP
+.SH AUTHORS
+XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
+Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
+Torrey T. Lyons improved and integrated this code into the XFree86
+Project's mainline for the 4.0.2 release.
+.PP
+The following members of the XonX Team contributed to the following
+releases (in alphabetical order):
+.TP 4
+XFree86 4.1.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - Cocoa version of XDarwin front end
+.br
+Gregory Robert Parker - Original Quartz implementation
+.br
+Christoph Pfisterer - Dynamic shared X libraries
+.br
+Toshimitsu Tanaka - Japanese localization
+.TP 4
+XFree86 4.2.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Pablo Di Noto - Spanish localization
+.br
+Paul Edens - Dutch localization
+.br
+Kyunghwan Kim - Korean localization
+.br
+Mario Klebsch - Non-US keyboard support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - German localization
+.br
+Patrik Montgomery - Swedish localization
+.br
+Greg Parker - Rootless support
+.br
+Toshimitsu Tanaka - Japanese localization
+.br
+Olivier Verdier - French localization
diff --git a/hw/darwin/bundle/Dutch.lproj/Credits.rtf b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
new file mode 100644
index 000000000..22d7683eb
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..034396156
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..e7ca52c2c
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/19 01:21:32 torrey Exp $ --> #include "xf86Version.h" #ifndef PRE_RELEASE #define PRE_RELEASE XF86_VERSION_SNAP #endif <html> <head> <title>XFree86 voor Mac OS X</title> </head> <body> <center> <h1>XFree86 voor Darwin en Mac OS X</h1> XFree86 XF86_VERSION<br> Release Date: XF86_REL_DATE </center> <h2>Inhoud</h2> <ol> <li><A HREF="#notice">Belangrijke Informatie</A></li> <li><A HREF="#usage">Gebruik</A></li> <li><A HREF="#path">Instellen van het Path</A></li> <li><A HREF="#prefs">Voorkeursinstellingen</A></li> <li><A HREF="#license">Licentie</A></li> </ol> <center> <h2><a NAME="notice">Belangrijke Informatie</a></h2> </center> <blockquote> #if PRE_RELEASE Dit is een pre-release van XFree86, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of in de <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>. #else Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. #endif </blockquote> <blockquote> Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote> <h2><a NAME="usage">Gebruik</a></h2> <p>XFree86 is een open-source uitvoering van het <a HREF="http://www.x.org/">X Window Systeem</a>, verzorgd door <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>, die vrij verspreid mag worden. De X window server voor Darwin en Mac OS X verzorgd door XFree86 heet XDarwin. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p> <p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p> <p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p> <h3>Meerknopsmuis emulatie</h3> <p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p> <h2><a NAME="path">Instellen van het Path</a></h2> <p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p> <p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p> <p>Het kan handig zijn de man pages voor XFree86 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p> <h2><a NAME="prefs">Voorkeursinstellingen</a></h2> <p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p> <h3>Algemeen</h3> <ul> <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li> <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li> <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li> </ul> <h3>Start</h3> <ul> <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li> <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li> <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li> <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li> <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li> <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li> </ul> <h3>Schermvullend</h3> <ul> <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li> <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li> <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li> <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li> </ul> <h2><a NAME="license">Licentie</a></h2> The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>. <H3><A NAME="3"></A>X Consortium License</H3> <p>Copyright (C) 1996 X Consortium</p> <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> <p>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</p> <p>X Window System is a trademark of X Consortium, Inc.</p> </body> </html> \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/Credits.rtf b/hw/darwin/bundle/English.lproj/Credits.rtf
new file mode 100644
index 000000000..4e2fad42c
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/Credits.rtf
@@ -0,0 +1,138 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2.99.x:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Fabr\'92cio Luis de Castro\
+
+\f2\i Portuguese localization
+\f1\i0 \
+Michael Oland\
+
+\f2\i New XDarwin icon
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
new file mode 100644
index 000000000..99211244e
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
@@ -0,0 +1,5 @@
+/* English versions of the Info.plist keys; used by most localizations. */
+/* Most of these are set in the target application settings. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.4 2003/01/15 02:34:04 torrey Exp $ */
+
+NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2003 XFree86 Project, Inc.__quote__;
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
new file mode 100644
index 000000000..6025a2469
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/Localizable.strings
@@ -0,0 +1,23 @@
+/* English localized versions of strings used by the Mac OS X front end. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */
+
+/* Title of alert panel */
+"Quit X server?" = "Quit X server?";
+
+/* Text of alert panel */
+"Quitting the X server will terminate any running X Window System programs." = "Quitting the X server will terminate any running X Window System programs.";
+
+/* Quit */
+"Quit" = "Quit";
+
+/* Cancel */
+"Cancel" = "Cancel";
+
+/* Default keymapping file */
+"USA.keymapping" = "USA.keymapping"
+
+/* Default switch string */
+"Cmd-Opt-a" = "Cmd-Opt-a"
+
+/* Button title when changing switch key */
+"Press key" = "Press key"
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..7aedf01c2
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..fc11e26d3
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,103 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
+<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
+<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
+
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
+<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
+<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
+
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
+ <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
+ <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
+</ul>
+<h3>Start Up</h3>
+<ul>
+ <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
+ <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
+ <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
+ <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
+ <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
+</ul>
+<h3>Full Screen</h3>
+<ul>
+ <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
+ <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
+</ul>
+
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/French.lproj/Credits.rtf b/hw/darwin/bundle/French.lproj/Credits.rtf
new file mode 100644
index 000000000..5e52d1177
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/Credits.rtf
@@ -0,0 +1,123 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 Participants \'88 XonX pour XFree86 4.2 :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Version pour Darwin x86
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Traduction en espagnol
+\f1\i0 \
+Paul Edens\
+
+\f2\i Traduction en allemand
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Traduction en cor\'8een
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Claviers non-US
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Direction du projet
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Traduction en allemand
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Traduction en su\'8edois
+\f1\i0 \
+Greg Parker\
+
+\f2\i Version \'c7 rootless \'c8
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Traduction en japonais
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i Traduction en fran\'8dais
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Remerciements :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman et Zero G Software, Inc.\
+
+\f2\i Installeur
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Participants \'88 XonX pour XFree86 4.2 :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Version pour Darwin x86
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Direction du projet
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Version Cocoa de l'interface de XDarwin
+\f1\i0 \
+Greg Parker\
+
+\f2\i Impl\'8ementation initiale sur Quartz
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Librairies partag\'8ees dynamiquement
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Traduction en japonais
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Remerciements :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+ Ic\'99ne
+\f2\i XDarwin
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Historique :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i Adaptation de Free86 4.0 pour Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
new file mode 100644
index 000000000..591f73cae
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..ef15f00f1
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..0fdfb01fb
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,107 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/20 06:42:20 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
+<title>XFree86 pour Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 pour Darwin et Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Date : XF86_REL_DATE
+</center>
+<h2>Sommaire</h2>
+<ol>
+ <li><A HREF="#notice">Avertissement</A></li>
+ <li><A HREF="#usage">Utilisation</A></li>
+ <li><A HREF="#path">Chemins d'accès</A></li>
+ <li><A HREF="#prefs">Préférences</A></li>
+ <li><A HREF="#license">Licence</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Avertissement</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Ceci est une pré-version de XFree86 et ne fait par conséquent l'objet d'aucun support client. Les bogues peuvent être signalés et des patches peuvent être soumis sur la
+<A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge. Veuillez prendre connaissance de la dernière version sur <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ou sur le <A HREF="http://www.XFree86.Org/cvs">répertoire CVS de XFree86</A> avant de signaler un bogue d'une pré-version.
+#else
+Si le serveur date de plus de 6-12 mois ou si votre matériel est plus récent que la date indiquée ci-dessus, veuillez vous procurer une version plus récente avant de signaler toute anomalie. Les bogues peuvent être signalés et des patches peuvent être soumis sur la <A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Ce logiciel est distribué sous la
+<A HREF="#license">Licence du Consortium X/X11 du MIT</A> et est fourni TEL QUEL, sans garanties. Veuillez prendre connaissance de la <A HREF="#license">Licence</A> avant toute utilisation.</blockquote>
+
+<h2><a NAME="usage">Utilisation</a></h2>
+<p>XFree86 est une implémentation libre et distribuable sans contrainte du <a HREF
+="http://www.x.org/">X Window System</a> produit par <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> Le serveur X window pour Darwin et Mac OS X fourni par XFree86 se nomme XDarwin. XDarwin fonctionne sous Mac OS X en mode « rootless » ou plein écran.</p>
+<p>Lorsque le système X window est actif en mode plein écran, il prend en charge la totalité de l'écran. Il est possible de revenir sur le bureau de Mac OS X en appuyant sur Commande-Option-A. Cette combinaison de touches peut être modifiée dans les préférences. Pour revenir dans X window, cliquer sur l'icône de XDarwin dans le Dock de Mac OS X. (Un réglage des préférences permet d'effectuer cette opération en cliquant dans une fenêtre flottante au lieu de l'icône du Dock)</p>
+<p>En mode « rootless », X window system et Aqua utilisent le même affichage. La fenêtre-mère de l'affichage X11 est de la taille de l'écran et contient toutes les autre fenêtres. En mode « rootless » cette fenêtre-mère n'est pas affichée car Aqua gère le fond d'écran.</p>
+<h3>Émulation de souris à plusieurs boutons</h3>
+<p>Le fonctionnement de la plupart des applications X11 repose sur l'utilisation d'une souris à 3 boutons. Il est possible d'émuler une souris à 3 boutons avec un seul bouton en appuyant sur des touches de modification. Ceci est réglé dans la section "Émulation de souris à plusieurs boutons" de l'onglet "Général" des préférences. L'émulation est activée par défaut. Dans ce cas, cliquer en appuyant simultanément sur la touche "commande" simulera le bouton du milieu. Cliquer en appuyant simultanément sur la touche "option" simulera le bouton de droite. Les préférences permettent de régler n'importe quelle combinaison de touches de modification pour émuler les boutons du milieu et de droite. Notez que même si les touches de modifications sont mises en correspondance avec d'autres touches par xmodmap, ce sont les touches originelles spécifiées dans les préférences qui assureront l'émulation d'une souris à plusieurs boutons.
+
+<h2><a NAME="path">Réglage du chemin d'accès</a></h2>
+<p>Le chemin d'accès est une liste de répertoires utilisés pour la recherche d'exécutables. Les commandes X11 sont situées dans <code>/usr/X11R6/bin</code>, qui doit être ajouté à votre chemin d'accès. XDarwin fait cela par défaut, et peut également ajouter d'autres répertoires dans lesquels vous auriez installé d'autre commandes unix.</p>
+<p>Les utilisateurs plus expérimentés auront déjà réglé leur chemin d'accès correctement par le biais des fichiers d'initialisation de leur shell. Dans ce cas, il est possible de demander à XDarwin de ne pas modifier le chemin d'accès initial. XDarwin lance les premiers clients X11 dans le shell d'ouverture de session par défaut. (Un shell de remplacement peut être spécifié dans les préférences.) La façon de régler le chemin d'accès dépend du shell utilisé. Ceci est documenté dans les pages "man" du shell.</p>
+<p>De plus, il est possible d'ajouter les pages "man" de XFree86 à la liste des pages recherchées pour la documentation "man". Les pages "man" X11 se trouvent dans <code>/usr/X11R6/man</code> et la variable d'environnement <code>MANPATH</code> contient la liste des répertoires dans lesquels chercher.</p>
+
+
+<h2><a NAME="prefs">Préférences</a></h2>
+<p>Un certain nombre d'options peuvent être réglées dans les préférences. On accède aux préférences en choisissant "Préférences..." dans le menu "XDarwin". Les options décrites comme options de démarrage ne prendront pas effet avant le redémarrage de XDarwin. Les autres options prennent immédiatement effet. Les différentes options sont détaillées ci-après :</p>
+<h3>Général</h3>
+<ul>
+ <li><b>Utiliser le bip d'alerte Système dans X11 :</b> Cocher cette option pour que le son d'alerte standard de Mac OS X soit utilisé à la place du son d'alerte de X11. L'option n'est pas cochée ar défaut. Dans ce cas, un simple signal sonore est utilisé.</li>
+ <li><b>Autoriser X11 à changer la vitesse de la souris :</b> Dans une implémentation classique du sytème X window, le gestionnaire de fenêtres peut modifier la vitesse de la souris. Cela peut s'avérer déroutant puisque le réglage de la vitesse de la souris peut être différent dans les préférences de Mac OS X et dans le gestionnaire X window. Par défaut, X11 n'est pas autorisé à changer la vitesse de la souris.</li>
+ <li><b>Émulation de souris à plusieurs boutons :</b> Ceci est décrit ci-dessus à la rubrique <a HREF="#usage">Usage</a>. Lorsque l'émulation est activée, il suffit d'appuyer simultanément sur les touches modificatrices sélectionnées et sur le bouton de la souris afin d'émuler les boutons du milieu et de droite.</li>
+</ul>
+<h3>Démarrage</h3>
+<ul>
+ <li><b>Mode par défaut :</b> Le mode spécifié à cet endroit sera utilisé si l'utilisateur ne l'indique pas au démarrage.</li>
+ <li><b>Choix du mode d'affichage au démarrage</b> Par défaut, une fenêtre de dialogue est affichée au démarrage de XDarwin pour permettre à l'utilisateur de choisir entre le mode plein écran et le mode « rootless ». Si cette option est désactivée, le mode par défaut sera automatiquement utilisé.</li>
+ <li><b>Numéro d'affichage (Display)</b> X11 offre la possibilité de plusieurs serveurs X sur un ordinateur. L'utilisateur doit spécifier ici le numéro d'affichage utilisé par XDarwin dans le cas où plusieurs serveurs X seraient en service simultanément.</li>
+ <li><b>Autoriser la prise en charge Xinerama de plusieurs moniteurs :</b> XDarwin peut être utilisé avec plusieurs moniteur avec Xinerama, qui considère les différents moniteurs comme des parties d'un écran rectugulaire plus grand. Cette option permet de désactiver Xinerama mais XDarwin ne prend alors pour l'instant pas correctement en charge l'affichage sur plusieurs écrans. Si il n'y a qu'un seul moniteur, Xinerama est automatiquement désactivé.</li>
+ <li><b>Fichier clavier :</b> Un fichier de correspondance de clavier est lu au démarrage puis transformé en un fihcier de correspondance clavier pour X11. Les fichiers de correspondance clavier, disponibles pour de nombreuses langues, se trouvent dans <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Démarrage des premiers clients X11 :</b> Lorsque XDarwin est démarré à partir du Finder, il lance <code>xinit</code> qui lance à son tour le gestionnaire X window ainsi que d'autres clients X. (Voir "<code>man xinit</code>" pour plus d'informations.) Avant de lancer <code>xinit</code>, XDarwin ajoute les répertoires ainsi spécifiés au chemin d'accès de l'utilisateur. Par défaut, seul <code>/usr/X11R6/bin</code> est ajouté. Il est possible d'ajouter d'autres répertoires en les séparants à l'aide de deux points (<code>:</code>). Les clients X sont démarrés à partir du shell par défaut de l'utilisateur. Ainsi, le fichier d'initialisation de shell de l'utilisateur est lu. Un autre shell peut éventuellement être spécifié.</li>
+</ul>
+<h3>Plein écran</h3>
+<ul>
+ <li><b>Combinaison de touches :</b> Appuyer sur ce bouton, puis appuyer sur une ou plusieurs touches modificatrices suivies d'une touche ordinaire. Cette combinaison de touche servira à commuter entre Aqua et X11.</li>
+ <li><b>Basculer dans X11 en cliquant sur l'icône du Dock :</b> Cette option permet de passer dans X11 en cliquant dans l'icône de XDarwin dans le Dock. Sur certaines versions de Mac OS X, la commutation en utilisant le Dock peut faire disparaître le curseur lors du retour dans Aqua.</li>
+ <li><b>Afficher l'aide du mode plein écran au démarrage :</b> Permet l'affichage d'une fenêtre d'introduction lorsque XDarwin est démarré en mode plein écran.</li>
+ <li><b>Profondeur de couleur :</b> En mode plein écran, l'affichage X11 peut utiliser une autre profondeur de couleur que celle employée par Aqua. Si "Actuelle" est choisi, XDarwin utilisera la même profondeur de couleur qu'Aqua. Les autres choix sont 8 (256 couleurs), 15 (milliers de couleurs) et 24 bits (millions de couleurs). </li>
+</ul>
+
+<h2><a NAME="license">Licence</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
+
diff --git a/hw/darwin/bundle/German.lproj/Credits.rtf b/hw/darwin/bundle/German.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
new file mode 100644
index 000000000..365cc291a
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..d3e7c5d57
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..6b1b91f5c
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,90 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp,v 1.1 2001/11/03 00:25:34 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> XFree86 runs on Mac OS X in full screen mode. When the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, just click on the XDarwin icon in the floating switch window to switch back to the X window system. You can change this behavior in the user preferences so that clicking on the XDarwin icon in the Dock switches as well.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p>
+<p>Notes:</p>
+<ul>
+ <li>With most keyboards the left and right command and option keys are not differentiated so either will work.
+ <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation.
+ <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button.
+</ul>
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. The following directions are for tcsh, which is the default shell on Darwin and Mac OS X.</p>
+<p>You can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to the file ~/Library/init/tcsh/path: (You may need to create this file and directory path if it does not exist already.)</p>
+<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote>
+<p>Note that if you have created a .cshrc or .tcshrc file, these files will override your settings in ~/Library/init/tcsh/ and you will need to change one of these files instead. These changes will not take effect until you open a new Terminal window. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p>
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed under Startup Options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<ul>
+ <li>Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li>Use System beep for X11: When enabled the standard Mac OS X alert sound is used as X11 bell. When disabled (default) a simple tone is used.</li>
+ <li>Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li>Show help on startup: This will show the introductory splash screen when XDarwin is launched.</li>
+ <li>Display number: This sets what X display number XDarwin should assign to the display. Note that XDarwin always takes over the main display when showing X11.</li>
+ <li>Keymapping: By default, XDarwin loads the keymapping from the Darwin kernel on startup. On portables, this keymapping is sometimes empty so that the keyboard will appear to be dead in X11. If "Load from file" is selected, XDarwin will load the keymapping from the specified file instead.</li>
+</ul>
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
new file mode 100644
index 000000000..6b1f82d8a
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
@@ -0,0 +1,135 @@
+{\rtf1\mac\ansicpg10001\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+\f3\fnil\fcharset78 HiraKakuPro-W3;}
+{\colortbl;\red255\green255\blue255;}
+\vieww13980\viewh11160\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+ Darwin x86
+\f2\i
+\f3\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Pablo Di Noto\
+
+\f2\i
+\f3\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Paul Edens\
+
+\f2\i
+\f3\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Kyunghwan Kim\
+
+\f2\i
+\f3\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Mario Klebsch\
+
+\f3 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Torrey T. Lyons\
+
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
+\f1 \
+Andreas Monitzer\
+
+\f3 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Patrik Montgomery\
+
+\f2\i
+\f3\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Greg Parker\
+
+\f3 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+
+\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
+\f1 \
+
+\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Olivier Verdier\
+
+\f2\i
+\f3\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i
+\f3\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89
+\f1 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+ Darwin x86
+\f3 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Torrey T. Lyons\
+
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
+\f1 \
+Andreas Monitzer\
+ Cocoa
+\f3 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68
+\f1 \
+Greg Parker\
+
+\f3 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67
+\f1 \
+Christoph Pfisterer\
+
+\f3 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a
+\f1 \
+
+\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
+\f1 \
+
+\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+ XDarwin
+\f3 \'83\'41\'83\'43\'83\'52\'83\'93
+\f1 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f3 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41
+\f1 \
+Dave Zarzycki\
+ XFree86 4.0
+\f3 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41
+\f1 \
+Torrey T. Lyons\
+ XFree86 4.0.2
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
new file mode 100644
index 000000000..091138dd5
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..fbfb4dd42
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..2065d43d4
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,149 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.5 2002/05/04 01:25:40 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
+<title>
+XFree86 for Mac OS X</title></head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Ìܼ¡</h2>
+<ol>
+ <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li>
+ <li><A HREF="#usage">»ÈÍÑË¡</A></li>
+ <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li>
+ <li><A HREF="#prefs">´Ä¶­ÀßÄê</A></li>
+ <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
+#else
+¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+#endif
+</blockquote>
+<blockquote>
+ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
+¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆɤ߲¼¤µ¤¤¡£
+</blockquote>
+
+<h2><a NAME="usage">»ÈÍÑË¡</a></h2>
+<p>XFree86 ¤Ï¡¤<a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¼ÂÁõ¤Ç¤¹¡£
+XFree86 ¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë Darwin ¤È Mac OS X ¤Î¤¿¤á¤Î X Window ¥µ¡¼¥Ð¡¼¤ò XDarwin ¤È¸Æ¤Ó¤Þ¤¹¡£
+XDarwin ¤Ï¡¤Mac OS X ¾å¤Ç¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£</p>
+
+<p>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
+Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é X Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
+¡Ê´Ä¶­ÀßÄê¤Ç¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë</p>
+
+<p>¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤È Aqua ¤Ï²èÌ̤ò¶¦Í­¤·¤Þ¤¹¡£
+X11 ¤¬É½¼¨¤¹¤ë¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï²èÌ̤Υµ¥¤¥º¤Ç¤¢¤ê¡¤Â¾¤ÎÁ´¤Æ¤Î¥¦¥£¥ó¥É¥¦¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
+Aqua ¤¬¥Ç¥¹¥¯¥È¥Ã¥×¤ÎÇطʤòÀ©¸æ¤¹¤ë¤Î¤Ç¡¤X11 ¤Î¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£</p>
+
+<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3>
+<p>¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ÈƱ»þ¤Ë¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¤°ì¤Ä¤Î¥Ü¥¿¥ó¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¤³¤ì¤Ï¡¤´Ä¶­ÀßÄê¤Î¡Ö°ìÈÌÀßÄê¡×¤Î¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤ÇÀßÄꤷ¤Þ¤¹¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ÏÍ­¸ú¤Ç¡¤¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
+¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¡¤´Ä¶­ÀßÄê¤Ç¥Ü¥¿¥ó 2 ¤È 3 ¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë½¤¾þ¥­¡¼¤ÎÁȹ礻¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+Ãí¡§½¤¾þ¥­¡¼¤ò xmodmap ¤Ç¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£</p>
+
+<h2><a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a></h2>
+<p>¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
+X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤<code>/usr/X11R6/bin</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+XDarwin ¤Ï¡¤¤³¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¹Ô¤¤¤Þ¤¹¡£¤Þ¤¿¡¤¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ÄɲäΥǥ£¥ì¥¯¥È¥ê¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</p>
+
+<p>·Ð¸³Ë­¤«¤Ê¥æ¡¼¥¶¡¼¤Ï¡¤¤¹¤Ç¤Ë¼«¤é¤Î¥·¥§¥ë¤Î¤¿¤á¤Ë½é´ü²½¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ¥Ñ¥¹¤òÀßÄꤷ¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¡£
+¤³¤Î¾ì¹ç¡¤¤¢¤Ê¤¿¤Ï´Ä¶­ÀßÄê¤Ç XDarwin ¤¬¤¢¤Ê¤¿¤Î¥Ñ¥¹¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+XDarwin ¤Ï¡¤¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤ÇºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤·¤Þ¤¹¡£
+¡Ê´Ä¶­ÀßÄê¤ÇÂå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë
+¥Ñ¥¹¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¤¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
+¤³¤ì¤Ï¡¤¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+
+<p>¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï <code>/usr/X11R6/man</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ <code>MANPATH</code> ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£</p>
+
+<h2><a NAME="prefs">´Ä¶­ÀßÄê</a></h2>
+<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë´Ä¶­ÀßÄê¥Ñ¥Í¥ë¤Ç¡¤¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
+¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
+°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p>
+
+<h3>°ìÈÌÀßÄê</h3>
+<ul>
+ <li><b>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
+ <li><b>X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë:</b> ɸ½àŪ¤Ê X Window System ¤Î¼ÂÁõ¤Ç¤Ï¡¤¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤Ï¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+ ¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤Ë Mac OS X ¤Î¥·¥¹¥Æ¥à´Ä¶­ÀßÄê¤È X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤¬°Û¤Ê¤ëÃͤòÀßÄꤷ¤¿¾ì¹ç¡¤¤³¤ì¤Ïº®Íð¤ò¾·¤­¤Þ¤¹¡£
+ ¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤È¤·¤Þ¤»¤ó¡£</li>
+ <li><b>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó:</b> <a HREF="#usage">»ÈÍÑË¡</a>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¥ª¥ó¤Î¾ì¹ç¡¤¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Âè 2 ¤Þ¤¿¤ÏÂè 3 ¤Î¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë»þ¤Ë¡¤ÁªÂò¤·¤¿½¤¾þ¥­¡¼¤òƱ»þ¤Ë²¡¤·¤Þ¤¹¡£</li>
+</ul>
+
+<h3>µ¯Æ°¥ª¥×¥·¥ç¥ó</h3>
+<ul>
+ <li><b>²èÌ̥⡼¥É:</b> ¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
+ <li><b>µ¯Æ°»þ¤Ë¥â¡¼¥ÉÁªÂò¥Ñ¥Í¥ë¤òɽ¼¨¤¹¤ë:</b> ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Îµ¯Æ°»þ¤Ë¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤òÁªÂò¤¹¤ë¥Ñ¥Í¥ë¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥ª¥Õ¤Î¾ì¹ç¡¤²èÌ̥⡼¥É¤Ç»ØÄꤷ¤¿¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£</li>
+ <li><b>X11 ¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ:</b> X11¤Ï¡¤°ì¤Ä¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤ÇÊÌ¡¹¤Î X ¥µ¡¼¥Ð¡¼¤¬´ÉÍý¤¹¤ëÊ£¿ô¤Î¥Ç¥£¥¹¥×¥ì¥¤¤¬Â¸ºß¤¹¤ë¤³¤È¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î X ¥µ¡¼¥Ð¡¼¤¬Æ±»þ¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»þ¡¤XDarwin ¤¬»ÈÍѤ¹¤ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+ <li><b>Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë:</b> XDarwin ¤Ï¡¤Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤½¤ì¤ÏÁ´¤Æ¤Î¥â¥Ë¥¿¤ò°ì¤Ä¤ÎÂ礭¤Ê²èÌ̤ΰìÉô¤È¤ß¤Ê¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç Xinerama ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¤¸½ºß XDarwin ¤Ï¤½¤ì̵¤·¤ÇÀµ¤·¤¯Ê£¿ô¤Î¥â¥Ë¥¿¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤â¤·¡¤¤¢¤Ê¤¿¤¬°ì¤Ä¤Î¥â¥Ë¥¿¤ò»È¤¦¤À¤±¤Ê¤é¤Ð¡¤Xinerama ¤Ï¼«Æ°Åª¤Ë̵¸ú¤È¤Ê¤ê¤Þ¤¹¡£</li>
+ <li><b>¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë:</b> ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ïµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¡¤X11 ¥­¡¼¥Þ¥Ã¥×¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Â¾¸À¸ì¤ËÂбþ¤·¤¿¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ï <code>/System/Library/Keyboards</code> ¤Ë¤¢¤ê¤Þ¤¹¡£¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤°ìÉô¤Î¥­¡¼¤¬¸ú¤«¤Ê¤¤Åù¤ÎÉÔ¶ñ¹ç¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li>
+ <li><b>ºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°:</b> XDarwin ¤¬ Finder¤«¤éµ¯Æ°¤¹¤ë»þ¡¤X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤È X ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¡Ê¾ÜºÙ¤Ï "<code>man xinit</code>" ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¡ËXDarwin ¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¤ËÄɲä·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï <code>/usr/X11R6/bin</code> ¤À¤±¤òÄɲä·¤Þ¤¹¡£Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï¡¤¥³¥í¥ó¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£¥æ¡¼¥¶¡¼¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤¿¤á¤Ë¡¤X ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥í¥°¥¤¥ó¥·¥§¥ë¤Çµ¯Æ°¤µ¤ì¤Þ¤¹¡£É¬ÍפǤ¢¤ì¤Ð¡¤Âå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+</ul>
+
+<h3>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó</h3>
+<ul>
+ <li><b>¥­¡¼ÀßÄê¥Ü¥¿¥ó:</b> X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ü¥¿¥ó¤ÎÁȤ߹ç¤ï¤»¤ò»ØÄꤷ¤Þ¤¹¡£
+ ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤Ç¤°Õ¤Î¿ô¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£</li>
+ <li><b>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀڤ괹¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£Mac OS X ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç Aqua ¤ËÌá¤Ã¤¿»þ¡¤¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li>
+ <li><b>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë:</b> XDarwin ¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë»þ¡¤¥¹¥×¥é¥Ã¥·¥å¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li>
+ <li><b>¿§¿¼ÅÙ:</b> ¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X11 ¥Ç¥£¥¹¥×¥ì¥¤¤¬ Aqua ¤È°Û¤Ê¤ë¿§¿¼ÅÙ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡ÖÊѹ¹¤Ê¤·¡×¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤XDarwin ¤Ï Aqua ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¿§¿¼ÅÙ¤ò»È¤¤¤Þ¤¹¡£¤³¤ì°Ê³°¤Ë 8¡¤15 ¤Þ¤¿¤Ï24 ¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+</ul>
+
+<h2>
+<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
+</h2>
+XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£
+»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£
+¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
+¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
+<H3>
+<A NAME="3"></A>
+X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
new file mode 100644
index 000000000..cbf13779f
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
@@ -0,0 +1,139 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5340\viewh4520\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 Contribuidores do XonX ao XFree86 4.2.99.x:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Fabr\'92cio Luis de Castro
+\f0\b \
+
+\f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\i0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Contribuidores do XonX ao XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Suporte para o Darwin x86\
+
+\f1\i0 Pablo Di Noto\
+
+\f2\i Localiza\'8d\'8bo para o Espanhol
+\f1\i0 \
+Paul Edens\
+
+\f2\i Localiza\'8d\'8bo para o Holand\'90s
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Localiza\'8d\'8bo para o Coreano
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Suporte para teclados Non-US
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i L\'92der de Projeto
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Localiza\'8d\'8bo para o Alem\'8bo
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Localiza\'8d\'8bo para o Sueco
+\f1\i0 \
+Greg Parker\
+
+\f2\i Suporte ao modo Compartilhado (Rootless)
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Localiza\'8d\'8bo para o Japon\'90s
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Agradecimentos Especiais:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Instalador
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Membros do Time XonX\
+Contribuindo com o XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Suporte ao Darwin x86\
+
+\f1\i0 Torrey T. Lyons\
+
+\f2\i L\'92der de Projeto
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Vers\'8bo Cocoa da interface XDarwin
+\f1\i0 \
+Greg Parker\
+
+\f2\i Implementa\'8d\'8bo Original
+\f1\i0
+\f2\i ao Quartz \
+
+\f1\i0 Christoph Pfisterer\
+
+\f2\i Bibliotecas Din\'89micas Compartilhadas
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Localiza\'8d\'8bo para o Japon\'90s
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Agradecimento Especial:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i \'eacone do XDarwin
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Hist\'97rico:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Suporte Original do XFree86 no Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i Suporte ao
+\f1\i0
+\f2\i XFree86 4.0 no Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
new file mode 100644
index 000000000..b3edbb41d
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..4b7736a12
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..37502eac6
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,216 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp,v 1.1 2002/01/25 06:46:46 torrey Exp $ --><html><body>
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+
+<head>
+<title>XFree86 para Mac OS X</title>
+</head>
+
+<center>
+
+ <h1>XFree86 para Darwin e Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>&Iacute;ndice</h2>
+<ol>
+ <li><A HREF="#notice">Notas importantes</A></li>
+ <li><A HREF="#usage">Uso</A></li>
+ <li><A HREF="#path">Ajustando seu Path</A></li>
+
+ <li><A HREF="#prefs">Prefer&ecirc;ncias do usu&aacute;rio</A></li>
+ <li><A HREF="#license">Licen&ccedil;a</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Notas importantes</a></h2>
+</center>
+<blockquote> #if PRE_RELEASE Essa &eacute; uma vers&atilde;o pr&eacute;-lancamento
+ do XFree86, e ela n&atilde;o &eacute; suportada de nenhuma forma. Bugs podem
+ ser reportados e corre&ccedil;&otilde;es podem ser enviadas para <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina
+ do projeto XonX</A> no SourceForge. Antes de informar bugs em vers&otilde;es
+ pr&eacute;-lancamento, por favor verifique a þltima vers&atilde;o em <A HREF="http://sourceforge.net/projects/xonx/">XonX</A>
+ or no <A HREF="http://www.XFree86.Org/cvs">Reposit&oacute;rio CVS do XFree86</A>.
+ #else Se o servidor &eacute; mais velho que 6-12 semanas, ou seu hardware &eacute;
+ mais novo que a data acima, procure por uma nova vers&atilde;o antes de informar
+ problemas. Bugs podem ser reportados e corre&ccedil;&otilde;es podem ser enviadas
+ para a <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina do projeto
+ XonX</A> na SourceForge. #endif </blockquote>
+<blockquote> Este software &eacute; distribu&iacute;do sob os termos da <a href="#license">licen&ccedil;a
+ MIT X11 / X Consortium</a> e &eacute; provido, sem nenhuma garantia. Por favor
+ leia a <a href="#license">Licen&ccedil;a</a> antes de come&ccedil;ar a usar
+ o programa.</blockquote>
+
+<h2><a NAME="usage">Uso</a></h2>
+<p>O XFree86 &eacute; uma aplica&ccedil;&atilde;o &quot;open-source&quot; livremente
+ redistribu&iacute;da do <a HREF
+="http://www.x.org/">Sistema X Window</a> produzido pelo <a HREF="http://www.XFree86.Org/">XFree86
+ Project, Inc.</a> O servidor X window para o Darwin e Mac OS X provido pelo
+ XFree86 &eacute; chamado XDarwin. XDarwin roda sobre Mac OS X no modo Tela Cheia
+ ou no modo Compartilhado.</p>
+<p>No modo Tela Cheia, quando o sistema X window est&aacute; ativo, ele ocupa
+ a tela toda. Voc&ecirc; pode voltar ao desktop do Mac OS X clicando Command-Option-A.
+ Essa combina&ccedil;&atilde;o de teclas pode ser mudada nas prefer&ecirc;ncias.
+ Pelo desktop Mac OS X, clique no &iacute;cone XDarwin no Dock para voltar ao
+ sistema X window. (Voc&ecirc; pode mudar esse comportamento nas prefer&ecirc;ncias
+ da&iacute; voc&ecirc; dever&aacute; clicar no &iacute;cone XDarwin na janela
+ flutuante que aparecer&aacute;.)</p>
+<p>No modo Compartilhado, o sistema X window e Aqua dividem a mesma tela. A janela
+ raiz da tela X11 est&aacute; do tamanho da tela (monitor) e cont&eacute;m todas
+ as outras janelas. A janela raiz do X11 no modo compartilhado n&atilde;o &eacute;
+ mostrada pois o Aqua controla o fundo de tela.</p>
+<h3>Emula&ccedil;&atilde;o de Mouse Multi-Bot&otilde;es</h3>
+<p>Muitas aplica&ccedil;&otilde;es X11 insistem em usar um mouse de 3 bot&otilde;es.
+ Voc&ecirc; pode emular um mouse de 3 bot&otilde;es com um simples bot&atilde;o,
+ mantendo pressionando teclas modificadoras enquanto voc&ecirc; clica no bot&atilde;o
+ do mouse. Isto &eacute; controlado pela configura&ccedil;&atilde;o da &quot;Emula&ccedil;&atilde;o
+ de Mouse Multi-Bot&otilde;es&quot; da prefer&ecirc;ncia &quot;Geral&quot;. Por
+ padr&atilde;o, a emula&ccedil;&atilde;o est&aacute; habilitada e mantendo pressionada
+ a tecla Command e clicando no bot&atilde;o do mouse ele simular&aacute; o clique
+ no segundo bot&atilde;o do mouse. Mantendo pressionada a tecla Option e clicando
+ no bot&atilde;o do mouse ele simular&aacute; o terceiro bot&atilde;o. Voc&ecirc;
+ pode mudar a combina&ccedil;&atilde;o de teclas modificadoras para emular os
+ bot&otilde;es dois e tr&ecirc;s nas prefer&ecirc;ncias. Nota, se a tecla modificadora
+ foi mapeada para alguma outra tecla no xmodmap, voc&ecirc; ainda ter&aacute;
+ que usar a tecla atual especificada nas prefer&ecirc;ncias para a emula&ccedil;&atilde;o
+ do mouse multi-bot&otilde;es.</p>
+<h2><a NAME="path">Ajustando seu Path</a></h2>
+<p>Seu path &eacute; a lista de diret&oacute;rios a serem procurados por arquivos
+ execut&aacute;veis. O comando X11 est&aacute; localizado em <code>/usr/X11R6/bin</code>,
+ que precisa ser adicionado ao seu path. XDarwin faz isso para voc&ecirc; por
+ padr&atilde;o e pode-se tamb&eacute;m adicionar diret&oacute;rios onde voc&ecirc;
+ instalou aplica&ccedil;&otilde;es de linha de comando.</p>
+<p>Usu&aacute;rios experientes j&aacute; ter&atilde;o configurado corretamente
+ seu path usando arquivos de inicializa&ccedil;&atilde;o de seu shell. Neste
+ caso, voc&ecirc; pode informar o XDarwin para n&atilde;o modificar seu path
+ nas prefer&ecirc;ncias. O XDarwin inicia o cliente inicial X11 no shell padr&atilde;o
+ do usu&aacute;rio corrente. (Um shell alternativo pode ser tamb&eacute;m expecificado
+ nas prefer&ecirc;ncias.) O modo para ajustar o path depende do shell que voc&ecirc;
+ est&aacute; usando. Isto &eacute; descrito na man page do seu shell.</p>
+<p>Voc&ecirc; pode tamb&eacute;m querer adicionar as man pages do XFree86 para
+ a lista de p&aacute;ginas a serem procuradas quando voc&ecirc; est&aacute; procurando
+ por documenta&ccedil;&atilde;o. As man pages do X11 est&atilde;o localizadas
+ em <code>/usr/X11R6/man</code> e a vari&aacute;vel de ambiente <code>MANPATH</code>
+ cont&eacute;m a lista de diret&oacute;rios a buscar.</p>
+<h2><a NAME="prefs">Prefer&ecirc;ncias do Usu&aacute;rio</a></h2>
+<p>V&aacute;rias op&ccedil;&otilde;es podem ser ajustadas nas prefer&ecirc;ncias
+ do usu&aacute;rio, acess&iacute;vel pelo item &quot;Prefer&ecirc;ncias...&quot;
+ no menu &quot;XDarwin&quot;. As op&ccedil;&otilde;es listadas como op&ccedil;&otilde;es
+ de inicializa&ccedil;&atilde;o, n&atilde;o ter&atilde;o efeito at&eacute; voc&ecirc;
+ reiniciar o XDarwin. Todas as outras op&ccedil;&otilde;es ter&atilde;o efeito
+ imediatamente. V&aacute;rias das op&ccedil;&otilde;es est&atilde;o descritas
+ abaixo:</p>
+<h3>Geral</h3>
+<ul>
+ <li><b>Usar o Beep do Sistema para o X11: </b>Quando habilitado som de alerta
+ padr&atilde;o do Mac OS X ser&aacute; usado como alerta no X11. Quando desabilitado
+ (padr&atilde;o) um tom simples ser&aacute; usado.</li>
+ <li><b>Permitir o X11 mudar a acelera&ccedil;&atilde;o do mouse: </b>Por implementa&ccedil;&atilde;o
+ padr&atilde;o no sistema X window, o gerenciador de janelas pode mudar a acelera&ccedil;&atilde;o
+ do mouse. Isso pode gerar uma confus&atilde;o pois a acelera&ccedil;&atilde;o
+ do mouse pode ser ajustada diferentemente nas prefer&ecirc;ncias do Mac OS
+ X e nas prefer&ecirc;ncias do X window. Por padr&atilde;o, o X11 n&atilde;o
+ est&aacute; habilitado a mudar a acelera&ccedil;&atilde;o do mouse para evitar
+ este problema.</li>
+ <li><b>Emula&ccedil;&atilde;o de Mouse de Multi-Bot&otilde;es: </b>Esta op&ccedil;&atilde;o
+ est&aacute; escrita acima em <a href="#usage">Uso</a>. Quando a emula&ccedil;&atilde;o
+ est&aacute; habilitada as teclas modificadoras selecionadas tem que estar
+ pressionadas quando o bot&atilde;o do mouse for pressionado, para emular o
+ segundo e terceiro bot&otilde;es.</li>
+</ul>
+<h3>Inicial</h3>
+<ul>
+ <li><b>Modo Padr&atilde;o: </b>Se o usu&aacute;rio n&atilde;o indicar qual modo
+ de exibi&ccedil;&atilde;o quer usar (Tela Cheia ou Compartilhado) o modo especificado
+ aqui ser&aacute; usado .</li>
+ <li><b>Mostrar o painel de escolha na inicializa&ccedil;&atilde;o: </b> Por
+ padr&atilde;o, uma painel &eacute; mostrado quando o XDarwin &eacute;
+ iniciado para permitir que o usu&aacute;rio escolha ente o modo tela cheia
+ ou modo compartilhado. Se esta op&ccedil;&atilde;o estiver desligada, o modo
+ padr&atilde;o ser&aacute; inicializado automaticamente.</li>
+ <li><b>N&uacute;mero do Monitor X11: </b>O X11 permite ser administrado em multiplos
+ monitores por servidores X separados num mesmo computador. O usu&aacute;rio
+ pode indicar o n&uacute;mero do monitor para o XDarwin usar se mais de um
+ servidor X se estiver rodando simultaneamente.</li>
+ <li><b>Habilitar suporte a m&uacute;ltiplos monitores pelo Xinerama: </b>o XDarwin
+ suporta m&uacute;ltiplos monitores com o Xinerama, que trata todos os monitores
+ como parte de uma grande e retangular tela. Voc&ecirc; pode desabilitar o
+ Xinerama com est&aacute; op&ccedil;&atilde;o, mas normalmente o XDarwin n&atilde;o
+ controla m&uacute;ltiplos monitores corretamente sem est&aacute; op&ccedil;&atilde;o.
+ Se voc&ecirc; s&oacute; tiver um monotor, Xinerama &eacute; automaticamente
+ desabilitado. </li>
+ <li><b>Arquivo de Mapa de Teclado: </b> O mapa de teclado &eacute; lido na inicializa&ccedil;&atilde;o
+ e traduzido para um mapa de teclado X11. Arquivos de mapa de teclado, est&atilde;o
+ dispon&iacute;veis numa grande variedade de l&iacute;nguas e s&atilde;o encontradas
+ em <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Iniciando Clientes X11 primeiro: </b>Quando o XDrawin &eacute; inicializado
+ pelo Finder, ele ir&aacute; rodar o <code>xinit</code> para abrir o controlador
+ X window e outros clientes X. (Veja o manual "<code>man xinit</code>" para
+ mais informa&ccedil;&otilde;es.) Antes do XDarwin rodar o <code>xinit</code>
+ ele ir&aacute; adicionar espec&iacute;ficos diret&oacute;rios a seu path.
+ Por padr&atilde;o somente o <code>/usr/X11R6/bin</code> &eacute; adicionado.
+ separado por um ponto-e-v&iacute;rgula. Os clientes X s&atilde;o inicializados
+ no shell padr&atilde;o do usu&aacute;rio e os arquivos de inicializa&ccedil;&atilde;o
+ do shell ser&atilde;o lidos. Se desejado, um shell alternativo pode ser especificado.</li>
+</ul>
+<h3>Tela Cheia</h3>
+<ul>
+ <li><b>Bot&atilde;o de Combina&ccedil;&atilde;o de Teclas: </b> Clique no bot&atilde;o
+ e pressione qualquer quantidade de teclas modificadoras seguidas por uma tecla
+ padr&atilde;o para modificar a combina&ccedil;&atilde;o quando se quer mudar
+ entre o Aqua e X11.</li>
+ <li><b>Clique no &Iacute;cone no Dock para mudar para o X11: </b>Habilitando
+ esta op&ccedil;&atilde;o voc&ecirc; ir&aacute; ativar a mudan&ccedil;a para
+ o X11 clicando no &iacute;cone do XDarwin no Dock. Em algumas vers&otilde;es
+ do Mac OS X, mudando pelo clique no Dock pode causar o desaparecimento do
+ cursor quando retornar ao Aqua.</li>
+ <li><b>Mostrar a Ajuda na inicializa&ccedil;&atilde;o: </b>Isto ir&aacute; mostrar
+ uma tela introdut&oacute;ria quando o XDarwin for inicializado no modo Tela
+ Cheia. </li>
+ <li><b>Profundidade de Cores em bits: </b> No modo Tela Cheia, a tela do X11
+ pode usar uma profundiadde de cor diferente da usada no Aqua. Se a op&ccedil;&atilde;o
+ &quot;Atual&quot; est&aacute; especificada, a profundidade usada pelo Aqua
+ quando o XDarwin iniciar ser&aacute; a mesma. Al&eacute;m das op&ccedil;&otilde;es
+ 8, 15 ou 24 bits que podem ser especificadas.</li>
+</ul>
+
+<h2><a NAME="license">Licen&ccedil;a</a></h2>
+<p>O projeto XFree86 &eacute; designado a prover e a ser livremente redistribu&iacute;do
+ as vers&otilde;es bin&aacute;rias e souce (c&oacute;digo-fonte). A licen&ccedil;a
+ principal n&oacute;s usamos uma baseada na licen&ccedil;a tradicional MIT X11
+ / X Consortium, que n&atilde;o imp&otilde;e nenhuma condi&ccedil;&atilde;o sobre
+ modifica&ccedil;&otilde;es ou redistribui&ccedil;&atilde;o do c&oacute;digo-fonte
+ ou dos bin&aacute;rios desde que o copyright/licen&ccedil;a sejam mantidos intactos.
+ Para mais informa&ccedil;&otilde;es e not&iacute;cias adicionais de copyright/licensing
+ em algumas se&ccedil;&atilde;o do c&oacute;digo, por favor visite a <a href="http://www.xfree86.org/legal/licence.html">p&aacute;gina
+ de licen&ccedil;as do XFree86</a>.</p>
+<H3><A NAME="3"></A>Licen&ccedil;a do X Consortium</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permiss&otilde;es s&atilde;o em virtude garantidas, livre de mudan&ccedil;as,
+ para qualquer pessoa que possua uma c&oacute;pia deste software e aos arquivos
+ de documenta&ccedil;&atilde;o associada (o &quot;Software&quot;), para lidar
+ com o software sem restri&ccedil;&otilde;es, incluindo limita&ccedil;&otilde;es
+ dos direitos de uso, c&oacute;pia, modifica&ccedil;&atilde;o, inclus&atilde;o,
+ publica&ccedil;&atilde;o, distribui&ccedil;&atilde;o, sub licen&ccedil;a, e/ou
+ venda de c&oacute;pias deste Software, e permitir pessoas to whom o Software
+ &eacute; fornecido para ser desta forma, verifique as seguintes condi&ccedil;&otilde;es:</p>
+<p>O nota de copyright abaixo e a permiss&atilde;o dever&atilde;o ser inclu&iacute;das
+ em todas as c&oacute;pias ou substanciais por&ccedil;&otilde;es do Software.</p>
+<p>O SOFTWARE 'E PROVIDO &quot;COMO TAL&quot;, SEM GARANTIAS DE NENHUM TIPO, EXPLICITA
+ OU IMPLICITA, INCLUINDO MAS N&Atilde;O LIMITADO NOS AVISOS DE COM&Eacute;RCIO,
+ TAMANHO OU PARA PROPOSTAS PARTICULARES E N&Atilde;O INFRA&Ccedil;&Atilde;O.
+ EM NENHUM ACONTECIMENTO O X CONSORTIUM SER&Aacute; RESPONSAV&Eacute;L POR NENHUMA
+ RECLAMA&Ccedil;&Atilde;O, DANOS OU OUTRAS RESPONSABILIDADES, SE NUMA A&Ccedil;&Atilde;O
+ DE CONTRATO, OU OUTRA COISA, SURGINDO DE, FORA DE OU EM CONEX&Atilde;O COM O
+ SOFTWARE OU O USO OU OUTRO MODO DE LIDAR COM O SOFTWARE.</p>
+<p>Exceto o contido nesta nota, o nome do X Consortium n&atilde;o pode ser usado
+ em propagandas ou outra forma de promo&ccedil;&atilde;o de vendas, uso ou outro
+ modo de lidar com este Software sem ter recebido uma autoriza&ccedil;&atilde;o
+ escrita pelo X Consortium.</p>
+<p>O Sistema X Window &eacute; marca registrada do X Consortium, Inc.</p>
+</body>
+</html>
+
diff --git a/hw/darwin/bundle/Spanish.lproj/Credits.rtf b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
new file mode 100644
index 000000000..06eb0e5fb
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..83647d675
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..3e0710a2c
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,116 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/30 03:52:27 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 para Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 en Darwin y Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Fecha de release: XF86_REL_DATE
+</center>
+<h2>Contenido</h2>
+<ol>
+ <li><A HREF="#notice">Aviso Importante</A></li>
+ <li><A HREF="#usage">Modo de uso</A></li>
+ <li><A HREF="#path">Configurando su Path</A></li>
+ <li><A HREF="#prefs">Preferencias del Usuario</A></li>
+ <li><A HREF="#license">Licencia</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Aviso Importante</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Esta es una versi&oacuten pre-release de XFree86, y no tiene ning&uacuten soporte. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge. Antes de reportar errores en versiones pre-release, por favor verifique la ultima versi&oacuten en <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> o bien en el <A HREF="http://www.XFree86.Org/cvs">repositorio CVS de XFree86</A>.
+#else
+Si el server el m&aacutes antiguo que 6 a 12 meses, o si su hardware es posterior a la fecha indicada m&aacutes arriba, por favor verifique la &uacuteltima versi&oacuten antes de reportar problemas. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Este software es distribuido bajo los t&eacuterminos de la <A HREF="#license">Licencia MIT X11 / X Consortium</A> y es provisto sin garant&iacutea alguna y en el estado en que se encuentra. Por favor lea la <A HREF="#license">Licencia</A> antes de utilizarlo.</blockquote>
+
+<h2><a NAME="usage">Modo de uso</a></h2>
+<p>XFree86 es una implementaci&oacuten open-source de distribuci&oacuten libre del <a HREF
+="http://www.x.org/">X Window System</a> producido por <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> El window server para Darwin y Mac OS X provisto por XFree86 se llama XDarwin. XDarwin funciona en Mac OS X en modo pantalla completa o en modo rootless (integrado al escritorio).</p>
+<p>En modo pantalla completa, el X window system toma control total de la pantalla mientras esta activo. Presionando Command-Option-A puede regresar al Escritorio de Mac OS X. Esta combinaci&oacuten de teclas puede cambiarse en las Preferencias de Usuario. Desde el Escritorio de Mac OS X, haga click en &iacutecono de XDarwin en el Dock para volver al X window system. (Puede cambiar esta comportamiento en las Preferencias de Usuario y configurar que XDarwin vuelva al X window system haciendo click en la ventana flotante con el logo X.)</p>
+<p>En modo rootless, el X window system comparte la pantalla con Aqua. La ventana root de X11 es del tama&ntildeo de la pantalla y contiene a todas las dem&aacutes ventanas. La ventana root de X11 no se muestra en este modo, ya que Aqua maneja el fondo de pantalla.</p>
+<h3>Emulaci&oacuten de mouse multi-bot&oacuten</h3>
+<p>Muchas aplicaciones X11 requieren del uso de un mouse de 3 botones. Es posible emular un mouse de 3 botones con un mouse de solo un bot&oacuten presionando teclas modificadoras mientras hace click. Esto es controlado en de la seccion "Emulaci&oacuten mouse" dentro de la secci&oacuten "General" de las Preferencias del Usuario. Por defecto, la emulaci&oacuten est&aacute activa y utiliza la tecla Command para simular el 2do bot&oacuten y la tecla Option para simlar el 3er bot&oacuten. La conbinaci&oacuten para simular el 2do y 3er bot&oacuten pueden ser modificada por cualquier combinaci&oacuten de teclas modificadoras dentro de las Preferencias del Usuario. Tenga en cuenta que aunque las teclas modificadoras hayan sido mapeadas a otras teclas con xmodmap, las teclas configuradas en las Preferencias del Usuario seguir&aacuten siendo las utilizadas por la emulaci&oacuten de mouse multi-bot&oacuten.</p>
+
+<h2><a NAME="path">Configurando su Path</a></h2>
+<p>El path es la lista de directorios donde se buscar&aacuten los comandos ejecutables. Los comandos de X11 se encuentran en <code>/usr/X11R6/bin</code>, y &eacuteste necesita estar dentro de su path. XDarwin hace &eacutesto autom&aacuteticamente por defecto, y puede adem&aacutes agregar directorios adicionales donde tenga otros comandos de l&iacutenea.</p>
+<p>Usuarios experimentados pueden tener su path correctamente configurado mediante los archivos de inicio de su interprete de comandos. En este caso, puede informarle a XDarwin en las Preferencias de Usuario para que no modifique su path. XDarwin arrancar&aacute los clientes X11 iniciales usando el int&eacuterprete de comandos del usuario, seg&uacuten su configuraci&oacuten de login. Un int&eacuterprete de comandos alternativo puede ser especificado en las Preferencias del Usuario. La manera de configurar el path de su int&eacuterprete de comandos depende de cual est&aacute usando, y es generalmente descripta en las p&aacuteginas man del mismo.</p>
+<p>Adem&aacutes, Ud. puede agregar las p&aacuteginas man de XFree86 a la lista de p&aacuteginas que son consultadas. Estas est&aacuten ubicadas en <code>/usr/X11R6/man</code> y <code>MANPATH</code> es la variable de entorno que contiene los directorios que son consultados.</p>
+
+<h2><a NAME="prefs">Preferencias del Usuario</a></h2>
+<p>Ciertas opciones pueden definirse dentro de "Preferencias...", en el men&uacute de XDarwin. Las opciones dentro de de "Inicio" no surtir&aacuten efecto hasta que la aplicaci&oacuten se reinicie. Las restantes opciones surten efecto inmediatamente. Las diferentes opciones se describen a continuaci&oacuten:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Usar beep del sistema en X11:</b> Cuando esta opci&oacuten est&aacute activa, el sonido de alerta est&aacutendar de Mac OS X se usar&aacute como alerta de X11. Cuando est&aacute desactivada, un simple tono es utilizado (esta es la opci&oacuten por defecto).</li>
+ <li><b>Permitir que X11 cambie la aceleraci&oacuten del mouse:</b> En una implementaci&oacuten est&aacutendard de X11, el window manager puede cambiar la aceleraci&oacuten del mouse. Esto puede llevar a una gran confusi&oacuten si la aceleraci&oacuten es diferente en XDarwin y en Mac OS X. Por defecto, no se le permite a X11 alterar la aceleraci&oacuten para evitar este inconveniente.</li>
+ <li><b>Emulaci&oacuten de mouse multi-bot&oacuten:</b> Esta opci&oacuten es descripta m&aacutes arriba bajo <a HREF="#usage">Modo de Uso</a>. Cuando esta emulaci&oacuten est&aacute activa los modificadores seleccionados deben ser presionados cuando se hace click para emular el bot&oacuten 2 o el bot&oacuten 3.</li>
+</ul>
+<h3>Inicio</h3>
+<ul>
+ <li><b>Modo inicial:</b> Si el usuario no indica si desea utilizar la Pantalla Completa o el modo Rootless, el modo especificado aqu&iacute ser&aacute el usado.</li>
+ <li><b>Mostrar panel de selecci&oacuten al inicio:</b> Por defecto, un di&aacutelogo permite al usuario elegir entre Pantalla Completa o Rootless al inicio. Si esta opci&oacuten esta desactivada, XDarwin arrancar&aacute utilizando el modo por defecto sin consultar al usuario.</li>
+ <li><b>N&uacutemero de display X11:</b> X11 permite que existan m&uacuteltiples pantallas manejadas por servidores X11 separados funcionando en una misma computadora. El usuario puede especificar aqui un n&uacutemero entero para indicar el n&uacutemero de pantalla (display) que XDarwin utilizar&aacute si m&aacutes de un servidor X funciona en forma simult&aacutenea.</li>
+ <li><b>Habilitar soporte Xinerama para m&uacuteltipes monitores:</b> XDarwin suporta m&uacuteltiple monitores con Xinerama, que maneja todos los monitores como si fueran parte de una gran pantalla rectangular. Puede deshabilitar Xinerama con esta opci&oacuten, pero XDarwin no maneja m&uacuteltiples monitores en forma correcta sin esta opci&oacuten habilitada. Si tiene solo un monitor, Xinerama es autom&aacuteticamente deshabilitado.</li>
+ <li><b>Archivo de mapa de teclado:</b> Un archivo de mapa de teclas es le&iacutedo al inicio y es traducido a un keymap X11 (un archivo est&aacutendard de X11 para especificar la funci&oacuten de cada tecla). Estos archivos, disponibles para una amplia variedad de lenguajes, pueden encontrarse en <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Al iniciar clientes X11:</b> Cuando XDarwin arranca desde el Finder, &eacuteste ejecutar&aacute <code>xinit</code> para a su vez arrancar el window manager y otros clientes. (Vea en "<code>man xinit</code>" para mayor informaci&oacuten). Antes de ejecutar <code>xinit</code> XDarwin agregar&aacute los directorios especificados al path del usuario. Por defecto, solo <code>/usr/X11R6/bin</code> es agregado. Otros directorios adicionales puede agregarse separados por dos puntos (:). Los clientes X son ejecutados con el int&eacuterprete de comandos del usuario, por lo que los archivos de inicio de &eacuteste son le&iacutedos. Si se desea, un int&eacuterprete de comandos diferente puede ser especificado.</li>
+</ul>
+<h3>Pantalla Completa</h3>
+<ul>
+ <li><b>Bot&oacuten para definir combinaci&oacuten de teclas:</b> Haga click en este bot&oacuten y luego presione cualquier combinaci&oacuten de modificadores seguidos de una tecla convencional para definir que combinaci&oacuten usar&aacute para intercambiar entre X11 y Aqua.</li>
+ <li><b>Click en el &iacutecono del Dock cambia a X11:</b> Habilite esta opci&oacuten para volver a X11 al hacer click en &iacutecono de XDarwin en el Dock. En algunas versiones de Mac OS X, al volver haciendo click en el Dock puede causar al desaparci&oacuten del cursor al volver a Aqua.</li>
+ <li><b>Mostrar ayuda al inicio:</b> Esta opci&oacuten habilitada har&aacute que una pantalla inicial de introducci&oacuten aparezca cuando XDarwin es arrancado en modo Pantalla Completa.</li>
+ <li><b>Profundidad de color (bits):</b> En modo Pantalla Completa, el display X11 puede utilizar una profundidad de color diferente de la utilizada por Aqua. Si se especifica "Actual", la misma profundidad de color que Aqua utiliza ser&aacute adoptada por X11. Al contrario, puede especificar 8, 15, o 24 bits.</li>
+</ul>
+
+<h2><a NAME="license">Licencia</a></h2>
+El XFree86 Project esta comprometido en proveer versiones binarias y en c&oacutedigo fuente de distribuci&oacuten libre. La licencia principal que utilizamos es una basada en la Licencia MIT X11 tradicional, que no impone condiciones a la modificaci&oacuten o redistribuci&oacuten del c&oacutedigo fuente o de archivos binarios m&aacutes all&aacute de requerir que los mensajes de Licencia y Copyright se mantengan intactos. Para mayor informaci&oacuten y para mensajes adicionales de Licencia y Copyright que cubren algunas secciones del c&oacutedigo fuente, por favor consulte la <A HREF="http://www.xfree86.org/legal/licence.html">P&aacutegina de Licencia de XFree86</A>.
+<H3><A NAME="3"></A>Licencia del X Consortium</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Se otorga aqui permiso, libre de costo, a toda persona que obtenga una copia de este Software y los archivos de documentaci&oacuten asociados (el "Software"),
+para utilizar el Software sin restricciones, incluyendo sin l&iacutemites los derechos de usar, copiar, modificar, integrar con otros productos, publicar, distribuir, sub-licenciar y/o comercializar copias del Software, y de permitir a las personas que lo reciben para hacer lo propio, sujeto a las siguientes condiciones:</p>
+<p>El mensaje de Copyright indicado m&aacutes arriba y este permiso ser&aacute inclu&iacutedo en todas las copias o porciones sustanciales del Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Excepto lo indicado en este mensaje, el nombre del X Consortium no ser&aacute utilizado en propaganda o como medio de promoci&oacuten para la venta, utilizaci&oacuten u otros manejos de este Software sin previa autorizaci&oacuten escrita del X Consortium.</p>
+<p>X Window System es una marca registrada de X Consortium, Inc.</p>
+<H3><A NAME="3"></A>X Consortium License (English)</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Swedish.lproj/Credits.rtf b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
new file mode 100644
index 000000000..7ade67d55
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..230436b31
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..ee099d1a0
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,108 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/07 22:43:27 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 f&ouml;r Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 f&ouml;r Darwin och Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ F&auml;rdigst&auml;llt: XF86_REL_DATE
+</center>
+<h2>Inneh&aring;ll</h2>
+<ol>
+ <li><A HREF="#notice">Viktigt!</A></li>
+ <li><A HREF="#usage">Anv&auml;ndande</A></li>
+ <li><A HREF="#path">Att st&auml;lla in sin s&ouml;kv&auml;g</A></li>
+ <li><A HREF="#prefs">Inst&auml;llningar</A></li>
+ <li><A HREF="#license">Licens</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Viktigt!</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Detta &auml;r en testversion av XFree86, och du kan inte garranteras n&aring;gon som helst support f&ouml;r den. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge. Innan du rapporterar buggar i testversioner, var god pr&ouml;va den senaste versionen fr&aring;n <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> eller i <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS-arkiv</A>.
+#else
+Om servern &auml;r &auml;ldre &auml;n 6-12 m&aring;nader, eller om din h&aring;rdvara &auml;r nyare &auml;n datumet ovan, leta efter en nyare version innan du rapporterar fel. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Denna programvara distrubueras i enlighet med <A HREF="#license">MIT X11 / X Consortium License</A> och tilhandh&aring;lls som den &auml;r, helt utan garantier. Var god l&auml;s igenom <A HREF="#license">licensdokumentet (engelska)</A> innan du anv&auml;nder programmet.</blockquote>
+
+<h2><a NAME="usage">Anv&auml;ndande</a></h2>
+<p>XFree86 &auml;r en fritt spridd implemenation av <a HREF
+="http://www.x.org/">X Window-systemet</a> producerad av <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc</a>, med &ouml;ppen k&auml;llkod. Den X Window-server f&ouml;r Darwin och Mac OS X som tillhandah&aring;lls av XFree86 kallas XDarwin. XDarwin kan k&ouml;ras p&aring; Mac OS X i fullsk&auml;rmsl&auml;ge eller rotl&ouml;st l&auml;ge.</p>
+<p>I fullsk&auml;rmsl&auml;ge kommer X window-systemet att ta &ouml;ver hela sk&auml;rmen n&auml;r det &auml;r aktivt. Du kan byta tillbaka till Mac OS Xs skrivbord genom att trycka Kommando-Alt-A. Denna tangentkombination kan &auml;ndra i inst&auml;llningarna. N&auml;r du &auml;r p&aring; Mac OS Xs skrivbord kan du klicka p&aring; XDarwin-ikonen i dockan f&ouml;r att byta tillbaka till X Window-systemet. (Du kan f&ouml;r&auml;ndra detta beteende i inst&auml;llningarna s&aring; att du ist&auml;llet m&aring;ste klicka i det fltande bytesf&ouml;nstret ist&auml;llet.)</p>
+<p>I rotl&ouml;stl&auml;ge delar X11 och Aqua p&aring; din sk&auml;rm. Rotf&ouml;nstret p&aring; X11-sk&auml;rmen &auml;r av samma storlek som hela sk&auml;rmen och inneh&aring;ller alla andra f&ouml;nster - det fungerar som bakgrund. I rotl&ouml;stl&auml;ge visas inte detta rotf&ouml;nster, eftersom Aqua hanterar skrvbordbakgrunden.</p>
+
+<h3>Emulering av flerknapparsmus</h3>
+<p>M&aring;nga X11-program utnyttjar en treknapparsmus. Du kan emulera en treknapparsmus med en knapp genom att h&aring;lla ner olika knappar p&aring; tangentbordet medan du klickar med musens enda knapp. Denna funktion styrs av inst&auml;llningarna i "Emulera flerknapparsmus" under fliken "Diverse" i inst&auml;llningarna. Grundinst&auml;llningen &auml;r att emulationen &auml;r aktiv och att ett kommando-klick (H&aring;ll ner kommando och klicka) simulerar den andra musknappen. Den tredje musknappen f&aring;s genom att h&aring;lla ner alt och klicka. Du kan &auml;ndra detta till n&aring;gon annan kombination av de fem tangenterna kommando, alt, kontrol, skift och fn (Powerbook/iBook). Notera att om dessa knappar har flyttats med hj&auml;lp av kommandot xmodmap kommer denna f&ouml;r&auml;ndring inte att p&aring;verka vilka knappar som anv&auml;nds vid flerknappsemulationen.</p>
+
+<h2><a NAME="path">Att st&auml;lla in sin s&ouml;kv&auml;g</a></h2>
+<p>Din s&ouml;kv&auml;g &auml;r en lista av kataloger som s&ouml;ks igenom n&auml;r terminalen letar efter kommandon att exekvera. Kommandon som h&ouml;r till X11 ligger i <code>/usr/X11R6/bin</code>, en katalog som inte ligger i din s&ouml;kv&auml;g fr&aring;n b&ouml;rjan. XDarwin l&auml;gger till denna katalog &aring;t dig, och du kan ocks&aring; l&auml;gga till ytterligare kataloger i vilka du lagt program som skall k&ouml;ras fr&aring;n kommandoraden.</p>
+<p>Mer erfarna anv&auml;ndare har antagligen redan st&auml;llt in sin s&ouml;kv&auml;g i skalets inst&auml;llningsfiler. Om detta g&auml;ller dig kan st&auml;lla in XDarwin s&aring; att din s&ouml;kv&auml;g inte modifieras. XDarwin startar de f&ouml;rsta X11-klienterna i anv&auml;ndarens inloggningsskal (Vill du anv&auml;nda ett alternativt skall, kan du specificera detta i inst&auml;llningarna). Hur du st&auml;ller in din s&ouml;kv&auml;g beror p&aring; vilket skal du anv&auml;nder. Exakt hur beskrivs i skalets man-sidor.</p>
+
+<p>Ut&ouml;ver detta kan du ocks&aring; vilja l&auml;gga till XFree86s man-sidor (dokumentation) till listan &auml;ver sidor som som skall s&ouml;kas n&auml;r du vill l&auml;sa efter dokumentationen. X11s man-sidor ligger i <code>/usr/X11R6/man</code> och listan &auml;ver kataloger att s&ouml;ka best&auml;mms av variabeln<code>MANPATH</code>.</p>
+
+<h2><a NAME="prefs">Inst&auml;llningar</a></h2>
+<p>I inst&auml;llningarna finns ett antal alternativ d&auml;r du kan p&aring;verka hur XDarwin beter sig i vissa fall. Inst&auml;llningarna kommer du till genom att v&auml;lja "Inst&auml;llningar..." i menyn "XDarwin". De alternativ som finns under fliken "Starta" tr&auml;der inte i kraft f&ouml;rr&auml;n du startat om programmet. Alla andra alternativ tr&auml;der i kraft omedelbart. De olika alternativen beskrivs nedan:</p>
+<h3>Diverse</h3>
+<ul>
+ <li><b>Anv&auml;nd Mac OS varningsljud i X11:</b> N&auml;r detta alternativ &auml;r valt anv&auml;nds Mac OS vanliga varningsljud &auml;r X11s varningsljud (bell). N&auml;r detta alternativ inte &auml;r valt (f&ouml;rvalt) anv&auml;nds en vanlig ton.</li>
+ <li><b>Till&aring;t X11 att &auml;ndra musens acceleration:</b> I ett vanligt X11-system kan f&ouml;nsterhanteraren &auml;ndra musens acceleration. Detta kan vara f&ouml;rvirrande eftersom musens acceleration kan vara olika i Mac OS Xs System Preferences och i f&ouml;nsterhanteraren i X11. F&ouml;rvalet &auml;r att X11 inte kan &auml;ndra musens acceleration f&ouml;r att p&aring; detta s&auml;tt undvika detta problem.</li>
+ <li><b>Emulera flerknapparsmus:</b> Detta beskrivs ovan under <a HREF="#usage">Anv&auml;ndande</a>. N&auml;r emulationen &auml;r aktiv m&aring;ste du h&aring;lla ner de valda knapparna f&ouml;r att emulera en andra eller tredje musknapp.</li>
+</ul>
+<h3>Starta</h3>
+<ul>
+ <li><b>F&ouml;rvalt l&auml;ge:</b> Om anv&auml;ndaren inte p&aring; annat s&auml;tt v&auml;ljer vilket l&auml;ge som skall anv&auml;ndas kommer alternativet h&auml;r att anv&auml;ndas.</li>
+ <li><b>Visa val av sk&auml;rml&auml;ge vid start:</b> F&ouml;rvalet &auml;r att visa ett f&ouml;nster n&auml;r XDarwin startar som l&aring;ter anv&auml;ndaren v&auml;lja mellan fullsk&auml;rmsl&auml;ge och rotl&ouml;st l&auml;ge. Om detta alternativ inte &auml;r aktivt kommer XDarwin automatiskt att startas i det l&auml;ge som valts ovan.</li>
+ <li><b>Sk&auml;rmnummer i X11:</b> X11 till&aring;ter att det finns flera sk&auml;rmar styrda av varsin X-server p&aring; en och samma dator. Anv&auml;ndaren kan ange vilket nummer XDarwin skall anv&auml;nda om mer &auml;n en X-server skall anv&auml;ndas samtidigt.</li>
+ <li><b>Aktivera Xinerama (st&ouml;d f&ouml;r flera sk&auml;rmar):</b> XDarwin st&ouml;djer flera sk&auml;rmar genom Xinerama, vilket hanterar alla skr&auml;mar som delar av en enda stor rektangul&auml;r sk&auml;rm. Du kan anv&auml;nda detta alternativ f&ouml;r att st&auml;nga av Xinerama, men f&ouml;r n&auml;rvarande kan inte XDarwin hantera flera sk&auml;rmar utan det. Om du bara har en sk&auml;rm kommer Xinerama automatiskt att deaktiveras.</li>
+ <li><b>Fil med tangentbordsupps&auml;ttning:</b> En fil som anger tangentbordsupps&auml;ttning l&auml;ses vid start och &ouml;vers&auml;tts till en tangentborsupps&auml;ttningsfil f&ouml;r X11. Filer med tangentbordsupps&auml;ttningar f&ouml;r ett stort antal spr&aring;k finns i <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Startar f&ouml;rsta X11-klienterna:</b> N&auml;r X11 startas fr&aring;n Finder kommer det att exekvera filen <code>xinit</code> f&ouml;r att starta f&ouml;nsterhanteraren i X11 och andra program. (Se "<code>man xinit</code>" f&ouml;r mer information.) Innan XDarwin k&ouml;r xinit kommer det att l&auml;gga till katalogern h&auml;r till anv&auml;ndarens s&ouml;kv&auml;g. F&ouml;rvalet &auml;r att endast l&auml;gga till katalogen <code>/usr/X11R6/bin</code>. Ytterligare kataloger kan l&auml;ggas till - separera dem med kolon. X11-klienterna startas i anv&auml;ndarens inloggningsskal s&aring; att anv&auml;ndarens inst&auml;llningsfiler i skalet l&auml;ses. Om s&aring; &ouml;nskas kan de startas i ett annat skal.</li>
+</ul>
+<h3>Fullsk&auml;rm</h3>
+<ul>
+ <li><b>Tangentkombinationsknappen:</b> Tryck p&aring; denna knapp och en tangentkombination f&ouml;r att &auml;ndra den tangentkombination som anv&auml;nds f&ouml;r att byta mellan X11 och Aqua.</li>
+ <li><b>Klick p&aring; ikonen i dockan byter till X11:</b> Aktivera detta alternativ f&ouml;r att byta till X11 genom att klicka p&aring; ikonen i dockan. I vissa versioner av Mac OS X kommer ett bte p&aring; detta s&auml;tt att g&ouml;mma pekaren n&auml;r du &aring;terv&auml;nder till Aqua.</li>
+ <li><b>Visa fullsk&auml;rmshj&auml;lp vid start:</b> Detta kommer att visa en informationsruta n&auml;r XDarwin startas i fullsk&auml;rmsl&auml;ge.</li>
+ <li><b>F&auml;rgdjup:</b> I fullsk&auml;rmsl&auml;ge kan X11 anv&auml;nda ett annat f&auml;rgdjup &auml;n Aquas. Om du v&auml;jer "Nuvarande" kommer X11 att anv&auml;nda det f&auml;rgdjup som Aqua har just d&aring;. Annars kan du v&auml;lja 8, 15, eller 24 bitare f&auml;rg.</li>
+</ul>
+
+<h2><a NAME="license">Licens (svenska)</a></h2>
+<p>XFree86-projektet &aring;tar sig att tillhandah&aring;lla programvara och k&auml;llkod i format som fritt kan spridas vidare. Den huvudsakliga licens vi anv&auml;nder oss av &auml;r baserad p&aring; den traditionella MIT X11 / XConsortium-licensen, vilken inte p&aring; n&aring;got s&auml;tt begr&auml;nsar f&ouml;r&auml;ndringar eller vidarespridning av vare sig k&auml;llkod eller kompilerad programvara annat &auml;n genom att kr&auml;va att delarna som r&ouml;r copyright och licensiering l&auml;mnas intakta. F&ouml;r mer information och ytterligare copyright/licensieringsinfromation r&ouml;rande vissa speciella delar av koden, se <A HREF="http://www.xfree86.org/legal/licence.html">XFree86-licenssida</A> (engelska).</p>
+
+<h3>Licence (english)</h3>
+<p>The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>.</p>
+
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/XDarwin.icns b/hw/darwin/bundle/XDarwin.icns
new file mode 100644
index 000000000..31dc1bdf9
--- /dev/null
+++ b/hw/darwin/bundle/XDarwin.icns
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Credits.rtf b/hw/darwin/bundle/ko.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
new file mode 100644
index 000000000..2e7137b05
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..e35148d76
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..4c83fe278
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,103 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp,v 1.1 2001/12/04 03:36:39 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
+<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
+<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
+
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
+<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
+<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
+
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
+ <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
+ <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
+</ul>
+<h3>Start Up</h3>
+<ul>
+ <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
+ <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
+ <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
+ <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
+ <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
+</ul>
+<h3>Full Screen</h3>
+<ul>
+ <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
+ <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
+</ul>
+
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following conditions:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/startXClients.cpp b/hw/darwin/bundle/startXClients.cpp
new file mode 100644
index 000000000..b27ad46fe
--- /dev/null
+++ b/hw/darwin/bundle/startXClients.cpp
@@ -0,0 +1,24 @@
+XCOMM!/bin/sh
+
+XCOMM This script is used by XDarwin to start X clients when XDarwin is
+XCOMM launched from the Finder.
+XCOMM
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/startXClients.cpp,v 1.1 2001/10/18 05:03:42 torrey Exp $
+
+userclientrc=$HOME/.xinitrc
+sysclientrc=XINITDIR/xinitrc
+clientargs=""
+
+if [ -f $userclientrc ]; then
+ clientargs=$userclientrc
+else if [ -f $sysclientrc ]; then
+ clientargs=$sysclientrc
+fi
+fi
+
+if [ "x$2" != "x" ]; then
+ PATH="$PATH:$2"
+ export PATH
+fi
+
+exec xinit $clientargs -- XBINDIR/XDarwinStartup "$1" -idle
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
new file mode 100644
index 000000000..ff5ae1b33
--- /dev/null
+++ b/hw/darwin/darwin.c
@@ -0,0 +1,1025 @@
+/**************************************************************
+ *
+ * Shared code for the Darwin X Server
+ * running with Quartz or the IOKit
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.50 2003/02/26 09:21:33 dawes Exp $ */
+
+#include "X.h"
+#include "Xproto.h"
+#include "os.h"
+#include "servermd.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mibstore.h" // mi backing store implementation
+#include "mipointer.h" // mi software cursor
+#include "micmap.h" // mi colormap code
+#include "fb.h" // fb framebuffer code
+#include "site.h"
+#include "globals.h"
+#include "xf86Version.h"
+#include "xf86Date.h"
+#include "dix.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/syslimits.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+#define NO_CFPLUGIN
+#include <IOKit/IOKitLib.h>
+#include <IOKit/hidsystem/IOHIDLib.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+
+#include "darwin.h"
+#include "darwinClut8.h"
+#include "quartz/quartz.h"
+#include "xfIOKit.h"
+
+/*
+ * X server shared global variables
+ */
+int darwinScreensFound = 0;
+int darwinScreenIndex = 0;
+io_connect_t darwinParamConnect = 0;
+int darwinEventFD = -1;
+Bool quartz = FALSE;
+int quartzMouseAccelChange = 1;
+int darwinFakeButtons = 0;
+
+// location of X11's (0,0) point in global screen coordinates
+int darwinMainScreenX = 0;
+int darwinMainScreenY = 0;
+
+// parameters read from the command line or user preferences
+unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0;
+int darwinDesiredDepth = -1;
+int darwinDesiredRefresh = -1;
+char *darwinKeymapFile = "USA.keymapping";
+
+// modifier masks for faking mouse buttons
+int darwinFakeMouse2Mask = NX_COMMANDMASK;
+int darwinFakeMouse3Mask = NX_ALTERNATEMASK;
+
+static DeviceIntPtr darwinPointer;
+static DeviceIntPtr darwinKeyboard;
+
+// Common pixmap formats
+static PixmapFormatRec formats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
+};
+const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
+
+#ifndef OSNAME
+#define OSNAME " Darwin"
+#endif
+#ifndef OSVENDOR
+#define OSVENDOR ""
+#endif
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+static void
+DarwinPrintBanner()
+{
+#if PRE_RELEASE
+ ErrorF("\n"
+ "This is a pre-release version of XFree86, and is not supported in any\n"
+ "way. Bugs may be reported to XFree86@XFree86.Org and patches submitted\n"
+ "to fixes@XFree86.Org. Before reporting bugs in pre-release versions,\n"
+ "please check the latest version in the XFree86 CVS repository\n"
+ "(http://www.XFree86.Org/cvs)\n");
+#endif
+ ErrorF("\nXFree86 Version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
+ XF86_VERSION_PATCH);
+#if XF86_VERSION_SNAP > 0
+ ErrorF(".%d", XF86_VERSION_SNAP);
+#endif
+
+#if XF86_VERSION_SNAP >= 900
+ ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1,
+ XF86_VERSION_SNAP - 900);
+#endif
+
+#ifdef XF86_CUSTOM_VERSION
+ ErrorF(" (%s)", XF86_CUSTOM_VERSION);
+#endif
+ ErrorF(" / X Window System\n");
+ ErrorF("(protocol Version %d, revision %d, vendor release %d)\n",
+ X_PROTOCOL, X_PROTOCOL_REVISION, VENDOR_RELEASE );
+ ErrorF("Release Date: %s\n", XF86_DATE);
+ ErrorF("\tIf the server is older than 6-12 months, or if your hardware is\n"
+ "\tnewer than the above date, look for a newer version before\n"
+ "\treporting problems. (See http://www.XFree86.Org/FAQ)\n");
+ ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR);
+#if defined(BUILDERSTRING)
+ ErrorF("%s \n",BUILDERSTRING);
+#endif
+}
+
+
+/*
+ * DarwinSaveScreen
+ * X screensaver support. Not implemented.
+ */
+static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
+{
+ // FIXME
+ if (on == SCREEN_SAVER_FORCER) {
+ } else if (on == SCREEN_SAVER_ON) {
+ } else {
+ }
+ return TRUE;
+}
+
+
+/*
+ * DarwinAddScreen
+ * This is a callback from dix during AddScreen() from InitOutput().
+ * Initialize the screen and communicate information about it back to dix.
+ */
+static Bool DarwinAddScreen(
+ int index,
+ ScreenPtr pScreen,
+ int argc,
+ char **argv )
+{
+ int bitsPerRGB, i, dpi;
+ static int foundIndex = 0;
+ Bool ret;
+ VisualPtr visual;
+ ColormapPtr pmap;
+ DarwinFramebufferPtr dfb;
+
+ // reset index of found screens for each server generation
+ if (index == 0) foundIndex = 0;
+
+ // allocate space for private per screen storage
+ dfb = xalloc(sizeof(DarwinFramebufferRec));
+ SCREEN_PRIV(pScreen) = dfb;
+
+ // setup hardware/mode specific details
+ if (quartz) {
+ ret = QuartzAddScreen(foundIndex, pScreen);
+ } else {
+ ret = XFIOKitAddScreen(foundIndex, pScreen);
+ }
+ foundIndex++;
+ if (! ret)
+ return FALSE;
+
+ bitsPerRGB = dfb->bitsPerComponent;
+
+ // reset the visual list
+ miClearVisualTypes();
+
+ // setup a single visual appropriate for our pixel type
+ if (dfb->colorType == TrueColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask,
+ bitsPerRGB, TrueColor )) {
+ return FALSE;
+ }
+ } else if (dfb->colorType == PseudoColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask,
+ bitsPerRGB, PseudoColor )) {
+ return FALSE;
+ }
+ } else if (dfb->colorType == StaticColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask,
+ bitsPerRGB, StaticColor )) {
+ return FALSE;
+ }
+ } else {
+ return FALSE;
+ }
+
+ miSetPixmapDepths();
+
+ // machine independent screen init
+ // setup _Screen structure in pScreen
+ if (monitorResolution)
+ dpi = monitorResolution;
+ else
+ dpi = 75;
+
+ // initialize fb
+ if (! fbScreenInit(pScreen,
+ dfb->framebuffer, // pointer to screen bitmap
+ dfb->width, dfb->height, // screen size in pixels
+ dpi, dpi, // dots per inch
+ dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer
+ dfb->bitsPerPixel)) // bits per pixel for screen
+ {
+ return FALSE;
+ }
+
+ // set the RGB order correctly for TrueColor
+ if (dfb->bitsPerPixel > 8) {
+ for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
+ i < pScreen->numVisuals; i++, visual++) {
+ if (visual->class == TrueColor) {
+ visual->offsetRed = bitsPerRGB * 2;
+ visual->offsetGreen = bitsPerRGB;
+ visual->offsetBlue = 0;
+ visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
+ visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
+ visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
+ }
+ }
+ }
+
+#ifdef RENDER
+ if (! fbPictureInit(pScreen, 0, 0)) {
+ return FALSE;
+ }
+#endif
+
+#ifdef MITSHM
+ ShmRegisterFbFuncs(pScreen);
+#endif
+
+ // this must be initialized (why doesn't X have a default?)
+ pScreen->SaveScreen = DarwinSaveScreen;
+
+ // finish mode dependent screen setup including cursor support
+ if (quartz) {
+ if (! QuartzSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+ } else {
+ if (! XFIOKitSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+ }
+
+ // create and install the default colormap and
+ // set pScreen->blackPixel / pScreen->white
+ if (!miCreateDefColormap( pScreen )) {
+ return FALSE;
+ }
+
+ /* Set the colormap to the statically defined one if we're in 8 bit
+ * mode and we're using a fixed color map. Essentially this translates
+ * to Darwin/x86 in 8-bit mode.
+ */
+ if( (dfb->colorBitsPerPixel == 8) &&
+ (dfb->colorType == StaticColor) )
+ {
+ pmap = miInstalledMaps[pScreen->myNum];
+ visual = pmap->pVisual;
+ for( i = 0; i < visual->ColormapEntries; i++ ) {
+ pmap->red[i].co.local.red = darwinClut8[i].red;
+ pmap->red[i].co.local.green = darwinClut8[i].green;
+ pmap->red[i].co.local.blue = darwinClut8[i].blue;
+ }
+ }
+
+ dixScreenOrigins[index].x = dfb->x;
+ dixScreenOrigins[index].y = dfb->y;
+
+ ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y);
+
+ return TRUE;
+}
+
+/*
+ =============================================================================
+
+ mouse and keyboard callbacks
+
+ =============================================================================
+*/
+
+/*
+ * DarwinChangePointerControl
+ * Set mouse acceleration and thresholding
+ * FIXME: We currently ignore the threshold in ctrl->threshold.
+ */
+static void DarwinChangePointerControl(
+ DeviceIntPtr device,
+ PtrCtrl *ctrl )
+{
+ kern_return_t kr;
+ double acceleration;
+
+ if (!quartzMouseAccelChange)
+ return;
+
+ acceleration = ctrl->num / ctrl->den;
+ kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration );
+ if (kr != KERN_SUCCESS)
+ ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr );
+}
+
+
+/*
+ * DarwinMouseProc
+ * Handle the initialization, etc. of a mouse
+ */
+static int DarwinMouseProc(
+ DeviceIntPtr pPointer,
+ int what )
+{
+ char map[6];
+
+ switch (what) {
+
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ // Set button map.
+ map[1] = 1;
+ map[2] = 2;
+ map[3] = 3;
+ map[4] = 4;
+ map[5] = 5;
+ InitPointerDeviceStruct( (DevicePtr)pPointer,
+ map,
+ 5, // numbuttons (4 & 5 are scroll wheel)
+ miPointerGetMotionEvents,
+ DarwinChangePointerControl,
+ 0 );
+ break;
+
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventFD );
+ return Success;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventFD );
+ return Success;
+ }
+
+ return Success;
+}
+
+
+/*
+ * DarwinKeybdProc
+ * Callback from X
+ */
+static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
+{
+ switch ( onoff ) {
+ case DEVICE_INIT:
+ DarwinKeyboardInit( pDev );
+ break;
+ case DEVICE_ON:
+ pDev->public.on = TRUE;
+ AddEnabledDevice( darwinEventFD );
+ break;
+ case DEVICE_OFF:
+ pDev->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventFD );
+ break;
+ case DEVICE_CLOSE:
+ break;
+ }
+
+ return Success;
+}
+
+/*
+===========================================================================
+
+ Utility routines
+
+===========================================================================
+*/
+
+/*
+ * DarwinFindLibraryFile
+ * Search for a file in the standard Library paths, which are (in order):
+ *
+ * ~/Library/ user specific
+ * /Library/ host specific
+ * /Network/Library/ LAN specific
+ * /System/Library/ OS specific
+ *
+ * A sub-path can be specified to search in below the various Library
+ * directories. Returns a new character string (owned by the caller)
+ * containing the full path to the first file found.
+ */
+static char * DarwinFindLibraryFile(
+ const char *file,
+ const char *pathext )
+{
+ // Library search paths
+ char *pathList[] = {
+ "",
+ "/Network",
+ "/System",
+ NULL
+ };
+ char *home;
+ char *fullPath;
+ int i = 0;
+
+ // Return the file name as is if it is already a fully qualified path.
+ if (!access(file, F_OK)) {
+ fullPath = xalloc(strlen(file)+1);
+ strcpy(fullPath, file);
+ return fullPath;
+ }
+
+ fullPath = xalloc(PATH_MAX);
+
+ home = getenv("HOME");
+ if (home) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ while (pathList[i]) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++],
+ pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ xfree(fullPath);
+ return NULL;
+}
+
+
+/*
+ * DarwinParseModifierList
+ * Parse a list of modifier names and return a corresponding modifier mask
+ */
+static int DarwinParseModifierList(
+ const char *constmodifiers) // string containing list of modifier names
+{
+ int result = 0;
+
+ if (constmodifiers) {
+ char *modifiers = strdup(constmodifiers);
+ char *modifier;
+ int nxkey;
+ char *p = modifiers;
+
+ while (p) {
+ modifier = strsep(&p, " ,+&|/"); // allow lots of separators
+ nxkey = DarwinModifierStringToNXKey(modifier);
+ if (nxkey != -1)
+ result |= DarwinModifierNXKeyToNXMask(nxkey);
+ else
+ ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
+ }
+ free(modifiers);
+ }
+ return result;
+}
+
+/*
+===========================================================================
+
+ Functions needed to link against device independent X
+
+===========================================================================
+*/
+
+/*
+ * InitInput
+ * Register the keyboard and mouse devices
+ */
+void InitInput( int argc, char **argv )
+{
+ darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
+ RegisterPointerDevice( darwinPointer );
+
+ darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
+ RegisterKeyboardDevice( darwinKeyboard );
+
+ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+
+ if (quartz) {
+ QuartzInitInput(argc, argv);
+ } else {
+ XFIOKitInitInput(argc, argv);
+ }
+}
+
+
+/*
+ * InitOutput
+ * Initialize screenInfo for all actually accessible framebuffers.
+ *
+ * The display mode dependent code gets called three times. The mode
+ * specific InitOutput routines are expected to discover the number
+ * of potentially useful screens and cache routes to them internally.
+ * Inside DarwinAddScreen are two other mode specific calls.
+ * A mode specific AddScreen routine is called for each screen to
+ * actually initialize the screen with the ScreenPtr structure.
+ * After other screen setup has been done, a mode specific
+ * SetupScreen function can be called to finalize screen setup.
+ */
+void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
+{
+ int i, left, top;
+ static unsigned long generation = 0;
+
+ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+
+ // List how we want common pixmap formats to be padded
+ pScreenInfo->numPixmapFormats = NUMFORMATS;
+ for (i = 0; i < NUMFORMATS; i++)
+ pScreenInfo->formats[i] = formats[i];
+
+ // Allocate private storage for each screen's Darwin specific info
+ if (generation != serverGeneration) {
+ darwinScreenIndex = AllocateScreenPrivateIndex();
+ generation = serverGeneration;
+ }
+
+ // Discover screens and do mode specific initialization
+ if (quartz) {
+ QuartzInitOutput(argc, argv);
+ } else {
+ XFIOKitInitOutput(argc, argv);
+ }
+
+ // Add screens
+ for (i = 0; i < darwinScreensFound; i++) {
+ AddScreen( DarwinAddScreen, argc, argv );
+ }
+
+ // Shift all screens so the X11 (0, 0) coordinate is at the top left
+ // of the global screen coordinates.
+ // Screens can be arranged so the top left isn't on any screen,
+ // so instead use the top left of the leftmost screen as (0,0).
+ // This may mean some screen space is in -y, but it's better
+ // that (0,0) be onscreen, or else default xterms disappear.
+ // It's better that -y be used than -x, because when popup
+ // menus are forced "onscreen" by dumb window managers like twm,
+ // they'll shift the menus down instead of left, which still looks
+ // funny but is an easier target to hit.
+ left = dixScreenOrigins[0].x;
+ top = dixScreenOrigins[0].y;
+
+ // Find leftmost screen. If there's a tie, take the topmost of the two.
+ for (i = 1; i < pScreenInfo->numScreens; i++) {
+ if (dixScreenOrigins[i].x < left ||
+ (dixScreenOrigins[i].x == left &&
+ dixScreenOrigins[i].y < top))
+ {
+ left = dixScreenOrigins[i].x;
+ top = dixScreenOrigins[i].y;
+ }
+ }
+
+ darwinMainScreenX = left;
+ darwinMainScreenY = top;
+
+ // Shift all screens so that there is a screen whose top left
+ // is at X11 (0,0) and at global screen coordinate
+ // (darwinMainScreenX, darwinMainScreenY).
+ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
+ for (i = 0; i < pScreenInfo->numScreens; i++) {
+ dixScreenOrigins[i].x -= darwinMainScreenX;
+ dixScreenOrigins[i].y -= darwinMainScreenY;
+ ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
+ i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
+ }
+ }
+}
+
+
+/*
+ * OsVendorFataError
+ */
+void OsVendorFatalError( void )
+{
+ ErrorF( " OsVendorFatalError\n" );
+}
+
+
+/*
+ * OsVendorInit
+ * Initialization of Darwin OS support.
+ */
+void OsVendorInit(void)
+{
+ if (serverGeneration == 1) {
+ DarwinPrintBanner();
+ }
+
+ // Find the full path to the keymapping file.
+ if ( darwinKeymapFile ) {
+ char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards");
+ if ( !tempStr )
+ FatalError("Could not find keymapping file %s.\n",
+ darwinKeymapFile);
+ darwinKeymapFile = tempStr;
+ ErrorF("Using keymapping provided in %s.\n", darwinKeymapFile);
+ } else {
+ ErrorF("Reading keymapping from the kernel.\n");
+ }
+}
+
+
+/*
+ * ddxProcessArgument --
+ * Process device-dependent command line args. Returns 0 if argument is
+ * not device dependent, otherwise Count of number of elements of argv
+ * that are part of a device dependent commandline option.
+ */
+int ddxProcessArgument( int argc, char *argv[], int i )
+{
+#ifdef DARWIN_WITH_QUARTZ
+ int numDone;
+
+ if ((numDone = QuartzProcessArgument( argc, argv, i )))
+ return numDone;
+#endif
+
+ if ( !strcmp( argv[i], "-fakebuttons" ) ) {
+ darwinFakeButtons = TRUE;
+ ErrorF( "Faking a three button mouse\n" );
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
+ darwinFakeButtons = FALSE;
+ ErrorF( "Not faking a three button mouse\n" );
+ return 1;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse2" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse2 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse2Mask = 0;
+ else
+ darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
+ darwinFakeMouse2Mask);
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse3" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse3 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse3Mask = 0;
+ else
+ darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
+ darwinFakeMouse3Mask);
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-keymap" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-keymap must be followed by a filename\n" );
+ }
+ darwinKeymapFile = argv[i+1];
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-nokeymap" ) ) {
+ darwinKeymapFile = NULL;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-size" ) ) {
+ if ( i >= argc-2 ) {
+ FatalError( "-size must be followed by two numbers\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" );
+#else
+ darwinDesiredWidth = atoi( argv[i+1] );
+ darwinDesiredHeight = atoi( argv[i+2] );
+ ErrorF( "Attempting to use width x height = %i x %i\n",
+ darwinDesiredWidth, darwinDesiredHeight );
+#endif
+ return 3;
+ }
+
+ if ( !strcmp( argv[i], "-depth" ) ) {
+ int bitDepth;
+
+ if ( i == argc-1 ) {
+ FatalError( "-depth must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
+#else
+ bitDepth = atoi( argv[i+1] );
+ if (bitDepth == 8)
+ darwinDesiredDepth = 0;
+ else if (bitDepth == 15)
+ darwinDesiredDepth = 1;
+ else if (bitDepth == 24)
+ darwinDesiredDepth = 2;
+ else
+ FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
+ ErrorF( "Attempting to use pixel depth of %i\n", bitDepth );
+#endif
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-refresh" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-refresh must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n");
+#else
+ darwinDesiredRefresh = atoi( argv[i+1] );
+ ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh );
+#endif
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ // XDarwinStartup uses this argument to indicate the IOKit X server
+ // should be started. Ignore it here.
+ if ( !strcmp( argv[i], "-iokit" ) ) {
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * ddxUseMsg --
+ * Print out correct use of device dependent commandline options.
+ * Maybe the user now knows what really to do ...
+ */
+void ddxUseMsg( void )
+{
+ ErrorF("\n");
+ ErrorF("\n");
+ ErrorF("Device Dependent Usage:\n");
+ ErrorF("\n");
+ ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
+ ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
+ ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
+ ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
+ ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
+ ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
+ ErrorF("-version : show the server version.\n");
+ ErrorF("\n");
+#ifdef DARWIN_WITH_QUARTZ
+ ErrorF("Quartz modes:\n");
+ ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n");
+ ErrorF("-rootless : run rootless inside Mac OS X window server.\n");
+ ErrorF("-quartz : use default Mac OS X window server mode\n");
+ ErrorF("\n");
+ ErrorF("Options ignored in rootless mode:\n");
+#endif
+ ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
+ ErrorF("-depth <8,15,24> : use this bit depth.\n");
+ ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
+ ErrorF("\n");
+}
+
+
+/*
+ * ddxGiveUp --
+ * Device dependent cleanup. Called by dix before normal server death.
+ */
+void ddxGiveUp( void )
+{
+ ErrorF( "Quitting XDarwin...\n" );
+
+ if (quartz) {
+ QuartzGiveUp();
+ } else {
+ XFIOKitGiveUp();
+ }
+}
+
+
+/*
+ * AbortDDX --
+ * DDX - specific abort routine. Called by AbortServer(). The attempt is
+ * made to restore all original setting of the displays. Also all devices
+ * are closed.
+ */
+void AbortDDX( void )
+{
+ ErrorF( " AbortDDX\n" );
+ /*
+ * This is needed for a abnormal server exit, since the normal exit stuff
+ * MUST also be performed (i.e. the vt must be left in a defined state)
+ */
+ ddxGiveUp();
+}
+
+
+#ifdef DPMSExtension
+/*
+ * DPMS extension stubs
+ */
+Bool DPMSSupported(void)
+{
+ return FALSE;
+}
+
+void DPMSSet(int level)
+{
+}
+
+int DPMSGet(int *level)
+{
+ return -1;
+}
+#endif
+
+
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+#include "windowstr.h" // for struct _Window
+#include "scrnintstr.h" // for struct _Screen
+
+// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
+// Quartz mode uses this when switching in and out of Quartz.
+// Quartz or IOKit can use this when waking from sleep.
+// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+void
+xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = TRUE;
+ RegionPtr pOldClip = NULL, bsExposed;
+#ifdef DO_SAVE_UNDERS
+ Bool dosave = FALSE;
+#endif
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+#ifdef DO_SAVE_UNDERS
+ if (DO_SAVE_UNDERS(pWin))
+ {
+ dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
+ }
+#endif /* DO_SAVE_UNDERS */
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+#ifdef DO_SAVE_UNDERS
+ if (dosave)
+ (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
+#endif /* DO_SAVE_UNDERS */
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
new file mode 100644
index 000000000..62698d74a
--- /dev/null
+++ b/hw/darwin/darwin.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.15 2002/12/10 00:00:38 torrey Exp $ */
+
+#ifndef _DARWIN_H
+#define _DARWIN_H
+
+#include <IOKit/IOTypes.h>
+#include "inputstr.h"
+#include "screenint.h"
+#include "extensions/XKB.h"
+#include "quartz/quartzShared.h"
+
+typedef struct {
+ void *framebuffer;
+ int x;
+ int y;
+ int width;
+ int height;
+ int pitch;
+ int colorType;
+ int bitsPerPixel;
+ int colorBitsPerPixel;
+ int bitsPerComponent;
+} DarwinFramebufferRec, *DarwinFramebufferPtr;
+
+
+void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
+
+// From darwinEvents.c
+Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
+void DarwinEQEnqueue(const xEvent *e);
+void DarwinEQPointerPost(xEvent *e);
+void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+
+// From darwinKeyboard.c
+int DarwinModifierNXKeyToNXKeycode(int key, int side);
+void DarwinKeyboardInit(DeviceIntPtr pDev);
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
+int DarwinModifierNXKeyToNXMask(int key);
+int DarwinModifierNXMaskToNXKey(int mask);
+int DarwinModifierStringToNXKey(const char *string);
+
+#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...
+
+/*
+ * Global variables from darwin.c
+ */
+extern int darwinScreenIndex; // index into pScreen.devPrivates
+extern int darwinScreensFound;
+extern io_connect_t darwinParamConnect;
+extern int darwinEventFD;
+extern Bool quartz;
+
+/*
+ * Special ddx events understood by the X server
+ */
+enum {
+ kXDarwinUpdateModifiers // update all modifier keys
+ = LASTEvent+1, // (from X.h list of event names)
+ kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
+ kXDarwinScrollWheel, // scroll wheel event
+ kXDarwinShow, // vt switch to X server;
+ // recapture screen and restore X drawing
+ kXDarwinHide, // vt switch away from X server;
+ // release screen and clip X drawing
+ kXDarwinSetRootClip, // enable or disable drawing to the X screen
+ kXDarwinQuit, // kill the X server and release the display
+ kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
+ kXDarwinWritePasteboard // copy X cut buffer onto Mac OS X pasteboard
+};
+
+#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/darwin/darwinClut8.h
new file mode 100644
index 000000000..06e7b71c5
--- /dev/null
+++ b/hw/darwin/darwinClut8.h
@@ -0,0 +1,532 @@
+/*
+ * Darwin default 8-bit Colormap for StaticColor
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.1.8.1 2003/03/04 01:31:43 torrey Exp $ */
+
+#ifndef _DARWIN_CLUT8_
+#define _DARWIN_CLUT8_
+
+#ifdef USE_NEW_CLUT
+
+static xColorItem darwinClut8[] = {
+ { 0, 0xffff, 0xffff, 0xffff, 0, 0 },
+ { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 },
+ { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 },
+ { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 },
+ { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0, 0, 0 },
+ { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 },
+ { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 },
+ { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 },
+ { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 },
+ { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 },
+ { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 },
+ { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 },
+ { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 },
+ { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 },
+ { 15, 0x0, 0x0, 0x0, 0, 0 },
+ { 16, 0xefef, 0xefef, 0xefef, 0, 0 },
+ { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 18, 0xeded, 0xeded, 0xeded, 0, 0 },
+ { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 },
+ { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 },
+ { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 },
+ { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 },
+ { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 },
+ { 24, 0xffff, 0x0, 0xffff, 0, 0 },
+ { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 },
+ { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 },
+ { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 },
+ { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 },
+ { 29, 0xdede, 0xdede, 0xdede, 0, 0 },
+ { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 },
+ { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 },
+ { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 },
+ { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 },
+ { 35, 0xffff, 0x0, 0x0, 0, 0 },
+ { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 },
+ { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 },
+ { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 },
+ { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 },
+ { 40, 0xa3a3, 0x606, 0x4545, 0, 0 },
+ { 41, 0xcece, 0xcece, 0xcece, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 },
+ { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 },
+ { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 },
+ { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 },
+ { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 },
+ { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 },
+ { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 },
+ { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 },
+ { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 },
+ { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 },
+ { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 },
+ { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 },
+ { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 },
+ { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 },
+ { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 },
+ { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 },
+ { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 },
+ { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 },
+ { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 },
+ { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 },
+ { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 },
+ { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 },
+ { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 },
+ { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 },
+ { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 },
+ { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 },
+ { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 },
+ { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 },
+ { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 },
+ { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 },
+ { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 },
+ { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 },
+ { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 },
+ { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 },
+ { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 },
+ { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 },
+ { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 },
+ { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 },
+ { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 },
+ { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 },
+ { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 },
+ { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 },
+ { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 },
+ { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 },
+ { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 },
+ { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 },
+ { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 },
+ { 91, 0x6060, 0x5353, 0xadad, 0, 0 },
+ { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 },
+ { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 },
+ { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 },
+ { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 },
+ { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 },
+ { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 },
+ { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 },
+ { 99, 0x4141, 0x4444, 0xbaba, 0, 0 },
+ { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 },
+ { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 },
+ { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 },
+ { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 },
+ { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 },
+ { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 },
+ { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 },
+ { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 },
+ { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 },
+ { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 },
+ { 110, 0x3434, 0x6565, 0xafaf, 0, 0 },
+ { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 },
+ { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 },
+ { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 },
+ { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 },
+ { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 },
+ { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 },
+ { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 },
+ { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 },
+ { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 },
+ { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 },
+ { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 },
+ { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 },
+ { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 },
+ { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 },
+ { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 },
+ { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 },
+ { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 },
+ { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 },
+ { 129, 0x0, 0x5f5f, 0x7979, 0, 0 },
+ { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 },
+ { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 },
+ { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 },
+ { 133, 0x2424, 0x8282, 0x8383, 0, 0 },
+ { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 },
+ { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 },
+ { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 },
+ { 137, 0xa0a, 0x9393, 0x8585, 0, 0 },
+ { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 },
+ { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 },
+ { 140, 0x404, 0x8181, 0x7272, 0, 0 },
+ { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 },
+ { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 },
+ { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 },
+ { 144, 0x202, 0x8c8c, 0x5050, 0, 0 },
+ { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 },
+ { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 },
+ { 147, 0x202, 0x7d7d, 0x3939, 0, 0 },
+ { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 },
+ { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 },
+ { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 },
+ { 151, 0x101, 0x8888, 0x2a2a, 0, 0 },
+ { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 },
+ { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 },
+ { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 },
+ { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 },
+ { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 },
+ { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 },
+ { 158, 0x0, 0x8e8e, 0x1919, 0, 0 },
+ { 159, 0x1010, 0xafaf, 0x2828, 0, 0 },
+ { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 },
+ { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 },
+ { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 },
+ { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 },
+ { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 },
+ { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 },
+ { 166, 0x1212, 0xbaba, 0x1717, 0, 0 },
+ { 167, 0x101, 0x8a8a, 0x202, 0, 0 },
+ { 168, 0x303, 0x9a9a, 0x202, 0, 0 },
+ { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 },
+ { 170, 0x808, 0xb2b2, 0x505, 0, 0 },
+ { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 },
+ { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 },
+ { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 },
+ { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 },
+ { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 },
+ { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 },
+ { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 },
+ { 178, 0x2929, 0xa5a5, 0x808, 0, 0 },
+ { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 },
+ { 180, 0x0, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 },
+ { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 },
+ { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 },
+ { 184, 0x5555, 0xcccc, 0x1515, 0, 0 },
+ { 185, 0x0, 0xffff, 0x0, 0, 0 },
+ { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 },
+ { 187, 0x4343, 0xa7a7, 0x101, 0, 0 },
+ { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 },
+ { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 },
+ { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 },
+ { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 },
+ { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 },
+ { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 },
+ { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 },
+ { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 },
+ { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 },
+ { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 },
+ { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 },
+ { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 },
+ { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 },
+ { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 },
+ { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 },
+ { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 },
+ { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 },
+ { 205, 0x9898, 0x9696, 0x202, 0, 0 },
+ { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 },
+ { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 },
+ { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 },
+ { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 },
+ { 210, 0x0, 0x0, 0xffff, 0, 0 },
+ { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 },
+ { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 },
+ { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 },
+ { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 },
+ { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 },
+ { 216, 0xdddd, 0x0, 0x0, 0, 0 },
+ { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 },
+ { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 },
+ { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 },
+ { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 },
+ { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 },
+ { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 },
+ { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 },
+ { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 },
+ { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 },
+ { 226, 0xadad, 0x5252, 0xf0f, 0, 0 },
+ { 227, 0x0, 0xbbbb, 0x0, 0, 0 },
+ { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 },
+ { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 },
+ { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 },
+ { 231, 0xa4a4, 0x3434, 0x303, 0, 0 },
+ { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 },
+ { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 },
+ { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 },
+ { 235, 0xa9a9, 0x2222, 0x606, 0, 0 },
+ { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 },
+ { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 },
+ { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 },
+ { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 },
+ { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 },
+ { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 },
+ { 242, 0xacac, 0xacac, 0xacac, 0, 0 },
+ { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 },
+ { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 },
+ { 245, 0x9292, 0x9292, 0x9292, 0, 0 },
+ { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0x8181, 0x8181, 0x8181, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 },
+ { 255, 0x0, 0x0, 0x0, 0, 0 },
+};
+
+#else /* !USE_NEW_CLUT */
+
+static xColorItem darwinClut8[] = {
+ { 0, 0x0000, 0x0000, 0x0000, 0, 0 },
+ { 1, 0xffff, 0xffff, 0xcccc, 0, 0 },
+ { 2, 0xffff, 0xffff, 0x9999, 0, 0 },
+ { 3, 0xffff, 0xffff, 0x6666, 0, 0 },
+ { 4, 0xffff, 0xffff, 0x3333, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0000, 0, 0 },
+ { 6, 0xffff, 0xcccc, 0xffff, 0, 0 },
+ { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 },
+ { 8, 0xffff, 0xcccc, 0x9999, 0, 0 },
+ { 9, 0xffff, 0xcccc, 0x6666, 0, 0 },
+ { 10, 0xffff, 0xcccc, 0x3333, 0, 0 },
+ { 11, 0xffff, 0xcccc, 0x0000, 0, 0 },
+ { 12, 0xffff, 0x9999, 0xffff, 0, 0 },
+ { 13, 0xffff, 0x9999, 0xcccc, 0, 0 },
+ { 14, 0xffff, 0x9999, 0x9999, 0, 0 },
+ { 15, 0xffff, 0x9999, 0x6666, 0, 0 },
+ { 16, 0xffff, 0x9999, 0x3333, 0, 0 },
+ { 17, 0xffff, 0x9999, 0x0000, 0, 0 },
+ { 18, 0xffff, 0x6666, 0xffff, 0, 0 },
+ { 19, 0xffff, 0x6666, 0xcccc, 0, 0 },
+ { 20, 0xffff, 0x6666, 0x9999, 0, 0 },
+ { 21, 0xffff, 0x6666, 0x6666, 0, 0 },
+ { 22, 0xffff, 0x6666, 0x3333, 0, 0 },
+ { 23, 0xffff, 0x6666, 0x0000, 0, 0 },
+ { 24, 0xffff, 0x3333, 0xffff, 0, 0 },
+ { 25, 0xffff, 0x3333, 0xcccc, 0, 0 },
+ { 26, 0xffff, 0x3333, 0x9999, 0, 0 },
+ { 27, 0xffff, 0x3333, 0x6666, 0, 0 },
+ { 28, 0xffff, 0x3333, 0x3333, 0, 0 },
+ { 29, 0xffff, 0x3333, 0x0000, 0, 0 },
+ { 30, 0xffff, 0x0000, 0xffff, 0, 0 },
+ { 31, 0xffff, 0x0000, 0xcccc, 0, 0 },
+ { 32, 0xffff, 0x0000, 0x9999, 0, 0 },
+ { 33, 0xffff, 0x0000, 0x6666, 0, 0 },
+ { 34, 0xffff, 0x0000, 0x3333, 0, 0 },
+ { 35, 0xffff, 0x0000, 0x0000, 0, 0 },
+ { 36, 0xcccc, 0xffff, 0xffff, 0, 0 },
+ { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 },
+ { 38, 0xcccc, 0xffff, 0x9999, 0, 0 },
+ { 39, 0xcccc, 0xffff, 0x6666, 0, 0 },
+ { 40, 0xcccc, 0xffff, 0x3333, 0, 0 },
+ { 41, 0xcccc, 0xffff, 0x0000, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 },
+ { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 },
+ { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 },
+ { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 },
+ { 48, 0xcccc, 0x9999, 0xffff, 0, 0 },
+ { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 },
+ { 50, 0xcccc, 0x9999, 0x9999, 0, 0 },
+ { 51, 0xcccc, 0x9999, 0x6666, 0, 0 },
+ { 52, 0xcccc, 0x9999, 0x3333, 0, 0 },
+ { 53, 0xcccc, 0x9999, 0x0000, 0, 0 },
+ { 54, 0xcccc, 0x6666, 0xffff, 0, 0 },
+ { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 },
+ { 56, 0xcccc, 0x6666, 0x9999, 0, 0 },
+ { 57, 0xcccc, 0x6666, 0x6666, 0, 0 },
+ { 58, 0xcccc, 0x6666, 0x3333, 0, 0 },
+ { 59, 0xcccc, 0x6666, 0x0000, 0, 0 },
+ { 60, 0xcccc, 0x3333, 0xffff, 0, 0 },
+ { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 },
+ { 62, 0xcccc, 0x3333, 0x9999, 0, 0 },
+ { 63, 0xcccc, 0x3333, 0x6666, 0, 0 },
+ { 64, 0xcccc, 0x3333, 0x3333, 0, 0 },
+ { 65, 0xcccc, 0x3333, 0x0000, 0, 0 },
+ { 66, 0xcccc, 0x0000, 0xffff, 0, 0 },
+ { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 },
+ { 68, 0xcccc, 0x0000, 0x9999, 0, 0 },
+ { 69, 0xcccc, 0x0000, 0x6666, 0, 0 },
+ { 70, 0xcccc, 0x0000, 0x3333, 0, 0 },
+ { 71, 0xcccc, 0x0000, 0x0000, 0, 0 },
+ { 72, 0x9999, 0xffff, 0xffff, 0, 0 },
+ { 73, 0x9999, 0xffff, 0xcccc, 0, 0 },
+ { 74, 0x9999, 0xffff, 0x9999, 0, 0 },
+ { 75, 0x9999, 0xffff, 0x6666, 0, 0 },
+ { 76, 0x9999, 0xffff, 0x3333, 0, 0 },
+ { 77, 0x9999, 0xffff, 0x0000, 0, 0 },
+ { 78, 0x9999, 0xcccc, 0xffff, 0, 0 },
+ { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 },
+ { 80, 0x9999, 0xcccc, 0x9999, 0, 0 },
+ { 81, 0x9999, 0xcccc, 0x6666, 0, 0 },
+ { 82, 0x9999, 0xcccc, 0x3333, 0, 0 },
+ { 83, 0x9999, 0xcccc, 0x0000, 0, 0 },
+ { 84, 0x9999, 0x9999, 0xffff, 0, 0 },
+ { 85, 0x9999, 0x9999, 0xcccc, 0, 0 },
+ { 86, 0x9999, 0x9999, 0x9999, 0, 0 },
+ { 87, 0x9999, 0x9999, 0x6666, 0, 0 },
+ { 88, 0x9999, 0x9999, 0x3333, 0, 0 },
+ { 89, 0x9999, 0x9999, 0x0000, 0, 0 },
+ { 90, 0x9999, 0x6666, 0xffff, 0, 0 },
+ { 91, 0x9999, 0x6666, 0xcccc, 0, 0 },
+ { 92, 0x9999, 0x6666, 0x9999, 0, 0 },
+ { 93, 0x9999, 0x6666, 0x6666, 0, 0 },
+ { 94, 0x9999, 0x6666, 0x3333, 0, 0 },
+ { 95, 0x9999, 0x6666, 0x0000, 0, 0 },
+ { 96, 0x9999, 0x3333, 0xffff, 0, 0 },
+ { 97, 0x9999, 0x3333, 0xcccc, 0, 0 },
+ { 98, 0x9999, 0x3333, 0x9999, 0, 0 },
+ { 99, 0x9999, 0x3333, 0x6666, 0, 0 },
+ { 100, 0x9999, 0x3333, 0x3333, 0, 0 },
+ { 101, 0x9999, 0x3333, 0x0000, 0, 0 },
+ { 102, 0x9999, 0x0000, 0xffff, 0, 0 },
+ { 103, 0x9999, 0x0000, 0xcccc, 0, 0 },
+ { 104, 0x9999, 0x0000, 0x9999, 0, 0 },
+ { 105, 0x9999, 0x0000, 0x6666, 0, 0 },
+ { 106, 0x9999, 0x0000, 0x3333, 0, 0 },
+ { 107, 0x9999, 0x0000, 0x0000, 0, 0 },
+ { 108, 0x6666, 0xffff, 0xffff, 0, 0 },
+ { 109, 0x6666, 0xffff, 0xcccc, 0, 0 },
+ { 110, 0x6666, 0xffff, 0x9999, 0, 0 },
+ { 111, 0x6666, 0xffff, 0x6666, 0, 0 },
+ { 112, 0x6666, 0xffff, 0x3333, 0, 0 },
+ { 113, 0x6666, 0xffff, 0x0000, 0, 0 },
+ { 114, 0x6666, 0xcccc, 0xffff, 0, 0 },
+ { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 },
+ { 116, 0x6666, 0xcccc, 0x9999, 0, 0 },
+ { 117, 0x6666, 0xcccc, 0x6666, 0, 0 },
+ { 118, 0x6666, 0xcccc, 0x3333, 0, 0 },
+ { 119, 0x6666, 0xcccc, 0x0000, 0, 0 },
+ { 120, 0x6666, 0x9999, 0xffff, 0, 0 },
+ { 121, 0x6666, 0x9999, 0xcccc, 0, 0 },
+ { 122, 0x6666, 0x9999, 0x9999, 0, 0 },
+ { 123, 0x6666, 0x9999, 0x6666, 0, 0 },
+ { 124, 0x6666, 0x9999, 0x3333, 0, 0 },
+ { 125, 0x6666, 0x9999, 0x0000, 0, 0 },
+ { 126, 0x6666, 0x6666, 0xffff, 0, 0 },
+ { 127, 0x6666, 0x6666, 0xcccc, 0, 0 },
+ { 128, 0x6666, 0x6666, 0x9999, 0, 0 },
+ { 129, 0x6666, 0x6666, 0x6666, 0, 0 },
+ { 130, 0x6666, 0x6666, 0x3333, 0, 0 },
+ { 131, 0x6666, 0x6666, 0x0000, 0, 0 },
+ { 132, 0x6666, 0x3333, 0xffff, 0, 0 },
+ { 133, 0x6666, 0x3333, 0xcccc, 0, 0 },
+ { 134, 0x6666, 0x3333, 0x9999, 0, 0 },
+ { 135, 0x6666, 0x3333, 0x6666, 0, 0 },
+ { 136, 0x6666, 0x3333, 0x3333, 0, 0 },
+ { 137, 0x6666, 0x3333, 0x0000, 0, 0 },
+ { 138, 0x6666, 0x0000, 0xffff, 0, 0 },
+ { 139, 0x6666, 0x0000, 0xcccc, 0, 0 },
+ { 140, 0x6666, 0x0000, 0x9999, 0, 0 },
+ { 141, 0x6666, 0x0000, 0x6666, 0, 0 },
+ { 142, 0x6666, 0x0000, 0x3333, 0, 0 },
+ { 143, 0x6666, 0x0000, 0x0000, 0, 0 },
+ { 144, 0x3333, 0xffff, 0xffff, 0, 0 },
+ { 145, 0x3333, 0xffff, 0xcccc, 0, 0 },
+ { 146, 0x3333, 0xffff, 0x9999, 0, 0 },
+ { 147, 0x3333, 0xffff, 0x6666, 0, 0 },
+ { 148, 0x3333, 0xffff, 0x3333, 0, 0 },
+ { 149, 0x3333, 0xffff, 0x0000, 0, 0 },
+ { 150, 0x3333, 0xcccc, 0xffff, 0, 0 },
+ { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 },
+ { 152, 0x3333, 0xcccc, 0x9999, 0, 0 },
+ { 153, 0x3333, 0xcccc, 0x6666, 0, 0 },
+ { 154, 0x3333, 0xcccc, 0x3333, 0, 0 },
+ { 155, 0x3333, 0xcccc, 0x0000, 0, 0 },
+ { 156, 0x3333, 0x9999, 0xffff, 0, 0 },
+ { 157, 0x3333, 0x9999, 0xcccc, 0, 0 },
+ { 158, 0x3333, 0x9999, 0x9999, 0, 0 },
+ { 159, 0x3333, 0x9999, 0x6666, 0, 0 },
+ { 160, 0x3333, 0x9999, 0x3333, 0, 0 },
+ { 161, 0x3333, 0x9999, 0x0000, 0, 0 },
+ { 162, 0x3333, 0x6666, 0xffff, 0, 0 },
+ { 163, 0x3333, 0x6666, 0xcccc, 0, 0 },
+ { 164, 0x3333, 0x6666, 0x9999, 0, 0 },
+ { 165, 0x3333, 0x6666, 0x6666, 0, 0 },
+ { 166, 0x3333, 0x6666, 0x3333, 0, 0 },
+ { 167, 0x3333, 0x6666, 0x0000, 0, 0 },
+ { 168, 0x3333, 0x3333, 0xffff, 0, 0 },
+ { 169, 0x3333, 0x3333, 0xcccc, 0, 0 },
+ { 170, 0x3333, 0x3333, 0x9999, 0, 0 },
+ { 171, 0x3333, 0x3333, 0x6666, 0, 0 },
+ { 172, 0x3333, 0x3333, 0x3333, 0, 0 },
+ { 173, 0x3333, 0x3333, 0x0000, 0, 0 },
+ { 174, 0x3333, 0x0000, 0xffff, 0, 0 },
+ { 175, 0x3333, 0x0000, 0xcccc, 0, 0 },
+ { 176, 0x3333, 0x0000, 0x9999, 0, 0 },
+ { 177, 0x3333, 0x0000, 0x6666, 0, 0 },
+ { 178, 0x3333, 0x0000, 0x3333, 0, 0 },
+ { 179, 0x3333, 0x0000, 0x0000, 0, 0 },
+ { 180, 0x0000, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x0000, 0xffff, 0xcccc, 0, 0 },
+ { 182, 0x0000, 0xffff, 0x9999, 0, 0 },
+ { 183, 0x0000, 0xffff, 0x6666, 0, 0 },
+ { 184, 0x0000, 0xffff, 0x3333, 0, 0 },
+ { 185, 0x0000, 0xffff, 0x0000, 0, 0 },
+ { 186, 0x0000, 0xcccc, 0xffff, 0, 0 },
+ { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 },
+ { 188, 0x0000, 0xcccc, 0x9999, 0, 0 },
+ { 189, 0x0000, 0xcccc, 0x6666, 0, 0 },
+ { 190, 0x0000, 0xcccc, 0x3333, 0, 0 },
+ { 191, 0x0000, 0xcccc, 0x0000, 0, 0 },
+ { 192, 0x0000, 0x9999, 0xffff, 0, 0 },
+ { 193, 0x0000, 0x9999, 0xcccc, 0, 0 },
+ { 194, 0x0000, 0x9999, 0x9999, 0, 0 },
+ { 195, 0x0000, 0x9999, 0x6666, 0, 0 },
+ { 196, 0x0000, 0x9999, 0x3333, 0, 0 },
+ { 197, 0x0000, 0x9999, 0x0000, 0, 0 },
+ { 198, 0x0000, 0x6666, 0xffff, 0, 0 },
+ { 199, 0x0000, 0x6666, 0xcccc, 0, 0 },
+ { 200, 0x0000, 0x6666, 0x9999, 0, 0 },
+ { 201, 0x0000, 0x6666, 0x6666, 0, 0 },
+ { 202, 0x0000, 0x6666, 0x3333, 0, 0 },
+ { 203, 0x0000, 0x6666, 0x0000, 0, 0 },
+ { 204, 0x0000, 0x3333, 0xffff, 0, 0 },
+ { 205, 0x0000, 0x3333, 0xcccc, 0, 0 },
+ { 206, 0x0000, 0x3333, 0x9999, 0, 0 },
+ { 207, 0x0000, 0x3333, 0x6666, 0, 0 },
+ { 208, 0x0000, 0x3333, 0x3333, 0, 0 },
+ { 209, 0x0000, 0x3333, 0x0000, 0, 0 },
+ { 210, 0x0000, 0x0000, 0xffff, 0, 0 },
+ { 211, 0x0000, 0x0000, 0xcccc, 0, 0 },
+ { 212, 0x0000, 0x0000, 0x9999, 0, 0 },
+ { 213, 0x0000, 0x0000, 0x6666, 0, 0 },
+ { 214, 0x0000, 0x0000, 0x3333, 0, 0 },
+ { 215, 0xeeee, 0x0000, 0x0000, 0, 0 },
+ { 216, 0xdddd, 0x0000, 0x0000, 0, 0 },
+ { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 },
+ { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 },
+ { 219, 0x8888, 0x0000, 0x0000, 0, 0 },
+ { 220, 0x7777, 0x0000, 0x0000, 0, 0 },
+ { 221, 0x5555, 0x0000, 0x0000, 0, 0 },
+ { 222, 0x4444, 0x0000, 0x0000, 0, 0 },
+ { 223, 0x2222, 0x0000, 0x0000, 0, 0 },
+ { 224, 0x1111, 0x0000, 0x0000, 0, 0 },
+ { 225, 0x0000, 0xeeee, 0x0000, 0, 0 },
+ { 226, 0x0000, 0xdddd, 0x0000, 0, 0 },
+ { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 },
+ { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 },
+ { 229, 0x0000, 0x8888, 0x0000, 0, 0 },
+ { 230, 0x0000, 0x7777, 0x0000, 0, 0 },
+ { 231, 0x0000, 0x5555, 0x0000, 0, 0 },
+ { 232, 0x0000, 0x4444, 0x0000, 0, 0 },
+ { 233, 0x0000, 0x2222, 0x0000, 0, 0 },
+ { 234, 0x0000, 0x1111, 0x0000, 0, 0 },
+ { 235, 0x0000, 0x0000, 0xeeee, 0, 0 },
+ { 236, 0x0000, 0x0000, 0xdddd, 0, 0 },
+ { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 },
+ { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 },
+ { 239, 0x0000, 0x0000, 0x8888, 0, 0 },
+ { 240, 0x0000, 0x0000, 0x7777, 0, 0 },
+ { 241, 0x0000, 0x0000, 0x5555, 0, 0 },
+ { 242, 0x0000, 0x0000, 0x4444, 0, 0 },
+ { 243, 0x0000, 0x0000, 0x2222, 0, 0 },
+ { 244, 0x0000, 0x0000, 0x1111, 0, 0 },
+ { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x1111, 0x1111, 0x1111, 0, 0 },
+ { 255, 0xffff, 0xffff, 0xffff, 0, 0 }
+};
+#endif /* USE_NEW_CLUT */
+
+#endif /* _DARWIN_CLUT8_ */
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
new file mode 100644
index 000000000..72d7eff05
--- /dev/null
+++ b/hw/darwin/darwinEvents.c
@@ -0,0 +1,438 @@
+/*
+ * Darwin event queue and event handling
+ */
+/*
+Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved.
+
+This file is based on mieq.c by Keith Packard,
+which contains the following copyright:
+Copyright 1990, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+#define NEED_EVENTS
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "inputstr.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "mipointer.h"
+
+#include "darwin.h"
+#include "quartz/quartz.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <IOKit/hidsystem/IOLLEvent.h>
+
+/* Fake button press/release for scroll wheel move. */
+#define SCROLLWHEELUPFAKE 4
+#define SCROLLWHEELDOWNFAKE 5
+
+#define QUEUE_SIZE 256
+
+typedef struct _Event {
+ xEvent event;
+ ScreenPtr pScreen;
+} EventRec, *EventPtr;
+
+typedef struct _EventQueue {
+ HWEventQueueType head, tail; /* long for SetInputCheck */
+ CARD32 lastEventTime; /* to avoid time running backwards */
+ Bool lastMotion;
+ EventRec events[QUEUE_SIZE]; /* static allocation for signals */
+ DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
+ ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
+ ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
+} EventQueueRec, *EventQueuePtr;
+
+static EventQueueRec darwinEventQueue;
+
+
+/*
+ * DarwinPressModifierMask
+ * Press or release the given modifier key, specified by its mask.
+ */
+static void DarwinPressModifierMask(
+ xEvent *xe, // must already have type, time and mouse location
+ int mask) // one of NX_*MASK constants
+{
+ int key = DarwinModifierNXMaskToNXKey(mask);
+
+ if (key != -1) {
+ int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
+ if (keycode != 0) {
+ xe->u.u.detail = keycode + MIN_KEYCODE;
+ (*darwinEventQueue.pKbd->processInputProc)(xe,
+ (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+ }
+ }
+}
+
+
+/*
+ * DarwinUpdateModifiers
+ * Send events to update the modifier state.
+ */
+static void DarwinUpdateModifiers(
+ xEvent *xe, // event template with time and mouse position set
+ int pressed, // KeyPress or KeyRelease
+ int flags ) // modifier flags that have changed
+{
+ xe->u.u.type = pressed;
+ if (flags & NX_ALPHASHIFTMASK) {
+ DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
+ }
+ if (flags & NX_COMMANDMASK) {
+ DarwinPressModifierMask(xe, NX_COMMANDMASK);
+ }
+ if (flags & NX_CONTROLMASK) {
+ DarwinPressModifierMask(xe, NX_CONTROLMASK);
+ }
+ if (flags & NX_ALTERNATEMASK) {
+ DarwinPressModifierMask(xe, NX_ALTERNATEMASK);
+ }
+ if (flags & NX_SHIFTMASK) {
+ DarwinPressModifierMask(xe, NX_SHIFTMASK);
+ }
+ if (flags & NX_SECONDARYFNMASK) {
+ DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
+ }
+}
+
+
+/*
+ * DarwinSimulateMouseClick
+ * Send a mouse click to X when multiple mouse buttons are simulated
+ * with modifier-clicks, such as command-click for button 2. The dix
+ * layer is told that the previously pressed modifier key(s) are
+ * released, the simulated click event is sent. After the mouse button
+ * is released, the modifier keys are reverted to their actual state,
+ * which may or may not be pressed at that point. This is usually
+ * closest to what the user wants. Ie. the user typically wants to
+ * simulate a button 2 press instead of Command-button 2.
+ */
+static void DarwinSimulateMouseClick(
+ xEvent *xe, // event template with time and
+ // mouse position filled in
+ int whichButton, // mouse button to be pressed
+ int modifierMask) // modifiers used for the fake click
+{
+ // first fool X into forgetting about the keys
+ DarwinUpdateModifiers(xe, KeyRelease, modifierMask);
+
+ // push the mouse button
+ xe->u.u.type = ButtonPress;
+ xe->u.u.detail = whichButton;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+}
+
+
+Bool
+DarwinEQInit(
+ DevicePtr pKbd,
+ DevicePtr pPtr)
+{
+ darwinEventQueue.head = darwinEventQueue.tail = 0;
+ darwinEventQueue.lastEventTime = GetTimeInMillis ();
+ darwinEventQueue.pKbd = pKbd;
+ darwinEventQueue.pPtr = pPtr;
+ darwinEventQueue.pEnqueueScreen = screenInfo.screens[0];
+ darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen;
+ SetInputCheck (&darwinEventQueue.head, &darwinEventQueue.tail);
+ return TRUE;
+}
+
+
+/*
+ * DarwinEQEnqueue
+ * Must be thread safe with ProcessInputEvents.
+ * DarwinEQEnqueue - called from event gathering thread
+ * ProcessInputEvents - called from X server thread
+ * DarwinEQEnqueue should never be called from more than one thread.
+ */
+void
+DarwinEQEnqueue(
+ const xEvent *e)
+{
+ HWEventQueueType oldtail, newtail;
+
+ oldtail = darwinEventQueue.tail;
+
+ // mieqEnqueue() collapses successive motion events into one event.
+ // This is difficult to do in a thread-safe way and rarely useful.
+
+ newtail = oldtail + 1;
+ if (newtail == QUEUE_SIZE)
+ newtail = 0;
+ /* Toss events which come in late */
+ if (newtail == darwinEventQueue.head)
+ return;
+
+ darwinEventQueue.events[oldtail].event = *e;
+ /*
+ * Make sure that event times don't go backwards - this
+ * is "unnecessary", but very useful
+ */
+ if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime &&
+ darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
+ {
+ darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time =
+ darwinEventQueue.lastEventTime;
+ }
+ darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen;
+
+ // Update the tail after the event is prepared
+ darwinEventQueue.tail = newtail;
+}
+
+
+/*
+ * DarwinEQPointerPost
+ * Post a pointer event. Used by the mipointer.c routines.
+ */
+void
+DarwinEQPointerPost(
+ xEvent *e)
+{
+ (*darwinEventQueue.pPtr->processInputProc)
+ (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+}
+
+
+void
+DarwinEQSwitchScreen(
+ ScreenPtr pScreen,
+ Bool fromDIX)
+{
+ darwinEventQueue.pEnqueueScreen = pScreen;
+ if (fromDIX)
+ darwinEventQueue.pDequeueScreen = pScreen;
+}
+
+
+/*
+ * ProcessInputEvents
+ * Read and process events from the event queue until it is empty.
+ */
+void ProcessInputEvents(void)
+{
+ EventRec *e;
+ int x, y;
+ xEvent xe;
+ static int old_flags = 0; // last known modifier state
+ // button number and modifier mask of currently pressed fake button
+ static int darwinFakeMouseButtonDown = 0;
+ static int darwinFakeMouseButtonMask = 0;
+
+ // Empty the signaling pipe
+ x = sizeof(xe);
+ while (x == sizeof(xe)) {
+ x = read(darwinEventFD, &xe, sizeof(xe));
+ }
+
+ while (darwinEventQueue.head != darwinEventQueue.tail)
+ {
+ if (screenIsSaved == SCREEN_SAVER_ON)
+ SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
+
+ e = &darwinEventQueue.events[darwinEventQueue.head];
+ xe = e->event;
+
+ // Shift from global screen coordinates to coordinates relative to
+ // the origin of the current screen.
+ xe.u.keyButtonPointer.rootX -= darwinMainScreenX +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].x;
+ xe.u.keyButtonPointer.rootY -= darwinMainScreenY +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].y;
+
+ /*
+ * Assumption - screen switching can only occur on motion events
+ */
+ if (e->pScreen != darwinEventQueue.pDequeueScreen)
+ {
+ darwinEventQueue.pDequeueScreen = e->pScreen;
+ x = xe.u.keyButtonPointer.rootX;
+ y = xe.u.keyButtonPointer.rootY;
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y);
+ }
+ else
+ {
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ switch (xe.u.u.type)
+ {
+ case KeyPress:
+ case KeyRelease:
+ xe.u.u.detail += MIN_KEYCODE;
+ (*darwinEventQueue.pKbd->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+ break;
+
+ case ButtonPress:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ if (darwinFakeButtons && xe.u.u.detail == 1) {
+ // Mimic multi-button mouse with modifier-clicks
+ // If both sets of modifiers are pressed,
+ // button 2 is clicked.
+ if ((old_flags & darwinFakeMouse2Mask) ==
+ darwinFakeMouse2Mask)
+ {
+ DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask);
+ darwinFakeMouseButtonDown = 2;
+ darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
+ break;
+ }
+ else if ((old_flags & darwinFakeMouse3Mask) ==
+ darwinFakeMouse3Mask)
+ {
+ DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask);
+ darwinFakeMouseButtonDown = 3;
+ darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
+ break;
+ }
+ }
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ break;
+
+ case ButtonRelease:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ if (darwinFakeButtons && xe.u.u.detail == 1 &&
+ darwinFakeMouseButtonDown)
+ {
+ // If last mousedown was a fake click, don't check for
+ // mouse modifiers here. The user may have released the
+ // modifiers before the mouse button.
+ xe.u.u.detail = darwinFakeMouseButtonDown;
+ darwinFakeMouseButtonDown = 0;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+
+ // Bring modifiers back up to date
+ DarwinUpdateModifiers(&xe, KeyPress,
+ darwinFakeMouseButtonMask & old_flags);
+ darwinFakeMouseButtonMask = 0;
+ } else {
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ break;
+
+ case MotionNotify:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ break;
+
+ case kXDarwinUpdateModifiers:
+ {
+ // Update modifier state.
+ // Any amount of modifiers may have changed.
+ int flags = xe.u.clientMessage.u.l.longs0;
+ DarwinUpdateModifiers(&xe, KeyRelease,
+ old_flags & ~flags);
+ DarwinUpdateModifiers(&xe, KeyPress,
+ ~old_flags & flags);
+ old_flags = flags;
+ break;
+ }
+
+ case kXDarwinUpdateButtons:
+ {
+ long hwDelta = xe.u.clientMessage.u.l.longs0;
+ long hwButtons = xe.u.clientMessage.u.l.longs1;
+ int i;
+
+ for (i = 1; i < 5; i++) {
+ if (hwDelta & (1 << i)) {
+ // IOKit and X have different numbering for the
+ // middle and right mouse buttons.
+ if (i == 1) {
+ xe.u.u.detail = 3;
+ } else if (i == 2) {
+ xe.u.u.detail = 2;
+ } else {
+ xe.u.u.detail = i + 1;
+ }
+ if (hwButtons & (1 << i)) {
+ xe.u.u.type = ButtonPress;
+ } else {
+ xe.u.u.type = ButtonRelease;
+ }
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ }
+ break;
+ }
+
+ case kXDarwinScrollWheel:
+ {
+ short count = xe.u.clientMessage.u.s.shorts0;
+
+ if (count > 0) {
+ xe.u.u.detail = SCROLLWHEELUPFAKE;
+ } else {
+ xe.u.u.detail = SCROLLWHEELDOWNFAKE;
+ count = -count;
+ }
+
+ for (; count; --count) {
+ xe.u.u.type = ButtonPress;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ xe.u.u.type = ButtonRelease;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ break;
+ }
+
+ default:
+ if (quartz) {
+ QuartzProcessEvent(&xe);
+ } else {
+ ErrorF("Unknown X event caught: %d\n", xe.u.u.type);
+ }
+ }
+ }
+ }
+
+ miPointerUpdate();
+}
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
new file mode 100644
index 000000000..4113bacba
--- /dev/null
+++ b/hw/darwin/darwinKeyboard.c
@@ -0,0 +1,805 @@
+//=============================================================================
+//
+// Keyboard support for the Darwin X Server
+//
+// Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+//
+// The code to parse the Darwin keymap is derived from dumpkeymap.c
+// by Eric Sunshine, which includes the following copyright:
+//
+// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
+// All rights reserved.
+//
+//-----------------------------------------------------------------------------
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+//=============================================================================
+
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.17 2002/12/10 00:00:38 torrey Exp $ */
+
+/*
+===========================================================================
+
+ An X keyCode must be in the range XkbMinLegalKeyCode (8) to
+ XkbMaxLegalKeyCode(255).
+
+ The keyCodes we get from the kernel range from 0 to 127, so we need to
+ offset the range before passing the keyCode to X.
+
+ An X KeySym is an extended ascii code that is device independent.
+
+ The modifier map is accessed by the keyCode, but the normal map is
+ accessed by keyCode - MIN_KEYCODE. Sigh.
+
+===========================================================================
+*/
+
+// Define this to get a diagnostic output to stderr which is helpful
+// in determining how the X server is interpreting the Darwin keymap.
+#undef DUMP_DARWIN_KEYMAP
+
+#include <drivers/event_status_driver.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <architecture/byte_order.h> // For the NXSwap*
+#include "darwin.h"
+#include "xfIOKit.h"
+#include "quartz/quartzAudio.h"
+#include "quartz/quartzShared.h"
+
+#define XK_TECHNICAL // needed to get XK_Escape
+#define XK_PUBLISHING
+#include "keysym.h"
+
+// Each key can generate 4 glyphs. They are, in order:
+// unshifted, shifted, modeswitch unshifted, modeswitch shifted
+#define GLYPHS_PER_KEY 4
+#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
+#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
+
+#define AltMask Mod1Mask
+#define MetaMask Mod2Mask
+#define FunctionMask Mod3Mask
+
+// FIXME: It would be nice to support some of the extra keys in XF86keysym.h,
+// at least the volume controls that now ship on every Apple keyboard.
+
+#define UK(a) NoSymbol // unknown symbol
+
+static KeySym const next_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, XK_Return, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+// 128
+ NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex,
+ XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+// 144
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave,
+ XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute,
+ XK_THORN, XK_mu, XK_multiply, XK_division,
+// 160
+ XK_copyright, XK_exclamdown, XK_cent, XK_sterling,
+ UK(fraction), XK_yen, UK(fhook), XK_section,
+ XK_currency, XK_rightsinglequotemark,
+ XK_leftdoublequotemark,
+ XK_guillemotleft,
+ XK_leftanglebracket,
+ XK_rightanglebracket,
+ UK(filigature), UK(flligature),
+// 176
+ XK_registered, XK_endash, XK_dagger, XK_doubledagger,
+ XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet),
+ XK_singlelowquotemark,
+ XK_doublelowquotemark,
+ XK_rightdoublequotemark,
+ XK_guillemotright,
+ XK_ellipsis, UK(permille), XK_notsign, XK_questiondown,
+// 192
+ XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex,
+ XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot,
+ XK_dead_diaeresis,
+ XK_twosuperior, XK_dead_abovering,
+ XK_dead_cedilla,
+ XK_threesuperior,
+ XK_dead_doubleacute,
+ XK_dead_ogonek, XK_dead_caron,
+// 208
+ XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf,
+ XK_threequarters,
+ XK_agrave, XK_aacute, XK_acircumflex,
+ XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+// 224
+ XK_igrave, XK_AE, XK_iacute, XK_ordfeminine,
+ XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde,
+ XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine,
+ XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde,
+// 240
+ XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute,
+ XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave,
+ XK_lstroke, XK_ooblique, XK_oe, XK_ssharp,
+ XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol,
+ };
+
+#define MIN_SYMBOL 0xAC
+static KeySym const symbol_to_x[] = {
+ XK_Left, XK_Up, XK_Right, XK_Down
+ };
+int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
+
+#define MIN_FUNCKEY 0x20
+static KeySym const funckey_to_x[] = {
+ XK_F1, XK_F2, XK_F3, XK_F4,
+ XK_F5, XK_F6, XK_F7, XK_F8,
+ XK_F9, XK_F10, XK_F11, XK_F12,
+ XK_Insert, XK_Delete, XK_Home, XK_End,
+ XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
+ XK_F15
+ };
+int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
+
+typedef struct {
+ KeySym normalSym;
+ KeySym keypadSym;
+} darwinKeyPad_t;
+
+static darwinKeyPad_t const normal_to_keypad[] = {
+ { XK_0, XK_KP_0 },
+ { XK_1, XK_KP_1 },
+ { XK_2, XK_KP_2 },
+ { XK_3, XK_KP_3 },
+ { XK_4, XK_KP_4 },
+ { XK_5, XK_KP_5 },
+ { XK_6, XK_KP_6 },
+ { XK_7, XK_KP_7 },
+ { XK_8, XK_KP_8 },
+ { XK_9, XK_KP_9 },
+ { XK_equal, XK_KP_Equal },
+ { XK_asterisk, XK_KP_Multiply },
+ { XK_plus, XK_KP_Add },
+ { XK_comma, XK_KP_Separator },
+ { XK_minus, XK_KP_Subtract },
+ { XK_period, XK_KP_Decimal },
+ { XK_slash, XK_KP_Divide }
+};
+int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
+
+static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
+{
+ // keyclick, bell volume / pitch, autorepead, LED's
+}
+
+static CARD8 modMap[MAP_LENGTH];
+static KeySym map[MAP_LENGTH * GLYPHS_PER_KEY];
+static unsigned char modifierKeycodes[NX_NUMMODIFIERS][2];
+static FILE *fref = NULL;
+static char *inBuffer = NULL;
+
+//-----------------------------------------------------------------------------
+// Data Stream Object
+// Can be configured to treat embedded "numbers" as being composed of
+// either 1, 2, or 4 bytes, apiece.
+//-----------------------------------------------------------------------------
+typedef struct _DataStream
+{
+ unsigned char const *data;
+ unsigned char const *data_end;
+ short number_size; // Size in bytes of a "number" in the stream.
+} DataStream;
+
+static DataStream* new_data_stream( unsigned char const* data, int size )
+{
+ DataStream* s = (DataStream*)xalloc( sizeof(DataStream) );
+ s->data = data;
+ s->data_end = data + size;
+ s->number_size = 1; // Default to byte-sized numbers.
+ return s;
+}
+
+static void destroy_data_stream( DataStream* s )
+{
+ xfree(s);
+}
+
+static unsigned char get_byte( DataStream* s )
+{
+ assert(s->data + 1 <= s->data_end);
+ return *s->data++;
+}
+
+static short get_word( DataStream* s )
+{
+ short hi, lo;
+ assert(s->data + 2 <= s->data_end);
+ hi = *s->data++;
+ lo = *s->data++;
+ return ((hi << 8) | lo);
+}
+
+static int get_dword( DataStream* s )
+{
+ int b1, b2, b3, b4;
+ assert(s->data + 4 <= s->data_end);
+ b4 = *s->data++;
+ b3 = *s->data++;
+ b2 = *s->data++;
+ b1 = *s->data++;
+ return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
+}
+
+static int get_number( DataStream* s )
+{
+ switch (s->number_size) {
+ case 4: return get_dword(s);
+ case 2: return get_word(s);
+ default: return get_byte(s);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Utility functions to help parse Darwin keymap
+//-----------------------------------------------------------------------------
+
+/*
+ * bits_set
+ * Calculate number of bits set in the modifier mask.
+ */
+static short bits_set( short mask )
+{
+ short n = 0;
+
+ for ( ; mask != 0; mask >>= 1)
+ if ((mask & 0x01) != 0)
+ n++;
+ return n;
+}
+
+/*
+ * parse_next_char_code
+ * Read the next character code from the Darwin keymapping
+ * and write it to the X keymap.
+ */
+static void parse_next_char_code(
+ DataStream *s,
+ KeySym *k )
+{
+ const short charSet = get_number(s);
+ const short charCode = get_number(s);
+
+ if (charSet == 0) { // ascii character
+ if (charCode >= 0 && charCode < 256)
+ *k = next_to_x[charCode];
+ } else if (charSet == 0x01) { // symbol character
+ if (charCode >= MIN_SYMBOL &&
+ charCode <= MIN_SYMBOL + NUM_SYMBOL)
+ *k = symbol_to_x[charCode - MIN_SYMBOL];
+ } else if (charSet == 0xFE) { // function key
+ if (charCode >= MIN_FUNCKEY &&
+ charCode <= MIN_FUNCKEY + NUM_FUNCKEY)
+ *k = funckey_to_x[charCode - MIN_FUNCKEY];
+ }
+}
+
+
+/*
+ * DarwinReadKeymapFile
+ * Read the appropriate keymapping from a keymapping file.
+ */
+Bool DarwinReadKeymapFile(
+ NXKeyMapping *keyMap)
+{
+ struct stat st;
+ NXEventSystemDevice info[20];
+ int interface = 0, handler_id = 0;
+ int map_interface, map_handler_id, map_size = 0;
+ unsigned int i, size;
+ int *bufferEnd;
+ union km_tag {
+ int *intP;
+ char *charP;
+ } km;
+
+ fref = fopen( darwinKeymapFile, "rb" );
+ if (fref == NULL) {
+ ErrorF("Unable to open keymapping file '%s' (errno %d).\n",
+ darwinKeymapFile, errno);
+ return FALSE;
+ }
+ if (fstat(fileno(fref), &st) == -1) {
+ ErrorF("Could not stat keymapping file '%s' (errno %d).\n",
+ darwinKeymapFile, errno);
+ return FALSE;
+ }
+
+ // check to make sure we don't crash later
+ if (st.st_size <= 16*sizeof(int)) {
+ ErrorF("Keymapping file '%s' is invalid (too small).\n",
+ darwinKeymapFile);
+ return FALSE;
+ }
+
+ inBuffer = (char*) xalloc( st.st_size );
+ bufferEnd = (int *) (inBuffer + st.st_size);
+ if (fread(inBuffer, st.st_size, 1, fref) != 1) {
+ ErrorF("Could not read %qd bytes from keymapping file '%s' (errno %d).\n",
+ st.st_size, darwinKeymapFile, errno);
+ return FALSE;
+ }
+
+ if (strncmp( inBuffer, "KYM1", 4 ) == 0) {
+ // Magic number OK.
+ } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) {
+ ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ } else {
+ ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ }
+
+ // find the keyboard interface and handler id
+ size = sizeof( info ) / sizeof( int );
+ if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO,
+ (NXEventSystemInfoType) info, &size )) {
+ ErrorF("Error reading event status driver info.\n");
+ return FALSE;
+ }
+
+ size = size * sizeof( int ) / sizeof( info[0] );
+ for( i = 0; i < size; i++) {
+ if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) {
+ Bool hasInterface = FALSE;
+ Bool hasMatch = FALSE;
+
+ interface = info[i].interface;
+ handler_id = info[i].id;
+
+ // Find an appropriate keymapping:
+ // The first time we try to match both interface and handler_id.
+ // If we can't match both, we take the first match for interface.
+
+ do {
+ km.charP = inBuffer;
+ km.intP++;
+ while (km.intP+3 < bufferEnd) {
+ map_interface = NXSwapBigIntToHost(*(km.intP++));
+ map_handler_id = NXSwapBigIntToHost(*(km.intP++));
+ map_size = NXSwapBigIntToHost(*(km.intP++));
+ if (map_interface == interface) {
+ if (map_handler_id == handler_id || hasInterface) {
+ hasMatch = TRUE;
+ break;
+ } else {
+ hasInterface = TRUE;
+ }
+ }
+ km.charP += map_size;
+ }
+ } while (hasInterface && !hasMatch);
+
+ if (hasMatch) {
+ // fill in NXKeyMapping structure
+ keyMap->size = map_size;
+ keyMap->mapping = (char*) xalloc(map_size);
+ memcpy(keyMap->mapping, km.charP, map_size);
+ return TRUE;
+ }
+ } // if dev_id == keyboard device
+ } // foreach info struct
+
+ // The keymapping file didn't match any of the info structs
+ // returned by NXEventSystemInfo.
+ ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile);
+ return FALSE;
+}
+
+
+/*
+ * DarwinKeyboardInit
+ * Get the Darwin keyboard map and compute an equivalent
+ * X keyboard map and modifier map. Set the new keyboard
+ * device structure.
+ */
+void DarwinKeyboardInit(
+ DeviceIntPtr pDev )
+{
+ KeySym *k;
+ int i;
+ short numMods, numKeys, numPadKeys = 0;
+ KeySymsRec keySyms;
+ NXKeyMapping keyMap;
+ DataStream *keyMapStream;
+ unsigned char const *numPadStart = 0;
+ BellProcPtr bellProc;
+ Bool haveKeymap = FALSE;
+
+ memset( modMap, NoSymbol, sizeof( modMap ) );
+ memset( map, 0, sizeof( map ) );
+ for (i = 0; i < NX_NUMMODIFIERS; i++) {
+ modifierKeycodes[i][0] = modifierKeycodes[i][1] = 0;
+ }
+
+ // Open a shared connection to the HID System.
+ // Note that the Event Status Driver is really just a wrapper
+ // for a kIOHIDParamConnectType connection.
+ assert( darwinParamConnect = NXOpenEventStatus() );
+
+ if (darwinKeymapFile) {
+ haveKeymap = DarwinReadKeymapFile(&keyMap);
+ if (fref)
+ fclose(fref);
+ if (inBuffer)
+ xfree(inBuffer);
+ if (!haveKeymap) {
+ ErrorF("Reverting to kernel keymapping.\n");
+ }
+ }
+
+ if (!haveKeymap) {
+ // get the Darwin keyboard map
+ keyMap.size = NXKeyMappingLength( darwinParamConnect );
+ keyMap.mapping = (char*) xalloc( keyMap.size );
+ if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) {
+ FatalError("Could not get kernel keymapping! Load keymapping from file instead.\n");
+ }
+ }
+
+ keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping,
+ keyMap.size );
+
+ // check the type of map
+ if (get_word(keyMapStream)) {
+ keyMapStream->number_size = 2;
+ ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n");
+ }
+
+ // Compute the modifier map and
+ // insert X modifier KeySyms into keyboard map.
+ // Store modifier keycodes in modifierKeycodes.
+ numMods = get_number(keyMapStream);
+ while (numMods-- > 0) {
+ int left = 1; // first keycode is left
+ short const charCode = get_number(keyMapStream);
+ short numKeyCodes = get_number(keyMapStream);
+
+ // This is just a marker, not a real modifier.
+ // Store numeric keypad keys for later.
+ if (charCode == NX_MODIFIERKEY_NUMERICPAD) {
+ numPadStart = keyMapStream->data;
+ numPadKeys = numKeyCodes;
+ }
+
+ while (numKeyCodes-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ if (charCode != NX_MODIFIERKEY_NUMERICPAD) {
+ modifierKeycodes[charCode][1-left] = keyCode;
+ switch (charCode) {
+ case NX_MODIFIERKEY_ALPHALOCK:
+ modMap[keyCode + MIN_KEYCODE] = LockMask;
+ map[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
+ break;
+ case NX_MODIFIERKEY_SHIFT:
+ modMap[keyCode + MIN_KEYCODE] = ShiftMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Shift_L : XK_Shift_R);
+ break;
+ case NX_MODIFIERKEY_CONTROL:
+ modMap[keyCode + MIN_KEYCODE] = ControlMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_ALTERNATE:
+ modMap[keyCode + MIN_KEYCODE] = AltMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Mode_switch : XK_Alt_R);
+ break;
+ case NX_MODIFIERKEY_COMMAND:
+ modMap[keyCode + MIN_KEYCODE] = MetaMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Meta_L : XK_Meta_R);
+ break;
+ case NX_MODIFIERKEY_SECONDARYFN:
+ modMap[keyCode + MIN_KEYCODE] = FunctionMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_HELP:
+ // Help is not an X11 modifier; treat as normal key
+ map[keyCode * GLYPHS_PER_KEY] = XK_Help;
+ break;
+ }
+ }
+ left = 0;
+ }
+ }
+
+ // Convert the Darwin keyboard map to an X keyboard map.
+ // A key can have a different character code for each combination of
+ // modifiers. We currently ignore all modifier combinations except
+ // those with Shift, AlphaLock, and Alt.
+ numKeys = get_number(keyMapStream);
+ for (i = 0, k = map; i < numKeys; i++, k += GLYPHS_PER_KEY) {
+ short const charGenMask = get_number(keyMapStream);
+ if (charGenMask != 0xFF) { // is key bound?
+ short numKeyCodes = 1 << bits_set(charGenMask);
+
+ // Record unmodified case
+ parse_next_char_code( keyMapStream, k );
+ numKeyCodes--;
+
+ // If AlphaLock and Shift modifiers produce different codes,
+ // we record the Shift case since X handles AlphaLock.
+ if (charGenMask & 0x01) { // AlphaLock
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Shift
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+
+ // Skip the Control cases
+ if (charGenMask & 0x04) { // Control
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Control-Shift
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ // Process Alt cases
+ if (charGenMask & 0x08) { // Alt
+ parse_next_char_code( keyMapStream, k+2 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-AlphaLock
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Alt-Shift
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ while (numKeyCodes-- > 0) {
+ get_number(keyMapStream); get_number(keyMapStream);
+ }
+
+ if (k[3] == k[2]) k[3] = NoSymbol;
+ if (k[2] == k[1]) k[2] = NoSymbol;
+ if (k[1] == k[0]) k[1] = NoSymbol;
+ if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ }
+ }
+
+ // Now we have to go back through the list of keycodes that are on the
+ // numeric keypad and update the X keymap.
+ keyMapStream->data = numPadStart;
+ while(numPadKeys-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ k = &map[keyCode * GLYPHS_PER_KEY];
+ for (i = 0; i < NUM_KEYPAD; i++) {
+ if (*k == normal_to_keypad[i].normalSym) {
+ k[0] = normal_to_keypad[i].keypadSym;
+ break;
+ }
+ }
+ }
+
+ // free Darwin keyboard map
+ destroy_data_stream( keyMapStream );
+ xfree( keyMap.mapping );
+
+#ifdef DUMP_DARWIN_KEYMAP
+ ErrorF("Darwin -> X converted keyboard map\n");
+ for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) {
+ int j;
+ ErrorF("0x%02x:", i);
+ for (j = 0; j < GLYPHS_PER_KEY; j++) {
+ if (k[j] == NoSymbol) {
+ ErrorF("\tNoSym");
+ } else {
+ ErrorF("\t0x%x", k[j]);
+ }
+ }
+ ErrorF("\n");
+ }
+#endif
+
+ keySyms.map = map;
+ keySyms.mapWidth = GLYPHS_PER_KEY;
+ keySyms.minKeyCode = MIN_KEYCODE;
+ keySyms.maxKeyCode = MAX_KEYCODE;
+
+ if (quartz)
+ bellProc = QuartzBell;
+ else
+ bellProc = XFIOKitBell;
+
+ assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, modMap,
+ bellProc,
+ DarwinChangeKeyboardControl ));
+}
+
+//-----------------------------------------------------------------------------
+// Modifier translation functions
+//
+// There are three different ways to specify a Mac modifier key:
+// keycode - specifies hardware key, read from keymapping
+// key - NX_MODIFIERKEY_*, really an index
+// mask - NX_*MASK, mask for modifier flags in event record
+// Left and right side have different keycodes but the same key and mask.
+//-----------------------------------------------------------------------------
+
+/*
+ * DarwinModifierNXKeyToNXKeycode
+ * Return the keycode for an NX_MODIFIERKEY_* modifier.
+ * side = 0 for left or 1 for right.
+ * Returns 0 if key+side is not a known modifier.
+ */
+int DarwinModifierNXKeyToNXKeycode(int key, int side)
+{
+ return modifierKeycodes[key][side];
+}
+
+/*
+ * DarwinModifierNXKeycodeToNXKey
+ * Returns -1 if keycode+side is not a modifier key
+ * outSide may be NULL, else it gets 0 for left and 1 for right.
+ */
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
+{
+ int key, side;
+
+ keycode += MIN_KEYCODE;
+ // search modifierKeycodes for this keycode+side
+ for (key = 0; key < NX_NUMMODIFIERS; key++) {
+ for (side = 0; side <= 1; side++) {
+ if (modifierKeycodes[key][side] == keycode) break;
+ }
+ }
+ if (key == NX_NUMMODIFIERS) return -1;
+ if (outSide) *outSide = side;
+ return key;
+}
+
+/*
+ * DarwinModifierNXMaskToNXKey
+ * Returns -1 if mask is not a known modifier mask.
+ */
+int DarwinModifierNXMaskToNXKey(int mask)
+{
+ switch (mask) {
+ case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
+ case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
+ case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
+ case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
+ case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
+ case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
+ case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
+ case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
+ }
+ return -1;
+}
+
+/*
+ * DarwinModifierNXKeyToNXMask
+ * Returns 0 if key is not a known modifier key.
+ */
+int DarwinModifierNXKeyToNXMask(int key)
+{
+ switch (key) {
+ case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
+ case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
+ case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK;
+ case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK;
+ case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK;
+ case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK;
+ case NX_MODIFIERKEY_HELP: return NX_HELPMASK;
+ case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK;
+ }
+ return 0;
+}
+
+/*
+ * DarwinModifierStringToNXKey
+ * Returns -1 if string is not a known modifier.
+ */
+int DarwinModifierStringToNXKey(const char *str)
+{
+ if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT;
+ else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL;
+ else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE;
+ else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND;
+ else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN;
+ else return -1;
+}
+
+/*
+ * LegalModifier
+ * This allows the ddx layer to prevent some keys from being remapped
+ * as modifier keys.
+ */
+Bool LegalModifier(unsigned int key, DevicePtr pDev)
+{
+ return 1;
+}
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
new file mode 100644
index 000000000..2c0d6756b
--- /dev/null
+++ b/hw/darwin/quartz/Preferences.h
@@ -0,0 +1,107 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface Preferences : NSObject
+{
+ IBOutlet NSPanel *window;
+ IBOutlet id displayField;
+ IBOutlet id dockSwitchButton;
+ IBOutlet id fakeButton;
+ IBOutlet id button2ModifiersMatrix;
+ IBOutlet id button3ModifiersMatrix;
+ IBOutlet id switchKeyButton;
+ IBOutlet id keymapFileField;
+ IBOutlet id modeMatrix;
+ IBOutlet id modeWindowButton;
+ IBOutlet id startupHelpButton;
+ IBOutlet id systemBeepButton;
+ IBOutlet id mouseAccelChangeButton;
+ IBOutlet id useXineramaButton;
+ IBOutlet id addToPathButton;
+ IBOutlet id addToPathField;
+ IBOutlet id useDefaultShellMatrix;
+ IBOutlet id useOtherShellField;
+ IBOutlet id depthButton;
+
+ BOOL isGettingKeyCode;
+ int keyCode;
+ int modifiers;
+ NSMutableString *switchString;
+}
+
+- (IBAction)close:(id)sender;
+- (IBAction)pickFile:(id)sender;
+- (IBAction)saveChanges:(id)sender;
+- (IBAction)setKey:(id)sender;
+
+- (BOOL)sendEvent:(NSEvent*)anEvent;
+
+- (void)awakeFromNib;
+- (void)windowWillClose:(NSNotification *)aNotification;
+
++ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
++ (void)setKeymapFile:(NSString*)newFile;
++ (void)setSwitchString:(NSString*)newString;
++ (void)setKeyCode:(int)newKeyCode;
++ (void)setModifiers:(int)newModifiers;
++ (void)setDisplay:(int)newDisplay;
++ (void)setDockSwitch:(BOOL)newDockSwitch;
++ (void)setFakeButtons:(BOOL)newFakeButtons;
++ (void)setButton2Mask:(int)newFakeMask;
++ (void)setButton3Mask:(int)newFakeMask;
++ (void)setMouseAccelChange:(BOOL)newMouseAccelChange;
++ (void)setUseQDCursor:(int)newUseQDCursor;
++ (void)setRootless:(BOOL)newRootless;
++ (void)setUseAGL:(BOOL)newUseAGL;
++ (void)setModeWindow:(BOOL)newModeWindow;
++ (void)setStartupHelp:(BOOL)newStartupHelp;
++ (void)setSystemBeep:(BOOL)newSystemBeep;
++ (void)setXinerama:(BOOL)newXinerama;
++ (void)setAddToPath:(BOOL)newAddToPath;
++ (void)setAddToPathString:(NSString*)newAddToPathString;
++ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
++ (void)setShellString:(NSString*)newShellString;
++ (void)setDepth:(int)newDepth;
++ (void)saveToDisk;
+
++ (BOOL)useKeymapFile;
++ (NSString*)keymapFile;
++ (NSString*)switchString;
++ (unsigned int)keyCode;
++ (unsigned int)modifiers;
++ (int)display;
++ (BOOL)dockSwitch;
++ (BOOL)fakeButtons;
++ (int)button2Mask;
++ (int)button3Mask;
++ (BOOL)mouseAccelChange;
++ (int)useQDCursor;
++ (BOOL)rootless;
++ (BOOL)useAGL;
++ (BOOL)modeWindow;
++ (BOOL)startupHelp;
++ (BOOL)systemBeep;
++ (BOOL)xinerama;
++ (BOOL)addToPath;
++ (NSString*)addToPathString;
++ (BOOL)useDefaultShell;
++ (NSString*)shellString;
++ (int)depth;
+
+@end
+
+// Possible settings for useQDCursor
+enum {
+ qdCursor_Never, // never use QuickDraw cursor
+ qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth
+ qdCursor_Always // always try to use QuickDraw cursor
+};
+
+// Possible settings for depth
+enum {
+ depth_Current,
+ depth_8Bit,
+ depth_15Bit,
+ depth_24Bit
+};
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
new file mode 100644
index 000000000..4f8dacbf0
--- /dev/null
+++ b/hw/darwin/quartz/Preferences.m
@@ -0,0 +1,530 @@
+//
+// Preferences.m
+//
+// This class keeps track of the user preferences.
+//
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.2 2003/01/15 02:34:06 torrey Exp $ */
+
+#import "Preferences.h"
+#import "quartzCommon.h"
+#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
+
+// Macros to build the path name
+#ifndef XBINDIR
+#define XBINDIR /usr/X11R6/bin
+#endif
+#define STR(s) #s
+#define XSTRPATH(s) STR(s)
+
+
+@implementation Preferences
+
++ (void)initialize
+{
+ // Provide user defaults if needed
+ NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:0], @"Display",
+ @"YES", @"FakeButtons",
+ [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask",
+ [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask",
+ NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile",
+ @"YES", @"UseKeymappingFile",
+ NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString",
+ @"YES", @"UseRootlessMode",
+ @"YES", @"UseAGLforGLX",
+ @"YES", @"ShowModePickWindow",
+ @"YES", @"ShowStartupHelp",
+ [NSNumber numberWithInt:0], @"SwitchKeyCode",
+ [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
+ @"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"YES", @"DockSwitch",
+ @"NO", @"AllowMouseAccelChange",
+ [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
+ @"YES", @"Xinerama",
+ @"YES", @"AddToPath",
+ [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
+ @"YES", @"UseDefaultShell",
+ @"/bin/tcsh", @"Shell",
+ [NSNumber numberWithInt:depth_Current], @"Depth", nil];
+
+ [super initialize];
+ [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
+}
+
+// Initialize internal state info of switch key button
+- (void)initSwitchKey
+{
+ keyCode = [Preferences keyCode];
+ modifiers = [Preferences modifiers];
+ [switchString setString:[Preferences switchString]];
+}
+
+- (id)init
+{
+ self = [super init];
+
+ isGettingKeyCode=NO;
+ switchString=[[NSMutableString alloc] init];
+ [self initSwitchKey];
+
+ return self;
+}
+
+// Set a modifiers checkbox matrix to match a modifier mask
+- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask
+{
+ [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0];
+ [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0];
+ [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0];
+ [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0];
+ [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0];
+}
+
+// Generate a modifiers mask from a modifiers checkbox matrix
+- (int)getMaskFromMatrix:(NSMatrix *)aMatrix
+{
+ int theMask = 0;
+
+ if ([[aMatrix cellAtRow:0 column:0] state])
+ theMask |= NX_SHIFTMASK;
+ if ([[aMatrix cellAtRow:1 column:0] state])
+ theMask |= NX_CONTROLMASK;
+ if ([[aMatrix cellAtRow:2 column:0] state])
+ theMask |= NX_COMMANDMASK;
+ if ([[aMatrix cellAtRow:3 column:0] state])
+ theMask |= NX_ALTERNATEMASK;
+ if ([[aMatrix cellAtRow:4 column:0] state])
+ theMask |= NX_SECONDARYFNMASK;
+
+ return theMask;
+}
+
+// Set the window controls to the state in user defaults
+- (void)resetWindow
+{
+ if ([Preferences keymapFile] == nil)
+ [keymapFileField setStringValue:@" "];
+ else
+ [keymapFileField setStringValue:[Preferences keymapFile]];
+
+ if ([Preferences switchString] == nil)
+ [switchKeyButton setTitle:@"--"];
+ else
+ [switchKeyButton setTitle:[Preferences switchString]];
+
+ [displayField setIntValue:[Preferences display]];
+ [dockSwitchButton setIntValue:[Preferences dockSwitch]];
+ [fakeButton setIntValue:[Preferences fakeButtons]];
+ [self resetMatrix:button2ModifiersMatrix
+ withMask:[Preferences button2Mask]];
+ [self resetMatrix:button3ModifiersMatrix
+ withMask:[Preferences button3Mask]];
+ [modeMatrix setState:[Preferences rootless] atRow:0 column:1];
+ [startupHelpButton setIntValue:[Preferences startupHelp]];
+ [modeWindowButton setIntValue:[Preferences modeWindow]];
+ [systemBeepButton setIntValue:[Preferences systemBeep]];
+ [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]];
+ [useXineramaButton setIntValue:[Preferences xinerama]];
+ [addToPathButton setIntValue:[Preferences addToPath]];
+ [addToPathField setStringValue:[Preferences addToPathString]];
+ [useDefaultShellMatrix setState:![Preferences useDefaultShell]
+ atRow:1 column:0];
+ [useOtherShellField setStringValue:[Preferences shellString]];
+ [depthButton selectItemAtIndex:[Preferences depth]];
+}
+
+- (void)awakeFromNib
+{
+ [self resetWindow];
+}
+
+// Preference window delegate
+- (void)windowWillClose:(NSNotification *)aNotification
+{
+ [self resetWindow];
+ [self initSwitchKey];
+}
+
+// User cancelled the changes
+- (IBAction)close:(id)sender
+{
+ [window orderOut:nil];
+ [self resetWindow]; // reset window controls
+ [self initSwitchKey]; // reset switch key state
+}
+
+// Pick keymapping file
+- (IBAction)pickFile:(id)sender
+{
+ int result;
+ NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"];
+ NSOpenPanel *oPanel = [NSOpenPanel openPanel];
+
+ [oPanel setAllowsMultipleSelection:NO];
+ result = [oPanel runModalForDirectory:@"/System/Library/Keyboards"
+ file:nil types:fileTypes];
+ if (result == NSOKButton) {
+ [keymapFileField setStringValue:[oPanel filename]];
+ }
+}
+
+// User saved changes
+- (IBAction)saveChanges:(id)sender
+{
+ [Preferences setKeyCode:keyCode];
+ [Preferences setModifiers:modifiers];
+ [Preferences setSwitchString:switchString];
+ [Preferences setKeymapFile:[keymapFileField stringValue]];
+ [Preferences setUseKeymapFile:YES];
+ [Preferences setDisplay:[displayField intValue]];
+ [Preferences setDockSwitch:[dockSwitchButton intValue]];
+ [Preferences setFakeButtons:[fakeButton intValue]];
+ [Preferences setButton2Mask:
+ [self getMaskFromMatrix:button2ModifiersMatrix]];
+ [Preferences setButton3Mask:
+ [self getMaskFromMatrix:button3ModifiersMatrix]];
+ [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]];
+ [Preferences setModeWindow:[modeWindowButton intValue]];
+ [Preferences setStartupHelp:[startupHelpButton intValue]];
+ [Preferences setSystemBeep:[systemBeepButton intValue]];
+ [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]];
+ [Preferences setXinerama:[useXineramaButton intValue]];
+ [Preferences setAddToPath:[addToPathButton intValue]];
+ [Preferences setAddToPathString:[addToPathField stringValue]];
+ [Preferences setUseDefaultShell:
+ [[useDefaultShellMatrix cellAtRow:0 column:0] state]];
+ [Preferences setShellString:[useOtherShellField stringValue]];
+ [Preferences setDepth:[depthButton indexOfSelectedItem]];
+ [Preferences saveToDisk];
+
+ [window orderOut:nil];
+}
+
+- (IBAction)setKey:(id)sender
+{
+ [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")];
+ isGettingKeyCode=YES;
+ [switchString setString:@""];
+}
+
+- (BOOL)sendEvent:(NSEvent*)anEvent
+{
+ if(isGettingKeyCode) {
+ if([anEvent type]==NSKeyDown) // wait for keyup
+ return YES;
+ if([anEvent type]!=NSKeyUp)
+ return NO;
+
+ if([anEvent modifierFlags] & NSCommandKeyMask)
+ [switchString appendString:@"Cmd-"];
+ if([anEvent modifierFlags] & NSControlKeyMask)
+ [switchString appendString:@"Ctrl-"];
+ if([anEvent modifierFlags] & NSAlternateKeyMask)
+ [switchString appendString:@"Opt-"];
+ if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work
+ [switchString appendString:@"Num-"];
+ if([anEvent modifierFlags] & NSHelpKeyMask)
+ [switchString appendString:@"Help-"];
+ if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only
+ [switchString appendString:@"Fn-"];
+
+ [switchString appendString:[anEvent charactersIgnoringModifiers]];
+ [switchKeyButton setTitle:switchString];
+
+ keyCode = [anEvent keyCode];
+ modifiers = [anEvent modifierFlags];
+ isGettingKeyCode=NO;
+
+ return YES;
+ }
+ return NO;
+}
+
++ (void)setKeymapFile:(NSString*)newFile
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newFile
+ forKey:@"KeymappingFile"];
+}
+
++ (void)setUseKeymapFile:(BOOL)newUseKeymapFile
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile
+ forKey:@"UseKeymappingFile"];
+}
+
++ (void)setSwitchString:(NSString*)newString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newString
+ forKey:@"SwitchString"];
+}
+
++ (void)setKeyCode:(int)newKeyCode
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode
+ forKey:@"SwitchKeyCode"];
+}
+
++ (void)setModifiers:(int)newModifiers
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newModifiers
+ forKey:@"SwitchModifiers"];
+}
+
++ (void)setDisplay:(int)newDisplay
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newDisplay
+ forKey:@"Display"];
+}
+
++ (void)setDockSwitch:(BOOL)newDockSwitch
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch
+ forKey:@"DockSwitch"];
+}
+
++ (void)setFakeButtons:(BOOL)newFakeButtons
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons
+ forKey:@"FakeButtons"];
+ // Update the setting used by the X server thread
+ darwinFakeButtons = newFakeButtons;
+}
+
++ (void)setButton2Mask:(int)newFakeMask
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
+ forKey:@"Button2Mask"];
+ // Update the setting used by the X server thread
+ darwinFakeMouse2Mask = newFakeMask;
+}
+
++ (void)setButton3Mask:(int)newFakeMask
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
+ forKey:@"Button3Mask"];
+ // Update the setting used by the X server thread
+ darwinFakeMouse3Mask = newFakeMask;
+}
+
++ (void)setMouseAccelChange:(BOOL)newMouseAccelChange
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
+ forKey:@"AllowMouseAccelChange"];
+ // Update the setting used by the X server thread
+ quartzMouseAccelChange = newMouseAccelChange;
+}
+
++ (void)setUseQDCursor:(int)newUseQDCursor
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor
+ forKey:@"UseQDCursor"];
+}
+
++ (void)setModeWindow:(BOOL)newModeWindow
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newModeWindow
+ forKey:@"ShowModePickWindow"];
+}
+
++ (void)setRootless:(BOOL)newRootless
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newRootless
+ forKey:@"UseRootlessMode"];
+}
+
++ (void)setUseAGL:(BOOL)newUseAGL
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseAGL
+ forKey:@"UseAGLforGLX"];
+}
+
++ (void)setStartupHelp:(BOOL)newStartupHelp
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp
+ forKey:@"ShowStartupHelp"];
+}
+
++ (void)setSystemBeep:(BOOL)newSystemBeep
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep
+ forKey:@"UseSystemBeep"];
+ // Update the setting used by the X server thread
+ quartzUseSysBeep = newSystemBeep;
+}
+
++ (void)setXinerama:(BOOL)newXinerama
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newXinerama
+ forKey:@"Xinerama"];
+}
+
++ (void)setAddToPath:(BOOL)newAddToPath
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newAddToPath
+ forKey:@"AddToPath"];
+}
+
++ (void)setAddToPathString:(NSString*)newAddToPathString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
+ forKey:@"AddToPathString"];
+}
+
++ (void)setUseDefaultShell:(BOOL)newUseDefaultShell
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell
+ forKey:@"UseDefaultShell"];
+}
+
++ (void)setShellString:(NSString*)newShellString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newShellString
+ forKey:@"Shell"];
+}
+
++ (void)setDepth:(int)newDepth
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newDepth
+ forKey:@"Depth"];
+}
+
++ (void)saveToDisk
+{
+ [[NSUserDefaults standardUserDefaults] synchronize];
+}
+
++ (BOOL)useKeymapFile
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseKeymappingFile"];
+}
+
++ (NSString*)keymapFile
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"KeymappingFile"];
+}
+
++ (NSString*)switchString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"SwitchString"];
+}
+
++ (unsigned int)keyCode
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"SwitchKeyCode"];
+}
+
++ (unsigned int)modifiers
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"SwitchModifiers"];
+}
+
++ (int)display
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Display"];
+}
+
++ (BOOL)dockSwitch
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
+}
+
++ (BOOL)fakeButtons
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
+}
+
++ (int)button2Mask
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Button2Mask"];
+}
+
++ (int)button3Mask
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Button3Mask"];
+}
+
++ (BOOL)mouseAccelChange
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"AllowMouseAccelChange"];
+}
+
++ (int)useQDCursor
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"UseQDCursor"];
+}
+
++ (BOOL)rootless
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseRootlessMode"];
+}
+
++ (BOOL)useAGL
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseAGLforGLX"];
+}
+
++ (BOOL)modeWindow
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"ShowModePickWindow"];
+}
+
++ (BOOL)startupHelp
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"ShowStartupHelp"];
+}
+
++ (BOOL)systemBeep
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
+}
+
++ (BOOL)xinerama
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
+}
+
++ (BOOL)addToPath
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
+}
+
++ (NSString*)addToPathString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"AddToPathString"];
+}
+
++ (BOOL)useDefaultShell
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseDefaultShell"];
+}
+
++ (NSString*)shellString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"Shell"];
+}
+
++ (int)depth
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Depth"];
+}
+
+
+@end
diff --git a/hw/darwin/quartz/XApplication.h b/hw/darwin/quartz/XApplication.h
new file mode 100644
index 000000000..3d3e96dab
--- /dev/null
+++ b/hw/darwin/quartz/XApplication.h
@@ -0,0 +1,47 @@
+//
+// XApplication.h
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.h,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
+
+#import <Cocoa/Cocoa.h>
+
+#import "XServer.h"
+#import "Preferences.h"
+
+@interface XApplication : NSApplication {
+ IBOutlet XServer *xserver;
+ IBOutlet Preferences *preferences;
+}
+
+- (void)sendEvent:(NSEvent *)anEvent;
+
+@end
diff --git a/hw/darwin/quartz/XApplication.m b/hw/darwin/quartz/XApplication.m
new file mode 100644
index 000000000..9b81bbee0
--- /dev/null
+++ b/hw/darwin/quartz/XApplication.m
@@ -0,0 +1,47 @@
+//
+// XApplication.m
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.m,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
+
+#import "XApplication.h"
+
+
+@implementation XApplication
+
+- (void)sendEvent:(NSEvent *)anEvent {
+ if (![xserver translateEvent:anEvent]) {
+ if (![preferences sendEvent:anEvent])
+ [super sendEvent:anEvent];
+ }
+}
+
+@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
new file mode 100644
index 000000000..574ce5f18
--- /dev/null
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -0,0 +1,1683 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 38;
+ objects = {
+ 01279092000747AA0A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XServer.m;
+ refType = 4;
+ };
+ 0127909600074AF60A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XApplication.m;
+ refType = 4;
+ };
+ 0127909800074B1A0A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XApplication.h;
+ refType = 4;
+ };
+ 014C68ED00ED6A9D7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.h;
+ refType = 4;
+ };
+ 014C68EE00ED6A9D7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.m;
+ refType = 4;
+ };
+ 014C68F200ED7AD67F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fakeBoxRec.h;
+ refType = 4;
+ };
+ 014C68F300EE5AB97F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.c;
+ refType = 4;
+ };
+ 014C68F400EE5AB97F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.h;
+ refType = 4;
+ };
+ 014C68F700EE678F7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.c;
+ refType = 4;
+ };
+ 014C68F800EE678F7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.h;
+ refType = 4;
+ };
+ 015698ED003DF345CE6F79C2 = {
+ isa = PBXFileReference;
+ path = XDarwin.icns;
+ refType = 4;
+ };
+ 0157A37D002CF6D7CE6F79C2 = {
+ children = (
+ F533214601A4B45401000001,
+ 0157A37E002CF6D7CE6F79C2,
+ F58D65DF018F79B101000001,
+ F533213D0193CBE001000001,
+ 43B962E200617B93416877C2,
+ F5ACD263C5BE031F01000001,
+ F51BF62E02026E3501000001,
+ F5ACD25CC5B5E96601000001,
+ F587E16401924C6901000001,
+ );
+ isa = PBXVariantGroup;
+ name = Credits.rtf;
+ path = "";
+ refType = 4;
+ };
+ 0157A37E002CF6D7CE6F79C2 = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/Credits.rtf;
+ refType = 4;
+ };
+ 015EDCEA004203A8CE6F79C2 = {
+ isa = PBXFrameworkReference;
+ name = IOKit.framework;
+ path = /System/Library/Frameworks/IOKit.framework;
+ refType = 0;
+ };
+ 017D6F4400E861FB7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessGC.c;
+ refType = 4;
+ };
+ 017D6F4500E861FB7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessScreen.c;
+ refType = 4;
+ };
+ 018F40F2003E1902CE6F79C2 = {
+ children = (
+ 018F40F3003E1916CE6F79C2,
+ 021D6BA9003E1BACCE6F79C2,
+ 3E74E03600863F047F000001,
+ F5A94EF10314BAC70100011B,
+ 018F40F6003E1974CE6F79C2,
+ );
+ isa = PBXGroup;
+ name = "X Server";
+ path = ..;
+ refType = 4;
+ };
+ 018F40F3003E1916CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwin.c;
+ refType = 4;
+ };
+ 018F40F6003E1974CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinKeyboard.c;
+ refType = 4;
+ };
+ 018F40F8003E1979CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartz.c;
+ refType = 4;
+ };
+ 018F40FA003E197ECE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartz.h;
+ refType = 4;
+ };
+ 018F40FC003E1983CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKit.c;
+ refType = 4;
+ };
+ 018F40FE003E1988CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKit.h;
+ refType = 4;
+ };
+ 018F4100003E19E4CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKitCursor.c;
+ refType = 4;
+ };
+//010
+//011
+//012
+//013
+//014
+//020
+//021
+//022
+//023
+//024
+ 021D6BA9003E1BACCE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwin.h;
+ refType = 4;
+ };
+ 02A1FEA6006D34BE416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKitStartup.c;
+ refType = 4;
+ };
+ 02A1FEA8006D38F0416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzStartup.c;
+ refType = 4;
+ };
+ 02E03CA000348209CE6F79C2 = {
+ children = (
+ F533214701A4B48301000001,
+ 02E03CA100348209CE6F79C2,
+ F58D65E0018F79C001000001,
+ F533213E0193CBF401000001,
+ 43B962E300617B93416877C2,
+ F5ACD268C5BE046401000001,
+ F51BF62F02026E5C01000001,
+ F5ACD261C5B5EA2001000001,
+ F587E16501924C7401000001,
+ );
+ isa = PBXVariantGroup;
+ name = XDarwinHelp.html;
+ path = "";
+ refType = 4;
+ };
+ 02E03CA100348209CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+//020
+//021
+//022
+//023
+//024
+//030
+//031
+//032
+//033
+//034
+ 0338412F0083BFE57F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCursor.h;
+ refType = 4;
+ };
+//030
+//031
+//032
+//033
+//034
+//040
+//041
+//042
+//043
+//044
+ 04329610000763920A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Preferences.m;
+ refType = 4;
+ };
+ 04329611000763920A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Preferences.h;
+ refType = 4;
+ };
+//040
+//041
+//042
+//043
+//044
+//060
+//061
+//062
+//063
+//064
+ 06EB6C3B004099E7CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzShared.h;
+ refType = 4;
+ };
+//060
+//061
+//062
+//063
+//064
+//080
+//081
+//082
+//083
+//084
+ 080E96DDFE201D6D7F000001 = {
+ children = (
+ 04329610000763920A000002,
+ 04329611000763920A000002,
+ 0127909600074AF60A000002,
+ 0127909800074B1A0A000002,
+ 01279092000747AA0A000002,
+ 1C4A3109004D8F24CE6F79C2,
+ 014C68EE00ED6A9D7F000001,
+ 014C68ED00ED6A9D7F000001,
+ );
+ isa = PBXGroup;
+ name = Classes;
+ refType = 4;
+ };
+ 089C165CFE840E0CC02AAC07 = {
+ children = (
+ F533214301A4B3F001000001,
+ 089C165DFE840E0CC02AAC07,
+ F58D65DD018F798F01000001,
+ F533213A0193CBA201000001,
+ 43B962E100617B49416877C2,
+ F5ACD269C5BE049301000001,
+ F51BF62B02026DDA01000001,
+ F5ACD262C5B5EA4D01000001,
+ F587E16101924C2F01000001,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings;
+ refType = 4;
+ };
+ 089C165DFE840E0CC02AAC07 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+//080
+//081
+//082
+//083
+//084
+//0A0
+//0A1
+//0A2
+//0A3
+//0A4
+ 0A79E19E004499A1CE6F79C2 = {
+ isa = PBXApplicationReference;
+ path = XDarwin.app;
+ refType = 3;
+ };
+ 0A79E19F004499A1CE6F79C2 = {
+ buildPhases = (
+ 0A79E1A0004499A1CE6F79C2,
+ 0A79E1A1004499A1CE6F79C2,
+ 0A79E1A2004499A1CE6F79C2,
+ 0A79E1A3004499A1CE6F79C2,
+ 0A79E1A4004499A1CE6F79C2,
+ );
+ buildSettings = {
+ INSTALL_PATH = /;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = XDarwin;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = app;
+ };
+ dependencies = (
+ 6EF065C903D4F0CA006877C2,
+ 6EF065C703D4EE19006877C2,
+ );
+ isa = PBXApplicationTarget;
+ name = XDarwin;
+ productInstallPath = /;
+ productName = XDarwin;
+ productReference = 0A79E19E004499A1CE6F79C2;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>XDarwin</string>
+ <key>CFBundleGetInfoString</key>
+ <string>XDarwin 1.2.0, ©2001-2003 XFree86 Project, Inc.</string>
+ <key>CFBundleIconFile</key>
+ <string>XDarwin.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.xfree86.XDarwin</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>XDarwin</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>XDarwin 1.2.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string></string>
+ <key>NSHelpFile</key>
+ <string>XDarwinHelp.html</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>XApplication</string>
+</dict>
+</plist>
+";
+ };
+ 0A79E1A0004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A1004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ 0A79E1A600449EB2CE6F79C2,
+ 0A79E1A700449EB2CE6F79C2,
+ 0A79E1A800449EB2CE6F79C2,
+ 0A79E1A900449EB2CE6F79C2,
+ 0A79E1AA00449EB2CE6F79C2,
+ 1220774500712D2D416877C2,
+ F54BF6ED017D506E01000001,
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A2004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A3004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A4004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A600449EB2CE6F79C2 = {
+ fileRef = 29B97318FDCFA39411CA2CEA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A700449EB2CE6F79C2 = {
+ fileRef = 089C165CFE840E0CC02AAC07;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A800449EB2CE6F79C2 = {
+ fileRef = 0157A37D002CF6D7CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A900449EB2CE6F79C2 = {
+ fileRef = 02E03CA000348209CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1AA00449EB2CE6F79C2 = {
+ fileRef = 015698ED003DF345CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//0A0
+//0A1
+//0A2
+//0A3
+//0A4
+//100
+//101
+//102
+//103
+//104
+ 1058C7A0FEA54F0111CA2CBB = {
+ children = (
+ F53321400193CCF001000001,
+ 1BE4F84D0006C9890A000002,
+ 1058C7A1FEA54F0111CA2CBB,
+ F53321410193CCF001000001,
+ 015EDCEA004203A8CE6F79C2,
+ );
+ isa = PBXGroup;
+ name = "Linked Frameworks";
+ refType = 4;
+ };
+ 1058C7A1FEA54F0111CA2CBB = {
+ isa = PBXFrameworkReference;
+ name = Cocoa.framework;
+ path = /System/Library/Frameworks/Cocoa.framework;
+ refType = 0;
+ };
+ 1058C7A2FEA54F0111CA2CBB = {
+ children = (
+ 29B97325FDCFA39411CA2CEA,
+ 29B97324FDCFA39411CA2CEA,
+ );
+ isa = PBXGroup;
+ name = "Other Frameworks";
+ refType = 4;
+ };
+//100
+//101
+//102
+//103
+//104
+//120
+//121
+//122
+//123
+//124
+ 1220774300712D2D416877C2 = {
+ children = (
+ F533214501A4B42501000001,
+ 1220774400712D2D416877C2,
+ F58D65DE018F79A001000001,
+ F533213C0193CBC901000001,
+ 1220774600712D75416877C2,
+ F5ACD266C5BE03C501000001,
+ F51BF62D02026E1C01000001,
+ F5ACD25FC5B5E9AA01000001,
+ F587E16301924C5E01000001,
+ );
+ isa = PBXVariantGroup;
+ name = Localizable.strings;
+ path = "";
+ refType = 4;
+ };
+ 1220774400712D2D416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/Localizable.strings;
+ refType = 4;
+ };
+ 1220774500712D2D416877C2 = {
+ fileRef = 1220774300712D2D416877C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 1220774600712D75416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/Localizable.strings;
+ refType = 4;
+ };
+//120
+//121
+//122
+//123
+//124
+//170
+//171
+//172
+//173
+//174
+ 170DFAFF00729A35416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XDarwinStartup.c;
+ refType = 4;
+ };
+ 170DFB0000729C86416877C2 = {
+ children = (
+ 018F40FC003E1983CE6F79C2,
+ 018F40FE003E1988CE6F79C2,
+ 018F4100003E19E4CE6F79C2,
+ 02A1FEA6006D34BE416877C2,
+ );
+ isa = PBXGroup;
+ name = IOKit;
+ path = ..;
+ refType = 4;
+ };
+//170
+//171
+//172
+//173
+//174
+//190
+//191
+//192
+//193
+//194
+ 19C28FACFE9D520D11CA2CBB = {
+ children = (
+ 0A79E19E004499A1CE6F79C2,
+ 6EF7C58703D3BC6D00000104,
+ 6EF065C603D4EE19006877C2,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ };
+//190
+//191
+//192
+//193
+//194
+//1B0
+//1B1
+//1B2
+//1B3
+//1B4
+ 1BD8DE4200B8A3567F000001 = {
+ children = (
+ F533214401A4B40F01000001,
+ 1BD8DE4300B8A3567F000001,
+ F58D65DC018F794D01000001,
+ F533213B0193CBB401000001,
+ 1BD8DE4700B8A3C77F000001,
+ F5ACD264C5BE035B01000001,
+ F51BF62C02026E0601000001,
+ F5ACD25DC5B5E97701000001,
+ F587E16201924C5301000001,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4300B8A3567F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4400B8A38E7F000001 = {
+ children = (
+ F533214801A4B4D701000001,
+ 1BD8DE4500B8A38E7F000001,
+ F58D65E1018F79E001000001,
+ F533213F0193CC2501000001,
+ 1BD8DE4800B8A4167F000001,
+ F5ACD267C5BE03FC01000001,
+ F51BF63002026E8D01000001,
+ F5ACD260C5B5E9DF01000001,
+ F587E16601924C9D01000001,
+ );
+ isa = PBXVariantGroup;
+ name = XDarwinHelp.html.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4500B8A38E7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ 1BD8DE4700B8A3C77F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4800B8A4167F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ 1BE4F84D0006C9890A000002 = {
+ isa = PBXFrameworkReference;
+ name = Carbon.framework;
+ path = /System/Library/Frameworks/Carbon.framework;
+ refType = 0;
+ };
+//1B0
+//1B1
+//1B2
+//1B3
+//1B4
+//1C0
+//1C1
+//1C2
+//1C3
+//1C4
+ 1C4A3109004D8F24CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XServer.h;
+ refType = 4;
+ };
+//1C0
+//1C1
+//1C2
+//1C3
+//1C4
+//230
+//231
+//232
+//233
+//234
+ 237A34C10076E37E7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzAudio.c;
+ refType = 4;
+ };
+ 237A34C20076E37E7F000001 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ OPTIMIZATION_CFLAGS = "-O0";
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 237A34C30076E37E7F000001 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+ 237A34C40076F4F07F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzAudio.h;
+ refType = 4;
+ };
+//230
+//231
+//232
+//233
+//234
+//290
+//291
+//292
+//293
+//294
+ 29B97313FDCFA39411CA2CEA = {
+ buildStyles = (
+ 237A34C20076E37E7F000001,
+ 237A34C30076E37E7F000001,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ Swedish,
+ Dutch,
+ Spanish,
+ ko,
+ Portuguese,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA;
+ projectDirPath = "";
+ targets = (
+ 0A79E19F004499A1CE6F79C2,
+ 6EF7C58603D3BC6D00000104,
+ 6EF065C503D4EE19006877C2,
+ );
+ };
+ 29B97314FDCFA39411CA2CEA = {
+ children = (
+ 080E96DDFE201D6D7F000001,
+ 018F40F2003E1902CE6F79C2,
+ 170DFB0000729C86416877C2,
+ 43B962CE00617089416877C2,
+ F5614B3D025112D901000114,
+ 32FEE13C00E07C3E7F000001,
+ 29B97315FDCFA39411CA2CEA,
+ 29B97317FDCFA39411CA2CEA,
+ 29B97323FDCFA39411CA2CEA,
+ 19C28FACFE9D520D11CA2CBB,
+ );
+ isa = PBXGroup;
+ name = "Xmaster-Cocoa";
+ path = "";
+ refType = 4;
+ };
+ 29B97315FDCFA39411CA2CEA = {
+ children = (
+ 170DFAFF00729A35416877C2,
+ );
+ isa = PBXGroup;
+ name = "Other Sources";
+ path = "";
+ refType = 2;
+ };
+ 29B97317FDCFA39411CA2CEA = {
+ children = (
+ 29B97318FDCFA39411CA2CEA,
+ 089C165CFE840E0CC02AAC07,
+ 1BD8DE4200B8A3567F000001,
+ 1220774300712D2D416877C2,
+ 0157A37D002CF6D7CE6F79C2,
+ 02E03CA000348209CE6F79C2,
+ 1BD8DE4400B8A38E7F000001,
+ 015698ED003DF345CE6F79C2,
+ F54BF6EA017D500901000001,
+ F54BF6EC017D506E01000001,
+ );
+ isa = PBXGroup;
+ name = Resources;
+ path = ../bundle;
+ refType = 4;
+ };
+ 29B97318FDCFA39411CA2CEA = {
+ children = (
+ F533214201A4B3CE01000001,
+ 29B97319FDCFA39411CA2CEA,
+ F58D65DB018F793801000001,
+ F53321390193CB6A01000001,
+ 43B962E000617B49416877C2,
+ F5ACD265C5BE038601000001,
+ F51BF62A02026DAF01000001,
+ F5ACD25EC5B5E98D01000001,
+ F587E16001924C1D01000001,
+ );
+ isa = PBXVariantGroup;
+ name = MainMenu.nib;
+ path = "";
+ refType = 4;
+ };
+ 29B97319FDCFA39411CA2CEA = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ 29B97323FDCFA39411CA2CEA = {
+ children = (
+ 1058C7A0FEA54F0111CA2CBB,
+ 1058C7A2FEA54F0111CA2CBB,
+ );
+ isa = PBXGroup;
+ name = Frameworks;
+ path = "";
+ refType = 4;
+ };
+ 29B97324FDCFA39411CA2CEA = {
+ isa = PBXFrameworkReference;
+ name = AppKit.framework;
+ path = /System/Library/Frameworks/AppKit.framework;
+ refType = 0;
+ };
+ 29B97325FDCFA39411CA2CEA = {
+ isa = PBXFrameworkReference;
+ name = Foundation.framework;
+ path = /System/Library/Frameworks/Foundation.framework;
+ refType = 0;
+ };
+//290
+//291
+//292
+//293
+//294
+//320
+//321
+//322
+//323
+//324
+ 32FEE13C00E07C3E7F000001 = {
+ children = (
+ F56CBD0D02EB84A801129B8A,
+ F56CBD0E02EB84A801129B8A,
+ F56CBD0F02EBDCFC01129B8A,
+ 014C68F200ED7AD67F000001,
+ F5269C2D01D5BC3501000001,
+ F5269C2E01D5BC3501000001,
+ 32FEE13E00E07CBE7F000001,
+ 32FEE13F00E07CBE7F000001,
+ 32FEE14000E07CBE7F000001,
+ 32FEE14100E07CBE7F000001,
+ 32FEE14200E07CBE7F000001,
+ 014C68F300EE5AB97F000001,
+ 014C68F400EE5AB97F000001,
+ 017D6F4400E861FB7F000001,
+ 017D6F4500E861FB7F000001,
+ 014C68F700EE678F7F000001,
+ 014C68F800EE678F7F000001,
+ 32FEE14900E07D317F000001,
+ );
+ isa = PBXGroup;
+ name = Rootless;
+ path = "";
+ refType = 4;
+ };
+ 32FEE13E00E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootless.h;
+ refType = 4;
+ };
+ 32FEE13F00E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAqua.h;
+ refType = 4;
+ };
+ 32FEE14000E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaGlue.c;
+ refType = 4;
+ };
+ 32FEE14100E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaImp.h;
+ refType = 4;
+ };
+ 32FEE14200E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaImp.m;
+ refType = 4;
+ };
+ 32FEE14900E07D317F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessValTree.c;
+ refType = 4;
+ };
+//320
+//321
+//322
+//323
+//324
+//350
+//351
+//352
+//353
+//354
+ 3576829A0077B8F17F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCursor.c;
+ refType = 4;
+ };
+//350
+//351
+//352
+//353
+//354
+//3E0
+//3E1
+//3E2
+//3E3
+//3E4
+ 3E74E03600863F047F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinClut8.h;
+ refType = 4;
+ };
+//3E0
+//3E1
+//3E2
+//3E3
+//3E4
+//430
+//431
+//432
+//433
+//434
+ 43B962CE00617089416877C2 = {
+ children = (
+ 018F40F8003E1979CE6F79C2,
+ 018F40FA003E197ECE6F79C2,
+ 237A34C10076E37E7F000001,
+ 237A34C40076F4F07F000001,
+ 3576829A0077B8F17F000001,
+ 0338412F0083BFE57F000001,
+ 43B962D000617089416877C2,
+ 43B962D100617089416877C2,
+ 43B962CF00617089416877C2,
+ F5582948015DAD3B01000001,
+ 06EB6C3B004099E7CE6F79C2,
+ 02A1FEA8006D38F0416877C2,
+ );
+ isa = PBXGroup;
+ name = Quartz;
+ path = "";
+ refType = 4;
+ };
+ 43B962CF00617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCocoa.m;
+ refType = 4;
+ };
+ 43B962D000617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzPasteboard.c;
+ refType = 4;
+ };
+ 43B962D100617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzPasteboard.h;
+ refType = 4;
+ };
+ 43B962E000617B49416877C2 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ 43B962E100617B49416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ 43B962E200617B93416877C2 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/Credits.rtf;
+ refType = 4;
+ };
+ 43B962E300617B93416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+//430
+//431
+//432
+//433
+//434
+//6E0
+//6E1
+//6E2
+//6E3
+//6E4
+ 6EF065C003D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C103D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C203D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C303D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C403D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C503D4EE19006877C2 = {
+ buildPhases = (
+ 6EF065C003D4EE19006877C2,
+ 6EF065C103D4EE19006877C2,
+ 6EF065C203D4EE19006877C2,
+ 6EF065C303D4EE19006877C2,
+ 6EF065C403D4EE19006877C2,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxMesa;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxMesa;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = glxMesa;
+ productReference = 6EF065C603D4EE19006877C2;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>glxMesa</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>GLX bundle with Mesa</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6EF065C603D4EE19006877C2 = {
+ isa = PBXBundleReference;
+ path = glxMesa.bundle;
+ refType = 3;
+ };
+ 6EF065C703D4EE19006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6EF065C503D4EE19006877C2;
+ };
+ 6EF065C903D4F0CA006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6EF7C58603D3BC6D00000104;
+ };
+ 6EF7C58103D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58203D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58303D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58403D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58503D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58603D3BC6D00000104 = {
+ buildPhases = (
+ 6EF7C58103D3BC6D00000104,
+ 6EF7C58203D3BC6D00000104,
+ 6EF7C58303D3BC6D00000104,
+ 6EF7C58403D3BC6D00000104,
+ 6EF7C58503D3BC6D00000104,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxAGL;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxAGL;
+ productName = glxAqua;
+ productReference = 6EF7C58703D3BC6D00000104;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>glxAGL</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>GLX bundle with AGL</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6EF7C58703D3BC6D00000104 = {
+ isa = PBXBundleReference;
+ path = glxAGL.bundle;
+ refType = 3;
+ };
+//6E0
+//6E1
+//6E2
+//6E3
+//6E4
+//F50
+//F51
+//F52
+//F53
+//F54
+ F51BF62A02026DAF01000001 = {
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F51BF62B02026DDA01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F51BF62C02026E0601000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F51BF62D02026E1C01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F51BF62E02026E3501000001 = {
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F51BF62F02026E5C01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F51BF63002026E8D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5269C2D01D5BC3501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = pseudoramiX.c;
+ refType = 4;
+ };
+ F5269C2E01D5BC3501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = pseudoramiX.h;
+ refType = 4;
+ };
+ F53321390193CB6A01000001 = {
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F533213A0193CBA201000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F533213B0193CBB401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F533213C0193CBC901000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F533213D0193CBE001000001 = {
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F533213E0193CBF401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F533213F0193CC2501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F53321400193CCF001000001 = {
+ isa = PBXFrameworkReference;
+ name = ApplicationServices.framework;
+ path = /System/Library/Frameworks/ApplicationServices.framework;
+ refType = 0;
+ };
+ F53321410193CCF001000001 = {
+ isa = PBXFrameworkReference;
+ name = CoreAudio.framework;
+ path = /System/Library/Frameworks/CoreAudio.framework;
+ refType = 0;
+ };
+ F533214201A4B3CE01000001 = {
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F533214301A4B3F001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F533214401A4B40F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F533214501A4B42501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F533214601A4B45401000001 = {
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F533214701A4B48301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F533214801A4B4D701000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F54BF6EA017D500901000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = startXClients.cpp;
+ refType = 4;
+ };
+ F54BF6EC017D506E01000001 = {
+ isa = PBXFileReference;
+ path = startXClients;
+ refType = 4;
+ };
+ F54BF6ED017D506E01000001 = {
+ fileRef = F54BF6EC017D506E01000001;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5582948015DAD3B01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCommon.h;
+ refType = 4;
+ };
+ F5614B3B0251124C01000114 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fullscreen.c;
+ refType = 4;
+ };
+ F5614B3C0251124C01000114 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fullscreen.h;
+ refType = 4;
+ };
+ F5614B3D025112D901000114 = {
+ children = (
+ F5614B3B0251124C01000114,
+ F5614B3C0251124C01000114,
+ );
+ isa = PBXGroup;
+ name = "Full Screen";
+ path = "";
+ refType = 4;
+ };
+ F56CBD0D02EB84A801129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aqua.h;
+ refType = 4;
+ };
+ F56CBD0E02EB84A801129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aquaPicture.c;
+ refType = 4;
+ };
+ F56CBD0F02EBDCFC01129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aquaWindow.c;
+ refType = 4;
+ };
+ F587E16001924C1D01000001 = {
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F587E16101924C2F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F587E16201924C5301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F587E16301924C5E01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F587E16401924C6901000001 = {
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F587E16501924C7401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F587E16601924C9D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F58D65DB018F793801000001 = {
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F58D65DC018F794D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F58D65DD018F798F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F58D65DE018F79A001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F58D65DF018F79B101000001 = {
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F58D65E0018F79C001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F58D65E1018F79E001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5A94EF10314BAC70100011B = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinEvents.c;
+ refType = 4;
+ };
+ F5ACD25CC5B5E96601000001 = {
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F5ACD25DC5B5E97701000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F5ACD25EC5B5E98D01000001 = {
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F5ACD25FC5B5E9AA01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F5ACD260C5B5E9DF01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5ACD261C5B5EA2001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F5ACD262C5B5EA4D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F5ACD263C5BE031F01000001 = {
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F5ACD264C5BE035B01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F5ACD265C5BE038601000001 = {
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F5ACD266C5BE03C501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F5ACD267C5BE03FC01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5ACD268C5BE046401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F5ACD269C5BE049301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA;
+}
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
new file mode 100644
index 000000000..53343aa1e
--- /dev/null
+++ b/hw/darwin/quartz/XDarwinStartup.c
@@ -0,0 +1,165 @@
+/**************************************************************
+ *
+ * Startup program for Darwin X servers
+ *
+ * This program selects the appropriate X server to launch:
+ * XDarwin IOKit X server (default)
+ * XDarwinQuartz A soft link to the Quartz X server
+ * executable (-quartz etc. option)
+ *
+ * If told to idle, the program will simply pause and not
+ * launch any X server. This is to support startx being
+ * run by XDarwin.app.
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * TORREY T. LYONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Torrey T. Lyons shall not
+ * be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Torrey T. Lyons.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/syslimits.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+extern int errno;
+
+// Macros to build the path name
+#ifndef XBINDIR
+#define XBINDIR /usr/X11R6/bin
+#endif
+#define STR(s) #s
+#define XSTRPATH(s) STR(s) "/"
+#define XPATH(file) XSTRPATH(XBINDIR) STR(file)
+
+int main(
+ int argc,
+ char *argv[] )
+{
+ int i, j, quartzMode = -1;
+ char **newargv;
+
+ // Check if we are going to run in Quartz mode or idle
+ // to support startx from the Quartz server. The last
+ // parameter in the list is the one used.
+ for (i = argc-1; i; i--) {
+ if (!strcmp(argv[i], "-idle")) {
+ pause();
+ return 0;
+
+ } else if (!strcmp(argv[i], "-quartz") ||
+ !strcmp(argv[i], "-rootless") ||
+ !strcmp(argv[i], "-fullscreen"))
+ {
+ quartzMode = 1;
+ break;
+
+ } else if (!strcmp(argv[i], "-iokit")) {
+ quartzMode = 0;
+ break;
+ }
+ }
+
+ if (quartzMode == -1) {
+#ifdef HAS_CG_MACH_PORT
+ // Check if the CoreGraphics window server is running.
+ // Mike Paquette says this is the fastest way to determine if it is running.
+ CFMachPortRef cgMachPortRef = CGWindowServerCFMachPort();
+ if (cgMachPortRef == NULL)
+ quartzMode = 0;
+ else
+ quartzMode = 1;
+#else
+ // On older systems we assume IOKit mode.
+ quartzMode = 0;
+#endif
+ }
+
+ if (quartzMode) {
+ // Launch the X server for the quartz modes
+
+ char quartzPath[PATH_MAX+1];
+ int pathLength;
+ OSStatus theStatus;
+ CFURLRef appURL;
+ CFStringRef appPath;
+ Boolean success;
+
+ // Build the new argument list
+ newargv = (char **) malloc((argc+2) * sizeof(char *));
+ for (j = argc; j; j--)
+ newargv[j] = argv[j];
+ newargv[argc] = "-nostartx";
+ newargv[argc+1] = NULL;
+
+ // Use the XDarwinQuartz soft link if it is valid
+ pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX);
+ if (pathLength != -1) {
+ quartzPath[pathLength] = '\0';
+ newargv[0] = quartzPath;
+ execv(newargv[0], newargv);
+ }
+
+ // Otherwise query LaunchServices for the location of the XDarwin application
+ theStatus = LSFindApplicationForInfo(kLSUnknownCreator,
+ CFSTR("org.xfree86.XDarwin"),
+ NULL, NULL, &appURL);
+ if (theStatus) {
+ fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus);
+ fprintf(stderr, "Launch XDarwin once from the Finder.\n");
+ return theStatus;
+ }
+
+ appPath = CFURLCopyFileSystemPath (appURL, kCFURLPOSIXPathStyle);
+ success = CFStringGetCString(appPath, quartzPath, PATH_MAX, CFStringGetSystemEncoding());
+ if (! success) {
+ fprintf(stderr, "Could not find path to XDarwin application.\n");
+ return success;
+ }
+
+ // Launch the XDarwin application
+ strncat(quartzPath, "/Contents/MacOS/XDarwin", PATH_MAX);
+ newargv[0] = quartzPath;
+ execv(newargv[0], newargv);
+ fprintf(stderr, "Could not start XDarwin application at %s.\n", newargv[0]);
+ return errno;
+
+ } else {
+
+ // Build the new argument list
+ newargv = (char **) malloc((argc+1) * sizeof(char *));
+ for (j = argc; j; j--)
+ newargv[j] = argv[j];
+ newargv[0] = "XDarwin";
+ newargv[argc] = NULL;
+
+ // Launch the IOKit X server
+ execvp(newargv[0], newargv);
+ fprintf(stderr, "Could not start XDarwin IOKit X server.\n");
+ return errno;
+ }
+}
diff --git a/hw/darwin/quartz/XDarwinStartup.man b/hw/darwin/quartz/XDarwinStartup.man
new file mode 100644
index 000000000..312f4b88b
--- /dev/null
+++ b/hw/darwin/quartz/XDarwinStartup.man
@@ -0,0 +1,75 @@
+.\" $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man,v 1.1 2002/03/28 02:21:18 torrey Exp $
+.TH XDarwinStartup 1
+.SH NAME
+XDarwinStartup - Startup program for the XDarwin X window server
+.SH SYNOPSIS
+.B XDarwinStartup
+[\fI-iokit\fP]
+[\fI-fullscreen\fP]
+[\fI-rootless\fP]
+[\fI-quartz\fP]
+[\fI-idle\fP]
+[\fIoptions\fP]
+.SH DESCRIPTION
+The \fIXDarwin(1)\fP X window server can be run in a variety of different
+modes and is actually two different executables. The IOKit X server,
+XDarwin, is used when running from the console. It is most commonly
+located in __XBinDir__. The Quartz X server, for running in parallel with
+Aqua, is a full-fledged Mac OS X application that can be started from
+the Finder. Its application bundle is XDarwin.app, which is typically
+located in /Applications.
+.I XDarwinStartup
+allows easy switching between these X servers and auto-detection of the
+appropriate one to use when launching from the command line.
+When run without any arguments,
+.I XDarwinStartup
+will start the Quartz X server if the Core Graphics window server
+is currently running. Otherwise it will start the IOKit X server.
+.PP
+To locate the Quartz X server,
+.I XDarwinStartup
+will try to read the soft link at __XBinDir__/XDarwinQuartz.
+This is typically a soft link to the executable of the XDarwin.app
+application. If this fails,
+.I XDarwinStartup
+will call Launch Services to locate XDarwin.app.
+.PP
+To start the IOKit X server,
+.I XDarwinStartup
+will run the XDarwin execuatable, which should be present in the
+user's path.
+.SH OPTIONS
+.I XDarwinStartup
+accepts and passes on all options to the X server it
+launches. In addition the following options have specific effects:
+.TP 8
+.B \-iokit
+Launch the IOKit X server.
+.TP 8
+.B \-fullscreen
+Launch the Quartz X server to run in full screen mode.
+.TP 8
+.B \-rootless
+Launch the Quartz X server to run in rootless mode.
+.TP 8
+.B \-quartz
+Launch the Quartz X server.
+.TP 8
+.B \-idle
+Pause and do nothing. This option is used by XDarwin.app when it is
+started from the Finder.
+.SH FILES
+.TP 30
+__XBinDir__/XDarwin
+IOKit mode X server
+.TP 30
+/Applications/XDarwin.app
+Quartz mode X server
+.TP 30
+__XBinDir__/XDarwinQuartz
+Soft link to Quartz mode X server executable
+.SH SEE ALSO
+XDarwin(1)
+.SH BUGS
+The path to XDarwinQuartz should not be hard coded.
+
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
new file mode 100644
index 000000000..3eadd650e
--- /dev/null
+++ b/hw/darwin/quartz/XServer.h
@@ -0,0 +1,112 @@
+//
+// XServer.h
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+
+#define BOOL xBOOL
+#include "Xproto.h"
+#undef BOOL
+
+#import <Cocoa/Cocoa.h>
+
+@interface XServer : NSObject {
+ // server state
+ int serverState;
+ NSRecursiveLock *serverLock;
+ BOOL serverVisible;
+ BOOL rootlessMenuBarVisible;
+ BOOL queueShowServer;
+ UInt32 mouseState;
+ Class windowClass;
+
+ // server event queue
+ BOOL sendServerEvents;
+ int eventWriteFD;
+
+ // Aqua interface
+ IBOutlet NSWindow *modeWindow;
+ IBOutlet NSButton *startupModeButton;
+ IBOutlet NSButton *startFullScreenButton;
+ IBOutlet NSButton *startRootlessButton;
+ IBOutlet NSWindow *helpWindow;
+ IBOutlet NSButton *startupHelpButton;
+ IBOutlet NSPanel *switchWindow;
+}
+
+- (id)init;
+
+- (BOOL)translateEvent:(NSEvent *)anEvent;
+- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
+
++ (void)append:(NSString *)value toEnv:(NSString *)name;
+
+- (void)startX;
+- (void)finishStartX;
+- (BOOL)startXClients;
+- (void)run;
+- (void)toggle;
+- (void)showServer:(BOOL)show;
+- (void)forceShowServer:(BOOL)show;
+- (void)setRootClip:(BOOL)enable;
+- (void)readPasteboard;
+- (void)writePasteboard;
+- (void)quitServer;
+- (void)sendXEvent:(xEvent *)xe;
+- (void)sendShowHide:(BOOL)show;
+- (void)clientProcessDone:(int)clientStatus;
+
+// Aqua interface actions
+- (IBAction)startFullScreen:(id)sender;
+- (IBAction)startRootless:(id)sender;
+- (IBAction)closeHelpAndShow:(id)sender;
+- (IBAction)showAction:(id)sender;
+
+// NSApplication delegate
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
+- (void)applicationWillResignActive:(NSNotification *)aNotification;
+- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
+
+// NSPort delegate
+- (void)handlePortMessage:(NSPortMessage *)portMessage;
+
+@end
+
+// X server states
+enum {
+ server_NotStarted,
+ server_Starting,
+ server_Running,
+ server_Quitting,
+ server_Done
+};
+
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
new file mode 100644
index 000000000..c57defd53
--- /dev/null
+++ b/hw/darwin/quartz/XServer.m
@@ -0,0 +1,1029 @@
+//
+// XServer.m
+//
+// This class handles the interaction between the Cocoa front-end
+// and the Darwin X server thread.
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+
+#include "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "X.h"
+#include "Xproto.h"
+#include "os.h"
+#include "darwin.h"
+#undef BOOL
+
+#import "XServer.h"
+#import "Preferences.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/syslimits.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <pwd.h>
+#include <signal.h>
+#include <fcntl.h>
+
+// For power management notifications
+#import <mach/mach_port.h>
+#import <mach/mach_interface.h>
+#import <mach/mach_init.h>
+#import <IOKit/pwr_mgt/IOPMLib.h>
+#import <IOKit/IOMessage.h>
+
+#define ENQUEUE(xe) \
+{ \
+ char byte = 0; \
+ DarwinEQEnqueue(xe); \
+ /* signal there is an event ready to handle */ \
+ write(eventWriteFD, &byte, 1); \
+}
+
+// Types of shells
+enum {
+ shell_Unknown,
+ shell_Bourne,
+ shell_C
+};
+
+typedef struct {
+ char *name;
+ int type;
+} shellList_t;
+
+static shellList_t const shellList[] = {
+ { "csh", shell_C }, // standard C shell
+ { "tcsh", shell_C }, // ... needs no introduction
+ { "sh", shell_Bourne }, // standard Bourne shell
+ { "zsh", shell_Bourne }, // Z shell
+ { "bash", shell_Bourne }, // GNU Bourne again shell
+ { NULL, shell_Unknown }
+};
+
+extern int argcGlobal;
+extern char **argvGlobal;
+extern char **envpGlobal;
+extern int main(int argc, char *argv[], char *envp[]);
+extern void HideMenuBar(void);
+extern void ShowMenuBar(void);
+extern void QuartzReallySetCursor();
+static void childDone(int sig);
+static void powerDidChange(void *x, io_service_t y, natural_t messageType,
+ void *messageArgument);
+
+static NSPort *signalPort;
+static NSPort *returnPort;
+static NSPortMessage *signalMessage;
+static pid_t clientPID;
+static XServer *oneXServer;
+static NSRect aquaMenuBarBox;
+static io_connect_t root_port;
+
+
+@implementation XServer
+
+- (id)init
+{
+ self = [super init];
+ oneXServer = self;
+
+ serverState = server_NotStarted;
+ serverLock = [[NSRecursiveLock alloc] init];
+ clientPID = 0;
+ sendServerEvents = NO;
+ serverVisible = NO;
+ rootlessMenuBarVisible = YES;
+ queueShowServer = YES;
+ quartzServerQuitting = NO;
+ mouseState = 0;
+ eventWriteFD = quartzEventWriteFD;
+ windowClass = [NSWindow class];
+
+ // set up a port to safely send messages to main thread from server thread
+ signalPort = [[NSPort port] retain];
+ returnPort = [[NSPort port] retain];
+ signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort
+ receivePort:returnPort components:nil];
+
+ // set up receiving end
+ [signalPort setDelegate:self];
+ [[NSRunLoop currentRunLoop] addPort:signalPort
+ forMode:NSDefaultRunLoopMode];
+ [[NSRunLoop currentRunLoop] addPort:signalPort
+ forMode:NSModalPanelRunLoopMode];
+
+ return self;
+}
+
+- (NSApplicationTerminateReply)
+ applicationShouldTerminate:(NSApplication *)sender
+{
+ // Quit if the X server is not running
+ if ([serverLock tryLock]) {
+ quartzServerQuitting = YES;
+ serverState = server_Done;
+ if (clientPID != 0)
+ kill(clientPID, SIGINT);
+ return NSTerminateNow;
+ }
+
+ // Hide the X server and stop sending it events
+ [self showServer:NO];
+ sendServerEvents = NO;
+
+ if (clientPID != 0 || !quartzStartClients) {
+ int but;
+
+ but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
+ NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""),
+ NSLocalizedString(@"Quit",@""),
+ NSLocalizedString(@"Cancel",@""),
+ nil);
+
+ switch (but) {
+ case NSAlertDefaultReturn: // quit
+ break;
+ case NSAlertAlternateReturn: // cancel
+ if (serverState == server_Running)
+ sendServerEvents = YES;
+ return NSTerminateCancel;
+ }
+ }
+
+ quartzServerQuitting = YES;
+ if (clientPID != 0)
+ kill(clientPID, SIGINT);
+
+ // At this point the X server is either running or starting.
+ if (serverState == server_Starting) {
+ // Quit will be queued later when server is running
+ return NSTerminateLater;
+ } else if (serverState == server_Running) {
+ [self quitServer];
+ }
+
+ return NSTerminateNow;
+}
+
+// Ensure that everything has quit cleanly
+- (void)applicationWillTerminate:(NSNotification *)aNotification
+{
+ // Make sure the client process has finished
+ if (clientPID != 0) {
+ NSLog(@"Waiting on client process...");
+ sleep(2);
+
+ // If the client process hasn't finished yet, kill it off
+ if (clientPID != 0) {
+ int clientStatus;
+ NSLog(@"Killing client process...");
+ killpg(clientPID, SIGKILL);
+ waitpid(clientPID, &clientStatus, 0);
+ }
+ }
+
+ // Wait until the X server thread quits
+ [serverLock lock];
+}
+
+// returns YES when event was handled
+- (BOOL)translateEvent:(NSEvent *)anEvent
+{
+ xEvent xe;
+ static BOOL mouse1Pressed = NO;
+ NSEventType type;
+ unsigned int flags;
+
+ if (!sendServerEvents) {
+ return NO;
+ }
+
+ type = [anEvent type];
+ flags = [anEvent modifierFlags];
+
+ if (!quartzRootless) {
+ // Check for switch keypress
+ if ((type == NSKeyDown) && (![anEvent isARepeat]) &&
+ ([anEvent keyCode] == [Preferences keyCode]))
+ {
+ unsigned int switchFlags = [Preferences modifiers];
+
+ // Switch if all the switch modifiers are pressed, while none are
+ // pressed that should not be, except for caps lock.
+ if (((flags & switchFlags) == switchFlags) &&
+ ((flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0))
+ {
+ [self toggle];
+ return YES;
+ }
+ }
+
+ if (!serverVisible)
+ return NO;
+ }
+
+ memset(&xe, 0, sizeof(xe));
+
+ switch (type) {
+ case NSLeftMouseUp:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ if (quartzRootless && !mouse1Pressed) {
+ // MouseUp after MouseDown in menu - ignore
+ return NO;
+ }
+ mouse1Pressed = NO;
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 1;
+ break;
+ case NSLeftMouseDown:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ if (quartzRootless &&
+ ! ([anEvent window] &&
+ [[anEvent window] isKindOfClass:windowClass])) {
+ // Click in non X window - ignore
+ return NO;
+ }
+ mouse1Pressed = YES;
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 1;
+ break;
+ case NSMouseMoved:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDragged:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = MotionNotify;
+ break;
+ case NSSystemDefined:
+ {
+ long hwButtons = [anEvent data2];
+
+ if (![anEvent subtype]==7)
+ return NO; // we only use multibutton mouse events
+ if (mouseState == hwButtons)
+ return NO; // ignore double events
+ mouseState = hwButtons;
+
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = kXDarwinUpdateButtons;
+ xe.u.clientMessage.u.l.longs0 = [anEvent data1];
+ xe.u.clientMessage.u.l.longs1 =[anEvent data2];
+ break;
+ }
+ case NSScrollWheel:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = kXDarwinScrollWheel;
+ xe.u.clientMessage.u.s.shorts0 = [anEvent deltaY];
+ break;
+ case NSKeyDown:
+ case NSKeyUp:
+ // If the mouse is not on the valid X display area,
+ // we don't send the X server key events.
+ if (![self getMousePosition:&xe fromEvent:nil])
+ return NO;
+ if (type == NSKeyDown)
+ xe.u.u.type = KeyPress;
+ else
+ xe.u.u.type = KeyRelease;
+ xe.u.u.detail = [anEvent keyCode];
+ break;
+ case NSFlagsChanged:
+ [self getMousePosition:&xe fromEvent:nil];
+ xe.u.u.type = kXDarwinUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = flags;
+ break;
+ case NSOtherMouseDown: // undocumented MouseDown
+ case NSOtherMouseUp: // undocumented MouseUp
+ // Hide these from AppKit to avoid its log messages
+ return YES;
+ default:
+ return NO;
+ }
+
+ [self sendXEvent:&xe];
+
+ // Rootless: Send first NSLeftMouseDown to windows and views so window
+ // ordering can be suppressed.
+ // Don't pass further events - they (incorrectly?) bring the window
+ // forward no matter what.
+ if (quartzRootless &&
+ (type == NSLeftMouseDown || type == NSLeftMouseUp) &&
+ [anEvent clickCount] == 1 &&
+ [[anEvent window] isKindOfClass:windowClass])
+ {
+ return NO;
+ }
+
+ return YES;
+}
+
+// Return mouse coordinates, inverting y coordinate.
+// The coordinates are extracted from an event or the current mouse position.
+// For rootless mode, the menu bar is treated as not part of the usable
+// X display area and the cursor position is adjusted accordingly.
+// Returns YES if the cursor is not in the menu bar.
+- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent
+{
+ NSPoint pt;
+
+ if (anEvent) {
+ NSWindow *eventWindow = [anEvent window];
+
+ if (eventWindow) {
+ pt = [anEvent locationInWindow];
+ pt.x += [eventWindow frame].origin.x;
+ pt.y += [eventWindow frame].origin.y;
+ } else {
+ pt = [NSEvent mouseLocation];
+ }
+ } else {
+ pt = [NSEvent mouseLocation];
+ }
+
+ xe->u.keyButtonPointer.rootX = (int)(pt.x);
+
+ if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) {
+ // mouse in menu bar - tell X11 that it's just below instead
+ xe->u.keyButtonPointer.rootY = aquaMenuBarHeight;
+ return NO;
+ } else {
+ xe->u.keyButtonPointer.rootY =
+ NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y);
+ return YES;
+ }
+}
+
+// Append a string to the given enviroment variable
++ (void)append:(NSString*)value toEnv:(NSString*)name
+{
+ setenv([name cString],
+ [[[NSString stringWithCString:getenv([name cString])]
+ stringByAppendingString:value] cString],1);
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ // Block SIGPIPE
+ // SIGPIPE repeatably killed the (rootless) server when closing a
+ // dozen xterms in rapid succession. Those SIGPIPEs should have been
+ // sent to the X server thread, which ignores them, but somehow they
+ // ended up in this thread instead.
+ {
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set, SIGPIPE);
+ // pthread_sigmask not implemented yet
+ // pthread_sigmask(SIG_BLOCK, &set, NULL);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+ }
+
+ if (quartzRootless == -1) {
+ // The display mode was not set from the command line.
+ // Show mode pick panel?
+ if ([Preferences modeWindow]) {
+ if ([Preferences rootless])
+ [startRootlessButton setKeyEquivalent:@"\r"];
+ else
+ [startFullScreenButton setKeyEquivalent:@"\r"];
+ [modeWindow makeKeyAndOrderFront:nil];
+ } else {
+ // Otherwise use default mode
+ quartzRootless = [Preferences rootless];
+ [self startX];
+ }
+ } else {
+ [self startX];
+ }
+}
+
+// Start the X server thread and the client process
+- (void)startX
+{
+ NSDictionary *appDictionary;
+ NSString *appVersion;
+
+ [modeWindow close];
+
+ // Calculate the height of the menu bar so rootless mode can avoid it
+ if (quartzRootless) {
+ aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
+ NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1;
+ aquaMenuBarBox =
+ NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1,
+ NSWidth([[NSScreen mainScreen] frame]),
+ aquaMenuBarHeight);
+ }
+
+ // Write the XDarwin version to the console log
+ appDictionary = [[NSBundle mainBundle] infoDictionary];
+ appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"];
+ if (appVersion)
+ NSLog(@"\n%@", appVersion);
+ else
+ NSLog(@"No version");
+
+ // Start the X server thread
+ serverState = server_Starting;
+ [NSThread detachNewThreadSelector:@selector(run) toTarget:self
+ withObject:nil];
+
+ // Start the X clients if started from GUI
+ if (quartzStartClients) {
+ [self startXClients];
+ }
+
+ if (quartzRootless) {
+ // There is no help window for rootless; just start
+ [helpWindow close];
+ helpWindow = nil;
+ } else {
+ IONotificationPortRef notify;
+ io_object_t anIterator;
+
+ // Register for system power notifications
+ root_port = IORegisterForSystemPower(0, &notify, powerDidChange,
+ &anIterator);
+ if (root_port) {
+ CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop],
+ IONotificationPortGetRunLoopSource(notify),
+ kCFRunLoopDefaultMode);
+ } else {
+ NSLog(@"Failed to register for system power notifications.");
+ }
+
+ // Show the X switch window if not using dock icon switching
+ if (![Preferences dockSwitch])
+ [switchWindow orderFront:nil];
+
+ if ([Preferences startupHelp]) {
+ // display the full screen mode help
+ [helpWindow makeKeyAndOrderFront:nil];
+ queueShowServer = NO;
+ } else {
+ // start running full screen and make sure X is visible
+ ShowMenuBar();
+ [self closeHelpAndShow:nil];
+ }
+ }
+}
+
+// Finish starting the X server thread
+// This includes anything that must be done after the X server is
+// ready to process events.
+- (void)finishStartX
+{
+ sendServerEvents = YES;
+ serverState = server_Running;
+
+ if (quartzRootless) {
+ [self forceShowServer:[NSApp isActive]];
+ } else {
+ [self forceShowServer:queueShowServer];
+ }
+
+ if (quartzServerQuitting) {
+ [self quitServer];
+ [NSApp replyToApplicationShouldTerminate:YES];
+ }
+}
+
+// Start the first X clients in a separate process
+- (BOOL)startXClients
+{
+ struct passwd *passwdUser;
+ NSString *shellPath, *dashShellName, *commandStr, *startXPath;
+ NSMutableString *safeStartXPath;
+ NSRange aRange;
+ NSBundle *thisBundle;
+ const char *shellPathStr, *newargv[3], *shellNameStr;
+ int fd[2], outFD, length, shellType, i;
+
+ // Register to catch the signal when the client processs finishes
+ signal(SIGCHLD, childDone);
+
+ // Get user's password database entry
+ passwdUser = getpwuid(getuid());
+
+ // Find the shell to use
+ if ([Preferences useDefaultShell])
+ shellPath = [NSString stringWithCString:passwdUser->pw_shell];
+ else
+ shellPath = [Preferences shellString];
+
+ dashShellName = [NSString stringWithFormat:@"-%@",
+ [shellPath lastPathComponent]];
+ shellPathStr = [shellPath cString];
+ shellNameStr = [[shellPath lastPathComponent] cString];
+
+ if (access(shellPathStr, X_OK)) {
+ NSLog(@"Shell %s is not valid!", shellPathStr);
+ return NO;
+ }
+
+ // Find the type of shell
+ for (i = 0; shellList[i].name; i++) {
+ if (!strcmp(shellNameStr, shellList[i].name))
+ break;
+ }
+ shellType = shellList[i].type;
+
+ newargv[0] = [dashShellName cString];
+ if (shellType == shell_Bourne) {
+ // Bourne shells need to be told they are interactive to make
+ // sure they read all their initialization files.
+ newargv[1] = "-i";
+ newargv[2] = NULL;
+ } else {
+ newargv[1] = NULL;
+ }
+
+ // Create a pipe to communicate with the X client process
+ NSAssert(pipe(fd) == 0, @"Could not create new pipe.");
+
+ // Open a file descriptor for writing to stdout and stderr
+ outFD = open("/dev/console", O_WRONLY, 0);
+ if (outFD == -1) {
+ outFD = open("/dev/null", O_WRONLY, 0);
+ NSAssert(outFD != -1, @"Could not open shell output.");
+ }
+
+ // Fork process to start X clients in user's default shell
+ // Sadly we can't use NSTask because we need to start a login shell.
+ // Login shells are started by passing "-" as the first character of
+ // argument 0. NSTask forces argument 0 to be the shell's name.
+ clientPID = vfork();
+ if (clientPID == 0) {
+
+ // Inside the new process:
+ if (fd[0] != STDIN_FILENO) {
+ dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
+ close(fd[0]);
+ }
+ close(fd[1]); // Close write end of pipe
+ if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
+ dup2(outFD, STDERR_FILENO);
+ } else if (outFD == STDERR_FILENO) {
+ dup2(outFD, STDOUT_FILENO);
+ } else {
+ dup2(outFD, STDERR_FILENO);
+ dup2(outFD, STDOUT_FILENO);
+ close(outFD);
+ }
+
+ // Setup environment
+ setenv("HOME", passwdUser->pw_dir, 1);
+ setenv("SHELL", shellPathStr, 1);
+ setenv("LOGNAME", passwdUser->pw_name, 1);
+ setenv("USER", passwdUser->pw_name, 1);
+ setenv("TERM", "unknown", 1);
+ if (chdir(passwdUser->pw_dir)) // Change to user's home dir
+ NSLog(@"Could not change to user's home directory.");
+
+ execv(shellPathStr, (char * const *)newargv); // Start user's shell
+
+ NSLog(@"Could not start X client process with errno = %i.", errno);
+ _exit(127);
+ }
+
+ // In parent process:
+ close(fd[0]); // Close read end of pipe
+ close(outFD); // Close output file descriptor
+
+ thisBundle = [NSBundle bundleForClass:[self class]];
+ startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil];
+ if (!startXPath) {
+ NSLog(@"Could not find startXClients in application bundle!");
+ return NO;
+ }
+
+ // We will run the startXClients script with the path in single quotes
+ // in case there are problematic characters in the path. We still have
+ // to worry about there being single quotes in the path. So, replace
+ // all instances of the ' character in startXPath with '\''.
+ safeStartXPath = [NSMutableString stringWithString:startXPath];
+ aRange = NSMakeRange(0, [safeStartXPath length]);
+ while (aRange.length) {
+ aRange = [safeStartXPath rangeOfString:@"'" options:0 range:aRange];
+ if (!aRange.length)
+ break;
+ [safeStartXPath replaceCharactersInRange:aRange
+ withString:@"\'\\'\'"];
+ aRange.location += 4;
+ aRange.length = [safeStartXPath length] - aRange.location;
+ }
+
+ if ([Preferences addToPath]) {
+ commandStr = [NSString stringWithFormat:@"'%@' :%d %@\n",
+ safeStartXPath, [Preferences display],
+ [Preferences addToPathString]];
+ } else {
+ commandStr = [NSString stringWithFormat:@"'%@' :%d\n",
+ safeStartXPath, [Preferences display]];
+ }
+
+ length = [commandStr cStringLength];
+ if (write(fd[1], [commandStr cString], length) != length) {
+ NSLog(@"Write to X client process failed.");
+ return NO;
+ }
+
+ // Close the pipe so that shell will terminate when xinit quits
+ close(fd[1]);
+
+ return YES;
+}
+
+// Run the X server thread
+- (void)run
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [serverLock lock];
+ main(argcGlobal, argvGlobal, envpGlobal);
+ serverVisible = NO;
+ [pool release];
+ [serverLock unlock];
+ QuartzMessageMainThread(kQuartzServerDied, nil, 0);
+}
+
+// Full screen mode was picked in the mode pick panel
+- (IBAction)startFullScreen:(id)sender
+{
+ [Preferences setModeWindow:[startupModeButton intValue]];
+ [Preferences saveToDisk];
+ quartzRootless = FALSE;
+ [self startX];
+}
+
+// Rootless mode was picked in the mode pick panel
+- (IBAction)startRootless:(id)sender
+{
+ [Preferences setModeWindow:[startupModeButton intValue]];
+ [Preferences saveToDisk];
+ quartzRootless = TRUE;
+ [self startX];
+}
+
+// Close the help splash screen and show the X server
+- (IBAction)closeHelpAndShow:(id)sender
+{
+ if (sender) {
+ int helpVal = [startupHelpButton intValue];
+ [Preferences setStartupHelp:helpVal];
+ [Preferences saveToDisk];
+ }
+ [helpWindow close];
+ helpWindow = nil;
+
+ [self forceShowServer:YES];
+ [NSApp activateIgnoringOtherApps:YES];
+}
+
+// Show the X server when sent message from GUI
+- (IBAction)showAction:(id)sender
+{
+ [self forceShowServer:YES];
+}
+
+// Show or hide the X server or menu bar in rootless mode
+- (void)toggle
+{
+ if (quartzRootless) {
+#if 0
+ // FIXME: Remove or add option to not dodge menubar
+ if (rootlessMenuBarVisible)
+ HideMenuBar();
+ else
+ ShowMenuBar();
+ rootlessMenuBarVisible = !rootlessMenuBarVisible;
+#endif
+ } else {
+ [self showServer:!serverVisible];
+ }
+}
+
+// Show or hide the X server on screen
+- (void)showServer:(BOOL)show
+{
+ // Do not show or hide multiple times in a row
+ if (serverVisible == show)
+ return;
+
+ if (sendServerEvents) {
+ [self sendShowHide:show];
+ } else if (serverState == server_Starting) {
+ queueShowServer = show;
+ }
+}
+
+// Show or hide the X server irregardless of the current state
+- (void)forceShowServer:(BOOL)show
+{
+ serverVisible = !show;
+ [self showServer:show];
+}
+
+// Tell the X server to show or hide itself.
+// This ignores the current X server visible state.
+//
+// In full screen mode, the order we do things is important and must be
+// preserved between the threads. X drawing operations have to be performed
+// in the X server thread. It appears that we have the additional
+// constraint that we must hide and show the menu bar in the main thread.
+//
+// To show the X server:
+// 1. Capture the displays. (Main thread)
+// 2. Hide the menu bar. (Must be in main thread)
+// 3. Send event to X server thread to redraw X screen.
+// 4. Redraw the X screen. (Must be in X server thread)
+//
+// To hide the X server:
+// 1. Send event to X server thread to stop drawing.
+// 2. Stop drawing to the X screen. (Must be in X server thread)
+// 3. Message main thread that drawing is stopped.
+// 4. If main thread still wants X server hidden:
+// a. Release the displays. (Main thread)
+// b. Unhide the menu bar. (Must be in main thread)
+// Otherwise we have already queued an event to start drawing again.
+//
+- (void)sendShowHide:(BOOL)show
+{
+ xEvent xe;
+
+ [self getMousePosition:&xe fromEvent:nil];
+
+ if (show) {
+ if (!quartzRootless) {
+ QuartzFSCapture();
+ HideMenuBar();
+ }
+ xe.u.u.type = kXDarwinShow;
+ [self sendXEvent:&xe];
+
+ // the mouse location will have moved; track it
+ xe.u.u.type = MotionNotify;
+ [self sendXEvent:&xe];
+
+ // inform the X server of the current modifier state
+ xe.u.u.type = kXDarwinUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
+ [self sendXEvent:&xe];
+
+ // put the pasteboard into the X cut buffer
+ [self readPasteboard];
+ } else {
+ // put the X cut buffer on the pasteboard
+ [self writePasteboard];
+
+ xe.u.u.type = kXDarwinHide;
+ [self sendXEvent:&xe];
+ }
+
+ serverVisible = show;
+}
+
+// Enable or disable rendering to the X screen
+- (void)setRootClip:(BOOL)enable
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinSetRootClip;
+ xe.u.clientMessage.u.l.longs0 = enable;
+ [self sendXEvent:&xe];
+}
+
+// Tell the X server to read from the pasteboard into the X cut buffer
+- (void)readPasteboard
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinReadPasteboard;
+ [self sendXEvent:&xe];
+}
+
+// Tell the X server to write the X cut buffer into the pasteboard
+- (void)writePasteboard
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinWritePasteboard;
+ [self sendXEvent:&xe];
+}
+
+- (void)quitServer
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinQuit;
+ [self sendXEvent:&xe];
+
+ // Revert to the Mac OS X arrow cursor. The main thread sets the cursor
+ // and it won't be responding to future requests to change it.
+ [[NSCursor arrowCursor] set];
+
+ serverState = server_Quitting;
+}
+
+- (void)sendXEvent:(xEvent *)xe
+{
+ // This field should be filled in for every event
+ xe->u.keyButtonPointer.time = GetTimeInMillis();
+
+#if 0
+ // FIXME: Really?
+ if (quartzRootless &&
+ (ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp ||
+ (ev->type == NSSystemDefined && ev->data.compound.subType == 7)))
+ {
+ // mouse button event - send mouseMoved to this position too
+ // X gets confused if it gets a click that isn't at the last
+ // reported mouse position.
+ xEvent moveEvent = *ev;
+ xe.u.u.type = NSMouseMoved;
+ [self sendXEvent:&moveEvent];
+ }
+#endif
+
+ ENQUEUE(xe);
+}
+
+// Handle messages from the X server thread
+- (void)handlePortMessage:(NSPortMessage *)portMessage
+{
+ unsigned msg = [portMessage msgid];
+
+ switch(msg) {
+ case kQuartzServerHidden:
+ // Make sure the X server wasn't queued to be shown again while
+ // the hide was pending.
+ if (!quartzRootless && !serverVisible) {
+ QuartzFSRelease();
+ ShowMenuBar();
+ }
+ break;
+
+ case kQuartzServerStarted:
+ [self finishStartX];
+ break;
+
+ case kQuartzServerDied:
+ sendServerEvents = NO;
+ serverState = server_Done;
+ if (!quartzServerQuitting) {
+ [NSApp terminate:nil]; // quit if we aren't already
+ }
+ break;
+
+ case kQuartzCursorUpdate:
+ QuartzReallySetCursor();
+ break;
+
+ case kQuartzPostEvent:
+ {
+ const xEvent *xe = [[[portMessage components] lastObject] bytes];
+ ENQUEUE(xe);
+ break;
+ }
+
+ default:
+ NSLog(@"Unknown message from server thread.");
+ }
+}
+
+// Quit the X server when the X client process finishes
+- (void)clientProcessDone:(int)clientStatus
+{
+ if (WIFEXITED(clientStatus)) {
+ int exitStatus = WEXITSTATUS(clientStatus);
+ if (exitStatus != 0)
+ NSLog(@"X client process terminated with status %i.", exitStatus);
+ } else {
+ NSLog(@"X client process terminated abnormally.");
+ }
+
+ if (!quartzServerQuitting) {
+ [NSApp terminate:nil]; // quit if we aren't already
+ }
+}
+
+// Called when the user clicks the application icon,
+// but not when Cmd-Tab is used.
+// Rootless: Don't switch until applicationWillBecomeActive.
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
+ hasVisibleWindows:(BOOL)flag
+{
+ if ([Preferences dockSwitch] && !quartzRootless) {
+ [self showServer:YES];
+ }
+ return NO;
+}
+
+- (void)applicationWillResignActive:(NSNotification *)aNotification
+{
+ [self showServer:NO];
+}
+
+- (void)applicationWillBecomeActive:(NSNotification *)aNotification