aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/XTrap/makefile5
-rw-r--r--xorg-server/Xext/Makefile42
-rw-r--r--xorg-server/Xext/dpms.c2
-rw-r--r--xorg-server/Xext/saver.c2
-rw-r--r--xorg-server/Xext/security.c2
-rw-r--r--xorg-server/Xext/shape.c2
-rw-r--r--xorg-server/Xext/shm.c21
-rw-r--r--xorg-server/Xext/xace.c2
-rw-r--r--xorg-server/Xext/xevie.c2
-rw-r--r--xorg-server/Xi/exevents.c2
-rw-r--r--xorg-server/Xi/makefile40
-rw-r--r--xorg-server/afb/afbply1rct.c8
-rw-r--r--xorg-server/afb/makefile8
-rw-r--r--xorg-server/cfb/cfbmap.h4
-rw-r--r--xorg-server/cfb/makefile10
-rw-r--r--xorg-server/cfb32/makefile5
-rw-r--r--xorg-server/composite/makefile4
-rw-r--r--xorg-server/config/makefile4
-rw-r--r--xorg-server/damageext/makefile4
-rw-r--r--xorg-server/dbe/makefile4
-rw-r--r--xorg-server/dix/colormap.c4
-rw-r--r--xorg-server/dix/dixfonts.c13
-rw-r--r--xorg-server/dix/main.c1
-rw-r--r--xorg-server/dix/makefile8
-rw-r--r--xorg-server/exa/exa_accel.c2
-rw-r--r--xorg-server/exa/exa_migration.c12
-rw-r--r--xorg-server/exa/makefile4
-rw-r--r--xorg-server/fb/fbpict.c3
-rw-r--r--xorg-server/fb/fbpixmap.c11
-rw-r--r--xorg-server/fb/fbpseudocolor.c10
-rw-r--r--xorg-server/fb/makefile9
-rw-r--r--xorg-server/fonts.src/100dpi/makefile343
-rw-r--r--xorg-server/fonts.src/75dpi/makefile343
-rw-r--r--xorg-server/fonts.src/OTF/makefile52
-rw-r--r--xorg-server/fonts.src/Speedo/makefile37
-rw-r--r--xorg-server/fonts.src/TTF/makefile53
-rw-r--r--xorg-server/fonts.src/Type1/makefile93
-rw-r--r--xorg-server/fonts.src/cyrillic/makefile114
-rw-r--r--xorg-server/fonts.src/encodings/large/makefile39
-rw-r--r--xorg-server/fonts.src/encodings/makefile63
-rw-r--r--xorg-server/fonts.src/font-util/makefile5
-rw-r--r--xorg-server/fonts.src/misc/makefile331
-rw-r--r--xorg-server/glx/glapi.h1
-rw-r--r--xorg-server/glx/glheader.h24
-rw-r--r--xorg-server/glx/glxcmds.c4
-rw-r--r--xorg-server/glx/glxcmdsswap.c4
-rw-r--r--xorg-server/glx/glxdri.c3
-rw-r--r--xorg-server/glx/glxdricommon.c8
-rw-r--r--xorg-server/glx/glxdriswrast.c28
-rw-r--r--xorg-server/glx/glxext.c4
-rw-r--r--xorg-server/glx/glxscreens.c4
-rw-r--r--xorg-server/glx/glxserver.h1
-rw-r--r--xorg-server/glx/glxutil.c4
-rw-r--r--xorg-server/glx/indirect_dispatch.c7
-rw-r--r--xorg-server/glx/indirect_dispatch_swap.c7
-rw-r--r--xorg-server/glx/indirect_program.c4
-rw-r--r--xorg-server/glx/indirect_reqsize.c7
-rw-r--r--xorg-server/glx/indirect_size_get.c9
-rw-r--r--xorg-server/glx/indirect_table.c4
-rw-r--r--xorg-server/glx/indirect_texture_compression.c4
-rw-r--r--xorg-server/glx/indirect_util.c4
-rw-r--r--xorg-server/glx/makefile7
-rw-r--r--xorg-server/glx/render2.c4
-rw-r--r--xorg-server/glx/render2swap.c4
-rw-r--r--xorg-server/glx/renderpix.c4
-rw-r--r--xorg-server/glx/renderpixswap.c4
-rw-r--r--xorg-server/glx/rensize.c10
-rw-r--r--xorg-server/glx/single2.c7
-rw-r--r--xorg-server/glx/single2swap.c4
-rw-r--r--xorg-server/glx/singlepix.c4
-rw-r--r--xorg-server/glx/singlepixswap.c4
-rw-r--r--xorg-server/glx/singlesize.c4
-rw-r--r--xorg-server/glx/swap_interval.c6
-rw-r--r--xorg-server/glx/xfont.c4
-rw-r--r--xorg-server/hw/dmx/dmxinit.c7
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c17
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.h4
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c19
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c42
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.h4
-rw-r--r--xorg-server/hw/kdrive/ephyr/makefile6
-rw-r--r--xorg-server/hw/kdrive/fake/fakeinit.c14
-rw-r--r--xorg-server/hw/kdrive/sdl/sdl.c11
-rw-r--r--xorg-server/hw/kdrive/src/kdrive.c7
-rw-r--r--xorg-server/hw/kdrive/src/kinput.c27
-rw-r--r--xorg-server/hw/kdrive/src/kmap.c9
-rw-r--r--xorg-server/hw/kdrive/src/makefile20
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h6
-rw-r--r--xorg-server/hw/xwin/InitInput.c15
-rw-r--r--xorg-server/hw/xwin/InitOutput.c86
-rw-r--r--xorg-server/hw/xwin/X.icobin20870 -> 25214 bytes
-rw-r--r--xorg-server/hw/xwin/XWin.exe.manifest16
-rw-r--r--xorg-server/hw/xwin/XWin.rc59
-rw-r--r--xorg-server/hw/xwin/makefile101
-rw-r--r--xorg-server/hw/xwin/win.h15
-rw-r--r--xorg-server/hw/xwin/winclipboard.h9
-rw-r--r--xorg-server/hw/xwin/winclipboardthread.c38
-rw-r--r--xorg-server/hw/xwin/winclipboardunicode.c34
-rw-r--r--xorg-server/hw/xwin/winclipboardwndproc.c34
-rw-r--r--xorg-server/hw/xwin/winclipboardwrappers.c27
-rw-r--r--xorg-server/hw/xwin/winclipboardxevents.c76
-rw-r--r--xorg-server/hw/xwin/wincreatewnd.c8
-rw-r--r--xorg-server/hw/xwin/wincursor.c16
-rw-r--r--xorg-server/hw/xwin/windialogs.c141
-rw-r--r--xorg-server/hw/xwin/winerror.c38
-rw-r--r--xorg-server/hw/xwin/winglobals.c5
-rw-r--r--xorg-server/hw/xwin/winkeybd.c47
-rw-r--r--xorg-server/hw/xwin/winkeybd.h33
-rw-r--r--xorg-server/hw/xwin/winlayouts.h23
-rw-r--r--xorg-server/hw/xwin/winmouse.c42
-rw-r--r--xorg-server/hw/xwin/winmultiwindowclass.c4
-rw-r--r--xorg-server/hw/xwin/winmultiwindowicons.c316
-rw-r--r--xorg-server/hw/xwin/winmultiwindowshape.c15
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c53
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c333
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwndproc.c234
-rw-r--r--xorg-server/hw/xwin/winpolyline.c2
-rw-r--r--xorg-server/hw/xwin/winprefs.c52
-rw-r--r--xorg-server/hw/xwin/winprefs.h24
-rw-r--r--xorg-server/hw/xwin/winprefslex.l10
-rw-r--r--xorg-server/hw/xwin/winprefsyacc.c7
-rw-r--r--xorg-server/hw/xwin/winprefsyacc.h4
-rw-r--r--xorg-server/hw/xwin/winprefsyacc.y78
-rw-r--r--xorg-server/hw/xwin/winprocarg.c35
-rw-r--r--xorg-server/hw/xwin/winresource.h1
-rw-r--r--xorg-server/hw/xwin/winscrinit.c55
-rw-r--r--xorg-server/hw/xwin/winshaddd.c32
-rw-r--r--xorg-server/hw/xwin/winshadddnl.c23
-rw-r--r--xorg-server/hw/xwin/winshadgdi.c2
-rw-r--r--xorg-server/hw/xwin/winwin32rootless.c5
-rw-r--r--xorg-server/hw/xwin/winwin32rootlesswndproc.c9
-rw-r--r--xorg-server/hw/xwin/winwindow.c5
-rw-r--r--xorg-server/hw/xwin/winwindow.h23
-rw-r--r--xorg-server/hw/xwin/winwindowswm.c2
-rw-r--r--xorg-server/hw/xwin/winwndproc.c13
-rw-r--r--xorg-server/hw/xwin/xlaunch/config.h76
-rw-r--r--xorg-server/hw/xwin/xlaunch/main.cc20
-rw-r--r--xorg-server/hw/xwin/xlaunch/makefile32
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/makefile4
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/util.h2
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/wizard.h1
-rw-r--r--xorg-server/include/dixstruct.h2
-rw-r--r--xorg-server/include/do-not-use-config.h6
-rw-r--r--xorg-server/include/globals.h2
-rw-r--r--xorg-server/include/misc.h4
-rw-r--r--xorg-server/include/pixmapstr.h2
-rw-r--r--xorg-server/include/scrnintstr.h6
-rw-r--r--xorg-server/include/windowstr.h2
-rw-r--r--xorg-server/include/xkb-config.h6
-rw-r--r--xorg-server/makefile102
-rw-r--r--xorg-server/mfb/makefile14
-rw-r--r--xorg-server/mfb/mfbply1rct.c8
-rw-r--r--xorg-server/mi/makefile41
-rw-r--r--xorg-server/mi/micoord.h8
-rw-r--r--xorg-server/miext/damage/makefile7
-rw-r--r--xorg-server/miext/rootless/Xplugin.h713
-rw-r--r--xorg-server/miext/rootless/rootlessWindow.c14
-rw-r--r--xorg-server/miext/rootless/rootlessWindow.h2
-rw-r--r--xorg-server/miext/shadow/makefile25
-rw-r--r--xorg-server/os/WaitFor.c6
-rw-r--r--xorg-server/os/io.c1
-rw-r--r--xorg-server/os/log.c6
-rw-r--r--xorg-server/os/makefile4
-rw-r--r--xorg-server/os/utils.c7
-rw-r--r--xorg-server/os/xprintf.c12
-rw-r--r--xorg-server/os/xstrans.c2
-rw-r--r--xorg-server/protocol.txt1066
-rw-r--r--xorg-server/randr/makefile4
-rw-r--r--xorg-server/randr/rroutput.c5
-rw-r--r--xorg-server/randr/rrscreen.c5
-rw-r--r--xorg-server/record/makefile4
-rw-r--r--xorg-server/render/makefile4
-rw-r--r--xorg-server/render/mipict.c2
-rw-r--r--xorg-server/startmulti.bat1
-rw-r--r--xorg-server/startxdmcp.bat2
-rw-r--r--xorg-server/xfixes/cursor.c2
-rw-r--r--xorg-server/xfixes/makefile9
-rw-r--r--xorg-server/xkb/makefile47
-rw-r--r--xorg-server/xkb/xkb.c2
-rw-r--r--xorg-server/xkb/xkbActions.c6
-rw-r--r--xorg-server/xkb/xkbInit.c6
-rw-r--r--xorg-server/xkbdata.src/compat/makefile33
-rw-r--r--xorg-server/xkbdata.src/geometry/makefile41
-rw-r--r--xorg-server/xkbdata.src/keycodes/makefile36
-rw-r--r--xorg-server/xkbdata.src/keymap/makefile30
-rw-r--r--xorg-server/xkbdata.src/makefile9
-rw-r--r--xorg-server/xkbdata.src/rules/makefile26
-rw-r--r--xorg-server/xkbdata.src/semantics/makefile19
-rw-r--r--xorg-server/xkbdata.src/symbols/makefile136
-rw-r--r--xorg-server/xkbdata.src/types/makefile26
-rw-r--r--xorg-server/xkbdata.src/xkbrules.mak14
-rw-r--r--xorg-server/xwin.rc106
192 files changed, 6402 insertions, 689 deletions
diff --git a/xorg-server/XTrap/makefile b/xorg-server/XTrap/makefile
new file mode 100644
index 000000000..6846a546c
--- /dev/null
+++ b/xorg-server/XTrap/makefile
@@ -0,0 +1,5 @@
+CSRCS = xtrapddmi.c xtrapdi.c xtrapdiswp.c xtrapditbl.c
+
+LIBRARY=libxtrap
+
+
diff --git a/xorg-server/Xext/Makefile b/xorg-server/Xext/Makefile
new file mode 100644
index 000000000..f78eff1eb
--- /dev/null
+++ b/xorg-server/Xext/Makefile
@@ -0,0 +1,42 @@
+CSRCS=\
+bigreq.c \
+cup.c \
+dpms.c \
+dpmsstubs.c \
+EVI.c \
+mbuf.c \
+mitmisc.c \
+sampleEVI.c \
+saver.c \
+security.c \
+shape.c \
+sleepuntil.c \
+sync.c \
+xace.c \
+xcmisc.c \
+xevie.c \
+xres.c \
+xtest.c
+
+#shm.c \
+#appgroup.c \
+#fontcache.c \
+#mbufbf.c \
+#mbufpx.c \
+#panoramiX.c \
+#panoramiXprocs.c \
+#panoramiXSwap.c \
+#xcalibrate.c \
+#xf86bigfont.c \
+#xprint.c \
+#xselinux.c \
+#xvdisp.c \
+#xvmain.c \
+#xvmc.c
+
+LIBRARY=libxext
+
+INCLUDES += ..\hw\xfree86\dixmods\extmod
+
+
+
diff --git a/xorg-server/Xext/dpms.c b/xorg-server/Xext/dpms.c
index e3204febb..be11fd76a 100644
--- a/xorg-server/Xext/dpms.c
+++ b/xorg-server/Xext/dpms.c
@@ -35,6 +35,8 @@ Equipment Corporation.
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define DPMSExtension
#endif
#include <X11/X.h>
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index feab972e2..3a70afe6d 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -31,6 +31,8 @@ in this Software without prior written authorization from the X Consortium.
#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define SCREENSAVER
#endif
#include <X11/X.h>
diff --git a/xorg-server/Xext/security.c b/xorg-server/Xext/security.c
index ad30e06b8..ff6c1edfa 100644
--- a/xorg-server/Xext/security.c
+++ b/xorg-server/Xext/security.c
@@ -26,6 +26,8 @@ in this Software without prior written authorization from The Open Group.
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define XACE
#endif
#include "scrnintstr.h"
diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c
index 2f1baf917..53c7de8b8 100644
--- a/xorg-server/Xext/shape.c
+++ b/xorg-server/Xext/shape.c
@@ -28,6 +28,8 @@ in this Software without prior written authorization from The Open Group.
#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define SHAPE
#endif
#include <stdlib.h>
diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c
index 34c875274..bbcbd05af 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -34,7 +34,8 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <sys/types.h>
-#ifndef Lynx
+#if !defined(_MSC_VER)
+#if !defined(Lynx)
#include <sys/ipc.h>
#include <sys/shm.h>
#else
@@ -42,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
#include <shm.h>
#endif
#include <unistd.h>
+#endif
#include <sys/stat.h>
#define NEED_REPLIES
#define NEED_EVENTS
@@ -348,8 +350,10 @@ ProcShmQueryVersion(client)
rep.pixmapFormat = pixmapFormat;
rep.majorVersion = SHM_MAJOR_VERSION;
rep.minorVersion = SHM_MINOR_VERSION;
+#ifndef _MSC_VER
rep.uid = geteuid();
rep.gid = getegid();
+#endif
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
@@ -399,6 +403,9 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly)
if (uid == 0) {
return 0;
}
+ #ifdef _MSC_VER
+ __asm int 3;
+ #else
/* Check the owner */
if (SHMPERM_UID(perm) == uid || SHMPERM_CUID(perm) == uid) {
mask = S_IRUSR;
@@ -407,10 +414,14 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly)
}
return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1;
}
+ #endif
}
if (gidset) {
/* Check the group */
+ #ifdef _MSC_VER
+ __asm int 3;
+ #else
if (SHMPERM_GID(perm) == gid || SHMPERM_CGID(perm) == gid) {
mask = S_IRGRP;
if (!readonly) {
@@ -418,14 +429,20 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly)
}
return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1;
}
+ #endif
}
}
+ #ifdef _MSC_VER
+ __asm int 3;
+ return -1;
+ #else
/* Otherwise, check everyone else */
mask = S_IROTH;
if (!readonly) {
mask |= S_IWOTH;
}
return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1;
+ #endif
}
static int
@@ -500,7 +517,9 @@ ShmDetachSegment(value, shmseg)
if (--shmdesc->refcnt)
return TRUE;
+#ifndef _MSC_VER
shmdt(shmdesc->addr);
+#endif
for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next)
;
*prev = shmdesc->next;
diff --git a/xorg-server/Xext/xace.c b/xorg-server/Xext/xace.c
index 8a8f8c61d..9d2d2fa51 100644
--- a/xorg-server/Xext/xace.c
+++ b/xorg-server/Xext/xace.c
@@ -19,6 +19,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define XACE
#endif
#include <stdarg.h>
diff --git a/xorg-server/Xext/xevie.c b/xorg-server/Xext/xevie.c
index 1d51fd825..ad1ea52b8 100644
--- a/xorg-server/Xext/xevie.c
+++ b/xorg-server/Xext/xevie.c
@@ -35,6 +35,8 @@ of the copyright holder.
#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define XEVIE
#endif
#include <X11/X.h>
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 641bead33..17cf0e86e 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -55,6 +55,8 @@ SOFTWARE.
#define NEED_EVENTS
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define XINPUT
#endif
#include <X11/X.h>
diff --git a/xorg-server/Xi/makefile b/xorg-server/Xi/makefile
new file mode 100644
index 000000000..422f79acb
--- /dev/null
+++ b/xorg-server/Xi/makefile
@@ -0,0 +1,40 @@
+CSRCS=allowev.c \
+ chgdctl.c \
+ chgfctl.c \
+ chgkbd.c \
+ chgkmap.c \
+ chgprop.c \
+ chgptr.c \
+ closedev.c \
+ devbell.c \
+ exevents.c \
+ extinit.c \
+ getbmap.c \
+ getdctl.c \
+ getfctl.c \
+ getfocus.c \
+ getkmap.c \
+ getmmap.c \
+ getprop.c \
+ getselev.c \
+ getvers.c \
+ grabdev.c \
+ grabdevb.c \
+ grabdevk.c \
+ gtmotion.c \
+ listdev.c \
+ opendev.c \
+ queryst.c \
+ selectev.c \
+ sendexev.c \
+ setbmap.c \
+ setdval.c \
+ setfocus.c \
+ setmmap.c \
+ setmode.c \
+ ungrdev.c \
+ ungrdevb.c \
+ ungrdevk.c
+
+LIBRARY=libXi
+
diff --git a/xorg-server/afb/afbply1rct.c b/xorg-server/afb/afbply1rct.c
index e9d4d5e09..65002c967 100644
--- a/xorg-server/afb/afbply1rct.c
+++ b/xorg-server/afb/afbply1rct.c
@@ -51,14 +51,14 @@ in this Software without prior written authorization from the X Consortium.
#endif
#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) (i))))
+#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int)((short) ((i)&0xffff))))
#define coordToInt(x,y) (((x) << 16) | (y))
#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int)((short) i))
+#define intToY(i) ((int)((short) ((i)&0xffff)))
#else
-#define intToCoord(i,x,y) (((x) = (int)((short) (i))), ((y) = GetHighWord(i)))
+#define intToCoord(i,x,y) (((x) = (int)((short) ((i)&0xffff))), ((y) = GetHighWord(i)))
#define coordToInt(x,y) (((y) << 16) | (x))
-#define intToX(i) ((int)((short) (i)))
+#define intToX(i) ((int)((short) ((i)&0xffff)))
#define intToY(i) (GetHighWord(i))
#endif
diff --git a/xorg-server/afb/makefile b/xorg-server/afb/makefile
new file mode 100644
index 000000000..862f25431
--- /dev/null
+++ b/xorg-server/afb/makefile
@@ -0,0 +1,8 @@
+CSRCS=afbbitblt.c afbbltC.c afbbltCI.c afbbltG.c afbbltO.c afbbltX.c afbbres.c afbbresd.c afbclip.c \
+ afbcmap.c afbfillarc.c afbfillrct.c afbfillsp.c afbfont.c afbgc.c afbgetsp.c afbhrzvert.c afbimage.c afbimggblt.c \
+ afbmisc.c afbpixmap.c afbply1rct.c afbplygblt.c afbpntarea.c afbpolypnt.c afbpushpxl.c afbscrinit.c afbseg.c \
+ afbsetsp.c afbtegblt.c afbtileC.c afbtileG.c afbwindow.c afbzerarc.c
+#afbtile.c afbline.c afbblt.c
+
+LIBRARY=libafb
+
diff --git a/xorg-server/cfb/cfbmap.h b/xorg-server/cfb/cfbmap.h
index 16e4afc3c..14b58c550 100644
--- a/xorg-server/cfb/cfbmap.h
+++ b/xorg-server/cfb/cfbmap.h
@@ -32,6 +32,10 @@ in this Software without prior written authorization from The Open Group.
/* a losing vendor cpp dumps core if we define CFBNAME in terms of CATNAME */
+#ifdef _MSC_VER
+#define PSZ 8
+#endif
+
#if PSZ != 8
#if PSZ == 32
diff --git a/xorg-server/cfb/makefile b/xorg-server/cfb/makefile
new file mode 100644
index 000000000..db934f2a0
--- /dev/null
+++ b/xorg-server/cfb/makefile
@@ -0,0 +1,10 @@
+CSRCS=cfb8bit.c cfb8lineCO.c cfb8lineCP.c cfb8lineG.c cfb8lineX.c cfb8segC.c cfb8segCS.c cfb8segX.c cfb8setG.c \
+ cfballpriv.c cfbbitblt.c cfbbltC.c cfbbltG.c cfbbltO.c cfbbltX.c cfbbres.c cfbbresd.c cfbcmap.c cfbcppl.c \
+ cfbfillarcC.c cfbfillarcG.c cfbfillrct.c cfbfillsp.c cfbgc.c cfbgetsp.c cfbglrop8.c cfbhrzvert.c cfbigblt8.c \
+ cfbimage.c cfbmskbits.c cfbpixmap.c cfbply1rctC.c cfbply1rctG.c cfbpolypnt.c cfbpush8.c cfbrctstp8.c \
+ cfbrrop.c cfbscrinit.c cfbseg.c cfbsetsp.c cfbsolidC.c cfbsolidG.c cfbsolidX.c cfbteblt8.c cfbtegblt.c \
+ cfbtile32C.c cfbtile32G.c cfbtileoddC.c cfbtileoddG.c cfbwindow.c cfbzerarcC.c cfbzerarcG.c cfbzerarcX.c
+#cfbline.c cfbfillarc.c cfbzerarc.c cfbblt.c cfbsolid.c cfbtileodd.c cfbtile32.c cfb8line.c cfbply1rct.c cfbglblt8.c
+
+LIBRARY=libcfb
+
diff --git a/xorg-server/cfb32/makefile b/xorg-server/cfb32/makefile
new file mode 100644
index 000000000..e723acaa2
--- /dev/null
+++ b/xorg-server/cfb32/makefile
@@ -0,0 +1,5 @@
+CSRCS=cfb8lineCO.c cfb8lineCP.c cfb8lineG.c cfb8lineX.c cfb8segC.c cfb8segCS.c cfb8segX.c cfb8setG.c cfbbltC.c cfbbltG.c cfbbltO.c \
+cfbbltX.c cfbfillarcC.c cfbfillarcG.c cfbply1rctC.c cfbply1rctG.c cfbseg.c cfbsolidC.c cfbsolidG.c cfbsolidX.c cfbtile32C.c cfbtile32G.c \
+cfbtileoddC.c cfbtileoddG.c cfbzerarcC.c cfbzerarcG.c cfbzerarcX.c
+
+LIBRARY=libcfb32
diff --git a/xorg-server/composite/makefile b/xorg-server/composite/makefile
new file mode 100644
index 000000000..081608674
--- /dev/null
+++ b/xorg-server/composite/makefile
@@ -0,0 +1,4 @@
+CSRCS=compalloc.c compext.c compinit.c compwindow.c
+
+LIBRARY=libcomposite
+
diff --git a/xorg-server/config/makefile b/xorg-server/config/makefile
new file mode 100644
index 000000000..937785271
--- /dev/null
+++ b/xorg-server/config/makefile
@@ -0,0 +1,4 @@
+CSRCS=config.c
+
+LIBRARY=libconfig
+
diff --git a/xorg-server/damageext/makefile b/xorg-server/damageext/makefile
new file mode 100644
index 000000000..c8481cd3c
--- /dev/null
+++ b/xorg-server/damageext/makefile
@@ -0,0 +1,4 @@
+CSRCS=damageext.c
+
+LIBRARY=libdamageext
+
diff --git a/xorg-server/dbe/makefile b/xorg-server/dbe/makefile
new file mode 100644
index 000000000..70fb81430
--- /dev/null
+++ b/xorg-server/dbe/makefile
@@ -0,0 +1,4 @@
+CSRCS=dbe.c midbe.c
+
+LIBRARY=libdbe
+
diff --git a/xorg-server/dix/colormap.c b/xorg-server/dix/colormap.c
index 8b1bad8a3..f54615111 100644
--- a/xorg-server/dix/colormap.c
+++ b/xorg-server/dix/colormap.c
@@ -66,6 +66,10 @@ SOFTWARE.
#include "privates.h"
#include "xace.h"
+#ifdef _MSC_VER
+#define UpdateColors thisUpdateColors
+#endif
+
extern XID clientErrorValue;
static Pixel FindBestPixel(
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index e9a3f3963..8ed494c09 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -127,6 +127,7 @@ SetDefaultFont(char *defaultfontname)
int err;
FontPtr pf;
XID fid;
+ static FontPtr last_pf;
fid = FakeClientID(0);
err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync,
@@ -134,9 +135,10 @@ SetDefaultFont(char *defaultfontname)
if (err != Success)
return FALSE;
pf = (FontPtr) LookupIDByType(fid, RT_FONT);
- if (pf == (FontPtr) NULL)
+ if (pf != (FontPtr) NULL) last_pf = pf;
+ if (last_pf == (FontPtr) NULL)
return FALSE;
- defaultFont = pf;
+ defaultFont = last_pf;
return TRUE;
}
@@ -1902,22 +1904,15 @@ InitFonts (void)
{
patternCache = MakeFontPatternCache();
-#ifndef BUILTIN_FONTS
if (screenInfo.numScreens > screenInfo.numVideoScreens) {
PrinterFontRegisterFpeFunctions();
FontFileCheckRegisterFpeFunctions();
check_fs_register_fpe_functions();
} else
-#endif
{
-#ifdef BUILTIN_FONTS
BuiltinRegisterFpeFunctions();
-#else
FontFileRegisterFpeFunctions();
-#endif
-#ifndef NOFONTSERVERACCESS
fs_register_fpe_functions();
-#endif
}
}
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index 6d9dd3332..fa1a934a3 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -248,6 +248,7 @@ main(int argc, char *argv[], char *envp[])
char *xauthfile;
HWEventQueueType alwaysCheckForInput[2];
+ ptw32_processInitialize();
display = "0";
InitGlobals();
diff --git a/xorg-server/dix/makefile b/xorg-server/dix/makefile
new file mode 100644
index 000000000..24afd2b94
--- /dev/null
+++ b/xorg-server/dix/makefile
@@ -0,0 +1,8 @@
+DEFINES += FONTDEBUG
+
+CSRCS=atom.c colormap.c cursor.c deprecated.c devices.c dispatch.c dix.c dixfonts.c dixutils.c events.c extension.c ffs.c gc.c \
+getevents.c globals.c glyphcurs.c grabs.c initatoms.c main.c pixmap.c privates.c property.c registry.c resource.c selection.c \
+strcasecmp.c strcasestr.c swaprep.c swapreq.c tables.c window.c xpstubs.c
+
+LIBRARY=libdix
+
diff --git a/xorg-server/exa/exa_accel.c b/xorg-server/exa/exa_accel.c
index 3ec96253d..c049745f2 100644
--- a/xorg-server/exa/exa_accel.c
+++ b/xorg-server/exa/exa_accel.c
@@ -255,7 +255,7 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
bits);
}
-static Bool inline
+static Bool __inline
exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy)
{
diff --git a/xorg-server/exa/exa_migration.c b/xorg-server/exa/exa_migration.c
index b7cc06240..adfbacc9e 100644
--- a/xorg-server/exa/exa_migration.c
+++ b/xorg-server/exa/exa_migration.c
@@ -169,7 +169,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
static Bool firsttime = TRUE;
if (firsttime) {
- ErrorF("%s: Pending damage region empty!\n", __func__);
+ ErrorF("%s: Pending damage region empty!\n", __FUNCTION__ );
firsttime = FALSE;
}
}
@@ -354,8 +354,8 @@ exaDoMoveInPixmap (ExaMigrationPtr migrate)
void
exaMoveInPixmap (PixmapPtr pPixmap)
{
- static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE,
- .pReg = NULL };
+ static ExaMigrationRec migrate = { FALSE, TRUE, NULL,
+ NULL };
migrate.pPix = pPixmap;
exaDoMoveInPixmap (&migrate);
@@ -395,8 +395,8 @@ exaDoMoveOutPixmap (ExaMigrationPtr migrate)
void
exaMoveOutPixmap (PixmapPtr pPixmap)
{
- static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE,
- .pReg = NULL };
+ static ExaMigrationRec migrate = { FALSE, TRUE, NULL,
+ NULL };
migrate.pPix = pPixmap;
exaDoMoveOutPixmap (&migrate);
@@ -589,7 +589,7 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
for (i = 0; i < npixmaps; i++) {
if (!exaPixmapIsDirty (pixmaps[i].pPix) &&
!exaAssertNotDirty (pixmaps[i].pPix))
- ErrorF("%s: Pixmap %d dirty but not marked as such!\n", __func__, i);
+ ErrorF("%s: Pixmap %d dirty but not marked as such!\n", __FUNCTION__ , i);
}
}
/* If anything is pinned in system memory, we won't be able to
diff --git a/xorg-server/exa/makefile b/xorg-server/exa/makefile
new file mode 100644
index 000000000..0373a4be3
--- /dev/null
+++ b/xorg-server/exa/makefile
@@ -0,0 +1,4 @@
+CSRCS=exa.c exa_accel.c exa_migration.c exa_offscreen.c exa_render.c exa_unaccel.c
+
+LIBRARY=libexa
+
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c
index 85b5171c5..b70b7043b 100644
--- a/xorg-server/fb/fbpict.c
+++ b/xorg-server/fb/fbpict.c
@@ -31,9 +31,10 @@
#include "fb.h"
+#include "picturestr.h"
+
#ifdef RENDER
-#include "picturestr.h"
#include "mipict.h"
#include "fbpict.h"
diff --git a/xorg-server/fb/fbpixmap.c b/xorg-server/fb/fbpixmap.c
index 311da9e62..c4c2c4aa7 100644
--- a/xorg-server/fb/fbpixmap.c
+++ b/xorg-server/fb/fbpixmap.c
@@ -323,11 +323,7 @@ fbPixmapToRegion(PixmapPtr pPix)
#ifdef FB_DEBUG
-#ifndef WIN32
#include <stdio.h>
-#else
-#include <dbg.h>
-#endif
static Bool
fbValidateBits (FbStip *bits, int stride, FbStip data)
@@ -336,12 +332,7 @@ fbValidateBits (FbStip *bits, int stride, FbStip data)
{
if (*bits != data)
{
-#ifdef WIN32
- NCD_DEBUG ((DEBUG_FAILURE, "fdValidateBits failed at 0x%x (is 0x%x want 0x%x)",
- bits, *bits, data));
-#else
- fprintf (stderr, "fbValidateBits failed\n");
-#endif
+ fprintf (stderr, "fbValidateBits failed at 0x%x (is 0x%x want 0x%x)\n",bits, *bits, data);
return FALSE;
}
bits++;
diff --git a/xorg-server/fb/fbpseudocolor.c b/xorg-server/fb/fbpseudocolor.c
index 06cf15992..df51eed8d 100644
--- a/xorg-server/fb/fbpseudocolor.c
+++ b/xorg-server/fb/fbpseudocolor.c
@@ -2145,13 +2145,13 @@ xxPushPixels(
#define RENDER_ADD_BOX(pScreen,box) {\
if (BOX_NOT_EMPTY(box)) { \
RegionRec region; \
- xxScrPriv(pScreen);\
- ScreenPtr pScreen = pScreen;\
- REGION_INIT (pScreen, &region, &box, 1); \
+ ScreenPtr pthisScreen = pScreen;\
+ xxScrPriv(pthisScreen);\
+ REGION_INIT (pthisScreen, &region, &box, 1); \
PRINT_RECTS(pScrPriv->region);\
- REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,&region);\
+ REGION_UNION(pthisScreen,&pScrPriv->region,&pScrPriv->region,&region);\
PRINT_RECTS(pScrPriv->region);\
- REGION_UNINIT(pScreen,&region);\
+ REGION_UNINIT(pthisScreen,&region);\
}\
}
diff --git a/xorg-server/fb/makefile b/xorg-server/fb/makefile
new file mode 100644
index 000000000..fd6ae3e7c
--- /dev/null
+++ b/xorg-server/fb/makefile
@@ -0,0 +1,9 @@
+CSRCS=fb24_32.c fballpriv.c fbarc.c fbbits.c fbblt.c fbbltone.c fbcmap_mi.c fbcopy.c fbfill.c fbfillrect.c fbfillsp.c \
+fbgc.c fbgetsp.c fbglyph.c fbimage.c fbline.c fboverlay.c fbpict.c fbpixmap.c fbpoint.c fbpseudocolor.c fbpush.c fbscreen.c \
+fbseg.c fbsetsp.c fbsolid.c fbstipple.c fbtile.c fbtrap.c fbutil.c fbwindow.c
+
+LIBRARY=libfb
+
+CCFLAGS:=$(CCFLAGS:-RTCc=)
+
+
diff --git a/xorg-server/fonts.src/100dpi/makefile b/xorg-server/fonts.src/100dpi/makefile
new file mode 100644
index 000000000..5b792525c
--- /dev/null
+++ b/xorg-server/fonts.src/100dpi/makefile
@@ -0,0 +1,343 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\100dpi
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+BDF2UCS_FONT_FILES = \
+ lutBS08 \
+ lutBS10 \
+ lutBS12 \
+ lutBS14 \
+ lutBS18 \
+ lutBS19 \
+ lutBS24 \
+ lutRS08 \
+ lutRS10 \
+ lutRS12 \
+ lutRS14 \
+ lutRS18 \
+ lutRS19 \
+ lutRS24 \
+ lubB08 \
+ lubB10 \
+ lubB12 \
+ lubB14 \
+ lubB18 \
+ lubB19 \
+ lubB24 \
+ lubBI08 \
+ lubBI10 \
+ lubBI12 \
+ lubBI14 \
+ lubBI18 \
+ lubBI19 \
+ lubBI24 \
+ lubI08 \
+ lubI10 \
+ lubI12 \
+ lubI14 \
+ lubI18 \
+ lubI19 \
+ lubI24 \
+ luBIS08 \
+ luBIS10 \
+ luBIS12 \
+ luBIS14 \
+ luBIS18 \
+ luBIS19 \
+ luBIS24 \
+ lubR08 \
+ lubR10 \
+ lubR12 \
+ lubR14 \
+ lubR18 \
+ lubR19 \
+ lubR24 \
+ luBS08 \
+ luBS10 \
+ luBS12 \
+ luBS14 \
+ luBS18 \
+ luBS19 \
+ luBS24 \
+ luIS08 \
+ luIS10 \
+ luIS12 \
+ luIS14 \
+ luIS18 \
+ luIS19 \
+ luIS24 \
+ luRS08 \
+ luRS10 \
+ luRS12 \
+ luRS14 \
+ luRS18 \
+ luRS19 \
+ luRS24 \
+ UTB___10 \
+ UTB___12 \
+ UTB___14 \
+ UTB___18 \
+ UTB___24 \
+ UTBI__10 \
+ UTBI__12 \
+ UTBI__14 \
+ UTBI__18 \
+ UTBI__24 \
+ UTI___10 \
+ UTI___12 \
+ UTI___14 \
+ UTI___18 \
+ UTI___24 \
+ UTRG__10 \
+ UTRG__12 \
+ UTRG__14 \
+ UTRG__18 \
+ UTRG__24 \
+ courB08 \
+ courB10 \
+ courB12 \
+ courB14 \
+ courB18 \
+ courB24 \
+ courBO08 \
+ courBO10 \
+ courBO12 \
+ courBO14 \
+ courBO18 \
+ courBO24 \
+ courO08 \
+ courO10 \
+ courO12 \
+ courO14 \
+ courO18 \
+ courO24 \
+ courR08 \
+ courR10 \
+ courR12 \
+ courR14 \
+ courR18 \
+ courR24 \
+ helvB08 \
+ helvB10 \
+ helvB12 \
+ helvB14 \
+ helvB18 \
+ helvB24 \
+ helvBO08 \
+ helvBO10 \
+ helvBO12 \
+ helvBO14 \
+ helvBO18 \
+ helvBO24 \
+ helvO08 \
+ helvO10 \
+ helvO12 \
+ helvO14 \
+ helvO18 \
+ helvO24 \
+ helvR08 \
+ helvR10 \
+ helvR12 \
+ helvR14 \
+ helvR18 \
+ helvR24 \
+ ncenB08 \
+ ncenB10 \
+ ncenB12 \
+ ncenB14 \
+ ncenB18 \
+ ncenB24 \
+ ncenBI08 \
+ ncenBI10 \
+ ncenBI12 \
+ ncenBI14 \
+ ncenBI18 \
+ ncenBI24 \
+ ncenI08 \
+ ncenI10 \
+ ncenI12 \
+ ncenI14 \
+ ncenI18 \
+ ncenI24 \
+ ncenR08 \
+ ncenR10 \
+ ncenR12 \
+ ncenR14 \
+ ncenR18 \
+ ncenR24 \
+ timB08 \
+ timB10 \
+ timB12 \
+ timB14 \
+ timB18 \
+ timB24 \
+ timBI08 \
+ timBI10 \
+ timBI12 \
+ timBI14 \
+ timBI18 \
+ timBI24 \
+ timI08 \
+ timI10 \
+ timI12 \
+ timI14 \
+ timI18 \
+ timI24 \
+ timR08 \
+ timR10 \
+ timR12 \
+ timR14 \
+ timR18 \
+ timR24
+EXTRA_FONT_FILES = \
+ symb08 \
+ symb10 \
+ symb12 \
+ symb14 \
+ symb18 \
+ symb24 \
+ charB08 \
+ charB10 \
+ charB12 \
+ charB14 \
+ charB18 \
+ charB24 \
+ charBI08 \
+ charBI10 \
+ charBI12 \
+ charBI14 \
+ charBI18 \
+ charBI24 \
+ charI08 \
+ charI10 \
+ charI12 \
+ charI14 \
+ charI18 \
+ charI24 \
+ charR08 \
+ charR10 \
+ charR12 \
+ charR14 \
+ charR18 \
+ charR24 \
+ tech14 \
+ techB14 \
+ term14 \
+ termB14
+FONT_FILES = $(BDF2UCS_FONT_FILES) $(EXTRA_FONT_FILES)
+
+BDF_FILES = $(FONT_FILES:%=%.bdf)
+PCF_FILES = $(FONT_FILES:%=$(DESTDIR)\%.pcf.gz)
+
+ISO8859_1_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.bdf)
+ISO8859_1_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.bdf)
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.bdf)
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.bdf)
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_9_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.bdf)
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.bdf)
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_13_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.bdf)
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.bdf)
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+ISO8859_15_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.bdf)
+ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-15.pcf.gz)
+
+UTIL_DIR = ..\font-util
+UCS2ANY = $(UTIL_DIR)\$(OBJDIR)\ucs2any.exe
+
+load_makefile $(UTIL_DIR)\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+%-ISO8859-1.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+
+%-ISO8859-2.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+
+%-ISO8859-3.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+
+%-ISO8859-4.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+
+%-ISO8859-9.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+
+%-ISO8859-10.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+
+%-ISO8859-13.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+
+%-ISO8859-14.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+
+%-ISO8859-15.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+
+fontdir = .
+font_DATA = \
+ $(PCF_FILES) \
+ $(ISO8859_1_PCF_FILES) \
+ $(ISO8859_2_PCF_FILES) \
+ $(ISO8859_3_PCF_FILES) \
+ $(ISO8859_4_PCF_FILES) \
+ $(ISO8859_9_PCF_FILES) \
+ $(ISO8859_10_PCF_FILES) \
+ $(ISO8859_13_PCF_FILES) \
+ $(ISO8859_14_PCF_FILES) \
+ $(ISO8859_15_PCF_FILES)
+BUILT_BDF_FILES = \
+ $(ISO8859_1_BDF_FILES) \
+ $(ISO8859_2_BDF_FILES) \
+ $(ISO8859_3_BDF_FILES) \
+ $(ISO8859_4_BDF_FILES) \
+ $(ISO8859_9_BDF_FILES) \
+ $(ISO8859_10_BDF_FILES) \
+ $(ISO8859_13_BDF_FILES) \
+ $(ISO8859_14_BDF_FILES) \
+ $(ISO8859_15_BDF_FILES)
+
+all: $(DESTDIR) $(UCS2ANY) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.alias
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+$(DESTDIR)\fonts.alias: fonts.alias
+ copy $< $@
+
diff --git a/xorg-server/fonts.src/75dpi/makefile b/xorg-server/fonts.src/75dpi/makefile
new file mode 100644
index 000000000..e7d8bf085
--- /dev/null
+++ b/xorg-server/fonts.src/75dpi/makefile
@@ -0,0 +1,343 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\75dpi
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+BDF2UCS_FONT_FILES = \
+ lutBS08 \
+ lutBS10 \
+ lutBS12 \
+ lutBS14 \
+ lutBS18 \
+ lutBS19 \
+ lutBS24 \
+ lutRS08 \
+ lutRS10 \
+ lutRS12 \
+ lutRS14 \
+ lutRS18 \
+ lutRS19 \
+ lutRS24 \
+ UTB___10 \
+ UTB___12 \
+ UTB___14 \
+ UTB___18 \
+ UTB___24 \
+ UTBI__10 \
+ UTBI__12 \
+ UTBI__14 \
+ UTBI__18 \
+ UTBI__24 \
+ UTI___10 \
+ UTI___12 \
+ UTI___14 \
+ UTI___18 \
+ UTI___24 \
+ UTRG__10 \
+ UTRG__12 \
+ UTRG__14 \
+ UTRG__18 \
+ UTRG__24 \
+ courB08 \
+ courB10 \
+ courB12 \
+ courB14 \
+ courB18 \
+ courB24 \
+ courBO08 \
+ courBO10 \
+ courBO12 \
+ courBO14 \
+ courBO18 \
+ courBO24 \
+ courO08 \
+ courO10 \
+ courO12 \
+ courO14 \
+ courO18 \
+ courO24 \
+ courR08 \
+ courR10 \
+ courR12 \
+ courR14 \
+ courR18 \
+ courR24 \
+ helvB08 \
+ helvB10 \
+ helvB12 \
+ helvB14 \
+ helvB18 \
+ helvB24 \
+ helvBO08 \
+ helvBO10 \
+ helvBO12 \
+ helvBO14 \
+ helvBO18 \
+ helvBO24 \
+ helvO08 \
+ helvO10 \
+ helvO12 \
+ helvO14 \
+ helvO18 \
+ helvO24 \
+ helvR08 \
+ helvR10 \
+ helvR12 \
+ helvR14 \
+ helvR18 \
+ helvR24 \
+ ncenB08 \
+ ncenB10 \
+ ncenB12 \
+ ncenB14 \
+ ncenB18 \
+ ncenB24 \
+ ncenBI08 \
+ ncenBI10 \
+ ncenBI12 \
+ ncenBI14 \
+ ncenBI18 \
+ ncenBI24 \
+ ncenI08 \
+ ncenI10 \
+ ncenI12 \
+ ncenI14 \
+ ncenI18 \
+ ncenI24 \
+ ncenR08 \
+ ncenR10 \
+ ncenR12 \
+ ncenR14 \
+ ncenR18 \
+ ncenR24 \
+ timB08 \
+ timB10 \
+ timB12 \
+ timB14 \
+ timB18 \
+ timB24 \
+ timBI08 \
+ timBI10 \
+ timBI12 \
+ timBI14 \
+ timBI18 \
+ timBI24 \
+ timI08 \
+ timI10 \
+ timI12 \
+ timI14 \
+ timI18 \
+ timI24 \
+ timR08 \
+ timR10 \
+ timR12 \
+ timR14 \
+ timR18 \
+ timR24 \
+ lubB08 \
+ lubB10 \
+ lubB12 \
+ lubB14 \
+ lubB18 \
+ lubB19 \
+ lubB24 \
+ lubBI08 \
+ lubBI10 \
+ lubBI12 \
+ lubBI14 \
+ lubBI18 \
+ lubBI19 \
+ lubBI24 \
+ lubI08 \
+ lubI10 \
+ lubI12 \
+ lubI14 \
+ lubI18 \
+ lubI19 \
+ lubI24 \
+ luBIS08 \
+ luBIS10 \
+ luBIS12 \
+ luBIS14 \
+ luBIS18 \
+ luBIS19 \
+ luBIS24 \
+ lubR08 \
+ lubR10 \
+ lubR12 \
+ lubR14 \
+ lubR18 \
+ lubR19 \
+ lubR24 \
+ luBS08 \
+ luBS10 \
+ luBS12 \
+ luBS14 \
+ luBS18 \
+ luBS19 \
+ luBS24 \
+ luIS08 \
+ luIS10 \
+ luIS12 \
+ luIS14 \
+ luIS18 \
+ luIS19 \
+ luIS24 \
+ luRS08 \
+ luRS10 \
+ luRS12 \
+ luRS14 \
+ luRS18 \
+ luRS19 \
+ luRS24
+EXTRA_FONT_FILES = \
+ charB08 \
+ charB10 \
+ charB12 \
+ charB14 \
+ charB18 \
+ charB24 \
+ charBI08 \
+ charBI10 \
+ charBI12 \
+ charBI14 \
+ charBI18 \
+ charBI24 \
+ charI08 \
+ charI10 \
+ charI12 \
+ charI14 \
+ charI18 \
+ charI24 \
+ charR08 \
+ charR10 \
+ charR12 \
+ charR14 \
+ charR18 \
+ charR24 \
+ tech14 \
+ techB14 \
+ term14 \
+ termB14 \
+ symb08 \
+ symb10 \
+ symb12 \
+ symb14 \
+ symb18 \
+ symb24
+FONT_FILES = $(BDF2UCS_FONT_FILES) $(EXTRA_FONT_FILES)
+
+BDF_FILES = $(FONT_FILES:%=%.bdf)
+PCF_FILES = $(FONT_FILES:%=$(DESTDIR)\%.pcf.gz)
+
+ISO8859_1_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.bdf)
+ISO8859_1_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.bdf)
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.bdf)
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.bdf)
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_9_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.bdf)
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.bdf)
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_13_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.bdf)
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.bdf)
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+ISO8859_15_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.bdf)
+ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-15.pcf.gz)
+
+UTIL_DIR = ..\font-util
+UCS2ANY = $(UTIL_DIR)\$(OBJDIR)\ucs2any.exe
+
+load_makefile $(UTIL_DIR)\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+%-ISO8859-1.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+
+%-ISO8859-2.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+
+%-ISO8859-3.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+
+%-ISO8859-4.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+
+%-ISO8859-9.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+
+%-ISO8859-10.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+
+%-ISO8859-13.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+
+%-ISO8859-14.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+
+%-ISO8859-15.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+
+fontdir = .
+font_DATA = \
+ $(PCF_FILES) \
+ $(ISO8859_1_PCF_FILES) \
+ $(ISO8859_2_PCF_FILES) \
+ $(ISO8859_3_PCF_FILES) \
+ $(ISO8859_4_PCF_FILES) \
+ $(ISO8859_9_PCF_FILES) \
+ $(ISO8859_10_PCF_FILES) \
+ $(ISO8859_13_PCF_FILES) \
+ $(ISO8859_14_PCF_FILES) \
+ $(ISO8859_15_PCF_FILES)
+BUILT_BDF_FILES = \
+ $(ISO8859_1_BDF_FILES) \
+ $(ISO8859_2_BDF_FILES) \
+ $(ISO8859_3_BDF_FILES) \
+ $(ISO8859_4_BDF_FILES) \
+ $(ISO8859_9_BDF_FILES) \
+ $(ISO8859_10_BDF_FILES) \
+ $(ISO8859_13_BDF_FILES) \
+ $(ISO8859_14_BDF_FILES) \
+ $(ISO8859_15_BDF_FILES)
+
+all: $(DESTDIR) $(UCS2ANY) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.alias
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+$(DESTDIR)\fonts.alias: fonts.alias
+ copy $< $@
+
diff --git a/xorg-server/fonts.src/OTF/makefile b/xorg-server/fonts.src/OTF/makefile
new file mode 100644
index 000000000..5e5d84814
--- /dev/null
+++ b/xorg-server/fonts.src/OTF/makefile
@@ -0,0 +1,52 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\OTF
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+FONT_FILES = \
+ SyrCOMAdiabene.otf \
+ SyrCOMAntioch.otf \
+ SyrCOMBatnanBold.otf \
+ SyrCOMBatnan.otf \
+ SyrCOMCtesiphon.otf \
+ SyrCOMEdessa.otf \
+ SyrCOMJerusalemBold.otf \
+ SyrCOMJerusalemItalic.otf \
+ SyrCOMJerusalem.otf \
+ SyrCOMJerusalemOutline.otf \
+ SyrCOMKharput.otf \
+ SyrCOMMalankara.otf \
+ SyrCOMMardinBold.otf \
+ SyrCOMMardin.otf \
+ SyrCOMMidyat.otf \
+ SyrCOMNisibin.otf \
+ SyrCOMNisibinOutline.otf \
+ SyrCOMQenNeshrin.otf \
+ SyrCOMTalada.otf \
+ SyrCOMTurAbdin.otf \
+ SyrCOMUrhoyBold.otf \
+ SyrCOMUrhoy.otf
+
+fontdir = .
+font_DATA = $(FONT_FILES:%=$(DESTDIR)\%)
+
+all: $(DESTDIR) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+# $(FCCACHE) $(DESTDIR)
+
+$(DESTDIR)\%.otf: %.otf
+ copy $< $@
diff --git a/xorg-server/fonts.src/Speedo/makefile b/xorg-server/fonts.src/Speedo/makefile
new file mode 100644
index 000000000..96223c065
--- /dev/null
+++ b/xorg-server/fonts.src/Speedo/makefile
@@ -0,0 +1,37 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\Speedo
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+FONT_FILES = \
+ font0419.spd \
+ font0582.spd \
+ font0583.spd \
+ font0611.spd \
+ font0648.spd \
+ font0649.spd \
+ font0709.spd \
+ font0710.spd \
+ fonts.scale
+
+fontdir = .
+font_DATA = $(FONT_FILES:%=$(DESTDIR)\%)
+
+all: $(DESTDIR) $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.scale
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+$(DESTDIR)\%.spd: %.spd
+ copy $< $@
+
+$(DESTDIR)\%.scale: %.scale
+ copy $< $@
diff --git a/xorg-server/fonts.src/TTF/makefile b/xorg-server/fonts.src/TTF/makefile
new file mode 100644
index 000000000..a488a8395
--- /dev/null
+++ b/xorg-server/fonts.src/TTF/makefile
@@ -0,0 +1,53 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\TTF
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+
+FONT_FILES = \
+ luximbi.ttf \
+ luximb.ttf \
+ luximri.ttf \
+ luximr.ttf \
+ luxirbi.ttf \
+ luxirb.ttf \
+ luxirri.ttf \
+ luxirr.ttf \
+ luxisbi.ttf \
+ luxisb.ttf \
+ luxisri.ttf \
+ luxisr.ttf \
+ Vera.ttf \
+ VeraBd.ttf \
+ VeraBI.ttf \
+ VeraIt.ttf \
+ VeraMoBd.ttf \
+ VeraMoBI.ttf \
+ VeraMoIt.ttf \
+ VeraMono.ttf \
+ VeraSe.ttf \
+ VeraSeBd.ttf
+
+fontdir = .
+font_DATA = $(FONT_FILES:%=$(DESTDIR)\%)
+
+all: $(DESTDIR) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+# $(FCCACHE) $(DESTDIR)
+
+$(DESTDIR)\%.ttf: %.ttf
+ copy $< $@
diff --git a/xorg-server/fonts.src/Type1/makefile b/xorg-server/fonts.src/Type1/makefile
new file mode 100644
index 000000000..48371a6b2
--- /dev/null
+++ b/xorg-server/fonts.src/Type1/makefile
@@ -0,0 +1,93 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\Type1
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+FONT_FILES = \
+ cursor.pfa \
+ UTB_____.afm \
+ UTBI____.afm \
+ UTBI____.pfa \
+ UTB_____.pfa \
+ UTI_____.afm \
+ UTI_____.pfa \
+ UTRG____.afm \
+ UTRG____.pfa \
+ cour.afm \
+ courb.afm \
+ courbi.afm \
+ courbi.pfa \
+ courb.pfa \
+ couri.afm \
+ couri.pfa \
+ cour.pfa \
+ l047013t.afm \
+ l047013t.pfa \
+ l047016t.afm \
+ l047016t.pfa \
+ l047033t.afm \
+ l047033t.pfa \
+ l047036t.afm \
+ l047036t.pfa \
+ l048013t.afm \
+ l048013t.pfa \
+ l048016t.afm \
+ l048016t.pfa \
+ l048033t.afm \
+ l048033t.pfa \
+ l048036t.afm \
+ l048036t.pfa \
+ l049013t.afm \
+ l049013t.pfa \
+ l049016t.afm \
+ l049016t.pfa \
+ l049033t.afm \
+ l049033t.pfa \
+ l049036t.afm \
+ l049036t.pfa \
+ c0419bt_.afm \
+ c0419bt_.pfb \
+ c0582bt_.afm \
+ c0582bt_.pfb \
+ c0583bt_.afm \
+ c0583bt_.pfb \
+ c0611bt_.afm \
+ c0611bt_.pfb \
+ c0632bt_.afm \
+ c0632bt_.pfb \
+ c0633bt_.afm \
+ c0633bt_.pfb \
+ c0648bt_.afm \
+ c0648bt_.pfb \
+ c0649bt_.afm \
+ c0649bt_.pfb
+
+fontdir = .
+font_DATA = $(FONT_FILES:%=$(DESTDIR)\%)
+
+all: $(DESTDIR) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+# $(FCCACHE) $(DESTDIR)
+
+$(DESTDIR)\%.afm: %.afm
+ copy $< $@
+
+$(DESTDIR)\%.pfb: %.pfb
+ copy $< $@
+
+$(DESTDIR)\%.pfa: %.pfa
+ copy $< $@
diff --git a/xorg-server/fonts.src/cyrillic/makefile b/xorg-server/fonts.src/cyrillic/makefile
new file mode 100644
index 000000000..faa115461
--- /dev/null
+++ b/xorg-server/fonts.src/cyrillic/makefile
@@ -0,0 +1,114 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\cyrillic
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+FONT_FILES = \
+ proof9x16 \
+ koi12x24b \
+ koi12x24 \
+ koi5x8 \
+ koi6x13b \
+ koi6x13 \
+ koi6x9 \
+ koi7x14b \
+ koi7x14 \
+ koi8x13 \
+ koi8x16b \
+ koi8x16 \
+ koi9x15b \
+ koi9x15 \
+ koi9x18b \
+ koi9x18 \
+ screen8x16b \
+ screen8x16 \
+ crox1cb \
+ crox1c \
+ crox1cbo \
+ crox1co \
+ crox1hb \
+ crox1h \
+ crox1hbo \
+ crox1ho \
+ crox1tb \
+ crox1t \
+ crox1tbo \
+ crox1to \
+ crox2cb \
+ crox2c \
+ crox2cbo \
+ crox2co \
+ crox2hb \
+ crox2h \
+ crox2hbo \
+ crox2ho \
+ crox2tb \
+ crox2t \
+ crox2tbo \
+ crox2to \
+ crox3cb \
+ crox3c \
+ crox3cbo \
+ crox3co \
+ crox3hb \
+ crox3h \
+ crox3hbo \
+ crox3ho \
+ crox3tb \
+ crox3t \
+ crox3tbo \
+ crox3to \
+ crox4hb \
+ crox4h \
+ crox4hbo \
+ crox4ho \
+ crox4tb \
+ crox4t \
+ crox4tbo \
+ crox4to \
+ crox5hb \
+ crox5h \
+ crox5hbo \
+ crox5ho \
+ crox5tb \
+ crox5t \
+ crox5tbo \
+ crox5to \
+ crox6hb \
+ crox6h \
+ crox6hbo \
+ crox6ho \
+ crox6tb \
+ crox6t \
+ crox6tbo \
+ crox6to \
+ koi10x16b \
+ koi10x20 \
+ koi6x10 \
+ koinil2
+
+BDF_FILES = $(FONT_FILES:%=%.bdf)
+PCF_FILES = $(FONT_FILES:%=$(DESTDIR)\%.pcf.gz)
+
+font_DATA = $(PCF_FILES)
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+all: $(DESTDIR) $(MKFONTSCALE) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.alias
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+
+$(DESTDIR)\fonts.alias: fonts.alias
+ copy $< $@
diff --git a/xorg-server/fonts.src/encodings/large/makefile b/xorg-server/fonts.src/encodings/large/makefile
new file mode 100644
index 000000000..6c60c5651
--- /dev/null
+++ b/xorg-server/fonts.src/encodings/large/makefile
@@ -0,0 +1,39 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\encodings\large
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+ENCODING_FILES = \
+ big5.eten-0.enc \
+ big5hkscs-0.enc \
+ cns11643-1.enc \
+ cns11643-2.enc \
+ cns11643-3.enc \
+ gb18030-0.enc \
+ gb18030.2000-0.enc \
+ gb18030.2000-1.enc \
+ gb2312.1980-0.enc \
+ gbk-0.enc \
+ jisx0201.1976-0.enc \
+ jisx0208.1990-0.enc \
+ jisx0212.1990-0.enc \
+ ksc5601.1987-0.enc \
+ ksc5601.1992-3.enc \
+ sun.unicode.india-0.enc
+
+COMPRESSED = $(ENCODING_FILES:%=$(DESTDIR)\%.gz)
+
+DATA_FILES = $(COMPRESSED)
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+all: $(DESTDIR)\encodings.dir
+
+$(DESTDIR)\encodings.dir: $(DATA_FILES) $(MKFONTSCALE)
+ cd "$(DESTDIR)" & $(MKFONTSCALE) -b -s -l -n -r -p .\large -e . .
+
+
diff --git a/xorg-server/fonts.src/encodings/makefile b/xorg-server/fonts.src/encodings/makefile
new file mode 100644
index 000000000..1f92bf112
--- /dev/null
+++ b/xorg-server/fonts.src/encodings/makefile
@@ -0,0 +1,63 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+load_makefile large\makefile
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\encodings
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+ENCODING_FILES = \
+ adobe-dingbats.enc \
+ adobe-standard.enc \
+ adobe-symbol.enc \
+ armscii-8.enc \
+ ascii-0.enc \
+ dec-special.enc \
+ ibm-cp437.enc \
+ ibm-cp850.enc \
+ ibm-cp852.enc \
+ ibm-cp866.enc \
+ iso8859-11.enc \
+ iso8859-13.enc \
+ iso8859-16.enc \
+ iso8859-6.16.enc \
+ iso8859-6.8x.enc \
+ microsoft-cp1250.enc \
+ microsoft-cp1251.enc \
+ microsoft-cp1252.enc \
+ microsoft-cp1253.enc \
+ microsoft-cp1254.enc \
+ microsoft-cp1255.enc \
+ microsoft-cp1256.enc \
+ microsoft-cp1257.enc \
+ microsoft-cp1258.enc \
+ microsoft-win3.1.enc \
+ mulearabic-0.enc \
+ mulearabic-1.enc \
+ mulearabic-2.enc \
+ mulelao-1.enc \
+ suneu-greek.enc \
+ tcvn-0.enc \
+ tis620-2.enc \
+ viscii1.1-1.enc
+
+COMPRESSED = $(ENCODING_FILES:%=$(DESTDIR)\%.gz)
+
+DATA_FILES = $(COMPRESSED)
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\encodings.dir: $(DATA_FILES) $(DESTDIR)\large\encodings.dir $(MKFONTSCALE)
+ cd "$(DESTDIR)" & $(MKFONTSCALE) -b -s -l -n -r -p . -e . -e large .
+
+all: $(DESTDIR)\encodings.dir
+
+.PHONY: cleanthis
+cleanthis:
+ del -e $(DESTDIR)
+
+clean: cleanthis
+
diff --git a/xorg-server/fonts.src/font-util/makefile b/xorg-server/fonts.src/font-util/makefile
new file mode 100644
index 000000000..bc3218f18
--- /dev/null
+++ b/xorg-server/fonts.src/font-util/makefile
@@ -0,0 +1,5 @@
+WINAPP = ucs2any
+
+CSRCS = ucs2any.c
+
+DEFINES += NEED_BASENAME
diff --git a/xorg-server/fonts.src/misc/makefile b/xorg-server/fonts.src/misc/makefile
new file mode 100644
index 000000000..62ba64b7f
--- /dev/null
+++ b/xorg-server/fonts.src/misc/makefile
@@ -0,0 +1,331 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\misc
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+BDF2UCS_FONT_FILES = \
+ clR6x12 \
+ 4x6 \
+ 5x7 \
+ 5x8 \
+ 6x9 \
+ 6x10 \
+ 6x12 \
+ 6x13 \
+ 6x13B \
+ 6x13O \
+ 7x13 \
+ 7x13B \
+ 7x13O \
+ 7x14 \
+ 7x14B \
+ 8x13 \
+ 8x13B \
+ 8x13O \
+ 9x15 \
+ 9x15B \
+ 9x18 \
+ 9x18B \
+ 10x20
+BDF2UCS_8_FONT_FILES = \
+ clR6x12 \
+ 4x6 \
+ 5x7 \
+ 5x8 \
+ 6x9 \
+ 6x10 \
+ 6x12 \
+ 6x13 \
+ 6x13B \
+ 7x13 \
+ 7x13B \
+ 7x14 \
+ 7x14B \
+ 8x13 \
+ 8x13B \
+ 9x15 \
+ 9x15B \
+ 9x18 \
+ 9x18B \
+ 10x20
+BDF2UCS_11_FONT_FILES = \
+ 6x13 \
+ 7x13 \
+ 7x13B \
+ 7x13O \
+ 7x14 \
+ 7x14B \
+ 9x15 \
+ 9x15B \
+ 9x18 \
+ 10x20
+BDF2UCS_KOI8_FONT_FILES = \
+ clR6x12 \
+ 4x6 \
+ 5x7 \
+ 5x8 \
+ 6x9 \
+ 6x10 \
+ 6x12 \
+ 6x13 \
+ 7x13 \
+ 7x14 \
+ 8x13 \
+ 9x15 \
+ 9x18 \
+ 10x20
+BDF2UCS_JISX0201_FONT_FILES = \
+ 7x14
+EXTRA_FONT_FILES = \
+ 12x13ja \
+ 18x18ja \
+ 18x18ko \
+ k14 \
+ nil2 \
+ micro \
+ jiskan16 \
+ jiskan24 \
+ gb16fs \
+ gb16st \
+ gb24st \
+ deccurs \
+ decsess \
+ arabic24 \
+ cursor \
+ hanglg16 \
+ hanglm16 \
+ hanglm24 \
+ cu12 \
+ cu-alt12 \
+ cu-arabic12 \
+ cuarabic12 \
+ cu-devnag12 \
+ cudevnag12 \
+ cu-lig12 \
+ cu-pua12 \
+ clB6x10 \
+ clB6x12 \
+ clB8x10 \
+ clB8x12 \
+ clB8x13 \
+ clB8x14 \
+ clB8x16 \
+ clB8x8 \
+ clB9x15 \
+ clI6x12 \
+ clI8x8 \
+ clR4x6 \
+ clR5x10 \
+ clR5x6 \
+ clR5x8 \
+ clR6x10 \
+ clR6x13 \
+ clR6x6 \
+ clR6x8 \
+ clR7x10 \
+ clR7x12 \
+ clR7x14 \
+ clR7x8 \
+ clR8x10 \
+ clR8x12 \
+ clR8x13 \
+ clR8x14 \
+ clR8x16 \
+ clR8x8 \
+ clR9x15 \
+ 12x24 \
+ 12x24rk \
+ 8x16 \
+ 8x16rk \
+ olcursor \
+ olgl10 \
+ olgl12 \
+ olgl14 \
+ olgl19
+
+FONT_FILES = $(BDF2UCS_FONT_FILES) $(EXTRA_FONT_FILES)
+
+BDF_FILES = $(FONT_FILES:%=%.bdf)
+PCF_FILES = $(FONT_FILES:%=$(DESTDIR)\%.pcf.gz)
+
+ISO8859_1_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-1.bdf)
+ISO8859_1_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-2.bdf)
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-3.bdf)
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-4.bdf)
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_5_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-5.bdf)
+ISO8859_5_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-5.pcf.gz)
+
+ISO8859_7_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-7.bdf)
+ISO8859_7_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-7.pcf.gz)
+
+ISO8859_8_BDF_FILES = $(BDF2UCS_8_FONT_FILES:%=%-ISO8859-8.bdf)
+ISO8859_8_PCF_FILES = $(BDF2UCS_8_FONT_FILES:%=$(DESTDIR)\%-ISO8859-8.pcf.gz)
+
+ISO8859_9_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-9.bdf)
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-10.bdf)
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_11_BDF_FILES = $(BDF2UCS_11_FONT_FILES:%=%-ISO8859-11.bdf)
+ISO8859_11_PCF_FILES = $(BDF2UCS_11_FONT_FILES:%=$(DESTDIR)\%-ISO8859-11.pcf.gz)
+
+ISO8859_13_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-13.bdf)
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-14.bdf)
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+ISO8859_15_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-15.bdf)
+ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-15.pcf.gz)
+
+
+ISO8859_16_BDF_FILES = $(BDF2UCS_FONT_FILES:%=%-ISO8859-16.bdf)
+ISO8859_16_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-16.pcf.gz)
+
+KOI8_R_BDF_FILES = $(BDF2UCS_KOI8_FONT_FILES:%=%-KOI8-R.bdf)
+KOI8_R_PCF_FILES = $(BDF2UCS_KOI8_FONT_FILES:%=$(DESTDIR)\%-KOI8-R.pcf.gz)
+
+JISX0201_BDF_FILES = $(BDF2UCS_JISX0201_FONT_FILES:%=%-JISX0201.1976-0.bdf)
+JISX0201_PCF_FILES = $(BDF2UCS_JISX0201_FONT_FILES:%=$(DESTDIR)\%-JISX0201.1976-0.pcf.gz)
+
+UTIL_DIR = ..\font-util
+UCS2ANY = $(UTIL_DIR)\$(OBJDIR)\ucs2any.exe
+
+load_makefile $(UTIL_DIR)\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+#%t.bdf: %.bdf
+# @rm -f $@
+# perl $(BDFTRUNCATE) 0x3200 < $< > $@
+
+%-ISO8859-1.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+
+%-ISO8859-2.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+
+%-ISO8859-3.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+
+%-ISO8859-4.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+
+%-ISO8859-5.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-5 ISO8859-5
+
+%-ISO8859-7.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-7 ISO8859-7
+
+%-ISO8859-8.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-8 ISO8859-8
+
+%-ISO8859-9.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+
+%-ISO8859-10.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+
+%-ISO8859-11.bdf: %.bdf
+ @rm -f $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-11 ISO8859-11
+
+%-ISO8859-13.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+
+%-ISO8859-14.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+
+%-ISO8859-15.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+
+%-ISO8859-16.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-16 ISO8859-16
+
+%-KOI8-R.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-KOI8-R KOI8-R
+
+%-JISX0201.1976-0.bdf: %.bdf
+ @del -e $@
+ $(UCS2ANY) $< $(UTIL_DIR)\map-JISX0201.1976-0 JISX0201.1976-0
+
+#%.pcf.gz: %t.bdf
+# @del -e $@
+# $(BDFTOPCF) -t $< | gzip > $@
+
+font_DATA = \
+ $(PCF_FILES) \
+ $(ISO8859_1_PCF_FILES) \
+ $(ISO8859_2_PCF_FILES) \
+ $(ISO8859_3_PCF_FILES) \
+ $(ISO8859_4_PCF_FILES) \
+ $(ISO8859_5_PCF_FILES) \
+ $(ISO8859_7_PCF_FILES) \
+ $(ISO8859_8_PCF_FILES) \
+ $(ISO8859_9_PCF_FILES) \
+ $(ISO8859_10_PCF_FILES) \
+ $(ISO8859_11_PCF_FILES) \
+ $(ISO8859_13_PCF_FILES) \
+ $(ISO8859_14_PCF_FILES) \
+ $(ISO8859_15_PCF_FILES) \
+ $(ISO8859_16_PCF_FILES) \
+ $(KOI8_R_PCF_FILES) \
+ $(JISX0201_PCF_FILES)
+BUILT_BDF_FILES = \
+ $(ISO8859_1_BDF_FILES) \
+ $(ISO8859_2_BDF_FILES) \
+ $(ISO8859_3_BDF_FILES) \
+ $(ISO8859_4_BDF_FILES) \
+ $(ISO8859_5_BDF_FILES) \
+ $(ISO8859_7_BDF_FILES) \
+ $(ISO8859_8_BDF_FILES) \
+ $(ISO8859_9_BDF_FILES) \
+ $(ISO8859_10_BDF_FILES) \
+ $(ISO8859_11_BDF_FILES) \
+ $(ISO8859_13_BDF_FILES) \
+ $(ISO8859_14_BDF_FILES) \
+ $(ISO8859_15_BDF_FILES) \
+ $(ISO8859_16_BDF_FILES) \
+ $(KOI8_R_BDF_FILES) \
+ $(JISX0201_BDF_FILES)
+
+all: $(DESTDIR) $(UCS2ANY) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.alias
+
+MKFONTSCALE=$(MHMAKECONF)\mkfontscale\$(OBJDIR)\mkfontscale.exe
+
+load_makefile $(MHMAKECONF)\mkfontscale\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+$(DESTDIR)\fonts.scale: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+$(DESTDIR)\fonts.alias: fonts.alias
+ copy $< $@
diff --git a/xorg-server/glx/glapi.h b/xorg-server/glx/glapi.h
index ddfb1cffb..697337ea0 100644
--- a/xorg-server/glx/glapi.h
+++ b/xorg-server/glx/glapi.h
@@ -46,6 +46,7 @@
#include "GL/gl.h"
+#include "GL/glext.h"
#include "glapitable.h"
#include "glthread.h"
diff --git a/xorg-server/glx/glheader.h b/xorg-server/glx/glheader.h
new file mode 100644
index 000000000..1c0ee2c9e
--- /dev/null
+++ b/xorg-server/glx/glheader.h
@@ -0,0 +1,24 @@
+#ifndef __GLHEADER_H__
+#define __GLHEADER_H__
+
+#define STDC_HEADERS 1
+
+#include <X11/Xwinsock.h>
+#include <X11/Xwindows.h>
+#include <assert.h>
+#define strcasecmp _stricmp
+
+#undef MINSHORT
+#undef MAXSHORT
+
+#define MINSHORT -32768
+#define MAXSHORT 32767
+
+#define PUBLIC
+
+#define GL_GLEXT_PROTOTYPES
+
+#define DRI_DRIVER_PATH "/usr/lib/dri"
+
+#endif
+
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index 95221a729..2181170ef 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -37,6 +37,10 @@
#define FONT_PCF
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxcmdsswap.c b/xorg-server/glx/glxcmdsswap.c
index 7f17c263b..cb34a11c7 100644
--- a/xorg-server/glx/glxcmdsswap.c
+++ b/xorg-server/glx/glxcmdsswap.c
@@ -37,6 +37,10 @@
#define FONT_PCF
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c
index 52a97d4c4..f76a0ce44 100644
--- a/xorg-server/glx/glxdri.c
+++ b/xorg-server/glx/glxdri.c
@@ -29,10 +29,13 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#ifndef _MSC_VER
#include <sys/time.h>
#include <dlfcn.h>
#include <drm.h>
+#endif
+
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c
index faaa3b7ae..028c77842 100644
--- a/xorg-server/glx/glxdricommon.c
+++ b/xorg-server/glx/glxdricommon.c
@@ -25,6 +25,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <stdint.h>
@@ -47,12 +51,16 @@ getUST(int64_t *ust)
if (ust == NULL)
return -EFAULT;
+#ifdef _MSC_VER
+ __asm int 3;
+#else
if (gettimeofday(&tv, NULL) == 0) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
+ #endif
}
const __DRIsystemTimeExtension systemTimeExtension = {
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
index f36dae739..a1bd4032b 100644
--- a/xorg-server/glx/glxdriswrast.c
+++ b/xorg-server/glx/glxdriswrast.c
@@ -26,6 +26,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <stdint.h>
@@ -55,6 +59,14 @@
#include "dispatch.h"
#include "extension_string.h"
+#ifndef RTLD_LOCAL
+#define RTLD_LOCAL 0
+#endif
+
+#ifdef _MSC_VER
+#define dlerror() "Getting loadlibrary error string not implemented"
+#endif
+
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
@@ -252,7 +264,11 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
(*screen->core->destroyScreen)(screen->driScreen);
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
__glXScreenDestroy(baseScreen);
@@ -473,14 +489,22 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
snprintf(filename, sizeof filename,
"%s/%s_dri.so", dri_driver_path, driverName);
+#ifdef _MSC_VER
+ screen->driver = LoadLibrary(filename);
+#else
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+#endif
if (screen->driver == NULL) {
LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
filename, dlerror());
goto handle_error;
}
+#ifdef _MSC_VER
+ extensions = GetProcAddress(screen->driver, __DRI_DRIVER_EXTENSIONS);
+#else
extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
+#endif
if (extensions == NULL) {
LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
driverName, dlerror());
@@ -528,7 +552,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
handle_error:
if (screen->driver)
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
xfree(screen);
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index 6ba404fb1..c7784ad10 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -21,6 +21,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/glxscreens.c b/xorg-server/glx/glxscreens.c
index f4839b32c..bda649e46 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -35,6 +35,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/glxtokens.h>
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 518868981..0cc54c773 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -59,6 +59,7 @@
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
+#include <GL/glext.h>
#include <GL/glxproto.h>
#include <GL/glxint.h>
diff --git a/xorg-server/glx/glxutil.c b/xorg-server/glx/glxutil.c
index fc73a02c9..ab39f27f2 100644
--- a/xorg-server/glx/glxutil.c
+++ b/xorg-server/glx/glxutil.c
@@ -37,6 +37,10 @@
#define FONT_PCF
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/indirect_dispatch.c b/xorg-server/glx/indirect_dispatch.c
index 2afd3eb22..fac726805 100644
--- a/xorg-server/glx/indirect_dispatch.c
+++ b/xorg-server/glx/indirect_dispatch.c
@@ -24,6 +24,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <X11/Xmd.h>
#include <GL/gl.h>
diff --git a/xorg-server/glx/indirect_dispatch_swap.c b/xorg-server/glx/indirect_dispatch_swap.c
index f137cbe98..afced8bc1 100644
--- a/xorg-server/glx/indirect_dispatch_swap.c
+++ b/xorg-server/glx/indirect_dispatch_swap.c
@@ -24,6 +24,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <X11/Xmd.h>
#include <GL/gl.h>
diff --git a/xorg-server/glx/indirect_program.c b/xorg-server/glx/indirect_program.c
index d23a0a9e6..421d9a0cb 100644
--- a/xorg-server/glx/indirect_program.c
+++ b/xorg-server/glx/indirect_program.c
@@ -32,6 +32,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_reqsize.c b/xorg-server/glx/indirect_reqsize.c
index 954eecd97..44a53c5f2 100644
--- a/xorg-server/glx/indirect_reqsize.c
+++ b/xorg-server/glx/indirect_reqsize.c
@@ -25,6 +25,13 @@
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <GL/gl.h>
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_size_get.c b/xorg-server/glx/indirect_size_get.c
index 8f726904f..aacb76a2b 100644
--- a/xorg-server/glx/indirect_size_get.c
+++ b/xorg-server/glx/indirect_size_get.c
@@ -25,6 +25,13 @@
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
+#endif
#include <GL/gl.h>
#include "indirect_size_get.h"
@@ -877,7 +884,9 @@ __glGetTexLevelParameterfv_size(GLenum e)
case GL_TEXTURE_INTENSITY_SIZE:
/* case GL_TEXTURE_INTENSITY_SIZE_EXT:*/
case GL_TEXTURE_DEPTH:
+#ifndef _MSC_VER
case GL_TEXTURE_INDEX_SIZE_EXT:
+#endif
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
/* case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:*/
case GL_TEXTURE_COMPRESSED:
diff --git a/xorg-server/glx/indirect_table.c b/xorg-server/glx/indirect_table.c
index cb3202605..b5ac86a5a 100644
--- a/xorg-server/glx/indirect_table.c
+++ b/xorg-server/glx/indirect_table.c
@@ -25,6 +25,10 @@
* SOFTWARE.
*/
+#ifndef HAVE_DIX_CONFIG_H
+#include "glheader.h"
+#endif
+
#include <inttypes.h>
#include "glxserver.h"
#include "glxext.h"
diff --git a/xorg-server/glx/indirect_texture_compression.c b/xorg-server/glx/indirect_texture_compression.c
index 3c09663fc..bae82c360 100644
--- a/xorg-server/glx/indirect_texture_compression.c
+++ b/xorg-server/glx/indirect_texture_compression.c
@@ -26,6 +26,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/indirect_util.c b/xorg-server/glx/indirect_util.c
index 58c194c99..b2ecc2578 100644
--- a/xorg-server/glx/indirect_util.c
+++ b/xorg-server/glx/indirect_util.c
@@ -25,6 +25,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
diff --git a/xorg-server/glx/makefile b/xorg-server/glx/makefile
new file mode 100644
index 000000000..8e595d7ab
--- /dev/null
+++ b/xorg-server/glx/makefile
@@ -0,0 +1,7 @@
+CSRCS=glapi.c glthread.c glxcmds.c glxcmdsswap.c glxdricommon.c glxext.c glxscreens.c glxutil.c \
+indirect_dispatch.c indirect_dispatch_swap.c indirect_program.c indirect_reqsize.c indirect_size_get.c indirect_table.c indirect_texture_compression.c \
+indirect_util.c render2.c render2swap.c renderpix.c renderpixswap.c rensize.c single2.c single2swap.c singlepix.c singlepixswap.c singlesize.c \
+swap_interval.c xfont.c glxdriswrast.c
+
+LIBRARY=libglx
+
diff --git a/xorg-server/glx/render2.c b/xorg-server/glx/render2.c
index 5b3d3e6d0..607b2d8ff 100644
--- a/xorg-server/glx/render2.c
+++ b/xorg-server/glx/render2.c
@@ -36,6 +36,10 @@
/* #define NEED_REPLIES */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <glxserver.h>
diff --git a/xorg-server/glx/render2swap.c b/xorg-server/glx/render2swap.c
index 23b7ebd37..b0e87b021 100644
--- a/xorg-server/glx/render2swap.c
+++ b/xorg-server/glx/render2swap.c
@@ -36,6 +36,10 @@
/* #define NEED_REPLIES */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/renderpix.c b/xorg-server/glx/renderpix.c
index 2fe630193..6de93e3c3 100644
--- a/xorg-server/glx/renderpix.c
+++ b/xorg-server/glx/renderpix.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/renderpixswap.c b/xorg-server/glx/renderpixswap.c
index 8455807e6..7b2c605d3 100644
--- a/xorg-server/glx/renderpixswap.c
+++ b/xorg-server/glx/renderpixswap.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/rensize.c b/xorg-server/glx/rensize.c
index c69619a61..7d7c62719 100644
--- a/xorg-server/glx/rensize.c
+++ b/xorg-server/glx/rensize.c
@@ -35,6 +35,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/gl.h>
@@ -224,7 +228,9 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_422_AVERAGE_EXT:
case GL_422_REV_AVERAGE_EXT:
case GL_DEPTH_STENCIL_NV:
+#ifndef _MSC_VER
case GL_DEPTH_STENCIL_MESA:
+#endif
case GL_YCBCR_MESA:
case GL_LUMINANCE_ALPHA:
elementsPerGroup = 2;
@@ -263,11 +269,13 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
+#ifndef _MSC_VER
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
bytesPerElement = 2;
elementsPerGroup = 1;
break;
+#endif
case GL_INT:
case GL_UNSIGNED_INT:
case GL_FLOAT:
@@ -278,8 +286,10 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
+#ifndef _MSC_VER
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
+#endif
bytesPerElement = 4;
elementsPerGroup = 1;
break;
diff --git a/xorg-server/glx/single2.c b/xorg-server/glx/single2.c
index 3387af2a2..d9272a156 100644
--- a/xorg-server/glx/single2.c
+++ b/xorg-server/glx/single2.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
@@ -341,6 +345,9 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
string = (const char *) CALL_GetString( GET_DISPATCH(), (name) );
client = cl->client;
+ if (string == NULL)
+ string = "";
+
/*
** Restrict extensions to those that are supported by both the
** implementation and the connection. That is, return the
diff --git a/xorg-server/glx/single2swap.c b/xorg-server/glx/single2swap.c
index 41a42bb0f..83408ae14 100644
--- a/xorg-server/glx/single2swap.c
+++ b/xorg-server/glx/single2swap.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlepix.c b/xorg-server/glx/singlepix.c
index d6b96defc..bac9a08be 100644
--- a/xorg-server/glx/singlepix.c
+++ b/xorg-server/glx/singlepix.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlepixswap.c b/xorg-server/glx/singlepixswap.c
index 032b42765..3a19dd51c 100644
--- a/xorg-server/glx/singlepixswap.c
+++ b/xorg-server/glx/singlepixswap.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/glx/singlesize.c b/xorg-server/glx/singlesize.c
index b5a74f30d..124c32a4e 100644
--- a/xorg-server/glx/singlesize.c
+++ b/xorg-server/glx/singlesize.c
@@ -35,6 +35,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/gl.h>
diff --git a/xorg-server/glx/swap_interval.c b/xorg-server/glx/swap_interval.c
index 24abd69fa..a136c950f 100644
--- a/xorg-server/glx/swap_interval.c
+++ b/xorg-server/glx/swap_interval.c
@@ -25,6 +25,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
@@ -54,7 +58,7 @@ int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap)
cx = __glXLookupContextByTag(cl, tag);
- LogMessage(X_ERROR, "%s: cx = %p, GLX screen = %p\n", __func__,
+ LogMessage(X_ERROR, "%s: cx = %p, GLX screen = %p\n", __FUNCTION__ ,
cx, (cx == NULL) ? NULL : cx->pGlxScreen);
if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
client->errorValue = tag;
diff --git a/xorg-server/glx/xfont.c b/xorg-server/glx/xfont.c
index 9629cf147..2d1993f90 100644
--- a/xorg-server/glx/xfont.c
+++ b/xorg-server/glx/xfont.c
@@ -36,6 +36,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include "glxserver.h"
diff --git a/xorg-server/hw/dmx/dmxinit.c b/xorg-server/hw/dmx/dmxinit.c
index 29dc00575..334c78693 100644
--- a/xorg-server/hw/dmx/dmxinit.c
+++ b/xorg-server/hw/dmx/dmxinit.c
@@ -851,6 +851,13 @@ void AbortDDX(void)
}
}
+#ifdef DDXBEFORERESET
+/* This function is called in Xserver/dix/dispatch.c */
+void ddxBeforeReset(void)
+{
+}
+#endif
+
/** This function is called in Xserver/dix/main.c from \a main() when
* dispatchException & DE_TERMINATE (which is the only way to exit the
* main loop without an interruption. */
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index b02f9903c..7c825a3fd 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -61,8 +61,11 @@ Bool EphyrWantGrayScale = 0;
Bool
ephyrInitialize (KdCardInfo *card, EphyrPriv *priv)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
OsSignal(SIGUSR1, hostx_handle_signal);
-
+#endif
priv->base = 0;
priv->bytes_per_line = 0;
return TRUE;
@@ -420,8 +423,6 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
Rotation randr;
int n = 0;
- EPHYR_LOG("mark");
-
struct { int width, height; } sizes[] =
{
{ 1600, 1200 },
@@ -442,6 +443,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{ 0, 0 }
};
+ EPHYR_LOG("mark");
+
*rotations = RR_Rotate_All|RR_Reflect_All;
if (!hostx_want_preexisting_window (screen)
@@ -795,21 +798,29 @@ ephyrUpdateModifierState(unsigned int state)
static void
ephyrBlockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_BLOCK, &set, 0);
+#endif
}
static void
ephyrUnblockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_UNBLOCK, &set, 0);
+#endif
}
static Bool
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.h b/xorg-server/hw/kdrive/ephyr/ephyr.h
index 5d58a216c..dd22bd150 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.h
@@ -26,9 +26,11 @@
#ifndef _EPHYR_H_
#define _EPHYR_H_
#include <stdio.h>
+#ifndef _MSC_VER
#include <unistd.h>
-#include <signal.h>
#include <libgen.h>
+#endif
+#include <signal.h>
#include "os.h" /* for OsSignal() */
#include "kdrive.h"
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index 47ddb3d82..005b0baa9 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -53,6 +53,7 @@ InitCard (char *name)
KdCardInfoAdd (&ephyrFuncs, &attr, 0);
}
+#ifndef _MSC_VER
void
InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
{
@@ -114,6 +115,7 @@ ddxUseMsg (void)
exit(1);
}
+#endif
void
processScreenArg (char *screen_size, char *parent_id)
@@ -144,6 +146,7 @@ processScreenArg (char *screen_size, char *parent_id)
}
}
+#ifndef _MSC_VER
int
ddxProcessArgument (int argc, char **argv, int i)
{
@@ -250,6 +253,13 @@ ddxProcessArgument (int argc, char **argv, int i)
return KdProcessArgument (argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset (void)
+{
+}
+#endif
+
void
OsVendorInit (void)
{
@@ -264,6 +274,15 @@ OsVendorInit (void)
KdOsInit (&EphyrOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void
+OsVendorFatalError(void)
+{
+}
+#endif
+
+#endif
+
/* 'Fake' cursor stuff, could be improved */
static Bool
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index c870a291d..90f0ea64e 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -43,13 +43,15 @@
#include <stdlib.h>
#include <stdio.h>
-#include <unistd.h>
#include <string.h> /* for memset */
#include <time.h>
+#ifndef _MSC_VER
+#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
+#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -206,7 +208,11 @@ hostx_add_screen (EphyrScreenInfo screen,
void
hostx_set_display_name (char *name)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
HostX.server_dpy_name = strdup (name);
+#endif
}
void
@@ -462,6 +468,9 @@ hostx_init (void)
}
/* Try to get share memory ximages for a little bit more speed */
+#ifdef _MSC_VER
+ __asm int 3;
+#else
if (!XShmQueryExtension(HostX.dpy) || getenv("XEPHYR_NO_SHM"))
{
fprintf(stderr, "\nXephyr unable to use SHM XImages\n");
@@ -492,6 +501,7 @@ hostx_init (void)
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
}
+#endif
XFlush(HostX.dpy);
@@ -611,7 +621,7 @@ hostx_screen_init (EphyrScreenInfo screen,
struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
if (!host_screen)
{
- fprintf (stderr, "%s: Error in accessing hostx data\n", __func__ );
+ fprintf (stderr, "%s: Error in accessing hostx data\n", __FUNCTION__ );
exit(1);
}
@@ -626,10 +636,14 @@ hostx_screen_init (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShmDetach(HostX.dpy, &host_screen->shminfo);
XDestroyImage (host_screen->ximg);
shmdt(host_screen->shminfo.shmaddr);
shmctl(host_screen->shminfo.shmid, IPC_RMID, 0);
+#endif
}
else
{
@@ -645,6 +659,9 @@ hostx_screen_init (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+__asm int 3;
+#else
host_screen->ximg = XShmCreateImage (HostX.dpy, HostX.visual, HostX.depth,
ZPixmap, NULL, &host_screen->shminfo,
width, buffer_height );
@@ -670,6 +687,7 @@ hostx_screen_init (EphyrScreenInfo screen,
XShmAttach(HostX.dpy, &host_screen->shminfo);
shm_success = True;
}
+#endif
}
if (!shm_success)
@@ -798,9 +816,13 @@ hostx_paint_rect (EphyrScreenInfo screen,
if (HostX.have_shm)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShmPutImage (HostX.dpy, host_screen->win,
HostX.gc, host_screen->ximg,
sx, sy, dx, dy, width, height, False);
+#endif
}
else
{
@@ -816,6 +838,9 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen,
int x, int y,
int width, int height)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct timespec tspec;
tspec.tv_sec = HostX.damage_debug_msec / (1000000);
@@ -831,6 +856,7 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen,
/* nanosleep seems to work better than usleep for me... */
nanosleep(&tspec, NULL);
+#endif
}
void
@@ -1265,8 +1291,12 @@ hostx_set_window_bounding_rectangles (int a_window,
rects[i].width, rects[i].height) ;
}
/*this aways returns 1*/
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShapeCombineRectangles (dpy, a_window, ShapeBounding, 0, 0,
rects, a_num_rects, ShapeSet, YXBanded) ;
+#endif
is_ok = TRUE ;
if (rects) {
@@ -1302,8 +1332,12 @@ hostx_set_window_clipping_rectangles (int a_window,
rects[i].width, rects[i].height) ;
}
/*this aways returns 1*/
+#ifdef _MSC_VER
+ __asm int 3;
+#else
XShapeCombineRectangles (dpy, a_window, ShapeClip, 0, 0,
rects, a_num_rects, ShapeSet, YXBanded) ;
+#endif
is_ok = TRUE ;
if (rects) {
@@ -1318,12 +1352,16 @@ int
hostx_has_xshape (void)
{
int event_base=0, error_base=0 ;
+#ifdef _MSC_VER
+ __asm int 3;
+#else
Display *dpy=hostx_get_display () ;
if (!XShapeQueryExtension (dpy,
&event_base,
&error_base)) {
return FALSE ;
}
+#endif
return TRUE;
}
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h
index 47ba61b5b..ba037d511 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.h
+++ b/xorg-server/hw/kdrive/ephyr/hostx.h
@@ -35,8 +35,12 @@
#define EPHYR_DBG(x, a...) \
fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
#else
+#ifdef _MSC_VER
+#define EPHYR_DBG()
+#else
#define EPHYR_DBG(x, a...) do {} while (0)
#endif
+#endif
typedef struct EphyrHostXVars EphyrHostXVars;
typedef struct EphyrHostXEvent EphyrHostXEvent;
diff --git a/xorg-server/hw/kdrive/ephyr/makefile b/xorg-server/hw/kdrive/ephyr/makefile
new file mode 100644
index 000000000..eba9a93e1
--- /dev/null
+++ b/xorg-server/hw/kdrive/ephyr/makefile
@@ -0,0 +1,6 @@
+LIBRARY = libxephyr
+
+CSRCS=ephyrinit.c ephyr.c hostx.c
+
+INCLUDES += ..\src ..\..\..\exa
+
diff --git a/xorg-server/hw/kdrive/fake/fakeinit.c b/xorg-server/hw/kdrive/fake/fakeinit.c
index 2cfcbedd5..9e8372eee 100644
--- a/xorg-server/hw/kdrive/fake/fakeinit.c
+++ b/xorg-server/hw/kdrive/fake/fakeinit.c
@@ -72,12 +72,26 @@ ddxProcessArgument (int argc, char **argv, int i)
return KdProcessArgument (argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void
+ddxBeforeReset (void)
+{
+}
+#endif
+
void
OsVendorInit (void)
{
KdOsInit (&FakeOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void
+OsVendorFatalError(void)
+{
+}
+#endif
+
KdCardFuncs fakeFuncs = {
fakeCardInit, /* cardinit */
fakeScreenInit, /* scrinit */
diff --git a/xorg-server/hw/kdrive/sdl/sdl.c b/xorg-server/hw/kdrive/sdl/sdl.c
index 411b5d4e1..bd8106a27 100644
--- a/xorg-server/hw/kdrive/sdl/sdl.c
+++ b/xorg-server/hw/kdrive/sdl/sdl.c
@@ -369,6 +369,12 @@ int ddxProcessArgument(int argc, char **argv, int i)
return KdProcessArgument(argc, argv, i);
}
+#ifdef DDXBEFORERESET
+void ddxBeforeReset (void)
+{
+}
+#endif
+
void sdlTimer(void)
{
static int buttonState=0;
@@ -452,4 +458,9 @@ void OsVendorInit (void)
KdOsInit (&sdlOsFuncs);
}
+#ifdef DDXOSFATALERROR
+void OsVendorFatalError(void)
+{
+}
+#endif
diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c
index e2ee4adea..3e739b8ec 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -340,6 +340,7 @@ KdProcessSwitch (void)
KdEnableScreens ();
}
+#ifndef _MSC_VER
void
AbortDDX(void)
{
@@ -362,6 +363,7 @@ ddxGiveUp ()
{
AbortDDX ();
}
+#endif
Bool kdDumbDriver;
Bool kdSoftCursor;
@@ -1394,6 +1396,7 @@ KdInitOutput (ScreenInfo *pScreenInfo,
}
#ifdef DPMSExtension
+#ifndef _MSC_VER
int
DPMSSet(ClientPtr client, int level)
{
@@ -1411,6 +1414,8 @@ DPMSSupported (void)
return FALSE;
}
#endif
+#endif
+#ifndef _MSC_VER
void ddxInitGlobals(void) { /* THANK YOU XPRINT */ }
-
+#endif
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index 9ba11661c..b1b04fa52 100644
--- a/xorg-server/hw/kdrive/src/kinput.c
+++ b/xorg-server/hw/kdrive/src/kinput.c
@@ -110,21 +110,29 @@ KdSigio (int sig)
static void
KdBlockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_BLOCK, &set, 0);
+#endif
}
static void
KdUnblockSigio (void)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
sigset_t set;
sigemptyset (&set);
sigaddset (&set, SIGIO);
sigprocmask (SIG_UNBLOCK, &set, 0);
+#endif
}
#ifdef DEBUG_SIGIO
@@ -170,15 +178,22 @@ KdResetInputMachine (void)
static void
KdNonBlockFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
int flags;
flags = fcntl (fd, F_GETFL);
flags |= FASYNC|NOBLOCK;
fcntl (fd, F_SETFL, flags);
+#endif
}
static void
KdAddFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct sigaction act;
sigset_t set;
@@ -195,11 +210,15 @@ KdAddFd (int fd)
sigaction (SIGIO, &act, 0);
sigemptyset (&set);
sigprocmask (SIG_SETMASK, &set, 0);
+#endif
}
static void
KdRemoveFd (int fd)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
struct sigaction act;
int flags;
@@ -215,6 +234,7 @@ KdRemoveFd (int fd)
sigemptyset (&act.sa_mask);
sigaction (SIGIO, &act, 0);
}
+#endif
}
Bool
@@ -513,11 +533,13 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
return BadImplementation;
}
+#ifndef _MSC_VER
Bool
LegalModifier(unsigned int key, DeviceIntPtr pDev)
{
return TRUE;
}
+#endif
static void
KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
@@ -536,6 +558,7 @@ KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
}
+#ifndef _MSC_VER
void
DDXRingBell(int volume, int pitch, int duration)
{
@@ -551,7 +574,7 @@ DDXRingBell(int volume, int pitch, int duration)
}
}
}
-
+#endif
void
KdRingBell(KdKeyboardInfo *ki, int volume, int pitch, int duration)
{
@@ -2345,6 +2368,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
KdWarpCursor
};
+#ifndef _MSC_VER
void
ProcessInputEvents ()
{
@@ -2354,6 +2378,7 @@ ProcessInputEvents ()
KdProcessSwitch ();
KdCheckLock ();
}
+#endif
/* FIXME use XSECURITY to work out whether the client should be allowed to
* open and close. */
diff --git a/xorg-server/hw/kdrive/src/kmap.c b/xorg-server/hw/kdrive/src/kmap.c
index ce1e28ae4..0762e72af 100644
--- a/xorg-server/hw/kdrive/src/kmap.c
+++ b/xorg-server/hw/kdrive/src/kmap.c
@@ -24,6 +24,7 @@
#include "kdrive.h"
#include <errno.h>
+#ifndef _MSC_VER
#include <unistd.h>
#include <sys/mman.h>
#ifdef HAVE_ASM_MTRR_H
@@ -31,6 +32,9 @@
#endif
#include <sys/ioctl.h>
+#else
+#define DRAW_DEBUG(a)
+#endif
void *
KdMapDevice (CARD32 addr, CARD32 size)
@@ -39,7 +43,8 @@ KdMapDevice (CARD32 addr, CARD32 size)
void *a;
void *d;
- d = VirtualAlloc (NULL, size, MEM_RESERVE, PAGE_NOACCESS);
+ d = VirtualAlloc (NULL, size, MEM_RESERVE, PAGE_READWRITE|PAGE_NOCACHE);
+/*
if (!d)
return NULL;
DRAW_DEBUG ((DEBUG_S3INIT, "Virtual address of 0x%x is 0x%x", addr, d));
@@ -53,6 +58,8 @@ KdMapDevice (CARD32 addr, CARD32 size)
return NULL;
}
DRAW_DEBUG ((DEBUG_S3INIT, "Device mapped successfully"));
+*/
+ __asm int 3;
return d;
#endif
#ifdef linux
diff --git a/xorg-server/hw/kdrive/src/makefile b/xorg-server/hw/kdrive/src/makefile
new file mode 100644
index 000000000..1400d0427
--- /dev/null
+++ b/xorg-server/hw/kdrive/src/makefile
@@ -0,0 +1,20 @@
+LIBRARY = libkdrive
+
+CSRCS = kaa.c \
+ kaapict.c \
+ kasync.c \
+ kcmap.c \
+ kcurscol.c \
+ kinfo.c \
+ kkeymap.c \
+ kmap.c \
+ kmode.c \
+ knoop.c \
+ koffscreen.c \
+ kshadow.c \
+ kinput.c \
+ kdrive.c \
+ ktest.c
+
+
+
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index 7b65da844..ff6ac8ad7 100644
--- a/xorg-server/hw/xfree86/common/compiler.h
+++ b/xorg-server/hw/xfree86/common/compiler.h
@@ -66,7 +66,7 @@
# endif
# endif /* __inline__ */
# ifndef __inline
-# if defined(__GNUC__)
+# if defined(__GNUC__) || defined(_MSC_VER)
/* gcc has __inline */
# elif defined(__HIGHC__)
# define __inline _Inline
@@ -1529,13 +1529,13 @@ inl(unsigned short port)
# define uint_t unsigned int
# define uchar_t unsigned char
# endif /* __UNIXWARE__ */
-# if !defined(sgi) && !defined(__SUNPRO_C)
+# if !defined(sgi) && !defined(__SUNPRO_C) && !defined(_MSC_VER)
# include <sys/inline.h>
# endif
# else
# include "scoasm.h"
# endif
-# if (!defined(__HIGHC__) && !defined(sgi) && !defined(__SUNPRO_C)) || \
+# if (!defined(__HIGHC__) && !defined(sgi) && !defined(__SUNPRO_C) && !defined(_MSC_VER)) || \
defined(__USLC__)
# pragma asm partial_optimization outl
# pragma asm partial_optimization outw
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c
index 6a850cd44..bce7ac54e 100644
--- a/xorg-server/hw/xwin/InitInput.c
+++ b/xorg-server/hw/xwin/InitInput.c
@@ -30,10 +30,8 @@
#include <xwin-config.h>
#endif
#include "win.h"
-#ifdef XWIN_CLIPBOARD
-# include "../../Xext/xf86miscproc.h"
-#endif
#include "dixstruct.h"
+#include "inputstr.h"
/*
@@ -104,6 +102,11 @@ ProcessInputEvents (void)
#endif
}
+void DDXRingBell(int volume, int pitch, int duration)
+{
+ /* winKeybdBell is used instead */
+ return;
+}
int
TimeSinceLastInputEvent ()
@@ -147,8 +150,10 @@ InitInput (int argc, char *argv[])
RegisterPointerDevice (pMouse);
RegisterKeyboardDevice (pKeyboard);
- miRegisterPointerDevice (screenInfo.screens[0], pMouse);
- mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
+ pMouse->name = strdup("Windows mouse");
+ pKeyboard->name = strdup("Windows keyboard");
+
+ mieqInit ();
/* Initialize the mode key states */
winInitializeModeKeyStates ();
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c
index d2159813c..545437437 100644
--- a/xorg-server/hw/xwin/InitOutput.c
+++ b/xorg-server/hw/xwin/InitOutput.c
@@ -1,6 +1,7 @@
/*
Copyright 1993, 1998 The Open Group
+Copyright (C) Colin Harrison 2005-2008
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
@@ -45,14 +46,16 @@ from The Open Group.
#if defined(XKB) && defined(WIN32)
#include <xkbsrv.h>
#endif
+
#ifdef RELOCATE_PROJECTROOT
+#undef Status
#include <shlobj.h>
-typedef HRESULT (*SHGETFOLDERPATHPROC)(
+typedef HRESULT (__stdcall * SHGETFOLDERPATHPROC)(
HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwFlags,
- LPTSTR pszPath
+ LPSTR pszPath
);
#endif
@@ -73,6 +76,7 @@ extern int g_iLogVerbose;
Bool g_fLogInited;
extern Bool g_fXdmcpEnabled;
+extern Bool g_fAuthEnabled;
#ifdef HAS_DEVWINDOWS
extern int g_fdMessageQueue;
#endif
@@ -132,6 +136,9 @@ const char *
winGetBaseDir(void);
#endif
+static
+void glx_debugging(void);
+
/*
* For the depth 24 pixmap we default to 32 bits per pixel, but
* we change this pixmap format later if we detect that the display
@@ -241,7 +248,7 @@ ddxGiveUp (void)
#endif
if (!g_fLogInited) {
- LogInit (g_pszLogFile, NULL);
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
g_fLogInited = TRUE;
}
LogClose ();
@@ -424,7 +431,17 @@ winFixupPaths (void)
#ifdef READ_FONTDIRS
{
/* Open fontpath configuration file */
+#if defined WIN32 && defined __MINGW32__
+ static Bool once = False;
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "%s\\font-dirs", basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ FILE *fontdirs = fopen(buffer, "rt");
+ if (once) fontdirs = NULL;
+ else once = True;
+#else
FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt");
+#endif
if (fontdirs != NULL)
{
char buffer[256];
@@ -624,6 +641,14 @@ winFixupPaths (void)
buffer[sizeof(buffer)-1] = 0;
putenv(buffer);
}
+ if (getenv("XHOSTPREFIX") == NULL)
+ {
+ char buffer[MAX_PATH];
+ snprintf(buffer, sizeof(buffer), "XHOSTPREFIX=%s\\X",
+ basedir);
+ buffer[sizeof(buffer)-1] = 0;
+ putenv(buffer);
+ }
if (getenv("HOME") == NULL)
{
HMODULE shfolder;
@@ -661,9 +686,10 @@ winFixupPaths (void)
if (size && size < sizeof(buffer))
{
snprintf(buffer + size, sizeof(buffer) - size,
- "XWin.%s.log", display);
+ "VCXSrv.%s.log", display);
buffer[sizeof(buffer)-1] = 0;
g_pszLogFile = buffer;
+ GetLongPathName(buffer, buffer, MAX_PATH);
winMsg (X_DEFAULT, "Logfile set to \"%s\"\n", g_pszLogFile);
}
}
@@ -671,7 +697,7 @@ winFixupPaths (void)
{
static char xkbbasedir[MAX_PATH];
- snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkb", basedir);
+ snprintf(xkbbasedir, sizeof(xkbbasedir), "%s\\xkbdata", basedir);
if (sizeof(xkbbasedir) > 0)
xkbbasedir[sizeof(xkbbasedir)-1] = 0;
XkbBaseDirectory = xkbbasedir;
@@ -687,9 +713,6 @@ OsVendorInit (void)
/* Re-initialize global variables on server reset */
winInitializeGlobals ();
- LogInit (NULL, NULL);
- LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
-
winFixupPaths();
#ifdef DDXOSVERRORF
@@ -704,7 +727,7 @@ OsVendorInit (void)
* avoid the second call
*/
g_fLogInited = TRUE;
- LogInit (g_pszLogFile, NULL);
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
}
LogSetParameter (XLOG_FLUSH, 1);
LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
@@ -877,7 +900,7 @@ winUseMsg (void)
#endif
ErrorF ("-logfile filename\n"
- "\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n");
+ "\tWrite logmessages to <filename>.\n");
ErrorF ("-logverbose verbosity\n"
"\tSet the verbosity of logmessages. [NOTE: Only a few messages\n"
@@ -907,7 +930,7 @@ ddxUseMsg(void)
/* Log file will not be opened for UseMsg unless we open it now */
if (!g_fLogInited) {
- LogInit (g_pszLogFile, NULL);
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
g_fLogInited = TRUE;
}
LogClose ();
@@ -915,9 +938,9 @@ ddxUseMsg(void)
/* Notify user where UseMsg text can be found.*/
if (!g_fNoHelpMessageBox)
winMessageBoxF ("The " PROJECT_NAME " help text has been printed to "
- "/tmp/XWin.log.\n"
- "Please open /tmp/XWin.log to read the help text.\n",
- MB_ICONINFORMATION);
+ "%s.\n"
+ "Please open %s to read the help text.\n",
+ MB_ICONINFORMATION, g_pszLogFile, g_pszLogFile);
}
/* ddxInitGlobals - called by |InitGlobals| from os/util.c */
@@ -965,9 +988,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
if (!winReadConfigfile ())
winErrorFVerb (1, "InitOutput - Error reading config file\n");
#else
- winMsg(X_INFO, "XF86Config is not supported\n");
- winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html "
- "for more information\n");
winConfigFiles ();
#endif
@@ -1031,7 +1051,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
#if defined(XCSECURITY)
/* Generate a cookie used by internal clients for authorization */
- if (g_fXdmcpEnabled)
+ if (g_fXdmcpEnabled || g_fAuthEnabled)
winGenerateAuthorization ();
#endif
@@ -1043,6 +1063,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
* Apply locale specified in LANG environment variable.
*/
setlocale (LC_ALL, "");
+
+ glx_debugging();
}
#endif
@@ -1071,7 +1093,7 @@ winCheckDisplayNumber ()
/* Check display range */
nDisp = atoi (display);
- if (nDisp < 0 || nDisp > 65535)
+ if (nDisp < 0 || nDisp > 59535)
{
ErrorF ("winCheckDisplayNumber - Bad display number: %d\n", nDisp);
return FALSE;
@@ -1118,7 +1140,7 @@ winCheckDisplayNumber ()
if (GetLastError () == ERROR_ALREADY_EXISTS)
{
ErrorF ("winCheckDisplayNumber - "
- PROJECT_NAME " is already running on display %d\n",
+ "VCXsrv, Xming or Cygwin/X is already running on display %d\n",
nDisp);
return FALSE;
}
@@ -1126,19 +1148,21 @@ winCheckDisplayNumber ()
return TRUE;
}
-#ifdef DPMSExtension
-Bool DPMSSupported(void)
-{
- return FALSE;
-}
+/* GLX debugging helpers */
+#include <../glx/glapi.h>
-void DPMSSet(int level)
-{
- return;
+static
+void warn_func(void * p1, const char *format, ...) {
+ va_list v;
+ va_start(v, format);
+ vfprintf(stderr, format, v);
+ va_end(v);
+ fprintf(stderr,"\n");
}
-int DPMSGet(int *plevel)
+static
+void glx_debugging(void)
{
- return 0;
+ _glapi_set_warning_func(warn_func);
+ _glapi_noop_enable_warnings(TRUE);
}
-#endif
diff --git a/xorg-server/hw/xwin/X.ico b/xorg-server/hw/xwin/X.ico
index d47168fca..5d69818b5 100644
--- a/xorg-server/hw/xwin/X.ico
+++ b/xorg-server/hw/xwin/X.ico
Binary files differ
diff --git a/xorg-server/hw/xwin/XWin.exe.manifest b/xorg-server/hw/xwin/XWin.exe.manifest
new file mode 100644
index 000000000..221150d52
--- /dev/null
+++ b/xorg-server/hw/xwin/XWin.exe.manifest
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <description>The XWin X Windows server for Cygwin.</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="X86"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/xorg-server/hw/xwin/XWin.rc b/xorg-server/hw/xwin/XWin.rc
index 749c0f5f5..cbe5244e9 100644
--- a/xorg-server/hw/xwin/XWin.rc
+++ b/xorg-server/hw/xwin/XWin.rc
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) 2008 Yaakov Selkowitz All Rights Reserved
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,62 +21,58 @@
*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 Harold L Hunt II
+ *Except as contained in this notice, the names of the authors
*shall not be used in advertising or otherwise to promote the sale, use
*or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *from the authors.
*
- * Authors: Harold L Hunt II
+ * Authors: Harold L Hunt II, Yaakov Selkowitz
*/
-#include "windows.h"
+#include <windows.h>
#include "winresource.h"
+#include "xwin-config.h"
/*
* Dialogs
*/
/* About */
-ABOUT_BOX DIALOG DISCARDABLE 32, 32, 240, 105
+ABOUT_BOX DIALOGEX 32, 32, 260, 95
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
-CAPTION "About " PROJECT_NAME
-FONT 8, "MS Sans Serif"
+CAPTION "About XSrv"
+FONT 8, "MS Shell Dlg 2"
BEGIN
- CONTROL PROJECT_NAME " Website", ID_ABOUT_WEBSITE, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 30, 45, 75, 15
- CONTROL "Change Log", ID_ABOUT_CHANGELOG, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 135, 45, 75, 15
- CONTROL "User's Guide", ID_ABOUT_UG, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 30, 65, 75, 15
- CONTROL "FAQ", ID_ABOUT_FAQ, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 135, 65, 75, 15
-
- DEFPUSHBUTTON "Dismiss", IDOK, 95, 85, 50, 15
-
- CTEXT "Welcome to the preliminary About box for the " PROJECT_NAME " X Server. This dialog was created on 2004/03/25 and will eventually be filled with more useful information. For now, use the links below to learn more about the " PROJECT_NAME " project.", IDC_STATIC, 5, 5, 230, 35
+ CONTROL IDI_XWIN, IDC_STATIC, "Static", SS_ICON, 8, 8, 32, 32
+ LTEXT "XSrv X Server ", IDC_STATIC, 36, 8, 220, 8
+ LTEXT "Version 0.0 (1 Jan 2009)", IDC_STATIC, 36, 18, 220, 8
+ LTEXT "This product is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 38, 220, 20
+ CONTROL __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button",
+ BS_OWNERDRAW | WS_TABSTOP, 36, 58, 68, 8
+ DEFPUSHBUTTON "OK", IDOK, 105, 75, 50, 15
END
/* Depth change */
-DEPTH_CHANGE_BOX DIALOG DISCARDABLE 32, 32, 180, 100
+DEPTH_CHANGE_BOX DIALOGEX 32, 32, 180, 100
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE
-FONT 8, "MS Sans Serif"
-CAPTION PROJECT_NAME
+FONT 8, "MS Shell Dlg 2"
+CAPTION "XSrv"
BEGIN
DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
- CTEXT PROJECT_NAME, IDC_STATIC, 40, 12, 100, 8
+ CTEXT "VCXSrv", IDC_STATIC, 40, 12, 100, 8
CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
- CTEXT "Restore previous resolution to use " PROJECT_NAME ".", IDC_STATIC, 7, 52, 166, 8
+ CTEXT "Restore previous resolution to use VCXSrv.", IDC_STATIC, 7, 52, 166, 8
END
/* Exit */
-EXIT_DIALOG DIALOG DISCARDABLE 32, 32, 180, 78
+EXIT_DIALOG DIALOGEX 32, 32, 180, 78
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
-FONT 8, "MS Sans Serif"
-CAPTION PROJECT_NAME " - Exit?"
+FONT 8, "MS Shell Dlg 2"
+CAPTION "Exit VCXSrv?"
BEGIN
PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14
DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14
@@ -89,14 +86,14 @@ END
* Menus
*/
-IDM_TRAYICON_MENU MENU DISCARDABLE
+IDM_TRAYICON_MENU MENU
BEGIN
POPUP "TRAYICON_MENU"
BEGIN
MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
MENUITEM "&About...", ID_APP_ABOUT
MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
+ MENUITEM "E&xit...", ID_APP_EXIT
END
END
@@ -105,5 +102,5 @@ END
* Icons
*/
-IDI_XWIN ICON DISCARDABLE "X.ico"
-IDI_XWIN_BOXED ICON DISCARDABLE "X-boxed.ico"
+IDI_XWIN ICON "X.ico"
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest"
diff --git a/xorg-server/hw/xwin/makefile b/xorg-server/hw/xwin/makefile
new file mode 100644
index 000000000..5b409759d
--- /dev/null
+++ b/xorg-server/hw/xwin/makefile
@@ -0,0 +1,101 @@
+LIBRARY = libXWin
+
+SRCS_CLIPBOARD = \
+ winclipboardinit.c \
+ winclipboardtextconv.c \
+ winclipboardthread.c \
+ winclipboardunicode.c \
+ winclipboardwndproc.c \
+ winclipboardwrappers.c \
+ winclipboardxevents.c
+
+DEFINES += XWIN_CLIPBOARD
+
+SRCS_MULTIWINDOW = \
+ winmultiwindowshape.c \
+ winmultiwindowwindow.c \
+ winmultiwindowwm.c \
+ winmultiwindowwndproc.c
+
+DEFINES += XWIN_MULTIWINDOW
+
+SRCS_RANDR = \
+ winrandr.c
+DEFINES += XWIN_RANDR RELOCATE_PROJECTROOT
+
+CSRCS = InitInput.c \
+ InitOutput.c \
+ winallpriv.c \
+ winauth.c \
+ winblock.c \
+ wincmap.c \
+ winconfig.c \
+ wincreatewnd.c \
+ wincursor.c \
+ windialogs.c \
+ winengine.c \
+ winerror.c \
+ winglobals.c \
+ winkeybd.c \
+ winkeyhook.c \
+ winmisc.c \
+ winmouse.c \
+ winmsg.c \
+ winmultiwindowclass.c \
+ winmultiwindowicons.c \
+ winprefs.c \
+ winprocarg.c \
+ winregistry.c \
+ winscrinit.c \
+ winshaddd.c \
+ winshadddnl.c \
+ winshadgdi.c \
+ wintrayicon.c \
+ winvalargs.c \
+ winwakeup.c \
+ winwindow.c \
+ winprefslex.c \
+ winprefsyacc.c \
+ winwndproc.c $(SRCS_RANDR) $(SRCS_MULTIWINDOW) $(SRCS_CLIPBOARD)
+
+DEFINES += YY_NO_UNISTD_H
+
+# XWin.rc \
+# $(top_srcdir)/Xext/dpmsstubs.c \
+# $(top_srcdir)/Xi/stubs.c \
+# $(top_srcdir)/mi/miinitext.c \
+# $(top_srcdir)/fb/fbcmap_mi.c \
+# $(SRCS_CLIPBOARD) \
+# $(SRCS_GLX_WINDOWS) \
+# $(SRCS_MULTIWINDOW) \
+# $(SRCS_MULTIWINDOWEXTWM) \
+# $(SRCS_NATIVEGDI) \
+# $(SRCS_PRIMARYFB) \
+# $(SRCS_RANDR) \
+# $(SRCS_XV)
+
+INCLUDES += ..\..\miext\rootless
+
+SRCS_NATIVEGDI = \
+ winclip.c \
+ winfillsp.c \
+ winfont.c \
+ wingc.c \
+ wingetsp.c \
+ winnativegdi.c \
+ winpixmap.c \
+ winpolyline.c \
+ winpushpxl.c \
+ winrop.c \
+ winsetsp.c
+CSRCS += $(SRCS_NATIVEGDI)
+DEFINES += XWIN_NATIVEGDI
+
+#.rc.o:
+
+# $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include -DPROJECT_NAME=\"$(VENDOR_NAME_SHORT)\" -DPROJECT_VERSION=\"$(PACKAGE_VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\"
+
+DEFINES += HAVE_XWIN_CONFIG_H BUILD_DATE=0-0-0000 PTW32_STATIC_LIB
+
+#CSRCS=winkeybd.c
+
diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h
index 3ab324931..62fcd83b8 100644
--- a/xorg-server/hw/xwin/win.h
+++ b/xorg-server/hw/xwin/win.h
@@ -103,6 +103,7 @@
#define WIN_E3B_TIMER_ID 1
#define WIN_POLLING_MOUSE_TIMER_ID 2
+#define MOUSE_POLLING_INTERVAL 50
#define WIN_E3B_OFF -1
#define WIN_FD_INVALID -1
@@ -142,6 +143,9 @@
#include <errno.h>
#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
#define HANDLE void *
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
#include <pthread.h>
#undef HANDLE
#endif
@@ -314,6 +318,7 @@ typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
+typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr);
/* Typedef for DIX wrapper functions */
typedef int (*winDispatchProcPtr) (ClientPtr);
@@ -564,6 +569,8 @@ typedef struct _winPrivScreenRec
winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
+ winCreateScreenResourcesProc pwinCreateScreenResources;
+
#ifdef XWIN_MULTIWINDOW
/* Window Procedures for MultiWindow mode */
winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow;
@@ -590,6 +597,11 @@ typedef struct _winPrivScreenRec
SetShapeProcPtr SetShape;
#endif
+#ifdef XWIN_NATIVEGDI
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+#endif
+
winCursorRec cursor;
} winPrivScreenRec;
@@ -1006,6 +1018,9 @@ winMouseButtonsHandle (ScreenPtr pScreen,
int iEventType, int iButton,
WPARAM wParam);
+void
+winEnqueueMotion(int x, int y);
+
#ifdef XWIN_NATIVEGDI
/*
* winnativegdi.c
diff --git a/xorg-server/hw/xwin/winclipboard.h b/xorg-server/hw/xwin/winclipboard.h
index 445c01b27..9603b92fe 100644
--- a/xorg-server/hw/xwin/winclipboard.h
+++ b/xorg-server/hw/xwin/winclipboard.h
@@ -34,15 +34,20 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#ifdef __CYGWIN__
#include <sys/select.h>
#else
-#include "Xwinsock.h"
+#include "X11/Xwinsock.h"
#define HAS_WINSOCK
#endif
#include <fcntl.h>
#include <setjmp.h>
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
#include <pthread.h>
/* X headers */
@@ -60,8 +65,10 @@
#define ATOM DWORD
#ifndef __CYGWIN__
+#ifndef sleep
#define sleep(x) Sleep (1000 * (x))
#endif
+#endif
/* Windows headers */
#ifndef XFree86Server
diff --git a/xorg-server/hw/xwin/winclipboardthread.c b/xorg-server/hw/xwin/winclipboardthread.c
index 081abd5e7..0e654d267 100644
--- a/xorg-server/hw/xwin/winclipboardthread.c
+++ b/xorg-server/hw/xwin/winclipboardthread.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,12 +21,13 @@
*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 Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) 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 copyright holder(s) and author(s).
*
* Authors: Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -38,6 +40,10 @@
#endif
#include "X11/Xauth.h"
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#define max __max
+#endif
/*
* Constants
@@ -218,7 +224,7 @@ winClipboardProc (void *pvNotUsed)
#ifdef HAS_DEVWINDOWS
/* Open a file descriptor for the windows message queue */
- fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
+ fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, _O_RDONLY);
if (fdMessageQueue == -1)
{
ErrorF ("winClipboardProc - Failed opening %s\n", WIN_MSG_QUEUE_FNAME);
@@ -231,15 +237,6 @@ winClipboardProc (void *pvNotUsed)
iMaxDescriptor = iConnectionNumber + 1;
#endif
- /* Select event types to watch */
- if (XSelectInput (pDisplay,
- DefaultRootWindow (pDisplay),
- SubstructureNotifyMask |
- StructureNotifyMask |
- PropertyChangeMask) == BadWindow)
- ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
- "on RootWindow\n\n");
-
/* Create atoms */
atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
atomClipboardManager = XInternAtom (pDisplay, "CLIPBOARD_MANAGER", False);
@@ -258,6 +255,13 @@ winClipboardProc (void *pvNotUsed)
pthread_exit (NULL);
}
+ /* Select event types to watch */
+ if (XSelectInput (pDisplay,
+ iWindow,
+ PropertyChangeMask) == BadWindow)
+ ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
+ "on messaging window\n");
+
/* Save the window in the screen privates */
g_iClipboardWindow = iWindow;
@@ -273,7 +277,8 @@ winClipboardProc (void *pvNotUsed)
/* PRIMARY */
iReturn = XSetSelectionOwner (pDisplay, XA_PRIMARY,
iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
{
ErrorF ("winClipboardProc - Could not set PRIMARY owner\n");
pthread_exit (NULL);
@@ -282,7 +287,8 @@ winClipboardProc (void *pvNotUsed)
/* CLIPBOARD */
iReturn = XSetSelectionOwner (pDisplay, atomClipboard,
iWindow, CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, atomClipboard) != iWindow)
{
ErrorF ("winClipboardProc - Could not set CLIPBOARD owner\n");
pthread_exit (NULL);
diff --git a/xorg-server/hw/xwin/winclipboardunicode.c b/xorg-server/hw/xwin/winclipboardunicode.c
index ba86915a4..531f5703a 100644
--- a/xorg-server/hw/xwin/winclipboardunicode.c
+++ b/xorg-server/hw/xwin/winclipboardunicode.c
@@ -43,25 +43,43 @@ Bool
winClipboardDetectUnicodeSupport (void)
{
Bool fReturn = FALSE;
- OSVERSIONINFO osvi = {0};
+ OSVERSIONINFOEX osvi = {0};
/* Get operating system version information */
osvi.dwOSVersionInfoSize = sizeof (osvi);
- GetVersionEx (&osvi);
+ GetVersionEx ((LPOSVERSIONINFO)&osvi);
/* Branch on platform ID */
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_NT:
- /* Unicode supported on NT only */
- ErrorF ("DetectUnicodeSupport - Windows NT/2000/XP\n");
- fReturn = TRUE;
+ if (osvi.dwMajorVersion >= 6)
+ {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ErrorF ("OS: Windows Vista\n");
+ else
+ ErrorF ("OS: Windows Server 2008\n");
+ fReturn = TRUE;
+ }
+ else if (osvi.dwMajorVersion == 5)
+ {
+ if (osvi.dwMinorVersion == 2)
+ {
+ ErrorF ("OS: Windows 2003\n");
+ fReturn = TRUE;
+ }
+ else if (osvi.dwMinorVersion == 1)
+ {
+ ErrorF ("OS: Windows XP\n");
+ fReturn = TRUE;
+ }
+ else if (osvi.dwMinorVersion == 0) ErrorF ("OS: Windows 2000\n");
+ }
+ else if (osvi.dwMajorVersion <= 4) ErrorF ("OS: Windows NT\n");
break;
case VER_PLATFORM_WIN32_WINDOWS:
- /* Unicode is not supported on non-NT */
- ErrorF ("DetectUnicodeSupport - Windows 95/98/Me\n");
- fReturn = FALSE;
+ ErrorF ("OS: Windows 95/98/Me\n");
break;
}
diff --git a/xorg-server/hw/xwin/winclipboardwndproc.c b/xorg-server/hw/xwin/winclipboardwndproc.c
index 802a74035..a69edaeca 100644
--- a/xorg-server/hw/xwin/winclipboardwndproc.c
+++ b/xorg-server/hw/xwin/winclipboardwndproc.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,12 +21,13 @@
*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 Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) 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 copyright holder(s) and author(s).
*
* Authors: Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -63,7 +65,7 @@ extern HWND g_hwndClipboard;
* Local function prototypes
*/
-static Bool
+static int
winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
Bool fUseUnicode, int iTimeoutSec);
@@ -260,12 +262,15 @@ winClipboardWindowProc (HWND hwnd, UINT message,
case WM_DRAWCLIPBOARD:
{
static Bool s_fProcessingDrawClipboard = FALSE;
+ static Atom atomClipboard;
Display *pDisplay = g_pClipboardDisplay;
Window iWindow = g_iClipboardWindow;
int iReturn;
winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD: Enter\n");
+ if (atomClipboard == None) atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
+
/*
* We've occasionally seen a loop in the clipboard chain.
* Try and fix it on the first hint of recursion.
@@ -353,17 +358,13 @@ winClipboardWindowProc (HWND hwnd, UINT message,
/* Release CLIPBOARD selection if owned */
iReturn = XGetSelectionOwner (pDisplay,
- XInternAtom (pDisplay,
- "CLIPBOARD",
- False));
+ atomClipboard);
if (iReturn == g_iClipboardWindow)
{
winDebug ("winClipboardWindowProc - WM_DRAWCLIPBOARD - "
"CLIPBOARD selection is owned by us.\n");
XSetSelectionOwner (pDisplay,
- XInternAtom (pDisplay,
- "CLIPBOARD",
- False),
+ atomClipboard,
None,
CurrentTime);
}
@@ -383,7 +384,8 @@ winClipboardWindowProc (HWND hwnd, UINT message,
XA_PRIMARY,
iWindow,
CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, XA_PRIMARY) != iWindow)
{
winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - "
"Could not reassert ownership of PRIMARY\n");
@@ -396,12 +398,12 @@ winClipboardWindowProc (HWND hwnd, UINT message,
/* Reassert ownership of the CLIPBOARD */
iReturn = XSetSelectionOwner (pDisplay,
- XInternAtom (pDisplay,
- "CLIPBOARD",
- False),
+ atomClipboard,
iWindow,
CurrentTime);
- if (iReturn == BadAtom || iReturn == BadWindow)
+
+ if (iReturn == BadAtom || iReturn == BadWindow ||
+ XGetSelectionOwner (pDisplay, atomClipboard) != iWindow)
{
winErrorFVerb (1, "winClipboardWindowProc - WM_DRAWCLIPBOARD - "
"Could not reassert ownership of CLIPBOARD\n");
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c
index 2cfe0ffce..5578182c1 100644
--- a/xorg-server/hw/xwin/winclipboardwrappers.c
+++ b/xorg-server/hw/xwin/winclipboardwrappers.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,12 +21,13 @@
*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 Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) 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 copyright holder(s) and author(s).
*
* Authors: Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -40,6 +42,7 @@
* Constants
*/
+#define CLIP_NUM_CALLS 4
#define CLIP_NUM_SELECTIONS 2
#define CLIP_OWN_PRIMARY 0
#define CLIP_OWN_CLIPBOARD 1
@@ -85,6 +88,8 @@ winProcQueryTree (ClientPtr client)
{
int iReturn;
+ ErrorF ("winProcQueryTree - Hello\n");
+
/*
* This procedure is only used for initialization.
* We can unwrap the original procedure at this point
@@ -184,7 +189,7 @@ winProcEstablishConnection (ClientPtr client)
static int s_iCallCount = 0;
static unsigned long s_ulServerGeneration = 0;
- ErrorF ("winProcEstablishConnection - Hello\n");
+ if (s_iCallCount == 0 || s_iCallCount == CLIP_NUM_CALLS) ErrorF ("winProcEstablishConnection - Hello\n");
/* Do nothing if clipboard is not enabled */
if (!g_fClipboard)
@@ -212,13 +217,15 @@ winProcEstablishConnection (ClientPtr client)
/* Increment call count */
++s_iCallCount;
- /* Wait for second call when Xdmcp is enabled */
+ /* Wait for CLIP_NUM_CALLS when Xdmcp is enabled */
if (g_fXdmcpEnabled
&& !g_fClipboardLaunched
- && s_iCallCount < 4)
+ && s_iCallCount < CLIP_NUM_CALLS)
{
- ErrorF ("winProcEstablishConnection - Xdmcp enabled, waiting to "
- "start clipboard client until fourth call.\n");
+ if (s_iCallCount == 1) ErrorF ("winProcEstablishConnection - Xdmcp, waiting to "
+ "start clipboard client until %dth call", CLIP_NUM_CALLS);
+ if (s_iCallCount == CLIP_NUM_CALLS - 1) ErrorF (".\n");
+ else ErrorF (".");
return (*winProcEstablishConnectionOrig) (client);
}
@@ -275,7 +282,7 @@ winProcEstablishConnection (ClientPtr client)
* 8) Unfortunately, there is another problem.
* 9) XDM walks the list of windows with XQueryTree,
* killing any client it finds with a window.
- * 10)Thus, when using XDMCP we wait until the second call
+ * 10)Thus, when using XDMCP we wait until CLIP_NUM_CALLS
* to ProcEstablishCeonnection before we startup the clipboard
* client. This should prevent XDM from finding the clipboard
* client, since it has not yet created a window.
diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c
index d4c617bec..09bdb7396 100644
--- a/xorg-server/hw/xwin/winclipboardxevents.c
+++ b/xorg-server/hw/xwin/winclipboardxevents.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,12 +21,13 @@
*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 Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *Except as contained in this notice, the name of the copyright holder(s)
+ *and author(s) 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 copyright holder(s) and author(s).
*
* Authors: Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -51,18 +53,25 @@ winClipboardFlushXEvents (HWND hwnd,
Display *pDisplay,
Bool fUseUnicode)
{
- Atom atomLocalProperty = XInternAtom (pDisplay,
- WIN_LOCAL_PROPERTY,
- False);
- Atom atomUTF8String = XInternAtom (pDisplay,
- "UTF8_STRING",
- False);
- Atom atomCompoundText = XInternAtom (pDisplay,
- "COMPOUND_TEXT",
- False);
- Atom atomTargets = XInternAtom (pDisplay,
- "TARGETS",
- False);
+ static Atom atomLocalProperty, atomCompoundText;
+ static Atom atomUTF8String, atomTargets;
+
+ if (atomLocalProperty == None)
+ atomLocalProperty = XInternAtom (pDisplay,
+ WIN_LOCAL_PROPERTY,
+ False);
+ if (atomUTF8String == None)
+ atomUTF8String = XInternAtom (pDisplay,
+ "UTF8_STRING",
+ False);
+ if (atomCompoundText == None)
+ atomCompoundText = XInternAtom (pDisplay,
+ "COMPOUND_TEXT",
+ False);
+ if (atomTargets == None)
+ atomTargets = XInternAtom (pDisplay,
+ "TARGETS",
+ False);
/* Process all pending events */
while (XPending (pDisplay))
@@ -183,6 +192,7 @@ winClipboardFlushXEvents (HWND hwnd,
}
/* Check that clipboard format is available */
+ XLockDisplay (pDisplay);
if (fUseUnicode
&& !IsClipboardFormatAvailable (CF_UNICODETEXT))
{
@@ -190,6 +200,7 @@ winClipboardFlushXEvents (HWND hwnd,
"available from Win32 clipboard. Aborting.\n");
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -200,6 +211,7 @@ winClipboardFlushXEvents (HWND hwnd,
"available from Win32 clipboard. Aborting.\n");
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -218,6 +230,7 @@ winClipboardFlushXEvents (HWND hwnd,
GetLastError ());
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -259,6 +272,7 @@ winClipboardFlushXEvents (HWND hwnd,
GetLastError ());
/* Abort */
+ XUnlockDisplay (pDisplay);
fAbort = TRUE;
goto winClipboardFlushXEvents_SelectionRequest_Done;
}
@@ -294,6 +308,7 @@ winClipboardFlushXEvents (HWND hwnd,
/* Convert DOS string to UNIX string */
winClipboardDOStoUNIX (pszConvertData, strlen (pszConvertData));
+ XUnlockDisplay (pDisplay);
/* Setup our text list */
pszTextList[0] = pszConvertData;
@@ -301,6 +316,7 @@ winClipboardFlushXEvents (HWND hwnd,
/* Initialize the text property */
xtpText.value = NULL;
+ xtpText.nitems = 0;
/* Create the text property from the text list */
if (fUseUnicode)
@@ -361,10 +377,13 @@ winClipboardFlushXEvents (HWND hwnd,
/* Release the clipboard data */
GlobalUnlock (hGlobal);
pszGlobalData = NULL;
+ fCloseClipboard = FALSE;
+ CloseClipboard ();
/* Clean up */
XFree (xtpText.value);
xtpText.value = NULL;
+ xtpText.nitems = 0;
/* Setup selection notify event */
eventSelection.type = SelectionNotify;
@@ -395,7 +414,11 @@ winClipboardFlushXEvents (HWND hwnd,
winClipboardFlushXEvents_SelectionRequest_Done:
/* Free allocated resources */
if (xtpText.value)
+ {
XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+ }
if (pszConvertData)
free (pszConvertData);
if (hGlobal && pszGlobalData)
@@ -436,7 +459,10 @@ winClipboardFlushXEvents (HWND hwnd,
/* Close clipboard if it was opened */
if (fCloseClipboard)
+ {
+ fCloseClipboard = FALSE;
CloseClipboard ();
+ }
break;
@@ -618,11 +644,12 @@ winClipboardFlushXEvents (HWND hwnd,
/* Conversion succeeded or some unconvertible characters */
if (ppszTextList != NULL)
{
+ iReturnDataLen = 0;
for (i = 0; i < iCount; i++)
{
iReturnDataLen += strlen(ppszTextList[i]);
}
- pszReturnData = malloc (iReturnDataLen + 1);
+ pszReturnData = (char *) malloc (iReturnDataLen + 1);
pszReturnData[0] = '\0';
for (i = 0; i < iCount; i++)
{
@@ -633,7 +660,7 @@ winClipboardFlushXEvents (HWND hwnd,
{
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
"X*TextPropertyToTextList list_return is NULL.\n");
- pszReturnData = malloc (1);
+ pszReturnData = (char *) malloc (1);
pszReturnData[0] = '\0';
}
}
@@ -653,7 +680,7 @@ winClipboardFlushXEvents (HWND hwnd,
ErrorF ("%d", iReturn);
break;
}
- pszReturnData = malloc (1);
+ pszReturnData = (char *) malloc (1);
pszReturnData[0] = '\0';
}
@@ -663,9 +690,11 @@ winClipboardFlushXEvents (HWND hwnd,
ppszTextList = NULL;
XFree (xtpText.value);
xtpText.value = NULL;
+ xtpText.nitems = 0;
/* Convert the X clipboard string to DOS format */
- winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
+ XLockDisplay (pDisplay);
+ winClipboardUNIXtoDOS ((unsigned char **)&pszReturnData, strlen (pszReturnData));
if (fUseUnicode)
{
@@ -711,6 +740,8 @@ winClipboardFlushXEvents (HWND hwnd,
hGlobal = GlobalAlloc (GMEM_MOVEABLE, iConvertDataLen);
}
+ free (pszReturnData);
+
/* Check that global memory was allocated */
if (!hGlobal)
{
@@ -770,11 +801,16 @@ winClipboardFlushXEvents (HWND hwnd,
*/
winClipboardFlushXEvents_SelectionNotify_Done:
+ XUnlockDisplay (pDisplay);
/* Free allocated resources */
if (ppszTextList)
XFreeStringList (ppszTextList);
if (xtpText.value)
+ {
XFree (xtpText.value);
+ xtpText.value = NULL;
+ xtpText.nitems = 0;
+ }
if (pszConvertData)
free (pszConvertData);
if (pwszUnicodeStr)
diff --git a/xorg-server/hw/xwin/wincreatewnd.c b/xorg-server/hw/xwin/wincreatewnd.c
index 796a08593..85b6cf8a9 100644
--- a/xorg-server/hw/xwin/wincreatewnd.c
+++ b/xorg-server/hw/xwin/wincreatewnd.c
@@ -88,7 +88,9 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
else
snprintf (szTitle,
sizeof (szTitle),
@@ -331,7 +333,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
else
snprintf (szTitle,
sizeof (szTitle),
diff --git a/xorg-server/hw/xwin/wincursor.c b/xorg-server/hw/xwin/wincursor.c
index 021b8b82c..0b8f7e7b2 100644
--- a/xorg-server/hw/xwin/wincursor.c
+++ b/xorg-server/hw/xwin/wincursor.c
@@ -99,8 +99,16 @@ winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
return;
}
- /* Only update the Windows cursor position if we are active */
- if (pScreenPriv->hwndScreen == GetForegroundWindow ())
+ /*
+ Only update the Windows cursor position if root window is active,
+ or we are in a rootless mode
+ */
+ if ((pScreenPriv->hwndScreen == GetForegroundWindow ())
+ || pScreenPriv->pScreenInfo->fRootless
+#ifdef XWIN_MULTIWINDOW
+ || pScreenPriv->pScreenInfo->fMultiWindow
+#endif
+ )
{
/* Get the client area coordinates */
GetClientRect (pScreenPriv->hwndScreen, &rcClient);
@@ -601,9 +609,11 @@ winInitCursor (ScreenPtr pScreen)
pPointPriv = (miPointerScreenPtr)
dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+ if (pPointPriv)
+ {
pScreenPriv->cursor.spriteFuncs = pPointPriv->spriteFuncs;
pPointPriv->spriteFuncs = &winSpriteFuncsRec;
-
+ }
pScreenPriv->cursor.handle = NULL;
pScreenPriv->cursor.visible = FALSE;
diff --git a/xorg-server/hw/xwin/windialogs.c b/xorg-server/hw/xwin/windialogs.c
index ab06b0d00..822941e83 100644
--- a/xorg-server/hw/xwin/windialogs.c
+++ b/xorg-server/hw/xwin/windialogs.c
@@ -54,6 +54,10 @@ extern Bool g_fClipboardStarted;
#endif
extern Bool g_fSoftwareCursor;
+#if defined(XWIN_MULTIWINDOW)
+extern HICON g_hIconX;
+extern HICON g_hSmallIconX;
+#endif
/*
* Local function prototypes
@@ -112,8 +116,8 @@ winDrawURLWindow (LPARAM lParam)
crText = RGB(0,0,128+64);
SetTextColor (draw->hDC, crText);
- /* Create underlined font 14 high, standard dialog font */
- font = CreateFont (-14, 0, 0, 0, FW_NORMAL, FALSE, TRUE, FALSE,
+ /* Create font 8 high, standard dialog font */
+ font = CreateFont (-8, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
0, 0, 0, 0, 0, "MS Sans Serif");
if (!font)
{
@@ -181,34 +185,73 @@ winUnoverrideURLButton (HWND hwnd, int id)
/*
* Center a dialog window in the desktop window
+ * and set small and large icons to X icons.
*/
static void
-winCenterDialog (HWND hwndDlg)
+winInitDialog (HWND hwndDlg)
{
HWND hwndDesk;
- RECT rc, rcDlg, rcDesk;
-
+ RECT rc, rcDlg, rcDesk;
+ HICON hIcon, hIconSmall;
+
hwndDesk = GetParent (hwndDlg);
if (!hwndDesk || IsIconic (hwndDesk))
hwndDesk = GetDesktopWindow ();
- GetWindowRect (hwndDesk, &rcDesk);
- GetWindowRect (hwndDlg, &rcDlg);
- CopyRect (&rc, &rcDesk);
-
- OffsetRect (&rcDlg, -rcDlg.left, -rcDlg.top);
- OffsetRect (&rc, -rc.left, -rc.top);
- OffsetRect (&rc, -rcDlg.right, -rcDlg.bottom);
-
- SetWindowPos (hwndDlg,
- HWND_TOP,
- rcDesk.left + (rc.right / 2),
- rcDesk.top + (rc.bottom / 2),
- 0, 0,
- SWP_NOSIZE | SWP_NOZORDER);
-}
+ /* Remove minimize and maximize buttons */
+ SetWindowLongPtr (hwndDlg, GWL_STYLE,
+ GetWindowLongPtr (hwndDlg, GWL_STYLE)
+ & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
+
+ /* Set Window not to show in the task bar */
+ SetWindowLongPtr (hwndDlg, GWL_EXSTYLE,
+ GetWindowLongPtr (hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
+
+ /* Center dialog window in the screen. Not done for multi-monitor systems, where
+ * it is likely to end up split across the screens. In that case, it appears
+ * near the Tray icon.
+ */
+ if (GetSystemMetrics(SM_CMONITORS)>1) {
+ /* Still need to refresh the frame change. */
+ SetWindowPos (hwndDlg, HWND_TOP, 0,0,0,0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
+ } else {
+ GetWindowRect (hwndDesk, &rcDesk);
+ GetWindowRect (hwndDlg, &rcDlg);
+ CopyRect (&rc, &rcDesk);
+
+ OffsetRect (&rcDlg, -rcDlg.left, -rcDlg.top);
+ OffsetRect (&rc, -rc.left, -rc.top);
+ OffsetRect (&rc, -rcDlg.right, -rcDlg.bottom);
+
+ SetWindowPos (hwndDlg,
+ HWND_TOPMOST,
+ rcDesk.left + (rc.right / 2),
+ rcDesk.top + (rc.bottom / 2),
+ 0, 0,
+ SWP_NOSIZE | SWP_FRAMECHANGED);
+ }
+#ifdef XWIN_MULTIWINDOW
+ if (g_hIconX) hIcon=g_hIconX;
+ else
+#endif
+ hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
+
+#ifdef XWIN_MULTIWINDOW
+ if (g_hSmallIconX) hIconSmall=g_hSmallIconX;
+ else
+#endif
+ hIconSmall = LoadImage (g_hInstance,
+ MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON,
+ GetSystemMetrics(SM_CXSMICON),
+ GetSystemMetrics(SM_CYSMICON),
+ LR_SHARED);
+
+ PostMessage (hwndDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
+ PostMessage (hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
+}
/*
* Display the Exit dialog box
@@ -220,7 +263,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
int i;
int liveClients = 0;
- /* Count up running clinets (clients[0] is serverClient) */
+ /* Count up running clients (clients[0] is serverClient) */
for (i = 1; i < currentMaxClients; i++)
if (clients[i] != NullClient)
liveClients++;
@@ -271,15 +314,6 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
winExitDlgProc,
(int) pScreenPriv);
- /* Drop minimize and maximize buttons */
- SetWindowLong (g_hDlgExit, GWL_STYLE,
- GetWindowLong (g_hDlgExit, GWL_STYLE)
- & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
- SetWindowLong (g_hDlgExit, GWL_EXSTYLE,
- GetWindowLong (g_hDlgExit, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
- SetWindowPos (g_hDlgExit, HWND_TOPMOST, 0, 0, 0, 0,
- SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
-
/* Show the dialog box */
ShowWindow (g_hDlgExit, SW_SHOW);
@@ -314,14 +348,7 @@ winExitDlgProc (HWND hDialog, UINT message,
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
- winCenterDialog (hDialog);
-
- /* Set icon to standard app icon */
- PostMessage (hDialog,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM) LoadIcon (g_hInstance,
- MAKEINTRESOURCE(IDI_XWIN)));
+ winInitDialog (hDialog);
/* Format the connected clients string */
pszConnectedClients = Xprintf (CONNECTED_CLIENTS_FORMAT,
@@ -413,17 +440,6 @@ winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv)
pScreenPriv->hwndScreen,
winChangeDepthDlgProc,
(int) pScreenPriv);
-
- /* Drop minimize and maximize buttons */
- SetWindowLong (g_hDlgDepthChange, GWL_STYLE,
- GetWindowLong (g_hDlgDepthChange, GWL_STYLE)
- & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
- SetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE,
- GetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE)
- & ~WS_EX_APPWINDOW );
- SetWindowPos (g_hDlgDepthChange, 0, 0, 0, 0, 0,
- SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
-
/* Show the dialog box */
ShowWindow (g_hDlgDepthChange, SW_SHOW);
@@ -480,13 +496,7 @@ winChangeDepthDlgProc (HWND hwndDialog, UINT message,
s_pScreenPriv->dwLastWindowsBitsPixel);
#endif
- winCenterDialog( hwndDialog );
-
- /* Set icon to standard app icon */
- PostMessage (hwndDialog,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
+ winInitDialog( hwndDialog );
return TRUE;
@@ -572,15 +582,6 @@ winDisplayAboutDialog (winPrivScreenPtr pScreenPriv)
winAboutDlgProc,
(int) pScreenPriv);
- /* Drop minimize and maximize buttons */
- SetWindowLong (g_hDlgAbout, GWL_STYLE,
- GetWindowLong (g_hDlgAbout, GWL_STYLE)
- & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
- SetWindowLong (g_hDlgAbout, GWL_EXSTYLE,
- GetWindowLong (g_hDlgAbout, GWL_EXSTYLE) & ~WS_EX_APPWINDOW);
- SetWindowPos (g_hDlgAbout, 0, 0, 0, 0, 0,
- SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
-
/* Show the dialog box */
ShowWindow (g_hDlgAbout, SW_SHOW);
@@ -622,13 +623,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
s_pScreenInfo = s_pScreenPriv->pScreenInfo;
s_pScreen = s_pScreenInfo->pScreen;
- winCenterDialog (hwndDialog);
-
- /* Set icon to standard app icon */
- PostMessage (hwndDialog,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
+ winInitDialog (hwndDialog);
/* Override the URL buttons */
winOverrideURLButton (hwndDialog, ID_ABOUT_CHANGELOG);
@@ -706,7 +701,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
case ID_ABOUT_WEBSITE:
{
- const char * pszPath = "http://x.cygwin.com/";
+ const char * pszPath = __VENDORDWEBSUPPORT__;
int iReturn;
iReturn = (int) ShellExecute (NULL,
diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c
index 7d292134f..9c5c92ccf 100644
--- a/xorg-server/hw/xwin/winerror.c
+++ b/xorg-server/hw/xwin/winerror.c
@@ -33,17 +33,17 @@
#endif
#ifdef XVENDORNAME
#define VENDOR_STRING XVENDORNAME
-#define VERSION_STRING XORG_RELEASE
#define VENDOR_CONTACT BUILDERADDR
#endif
-
+#include <../xfree86/common/xorgVersion.h>
#include "win.h"
/* References to external symbols */
extern char * g_pszCommandLine;
extern char * g_pszLogFile;
extern Bool g_fSilentFatalError;
-
+extern Bool g_fSilentDupError;
+extern Bool g_fLogInited;
#ifdef DDXOSVERRORF
/* Prototype */
@@ -62,6 +62,24 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args)
pthread_mutex_lock (&s_pmPrinting);
#endif
+ /*
+ If we want to silence it,
+ detect if we are going to abort due to duplication error
+ */
+ if (g_fSilentDupError)
+ {
+ if ((strcmp(pszFormat,
+ "InitOutput - Duplicate invocation on display "
+ "number: %s. Exiting.\n") == 0)
+ || (strcmp(pszFormat,
+ "Server is already active for display %s\n%s %s\n%s\n") == 0)
+ || (strcmp(pszFormat,
+ "MakeAllCOTSServerListeners: server already running\n") == 0))
+ {
+ g_fSilentFatalError = TRUE;
+ }
+ }
+
/* Print the error message to a log file, could be stderr */
LogVWrite (0, pszFormat, va_args);
@@ -80,7 +98,6 @@ OsVendorVErrorF (const char *pszFormat, va_list va_args)
*
* Attempt to do last-ditch, safe, important cleanup here.
*/
-#ifdef DDXOSFATALERROR
void
OsVendorFatalError (void)
{
@@ -88,12 +105,17 @@ OsVendorFatalError (void)
if (g_fSilentFatalError)
return;
+ if (!g_fLogInited) {
+ g_fLogInited = TRUE;
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
+ }
+ LogClose ();
+
winMessageBoxF (
"A fatal error has occurred and " PROJECT_NAME " will now exit.\n" \
"Please open %s for more information.\n",
MB_ICONERROR, (g_pszLogFile?g_pszLogFile:"the logfile"));
}
-#endif
/*
@@ -117,13 +139,15 @@ winMessageBoxF (const char *pszError, UINT uType, ...)
#define MESSAGEBOXF \
"%s\n" \
"Vendor: %s\n" \
- "Release: %s\n" \
+ "Release: %d.%d.%d.%d (%d)\n" \
"Contact: %s\n" \
"XWin was started with the following command-line:\n\n" \
"%s\n"
pszMsgBox = Xprintf (MESSAGEBOXF,
- pszErrorF, VENDOR_STRING, VERSION_STRING, VENDOR_CONTACT,
+ pszErrorF, VENDOR_STRING,
+ XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, BUILD_DATE,
+ VENDOR_CONTACT,
g_pszCommandLine);
if (!pszMsgBox)
goto winMessageBoxF_Cleanup;
diff --git a/xorg-server/hw/xwin/winglobals.c b/xorg-server/hw/xwin/winglobals.c
index fddada39e..01604a8c4 100644
--- a/xorg-server/hw/xwin/winglobals.c
+++ b/xorg-server/hw/xwin/winglobals.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -26,6 +27,7 @@
*from Harold L Hunt II.
*
* Authors: Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -58,10 +60,11 @@ HWND g_hDlgExit = NULL;
HWND g_hDlgAbout = NULL;
const char * g_pszQueryHost = NULL;
Bool g_fXdmcpEnabled = FALSE;
+Bool g_fAuthEnabled = FALSE;
HICON g_hIconX = NULL;
HICON g_hSmallIconX = NULL;
#ifndef RELOCATE_PROJECTROOT
-char * g_pszLogFile = "/tmp/XWin.log";
+char * g_pszLogFile = DEFAULT_LOGDIR "/XWin.%s.log";
#else
char * g_pszLogFile = "XWin.log";
Bool g_fLogFileChanged = FALSE;
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c
index d574f2053..1cd3e4cb3 100644
--- a/xorg-server/hw/xwin/winkeybd.c
+++ b/xorg-server/hw/xwin/winkeybd.c
@@ -49,10 +49,6 @@
static Bool g_winKeyState[NUM_KEYCODES];
-/* Stored to get internal mode key states. Must be read-only. */
-static unsigned short const *g_winInternalModeKeyStatesPtr = NULL;
-
-
/*
* Local prototypes
*/
@@ -84,6 +80,20 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2];
int iParamScanCode = LOBYTE (HIWORD (lParam));
+/* WM_ key messages faked by Vista speech recognition (WSR) don't have a
+ * scan code.
+ *
+ * Vocola 3 (Rick Mohr's supplement to WSR) uses
+ * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a
+ * scan code of 1
+ */
+ if (iParamScanCode <= 1)
+ {
+ iParamScanCode = MapVirtualKeyEx(wParam,
+ /*MAPVK_VK_TO_VSC*/0,
+ GetKeyboardLayout(0));
+ }
+
/* Branch on special extended, special non-extended, or normal key */
if ((HIWORD (lParam) & KF_EXTENDED) && iKeyFixupEx)
*piScanCode = iKeyFixupEx;
@@ -209,7 +219,6 @@ winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
static void
winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
{
- g_winInternalModeKeyStatesPtr = &(pDevice->key->state);
}
@@ -293,21 +302,23 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
{
winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n");
}
+
+ XkbSetExtension(pDeviceInt, ProcessKeyboardEvent);
}
#endif
-
- g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
break;
case DEVICE_ON:
pDevice->on = TRUE;
- g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
+
+ // immediately copy the state of this keyboard device to the VCK
+ // (which otherwise happens lazily after the first keypress)
+ SwitchCoreKeyboard(pDeviceInt);
break;
case DEVICE_CLOSE:
case DEVICE_OFF:
pDevice->on = FALSE;
- g_winInternalModeKeyStatesPtr = NULL;
break;
}
@@ -369,7 +380,7 @@ winRestoreModeKeyStates ()
unsigned short internalKeyStates;
/* X server is being initialized */
- if (!g_winInternalModeKeyStatesPtr)
+ if (!inputInfo.keyboard)
return;
/* Only process events if the rootwindow is mapped. The keyboard events
@@ -382,7 +393,9 @@ winRestoreModeKeyStates ()
mieqProcessInputEvents ();
/* Read the mode key states of our X server */
- internalKeyStates = *g_winInternalModeKeyStatesPtr;
+ /* (stored in the virtual core keyboard) */
+ internalKeyStates = inputInfo.keyboard->key->state;
+ winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates);
/*
* NOTE: The C XOR operator, ^, will not work here because it is
@@ -580,6 +593,7 @@ winKeybdReleaseKeys ()
void
winSendKeyEvent (DWORD dwKey, Bool fDown)
{
+ DeviceIntPtr pDev;
xEvent xCurrentEvent;
/*
@@ -597,7 +611,16 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
xCurrentEvent.u.keyButtonPointer.time =
g_c32LastInputEventTime = GetTickCount ();
xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE;
- mieqEnqueue (&xCurrentEvent);
+
+#if CYGDEBUG
+ ErrorF("winSendKeyEvent: xCurrentEvent.u.u.type: %d, xCurrentEvent.u.u.detail: %d\n",
+ xCurrentEvent.u.u.type, xCurrentEvent.u.u.detail);
+#endif
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if ((pDev->coreEvents && pDev != inputInfo.keyboard) && pDev->key)
+ {
+ mieqEnqueue (pDev, &xCurrentEvent);
+ }
}
BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/xorg-server/hw/xwin/winkeybd.h b/xorg-server/hw/xwin/winkeybd.h
index 09eed1491..d5b115736 100644
--- a/xorg-server/hw/xwin/winkeybd.h
+++ b/xorg-server/hw/xwin/winkeybd.h
@@ -45,6 +45,11 @@
#define WIN_KEYMAP_COLS 3
+/* ASCII column, rows 33 through 40 are for Speech Recognition with
+ * num-lock asserted.
+ * Rows 160 through 165 correspond to software-generated codes, which
+ * may not be associated with the appropriate scan code/extended bit
+ */
const int
g_iKeyMap [] = {
/* count Windows VK, ASCII, ASCII when extended VK */
@@ -81,14 +86,14 @@ g_iKeyMap [] = {
/* 30 */ 0, 0, 0,
/* 31 */ 0, 0, 0,
/* 32 */ 0, 0, 0,
- /* 33 */ VK_PRIOR, 0, KEY_PgUp,
- /* 34 */ VK_NEXT, 0, KEY_PgDown,
- /* 35 */ VK_END, 0, KEY_End,
- /* 36 */ VK_HOME, 0, KEY_Home,
- /* 37 */ VK_LEFT, 0, KEY_Left,
- /* 38 */ VK_UP, 0, KEY_Up,
- /* 39 */ VK_RIGHT, 0, KEY_Right,
- /* 40 */ VK_DOWN, 0, KEY_Down,
+ /* 33 */ VK_PRIOR, KEY_PgUp, KEY_PgUp,
+ /* 34 */ VK_NEXT, KEY_PgDown, KEY_PgDown,
+ /* 35 */ VK_END, KEY_End, KEY_End,
+ /* 36 */ VK_HOME, KEY_Home, KEY_Home,
+ /* 37 */ VK_LEFT, KEY_Left, KEY_Left,
+ /* 38 */ VK_UP, KEY_Up, KEY_Up,
+ /* 39 */ VK_RIGHT, KEY_Right, KEY_Right,
+ /* 40 */ VK_DOWN, KEY_Down, KEY_Down,
/* 41 */ 0, 0, 0,
/* 42 */ 0, 0, 0,
/* 43 */ 0, 0, 0,
@@ -208,12 +213,12 @@ g_iKeyMap [] = {
/* 157 */ 0, 0, 0,
/* 158 */ 0, 0, 0,
/* 159 */ 0, 0, 0,
- /* 160 */ 0, 0, 0,
- /* 161 */ 0, 0, 0,
- /* 162 */ 0, 0, 0,
- /* 163 */ 0, 0, 0,
- /* 164 */ 0, 0, 0,
- /* 165 */ 0, 0, 0,
+ /* 160 */ VK_LSHIFT, KEY_ShiftL, KEY_ShiftL,
+ /* 161 */ VK_RSHIFT, KEY_ShiftR, KEY_ShiftR,
+ /* 162 */ VK_LCONTROL, KEY_LCtrl, KEY_LCtrl,
+ /* 163 */ VK_RCONTROL, KEY_RCtrl, KEY_RCtrl,
+ /* 164 */ VK_LMENU, KEY_Alt, KEY_Alt,
+ /* 165 */ VK_RMENU, KEY_AltLang, KEY_AltLang,
/* 166 */ 0, 0, 0,
/* 167 */ 0, 0, 0,
/* 168 */ 0, 0, 0,
diff --git a/xorg-server/hw/xwin/winlayouts.h b/xorg-server/hw/xwin/winlayouts.h
index cc0752430..336839453 100644
--- a/xorg-server/hw/xwin/winlayouts.h
+++ b/xorg-server/hw/xwin/winlayouts.h
@@ -38,34 +38,50 @@ typedef struct
char *layoutname;
} WinKBLayoutRec, *WinKBLayoutPtr;
+/*
+ This table is sorted by low byte of winlayout, then by next byte, etc.
+*/
+
WinKBLayoutRec winKBLayouts[] =
{
+ { 0x404, -1, "pc105", "zh_TW", NULL, NULL, "Chinese (Taiwan)"},
{ 0x405, -1, "pc105", "cz", NULL, NULL, "Czech"},
{0x10405, -1, "pc105", "cz_qwerty", NULL, NULL, "Czech (QWERTY)"},
{ 0x406, -1, "pc105", "dk", NULL, NULL, "Danish"},
{ 0x407, -1, "pc105", "de", NULL, NULL, "German (Germany)"},
{0x10407, -1, "pc105", "de", NULL, NULL, "German (Germany, IBM)"},
- { 0x807, -1, "pc105", "de_CH", NULL, NULL, "German (Switzerland)"},
+ { 0x807, -1, "pc105", "ch", "de", NULL, "German (Switzerland)"},
{ 0x409, -1, "pc105", "us", NULL, NULL, "English (USA)"},
{0x10409, -1, "pc105", "dvorak", NULL, NULL, "English (USA, Dvorak)"},
{0x20409, -1, "pc105", "us_intl", NULL, NULL, "English (USA, International)"},
{ 0x809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"},
{ 0x1809, -1, "pc105", "ie", NULL, NULL, "Irish"},
{ 0x40a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain, Traditional Sort)"},
+ { 0x80a, -1, "pc105", "la", NULL, NULL, "Latin American"},
{ 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"},
{ 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
{ 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
- { 0xc0c, -1, "pc105", "ca_enhanced", NULL, NULL, "French (Canada)"},
- { 0x100c, -1, "pc105", "fr_CH", NULL, NULL, "French (Switzerland)"},
+ {0x1080c, -1, "pc105", "be", NULL, NULL, "Belgian (Comma)"},
+ { 0xc0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"},
+ { 0x100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"},
{ 0x40e, -1, "pc105", "hu", NULL, NULL, "Hungarian"},
+ { 0x40f, -1, "pc105", "is", NULL, NULL, "Icelandic"},
{ 0x410, -1, "pc105", "it", NULL, NULL, "Italian"},
+ {0x10410, -1, "pc105", "it", NULL, NULL, "Italian (142)"},
+ {0xa0000410,-1, "macbook79","it", "mac",NULL, "Italiano (Apple)"},
{ 0x411, 7, "jp106", "jp", NULL, NULL, "Japanese"},
+ { 0x413, -1, "pc105", "nl", NULL, NULL, "Dutch"},
{ 0x813, -1, "pc105", "be", NULL, NULL, "Dutch (Belgian)"},
{ 0x414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
+ { 0x415, -1, "pc105", "pl", NULL, NULL, "Polish (Programmers)"},
{ 0x416, -1, "pc105", "br", NULL, NULL, "Portuguese (Brazil, ABNT)"},
{0x10416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil, ABNT2)"},
{ 0x816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"},
+ { 0x41a, -1, "pc105", "hr", NULL, NULL, "Croatian"},
{ 0x41d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"},
+ { 0x424, -1, "pc105", "si", NULL, NULL, "Slovenian"},
+ { 0x425, -1, "pc105", "ee", NULL, NULL, "Estonian"},
+ { 0x452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"},
{ -1, -1, NULL, NULL, NULL, NULL, NULL}
};
@@ -147,6 +163,7 @@ Support ID XKB Language
Finnish (with Sami)
X 0x040c fr French (Standard)
X 0x080c be French (Belgian)
+ X 0x1080c be Belgian (Comma)
. 0x0c0c French (Canadian)
French (Canadian, Legacy)
Canadian (Multilingual)
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c
index 1507dd34f..d25a66524 100644
--- a/xorg-server/hw/xwin/winmouse.c
+++ b/xorg-server/hw/xwin/winmouse.c
@@ -36,7 +36,7 @@
#endif
#include "win.h"
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
#include "inputstr.h"
/* Peek the internal button mapping */
@@ -106,7 +106,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
2);
free(map);
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
g_winMouseButtonMap = pDeviceInt->button->map;
#endif
break;
@@ -116,7 +116,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
break;
case DEVICE_CLOSE:
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
g_winMouseButtonMap = NULL;
#endif
case DEVICE_OFF:
@@ -221,11 +221,12 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
void
winMouseButtonsSendEvent (int iEventType, int iButton)
{
+ DeviceIntPtr pDev;
xEvent xCurrentEvent;
/* Load an xEvent and enqueue the event */
xCurrentEvent.u.u.type = iEventType;
-#if defined(XFree86Server) && defined(XINPUT)
+#ifdef XINPUT
if (g_winMouseButtonMap)
xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
else
@@ -233,7 +234,16 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
xCurrentEvent.u.u.detail = iButton;
xCurrentEvent.u.keyButtonPointer.time
= g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
+
+#if CYGDEBUG
+ ErrorF("winMouseButtonsSendEvent: xCurrentEvent.u.u.type: %d, xCurrentEvent.u.u.detail: %d\n",
+ xCurrentEvent.u.u.type, xCurrentEvent.u.u.detail);
+#endif
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if ((pDev->coreEvents && pDev != inputInfo.pointer) && pDev->button)
+ {
+ mieqEnqueue (pDev, &xCurrentEvent);
+ }
}
@@ -339,3 +349,25 @@ winMouseButtonsHandle (ScreenPtr pScreen,
return 0;
}
+
+/**
+ * Enqueue a motion event.
+ */
+void winEnqueueMotion(int x, int y)
+{
+ int i, nevents;
+ int valuators[2];
+
+ xEvent *events = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum());
+
+ valuators[0] = x;
+ valuators[1] = y;
+ nevents = GetPointerEvents(events, inputInfo.pointer, MotionNotify, 0,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(inputInfo.pointer, events + i);
+
+ xfree(events);
+}
+// XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
diff --git a/xorg-server/hw/xwin/winmultiwindowclass.c b/xorg-server/hw/xwin/winmultiwindowclass.c
index 5b47c3976..fe81f2bd0 100644
--- a/xorg-server/hw/xwin/winmultiwindowclass.c
+++ b/xorg-server/hw/xwin/winmultiwindowclass.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -26,6 +27,7 @@
*from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -263,7 +265,7 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
if (prop->propertyName == XA_WM_TRANSIENT_FOR)
{
if (ppDaddy)
- memcpy (*ppDaddy, prop->data, sizeof (WindowPtr));
+ memcpy (ppDaddy, prop->data, sizeof (WindowPtr));
return 1;
}
else
diff --git a/xorg-server/hw/xwin/winmultiwindowicons.c b/xorg-server/hw/xwin/winmultiwindowicons.c
index 45ed093ec..0d9d87ed2 100644
--- a/xorg-server/hw/xwin/winmultiwindowicons.c
+++ b/xorg-server/hw/xwin/winmultiwindowicons.c
@@ -36,6 +36,9 @@
#include "winmultiwindowclass.h"
#include "winprefs.h"
+#include "propertyst.h"
+#include "windowstr.h"
+
/*
* External global variables
@@ -50,9 +53,15 @@ extern HICON g_hSmallIconX;
*/
static void
-winScaleXBitmapToWindows (int iconSize, int effBPP,
- PixmapPtr pixmap, unsigned char *image);
-
+winScaleIconToWindows (int iconSize,
+ int effBPP,
+ unsigned char *iconData,
+ unsigned short width,
+ unsigned short height,
+ int xStride,
+ int effXBPP,
+ int effXDepth,
+ unsigned char *image);
/*
* Scale an X icon bitmap into a Windoze icon bitmap
@@ -64,15 +73,9 @@ winScaleXBitmapToWindows (int iconSize,
PixmapPtr pixmap,
unsigned char *image)
{
- int row, column, effXBPP, effXDepth;
- unsigned char *outPtr;
- unsigned char *iconData = 0;
- int stride, xStride;
- float factX, factY;
- int posX, posY;
- unsigned char *ptr;
- unsigned int zero;
- unsigned int color;
+ int effXBPP, effXDepth;
+ int xStride;
+ unsigned char *iconData = 0;
effXBPP = BitsPerPixel(pixmap->drawable.depth);
effXDepth = pixmap->drawable.depth;
@@ -83,12 +86,10 @@ winScaleXBitmapToWindows (int iconSize,
if (pixmap->drawable.depth == 15)
effXDepth = 16;
- /* Need 32-bit aligned rows */
- stride = ((iconSize * effBPP + 31) & (~31)) / 8;
xStride = PixmapBytePad (pixmap->drawable.width, pixmap->drawable.depth);
- if (stride == 0 || xStride == 0)
+ if (xStride == 0)
{
- ErrorF ("winScaleXBitmapToWindows - stride or xStride is zero. "
+ ErrorF ("winScaleXBitmapToWindows - xStride is zero. "
"Bailing.\n");
return;
}
@@ -107,9 +108,54 @@ winScaleXBitmapToWindows (int iconSize,
pixmap->drawable.width, pixmap->drawable.height,
ZPixmap, 0xffffffff, iconData);
+ winScaleIconToWindows(iconSize, effBPP,
+ iconData,
+ pixmap->drawable.width, pixmap->drawable.height,
+ xStride, effXBPP, effXDepth,
+ image);
+
+ free (iconData);
+}
+
+/*
+ * Scale a drawable into a Windoze icon bitmap
+ */
+
+static void
+winScaleIconToWindows (int iconSize,
+ int effBPP,
+ unsigned char *iconData,
+ unsigned short width,
+ unsigned short height,
+ int xStride,
+ int effXBPP,
+ int effXDepth,
+ unsigned char *image)
+{
+ int row, column;
+ unsigned char *outPtr;
+ int stride;
+ float factX, factY;
+ int posX, posY;
+ unsigned char *ptr;
+ unsigned int zero;
+ unsigned int color;
+
+ winDebug("winScaleIconToWindows: scaling from %d x %d @ %d bpp (depth %d) to %d x %d @ %d bpp\n",
+ width, height, effXBPP, effXDepth, iconSize, iconSize, effBPP);
+
+ /* Need 16-bit aligned rows for DDBitmaps */
+ stride = ((iconSize * effBPP + 15) & (~15)) / 8;
+ if (stride == 0)
+ {
+ ErrorF ("winScaleXBitmapToWindows - stride is zero. "
+ "Bailing.\n");
+ return;
+ }
+
/* Keep aspect ratio */
- factX = ((float)pixmap->drawable.width) / ((float)iconSize);
- factY = ((float)pixmap->drawable.height) / ((float)iconSize);
+ factX = ((float)width) / ((float)iconSize);
+ factY = ((float)height) / ((float)iconSize);
if (factX > factY)
factY = factX;
else
@@ -132,8 +178,8 @@ winScaleXBitmapToWindows (int iconSize,
ptr += posX / 8;
/* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
+ if (posX >= width
+ || posY >= height)
ptr = (unsigned char *) &zero;
if ((*ptr) & (1 << (posX & 7)))
@@ -178,8 +224,8 @@ winScaleXBitmapToWindows (int iconSize,
ptr += posX * (effXBPP / 8);
/* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
+ if (posX >= width
+ || posY >= height)
ptr = (unsigned char *) &zero;
color = (((*ptr) << 16)
+ ((*(ptr + 1)) << 8)
@@ -190,7 +236,7 @@ winScaleXBitmapToWindows (int iconSize,
*(outPtr++) = *(ptr++); // b
*(outPtr++) = *(ptr++); // g
*(outPtr++) = *(ptr++); // r
- *(outPtr++) = 0; // resvd
+ *(outPtr++) = (effXDepth == 32) ? *(ptr++) : 0x0; // alpha
break;
case 24:
*(outPtr++) = *(ptr++);
@@ -221,8 +267,8 @@ winScaleXBitmapToWindows (int iconSize,
ptr += posX * (effXBPP / 8);
/* Out of X icon bounds, leave space blank */
- if (posX >= pixmap->drawable.width
- || posY >= pixmap->drawable.height)
+ if (posX >= width
+ || posY >= height)
ptr = (unsigned char *) &zero;
color = ((*ptr) << 8) + (*(ptr + 1));
switch (effBPP)
@@ -257,9 +303,50 @@ winScaleXBitmapToWindows (int iconSize,
} /* end if effxbpp==16) */
} /* end for column */
} /* end for row */
- free (iconData);
}
+static pointer
+GetWindowProp(WindowPtr pWin, Atom name, long int *size_return)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+
+ if (!pWin || !name) {
+ winDebug("GetWindowProp - pWin or name was NULL\n");
+ return 0;
+ }
+ pwin = (struct _Window*) pWin;
+ if (!pwin->optional) return NULL;
+ for (prop = (struct _Property *) pwin->optional->userProps;
+ prop;
+ prop=prop->next){
+ if (prop->propertyName == name) {
+ *size_return=prop->size;
+ return prop->data;
+ }
+ }
+ return NULL;
+}
+
+static void
+winScaleNetWMIconToWindows (int iconSize,
+ int effBPP,
+ uint32_t *icondata,
+ unsigned char *image)
+{
+ int height, width;
+ uint32_t *pixels;
+
+ width = icondata[0];
+ height = icondata[1];
+ pixels = &icondata[2];
+
+ winScaleIconToWindows(iconSize, effBPP,
+ (unsigned char *)pixels,
+ width, height,
+ width*4, 32, 32,
+ image);
+}
/*
* Attempt to create a custom icon from the WM_HINTS bitmaps
@@ -268,7 +355,7 @@ winScaleXBitmapToWindows (int iconSize,
HICON
winXIconToHICON (WindowPtr pWin, int iconSize)
{
- unsigned char *mask, *image, *imageMask;
+ unsigned char *mask, *image;
unsigned char *dst, *src;
PixmapPtr iconPtr;
PixmapPtr maskPtr;
@@ -276,14 +363,12 @@ winXIconToHICON (WindowPtr pWin, int iconSize)
HDC hDC;
ICONINFO ii;
WinXWMHints hints;
- HICON hIcon;
+ HICON hIcon = NULL;
+ Bool net_wm_icon_found = FALSE;
- winMultiWindowGetWMHints (pWin, &hints);
- if (!hints.icon_pixmap) return NULL;
-
- iconPtr = (PixmapPtr) LookupIDByType (hints.icon_pixmap, RT_PIXMAP);
-
- if (!iconPtr) return NULL;
+ static Atom _XA_NET_WM_ICON = 0;
+ uint32_t *icon, *icon_data;
+ long int size=0;
hDC = GetDC (GetDesktopWindow ());
planes = GetDeviceCaps (hDC, PLANES);
@@ -296,38 +381,99 @@ winXIconToHICON (WindowPtr pWin, int iconSize)
else
effBPP = bpp;
- /* Need 32-bit aligned rows */
- stride = ((iconSize * effBPP + 31) & (~31)) / 8;
+ /* Need 16-bit aligned rows for DDBitmaps */
+ stride = ((iconSize * effBPP + 15) & (~15)) / 8;
/* Mask is 1-bit deep */
- maskStride = ((iconSize * 1 + 31) & (~31)) / 8;
+ maskStride = ((iconSize * 1 + 15) & (~15)) / 8;
- image = (unsigned char * ) malloc (stride * iconSize);
- imageMask = (unsigned char *) malloc (stride * iconSize);
- mask = (unsigned char *) malloc (maskStride * iconSize);
-
- /* Default to a completely black mask */
- memset (mask, 0, maskStride * iconSize);
+ if (!_XA_NET_WM_ICON) _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, FALSE);
- winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image);
- maskPtr = (PixmapPtr) LookupIDByType (hints.icon_mask, RT_PIXMAP);
+ /* Always prefer _NET_WM_ICON icons */
+ icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size);
+ if (icon_data)
+ {
+ uint32_t *best_icon = 0;
+ unsigned int best_size = 0;
+
+ /*
+ For scaling to the required size, choose the smallest icon which is
+ bigger than or equal to the required size, failing that, the biggest
+ icon which is smaller than the required size
+ */
+ for(icon = icon_data;
+ icon < &icon_data[size] && *icon;
+ icon = &icon[icon[0]*icon[1]+2])
+ {
+ unsigned int candidateSize = (icon[0] + icon[1])/2;
+ winDebug("winXIconToHICON: pWin%x found %lu x %lu NetIcon\n",(int)pWin,icon[0],icon[1]);
+
+ if (((best_size < iconSize) && ((candidateSize > best_size) || (candidateSize >= iconSize)))
+ || ((best_size > iconSize) && (candidateSize >= iconSize) && (candidateSize < best_size)))
+ {
+ best_icon = icon;
+ best_size = candidateSize;
+ }
+ }
+
+ if (best_icon)
+ {
+ winDebug("winXIconToHICON: pWin%x selected %lu x %lu NetIcon for scaling to %u x %u\n",
+ (int)pWin, best_icon[0], best_icon[1], iconSize, iconSize );
+
+ image = malloc (stride * iconSize);
+
+ /* Use a completely black mask, image has alpha */
+ mask = calloc (maskStride, iconSize);
+
+ winScaleNetWMIconToWindows(iconSize, effBPP, best_icon, image);
+ net_wm_icon_found = TRUE;
+ }
+ else
+ {
+ winDebug("winXIconToHICON: pWin %x no %d x %d NetIcon\n",(int)pWin,iconSize,iconSize);
+ }
+ }
- if (maskPtr)
+ if (!net_wm_icon_found)
{
- winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask);
-
- winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask);
-
- /* Now we need to set all bits of the icon which are not masked */
- /* on to 0 because Color is really an XOR, not an OR function */
- dst = image;
- src = imageMask;
-
- for (i = 0; i < (stride * iconSize); i++)
- if ((*(src++)))
- *(dst++) = 0;
- else
- dst++;
+ unsigned char *imageMask;
+
+ winMultiWindowGetWMHints (pWin, &hints);
+ winDebug("winXIconToHICON: pWin 0x%x icon_pixmap hint %x\n", pWin, hints.icon_pixmap);
+ if (!hints.icon_pixmap) return NULL;
+
+ iconPtr = (PixmapPtr) LookupIDByType (hints.icon_pixmap, RT_PIXMAP);
+ winDebug("winXIconToHICON: pWin 0x%x iconPtr 0x%x\n", pWin, iconPtr);
+
+ if (!iconPtr) return NULL;
+
+ image = malloc (stride * iconSize);
+ imageMask = malloc (stride * iconSize);
+ /* Default to a completely black mask */
+ mask = calloc (maskStride, iconSize);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image);
+ maskPtr = (PixmapPtr) LookupIDByType (hints.icon_mask, RT_PIXMAP);
+
+ if (maskPtr)
+ {
+ winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask);
+
+ /* Now we need to set all bits of the icon which are not masked */
+ /* on to 0 because Color is really an XOR, not an OR function */
+ dst = image;
+ src = imageMask;
+
+ for (i = 0; i < (stride * iconSize); i++)
+ if ((*(src++)))
+ *(dst++) = 0;
+ else
+ dst++;
+ }
+ free (imageMask);
}
ii.fIcon = TRUE;
@@ -350,15 +496,13 @@ winXIconToHICON (WindowPtr pWin, int iconSize)
/* Free X mask and bitmap */
free (mask);
free (image);
- free (imageMask);
return hIcon;
}
-
/*
- * Change the Windows window icon
+ * Change the Windows window icon
*/
#ifdef XWIN_MULTIWINDOW
@@ -366,10 +510,14 @@ void
winUpdateIcon (Window id)
{
WindowPtr pWin;
- HICON hIcon, hiconOld;
+ HICON hIcon, hIconSmall, hiconOld;
pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW);
if (!pWin) return;
+{
+ winWindowPriv(pWin);
+ if (!pWinPriv->hWnd) return;
+
hIcon = (HICON)winOverrideIcon ((unsigned long)pWin);
if (!hIcon)
@@ -377,32 +525,30 @@ winUpdateIcon (Window id)
if (hIcon)
{
- winWindowPriv(pWin);
+ hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
+ GCL_HICON,
+ (int) hIcon);
- if (pWinPriv->hWnd)
- {
- hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
- GCL_HICON,
- (int) hIcon);
-
- /* Delete the icon if its not the default */
- winDestroyIcon(hiconOld);
- }
+ /* Delete the icon if its not the default */
+ if (hiconOld != g_hIconX)
+ winDestroyIcon(hiconOld);
}
- hIcon = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON));
- if (hIcon)
- {
- winWindowPriv(pWin);
+ hIconSmall = (HICON)winOverrideIcon ((unsigned long)pWin);
+
+ if (!hIconSmall)
+ hIconSmall = winXIconToHICON (pWin, GetSystemMetrics(SM_CXSMICON));
+
+ if (hIconSmall)
+ {
+ hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
+ GCL_HICONSM,
+ (int) hIconSmall);
+ if (hiconOld != g_hSmallIconX)
+ winDestroyIcon (hiconOld);
- if (pWinPriv->hWnd)
- {
- hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
- GCL_HICONSM,
- (int) hIcon);
- winDestroyIcon (hiconOld);
- }
}
+ }
}
void winInitGlobalIcons (void)
diff --git a/xorg-server/hw/xwin/winmultiwindowshape.c b/xorg-server/hw/xwin/winmultiwindowshape.c
index 33deae337..46e392ec3 100644
--- a/xorg-server/hw/xwin/winmultiwindowshape.c
+++ b/xorg-server/hw/xwin/winmultiwindowshape.c
@@ -45,7 +45,6 @@ void
winSetShapeMultiWindow (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
@@ -73,6 +72,9 @@ winUpdateRgnMultiWindow (WindowPtr pWin)
{
SetWindowRgn (winGetWindowPriv(pWin)->hWnd,
winGetWindowPriv(pWin)->hRgn, TRUE);
+
+ /* The system now owns the region specified by the region handle and delete it when it is no longer needed. */
+ winGetWindowPriv(pWin)->hRgn = NULL;
}
@@ -209,3 +211,14 @@ winReshapeMultiWindow (WindowPtr pWin)
return;
}
#endif
+
+void
+winShapeRgnUpdateMultiwindow(HWND hwnd)
+{
+ WindowPtr pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+ if (pWin)
+ {
+ winReshapeMultiWindow(pWin);
+ winUpdateRgnMultiWindow(pWin);
+ }
+}
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index 037c881b4..c3972013c 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -63,13 +65,6 @@ static void
winFindWindow (pointer value, XID id, pointer cdata);
/*
- * Constant defines
- */
-
-#define MOUSE_POLLING_INTERVAL 500
-
-
-/*
* Macros
*/
@@ -486,6 +481,7 @@ winCreateWindowsWindow (WindowPtr pWin)
int iWidth;
int iHeight;
HWND hWnd;
+ HWND hFore = NULL;
WNDCLASSEX wc;
winWindowPriv(pWin);
HICON hIcon;
@@ -496,6 +492,7 @@ winCreateWindowsWindow (WindowPtr pWin)
static int s_iWindowID = 0;
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
+ WindowPtr pDaddy;
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
@@ -504,20 +501,16 @@ winCreateWindowsWindow (WindowPtr pWin)
iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
- /* Default positions if none specified */
- if (!winMultiWindowGetWMNormalHints(pWin, &hints))
- hints.flags = 0;
- if ( !(hints.flags & (USPosition|PPosition)) &&
- !winMultiWindowGetTransientFor (pWin, NULL) &&
- !pWin->overrideRedirect )
- {
- iX = CW_USEDEFAULT;
- iY = CW_USEDEFAULT;
- }
-
iWidth = pWin->drawable.width;
iHeight = pWin->drawable.height;
+ /* ensure window actually ends up somewhere visible */
+ if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
+ iX = CW_USEDEFAULT;
+
+ if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
+ iY = CW_USEDEFAULT;
+
winSelectIcons(pWin, &hIcon, &hIconSmall);
/* Set standard class name prefix so we can identify window easily */
@@ -570,6 +563,28 @@ winCreateWindowsWindow (WindowPtr pWin)
wc.lpszClassName = pszClass;
RegisterClassEx (&wc);
+ if (!pWin->overrideRedirect)
+ {
+ if (winMultiWindowGetTransientFor (pWin, &pDaddy))
+ {
+ if (pDaddy)
+ {
+ hFore = GetForegroundWindow();
+ if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL;
+ }
+ }
+ else
+ {
+ /* Default positions if none specified */
+ if (!winMultiWindowGetWMNormalHints(pWin, &hints)) hints.flags = 0;
+ if (!(hints.flags & (USPosition|PPosition)))
+ {
+ iX = CW_USEDEFAULT;
+ iY = CW_USEDEFAULT;
+ }
+ }
+ }
+
/* Create the window */
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
@@ -581,7 +596,7 @@ winCreateWindowsWindow (WindowPtr pWin)
iY, /* Vertical position */
iWidth, /* Right edge */
iHeight, /* Bottom edge */
- (HWND) NULL, /* No parent or owner window */
+ hFore, /* Null or Parent window if transient*/
(HMENU) NULL, /* No menu */
GetModuleHandle (NULL), /* Instance handle */
pWin); /* ScreenPrivates */
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 5401ecdee..e766c42dc 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -26,6 +27,7 @@
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
+ * Colin Harrison
*/
/* X headers */
@@ -34,13 +36,18 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#ifdef __CYGWIN__
#include <sys/select.h>
#endif
#include <fcntl.h>
#include <setjmp.h>
#define HANDLE void *
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
#include <pthread.h>
#undef HANDLE
#include <X11/X.h>
@@ -52,24 +59,22 @@
#include <X11/cursorfont.h>
/* Windows headers */
-#ifdef __CYGWIN__
-/* Fixups to prevent collisions between Windows and X headers */
-#define ATOM DWORD
-
-#include <windows.h>
-#else
-#include <Xwindows.h>
-#endif
+#include <X11/Xwindows.h>
/* Local headers */
#include "objbase.h"
#include "ddraw.h"
#include "winwindow.h"
+#include "winprefs.h"
+#include "window.h"
+#include "windowstr.h"
#ifdef XWIN_MULTIWINDOWEXTWM
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
#endif
extern void winDebug(const char *format, ...);
+extern void winReshapeMultiWindow(WindowPtr pWin);
+extern void winUpdateRgnMultiWindow(WindowPtr pWin);
#ifndef CYGDEBUG
#define CYGDEBUG NO
@@ -86,6 +91,7 @@ extern void winDebug(const char *format, ...);
#endif
#define WIN_JMP_OKAY 0
#define WIN_JMP_ERROR_IO 2
+#define AUTH_NAME "MIT-MAGIC-COOKIE-1"
/*
@@ -135,6 +141,10 @@ typedef struct _XMsgProcArgRec {
extern char *display;
extern void ErrorF (const char* /*f*/, ...);
+#if defined(XCSECURITY)
+extern unsigned int g_uiAuthDataLen;
+extern char *g_pAuthData;
+#endif
/*
@@ -151,7 +161,7 @@ static Bool
InitQueue (WMMsgQueuePtr pQueue);
static void
-GetWindowName (Display * pDpy, Window iWin, char **ppName);
+GetWindowName (Display * pDpy, Window iWin, wchar_t **ppName);
static int
SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
@@ -191,6 +201,11 @@ PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction);
static Bool
CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen);
+static void
+winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle);
+
+void
+winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle);
/*
* Local globals
@@ -403,10 +418,12 @@ InitQueue (WMMsgQueuePtr pQueue)
*/
static void
-GetWindowName (Display *pDisplay, Window iWin, char **ppName)
+GetWindowName (Display *pDisplay, Window iWin, wchar_t **ppName)
{
int nResult, nNum;
char **ppList;
+ char *pszReturnData;
+ int iLen, i;
XTextProperty xtpName;
#if CYGMULTIWINDOW_DEBUG
@@ -425,38 +442,26 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
#endif
return;
}
-
- /* */
- if (xtpName.encoding == XA_STRING)
- {
- /* */
- if (xtpName.value)
- {
- int size = xtpName.nitems * (xtpName.format >> 3);
- *ppName = malloc(size + 1);
- strncpy(*ppName, xtpName.value, size);
- (*ppName)[size] = 0;
- XFree (xtpName.value);
- }
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - XA_STRING %s\n", *ppName);
-#endif
- }
- else
- {
- if (XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
- {
- *ppName = strdup (*ppList);
- XFreeStringList (ppList);
- }
- XFree (xtpName.value);
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - %s %s\n",
- XGetAtomName (pDisplay, xtpName.encoding), *ppName);
-#endif
- }
+ if (Xutf8TextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
+ {
+ iLen = 0;
+ for (i = 0; i < nNum; i++) iLen += strlen(ppList[i]);
+ pszReturnData = (char *) malloc (iLen + 1);
+ pszReturnData[0] = '\0';
+ for (i = 0; i < nNum; i++) strcat (pszReturnData, ppList[i]);
+ }
+ else
+ {
+ pszReturnData = (char *) malloc (1);
+ pszReturnData[0] = '\0';
+ }
+ iLen = MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, NULL, 0);
+ *ppName = (wchar_t*)malloc(sizeof(wchar_t)*(iLen + 1));
+ MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, *ppName, iLen);
+ XFree (xtpName.value);
+ if (ppList) XFreeStringList (ppList);
+ free (pszReturnData);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("GetWindowName - Returning\n");
@@ -493,7 +498,7 @@ SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
static void
UpdateName (WMInfoPtr pWMInfo, Window iWindow)
{
- char *pszName;
+ wchar_t *pszName;
Atom atmType;
int fmtRet;
unsigned long items, remain;
@@ -537,7 +542,7 @@ UpdateName (WMInfoPtr pWMInfo, Window iWindow)
&attr);
if (!attr.override_redirect)
{
- SetWindowText (hWnd, pszName);
+ SetWindowTextW (hWnd, pszName);
winUpdateIcon (iWindow);
}
@@ -705,10 +710,25 @@ winMultiWindowWMProc (void *pArg)
1);
UpdateName (pWMInfo, pNode->msg.iWindow);
winUpdateIcon (pNode->msg.iWindow);
-#if 0
- /* Handles the case where there are AOT windows above it in W32 */
- PreserveWin32Stack (pWMInfo, pNode->msg.iWindow, GW_HWNDPREV);
+ {
+ HWND zstyle = HWND_NOTOPMOST;
+ winApplyHints (pWMInfo->pDisplay, pNode->msg.iWindow, pNode->msg.hwndWindow, &zstyle);
+ winUpdateWindowPosition (pNode->msg.hwndWindow, TRUE, &zstyle);
+ }
+ break;
+
+ case WM_WM_MAP2:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_MAP2\n");
#endif
+ XChangeProperty (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmPrivMap,
+ XA_INTEGER,//pWMInfo->atmPrivMap,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &(pNode->msg.hwndWindow),
+ 1);
break;
case WM_WM_UNMAP:
@@ -803,6 +823,7 @@ winMultiWindowWMProc (void *pArg)
#if CYGMULTIWINDOW_DEBUG
ErrorF("-winMultiWindowWMProc ()\n");
#endif
+ return NULL;
}
@@ -1063,6 +1084,7 @@ winMultiWindowXMsgProc (void *pArg)
XCloseDisplay (pProcArg->pDisplay);
pthread_exit (NULL);
+ return NULL;
}
@@ -1226,6 +1248,14 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
/* Print the display connection string */
ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
+
+#if defined(XCSECURITY)
+ /* Use our generated cookie for authentication */
+ XSetAuthorization (AUTH_NAME,
+ strlen (AUTH_NAME),
+ g_pAuthData,
+ g_uiAuthDataLen);
+#endif
/* Open the X display */
do
@@ -1265,11 +1295,10 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
"WM_DELETE_WINDOW",
False);
-#ifdef XWIN_MULTIWINDOWEXTWM
+
pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
- WINDOWSWM_NATIVE_HWND,
+ "_WINDOWSWM_NATIVE_HWND",
False);
-#endif
if (1) {
@@ -1364,7 +1393,9 @@ winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr)
pErr->error_code,
pszErrorMsg,
sizeof (pszErrorMsg));
+#if CYGMULTIWINDOW_DEBUG
ErrorF ("winMultiWindowXMsgProcErrorHandler - ERROR: %s\n", pszErrorMsg);
+#endif
return 0;
}
@@ -1438,3 +1469,205 @@ winDeinitMultiWindowWM ()
ErrorF ("winDeinitMultiWindowWM - Noting shutdown in progress\n");
g_shutdown = TRUE;
}
+
+/* Windows window styles */
+#define HINT_NOFRAME (1L<<0)
+#define HINT_BORDER (1L<<1)
+#define HINT_SIZEBOX (1L<<2)
+#define HINT_CAPTION (1L<<3)
+#define HINT_NOMAXIMIZE (1L<<4)
+/* These two are used on their own */
+#define HINT_MAX (1L<<0)
+#define HINT_MIN (1L<<1)
+
+static void
+winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
+{
+ static Atom windowState, motif_wm_hints, windowType;
+ Atom type, *pAtom = NULL;
+ int format;
+ unsigned long hint = 0, maxmin = 0, rcStyle, nitems = 0 , left = 0;
+ WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP);
+ MwmHints *mwm_hint = NULL;
+ XSizeHints *normal_hint;
+ long supplied;
+
+ if (!hWnd) return;
+ if (!IsWindow (hWnd)) return;
+
+ if (windowState == None) windowState = XInternAtom(pDisplay, "_NET_WM_STATE", False);
+ if (motif_wm_hints == None) motif_wm_hints = XInternAtom(pDisplay, "_MOTIF_WM_HINTS", False);
+ if (windowType == None) windowType = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", False);
+
+ if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L,
+ 1L, False, XA_ATOM, &type, &format,
+ &nitems, &left, (unsigned char **)&pAtom) == Success)
+ {
+ if (pAtom && nitems == 1)
+ {
+ static Atom hiddenState, fullscreenState, belowState, aboveState;
+ if (hiddenState == None) hiddenState = XInternAtom(pDisplay, "_NET_WM_STATE_HIDDEN", False);
+ if (fullscreenState == None) fullscreenState = XInternAtom(pDisplay, "_NET_WM_STATE_FULLSCREEN", False);
+ if (belowState == None) belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False);
+ if (aboveState == None) aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False);
+ if (*pAtom == hiddenState) maxmin |= HINT_MIN;
+ else if (*pAtom == fullscreenState) maxmin |= HINT_MAX;
+ if (*pAtom == belowState) *zstyle = HWND_BOTTOM;
+ else if (*pAtom == aboveState) *zstyle = HWND_TOPMOST;
+ }
+ if (pAtom) XFree(pAtom);
+ }
+
+ nitems = left = 0;
+ if (XGetWindowProperty(pDisplay, iWindow, motif_wm_hints, 0L,
+ PropMwmHintsElements, False, motif_wm_hints, &type, &format,
+ &nitems, &left, (unsigned char **)&mwm_hint) == Success)
+ {
+ if (mwm_hint && nitems == PropMwmHintsElements && (mwm_hint->flags & MwmHintsDecorations))
+ {
+ if (!mwm_hint->decorations) hint |= HINT_NOFRAME;
+ else if (!(mwm_hint->decorations & MwmDecorAll))
+ {
+ if (mwm_hint->decorations & MwmDecorBorder) hint |= HINT_BORDER;
+ if (mwm_hint->decorations & MwmDecorHandle) hint |= HINT_SIZEBOX;
+ if (mwm_hint->decorations & MwmDecorTitle) hint |= HINT_CAPTION;
+ }
+ }
+ if (mwm_hint) XFree(mwm_hint);
+ }
+
+ nitems = left = 0;
+ pAtom = NULL;
+ if (XGetWindowProperty(pDisplay, iWindow, windowType, 0L,
+ 1L, False, XA_ATOM, &type, &format,
+ &nitems, &left, (unsigned char **)&pAtom) == Success)
+ {
+ if (pAtom && nitems == 1)
+ {
+ static Atom dockWindow;
+ if (dockWindow == None) dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False);
+ if (*pAtom == dockWindow)
+ {
+ hint = (hint & ~HINT_NOFRAME) | HINT_SIZEBOX; /* Xming puts a sizebox on dock windows */
+ *zstyle = HWND_TOPMOST;
+ }
+ }
+ if (pAtom) XFree(pAtom);
+ }
+
+ normal_hint = XAllocSizeHints();
+ if (normal_hint && (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == Success))
+ {
+ if (normal_hint->flags & PMaxSize)
+ {
+ /* Not maximizable if a maximum size is specified */
+ hint |= HINT_NOMAXIMIZE;
+
+ if (normal_hint->flags & PMinSize)
+ {
+ /*
+ If both minimum size and maximum size are specified and are the same,
+ don't bother with a resizing frame
+ */
+ if ((normal_hint->min_width == normal_hint->max_width)
+ && (normal_hint->min_height == normal_hint->max_height))
+ hint = (hint & ~HINT_SIZEBOX);
+ }
+ }
+ }
+ XFree(normal_hint);
+
+ /* Apply Styles, overriding hint settings from above */
+ rcStyle = winOverrideStyle((unsigned long)pWin);
+ if (rcStyle & STYLE_TOPMOST) *zstyle = HWND_TOPMOST;
+ else if (rcStyle & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX;
+ else if (rcStyle & STYLE_MINIMIZE) maxmin = (hint & ~HINT_MAX) | HINT_MIN;
+ else if (rcStyle & STYLE_BOTTOM) *zstyle = HWND_BOTTOM;
+
+ if (maxmin & HINT_MAX) SendMessage(hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
+ else if (maxmin & HINT_MIN) SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
+
+ if (rcStyle & STYLE_NOTITLE)
+ hint = (hint & ~HINT_NOFRAME & ~HINT_BORDER & ~HINT_CAPTION) | HINT_SIZEBOX;
+ else if (rcStyle & STYLE_OUTLINE)
+ hint = (hint & ~HINT_NOFRAME & ~HINT_SIZEBOX & ~HINT_CAPTION) | HINT_BORDER;
+ else if (rcStyle & STYLE_NOFRAME)
+ hint = (hint & ~HINT_BORDER & ~HINT_CAPTION & ~HINT_SIZEBOX) | HINT_NOFRAME;
+
+ SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX); /* Just in case */
+ if (!hint) /* All on */
+ SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) | WS_CAPTION | WS_SIZEBOX);
+ else if (hint & HINT_NOFRAME); /* All off, so do nothing */
+ else SetWindowLongPtr (hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) |
+ ((hint & HINT_BORDER) ? WS_BORDER : 0) |
+ ((hint & HINT_SIZEBOX) ? WS_SIZEBOX : 0) |
+ ((hint & HINT_CAPTION) ? WS_CAPTION : 0));
+
+ if (hint & HINT_NOMAXIMIZE)
+ SetWindowLongPtr(hWnd, GWL_STYLE, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX);
+}
+
+void
+winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle)
+{
+ int iX, iY, iWidth, iHeight;
+ int iDx, iDy;
+ RECT rcNew;
+ WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP);
+ DrawablePtr pDraw = NULL;
+
+ if (!pWin) return;
+ pDraw = &pWin->drawable;
+ if (!pDraw) return;
+
+ /* Get the X and Y location of the X window */
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Get the height and width of the X window */
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Setup a rectangle with the X window position and size */
+ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
+
+#if 0
+ ErrorF ("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n",
+ rcNew.left, rcNew.top,
+ rcNew.right, rcNew.bottom);
+#endif
+
+ AdjustWindowRectEx (&rcNew, GetWindowLongPtr (hWnd, GWL_STYLE), FALSE, WS_EX_APPWINDOW);
+
+ /* Don't allow window decoration to disappear off to top-left as a result of this adjustment */
+ if (rcNew.left < GetSystemMetrics(SM_XVIRTUALSCREEN))
+ {
+ iDx = GetSystemMetrics(SM_XVIRTUALSCREEN) - rcNew.left;
+ rcNew.left += iDx;
+ rcNew.right += iDx;
+ }
+
+ if (rcNew.top < GetSystemMetrics(SM_YVIRTUALSCREEN))
+ {
+ iDy = GetSystemMetrics(SM_YVIRTUALSCREEN) - rcNew.top;
+ rcNew.top += iDy;
+ rcNew.bottom += iDy;
+ }
+
+#if 0
+ ErrorF ("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n",
+ rcNew.left, rcNew.top,
+ rcNew.right, rcNew.bottom);
+#endif
+
+ /* Position the Windows window */
+ SetWindowPos (hWnd, *zstyle, rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ 0);
+
+ if (reshape)
+ {
+ winReshapeMultiWindow(pWin);
+ winUpdateRgnMultiWindow(pWin);
+ }
+}
diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c
index 20ff9f7db..bfb74a092 100644
--- a/xorg-server/hw/xwin/winmultiwindowwndproc.c
+++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c
@@ -1,5 +1,6 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -49,6 +51,8 @@ extern Bool g_fKeyboardHookLL;
extern Bool g_fSoftwareCursor;
extern Bool g_fButton[3];
+extern void winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle);
+
/*
* Local globals
@@ -61,7 +65,6 @@ static UINT_PTR g_uipMousePollingTimerID = 0;
* Constant defines
*/
-#define MOUSE_POLLING_INTERVAL 500
#define WIN_MULTIWINDOW_SHAPE YES
@@ -206,6 +209,7 @@ ValidateSizing (HWND hwnd, WindowPtr pWin,
WinXSizeHints sizeHints;
RECT *rect;
int iWidth, iHeight;
+ unsigned long rcStyle;
/* Invalid input checking */
if (pWin==NULL || lParam==0)
@@ -227,19 +231,31 @@ ValidateSizing (HWND hwnd, WindowPtr pWin,
iWidth = rect->right - rect->left;
iHeight = rect->bottom - rect->top;
- /* Now remove size of any borders */
- iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
- iHeight -= (GetSystemMetrics(SM_CYCAPTION)
- + 2 * GetSystemMetrics(SM_CYSIZEFRAME));
-
+ /* Now remove size of any borders and title bar */
+ rcStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
+ if (rcStyle & WS_CAPTION)
+ {
+ iHeight -= GetSystemMetrics(SM_CYCAPTION);
+ }
+ if (rcStyle & WS_SIZEBOX)
+ {
+ iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+ iHeight -= 2 * GetSystemMetrics(SM_CYSIZEFRAME);
+ }
/* Constrain the size to legal values */
ConstrainSize (sizeHints, &iWidth, &iHeight);
- /* Add back the borders */
- iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
- iHeight += (GetSystemMetrics(SM_CYCAPTION)
- + 2 * GetSystemMetrics(SM_CYSIZEFRAME));
+ /* Add back the size of borders and title bar */
+ if (rcStyle & WS_CAPTION)
+ {
+ iHeight += GetSystemMetrics(SM_CYCAPTION);
+ }
+ if (rcStyle & WS_SIZEBOX)
+ {
+ iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+ iHeight += 2 * GetSystemMetrics(SM_CYSIZEFRAME);
+ }
/* Adjust size according to where we're dragging from */
switch(wParam) {
@@ -276,16 +292,30 @@ static void winRaiseWindow(WindowPtr pWin)
if (!winInDestroyWindowsWindow && !winInRaiseWindow)
{
BOOL oldstate = winInRaiseWindow;
+ XID vlist[1] = { 0 };
winInRaiseWindow = TRUE;
/* Call configure window directly to make sure it gets processed
* in time
*/
- XID vlist[1] = { 0 };
ConfigureWindow(pWin, CWStackMode, vlist, serverClient);
winInRaiseWindow = oldstate;
}
}
+static
+void winStartMousePolling(winPrivScreenPtr s_pScreenPriv)
+{
+ /*
+ * Timer to poll mouse position. This is needed to make
+ * programs like xeyes follow the mouse properly when the
+ * mouse pointer is outside of any X window.
+ */
+ if (g_uipMousePollingTimerID == 0)
+ g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
+ WIN_POLLING_MOUSE_TIMER_ID,
+ MOUSE_POLLING_INTERVAL,
+ NULL);
+}
/*
* winTopLevelWindowProc - Window procedure for all top-level Windows windows.
@@ -377,7 +407,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
switch (message)
{
case WM_CREATE:
-
+{
+ RECT rWindow;
+ HRGN hRgnWindow;
/* */
SetProp (hwnd,
WIN_WINDOW_PROP,
@@ -396,13 +428,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
winReorderWindowsMultiWindow ();
/* Fix a 'round title bar corner background should be transparent not black' problem when first painted */
- RECT rWindow;
- HRGN hRgnWindow;
GetWindowRect(hwnd, &rWindow);
hRgnWindow = CreateRectRgnIndirect(&rWindow);
SetWindowRgn (hwnd, hRgnWindow, TRUE);
DeleteObject(hRgnWindow);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)XMING_SIGNATURE);
+}
return 0;
case WM_INIT_SYS_MENU:
@@ -535,9 +567,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
}
/* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
- ptMouse.y - s_pScreenInfo->dwYOffset,
- g_c32LastInputEventTime = GetTickCount ());
+ winEnqueueMotion(ptMouse.x - s_pScreenInfo->dwXOffset,
+ ptMouse.y - s_pScreenInfo->dwYOffset);
+
return 0;
case WM_NCMOUSEMOVE:
@@ -561,15 +593,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
ShowCursor (TRUE);
}
- /*
- * Timer to poll mouse events. This is needed to make
- * programs like xeyes follow the mouse properly.
- */
- if (g_uipMousePollingTimerID == 0)
- g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
- WIN_POLLING_MOUSE_TIMER_ID,
- MOUSE_POLLING_INTERVAL,
- NULL);
+ winStartMousePolling(s_pScreenPriv);
+
break;
case WM_MOUSELEAVE:
@@ -585,15 +610,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
ShowCursor (TRUE);
}
- /*
- * Timer to poll mouse events. This is needed to make
- * programs like xeyes follow the mouse properly.
- */
- if (g_uipMousePollingTimerID == 0)
- g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
- WIN_POLLING_MOUSE_TIMER_ID,
- MOUSE_POLLING_INTERVAL,
- NULL);
+ winStartMousePolling(s_pScreenPriv);
+
return 0;
case WM_LBUTTONDBLCLK:
@@ -601,12 +619,15 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[0] = TRUE;
+ SetCapture(hwnd);
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
-
+
case WM_LBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[0] = FALSE;
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
case WM_MBUTTONDBLCLK:
@@ -614,47 +635,66 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[1] = TRUE;
+ SetCapture(hwnd);
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
-
+
case WM_MBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[1] = FALSE;
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
-
+
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[2] = TRUE;
+ SetCapture(hwnd);
return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
-
+
case WM_RBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[2] = FALSE;
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
case WM_XBUTTONDBLCLK:
case WM_XBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
+ SetCapture(hwnd);
return winMouseButtonsHandle (s_pScreen, ButtonPress, HIWORD(wParam) + 5, wParam);
+
case WM_XBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
case WM_MOUSEWHEEL:
-
- /* Pass the message to the root window */
- SendMessage (hwndScreen, message, wParam, lParam);
- return 0;
+ if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELONG(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))) == HTCLIENT)
+ {
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+ }
+ else break;
case WM_SETFOCUS:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
+ {
+ /* Get the parent window for transient handling */
+ HWND hParent = GetParent(hwnd);
+ if (hParent && IsIconic(hParent)) ShowWindow (hParent, SW_RESTORE);
+ }
+
winRestoreModeKeyStates ();
/* Add the keyboard hook if possible */
@@ -668,6 +708,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
/* Remove our keyboard hook if it is installed */
winRemoveKeyboardHookLL ();
+ if (!wParam)
+ /* Revert the X focus as well, but only if the Windows focus is going to another thread */
+ DeleteWindowFromAnyEvents(pWin, FALSE);
return 0;
case WM_SYSDEADCHAR:
@@ -770,6 +813,10 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
}
+ /* Prevent the mouse wheel from stalling when another window is minimized */
+ if (HIWORD(wParam) == 0 && LOWORD(wParam) == WA_ACTIVE &&
+ (HWND)lParam != NULL && (HWND)lParam != (HWND)GetParent(hwnd))
+ SetFocus(hwnd);
return 0;
case WM_ACTIVATEAPP:
@@ -824,98 +871,57 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (!wParam)
return 0;
- /* Tell X to map the window */
- MapWindow (pWin, wClient(pWin));
-
/* */
if (!pWin->overrideRedirect)
{
- DWORD dwExStyle;
- DWORD dwStyle;
- RECT rcNew;
- int iDx, iDy;
-
/* Flag that this window needs to be made active when clicked */
SetProp (hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1);
- /* Get the standard and extended window style information */
- dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
- dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
-
- /* */
- if (dwExStyle != WS_EX_APPWINDOW)
+ if (!(GetWindowLongPtr (hwnd, GWL_EXSTYLE) & WS_EX_APPWINDOW))
{
- /* Setup a rectangle with the X window position and size */
- SetRect (&rcNew,
- pDraw->x,
- pDraw->y,
- pDraw->x + pDraw->width,
- pDraw->y + pDraw->height);
-
-#if 0
- ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
- rcNew.left, rcNew.top,
- rcNew.right, rcNew.bottom);
-#endif
-
- /* */
- AdjustWindowRectEx (&rcNew,
- WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
- FALSE,
- WS_EX_APPWINDOW);
-
- /* Calculate position deltas */
- iDx = pDraw->x - rcNew.left;
- iDy = pDraw->y - rcNew.top;
-
- /* Calculate new rectangle */
- rcNew.left += iDx;
- rcNew.right += iDx;
- rcNew.top += iDy;
- rcNew.bottom += iDy;
-
-#if 0
- ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
- rcNew.left, rcNew.top,
- rcNew.right, rcNew.bottom);
-#endif
+ HWND zstyle = HWND_NOTOPMOST;
/* Set the window extended style flags */
SetWindowLongPtr (hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
+ /* Set the transient style flags */
+ if (GetParent(hwnd)) SetWindowLongPtr (hwnd, GWL_STYLE,
+ WS_POPUP | WS_OVERLAPPED | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
/* Set the window standard style flags */
- SetWindowLongPtr (hwnd, GWL_STYLE,
- WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW);
-
- /* Position the Windows window */
- SetWindowPos (hwnd, HWND_TOP,
- rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
- SWP_NOMOVE | SWP_FRAMECHANGED
- | SWP_SHOWWINDOW | SWP_NOACTIVATE);
+ else SetWindowLongPtr (hwnd, GWL_STYLE,
+ (WS_POPUP | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
+ & ~WS_CAPTION & ~WS_SIZEBOX);
- /* Bring the Windows window to the foreground */
+ winUpdateWindowPosition (hwnd, FALSE, &zstyle);
SetForegroundWindow (hwnd);
}
+ wmMsg.msg = WM_WM_MAP;
}
else /* It is an overridden window so make it top of Z stack */
{
+ HWND forHwnd = GetForegroundWindow();
#if CYGWINDOWING_DEBUG
ErrorF ("overridden window is shown\n");
#endif
- SetWindowPos (hwnd, HWND_TOPMOST, 0, 0, 0, 0,
- SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ if (forHwnd != NULL)
+ {
+ if (GetWindowLongPtr(forHwnd, GWLP_USERDATA) & (LONG_PTR)XMING_SIGNATURE)
+ {
+ if (GetWindowLongPtr(forHwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
+ SetWindowPos (hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ else
+ SetWindowPos (hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ }
+ }
+ wmMsg.msg = WM_WM_MAP2;
}
- /* Setup the Window Manager message */
- wmMsg.msg = WM_WM_MAP;
- wmMsg.iWidth = pDraw->width;
- wmMsg.iHeight = pDraw->height;
-
/* Tell our Window Manager thread to map the window */
if (fWMMsgInitialized)
winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ winStartMousePolling(s_pScreenPriv);
+
return 0;
case WM_SIZING:
@@ -1009,8 +1015,20 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
#endif
/* Adjust the X Window to the moved Windows window */
winAdjustXWindow (pWin, hwnd);
+ if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow();
return 0; /* end of WM_SIZE handler */
+ case WM_STYLECHANGED:
+ /* when the style changes, adjust the window size so the client area remains the same */
+ {
+ LONG x,y;
+ DrawablePtr pDraw = &pWin->drawable;
+ x = pDraw->x - wBorderWidth(pWin);
+ y = pDraw->y - wBorderWidth(pWin);
+ winPositionWindowMultiWindow(pWin, x, y);
+ }
+ return 0;
+
case WM_MOUSEACTIVATE:
/* Check if this window needs to be made active when clicked */
diff --git a/xorg-server/hw/xwin/winpolyline.c b/xorg-server/hw/xwin/winpolyline.c
index db9dd345b..bf98d73ec 100644
--- a/xorg-server/hw/xwin/winpolyline.c
+++ b/xorg-server/hw/xwin/winpolyline.c
@@ -45,7 +45,7 @@ winPolyLineNativeGDI (DrawablePtr pDrawable,
{
case LineSolid:
if (pGC->lineWidth == 0)
- return miZeroLine (pDrawable, pGC, mode, npt, ppt);
+ miZeroLine (pDrawable, pGC, mode, npt, ppt);
else
miWideLine (pDrawable, pGC, mode, npt, ppt);
break;
diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c
index 30e587d4a..c5fd7eb08 100644
--- a/xorg-server/hw/xwin/winprefs.c
+++ b/xorg-server/hw/xwin/winprefs.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -26,6 +27,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
#ifdef HAVE_XWIN_CONFIG_H
@@ -724,7 +726,7 @@ winIconIsOverride(unsigned hiconIn)
/*
- * Try and open ~/.XWinrc and /usr/X11R6/lib/X11/system.XWinrc
+ * Try and open ~/.XWinrc and system.XWinrc
* Load it into prefs structure for use by other functions
*/
void
@@ -764,7 +766,7 @@ LoadPreferences ()
#ifdef RELOCATE_PROJECTROOT
snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir());
#else
- strncpy(buffer, PROJECTROOT"/lib/X11/system.XWinrc", sizeof(buffer));
+ strncpy(buffer, SYSCONFDIR"/X11/system.XWinrc", sizeof(buffer));
#endif
buffer[sizeof(buffer)-1] = 0;
prefFile = fopen (buffer, "r");
@@ -820,3 +822,49 @@ LoadPreferences ()
} /* for all menus */
}
+
+
+/*
+ * Check for a match of the window class to one specified in the
+ * STYLES{} section in the prefs file, and return the style type
+ */
+unsigned long
+winOverrideStyle (unsigned long longpWin)
+{
+ WindowPtr pWin = (WindowPtr) longpWin;
+ char *res_name, *res_class;
+ int i;
+ char *wmName;
+
+ if (pWin==NULL)
+ return STYLE_NONE;
+
+ /* If we can't find the class, we can't override from default! */
+ if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ return STYLE_NONE;
+
+ winMultiWindowGetWMName (pWin, &wmName);
+
+ for (i=0; i<pref.styleItems; i++) {
+ if (!strcmp(pref.style[i].match, res_name) ||
+ !strcmp(pref.style[i].match, res_class) ||
+ (wmName && strstr(wmName, pref.style[i].match)))
+ {
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ if (pref.style[i].type)
+ return pref.style[i].type;
+ }
+ }
+
+ /* Didn't find the style, fail gracefully */
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ return STYLE_NONE;
+}
diff --git a/xorg-server/hw/xwin/winprefs.h b/xorg-server/hw/xwin/winprefs.h
index d9e09deea..996b02ade 100644
--- a/xorg-server/hw/xwin/winprefs.h
+++ b/xorg-server/hw/xwin/winprefs.h
@@ -2,6 +2,7 @@
#define WINPREFS_H
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* Need Bool */
@@ -57,6 +59,15 @@ typedef enum MENUCOMMANDTYPE
CMD_RELOAD /* Reparse the .XWINRC file */
} MENUCOMMANDTYPE;
+#define STYLE_NONE (0L) /* Dummy the first entry */
+#define STYLE_NOTITLE (1L) /* Force window style no titlebar */
+#define STYLE_OUTLINE (1L<<1) /* Force window style just thin-line border */
+#define STYLE_NOFRAME (1L<<2) /* Force window style no frame */
+#define STYLE_TOPMOST (1L<<3) /* Open a window always-on-top */
+#define STYLE_MAXIMIZE (1L<<4) /* Open a window maximized */
+#define STYLE_MINIMIZE (1L<<5) /* Open a window minimized */
+#define STYLE_BOTTOM (1L<<6) /* Open a window at the bottom of the Z order */
+
/* Where to place a system menu */
typedef enum MENUPOSITION
{
@@ -97,6 +108,13 @@ typedef struct ICONITEM
unsigned long hicon; /* LoadImage() result */
} ICONITEM;
+/* To redefine styles for certain window types */
+typedef struct STYLEITEM
+{
+ char match[MENU_MAX+1]; /* What string to search for? */
+ unsigned long type; /* What should it do? */
+} STYLEITEM;
+
typedef struct WINPREFS
{
/* Menu information */
@@ -122,6 +140,9 @@ typedef struct WINPREFS
ICONITEM *icon;
int iconItems;
+ STYLEITEM *style;
+ int styleItems;
+
/* Silent exit flag */
Bool fSilentExit;
@@ -155,6 +176,9 @@ unsigned long
winOverrideIcon (unsigned long longpWin);
unsigned long
+winOverrideStyle (unsigned long longpWin);
+
+unsigned long
winTaskbarIcon(void);
unsigned long
diff --git a/xorg-server/hw/xwin/winprefslex.l b/xorg-server/hw/xwin/winprefslex.l
index a4c1abc3d..ee2478bcc 100644
--- a/xorg-server/hw/xwin/winprefslex.l
+++ b/xorg-server/hw/xwin/winprefslex.l
@@ -1,6 +1,7 @@
%{ # -*- C -*-
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -27,6 +28,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* $XFree86: $ */
@@ -70,6 +72,14 @@ MENU { return MENU; }
ICONDIRECTORY { return ICONDIRECTORY; }
DEFAULTICON { return DEFAULTICON; }
ICONS { return ICONS; }
+STYLES { return STYLES; }
+TOPMOST { return TOPMOST; }
+MAXIMIZE { return MAXIMIZE; }
+MINIMIZE { return MINIMIZE; }
+BOTTOM { return BOTTOM; }
+NOTITLE { return NOTITLE; }
+OUTLINE { return OUTLINE; }
+NOFRAME { return NOFRAME; }
ROOTMENU { return ROOTMENU; }
DEFAULTSYSMENU { return DEFAULTSYSMENU; }
SYSMENU { return SYSMENU; }
diff --git a/xorg-server/hw/xwin/winprefsyacc.c b/xorg-server/hw/xwin/winprefsyacc.c
index abdc681b6..131379f48 100644
--- a/xorg-server/hw/xwin/winprefsyacc.c
+++ b/xorg-server/hw/xwin/winprefsyacc.c
@@ -62,6 +62,9 @@
/* Tokens. */
#ifndef YYTOKENTYPE
+#ifdef DEBUG
+#undef DEBUG
+#endif
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
@@ -373,14 +376,14 @@ YYID (i)
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+ || defined __cplusplus)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+ || defined __cplusplus)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
diff --git a/xorg-server/hw/xwin/winprefsyacc.h b/xorg-server/hw/xwin/winprefsyacc.h
index 60a879a4d..de075f50a 100644
--- a/xorg-server/hw/xwin/winprefsyacc.h
+++ b/xorg-server/hw/xwin/winprefsyacc.h
@@ -35,6 +35,10 @@
/* Tokens. */
#ifndef YYTOKENTYPE
+#ifdef DEBUG
+#undef DEBUG
+#endif
+
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
diff --git a/xorg-server/hw/xwin/winprefsyacc.y b/xorg-server/hw/xwin/winprefsyacc.y
index 2a54ff28f..c917d04ff 100644
--- a/xorg-server/hw/xwin/winprefsyacc.y
+++ b/xorg-server/hw/xwin/winprefsyacc.y
@@ -1,6 +1,7 @@
%{
/*
* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) Colin Harrison 2005-2008
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -27,6 +28,7 @@
* from the XFree86 Project.
*
* Authors: Earle F. Philhower, III
+ * Colin Harrison
*/
/* $XFree86: $ */
@@ -41,6 +43,10 @@
/* The following give better error messages in bison at the cost of a few KB */
#define YYERROR_VERBOSE 1
+/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */
+#define YYLTYPE_IS_TRIVIAL 1
+#define YYENABLE_NLS 0
+
/* The global pref settings */
WINPREFS pref;
@@ -64,6 +70,10 @@ static void OpenIcons(void);
static void AddIconLine(char *matchstr, char *iconfile);
static void CloseIcons(void);
+static void OpenStyles(void);
+static void AddStyleLine(char *matchstr, unsigned long style);
+static void CloseStyles(void);
+
static void OpenSysMenu(void);
static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
static void CloseSysMenu(void);
@@ -78,14 +88,19 @@ extern int yylex(void);
%union {
char *sVal;
+ unsigned long uVal;
int iVal;
}
-%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS DEFAULTSYSMENU
+%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS STYLES
+%token TOPMOST MAXIMIZE MINIMIZE BOTTOM NOTITLE OUTLINE NOFRAME DEFAULTSYSMENU
%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG
%token RELOAD TRAYICON SILENTEXIT
%token <sVal> STRING
+%type <uVal> group1
+%type <uVal> group2
+%type <uVal> stylecombo
%type <iVal> atspot
%%
@@ -107,6 +122,7 @@ command: defaulticon
| icondirectory
| menu
| icons
+ | styles
| sysmenu
| rootmenu
| defaultsysmenu
@@ -154,6 +170,33 @@ iconlist: iconline
icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();}
;
+group1: TOPMOST { $$=STYLE_TOPMOST; }
+ | MAXIMIZE { $$=STYLE_MAXIMIZE; }
+ | MINIMIZE { $$=STYLE_MINIMIZE; }
+ | BOTTOM { $$=STYLE_BOTTOM; }
+ ;
+
+group2: NOTITLE { $$=STYLE_NOTITLE; }
+ | OUTLINE { $$=STYLE_OUTLINE; }
+ | NOFRAME { $$=STYLE_NOFRAME; }
+ ;
+
+stylecombo: group1 { $$=$1; }
+ | group2 { $$=$1; }
+ | group1 group2 { $$=$1+$2; }
+ | group2 group1 { $$=$1+$2; }
+ ;
+
+styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); }
+ ;
+
+stylelist: styleline
+ | styleline stylelist
+ ;
+
+styles: STYLES LB {OpenStyles();} newline_or_nada stylelist RB {CloseStyles();}
+ ;
+
atspot: { $$=AT_END; }
| ATSTART { $$=AT_START; }
| ATEND { $$=AT_END; }
@@ -316,6 +359,39 @@ CloseIcons (void)
}
static void
+OpenStyles (void)
+{
+ if (pref.style != NULL) {
+ ErrorF("LoadPreferences: Redefining window style\n");
+ free(pref.style);
+ pref.style = NULL;
+ }
+ pref.styleItems = 0;
+}
+
+static void
+AddStyleLine (char *matchstr, unsigned long style)
+{
+ if (pref.style==NULL)
+ pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
+ else
+ pref.style = (STYLEITEM*)
+ realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
+
+ strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
+ pref.style[pref.styleItems].match[MENU_MAX] = 0;
+
+ pref.style[pref.styleItems].type = style;
+
+ pref.styleItems++;
+}
+
+static void
+CloseStyles (void)
+{
+}
+
+static void
OpenSysMenu (void)
{
if (pref.sysMenu != NULL) {
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c
index 7139cbaab..9271da02b 100644
--- a/xorg-server/hw/xwin/winprocarg.c
+++ b/xorg-server/hw/xwin/winprocarg.c
@@ -1,6 +1,7 @@
/*
Copyright 1993, 1998 The Open Group
+Copyright (C) Colin Harrison 2005-2008
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
@@ -31,9 +32,9 @@ from The Open Group.
#endif
#ifdef XVENDORNAME
#define VENDOR_STRING XVENDORNAME
-#define VERSION_STRING XORG_RELEASE
#define VENDOR_CONTACT BUILDERADDR
#endif
+#include <../xfree86/common/xorgVersion.h>
#include "win.h"
#include "winconfig.h"
#include "winprefs.h"
@@ -57,6 +58,7 @@ extern char * g_pszLogFile;
extern Bool g_fLogFileChanged;
#endif
extern Bool g_fXdmcpEnabled;
+extern Bool g_fAuthEnabled;
extern char * g_pszCommandLine;
extern Bool g_fKeyboardHookLL;
extern Bool g_fNoHelpMessageBox;
@@ -1289,6 +1291,29 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
/*
+ * Look for the '-auth' argument
+ */
+ if (IS_OPTION ("-auth"))
+ {
+#ifdef __MINGW32__
+ HANDLE hFile;
+ char * pszFile;
+ CHECK_ARGS (1);
+ pszFile = argv[++i];
+ hFile = CreateFile(pszFile,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ winMessageBoxF ("This authorization file for the -auth option could not be opened...\n"
+ "\"%s\"\n"
+ "You should use an \"Xauthority\" file in your HOME directory.\n"
+ "\nIgnoring and continuing.\n",
+ MB_ICONINFORMATION,
+ pszFile);
+#endif
+ g_fAuthEnabled = TRUE;
+ return 0; /* Let DIX parse this again */
+ }
+
+ /*
* Look for the '-indirect' or '-broadcast' arguments
*/
if (IS_OPTION ("-indirect")
@@ -1459,13 +1484,13 @@ winLogCommandLine (int argc, char *argv[])
for (i = 0, iCurrLen = 0; i < argc; ++i)
if (argv[i])
{
- /* Add a character for lines that overflow */
+ /* Adds two characters for lines that overflow */
if ((strlen (argv[i]) < CHARS_PER_LINE
&& iCurrLen + strlen (argv[i]) > CHARS_PER_LINE)
|| strlen (argv[i]) > CHARS_PER_LINE)
{
iCurrLen = 0;
- ++iSize;
+ iSize += 2;
}
/* Add space for item and trailing space */
@@ -1525,8 +1550,8 @@ winLogVersionInfo (void)
ErrorF ("Welcome to the XWin X Server\n");
ErrorF ("Vendor: %s\n", VENDOR_STRING);
- ErrorF ("Release: %s\n\n", VERSION_STRING);
- ErrorF ("Contact: %s\n\n", VENDOR_CONTACT);
+ ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, BUILD_DATE);
+ ErrorF ("Contact: %s\n", VENDOR_CONTACT);
}
/*
diff --git a/xorg-server/hw/xwin/winresource.h b/xorg-server/hw/xwin/winresource.h
index 5aa884030..7085117e6 100644
--- a/xorg-server/hw/xwin/winresource.h
+++ b/xorg-server/hw/xwin/winresource.h
@@ -37,7 +37,6 @@
#define IDC_STATIC -1
#define IDI_XWIN 101
-#define IDI_XWIN_BOXED 102
#define IDM_TRAYICON_MENU 103
#define IDC_CLIENTS_CONNECTED 104
diff --git a/xorg-server/hw/xwin/winscrinit.c b/xorg-server/hw/xwin/winscrinit.c
index 9dc4c3da5..5cc3925c7 100644
--- a/xorg-server/hw/xwin/winscrinit.c
+++ b/xorg-server/hw/xwin/winscrinit.c
@@ -37,7 +37,6 @@
#endif
#include "win.h"
#include "winmsg.h"
-#include "safeAlpha.h"
#ifdef XWIN_MULTIWINDOWEXTWM
@@ -142,7 +141,7 @@ winScreenInit (int index,
}
/* Adjust the video mode for our engine type */
- if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
+ if (pScreenPriv->pwinAdjustVideoMode && !(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
{
ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
return FALSE;
@@ -176,7 +175,7 @@ winScreenInit (int index,
}
/* Create display window */
- if (!(*pScreenPriv->pwinCreateBoundingWindow) (pScreen))
+ if (pScreenPriv->pwinCreateBoundingWindow && !(*pScreenPriv->pwinCreateBoundingWindow) (pScreen))
{
ErrorF ("winScreenInit - pwinCreateBoundingWindow () "
"failed\n");
@@ -227,7 +226,7 @@ winScreenInit (int index,
pScreenInfo->dwBPP);
/* Call the engine dependent screen initialization procedure */
- if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
+ if (pScreenPriv->pwinFinishScreenInit && !((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
{
ErrorF ("winScreenInit - winFinishScreenInit () failed\n");
return FALSE;
@@ -245,6 +244,25 @@ winScreenInit (int index,
return TRUE;
}
+static Bool
+winCreateScreenResources(ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ Bool result;
+
+ result = pScreenPriv->pwinCreateScreenResources(pScreen);
+
+ /* Now the screen bitmap has been wrapped in a pixmap,
+ add that to the Shadow framebuffer */
+ if (!shadowAdd(pScreen, pScreen->devPrivate,
+ pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
+ {
+ ErrorF ("winCreateScreenResources - shadowAdd () failed\n");
+ return FALSE;
+ }
+
+ return result;
+}
/* See Porting Layer Definition - p. 20 */
Bool
@@ -360,22 +378,6 @@ winFinishScreenInitFB (int index,
pScreen->blockData = pScreen;
pScreen->wakeupData = pScreen;
-#ifdef XWIN_MULTIWINDOWEXTWM
- /*
- * Setup acceleration for multi-window external window manager mode.
- * To be compatible with the Damage extension, this must be done
- * before calling miDCInitialize, which calls DamageSetup.
- */
- if (pScreenInfo->fMWExtWM)
- {
- if (!RootlessAccelInit (pScreen))
- {
- ErrorF ("winFinishScreenInitFB - RootlessAccelInit () failed\n");
- return FALSE;
- }
- }
-#endif
-
#ifdef RENDER
/* Render extension initialization, calls miPictureInit */
if (!fbPictureInit (pScreen, NULL, 0))
@@ -428,15 +430,18 @@ winFinishScreenInitFB (int index,
)
{
#if CYGDEBUG
- winDebug ("winFinishScreenInitFB - Calling shadowInit ()\n");
+ winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n");
#endif
- if (!shadowInit (pScreen,
- pScreenPriv->pwinShadowUpdate,
- NULL))
+ if (!shadowSetup(pScreen))
{
- ErrorF ("winFinishScreenInitFB - shadowInit () failed\n");
+ ErrorF ("winFinishScreenInitFB - shadowSetup () failed\n");
return FALSE;
}
+
+ /* Wrap CreateScreenResources so we can add the screen pixmap
+ to the Shadow framebuffer after it's been created */
+ pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = winCreateScreenResources;
}
#ifdef XWIN_MULTIWINDOWEXTWM
diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c
index a2c1dc9b0..96acfcbc7 100644
--- a/xorg-server/hw/xwin/winshaddd.c
+++ b/xorg-server/hw/xwin/winshaddd.c
@@ -48,10 +48,12 @@ extern HWND g_hDlgExit;
* FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
* so we have to redefine it here.
*/
+#ifndef _MSC_VER
#ifdef DEFINE_GUID
#undef DEFINE_GUID
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif /* DEFINE_GUID */
+#endif
/*
@@ -361,7 +363,7 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
{
ErrorF ("winAllocateFBShadowDD - Changing video mode\n");
- /* Change the video mode to the mode requested */
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
pScreenInfo->dwWidth,
pScreenInfo->dwHeight,
@@ -373,7 +375,20 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDD - Could not set "\
"full screen display mode: %08x\n",
(unsigned int) ddrval);
- return FALSE;
+ ErrorF ("winAllocateFBShadowDD - Using default driver refresh rate\n");
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
}
}
else
@@ -508,7 +523,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
HRESULT ddrval = DD_OK;
RECT rcDest, rcSrc;
POINT ptOrigin;
@@ -534,7 +549,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
if (FAILED (ddrval))
{
- ErrorF ("winShadowUpdateProcDD - Unlock failed\n");
+ ErrorF ("winShadowUpdateDD - Unlock failed\n");
return;
}
@@ -626,19 +641,20 @@ winShadowUpdateDD (ScreenPtr pScreen,
NULL);
if (FAILED (ddrval))
{
- ErrorF ("winShadowUpdateProcDD - Lock failed\n");
+ ErrorF ("winShadowUpdateDD - Lock failed\n");
return;
}
/* Has our memory pointer changed? */
if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
{
- ErrorF ("winShadowUpdateProcDD - Memory location of the shadow "
+ extern char *g_pszLogFile;
+ ErrorF ("winShadowUpdateDD - Memory location of the shadow "
"surface has changed, trying to update the root window "
"pixmap header to point to the new address. If you get "
"this message and "PROJECT_NAME" freezes or crashes "
"after this message then send a problem report and your "
- "/tmp/XWin.log file to cygwin-xfree@cygwin.com\n");
+ "%s file to " BUILDERADDR, g_pszLogFile);
/* Location of shadow framebuffer has changed */
pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
@@ -653,7 +669,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
pScreenInfo->dwBPP),
pScreenInfo->pfb))
{
- ErrorF ("winShadowUpdateProcDD - Bits changed, could not "
+ ErrorF ("winShadowUpdateDD - Bits changed, could not "
"notify fb.\n");
return;
}
diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c
index 47cc382e9..e029154ed 100644
--- a/xorg-server/hw/xwin/winshadddnl.c
+++ b/xorg-server/hw/xwin/winshadddnl.c
@@ -48,10 +48,12 @@ extern HWND g_hDlgExit;
* FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
* so we have to redefine it here.
*/
+#ifndef _MSC_VER
#ifdef DEFINE_GUID
#undef DEFINE_GUID
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif /* DEFINE_GUID */
+#endif
/*
* FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
@@ -391,7 +393,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
{
winDebug ("winAllocateFBShadowDDNL - Changing video mode\n");
- /* Change the video mode to the mode requested */
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
pScreenInfo->dwWidth,
pScreenInfo->dwHeight,
@@ -403,7 +405,20 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDDNL - Could not set "
"full screen display mode: %08x\n",
(unsigned int) ddrval);
- return FALSE;
+ ErrorF ("winAllocateFBShadowDDNL - Using default driver refresh rate\n");
+ ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
}
}
else
@@ -584,7 +599,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
HRESULT ddrval = DD_OK;
RECT rcDest, rcSrc;
POINT ptOrigin;
@@ -1310,7 +1325,7 @@ winStoreColorsShadowDDNL (ColormapPtr pColormap,
+ pdefs[0].pixel);
if (FAILED (ddrval))
{
- ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", ddrval);
+ ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (int) ddrval);
return FALSE;
}
diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c
index 04cc2f716..d38e4f76b 100644
--- a/xorg-server/hw/xwin/winshadgdi.c
+++ b/xorg-server/hw/xwin/winshadgdi.c
@@ -498,7 +498,7 @@ winShadowUpdateGDI (ScreenPtr pScreen,
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
DWORD dwBox = REGION_NUM_RECTS (damage);
BoxPtr pBox = REGION_RECTS (damage);
int x, y, w, h;
diff --git a/xorg-server/hw/xwin/winwin32rootless.c b/xorg-server/hw/xwin/winwin32rootless.c
index 6f4e2c97e..2c80c0885 100644
--- a/xorg-server/hw/xwin/winwin32rootless.c
+++ b/xorg-server/hw/xwin/winwin32rootless.c
@@ -38,7 +38,7 @@
#include "win.h"
#include <winuser.h>
#define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
#include "dixevents.h"
#include "winmultiwindowclass.h"
#include "winprefs.h"
@@ -48,9 +48,6 @@
/*
* Constant defines
*/
-
-#define MOUSE_POLLING_INTERVAL 500
-
#define ULW_COLORKEY 0x00000001
#define ULW_ALPHA 0x00000002
#define ULW_OPAQUE 0x00000004
diff --git a/xorg-server/hw/xwin/winwin32rootlesswndproc.c b/xorg-server/hw/xwin/winwin32rootlesswndproc.c
index 859aafd29..3d16ae5c9 100644
--- a/xorg-server/hw/xwin/winwin32rootlesswndproc.c
+++ b/xorg-server/hw/xwin/winwin32rootlesswndproc.c
@@ -35,7 +35,7 @@
#include "win.h"
#include <winuser.h>
#define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
#include "dixevents.h"
#include "propertyst.h"
#include <X11/Xatom.h>
@@ -48,7 +48,6 @@
* Constant defines
*/
-#define MOUSE_POLLING_INTERVAL 500
#define MOUSE_ACTIVATE_DEFAULT TRUE
#define RAISE_ON_CLICK_DEFAULT FALSE
@@ -567,9 +566,9 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
}
/* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (ptMouse.x - pScreenInfo->dwXOffset,
- ptMouse.y - pScreenInfo->dwYOffset,
- g_c32LastInputEventTime = GetTickCount ());
+ winEnqueueMotion(ptMouse.x - pScreenInfo->dwXOffset,
+ ptMouse.y - pScreenInfo->dwYOffset);
+
return 0;
case WM_NCMOUSEMOVE:
diff --git a/xorg-server/hw/xwin/winwindow.c b/xorg-server/hw/xwin/winwindow.c
index 1600996df..54afe9f7e 100644
--- a/xorg-server/hw/xwin/winwindow.c
+++ b/xorg-server/hw/xwin/winwindow.c
@@ -60,6 +60,7 @@ winReshapeRootless (WindowPtr pWin);
Bool
winCreateWindowNativeGDI (WindowPtr pWin)
{
+ Bool fResult;
ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
winScreenPriv(pScreen);
@@ -352,7 +353,6 @@ winPositionWindowRootless (WindowPtr pWin, int x, int y)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
@@ -378,7 +378,6 @@ winChangeWindowAttributesRootless (WindowPtr pWin, unsigned long mask)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -436,7 +435,6 @@ winMapWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -462,7 +460,6 @@ void
winSetShapeRootless (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h
index 9c49d6482..71c5b015e 100644
--- a/xorg-server/hw/xwin/winwindow.h
+++ b/xorg-server/hw/xwin/winwindow.h
@@ -2,6 +2,7 @@
#define _WINWINDOW_H_
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *Copyright (C) Colin Harrison 2005-2008
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -28,6 +29,7 @@
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
+ * Colin Harrison
*/
#ifndef NO
@@ -42,8 +44,8 @@
# define PROJECT_NAME "Cygwin/X"
#endif
#define WINDOW_CLASS "cygwin/x"
-#define WINDOW_TITLE PROJECT_NAME " - %s:%d"
-#define WINDOW_TITLE_XDMCP PROJECT_NAME " - %s"
+#define WINDOW_TITLE PROJECT_NAME ":%s.%d"
+#define WINDOW_TITLE_XDMCP "%s:%s.%d"
#define WIN_SCR_PROP "cyg_screen_prop rl"
#define WINDOW_CLASS_X "cygwin/x X rl"
#define WINDOW_TITLE_X PROJECT_NAME " X"
@@ -60,6 +62,8 @@
#define CYGWINDOWING_DEBUG NO
#endif
+#define XMING_SIGNATURE 0x12345678L
+
typedef struct _winPrivScreenRec *winPrivScreenPtr;
@@ -111,9 +115,24 @@ typedef struct _winWMMessageRec{
#define WM_WM_NAME_EVENT (WM_USER + 9)
#define WM_WM_HINTS_EVENT (WM_USER + 10)
#define WM_WM_CHANGE_STATE (WM_USER + 11)
+#define WM_WM_MAP2 (WM_USER + 12)
#define WM_MANAGE (WM_USER + 100)
#define WM_UNMANAGE (WM_USER + 102)
+#define MwmHintsDecorations (1L << 1)
+
+#define MwmDecorAll (1l << 0)
+#define MwmDecorBorder (1l << 1)
+#define MwmDecorHandle (1l << 2)
+#define MwmDecorTitle (1l << 3)
+
+/* This structure only contains 3 elements... the Motif 2.0 structure
+contains 5... we only need the first 3... so that is all we will define */
+typedef struct MwmHints {
+ unsigned long flags, functions, decorations;
+} MwmHints;
+#define PropMwmHintsElements 3
+
void
winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c
index e1994de84..6a0b81232 100644
--- a/xorg-server/hw/xwin/winwindowswm.c
+++ b/xorg-server/hw/xwin/winwindowswm.c
@@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "servermd.h"
#include "swaprep.h"
#define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
static int WMErrorBase;
diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c
index 29ea81fc1..c553634f9 100644
--- a/xorg-server/hw/xwin/winwndproc.c
+++ b/xorg-server/hw/xwin/winwndproc.c
@@ -762,11 +762,11 @@ winWindowProc (HWND hwnd, UINT message,
g_fCursor = TRUE;
ShowCursor (TRUE);
}
-
+
/* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
- GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset,
- g_c32LastInputEventTime = GetTickCount ());
+ winEnqueueMotion(GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
+ GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
+
return 0;
case WM_NCMOUSEMOVE:
@@ -927,10 +927,9 @@ winWindowProc (HWND hwnd, UINT message,
/* Map from screen (-X, -Y) to root (0, 0) */
point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
-
+
/* Deliver absolute cursor position to X Server */
- miPointerAbsoluteCursor (point.x, point.y,
- g_c32LastInputEventTime = GetTickCount());
+ winEnqueueMotion(point.x , point.y);
/* Check if a button was released but we didn't see it */
GetCursorPos (&point);
diff --git a/xorg-server/hw/xwin/xlaunch/config.h b/xorg-server/hw/xwin/xlaunch/config.h
new file mode 100644
index 000000000..e2774e894
--- /dev/null
+++ b/xorg-server/hw/xwin/xlaunch/config.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2005 Alexander Gottwald
+ *
+ * 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.
+ *
+ * Authors: Alexander Gottwald, Colin Harrison
+ */
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+#define UNICODE
+#define _UNICODE
+
+#define PROG_NUMBER 10
+#define HOST_NUMBER 10
+#define MAX_MESSAGE 256
+#define MAX_CAPTION 128
+
+#include <windows.h>
+#include <string>
+#include <vector>
+struct CConfig
+{
+ enum {MultiWindow, Fullscreen, Windowed, Nodecoration} window;
+ enum {NoClient, StartProgram, XDMCP} client;
+ enum {NoXClient, Local, PuTTY, OpenSSH} clientstart;
+ std::string display;
+ std::string protocol_path;
+ std::string program;
+ std::vector<std::string> progs;
+ bool compress;
+ bool local;
+ std::string protocol;
+ std::string host;
+ std::string user;
+ std::string password;
+ bool password_save;
+ bool password_start;
+ bool broadcast;
+ bool indirect;
+ std::string xdmcp_host;
+ std::vector<std::string> xhosts;
+ bool clipboard;
+ bool no_access_control;
+ std::string font_server;
+ std::string extra_params;
+ std::string extra_ssh;
+ CConfig() : window(MultiWindow), client(NoClient), clientstart(NoXClient), display(""),
+ protocol_path(""), program("xeyes"), progs(PROG_NUMBER), compress(false), host(""), user(""),
+ password(""), password_save(false), password_start(false), broadcast(false),
+ indirect(false), xdmcp_host(""), xhosts(HOST_NUMBER), clipboard(true), no_access_control(false),
+ font_server(), extra_params(), extra_ssh() {};
+ void Load(const char * filename);
+ void Save(const char * filename);
+};
+
+#endif
diff --git a/xorg-server/hw/xwin/xlaunch/main.cc b/xorg-server/hw/xwin/xlaunch/main.cc
index 2247d3aaf..e4be475ee 100644
--- a/xorg-server/hw/xwin/xlaunch/main.cc
+++ b/xorg-server/hw/xwin/xlaunch/main.cc
@@ -34,6 +34,10 @@
#include <X11/Xlib.h>
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
/// @brief Send WM_ENDSESSION to all program windows.
/// This will shutdown the started xserver
BOOL CALLBACK KillWindowsProc(HWND hwnd, LPARAM lParam)
@@ -489,7 +493,7 @@ class CMyWizard : public CWizard
return NULL;
}
- /// @brief Do the actual start of Xming and clients
+ /// @brief Do the actual start of VCXsrv and clients
void StartUp()
{
std::string buffer;
@@ -500,12 +504,12 @@ class CMyWizard : public CWizard
std::string display = "localhost" + display_id + ":0";
#ifdef _DEBUG
- // Debug only: Switch to Xming installation directory
- SetCurrentDirectory("C:\\Programme\\Xming");
+ // Debug only: Switch to VCXsrv installation directory
+ SetCurrentDirectory("C:\\Programme\\vcxsrv");
#endif
- // Build Xming commandline
- buffer = "Xming " + display_id + " ";
+ // Build Xsrv commandline
+ buffer = "vcxsrv " + display_id + " ";
switch (config.window)
{
case CConfig::MultiWindow:
@@ -577,7 +581,7 @@ class CMyWizard : public CWizard
sic.cb = sizeof(sic);
ZeroMemory( &pic, sizeof(pic) );
- // Start Xming process.
+ // Start VCXsrv process.
#ifdef _DEBUG
printf("%s\n", buffer.c_str());
#endif
@@ -627,7 +631,7 @@ class CMyWizard : public CWizard
#ifdef _DEBUG
printf("killing process!\n");
#endif
- // Check if Xming is still running
+ // Check if Xsrv is still running
DWORD exitcode;
GetExitCodeProcess(pi.hProcess, &exitcode);
unsigned counter = 0;
@@ -636,7 +640,7 @@ class CMyWizard : public CWizard
if (++counter > 10)
TerminateProcess(pi.hProcess, (DWORD)-1);
else
- // Shutdown Xming (the soft way!)
+ // Shutdown Xsrv (the soft way!)
EnumThreadWindows(pi.dwThreadId, KillWindowsProc, 0);
Sleep(500);
GetExitCodeProcess(pi.hProcess, &exitcode);
diff --git a/xorg-server/hw/xwin/xlaunch/makefile b/xorg-server/hw/xwin/xlaunch/makefile
new file mode 100644
index 000000000..345357d92
--- /dev/null
+++ b/xorg-server/hw/xwin/xlaunch/makefile
@@ -0,0 +1,32 @@
+INCLUDELIBFILES = window\$(OBJDIR)\window.lib \
+ $(MHMAKECONF)\libx11\src\$(OBJDIR)\libx11.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libxau\$(OBJDIR)\libxau.lib \
+ $(MHMAKECONF)\libx11\src\xlibi18n\$(OBJDIR)\libi18n.lib \
+ $(MHMAKECONF)\libx11\modules\lc\xlocale\$(OBJDIR)\libxlocale.lib \
+ $(MHMAKECONF)\libx11\modules\lc\utf8\$(OBJDIR)\libxlcUTF8Load.lib \
+ $(MHMAKECONF)\libx11\modules\lc\gen\$(OBJDIR)\liblcGenConvLoad.lib \
+ $(MHMAKECONF)\libx11\modules\lc\def\$(OBJDIR)\libxlcDef.lib \
+ $(MHMAKECONF)\libx11\src\xkb\$(OBJDIR)\libxkb.lib \
+ $(MHMAKECONF)\libx11\modules\im\ximcp\$(OBJDIR)\libximcp.lib \
+ $(MHMAKECONF)\libx11\modules\om\generic\$(OBJDIR)\libxomGeneric.lib
+
+CSRCS=config.cc main.cc
+
+WINAPP = xlaunch
+
+RESOURCES = resources.rc
+
+$(OBJDIR)\%.res : resources\%.rc
+ $(RC) $(RCFLAGS) $(RCDEFINES:%=-d "%") $(RCINCLUDES:%=-i "%") -Fo"$(relpath $@)" "$<"
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);)
+
+ifeq ($(DEBUG),1)
+LINKLIBS += $(MHMAKECONF)\pthreads\pthreadVC2d.lib
+else
+LINKLIBS += $(MHMAKECONF)\pthreads\pthreadVC2.lib
+endif
+
diff --git a/xorg-server/hw/xwin/xlaunch/window/makefile b/xorg-server/hw/xwin/xlaunch/window/makefile
new file mode 100644
index 000000000..18a33e728
--- /dev/null
+++ b/xorg-server/hw/xwin/xlaunch/window/makefile
@@ -0,0 +1,4 @@
+CSRCS=dialog.cc util.cc window.cc wizard.cc
+
+LIBRARY = window
+
diff --git a/xorg-server/hw/xwin/xlaunch/window/util.h b/xorg-server/hw/xwin/xlaunch/window/util.h
index cd21da657..2e8dab263 100644
--- a/xorg-server/hw/xwin/xlaunch/window/util.h
+++ b/xorg-server/hw/xwin/xlaunch/window/util.h
@@ -28,7 +28,7 @@
#include <windows.h>
#include <stdexcept>
-
+#include <string>
class win32_error : public std::runtime_error
{
diff --git a/xorg-server/hw/xwin/xlaunch/window/wizard.h b/xorg-server/hw/xwin/xlaunch/window/wizard.h
index a2361c51c..c576cc093 100644
--- a/xorg-server/hw/xwin/xlaunch/window/wizard.h
+++ b/xorg-server/hw/xwin/xlaunch/window/wizard.h
@@ -29,7 +29,6 @@
#include "dialog.h"
#include <vector>
-#define _WIN32_IE 0x0500
#include <prsht.h>
class CWizard : public CBaseDialog
diff --git a/xorg-server/include/dixstruct.h b/xorg-server/include/dixstruct.h
index d44b9cfa7..88d1df342 100644
--- a/xorg-server/include/dixstruct.h
+++ b/xorg-server/include/dixstruct.h
@@ -97,7 +97,7 @@ typedef struct _Client {
Bool swapped;
ReplySwapPtr pSwapReplyFunc;
XID errorValue;
- int sequence;
+ unsigned short sequence; //MH
int closeDownMode;
int clientGone;
int noClientException; /* this client died or needs to be
diff --git a/xorg-server/include/do-not-use-config.h b/xorg-server/include/do-not-use-config.h
index b2c9161ee..ddec02eee 100644
--- a/xorg-server/include/do-not-use-config.h
+++ b/xorg-server/include/do-not-use-config.h
@@ -643,10 +643,10 @@
#define XKB 1
/* Path to XKB data */
-#define XKB_BASE_DIRECTORY "/usr/local/share/X11/xkb"
+#define XKB_BASE_DIRECTORY "xkbdata"
/* Path to XKB bin dir */
-#define XKB_BIN_DIRECTORY "/usr/local/bin"
+#define XKB_BIN_DIRECTORY "."
/* Disable XKB per default */
#define XKB_DFLT_DISABLED 0
@@ -655,7 +655,7 @@
#define XKB_IN_SERVER 1
/* Path to XKB output dir */
-#define XKM_OUTPUT_DIR "/usr/local/share/X11/xkb/compiled/"
+#define XKM_OUTPUT_DIR "xkbdata/compiled/"
/* Building Xorg server */
#define XORGSERVER 1
diff --git a/xorg-server/include/globals.h b/xorg-server/include/globals.h
index 2ca9531d9..1ff701380 100644
--- a/xorg-server/include/globals.h
+++ b/xorg-server/include/globals.h
@@ -50,9 +50,7 @@ extern Bool PanoramiXExtensionDisabledHack;
extern Bool noBigReqExtension;
#endif
-#ifdef COMPOSITE
extern Bool noCompositeExtension;
-#endif
#ifdef DAMAGE
extern Bool noDamageExtension;
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
index a1cbe8670..ca740c08b 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -164,9 +164,9 @@ typedef struct _xReq *xReqPtr;
#include <math.h>
#undef MAXSHORT
-#define MAXSHORT SHRT_MAX
+#define MAXSHORT 32767
#undef MINSHORT
-#define MINSHORT SHRT_MIN
+#define MINSHORT -32768
#undef MAXINT
#define MAXINT INT_MAX
#undef MININT
diff --git a/xorg-server/include/pixmapstr.h b/xorg-server/include/pixmapstr.h
index cc5a8d8de..4150b69b7 100644
--- a/xorg-server/include/pixmapstr.h
+++ b/xorg-server/include/pixmapstr.h
@@ -76,10 +76,8 @@ typedef struct _Pixmap {
int refcnt;
int devKind;
DevUnion devPrivate;
-#ifdef COMPOSITE
short screen_x;
short screen_y;
-#endif
unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */
} PixmapRec;
diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h
index 3b2cf9f81..c49487585 100644
--- a/xorg-server/include/scrnintstr.h
+++ b/xorg-server/include/scrnintstr.h
@@ -68,7 +68,7 @@ typedef struct _Visual {
VisualID vid;
short class;
short bitsPerRGBValue;
- short ColormapEntries;
+ long ColormapEntries;
short nplanes;/* = log2 (ColormapEntries). This does not
* imply that the screen has this many planes.
* it may have more or fewer */
@@ -432,6 +432,10 @@ typedef void (* MarkUnrealizedWindowProcPtr)(
WindowPtr /*pWin*/,
Bool /*fromConfigure*/);
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
typedef struct _Screen {
int myNum; /* index of this instance in Screens[] */
ATOM id;
diff --git a/xorg-server/include/windowstr.h b/xorg-server/include/windowstr.h
index e06a2f1bd..f370a25d2 100644
--- a/xorg-server/include/windowstr.h
+++ b/xorg-server/include/windowstr.h
@@ -137,7 +137,7 @@ typedef struct _Window {
RegionRec borderSize;
DDXPointRec origin; /* position relative to parent */
unsigned short borderWidth;
- unsigned short deliverableEvents;
+ unsigned long deliverableEvents;
Mask eventMask;
PixUnion background;
PixUnion border;
diff --git a/xorg-server/include/xkb-config.h b/xorg-server/include/xkb-config.h
index 8dc80b6c5..91c7957bf 100644
--- a/xorg-server/include/xkb-config.h
+++ b/xorg-server/include/xkb-config.h
@@ -10,13 +10,13 @@
#define __XKBDEFRULES__ "xorg"
/* Path to XKB definitions. */
-#define XKB_BASE_DIRECTORY "/usr/local/share/X11/xkb"
+#define XKB_BASE_DIRECTORY "xkbdata"
/* Path to xkbcomp. */
-#define XKB_BIN_DIRECTORY "/usr/local/bin"
+#define XKB_BIN_DIRECTORY "."
/* XKB output dir for compiled keymaps. */
-#define XKM_OUTPUT_DIR "/usr/local/share/X11/xkb/compiled/"
+#define XKM_OUTPUT_DIR "xkbdata/compiled/"
/* Do not have `strcasecmp'. */
/* #undef NEED_STRCASECMP */
diff --git a/xorg-server/makefile b/xorg-server/makefile
new file mode 100644
index 000000000..7ccc0d784
--- /dev/null
+++ b/xorg-server/makefile
@@ -0,0 +1,102 @@
+ifneq ($(MAKESERVER),1)
+$(error Please specify MAKESERVER=1 on the command line or as environment variable)
+endif
+
+INCLUDELIBFILES = afb\$(OBJDIR)\libafb.lib \
+ cfb\$(OBJDIR)\libcfb.lib \
+ cfb32\$(OBJDIR)\libcfb32.lib \
+ composite\$(OBJDIR)\libcomposite.lib \
+ config\$(OBJDIR)\libconfig.lib \
+ damageext\$(OBJDIR)\libdamageext.lib \
+ dbe\$(OBJDIR)\libdbe.lib \
+ dix\$(OBJDIR)\libdix.lib \
+ exa\$(OBJDIR)\libexa.lib \
+ fb\$(OBJDIR)\libfb.lib \
+ glx\$(OBJDIR)\libglx.lib \
+ hw\kdrive\ephyr\$(OBJDIR)\libxephyr.lib \
+ hw\kdrive\src\$(OBJDIR)\libkdrive.lib \
+ hw\xwin\$(OBJDIR)\libxwin.lib \
+ mfb\$(OBJDIR)\libmfb.lib \
+ mi\$(OBJDIR)\libmi.lib \
+ miext\damage\$(OBJDIR)\libdamage.lib \
+ miext\shadow\$(OBJDIR)\libshadow.lib \
+ os\$(OBJDIR)\libos.lib \
+ randr\$(OBJDIR)\librandr.lib \
+ record\$(OBJDIR)\librecord.lib \
+ Xext\$(OBJDIR)\libxext.lib \
+ xfixes\$(OBJDIR)\libxfixes.lib \
+ Xi\$(OBJDIR)\libxi.lib \
+ xkb\$(OBJDIR)\libxkb.lib \
+ render\$(OBJDIR)\librender.lib \
+ $(MHMAKECONF)\libxau\$(OBJDIR)\libxau.lib \
+ $(MHMAKECONF)\libxdmcp\$(OBJDIR)\libxdmcp.lib \
+ $(MHMAKECONF)\libXfont\src\util\$(OBJDIR)\libutil.lib \
+ $(MHMAKECONF)\libXfont\src\fc\$(OBJDIR)\libfc.lib \
+ $(MHMAKECONF)\libXfont\src\fontfile\$(OBJDIR)\libfontfile.lib \
+ $(MHMAKECONF)\libXfont\src\builtins\$(OBJDIR)\libbuiltins.lib \
+ $(MHMAKECONF)\libXfont\src\bitmap\$(OBJDIR)\libbitmap.lib \
+ $(MHMAKECONF)\pixman\pixman\$(OBJDIR)\libpixman-1.lib \
+ $(MHMAKECONF)\libx11\modules\im\ximcp\$(OBJDIR)\libximcp.lib \
+ $(MHMAKECONF)\libx11\src\xlibi18n\$(OBJDIR)\libi18n.lib \
+ $(MHMAKECONF)\libx11\src\$(OBJDIR)\libx11.lib \
+ $(MHMAKECONF)\libx11\src\xcms\$(OBJDIR)\libxcms.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libx11\src\xkb\$(OBJDIR)\libxkb.lib \
+ $(MHMAKECONF)\libx11\modules\om\generic\$(OBJDIR)\libxomGeneric.lib \
+ $(MHMAKECONF)\libx11\modules\lc\utf8\$(OBJDIR)\libxlcUTF8Load.lib \
+ $(MHMAKECONF)\libx11\modules\lc\def\$(OBJDIR)\libxlcDef.lib \
+ $(MHMAKECONF)\libx11\modules\lc\gen\$(OBJDIR)\liblcGenConvLoad.lib \
+ $(MHMAKECONF)\zlib\$(OBJDIR)\libz.lib \
+ $(MHMAKECONF)\libx11\modules\lc\xlocale\$(OBJDIR)\libxlocale.lib \
+ $(MHMAKECONF)\libXfont\src\Type1\$(OBJDIR)\libtype1.lib \
+ $(MHMAKECONF)\libfontenc\src\$(OBJDIR)\libfontenc.lib \
+ $(MHMAKECONF)\libXfont\src\Speedo\$(OBJDIR)\libspeedo.lib \
+ $(MHMAKECONF)\libxfont\src\freetype\$(OBJDIR)\libft.lib \
+ $(MHMAKECONF)\libxfont\src\stubs\$(OBJDIR)\libstubs.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);)
+
+OBJS = dix\$(OBJDIR)\main.obj
+
+WINAPP=vcxsrv
+
+LINKLIBS += $(MHMAKECONF)\openssl\out32\libeay32.lib
+
+ifeq ($(DEBUG),1)
+LINKLIBS += $(MHMAKECONF)\freetype\lib\freetype200b8MT_D.lib \
+ $(MHMAKECONF)\pthreads\pthreadVC2d.lib
+else
+LINKLIBS += $(MHMAKECONF)\freetype\lib\freetype200b8MT.lib \
+ $(MHMAKECONF)\pthreads\pthreadVC2.lib
+endif
+
+RCINCLUDES += hw\xwin $(MHMAKECONF)\include $(MHMAKECONF)
+
+XWin.rc: hw\xwin\XWin.rc
+ copy $< $@
+
+RESOURCES = XWin.rc
+
+$(OBJDIR)\$(WINAPP).exe: $(LINKLIBS)
+
+$(WINAPP).exe: $(OBJDIR)\$(WINAPP).exe
+ copy $< $@
+
+load_makefile hw\xwin\xlaunch\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+xlaunch.exe: hw\xwin\xlaunch\$(OBJDIR:obj\$(OBJDIRPREFIX)%=obj\%)\xlaunch.exe
+ copy $< $@
+
+load_makefile ..\xkbcomp\makefile MAKESERVER=0 DEBUG=$(DEBUG)
+
+xkbcomp.exe: ..\xkbcomp\$(OBJDIR:obj\$(OBJDIRPREFIX)%=obj\%)\xkbcomp.exe
+ copy $< $@
+
+all: $(WINAPP).exe xlaunch.exe xkbcomp.exe protocol.txt
+
+protocol.txt: dix\protocol.txt
+ copy $< $@
+
+
diff --git a/xorg-server/mfb/makefile b/xorg-server/mfb/makefile
new file mode 100644
index 000000000..f3ca6e647
--- /dev/null
+++ b/xorg-server/mfb/makefile
@@ -0,0 +1,14 @@
+CSRCS=mfbseg.c mfbpgbwht.c mfbpgbblak.c mfbpgbinv.c mfbigbwht.c \
+ mfbigbblak.c mfbpawhite.c mfbpablack.c mfbpainv.c mfbtewhite.c \
+ mfbteblack.c mfbbltC.c mfbbltX.c mfbbltCI.c mfbbltO.c mfbbltG.c \
+ mfbtileC.c mfbtileG.c mfbplywhite.c mfbplyblack.c mfbplyinv.c \
+ mfbgc.c mfbwindow.c mfbfont.c \
+ mfbfillrct.c maskbits.c mfbpixmap.c \
+ mfbimage.c mfbline.c mfbbres.c mfbhrzvert.c mfbbresd.c \
+ mfbpushpxl.c mfbzerarc.c mfbfillarc.c \
+ mfbfillsp.c mfbsetsp.c mfbscrinit.c mfbscrclse.c mfbclip.c \
+ mfbbitblt.c mfbgetsp.c mfbpolypnt.c \
+ mfbcmap.c mfbmisc.c
+
+LIBRARY=libmfb
+
diff --git a/xorg-server/mfb/mfbply1rct.c b/xorg-server/mfb/mfbply1rct.c
index 4227e894f..9ff4fb5be 100644
--- a/xorg-server/mfb/mfbply1rct.c
+++ b/xorg-server/mfb/mfbply1rct.c
@@ -51,14 +51,14 @@ in this Software without prior written authorization from The Open Group.
#endif
#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
+#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) ((i)&0xffff))))
#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int) ((short) i))
+#define intToY(i) ((int) ((short) ((i)&0xffff)))
#else
-#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
+#define intToCoord(i,x,y) (((x) = (int) ((short) ((i)&0xffff))), ((y) = GetHighWord(i)))
#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
-#define intToX(i) ((int) ((short) (i)))
+#define intToX(i) ((int) ((short) ((i)&0xffff)))
#define intToY(i) (GetHighWord(i))
#endif
diff --git a/xorg-server/mi/makefile b/xorg-server/mi/makefile
new file mode 100644
index 000000000..759278c09
--- /dev/null
+++ b/xorg-server/mi/makefile
@@ -0,0 +1,41 @@
+CSRCS=miarc.c \
+ mibank.c \
+ mibitblt.c \
+ mibstore.c \
+ micmap.c \
+ micursor.c \
+ midash.c \
+ midispcur.c \
+ mieq.c \
+ miexpose.c \
+ mifillarc.c \
+ mifillrct.c \
+ mifpolycon.c \
+ migc.c \
+ miglblt.c \
+ mioverlay.c \
+ mipointer.c \
+ mipoly.c \
+ mipolycon.c \
+ mipolygen.c \
+ mipolypnt.c \
+ mipolyrect.c \
+ mipolyseg.c \
+ mipolytext.c \
+ mipolyutil.c \
+ mipushpxl.c \
+ miregion.c \
+ miscrinit.c \
+ mispans.c \
+ misprite.c \
+ mivaltree.c \
+ miwideline.c \
+ miwindow.c \
+ mizerarc.c \
+ mizerclip.c \
+ mizerline.c \
+ miinitext.c
+
+LIBRARY=libmi
+
+
diff --git a/xorg-server/mi/micoord.h b/xorg-server/mi/micoord.h
index 876e88c95..08f315b99 100644
--- a/xorg-server/mi/micoord.h
+++ b/xorg-server/mi/micoord.h
@@ -55,14 +55,14 @@
#endif
#if IMAGE_BYTE_ORDER == MSBFirst
-#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i))))
+#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) ((i)&0xffff))))
#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
#define intToX(i) (GetHighWord(i))
-#define intToY(i) ((int) ((short) i))
+#define intToY(i) ((int) ((short) ((i)&0xffff)))
#else
-#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i)))
+#define intToCoord(i,x,y) (((x) = (int) ((short) ((i)&0xffff))), ((y) = GetHighWord(i)))
#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
-#define intToX(i) ((int) ((short) (i)))
+#define intToX(i) ((int) ((short) ((i)&0xffff)))
#define intToY(i) (GetHighWord(i))
#endif
diff --git a/xorg-server/miext/damage/makefile b/xorg-server/miext/damage/makefile
new file mode 100644
index 000000000..e58f4a883
--- /dev/null
+++ b/xorg-server/miext/damage/makefile
@@ -0,0 +1,7 @@
+LIBRARY = libdamage
+
+#INCLUDES = -I$(srcdir)/../cw -I$(top_srcdir)/hw/xfree86/os-support
+
+CSRCS =damage.c
+
+
diff --git a/xorg-server/miext/rootless/Xplugin.h b/xorg-server/miext/rootless/Xplugin.h
new file mode 100644
index 000000000..0262904ac
--- /dev/null
+++ b/xorg-server/miext/rootless/Xplugin.h
@@ -0,0 +1,713 @@
+/* Xplugin.h -- windowing API for rootless X11 server
+ $Id: Xplugin.h,v 1.4 2003/03/03 23:30:53 jharper Exp $
+
+
+ Copyright (c) 2002 Apple Computer, Inc. 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.
+
+
+Note that these interfaces are provided solely for the use of the
+X11 server. Any other uses are unsupported and strongly discouraged. */
+
+#ifndef XPLUGIN_H
+#define XPLUGIN_H 1
+
+
+#include <stdint.h>
+
+
+/* By default we use the X server definition of BoxRec to define xp_box,
+ so that the compiler can silently convert between the two. But if
+ XP_NO_X_HEADERS is defined, we'll define it ourselves. */
+
+
+#ifndef XP_NO_X_HEADERS
+# include "miscstruct.h"
+ typedef BoxRec xp_box;
+#else
+ struct xp_box_struct {
+ short x1, y1, x2, y2;
+ };
+ typedef struct xp_box_struct xp_box;
+#endif
+
+
+typedef unsigned int xp_resource_id;
+typedef xp_resource_id xp_window_id;
+typedef xp_resource_id xp_surface_id;
+typedef unsigned int xp_client_id;
+typedef unsigned int xp_request_type;
+typedef int xp_error;
+typedef int xp_bool;
+
+
+
+/* Error codes that the functions declared here may return. They all
+ numerically match their X equivalents, i.e. the XP_ can be dropped
+ if <X11/X.h> has been included. */
+
+
+enum xp_error_enum {
+ XP_Success = 0,
+ XP_BadRequest = 1,
+ XP_BadValue = 2,
+ XP_BadWindow = 3,
+ XP_BadMatch = 8,
+ XP_BadAccess = 10,
+ XP_BadImplementation = 17,
+};
+
+
+
+/* Event types generated by the plugin. */
+
+
+enum xp_event_type_enum {
+ /* The global display configuration changed somehow. */
+ XP_EVENT_DISPLAY_CHANGED = 1 << 0,
+
+
+ /* A window changed state. Argument is xp_window_state_event */
+ XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1,
+
+
+ /* An async request encountered an error. Argument is of type
+ xp_async_error_event */
+ XP_EVENT_ASYNC_ERROR = 1 << 2,
+
+
+ /* Sent when a surface is destroyed as a side effect of destroying
+ a window. Arg is of type xp_surface_id. */
+ XP_EVENT_SURFACE_DESTROYED = 1 << 3,
+
+
+ /* Sent when any GL contexts pointing at the given surface need to
+ call xp_update_gl_context () to refresh their state (because the
+ window moved or was resized. Arg is of type xp_surface_id. */
+ XP_EVENT_SURFACE_CHANGED = 1 << 4,
+
+
+/* Sent when a window has been moved. Arg is of type xp_window_id. */
+XP_EVENT_WINDOW_MOVED = 1 << 5,
+};
+
+/* Function type used to receive events. */
+
+
+typedef void (xp_event_fun) (unsigned int type, const void *arg,
+ unsigned int arg_size, void *user_data);
+
+
+
+/* Operation types. Used when reporting errors asynchronously. */
+
+
+enum xp_request_type_enum {
+ XP_REQUEST_NIL = 0,
+ XP_REQUEST_DESTROY_WINDOW = 1,
+ XP_REQUEST_CONFIGURE_WINDOW = 2,
+ XP_REQUEST_FLUSH_WINDOW = 3,
+ XP_REQUEST_COPY_WINDOW = 4,
+ XP_REQUEST_UNLOCK_WINDOW = 5,
+ XP_REQUEST_DISABLE_UPDATE = 6,
+ XP_REQUEST_REENABLE_UPDATE = 7,
+ XP_REQUEST_HIDE_CURSOR = 8,
+ XP_REQUEST_SHOW_CURSOR = 9,
+ XP_REQUEST_FRAME_DRAW = 10,
+};
+
+
+/* Structure used to report an error asynchronously. Passed as the "arg"
+ of an XP_EVENT_ASYNC_ERROR event. */
+
+
+struct xp_async_error_event_struct {
+ xp_request_type request_type;
+ xp_resource_id id;
+ xp_error error;
+};
+
+
+typedef struct xp_async_error_event_struct xp_async_error_event;
+
+
+
+/* Possible window states. */
+
+
+enum xp_window_state_enum {
+/* The window is not in the global list of possibly-visible windows. */
+XP_WINDOW_STATE_OFFSCREEN = 1 << 0,
+
+ /* Parts of the window may be obscured by other windows. */
+ XP_WINDOW_STATE_OBSCURED = 1 << 1,
+};
+
+
+/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */
+
+struct xp_window_state_event_struct {
+ xp_window_id id;
+ unsigned int state;
+};
+
+
+typedef struct xp_window_state_event_struct xp_window_state_event;
+
+
+
+/* Function type used to supply a colormap for indexed drawables. */
+
+
+typedef xp_error (xp_colormap_fun) (void *data, int first_color,
+ int n_colors, uint32_t *colors);
+
+
+
+/* Window attributes structure. Used when creating and configuring windows.
+Also used when configuring surfaces attached to windows. Functions that
+take one of these structures also take a bit mask defining which
+fields are set to meaningful values. */
+
+enum xp_window_changes_enum {
+ XP_ORIGIN = 1 << 0,
+ XP_SIZE = 1 << 1,
+ XP_BOUNDS = XP_ORIGIN | XP_SIZE,
+ XP_SHAPE = 1 << 2,
+ XP_STACKING = 1 << 3,
+ XP_DEPTH = 1 << 4,
+ XP_COLORMAP = 1 << 5,
+ XP_WINDOW_LEVEL = 1 << 6,
+};
+
+
+struct xp_window_changes_struct {
+ /* XP_ORIGIN */
+ int x, y;
+
+
+ /* XP_SIZE */
+ unsigned int width, height;
+ int bit_gravity; /* how to resize the backing store */
+
+
+ /* XP_SHAPE */
+ int shape_nrects; /* -1 = remove shape */
+ xp_box *shape_rects;
+ int shape_tx, shape_ty; /* translation for shape */
+
+
+ /* XP_STACKING */
+ int stack_mode;
+ xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes
+ it may specify a relative window */
+ /* XP_DEPTH, window-only */
+ unsigned int depth;
+
+
+ /* XP_COLORMAP, window-only */
+ xp_colormap_fun *colormap;
+ void *colormap_data;
+
+
+ /* XP_WINDOW_LEVEL, window-only */
+ int window_level;
+};
+
+
+typedef struct xp_window_changes_struct xp_window_changes;
+
+
+/* Values for bit_gravity field */
+
+
+enum xp_bit_gravity_enum {
+ XP_GRAVITY_NONE = 0, /* no gravity, fill everything */
+ XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
+ XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
+ XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
+ XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
+};
+
+
+/* Values for stack_mode field */
+
+
+enum xp_window_stack_mode_enum {
+ XP_UNMAPPED = 0, /* remove the window */
+ XP_MAPPED_ABOVE = 1, /* display the window on top */
+ XP_MAPPED_BELOW = 2, /* display the window at bottom */
+};
+
+
+/* Data formats for depth field and composite functions */
+
+
+enum xp_depth_enum {
+ XP_DEPTH_NIL = 0, /* null source when compositing */
+ XP_DEPTH_ARGB8888,
+ XP_DEPTH_RGB555,
+ XP_DEPTH_A8, /* for masks when compositing */
+ XP_DEPTH_INDEX8,
+};
+
+
+/* Options that may be passed to the xp_init () function. */
+
+
+enum xp_init_options_enum {
+ /* Don't mark that this process can be in the foreground. */
+ XP_IN_BACKGROUND = 1 << 0,
+
+
+ /* Deliver background pointer events to this process. */
+ XP_BACKGROUND_EVENTS = 1 << 1,
+};
+
+
+
+
+/* Miscellaneous functions */
+
+
+/* Initialize the plugin library. Only the copy/fill/composite functions
+ may be called without having previously called xp_init () */
+
+
+extern xp_error xp_init (unsigned int options);
+
+
+/* Sets the current set of requested notifications to MASK. When any of
+ these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that
+ calling this function cancels any previously requested notifications
+ that aren't set in MASK. */
+
+
+extern xp_error xp_select_events (unsigned int mask,
+ xp_event_fun *callback,
+ void *callback_data);
+
+
+/* Waits for all initiated operations to complete. */
+
+
+extern xp_error xp_synchronize (void);
+
+
+/* Causes any display update initiated through the plugin libary to be
+ queued until update is reenabled. Note that calls to these functions
+ nest. */
+
+
+extern xp_error xp_disable_update (void);
+extern xp_error xp_reenable_update (void);
+
+
+
+
+/* Cursor functions. */
+
+
+/* Installs the specified cursor. ARGB-DATA should point to 32-bit
+ premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters
+ specify the offset to the cursor's hot spot from its top-left
+ corner. */
+
+
+extern xp_error xp_set_cursor (unsigned int width, unsigned int height,
+ unsigned int hot_x, unsigned int hot_y,
+ const uint32_t *argb_data,
+ unsigned int rowbytes);
+
+
+/* Hide and show the cursor if it's owned by the current process. Calls
+ to these functions nest. */
+
+
+extern xp_error xp_hide_cursor (void);
+extern xp_error xp_show_cursor (void);
+
+
+
+
+/* Window functions. */
+
+
+/* Create a new window as defined by MASK and VALUES. MASK must contain
+ XP_BOUNDS or an error is raised. The id of the newly created window
+ is stored in *RET-ID if this function returns XP_Success. */
+
+
+extern xp_error xp_create_window (unsigned int mask,
+ const xp_window_changes *values,
+ xp_window_id *ret_id);
+
+
+/* Destroys the window identified by ID. */
+
+
+extern xp_error xp_destroy_window (xp_window_id id);
+
+
+/* Reconfigures the given window according to MASK and VALUES. */
+
+
+extern xp_error xp_configure_window (xp_window_id id, unsigned int mask,
+ const xp_window_changes *values);
+
+
+
+/* Returns true if NATIVE-ID is a window created by the plugin library.
+If so and RET-ID is non-null, stores the id of the window in *RET-ID. */
+
+extern xp_bool xp_lookup_native_window (unsigned int native_id,
+ xp_window_id *ret_id);
+
+
+/* If ID names a window created by the plugin library, stores it's native
+window id in *RET-NATIVE-ID. */
+
+extern xp_error xp_get_native_window (xp_window_id id,
+ unsigned int *ret_native_id);
+
+
+
+/* Locks the rectangle IN-RECT (or, if null, the entire window) of the
+given window's backing store. Any other non-null parameters are filled
+in as follows:
+
+ DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888
+ or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is
+ always stored in native byte order.
+
+
+ BITS[0] = pointer to top-left pixel of locked color data
+ BITS[1] = pointer to top-left of locked alpha data, or null if window
+ has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0].
+
+
+ ROWBYTES[0,1] = size in bytes of each row of color,alpha data
+
+
+ OUT-RECT = rectangle specifying the current position and size of the
+ locked region relative to the window origin.
+
+
+Note that an error is raised when trying to lock an already locked
+window. While the window is locked, the only operations that may
+be performed on it are to modify, access or flush its marked region. */
+
+extern xp_error xp_lock_window (xp_window_id id,
+ const xp_box *in_rect,
+ unsigned int *depth,
+ void *bits[2],
+ unsigned int rowbytes[2],
+ xp_box *out_rect);
+
+
+/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS,
+ SHAPE-TX, and SHAPE-TY in the specified window has been updated, and
+ will need to subsequently be redisplayed. */
+
+
+extern xp_error xp_mark_window (xp_window_id id, int shape_nrects,
+ const xp_box *shape_rects,
+ int shape_tx, int shape_ty);
+
+
+/* Unlocks the specified window. If FLUSH is true, then any marked
+ regions are immediately redisplayed. Note that it's an error to
+ unlock an already unlocked window. */
+
+
+extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush);
+
+
+/* If anything is marked in the given window for redisplay, do it now. */
+
+extern xp_error xp_flush_window (xp_window_id id);
+
+
+/* Moves the contents of the region DX,DY pixels away from that specified
+by DST_RECTS and DST_NRECTS in the window with SRC-ID to the
+destination region in the window DST-ID. Note that currently source
+and destination windows must be the same. */
+
+extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id,
+int dst_nrects, const xp_box *dst_rects,
+int dx, int dy);
+
+/* Returns true if the given window has any regions marked for
+ redisplay. */
+
+
+extern xp_bool xp_is_window_marked (xp_window_id id);
+
+
+/* If successful returns a superset of the region marked for update in
+the given window. Use xp_free_region () to release the returned data. */
+
+extern xp_error xp_get_marked_shape (xp_window_id id,
+ int *ret_nrects, xp_box **ret_rects);
+
+
+extern void xp_free_shape (int nrects, xp_box *rects);
+
+
+/* Searches for the first window below ABOVE-ID containing the point X,Y,
+and returns it's window id in *RET-ID. If no window is found, *RET-ID
+is set to zero. If ABOVE-ID is zero, finds the topmost window
+containing the given point. */
+
+extern xp_error xp_find_window (int x, int y, xp_window_id above_id,
+ xp_window_id *ret_id);
+
+
+/* Returns the current origin and size of the window ID in *BOUNDS-RET if
+successful. */
+extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret);
+
+
+
+/* Window surface functions. */
+
+
+/* Create a new VRAM surface on the specified window. If successful,
+ returns the identifier of the new surface in *RET-SID. */
+
+
+extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid);
+
+/* Destroys the specified surface. */
+
+
+extern xp_error xp_destroy_surface (xp_surface_id sid);
+
+
+/* Reconfigures the specified surface as defined by MASK and VALUES.
+ Note that specifying XP_DEPTH is an error. */
+
+
+extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask,
+const xp_window_changes *values);
+
+/* If successful, places the client identifier of the current process
+ in *RET-CLIENT. */
+
+
+extern xp_error xp_get_client_id (xp_client_id *ret_client);
+
+
+/* Given a valid window,surface combination created by the current
+ process, attempts to allow the specified external client access
+ to that surface. If successful, returns two integers in RET-KEY
+ which the client can use to import the surface into their process. */
+
+
+extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid,
+ xp_client_id client,
+ unsigned int ret_key[2]);
+
+
+/* Given a two integer key returned from xp_export_surface (), tries
+ to import the surface into the current process. If successful the
+ local surface identifier is stored in *SID-RET. */
+
+
+extern xp_error xp_import_surface (const unsigned int key[2],
+ xp_surface_id *sid_ret);
+
+
+/* If successful, stores the number of surfaces attached to the
+ specified window in *RET. */
+
+
+extern xp_error xp_get_window_surface_count (xp_window_id id,
+ unsigned int *ret);
+
+
+/* Attaches the CGLContextObj CGL-CTX to the specified surface. */
+
+
+extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid);
+
+
+/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to
+ the surface it's attached to. */
+
+
+extern xp_error xp_update_gl_context (void *cgl_ctx);
+
+
+
+
+/* Window frame functions. */
+
+
+/* Possible arguments to xp_frame_get_rect (). */
+
+
+enum xp_frame_rect_enum {
+ XP_FRAME_RECT_TITLEBAR = 1,
+ XP_FRAME_RECT_TRACKING = 2,
+ XP_FRAME_RECT_GROWBOX = 3,
+};
+
+
+/* Classes of window frame. */
+
+
+enum xp_frame_class_enum {
+ XP_FRAME_CLASS_DOCUMENT = 1 << 0,
+ XP_FRAME_CLASS_DIALOG = 1 << 1,
+ XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2,
+ XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3,
+ XP_FRAME_CLASS_UTILITY = 1 << 4,
+ XP_FRAME_CLASS_TOOLBAR = 1 << 5,
+ XP_FRAME_CLASS_MENU = 1 << 6,
+ XP_FRAME_CLASS_SPLASH = 1 << 7,
+ XP_FRAME_CLASS_BORDERLESS = 1 << 8,
+};
+
+
+/* Attributes of window frames. */
+
+
+enum xp_frame_attr_enum {
+ XP_FRAME_ACTIVE = 0x0001,
+ XP_FRAME_URGENT = 0x0002,
+ XP_FRAME_TITLE = 0x0004,
+ XP_FRAME_PRELIGHT = 0x0008,
+ XP_FRAME_SHADED = 0x0010,
+ XP_FRAME_CLOSE_BOX = 0x0100,
+ XP_FRAME_COLLAPSE = 0x0200,
+ XP_FRAME_ZOOM = 0x0400,
+ XP_FRAME_ANY_BUTTON = 0x0700,
+ XP_FRAME_CLOSE_BOX_CLICKED = 0x0800,
+ XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000,
+ XP_FRAME_ZOOM_BOX_CLICKED = 0x2000,
+ XP_FRAME_ANY_CLICKED = 0x3800,
+ XP_FRAME_GROW_BOX = 0x4000,
+};
+
+
+#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b))
+#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3))
+#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3))
+#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3))
+
+
+#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \
+ | XP_FRAME_ANY_BUTTON \
+ | XP_FRAME_ANY_CLICKED)
+
+
+extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer,
+const xp_box *inner, xp_box *ret);
+extern xp_error xp_frame_hit_test (int class, int x, int y,
+const xp_box *outer,
+const xp_box *inner, int *ret);
+extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr,
+const xp_box *outer, const xp_box *inner,
+unsigned int title_len,
+const unsigned char *title_bytes);
+
+
+/* Memory manipulation functions. */
+
+
+enum xp_composite_op_enum {
+ XP_COMPOSITE_SRC = 0,
+ XP_COMPOSITE_OVER,
+};
+
+
+#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
+ (((op) << 24) | ((src_depth) << 16) \
+ | ((mask_depth) << 8) | ((dest_depth) << 0))
+
+
+#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255)
+#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255)
+#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255)
+#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255)
+
+
+/* Composite WIDTH by HEIGHT pixels from source and mask to destination
+ using a specified function (if source and destination overlap,
+ undefined behavior results).
+
+
+For SRC and DEST, the first element of the array is the color data. If
+the second element is non-null it implies that there is alpha data
+(which may be meshed or planar). Data without alpha is assumed to be
+opaque.
+
+ Passing a null SRC-ROWBYTES pointer implies that the data SRC points
+ to is a single element.
+
+
+Operations that are not supported will return XP_BadImplementation. */
+
+extern xp_error xp_composite_pixels (unsigned int width, unsigned int height,
+unsigned int function,
+void *src[2], unsigned int src_rowbytes[2],
+void *mask, unsigned int mask_rowbytes,
+void *dest[2], unsigned int dest_rowbytes[2]);
+
+/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH
+ bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES
+ wide in total. */
+
+
+extern void xp_fill_bytes (unsigned int width,
+ unsigned int height, uint32_t value,
+ void *dst, unsigned int dst_rowbytes);
+
+
+/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH
+bytes copied. SRC and DST may overlap, and the right thing will happen. */
+
+extern void xp_copy_bytes (unsigned int width, unsigned int height,
+ const void *src, unsigned int src_rowbytes,
+ void *dst, unsigned int dst_rowbytes);
+
+
+/* Suggestions for the minimum number of bytes or pixels for which it
+ makes sense to use some of the xp_ functions */
+
+
+extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold,
+ xp_composite_area_threshold, xp_scroll_area_threshold;
+
+
+
+#endif /* XPLUGIN_H */
diff --git a/xorg-server/miext/rootless/rootlessWindow.c b/xorg-server/miext/rootless/rootlessWindow.c
index 0dad44a99..681fefef3 100644
--- a/xorg-server/miext/rootless/rootlessWindow.c
+++ b/xorg-server/miext/rootless/rootlessWindow.c
@@ -36,13 +36,13 @@
#include <stddef.h> /* For NULL */
#include <limits.h> /* For CHAR_BIT */
#include <assert.h>
+#include <X11/Xatom.h>
+#include <Xplugin.h>
#ifdef __APPLE__
//#include <X11/Xlib.h>
-#include <X11/Xatom.h>
#include "mi.h"
#include "pixmapstr.h"
#include "windowstr.h"
-#include <Xplugin.h>
//#include <X11/extensions/applewm.h>
extern int darwinMainScreenX, darwinMainScreenY;
#endif
@@ -93,9 +93,11 @@ static inline int
configure_window (xp_window_id id, unsigned int mask,
const xp_window_changes *values)
{
+#ifdef __APPLE__
if (!no_configure_window)
return xp_configure_window (id, mask, values);
else
+#endif
return XP_Success;
}
@@ -116,6 +118,7 @@ rootlessHasRoot (ScreenPtr pScreen)
return WINREC (WindowTable[pScreen->myNum]) != NULL;
}
+#ifdef __APPLE__
void
RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state)
{
@@ -155,7 +158,11 @@ RootlessNativeWindowMoved (WindowPtr pWin)
mask = CWX | CWY;
/* pretend we're the owner of the window! */
- client = LookupClient (pWin->drawable.id, NullClient);
+ err = dixLookupClient(&pClient, pWin->drawable.id, NullClient, DixUnknownAccess);
+ if(err != Success) {
+ ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", (unsigned int)pWin->drawable.id);
+ return;
+ }
/* Don't want to do anything to the physical window (avoids
notification-response feedback loops) */
@@ -184,6 +191,7 @@ set_screen_origin (WindowPtr pWin)
dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
}
+#endif /* __APPLE__ */
/*
* RootlessCreateWindow
diff --git a/xorg-server/miext/rootless/rootlessWindow.h b/xorg-server/miext/rootless/rootlessWindow.h
index 055589e79..cc5396224 100644
--- a/xorg-server/miext/rootless/rootlessWindow.h
+++ b/xorg-server/miext/rootless/rootlessWindow.h
@@ -56,7 +56,9 @@ void RootlessResizeWindow(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, WindowPtr pSib);
void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
+#ifdef __APPLE__
void RootlessNativeWindowMoved (WindowPtr pWin);
void RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state);
+#endif
#endif
diff --git a/xorg-server/miext/shadow/makefile b/xorg-server/miext/shadow/makefile
new file mode 100644
index 000000000..0a84b506c
--- /dev/null
+++ b/xorg-server/miext/shadow/makefile
@@ -0,0 +1,25 @@
+LIBRARY = libshadow
+
+#INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support
+
+CSRCS = shadow.c \
+ shalloc.c \
+ shpacked.c \
+ shplanar8.c \
+ shplanar.c \
+ shrot16pack_180.c \
+ shrot16pack_270.c \
+ shrot16pack_270YX.c \
+ shrot16pack_90.c \
+ shrot16pack_90YX.c \
+ shrot16pack.c \
+ shrot32pack_180.c \
+ shrot32pack_270.c \
+ shrot32pack_90.c \
+ shrot32pack.c \
+ shrot8pack_180.c \
+ shrot8pack_270.c \
+ shrot8pack_90.c \
+ shrot8pack.c \
+ shrotate.c
+
diff --git a/xorg-server/os/WaitFor.c b/xorg-server/os/WaitFor.c
index da12976ca..0ce1db698 100644
--- a/xorg-server/os/WaitFor.c
+++ b/xorg-server/os/WaitFor.c
@@ -214,6 +214,12 @@ WaitForSomething(int *pClientsReady)
wt = &waittime;
}
}
+ if (!wt)
+ {
+ wt = &waittime;
+ waittime.tv_sec = 0;
+ waittime.tv_usec = 100;
+ }
XFD_COPYSET(&AllSockets, &LastSelectMask);
#ifdef SMART_SCHEDULE
}
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index e7ec60952..d32096704 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -945,6 +945,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
/* If we've arrived here, then the client is stuffed to the gills
and not ready to accept more. Make a note of it and buffer
the rest. */
+ errno=0;
FD_SET(connection, &ClientsWriteBlocked);
AnyClientsWriteBlocked = TRUE;
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index ee14624dc..282d2b97c 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -95,8 +95,14 @@ OR PERFORMANCE OF THIS SOFTWARE.
#ifdef WIN32
#include <process.h>
+#ifndef _MSC_VER
#define getpid(x) _getpid(x)
#endif
+#endif
+
+#ifdef _MSC_VER
+#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG)
+#endif
#ifdef DDXOSVERRORF
diff --git a/xorg-server/os/makefile b/xorg-server/os/makefile
new file mode 100644
index 000000000..cf9eaf53f
--- /dev/null
+++ b/xorg-server/os/makefile
@@ -0,0 +1,4 @@
+CSRCS=access.c auth.c backtrace.c connection.c io.c log.c mitauth.c os.c oscolor.c osinit.c rpcauth.c strlcat.c strlcpy.c utils.c WaitFor.c xdmauth.c xdmcp.c xprintf.c xstrans.c
+
+LIBRARY=libos
+
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index f58c76366..f2b54d8dc 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -56,6 +56,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#ifdef __CYGWIN__
#include <stdlib.h>
#include <signal.h>
+__stdcall unsigned long GetTickCount(void);
#endif
#if defined(WIN32) && !defined(__CYGWIN__)
@@ -517,7 +518,7 @@ GiveUp(int sig)
errno = olderrno;
}
-#if defined WIN32 && defined __MINGW32__
+#if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__)
_X_EXPORT CARD32
GetTimeInMillis (void)
{
@@ -1504,7 +1505,7 @@ XNFstrdup(const char *s)
#ifdef SMART_SCHEDULE
-#ifdef SIGVTALRM
+#if defined(SIGVTALRM) && !defined(__CYGWIN__)
#define SMART_SCHEDULE_POSSIBLE
#endif
@@ -1943,6 +1944,7 @@ Fclose(pointer iop)
*/
/* Consider LD* variables insecure? */
+#ifndef _MSC_VER
#ifndef REMOVE_ENV_LD
#define REMOVE_ENV_LD 1
#endif
@@ -1951,6 +1953,7 @@ Fclose(pointer iop)
#ifndef REMOVE_LONG_ENV
#define REMOVE_LONG_ENV 1
#endif
+#endif
/*
* Disallow stdout or stderr as pipes? It's possible to block the X server
diff --git a/xorg-server/os/xprintf.c b/xorg-server/os/xprintf.c
index 07eaa1f58..bf70661ac 100644
--- a/xorg-server/os/xprintf.c
+++ b/xorg-server/os/xprintf.c
@@ -39,7 +39,9 @@
# ifdef __va_copy
# define va_copy __va_copy
# else
+# ifndef _MSC_VER
# error "no working va_copy was found"
+# endif
# endif
#endif
@@ -48,11 +50,16 @@ Xvprintf(const char *format, va_list va)
{
char *ret;
int size;
+
+#ifdef _MSC_VER
+ size = vsnprintf(NULL, 0, format, va);
+#else
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
+#endif
ret = (char *)Xalloc(size + 1);
if (ret == NULL)
@@ -78,11 +85,16 @@ XNFvprintf(const char *format, va_list va)
{
char *ret;
int size;
+
+#ifdef _MSC_VER
+ size = vsnprintf(NULL, 0, format, va);
+#else
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
+#endif
ret = (char *)XNFalloc(size + 1);
if (ret == NULL)
diff --git a/xorg-server/os/xstrans.c b/xorg-server/os/xstrans.c
index c086e225b..86c8688da 100644
--- a/xorg-server/os/xstrans.c
+++ b/xorg-server/os/xstrans.c
@@ -5,4 +5,6 @@
#define TRANS_REOPEN
#define TRANS_SERVER
#define XSERV_t
+#define TCPCONN
+
#include <X11/Xtrans/transport.c>
diff --git a/xorg-server/protocol.txt b/xorg-server/protocol.txt
new file mode 100644
index 000000000..0a85ca872
--- /dev/null
+++ b/xorg-server/protocol.txt
@@ -0,0 +1,1066 @@
+# Registry of protocol names used by X Server
+# This will eventually be replaced by server-side XCB
+#
+# Format is Xnnn <extension-name>:<object-name>
+# R=Request, V=Event, E=Error
+#
+# This is a security-sensitive file, please set permissions as appropriate.
+#
+R001 Adobe-DPS-Extension:Init
+R002 Adobe-DPS-Extension:CreateContext
+R003 Adobe-DPS-Extension:CreateSpace
+R004 Adobe-DPS-Extension:GiveInput
+R005 Adobe-DPS-Extension:GetStatus
+R006 Adobe-DPS-Extension:DestroySpace
+R007 Adobe-DPS-Extension:Reset
+R008 Adobe-DPS-Extension:NotifyContext
+R009 Adobe-DPS-Extension:CreateContextFromID
+R010 Adobe-DPS-Extension:XIDFromContext
+R011 Adobe-DPS-Extension:ContextFromXID
+R012 Adobe-DPS-Extension:SetStatusMask
+R013 Adobe-DPS-Extension:CreateSecureContext
+R014 Adobe-DPS-Extension:NotifyWhenReady
+R000 Apple-DRI:QueryVersion
+R001 Apple-DRI:QueryDirectRenderingCapable
+R002 Apple-DRI:CreateSurface
+R003 Apple-DRI:DestroySurface
+R004 Apple-DRI:AuthConnection
+V000 Apple-DRI:ObsoleteEvent1
+V001 Apple-DRI:ObsoleteEvent2
+V002 Apple-DRI:ObsoleteEvent3
+V003 Apple-DRI:SurfaceNotify
+E000 Apple-DRI:ClientNotLocal
+E001 Apple-DRI:OperationNotSupported
+R000 Apple-WM:QueryVersion
+R001 Apple-WM:FrameGetRect
+R002 Apple-WM:FrameHitTest
+R003 Apple-WM:FrameDraw
+R004 Apple-WM:DisableUpdate
+R005 Apple-WM:ReenableUpdate
+R006 Apple-WM:SelectInput
+R007 Apple-WM:SetWindowMenuCheck
+R008 Apple-WM:SetFrontProcess
+R009 Apple-WM:SetWindowLevel
+R010 Apple-WM:SetCanQuit
+R011 Apple-WM:SetWindowMenu
+V000 Apple-WM:ControllerNotify
+V001 Apple-WM:ActivationNotify
+V002 Apple-WM:PasteboardNotify
+E000 Apple-WM:ClientNotLocal
+E001 Apple-WM:OperationNotSupported
+R000 BIG-REQUESTS:Enable
+R000 Composite:CompositeQueryVersion
+R001 Composite:CompositeRedirectWindow
+R002 Composite:CompositeRedirectSubwindows
+R003 Composite:CompositeUnredirectWindow
+R004 Composite:CompositeUnredirectSubwindows
+R005 Composite:CompositeCreateRegionFromBorderClip
+R006 Composite:CompositeNameWindowPixmap
+R007 Composite:CompositeGetOverlayWindow
+R008 Composite:CompositeReleaseOverlayWindow
+R000 DAMAGE:QueryVersion
+R001 DAMAGE:Create
+R002 DAMAGE:Destroy
+R003 DAMAGE:Subtract
+R004 DAMAGE:Add
+V000 DAMAGE:Notify
+E000 DAMAGE:BadDamage
+R000 DEC-XTRAP:Reset
+R001 DEC-XTRAP:GetAvailable
+R002 DEC-XTRAP:Config
+R003 DEC-XTRAP:StartTrap
+R004 DEC-XTRAP:StopTrap
+R005 DEC-XTRAP:GetCurrent
+R006 DEC-XTRAP:GetStatistics
+R007 DEC-XTRAP:SimulateXEvent
+R008 DEC-XTRAP:GetVersion
+R009 DEC-XTRAP:GetLastInpTime
+V000 DEC-XTRAP:Event
+E002 DEC-XTRAP:BadIO
+E004 DEC-XTRAP:BadStatistics
+E005 DEC-XTRAP:BadDevices
+E007 DEC-XTRAP:BadScreen
+E008 DEC-XTRAP:BadSwapReq
+R000 DMX:DMXQueryVersion
+R001 DMX:DMXGetScreenCount
+R002 DMX:DMXGetScreenInfoDEPRECATED
+R003 DMX:DMXGetWindowAttributes
+R004 DMX:DMXGetInputCount
+R005 DMX:DMXGetInputAttributes
+R006 DMX:DMXForceWindowCreationDEPRECATED
+R007 DMX:DMXReconfigureScreenDEPRECATED
+R008 DMX:DMXSync
+R009 DMX:DMXForceWindowCreation
+R010 DMX:DMXGetScreenAttributes
+R011 DMX:DMXChangeScreensAttributes
+R012 DMX:DMXAddScreen
+R013 DMX:DMXRemoveScreen
+R014 DMX:DMXGetDesktopAttributes
+R015 DMX:DMXChangeDesktopAttributes
+R016 DMX:DMXAddInput
+R017 DMX:DMXRemoveInput
+R000 DOUBLE-BUFFER:GetVersion
+R001 DOUBLE-BUFFER:AllocateBackBufferName
+R002 DOUBLE-BUFFER:DeallocateBackBufferName
+R003 DOUBLE-BUFFER:SwapBuffers
+R004 DOUBLE-BUFFER:BeginIdiom
+R005 DOUBLE-BUFFER:EndIdiom
+R006 DOUBLE-BUFFER:GetVisualInfo
+R007 DOUBLE-BUFFER:GetBackBufferAttributes
+E000 DOUBLE-BUFFER:BadBuffer
+R000 DPMS:GetVersion
+R001 DPMS:Capable
+R002 DPMS:GetTimeouts
+R003 DPMS:SetTimeouts
+R004 DPMS:Enable
+R005 DPMS:Disable
+R006 DPMS:ForceLevel
+R007 DPMS:Info
+R000 Extended-Visual-Information:QueryVersion
+R001 Extended-Visual-Information:GetVisualInfo
+R000 FontCache:QueryVersion
+R001 FontCache:GetCacheSettings
+R002 FontCache:ChangeCacheSettings
+R003 FontCache:GetCacheStatistics
+E000 FontCache:BadProtocol
+E001 FontCache:CannotAllocMemory
+R001 GLX:
+R002 GLX:Large
+R003 GLX:CreateContext
+R004 GLX:DestroyContext
+R005 GLX:MakeCurrent
+R006 GLX:IsDirect
+R007 GLX:QueryVersion
+R008 GLX:WaitGL
+R009 GLX:WaitX
+R010 GLX:CopyContext
+R011 GLX:SwapBuffers
+R012 GLX:UseXFont
+R013 GLX:CreateGLXPixmap
+R014 GLX:GetVisualConfigs
+R015 GLX:DestroyGLXPixmap
+R016 GLX:VendorPrivate
+R017 GLX:VendorPrivateWithReply
+R018 GLX:QueryExtensionsString
+R019 GLX:QueryServerString
+R020 GLX:ClientInfo
+R101 GLX:NewList
+R102 GLX:EndList
+R103 GLX:DeleteLists
+R104 GLX:GenLists
+R105 GLX:FeedbackBuffer
+R106 GLX:SelectBuffer
+R107 GLX:Mode
+R108 GLX:Finish
+R109 GLX:PixelStoref
+R110 GLX:PixelStorei
+R111 GLX:ReadPixels
+R112 GLX:GetBooleanv
+R113 GLX:GetClipPlane
+R114 GLX:GetDoublev
+R115 GLX:GetError
+R116 GLX:GetFloatv
+R117 GLX:GetIntegerv
+R118 GLX:GetLightfv
+R119 GLX:GetLightiv
+R120 GLX:GetMapdv
+R121 GLX:GetMapfv
+R122 GLX:GetMapiv
+R123 GLX:GetMaterialfv
+R124 GLX:GetMaterialiv
+R125 GLX:GetPixelfv
+R126 GLX:GetPixelMapuiv
+R127 GLX:GetPixelMapusv
+R128 GLX:GetPolygonStipple
+R129 GLX:GetString
+R130 GLX:GetTexEnvfv
+R131 GLX:GetTexEnviv
+R132 GLX:GetTexGendv
+R133 GLX:GetTexGenfv
+R134 GLX:GetTexGeniv
+R135 GLX:GetTexImage
+R136 GLX:GetTexParameterfv
+R137 GLX:GetTexParameteriv
+R138 GLX:GetTexLevelParameterfv
+R139 GLX:GetTexLevelParameteriv
+R140 GLX:IsEnabled
+R141 GLX:IsList
+R142 GLX:Flush
+E000 GLX:BadContext
+E001 GLX:BadContextState
+E002 GLX:BadDrawable
+E003 GLX:BadPixmap
+E004 GLX:BadContextTag
+E005 GLX:BadCurrentWindow
+E006 GLX:BadRenderRequest
+E007 GLX:BadLargeRequest
+E008 GLX:UnsupportedPrivateRequest
+R000 LBX:QueryVersion
+R001 LBX:StartProxy
+R002 LBX:StopProxy
+R003 LBX:Switch
+R004 LBX:NewClient
+R005 LBX:CloseClient
+R006 LBX:ModifySequence
+R007 LBX:AllowMotion
+R008 LBX:IncrementPixel
+R009 LBX:Delta
+R010 LBX:GetModifierMapping
+R011 LBX:QueryTag
+R012 LBX:InvalidateTag
+R013 LBX:PolyPoint
+R014 LBX:PolyLine
+R015 LBX:PolySegment
+R016 LBX:PolyRectangle
+R017 LBX:PolyArc
+R018 LBX:FillPoly
+R019 LBX:PolyFillRectangle
+R020 LBX:PolyFillArc
+R021 LBX:GetKeyboardMapping
+R022 LBX:QueryFont
+R023 LBX:ChangeProperty
+R024 LBX:GetProperty
+R025 LBX:TagData
+R026 LBX:CopyArea
+R027 LBX:CopyPlane
+R028 LBX:PolyText8
+R029 LBX:PolyText16
+R030 LBX:ImageText8
+R031 LBX:ImageText16
+R032 LBX:QueryExtension
+R033 LBX:PutImage
+R034 LBX:GetImage
+R035 LBX:BeginLargeRequest
+R036 LBX:LargeRequestData
+R037 LBX:EndLargeRequest
+R038 LBX:InternAtoms
+R039 LBX:GetWinAttrAndGeom
+R040 LBX:GrabCmap
+R041 LBX:ReleaseCmap
+R042 LBX:AllocColor
+R043 LBX:Sync
+E000 LBX:BadLbxClient
+R000 MIT-SCREEN-SAVER:QueryVersion
+R001 MIT-SCREEN-SAVER:QueryInfo
+R002 MIT-SCREEN-SAVER:SelectInput
+R003 MIT-SCREEN-SAVER:SetAttributes
+R004 MIT-SCREEN-SAVER:UnsetAttributes
+R005 MIT-SCREEN-SAVER:Suspend
+V000 MIT-SCREEN-SAVER:Notify
+R000 MIT-SHM:QueryVersion
+R001 MIT-SHM:Attach
+R002 MIT-SHM:Detach
+R003 MIT-SHM:PutImage
+R004 MIT-SHM:GetImage
+R005 MIT-SHM:CreatePixmap
+V000 MIT-SHM:Completion
+E000 MIT-SHM:BadShmSeg
+R000 MIT-SUNDRY-NONSTANDARD:SetBugMode
+R001 MIT-SUNDRY-NONSTANDARD:GetBugMode
+R000 Multi-Buffering:GetBufferVersion
+R001 Multi-Buffering:CreateImageBuffers
+R002 Multi-Buffering:DestroyImageBuffers
+R003 Multi-Buffering:DisplayImageBuffers
+R004 Multi-Buffering:SetMBufferAttributes
+R005 Multi-Buffering:GetMBufferAttributes
+R006 Multi-Buffering:SetBufferAttributes
+R007 Multi-Buffering:GetBufferAttributes
+R008 Multi-Buffering:GetBufferInfo
+R009 Multi-Buffering:CreateStereoWindow
+R010 Multi-Buffering:ClearImageBufferArea
+V000 Multi-Buffering:ClobberNotify
+V001 Multi-Buffering:UpdateNotify
+E000 Multi-Buffering:BadBuffer
+R000 RANDR:QueryVersion
+R001 RANDR:OldGetScreenInfo
+R002 RANDR:SetScreenConfig
+R003 RANDR:OldScreenChangeSelectInput
+R004 RANDR:SelectInput
+R005 RANDR:GetScreenInfo
+R006 RANDR:GetScreenSizeRange
+R007 RANDR:SetScreenSize
+R008 RANDR:GetScreenResources
+R009 RANDR:GetOutputInfo
+R010 RANDR:ListOutputProperties
+R011 RANDR:QueryOutputProperty
+R012 RANDR:ConfigureOutputProperty
+R013 RANDR:ChangeOutputProperty
+R014 RANDR:DeleteOutputProperty
+R015 RANDR:GetOutputProperty
+R016 RANDR:CreateMode
+R017 RANDR:DestroyMode
+R018 RANDR:AddOutputMode
+R019 RANDR:DeleteOutputMode
+R020 RANDR:GetCrtcInfo
+R021 RANDR:SetCrtcConfig
+R022 RANDR:GetCrtcGammaSize
+R023 RANDR:GetCrtcGamma
+R024 RANDR:SetCrtcGamma
+V000 RANDR:ScreenChangeNotify
+V001 RANDR:Notify
+E000 RANDR:BadRROutput
+E001 RANDR:BadRRCrtc
+E002 RANDR:BadRRMode
+R000 RECORD:QueryVersion
+R001 RECORD:CreateContext
+R002 RECORD:RegisterClients
+R003 RECORD:UnregisterClients
+R004 RECORD:GetContext
+R005 RECORD:EnableContext
+R006 RECORD:DisableContext
+R007 RECORD:FreeContext
+E000 RECORD:BadContext
+R000 RENDER:QueryVersion
+R001 RENDER:QueryPictFormats
+R002 RENDER:QueryPictIndexValues
+R003 RENDER:QueryDithers
+R004 RENDER:CreatePicture
+R005 RENDER:ChangePicture
+R006 RENDER:SetPictureClipRectangles
+R007 RENDER:FreePicture
+R008 RENDER:Composite
+R009 RENDER:Scale
+R010 RENDER:Trapezoids
+R011 RENDER:Triangles
+R012 RENDER:TriStrip
+R013 RENDER:TriFan
+R014 RENDER:ColorTrapezoids
+R015 RENDER:ColorTriangles
+R016 RENDER:Transform
+R017 RENDER:CreateGlyphSet
+R018 RENDER:ReferenceGlyphSet
+R019 RENDER:FreeGlyphSet
+R020 RENDER:AddGlyphs
+R021 RENDER:AddGlyphsFromPicture
+R022 RENDER:FreeGlyphs
+R023 RENDER:CompositeGlyphs8
+R024 RENDER:CompositeGlyphs16
+R025 RENDER:CompositeGlyphs32
+R026 RENDER:FillRectangles
+R027 RENDER:CreateCursor
+R028 RENDER:SetPictureTransform
+R029 RENDER:QueryFilters
+R030 RENDER:SetPictureFilter
+R031 RENDER:CreateAnimCursor
+R032 RENDER:AddTraps
+R033 RENDER:CreateSolidFill
+R034 RENDER:CreateLinearGradient
+R035 RENDER:CreateRadialGradient
+R036 RENDER:CreateConicalGradient
+E000 RENDER:BadPictFormat
+E001 RENDER:BadPicture
+E002 RENDER:BadPictOp
+E003 RENDER:BadGlyphSet
+E004 RENDER:BadGlyph
+R000 SECURITY:QueryVersion
+R001 SECURITY:GenerateAuthorization
+R002 SECURITY:RevokeAuthorization
+V000 SECURITY:AuthorizationRevoked
+E000 SECURITY:BadAuthorization
+E001 SECURITY:BadAuthorizationProtocol
+R000 SELinux:SELinuxQueryVersion
+R001 SELinux:SELinuxSetDeviceCreateContext
+R002 SELinux:SELinuxGetDeviceCreateContext
+R003 SELinux:SELinuxSetDeviceContext
+R004 SELinux:SELinuxGetDeviceContext
+R005 SELinux:SELinuxSetWindowCreateContext
+R006 SELinux:SELinuxGetWindowCreateContext
+R007 SELinux:SELinuxGetWindowContext
+R008 SELinux:SELinuxSetPropertyCreateContext
+R009 SELinux:SELinuxGetPropertyCreateContext
+R010 SELinux:SELinuxSetPropertyUseContext
+R011 SELinux:SELinuxGetPropertyUseContext
+R012 SELinux:SELinuxGetPropertyContext
+R013 SELinux:SELinuxGetPropertyDataContext
+R014 SELinux:SELinuxListProperties
+R015 SELinux:SELinuxSetSelectionCreateContext
+R016 SELinux:SELinuxGetSelectionCreateContext
+R017 SELinux:SELinuxSetSelectionUseContext
+R018 SELinux:SELinuxGetSelectionUseContext
+R019 SELinux:SELinuxGetSelectionContext
+R020 SELinux:SELinuxGetSelectionDataContext
+R021 SELinux:SELinuxListSelections
+R022 SELinux:SELinuxGetClientContext
+R000 SHAPE:QueryVersion
+R001 SHAPE:Rectangles
+R002 SHAPE:Mask
+R003 SHAPE:Combine
+R004 SHAPE:Offset
+R005 SHAPE:QueryExtents
+R006 SHAPE:SelectInput
+R007 SHAPE:InputSelected
+R008 SHAPE:GetRectangles
+V000 SHAPE:Notify
+R000 SYNC:Initialize
+R001 SYNC:ListSystemCounters
+R002 SYNC:CreateCounter
+R003 SYNC:SetCounter
+R004 SYNC:ChangeCounter
+R005 SYNC:QueryCounter
+R006 SYNC:DestroyCounter
+R007 SYNC:Await
+R008 SYNC:CreateAlarm
+R009 SYNC:ChangeAlarm
+R010 SYNC:QueryAlarm
+R011 SYNC:DestroyAlarm
+R012 SYNC:SetPriority
+R013 SYNC:GetPriority
+V000 SYNC:CounterNotify
+V001 SYNC:AlarmNotify
+E000 SYNC:BadCounter
+E001 SYNC:BadAlarm
+R000 TOG-CUP:QueryVersion
+R001 TOG-CUP:GetReservedColormapEntries
+R002 TOG-CUP:StoreColors
+R000 Windows-WM:QueryVersion
+R001 Windows-WM:FrameGetRect
+R002 Windows-WM:FrameDraw
+R003 Windows-WM:FrameSetTitle
+R004 Windows-WM:DisableUpdate
+R005 Windows-WM:ReenableUpdate
+R006 Windows-WM:SelectInput
+R007 Windows-WM:SetFrontProcess
+V000 Windows-WM:ControllerNotify
+V001 Windows-WM:ActivationNotify
+E000 Windows-WM:ClientNotLocal
+E001 Windows-WM:OperationNotSupported
+R000 X-Resource:QueryVersion
+R001 X-Resource:QueryClients
+R002 X-Resource:QueryClientResources
+R003 X-Resource:QueryClientPixmapBytes
+R001 X11:CreateWindow
+R002 X11:ChangeWindowAttributes
+R003 X11:GetWindowAttributes
+R004 X11:DestroyWindow
+R005 X11:DestroySubwindows
+R006 X11:ChangeSaveSet
+R007 X11:ReparentWindow
+R008 X11:MapWindow
+R009 X11:MapSubwindows
+R010 X11:UnmapWindow
+R011 X11:UnmapSubwindows
+R012 X11:ConfigureWindow
+R013 X11:CirculateWindow
+R014 X11:GetGeometry
+R015 X11:QueryTree
+R016 X11:InternAtom
+R017 X11:GetAtomName
+R018 X11:ChangeProperty
+R019 X11:DeleteProperty
+R020 X11:GetProperty
+R021 X11:ListProperties
+R022 X11:SetSelectionOwner
+R023 X11:GetSelectionOwner
+R024 X11:ConvertSelection
+R025 X11:SendEvent
+R026 X11:GrabPointer
+R027 X11:UngrabPointer
+R028 X11:GrabButton
+R029 X11:UngrabButton
+R030 X11:ChangeActivePointerGrab
+R031 X11:GrabKeyboard
+R032 X11:UngrabKeyboard
+R033 X11:GrabKey
+R034 X11:UngrabKey
+R035 X11:AllowEvents
+R036 X11:GrabServer
+R037 X11:UngrabServer
+R038 X11:QueryPointer
+R039 X11:GetMotionEvents
+R040 X11:TranslateCoords
+R041 X11:WarpPointer
+R042 X11:SetInputFocus
+R043 X11:GetInputFocus
+R044 X11:QueryKeymap
+R045 X11:OpenFont
+R046 X11:CloseFont
+R047 X11:QueryFont
+R048 X11:QueryTextExtents
+R049 X11:ListFonts
+R050 X11:ListFontsWithInfo
+R051 X11:SetFontPath
+R052 X11:GetFontPath
+R053 X11:CreatePixmap
+R054 X11:FreePixmap
+R055 X11:CreateGC
+R056 X11:ChangeGC
+R057 X11:CopyGC
+R058 X11:SetDashes
+R059 X11:SetClipRectangles
+R060 X11:FreeGC
+R061 X11:ClearArea
+R062 X11:CopyArea
+R063 X11:CopyPlane
+R064 X11:PolyPoint
+R065 X11:PolyLine
+R066 X11:PolySegment
+R067 X11:PolyRectangle
+R068 X11:PolyArc
+R069 X11:FillPoly
+R070 X11:PolyFillRectangle
+R071 X11:PolyFillArc
+R072 X11:PutImage
+R073 X11:GetImage
+R074 X11:PolyText8
+R075 X11:PolyText16
+R076 X11:ImageText8
+R077 X11:ImageText16
+R078 X11:CreateColormap
+R079 X11:FreeColormap
+R080 X11:CopyColormapAndFree
+R081 X11:InstallColormap
+R082 X11:UninstallColormap
+R083 X11:ListInstalledColormaps
+R084 X11:AllocColor
+R085 X11:AllocNamedColor
+R086 X11:AllocColorCells
+R087 X11:AllocColorPlanes
+R088 X11:FreeColors
+R089 X11:StoreColors
+R090 X11:StoreNamedColor
+R091 X11:QueryColors
+R092 X11:LookupColor
+R093 X11:CreateCursor
+R094 X11:CreateGlyphCursor
+R095 X11:FreeCursor
+R096 X11:RecolorCursor
+R097 X11:QueryBestSize
+R098 X11:QueryExtension
+R099 X11:ListExtensions
+R100 X11:ChangeKeyboardMapping
+R101 X11:GetKeyboardMapping
+R102 X11:ChangeKeyboardControl
+R103 X11:GetKeyboardControl
+R104 X11:Bell
+R105 X11:ChangePointerControl
+R106 X11:GetPointerControl
+R107 X11:SetScreenSaver
+R108 X11:GetScreenSaver
+R109 X11:ChangeHosts
+R110 X11:ListHosts
+R111 X11:SetAccessControl
+R112 X11:SetCloseDownMode
+R113 X11:KillClient
+R114 X11:RotateProperties
+R115 X11:ForceScreenSaver
+R116 X11:SetPointerMapping
+R117 X11:GetPointerMapping
+R118 X11:SetModifierMapping
+R119 X11:GetModifierMapping
+R127 X11:NoOperation
+V000 X11:X_Error
+V001 X11:X_Reply
+V002 X11:KeyPress
+V003 X11:KeyRelease
+V004 X11:ButtonPress
+V005 X11:ButtonRelease
+V006 X11:MotionNotify
+V007 X11:EnterNotify
+V008 X11:LeaveNotify
+V009 X11:FocusIn
+V010 X11:FocusOut
+V011 X11:KeymapNotify
+V012 X11:Expose
+V013 X11:GraphicsExpose
+V014 X11:NoExpose
+V015 X11:VisibilityNotify
+V016 X11:CreateNotify
+V017 X11:DestroyNotify
+V018 X11:UnmapNotify
+V019 X11:MapNotify
+V020 X11:MapRequest
+V021 X11:ReparentNotify
+V022 X11:ConfigureNotify
+V023 X11:ConfigureRequest
+V024 X11:GravityNotify
+V025 X11:ResizeRequest
+V026 X11:CirculateNotify
+V027 X11:CirculateRequest
+V028 X11:PropertyNotify
+V029 X11:SelectionClear
+V030 X11:SelectionRequest
+V031 X11:SelectionNotify
+V032 X11:ColormapNotify
+V033 X11:ClientMessage
+V034 X11:MappingNotify
+E000 X11:Success
+E001 X11:BadRequest
+E002 X11:BadValue
+E003 X11:BadWindow
+E004 X11:BadPixmap
+E005 X11:BadAtom
+E006 X11:BadCursor
+E007 X11:BadFont
+E008 X11:BadMatch
+E009 X11:BadDrawable
+E010 X11:BadAccess
+E011 X11:BadAlloc
+E012 X11:BadColor
+E013 X11:BadGC
+E014 X11:BadIDChoice
+E015 X11:BadName
+E016 X11:BadLength
+E017 X11:BadImplementation
+R001 X3D-PEX:GetExtensionInfo
+R002 X3D-PEX:GetEnumeratedTypeInfo
+R003 X3D-PEX:GetImpDepConstants
+R004 X3D-PEX:CreateLookupTable
+R005 X3D-PEX:CopyLookupTable
+R006 X3D-PEX:FreeLookupTable
+R007 X3D-PEX:GetTableInfo
+R008 X3D-PEX:GetPredefinedEntries
+R009 X3D-PEX:GetDefinedIndices
+R010 X3D-PEX:GetTableEntry
+R011 X3D-PEX:GetTableEntries
+R012 X3D-PEX:SetTableEntries
+R013 X3D-PEX:DeleteTableEntries
+R014 X3D-PEX:CreatePipelineContext
+R015 X3D-PEX:CopyPipelineContext
+R016 X3D-PEX:FreePipelineContext
+R017 X3D-PEX:GetPipelineContext
+R018 X3D-PEX:ChangePipelineContext
+R019 X3D-PEX:CreateRenderer
+R020 X3D-PEX:FreeRenderer
+R021 X3D-PEX:ChangeRenderer
+R022 X3D-PEX:GetRendererAttributes
+R023 X3D-PEX:GetRendererDynamics
+R024 X3D-PEX:BeginRendering
+R025 X3D-PEX:EndRendering
+R026 X3D-PEX:BeginStructure
+R027 X3D-PEX:EndStructure
+R028 X3D-PEX:OutputCommands
+R029 X3D-PEX:Network
+R030 X3D-PEX:CreateStructure
+R031 X3D-PEX:CopyStructure
+R032 X3D-PEX:DestroyStructures
+R033 X3D-PEX:GetStructureInfo
+R034 X3D-PEX:GetElementInfo
+R035 X3D-PEX:GetStructuresInNetwork
+R036 X3D-PEX:GetAncestors
+R037 X3D-PEX:GetDescendants
+R038 X3D-PEX:FetchElements
+R039 X3D-PEX:SetEditingMode
+R040 X3D-PEX:SetElementPointer
+R041 X3D-PEX:SetElementPointerAtLabel
+R042 X3D-PEX:ElementSearch
+R043 X3D-PEX:StoreElements
+R044 X3D-PEX:DeleteElements
+R045 X3D-PEX:DeleteElementsToLabel
+R046 X3D-PEX:DeleteBetweenLabels
+R047 X3D-PEX:CopyElements
+R048 X3D-PEX:ChangeStructureRefs
+R049 X3D-PEX:CreateNameSet
+R050 X3D-PEX:CopyNameSet
+R051 X3D-PEX:FreeNameSet
+R052 X3D-PEX:GetNameSet
+R053 X3D-PEX:ChangeNameSet
+R054 X3D-PEX:CreateSearchContext
+R055 X3D-PEX:CopySearchContext
+R056 X3D-PEX:FreeSearchContext
+R057 X3D-PEX:GetSearchContext
+R058 X3D-PEX:ChangeSearchContext
+R059 X3D-PEX:SearchNetwork
+R060 X3D-PEX:CreatePhigsWks
+R061 X3D-PEX:FreePhigsWks
+R062 X3D-PEX:GetWksInfo
+R063 X3D-PEX:GetDynamics
+R064 X3D-PEX:GetViewRep
+R065 X3D-PEX:RedrawAllStructures
+R066 X3D-PEX:UpdateWorkstation
+R067 X3D-PEX:RedrawClipRegion
+R068 X3D-PEX:ExecuteDeferredActions
+R069 X3D-PEX:SetViewPriority
+R070 X3D-PEX:SetDisplayUpdateMode
+R071 X3D-PEX:MapDCtoWC
+R072 X3D-PEX:MapWCtoDC
+R073 X3D-PEX:SetViewRep
+R074 X3D-PEX:SetWksWindow
+R075 X3D-PEX:SetWksViewport
+R076 X3D-PEX:SetHlhsrMode
+R077 X3D-PEX:SetWksBufferMode
+R078 X3D-PEX:PostStructure
+R079 X3D-PEX:UnpostStructure
+R080 X3D-PEX:UnpostAllStructures
+R081 X3D-PEX:GetWksPostings
+R082 X3D-PEX:GetPickDevice
+R083 X3D-PEX:ChangePickDevice
+R084 X3D-PEX:CreatePickMeasure
+R085 X3D-PEX:FreePickMeasure
+R086 X3D-PEX:GetPickMeasure
+R087 X3D-PEX:UpdatePickMeasure
+R088 X3D-PEX:OpenFont
+R089 X3D-PEX:CloseFont
+R090 X3D-PEX:QueryFont
+R091 X3D-PEX:ListFonts
+R092 X3D-PEX:ListFontsWithInfo
+R093 X3D-PEX:QueryTextExtents
+R094 X3D-PEX:MatchRenderingTargets
+R095 X3D-PEX:Escape
+R096 X3D-PEX:EscapeWithReply
+R097 X3D-PEX:Elements
+R098 X3D-PEX:AccumulateState
+R099 X3D-PEX:BeginPickOne
+R100 X3D-PEX:EndPickOne
+R101 X3D-PEX:PickOne
+R102 X3D-PEX:BeginPickAll
+R103 X3D-PEX:EndPickAll
+R104 X3D-PEX:PickAll
+E000 X3D-PEX:ColorTypeError
+E001 X3D-PEX:erStateError
+E002 X3D-PEX:FloatingPointFormatError
+E003 X3D-PEX:LabelError
+E004 X3D-PEX:LookupTableError
+E005 X3D-PEX:NameSetError
+E006 X3D-PEX:PathError
+E007 X3D-PEX:FontError
+E008 X3D-PEX:PhigsWksError
+E009 X3D-PEX:PickMeasureError
+E010 X3D-PEX:PipelineContextError
+E011 X3D-PEX:erError
+E012 X3D-PEX:SearchContextError
+E013 X3D-PEX:StructureError
+E014 X3D-PEX:OutputCommandError
+R000 XC-APPGROUP:QueryVersion
+R001 XC-APPGROUP:Create
+R002 XC-APPGROUP:Destroy
+R003 XC-APPGROUP:GetAttr
+R004 XC-APPGROUP:Query
+R005 XC-APPGROUP:CreateAssoc
+R006 XC-APPGROUP:DestroyAssoc
+E000 XC-APPGROUP:BadAppGroup
+R000 XC-MISC:GetVersion
+R001 XC-MISC:GetXIDRange
+R002 XC-MISC:GetXIDList
+R000 XEVIE:QueryVersion
+R001 XEVIE:Start
+R002 XEVIE:End
+R003 XEVIE:Send
+R004 XEVIE:SelectInput
+R000 XFIXES:QueryVersion
+R001 XFIXES:ChangeSaveSet
+R002 XFIXES:SelectSelectionInput
+R003 XFIXES:SelectCursorInput
+R004 XFIXES:GetCursorImage
+R005 XFIXES:CreateRegion
+R006 XFIXES:CreateRegionFromBitmap
+R007 XFIXES:CreateRegionFromWindow
+R008 XFIXES:CreateRegionFromGC
+R009 XFIXES:CreateRegionFromPicture
+R010 XFIXES:DestroyRegion
+R011 XFIXES:SetRegion
+R012 XFIXES:CopyRegion
+R013 XFIXES:UnionRegion
+R014 XFIXES:IntersectRegion
+R015 XFIXES:SubtractRegion
+R016 XFIXES:InvertRegion
+R017 XFIXES:TranslateRegion
+R018 XFIXES:RegionExtents
+R019 XFIXES:FetchRegion
+R020 XFIXES:SetGCClipRegion
+R021 XFIXES:SetWindowShapeRegion
+R022 XFIXES:SetPictureClipRegion
+R023 XFIXES:SetCursorName
+R024 XFIXES:GetCursorName
+R025 XFIXES:GetCursorImageAndName
+R026 XFIXES:ChangeCursor
+R027 XFIXES:ChangeCursorByName
+R028 XFIXES:ExpandRegion
+R029 XFIXES:HideCursor
+R030 XFIXES:ShowCursor
+V000 XFIXES:SelectionNotify
+V001 XFIXES:CursorNotify
+E000 XFIXES:BadRegion
+R000 XFree86-Bigfont:QueryVersion
+R001 XFree86-Bigfont:QueryFont
+R000 XFree86-DGA:QueryVersion
+R001 XFree86-DGA:GetVideoLL
+R002 XFree86-DGA:DirectVideo
+R003 XFree86-DGA:GetViewPortSize
+R004 XFree86-DGA:SetViewPort
+R005 XFree86-DGA:GetVidPage
+R006 XFree86-DGA:SetVidPage
+R007 XFree86-DGA:InstallColormap
+R008 XFree86-DGA:QueryDirectVideo
+R009 XFree86-DGA:ViewPortChanged
+R010 XFree86-DGA:Obsolete1
+R011 XFree86-DGA:Obsolete2
+R012 XFree86-DGA:QueryModes
+R013 XFree86-DGA:SetMode
+R014 XFree86-DGA:SetViewport
+R015 XFree86-DGA:InstallColormap
+R016 XFree86-DGA:SelectInput
+R017 XFree86-DGA:FillRectangle
+R018 XFree86-DGA:CopyArea
+R019 XFree86-DGA:CopyTransparentArea
+R020 XFree86-DGA:GetViewportStatus
+R021 XFree86-DGA:Sync
+R022 XFree86-DGA:OpenFramebuffer
+R023 XFree86-DGA:CloseFramebuffer
+R024 XFree86-DGA:SetClientVersion
+R025 XFree86-DGA:ChangePixmapMode
+R026 XFree86-DGA:CreateColormap
+E000 XFree86-DGA:ClientNotLocal
+E001 XFree86-DGA:NoDirectVideoMode
+E002 XFree86-DGA:ScreenNotActive
+E003 XFree86-DGA:DirectNotActivated
+E004 XFree86-DGA:OperationNotSupported
+R000 XFree86-DRI:QueryVersion
+R001 XFree86-DRI:QueryDirectRenderingCapable
+R002 XFree86-DRI:OpenConnection
+R003 XFree86-DRI:CloseConnection
+R004 XFree86-DRI:GetClientDriverName
+R005 XFree86-DRI:CreateContext
+R006 XFree86-DRI:DestroyContext
+R007 XFree86-DRI:CreateDrawable
+R008 XFree86-DRI:DestroyDrawable
+R009 XFree86-DRI:GetDrawableInfo
+R010 XFree86-DRI:GetDeviceInfo
+R011 XFree86-DRI:AuthConnection
+R012 XFree86-DRI:OpenFullScreen
+R013 XFree86-DRI:CloseFullScreen
+E000 XFree86-DRI:ClientNotLocal
+E001 XFree86-DRI:OperationNotSupported
+R000 XFree86-Misc:QueryVersion
+R001 XFree86-Misc:GetSaver
+R002 XFree86-Misc:SetSaver
+R003 XFree86-Misc:GetMouseSettings
+R004 XFree86-Misc:GetKbdSettings
+R005 XFree86-Misc:SetMouseSettings
+R006 XFree86-Misc:SetKbdSettings
+R007 XFree86-Misc:SetGrabKeysState
+R008 XFree86-Misc:SetClientVersion
+R009 XFree86-Misc:GetFilePaths
+R010 XFree86-Misc:PassMessage
+E000 XFree86-Misc:BadMouseProtocol
+E001 XFree86-Misc:BadMouseBaudRate
+E002 XFree86-Misc:BadMouseFlags
+E003 XFree86-Misc:BadMouseCombo
+E004 XFree86-Misc:BadKbdType
+E005 XFree86-Misc:ModInDevDisabled
+E006 XFree86-Misc:ModInDevClientNotLocal
+E007 XFree86-Misc:NoModule
+R000 XFree86-VidModeExtension:QueryVersion
+R001 XFree86-VidModeExtension:GetModeLine
+R002 XFree86-VidModeExtension:ModModeLine
+R003 XFree86-VidModeExtension:SwitchMode
+R004 XFree86-VidModeExtension:GetMonitor
+R005 XFree86-VidModeExtension:LockModeSwitch
+R006 XFree86-VidModeExtension:GetAllModeLines
+R007 XFree86-VidModeExtension:AddModeLine
+R008 XFree86-VidModeExtension:DeleteModeLine
+R009 XFree86-VidModeExtension:ValidateModeLine
+R010 XFree86-VidModeExtension:SwitchToMode
+R011 XFree86-VidModeExtension:GetViewPort
+R012 XFree86-VidModeExtension:SetViewPort
+R013 XFree86-VidModeExtension:GetDotClocks
+R014 XFree86-VidModeExtension:SetClientVersion
+R015 XFree86-VidModeExtension:SetGamma
+R016 XFree86-VidModeExtension:GetGamma
+R017 XFree86-VidModeExtension:GetGammaRamp
+R018 XFree86-VidModeExtension:SetGammaRamp
+R019 XFree86-VidModeExtension:GetGammaRampSize
+R020 XFree86-VidModeExtension:GetPermissions
+V000 XFree86-VidModeExtension:Notify
+E000 XFree86-VidModeExtension:BadClock
+E001 XFree86-VidModeExtension:BadHTimings
+E002 XFree86-VidModeExtension:BadVTimings
+E003 XFree86-VidModeExtension:ModeUnsuitable
+E004 XFree86-VidModeExtension:ExtensionDisabled
+E005 XFree86-VidModeExtension:ClientNotLocal
+E006 XFree86-VidModeExtension:ZoomLocked
+R001 XIE:QueryImageExtension
+R002 XIE:QueryTechniques
+R003 XIE:CreateColorList
+R004 XIE:DestroyColorList
+R005 XIE:PurgeColorList
+R006 XIE:QueryColorList
+R007 XIE:CreateLUT
+R008 XIE:DestroyLUT
+R009 XIE:CreatePhotomap
+R010 XIE:DestroyPhotomap
+R011 XIE:QueryPhotomap
+R012 XIE:CreateROI
+R013 XIE:DestroyROI
+R014 XIE:CreatePhotospace
+R015 XIE:DestroyPhotospace
+R016 XIE:ExecuteImmediate
+R017 XIE:CreatePhotoflo
+R018 XIE:DestroyPhotoflo
+R019 XIE:ExecutePhotoflo
+R020 XIE:ModifyPhotoflo
+R021 XIE:RedefinePhotoflo
+R022 XIE:PutClientData
+R023 XIE:GetClientData
+R024 XIE:QueryPhotoflo
+R025 XIE:Await
+R026 XIE:Abort
+E000 XIE:ColorListError
+E001 XIE:LUTError
+E002 XIE:PhotofloError
+E003 XIE:PhotomapError
+E004 XIE:PhotospaceError
+E005 XIE:ROIError
+E006 XIE:FloError
+R000 XINERAMA:QueryVersion
+R001 XINERAMA:GetState
+R002 XINERAMA:GetScreenCount
+R003 XINERAMA:GetScreenSize
+R004 XINERAMA:IsActive
+R005 XINERAMA:QueryScreens
+R001 XInputExtension:GetExtensionVersion
+R002 XInputExtension:ListInputDevices
+R003 XInputExtension:OpenDevice
+R004 XInputExtension:CloseDevice
+R005 XInputExtension:SetDeviceMode
+R006 XInputExtension:SelectExtensionEvent
+R007 XInputExtension:GetSelectedExtensionEvents
+R008 XInputExtension:ChangeDeviceDontPropagateList
+R009 XInputExtension:GetDeviceDontPropagageList
+R010 XInputExtension:GetDeviceMotionEvents
+R011 XInputExtension:ChangeKeyboardDevice
+R012 XInputExtension:ChangePointerDevice
+R013 XInputExtension:GrabDevice
+R014 XInputExtension:UngrabDevice
+R015 XInputExtension:GrabDeviceKey
+R016 XInputExtension:UngrabDeviceKey
+R017 XInputExtension:GrabDeviceButton
+R018 XInputExtension:UngrabDeviceButton
+R019 XInputExtension:AllowDeviceEvents
+R020 XInputExtension:GetDeviceFocus
+R021 XInputExtension:SetDeviceFocus
+R022 XInputExtension:GetFeedbackControl
+R023 XInputExtension:ChangeFeedbackControl
+R024 XInputExtension:GetDeviceKeyMapping
+R025 XInputExtension:ChangeDeviceKeyMapping
+R026 XInputExtension:GetDeviceModifierMapping
+R027 XInputExtension:SetDeviceModifierMapping
+R028 XInputExtension:GetDeviceButtonMapping
+R029 XInputExtension:SetDeviceButtonMapping
+R030 XInputExtension:QueryDeviceState
+R031 XInputExtension:SendExtensionEvent
+R032 XInputExtension:DeviceBell
+R033 XInputExtension:SetDeviceValuators
+R034 XInputExtension:GetDeviceControl
+R035 XInputExtension:ChangeDeviceControl
+V000 XInputExtension:DeviceValuator
+V001 XInputExtension:DeviceKeyPress
+V002 XInputExtension:DeviceKeyRelease
+V003 XInputExtension:DeviceButtonPress
+V004 XInputExtension:DeviceButtonRelease
+V005 XInputExtension:DeviceMotionNotify
+V006 XInputExtension:DeviceFocusIn
+V007 XInputExtension:DeviceFocusOut
+V008 XInputExtension:ProximityIn
+V009 XInputExtension:ProximityOut
+V010 XInputExtension:DeviceStateNotify
+V011 XInputExtension:DeviceMappingNotify
+V012 XInputExtension:ChangeDeviceNotify
+V013 XInputExtension:DeviceKeystateNotify
+V014 XInputExtension:DeviceButtonstateNotify
+V015 XInputExtension:DevicePresenceNotify
+E000 XInputExtension:BadDevice
+E001 XInputExtension:BadEvent
+E002 XInputExtension:BadMode
+E003 XInputExtension:DeviceBusy
+E004 XInputExtension:BadClass
+R000 XKEYBOARD:UseExtension
+R001 XKEYBOARD:SelectEvents
+R002 XKEYBOARD:Obsolete
+R003 XKEYBOARD:Bell
+R004 XKEYBOARD:GetState
+R005 XKEYBOARD:LatchLockState
+R006 XKEYBOARD:GetControls
+R007 XKEYBOARD:SetControls
+R008 XKEYBOARD:GetMap
+R009 XKEYBOARD:SetMap
+R010 XKEYBOARD:GetCompatMap
+R011 XKEYBOARD:SetCompatMap
+R012 XKEYBOARD:GetIndicatorState
+R013 XKEYBOARD:GetIndicatorMap
+R014 XKEYBOARD:SetIndicatorMap
+R015 XKEYBOARD:GetNamedIndicator
+R016 XKEYBOARD:SetNamedIndicator
+R017 XKEYBOARD:GetNames
+R018 XKEYBOARD:SetNames
+R019 XKEYBOARD:GetGeometry
+R020 XKEYBOARD:SetGeometry
+R021 XKEYBOARD:PerClientFlags
+R022 XKEYBOARD:ListComponents
+R023 XKEYBOARD:GetKbdByName
+R024 XKEYBOARD:GetDeviceInfo
+R025 XKEYBOARD:SetDeviceInfo
+R101 XKEYBOARD:SetDebuggingFlags
+V000 XKEYBOARD:EventCode
+E000 XKEYBOARD:BadKeyboard
+R000 XTEST:GetVersion
+R001 XTEST:CompareCursor
+R002 XTEST:FakeInput
+R003 XTEST:GrabControl
+R000 XVideo:QueryExtension
+R001 XVideo:QueryAdaptors
+R002 XVideo:QueryEncodings
+R003 XVideo:GrabPort
+R004 XVideo:UngrabPort
+R005 XVideo:PutVideo
+R006 XVideo:PutStill
+R007 XVideo:GetVideo
+R008 XVideo:GetStill
+R009 XVideo:StopVideo
+R010 XVideo:SelectVideoNotify
+R011 XVideo:SelectPortNotify
+R012 XVideo:QueryBestSize
+R013 XVideo:SetPortAttribute
+R014 XVideo:GetPortAttribute
+R015 XVideo:QueryPortAttributes
+R016 XVideo:ListImageFormats
+R017 XVideo:QueryImageAttributes
+R018 XVideo:PutImage
+R019 XVideo:ShmPutImage
+V000 XVideo:VideoNotify
+V001 XVideo:PortNotify
+E000 XVideo:BadPort
+E001 XVideo:BadEncoding
+E002 XVideo:BadControl
+R000 XVideo-MotionCompensation:QueryVersion
+R001 XVideo-MotionCompensation:ListSurfaceTypes
+R002 XVideo-MotionCompensation:CreateContext
+R003 XVideo-MotionCompensation:DestroyContext
+R004 XVideo-MotionCompensation:CreateSurface
+R005 XVideo-MotionCompensation:DestroySurface
+R006 XVideo-MotionCompensation:CreateSubpicture
+R007 XVideo-MotionCompensation:DestroySubpicture
+R008 XVideo-MotionCompensation:ListSubpictureTypes
+R009 XVideo-MotionCompensation:GetDRInfo
+E000 XVideo-MotionCompensation:BadContext
+E001 XVideo-MotionCompensation:BadSurface
+E002 XVideo-MotionCompensation:BadSubpicture
+R000 XpExtension:QueryVersion
+R001 XpExtension:GetPrinterList
+R002 XpExtension:CreateContext
+R003 XpExtension:SetContext
+R004 XpExtension:GetContext
+R005 XpExtension:DestroyContext
+R006 XpExtension:GetContextScreen
+R007 XpExtension:StartJob
+R008 XpExtension:EndJob
+R009 XpExtension:StartDoc
+R010 XpExtension:EndDoc
+R011 XpExtension:PutDocumentData
+R012 XpExtension:GetDocumentData
+R013 XpExtension:StartPage
+R014 XpExtension:EndPage
+R015 XpExtension:SelectInput
+R016 XpExtension:InputSelected
+R017 XpExtension:GetAttributes
+R018 XpExtension:SetAttributes
+R019 XpExtension:GetOneAttribute
+R020 XpExtension:RehashPrinterList
+R021 XpExtension:GetPageDimensions
+R022 XpExtension:QueryScreens
+R023 XpExtension:SetImageResolution
+R024 XpExtension:GetImageResolution
+V000 XpExtension:PrintNotify
+V001 XpExtension:AttributeNotify
+E000 XpExtension:BadContext
+E001 XpExtension:BadSequence
+E002 XpExtension:BadResourceID
diff --git a/xorg-server/randr/makefile b/xorg-server/randr/makefile
new file mode 100644
index 000000000..ea6fa3fde
--- /dev/null
+++ b/xorg-server/randr/makefile
@@ -0,0 +1,4 @@
+CSRCS=mirandr.c randr.c rrcrtc.c rrdispatch.c rrinfo.c rrmode.c rroutput.c rrpointer.c rrproperty.c rrscreen.c rrsdispatch.c
+
+LIBRARY=librandr
+
diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c
index 1ecde31a2..af456e93a 100644
--- a/xorg-server/randr/rroutput.c
+++ b/xorg-server/randr/rroutput.c
@@ -23,6 +23,11 @@
#include "randrstr.h"
#include "registry.h"
+/* From render.h */
+#ifndef SubPixelUnknown
+#define SubPixelUnknown 0
+#endif
+
RESTYPE RROutputType;
/*
diff --git a/xorg-server/randr/rrscreen.c b/xorg-server/randr/rrscreen.c
index f39197337..e357189ca 100644
--- a/xorg-server/randr/rrscreen.c
+++ b/xorg-server/randr/rrscreen.c
@@ -22,6 +22,11 @@
#include "randrstr.h"
+/* From render.h */
+#ifndef SubPixelUnknown
+#define SubPixelUnknown 0
+#endif
+
extern char *ConnectionInfo;
static int padlength[4] = {0, 3, 2, 1};
diff --git a/xorg-server/record/makefile b/xorg-server/record/makefile
new file mode 100644
index 000000000..1cef2de18
--- /dev/null
+++ b/xorg-server/record/makefile
@@ -0,0 +1,4 @@
+CSRCS = record.c set.c
+
+LIBRARY=librecord
+
diff --git a/xorg-server/render/makefile b/xorg-server/render/makefile
new file mode 100644
index 000000000..1490c7c59
--- /dev/null
+++ b/xorg-server/render/makefile
@@ -0,0 +1,4 @@
+CSRCS=animcur.c filter.c glyph.c miindex.c mipict.c mirect.c mitrap.c mitri.c picture.c render.c renderedge.c
+
+LIBRARY=librender
+
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c
index 87dccbbda..dde4134fb 100644
--- a/xorg-server/render/mipict.c
+++ b/xorg-server/render/mipict.c
@@ -266,7 +266,7 @@ miChangePictureFilter (PicturePtr pPicture,
#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
-static inline pixman_bool_t
+static __inline pixman_bool_t
miClipPictureReg (pixman_region16_t * pRegion,
pixman_region16_t * pClip,
int dx,
diff --git a/xorg-server/startmulti.bat b/xorg-server/startmulti.bat
new file mode 100644
index 000000000..1f9d4980a
--- /dev/null
+++ b/xorg-server/startmulti.bat
@@ -0,0 +1 @@
+vcxsrv :1 -ac -terminate -lesspointer -multiwindow -clipboard +kb
diff --git a/xorg-server/startxdmcp.bat b/xorg-server/startxdmcp.bat
new file mode 100644
index 000000000..0f4c2485f
--- /dev/null
+++ b/xorg-server/startxdmcp.bat
@@ -0,0 +1,2 @@
+vcxsrv :1 -query 192.168.37.20 -clipboard -ac -xkblayout be -logverbose 3
+
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index d51251f19..ba2e36775 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -42,6 +42,8 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define XFIXES
#endif
#include "xfixesint.h"
diff --git a/xorg-server/xfixes/makefile b/xorg-server/xfixes/makefile
new file mode 100644
index 000000000..73df36c4e
--- /dev/null
+++ b/xorg-server/xfixes/makefile
@@ -0,0 +1,9 @@
+CSRCS = cursor.c \
+ region.c \
+ saveset.c \
+ select.c \
+ xfixes.c
+
+LIBRARY=libxfixes
+
+
diff --git a/xorg-server/xkb/makefile b/xorg-server/xkb/makefile
new file mode 100644
index 000000000..dc1b559e0
--- /dev/null
+++ b/xorg-server/xkb/makefile
@@ -0,0 +1,47 @@
+DEFINES += HAVE_XKB_CONFIG_H
+
+DDX_SRCS = \
+ ddxBeep.c \
+ ddxCtrls.c \
+ ddxFakeBtn.c \
+ ddxFakeMtn.c \
+ ddxInit.c \
+ ddxKeyClick.c \
+ ddxLEDs.c \
+ ddxLoad.c \
+ ddxList.c \
+ ddxDevBtn.c
+
+DIX_SRCS = \
+ xkb.c \
+ xkbUtils.c \
+ xkbEvents.c \
+ xkbAccessX.c \
+ xkbSwap.c \
+ xkbLEDs.c \
+ xkbInit.c \
+ xkbActions.c \
+ xkbPrKeyEv.c
+
+# this should be replaced by a common library or something, ideally -d
+XKBFILE_SRCS = \
+ maprules.c \
+ xkmread.c \
+ xkbtext.c \
+ xkbfmisc.c \
+ xkbout.c
+
+X11_SRCS = \
+ XKBMisc.c \
+ XKBAlloc.c \
+ XKBGAlloc.c \
+ XKBMAlloc.c
+
+# ends up unused...
+# XI_SRCS = xkbPrOtherEv.c
+
+CSRCS = $(DDX_SRCS) $(DIX_SRCS) $(XI_SRCS) $(XKBFILE_SRCS) \
+ $(X11_SRCS) ddxVT.c ddxPrivate.c ddxKillSrv.c
+
+LIBRARY=libxkb
+
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 7c569d483..4850a50de 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -5579,6 +5579,8 @@ ProcXkbGetKbdByName(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess;
+ memset(&mrep,0,sizeof(mrep)); //MH
+
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode);
xkb = dev->key->xkbInfo->desc;
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c
index 8c72874df..0b7e03032 100644
--- a/xorg-server/xkb/xkbActions.c
+++ b/xorg-server/xkb/xkbActions.c
@@ -1031,15 +1031,15 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
DeviceIntPtr dev;
int button;
- if (dev == inputInfo.keyboard)
- return 0;
-
if (filter->keycode==0) { /* initial press */
_XkbLookupButtonDevice(&dev, pAction->devbtn.device, serverClient,
DixUnknownAccess, &button);
if (!dev || !dev->public.on || dev == inputInfo.pointer)
return 1;
+ if (dev == inputInfo.keyboard)
+ return 0;
+
button= pAction->devbtn.button;
if ((button<1)||(button>dev->button->numButtons))
return 1;
diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c
index 3b47396e5..c1be14c8e 100644
--- a/xorg-server/xkb/xkbInit.c
+++ b/xorg-server/xkb/xkbInit.c
@@ -35,7 +35,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <math.h>
#define NEED_EVENTS 1
#include <X11/X.h>
@@ -95,10 +97,10 @@ typedef struct _SrvXkmInfo {
/***====================================================================***/
#ifndef XKB_BASE_DIRECTORY
-#define XKB_BASE_DIRECTORY "/usr/lib/X11/xkb"
+#define XKB_BASE_DIRECTORY "xkbdata"
#endif
#ifndef XKB_BIN_DIRECTORY
-#define XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY
+#define XKB_BIN_DIRECTORY "."
#endif
#ifndef XKB_DFLT_RULES_FILE
#define XKB_DFLT_RULES_FILE "rules"
diff --git a/xorg-server/xkbdata.src/compat/makefile b/xorg-server/xkbdata.src/compat/makefile
new file mode 100644
index 000000000..0598a1fd9
--- /dev/null
+++ b/xorg-server/xkbdata.src/compat/makefile
@@ -0,0 +1,33 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=compat
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+dist_xkbdata_compat_DATA = \
+ accessx \
+ basic \
+ complete \
+ default \
+ iso9995 \
+ japan \
+ keypad \
+ ledcaps \
+ lednum \
+ ledscroll \
+ misc \
+ mousekeys \
+ norepeat \
+ pc \
+ pc98 \
+ README \
+ xfree86 \
+ xtest
+
+DATA_FILES=$(dist_xkbdata_compat_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/geometry/makefile b/xorg-server/xkbdata.src/geometry/makefile
new file mode 100644
index 000000000..0c8e83bfb
--- /dev/null
+++ b/xorg-server/xkbdata.src/geometry/makefile
@@ -0,0 +1,41 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=geometry
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+dist_xkbdata_geometry_DATA = \
+ amiga \
+ ataritt \
+ chicony \
+ dell \
+ everex \
+ fujitsu \
+ hp \
+ keytronic \
+ kinesis \
+ macintosh \
+ microsoft \
+ nec \
+ northgate \
+ pc \
+ README \
+ sony \
+ sun \
+ winbook
+
+DATA_FILES=$(dist_xkbdata_geometry_DATA:%=$(DESTDIR)\%)
+
+SUBDIRS = digital ibm sgi
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+.PHONY: extrastuff
+
+extrastuff: $(SUBDIRS:%=%\all)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/keycodes/makefile b/xorg-server/xkbdata.src/keycodes/makefile
new file mode 100644
index 000000000..880881042
--- /dev/null
+++ b/xorg-server/xkbdata.src/keycodes/makefile
@@ -0,0 +1,36 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=keycodes
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+SUBDIRS = digital sgi
+
+dist_xkbdata_keycodes_DATA = \
+ aliases \
+ amiga \
+ ataritt \
+ fujitsu \
+ hp \
+ ibm \
+ macintosh \
+ powerpcps2 \
+ README \
+ sony \
+ sun \
+ xfree86 \
+ xfree98
+
+DATA_FILES=$(dist_xkbdata_keycodes_DATA:%=$(DESTDIR)\%)
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+.PHONY: extrastuff
+
+extrastuff: $(SUBDIRS:%=%\all)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/keymap/makefile b/xorg-server/xkbdata.src/keymap/makefile
new file mode 100644
index 000000000..0cb723e11
--- /dev/null
+++ b/xorg-server/xkbdata.src/keymap/makefile
@@ -0,0 +1,30 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=keymap
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+SUBDIRS = sun digital sgi
+
+dist_xkbdata_keymap_DATA = \
+ amiga \
+ ataritt \
+ macintosh \
+ README \
+ sony \
+ xfree86 \
+ xfree98
+
+DATA_FILES=$(dist_xkbdata_keymap_DATA:%=$(DESTDIR)\%)
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+.PHONY: extrastuff
+
+extrastuff: $(SUBDIRS:%=%\all)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/makefile b/xorg-server/xkbdata.src/makefile
new file mode 100644
index 000000000..1e3855fa4
--- /dev/null
+++ b/xorg-server/xkbdata.src/makefile
@@ -0,0 +1,9 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+SUBDIRS = semantics keycodes keymap compat geometry torture symbols rules types
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+all: $(SUBDIRS:%=%\all)
diff --git a/xorg-server/xkbdata.src/rules/makefile b/xorg-server/xkbdata.src/rules/makefile
new file mode 100644
index 000000000..e130c3a7b
--- /dev/null
+++ b/xorg-server/xkbdata.src/rules/makefile
@@ -0,0 +1,26 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\rules
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+dist_xkbdata_rules_DATA = \
+ README \
+ sgi \
+ sgi.lst \
+ sun \
+ sun.lst \
+ xfree98 \
+ xfree98.lst \
+ xkb.dtd \
+ xml2lst.pl \
+ xorg \
+ xorg-it.lst \
+ xorg.lst \
+ xorg.xml
+
+DATA_FILES=$(dist_xkbdata_rules_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/semantics/makefile b/xorg-server/xkbdata.src/semantics/makefile
new file mode 100644
index 000000000..806ca60f4
--- /dev/null
+++ b/xorg-server/xkbdata.src/semantics/makefile
@@ -0,0 +1,19 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=semantics
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+dist_xkbdata_semantics_DATA = \
+ basic \
+ complete \
+ default \
+ xtest
+
+DATA_FILES=$(dist_xkbdata_semantics_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/makefile b/xorg-server/xkbdata.src/symbols/makefile
new file mode 100644
index 000000000..82bdbea58
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/makefile
@@ -0,0 +1,136 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=symbols
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+SUBDIRS = pc macintosh sun fujitsu nec digital hp sgi sony xfree68
+
+dist_xkbdata_symbols_DATA = \
+ al \
+ altwin \
+ am \
+ apple \
+ ar \
+ az \
+ be \
+ ben \
+ bg \
+ br \
+ bs \
+ by \
+ ca \
+ ca_enhanced \
+ capslock \
+ compose \
+ ctrl \
+ cz \
+ cz_qwerty \
+ czsk \
+ de \
+ de_CH \
+ dev \
+ dk \
+ dvorak \
+ ee \
+ el \
+ en_US \
+ es \
+ eurosign \
+ fi \
+ fo \
+ fr \
+ fr_CH \
+ gb \
+ ge_la \
+ ge_ru \
+ group \
+ guj \
+ gur \
+ hr \
+ hr_US \
+ hu \
+ hu_qwerty \
+ hu_US \
+ ie \
+ il \
+ il_phonetic \
+ inet \
+ ir \
+ is \
+ iso9995-3 \
+ it \
+ iu \
+ jp \
+ kan \
+ keypad \
+ la \
+ level3 \
+ lo \
+ lock \
+ lt \
+ lt_a \
+ lt_p \
+ lt_std \
+ lv \
+ mk \
+ ml \
+ mm \
+ mn \
+ mt \
+ mt_us \
+ nl \
+ no \
+ ogham \
+ ori \
+ pc104 \
+ pl \
+ pl2 \
+ pt \
+ ralt \
+ README \
+ ro \
+ ro2 \
+ ru \
+ sapmi \
+ se \
+ se_FI \
+ se_NO \
+ se_SE \
+ si \
+ sk \
+ sk_qwerty \
+ sr \
+ srvr_ctrl \
+ syr \
+ syr_phonetic \
+ tel \
+ th \
+ th_pat \
+ th_tis \
+ tj \
+ tml \
+ tr \
+ tr_f \
+ ua \
+ us \
+ us_group2 \
+ us_group3 \
+ us_intl \
+ uz \
+ vn \
+ yu
+
+DATA_FILES=$(dist_xkbdata_symbols_DATA:%=$(DESTDIR)\%)
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+.PHONY: extrastuff
+
+extrastuff: $(SUBDIRS:%=%\all)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/types/makefile b/xorg-server/xkbdata.src/types/makefile
new file mode 100644
index 000000000..98271716a
--- /dev/null
+++ b/xorg-server/xkbdata.src/types/makefile
@@ -0,0 +1,26 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=types
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+$(DESTDIR):
+ if not isdir "$(DESTDIR)" mkdir /s "$(DESTDIR)"
+
+dist_xkbdata_types_DATA = \
+ basic \
+ cancel \
+ caps \
+ complete \
+ default \
+ extra \
+ iso9995 \
+ mousekeys \
+ numpad \
+ pc \
+ README
+
+DATA_FILES=$(dist_xkbdata_types_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/xkbrules.mak b/xorg-server/xkbdata.src/xkbrules.mak
new file mode 100644
index 000000000..e13c0a28b
--- /dev/null
+++ b/xorg-server/xkbdata.src/xkbrules.mak
@@ -0,0 +1,14 @@
+DIRFILE=$(THISDIR:%=$(DESTDIR)\..\%.dir)
+all: $(DESTDIR) $(DATA_FILES) $(DIRFILE)
+
+$(DESTDIR)\default: default
+ copy $< $@
+
+$(DESTDIR)\%: %
+ copy $< $@
+
+ifneq ($(DIRFILE),)
+$(DIRFILE): extrastuff $(DATA_FILES)
+ -del -e $@
+ cd $(DESTDIR) & ..\..\xkbcomp.exe -lfhlpR -o $(relpath $@) *
+endif
diff --git a/xorg-server/xwin.rc b/xorg-server/xwin.rc
new file mode 100644
index 000000000..cbe5244e9
--- /dev/null
+++ b/xorg-server/xwin.rc
@@ -0,0 +1,106 @@
+/*
+ *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) 2008 Yaakov Selkowitz 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 HAROLD L HUNT II 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 names of the authors
+ *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 authors.
+ *
+ * Authors: Harold L Hunt II, Yaakov Selkowitz
+ */
+
+#include <windows.h>
+#include "winresource.h"
+#include "xwin-config.h"
+
+/*
+ * Dialogs
+ */
+
+/* About */
+ABOUT_BOX DIALOGEX 32, 32, 260, 95
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
+CAPTION "About XSrv"
+FONT 8, "MS Shell Dlg 2"
+BEGIN
+ CONTROL IDI_XWIN, IDC_STATIC, "Static", SS_ICON, 8, 8, 32, 32
+ LTEXT "XSrv X Server ", IDC_STATIC, 36, 8, 220, 8
+ LTEXT "Version 0.0 (1 Jan 2009)", IDC_STATIC, 36, 18, 220, 8
+ LTEXT "This product is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 38, 220, 20
+ CONTROL __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button",
+ BS_OWNERDRAW | WS_TABSTOP, 36, 58, 68, 8
+ DEFPUSHBUTTON "OK", IDOK, 105, 75, 50, 15
+END
+
+
+/* Depth change */
+
+DEPTH_CHANGE_BOX DIALOGEX 32, 32, 180, 100
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE
+FONT 8, "MS Shell Dlg 2"
+CAPTION "XSrv"
+BEGIN
+ DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
+ CTEXT "VCXSrv", IDC_STATIC, 40, 12, 100, 8
+ CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
+ CTEXT "Restore previous resolution to use VCXSrv.", IDC_STATIC, 7, 52, 166, 8
+END
+
+
+/* Exit */
+
+EXIT_DIALOG DIALOGEX 32, 32, 180, 78
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
+FONT 8, "MS Shell Dlg 2"
+CAPTION "Exit VCXSrv?"
+BEGIN
+ PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14
+ DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14
+ CTEXT "Exiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
+ CTEXT "No information about connected clients available.", IDC_CLIENTS_CONNECTED, 7, 24, 166, 8
+ CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 36, 166, 8
+END
+
+
+/*
+ * Menus
+ */
+
+IDM_TRAYICON_MENU MENU
+BEGIN
+ POPUP "TRAYICON_MENU"
+ BEGIN
+ MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
+ MENUITEM "&About...", ID_APP_ABOUT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit...", ID_APP_EXIT
+ END
+END
+
+
+/*
+ * Icons
+ */
+
+IDI_XWIN ICON "X.ico"
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest"