aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xext/Makefile38
-rw-r--r--xorg-server/Xext/dpms.c2
-rw-r--r--xorg-server/Xext/saver.c6
-rw-r--r--xorg-server/Xext/security.c2
-rw-r--r--xorg-server/Xext/shape.c2
-rw-r--r--xorg-server/Xext/shm.c19
-rw-r--r--xorg-server/Xext/xace.c2
-rw-r--r--xorg-server/Xi/exevents.c2
-rw-r--r--xorg-server/Xi/makefile41
-rw-r--r--xorg-server/composite/compalloc.c2
-rw-r--r--xorg-server/composite/makefile9
-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/dispatch.c4
-rw-r--r--xorg-server/dix/dixfonts.c6
-rw-r--r--xorg-server/dix/getevents.c7
-rw-r--r--xorg-server/dix/main.c5
-rw-r--r--xorg-server/dix/makefile36
-rw-r--r--xorg-server/dix/ptrveloc.c9
-rw-r--r--xorg-server/dix/window.c5
-rw-r--r--xorg-server/exa/exa_accel.c2
-rw-r--r--xorg-server/exa/exa_migration.c12
-rw-r--r--xorg-server/exa/exa_render.c16
-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/makefile37
-rw-r--r--xorg-server/fonts.src/100dpi/makefile352
-rw-r--r--xorg-server/fonts.src/75dpi/makefile348
-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/makefile40
-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/makefile1
-rw-r--r--xorg-server/fonts.src/misc/makefile340
-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/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/ephyrlog.h4
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c40
-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.c9
-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/makefile15
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h6
-rw-r--r--xorg-server/hw/xwin/InitInput.c18
-rw-r--r--xorg-server/hw/xwin/InitOutput.c91
-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.rc56
-rw-r--r--xorg-server/hw/xwin/ddraw.h2106
-rw-r--r--xorg-server/hw/xwin/makefile107
-rw-r--r--xorg-server/hw/xwin/win.h30
-rw-r--r--xorg-server/hw/xwin/winclipboard.h9
-rw-r--r--xorg-server/hw/xwin/winclipboardthread.c85
-rw-r--r--xorg-server/hw/xwin/winclipboardunicode.c34
-rw-r--r--xorg-server/hw/xwin/winclipboardwndproc.c78
-rw-r--r--xorg-server/hw/xwin/winclipboardwrappers.c48
-rw-r--r--xorg-server/hw/xwin/winclipboardxevents.c76
-rw-r--r--xorg-server/hw/xwin/wincreatewnd.c23
-rw-r--r--xorg-server/hw/xwin/wincursor.c43
-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.c63
-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.c143
-rw-r--r--xorg-server/hw/xwin/winmultiwindowclass.c4
-rw-r--r--xorg-server/hw/xwin/winmultiwindowicons.c314
-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.c268
-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/wintrayicon.c6
-rw-r--r--xorg-server/hw/xwin/winwin32rootless.c5
-rw-r--r--xorg-server/hw/xwin/winwin32rootlesswndproc.c36
-rw-r--r--xorg-server/hw/xwin/winwindow.c5
-rw-r--r--xorg-server/hw/xwin/winwindow.h37
-rw-r--r--xorg-server/hw/xwin/winwindowswm.c2
-rw-r--r--xorg-server/hw/xwin/winwndproc.c71
-rw-r--r--xorg-server/hw/xwin/xlaunch/config.h76
-rw-r--r--xorg-server/hw/xwin/xlaunch/main.cc123
-rw-r--r--xorg-server/hw/xwin/xlaunch/makefile32
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/resources.h2
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/resources.rc2
-rw-r--r--xorg-server/hw/xwin/xlaunch/resources/strings.rc6
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/makefile4
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/util.cc2
-rw-r--r--xorg-server/hw/xwin/xlaunch/window/util.h4
-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/globals.h2
-rw-r--r--xorg-server/include/misc.h4
-rw-r--r--xorg-server/include/os.h4
-rw-r--r--xorg-server/include/pixmapstr.h2
-rw-r--r--xorg-server/include/scrnintstr.h6
-rw-r--r--xorg-server/include/servermd.h6
-rw-r--r--xorg-server/include/site.h4
-rw-r--r--xorg-server/include/windowstr.h2
-rw-r--r--xorg-server/include/xkb-config.h24
-rw-r--r--xorg-server/include/xkbsrv.h4
-rw-r--r--xorg-server/installer/genruntimeinclude.py51
-rw-r--r--xorg-server/installer/packageall.bat3
-rw-r--r--xorg-server/installer/vcxsrv.nsi195
-rw-r--r--xorg-server/locale/compose.dir9
-rw-r--r--xorg-server/locale/locale.alias16
-rw-r--r--xorg-server/locale/locale.dir11
-rw-r--r--xorg-server/makefile110
-rw-r--r--xorg-server/mi/makefile41
-rw-r--r--xorg-server/mi/micoord.h8
-rw-r--r--xorg-server/mi/mioverlay.c4
-rw-r--r--xorg-server/mi/mipointer.c4
-rw-r--r--xorg-server/mi/misprite.c15
-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.c8
-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/connection.c4
-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/oscolor.c4
-rw-r--r--xorg-server/os/osinit.c2
-rw-r--r--xorg-server/os/utils.c48
-rw-r--r--xorg-server/os/xprintf.c12
-rw-r--r--xorg-server/os/xstrans.c2
-rw-r--r--xorg-server/randr/makefile16
-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/makefile16
-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/system.XWinrc124
-rw-r--r--xorg-server/vcxsrv.sln16
-rw-r--r--xorg-server/xfixes/cursor.c2
-rw-r--r--xorg-server/xfixes/makefile9
-rw-r--r--xorg-server/xkb/makefile46
-rw-r--r--xorg-server/xkb/xkb.c2
-rw-r--r--xorg-server/xkb/xkbActions.c6
-rw-r--r--xorg-server/xkb/xkbInit.c8
-rw-r--r--xorg-server/xkbdata.src/compat/makefile20
-rw-r--r--xorg-server/xkbdata.src/geometry/digital_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/geometry/makefile27
-rw-r--r--xorg-server/xkbdata.src/geometry/sgi_vndr/makefile13
-rw-r--r--xorg-server/xkbdata.src/keycodes/digital_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/keycodes/makefile34
-rw-r--r--xorg-server/xkbdata.src/keycodes/sgi_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/keymap/digital_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/keymap/makefile24
-rw-r--r--xorg-server/xkbdata.src/keymap/sgi_vndr/makefile20
-rw-r--r--xorg-server/xkbdata.src/keymap/sun_vndr/makefile15
-rw-r--r--xorg-server/xkbdata.src/makefile9
-rw-r--r--xorg-server/xkbdata.src/rules/compat/ln_s.sh22
-rw-r--r--xorg-server/xkbdata.src/rules/compat/lnv_s.sh14
-rw-r--r--xorg-server/xkbdata.src/rules/compat/makefile61
-rw-r--r--xorg-server/xkbdata.src/rules/compat/ml1_s.sh19
-rw-r--r--xorg-server/xkbdata.src/rules/compat/ml1v1_s.sh11
-rw-r--r--xorg-server/xkbdata.src/rules/compat/ml1v_s.sh11
-rw-r--r--xorg-server/xkbdata.src/rules/compat/ml_s.sh15
-rw-r--r--xorg-server/xkbdata.src/rules/compat/mlv_s.sh12
-rw-r--r--xorg-server/xkbdata.src/rules/makefile157
-rw-r--r--xorg-server/xkbdata.src/rules/merge.py13
-rw-r--r--xorg-server/xkbdata.src/semantics/makefile17
-rw-r--r--xorg-server/xkbdata.src/symbols/digital_vndr/makefile13
-rw-r--r--xorg-server/xkbdata.src/symbols/fujitsu_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/symbols/hp_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/symbols/level32
-rw-r--r--xorg-server/xkbdata.src/symbols/macintosh_vndr/makefile16
-rw-r--r--xorg-server/xkbdata.src/symbols/makefile50
-rw-r--r--xorg-server/xkbdata.src/symbols/nec_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/symbols/sgi_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/symbols/sony_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/symbols/sun_vndr/makefile17
-rw-r--r--xorg-server/xkbdata.src/symbols/xfree68_vndr/makefile12
-rw-r--r--xorg-server/xkbdata.src/types/makefile25
-rw-r--r--xorg-server/xkbdata.src/xkbrules.mak14
235 files changed, 6523 insertions, 3055 deletions
diff --git a/xorg-server/Xext/Makefile b/xorg-server/Xext/Makefile
new file mode 100644
index 000000000..7eda4bae5
--- /dev/null
+++ b/xorg-server/Xext/Makefile
@@ -0,0 +1,38 @@
+CSRCS=\
+bigreq.c \
+dpms.c \
+dpmsstubs.c \
+mbuf.c \
+saver.c \
+security.c \
+shape.c \
+sleepuntil.c \
+sync.c \
+xace.c \
+xcmisc.c \
+xres.c \
+xtest.c \
+geext.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 bad7aa64f..06425993b 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 86db7b0b9..c9b2eb3f8 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -31,6 +31,12 @@ 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
+
+#ifdef CreateWindow
+#undef CreateWindow
#endif
#include <X11/X.h>
diff --git a/xorg-server/Xext/security.c b/xorg-server/Xext/security.c
index 1a90a82b1..f781e2239 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 332e58743..565dfdd16 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 a48d2bd5b..0b549a487 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -34,8 +34,10 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <sys/types.h>
+#if !defined(_MSC_VER)
#include <sys/ipc.h>
#include <sys/shm.h>
+#endif
#include <unistd.h>
#include <sys/stat.h>
#define NEED_REPLIES
@@ -318,8 +320,10 @@ ProcShmQueryVersion(ClientPtr client)
rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0;
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);
@@ -369,6 +373,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;
@@ -377,10 +384,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) {
@@ -388,14 +399,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
@@ -468,7 +485,9 @@ ShmDetachSegment(pointer value, /* must conform to DeleteType */
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/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 0bb84f86c..56e1d4439 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..e7d9fa24b
--- /dev/null
+++ b/xorg-server/Xi/makefile
@@ -0,0 +1,41 @@
+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 \
+ xiproperty.c
+
+LIBRARY=libXi
+
diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c
index a2f3f140a..5a399bf3b 100644
--- a/xorg-server/composite/compalloc.c
+++ b/xorg-server/composite/compalloc.c
@@ -108,7 +108,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
*/
if (!cw)
{
- cw = xalloc (sizeof (CompWindowRec));
+ cw = xcalloc (1,sizeof (CompWindowRec));
if (!cw)
{
xfree (ccw);
diff --git a/xorg-server/composite/makefile b/xorg-server/composite/makefile
new file mode 100644
index 000000000..1ab95ebba
--- /dev/null
+++ b/xorg-server/composite/makefile
@@ -0,0 +1,9 @@
+
+LIBRARY=libcomposite
+
+CSRCS = \
+ compalloc.c \
+ compext.c \
+ compinit.c \
+ compoverlay.c \
+ compwindow.c
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/dispatch.c b/xorg-server/dix/dispatch.c
index 7e16589da..b4f5f437f 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -109,6 +109,10 @@ Equipment Corporation.
#include <dix-config.h>
#endif
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
#ifdef PANORAMIX_DEBUG
#include <stdio.h>
int ProcInitialConnection();
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index 719bca469..02f9d6de8 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -136,6 +136,7 @@ SetDefaultFont(char *defaultfontname)
int err;
FontPtr pf;
XID fid;
+ static FontPtr last_pf;
fid = FakeClientID(0);
err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync,
@@ -143,9 +144,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;
}
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
index 9747b35a6..50a8f5690 100644
--- a/xorg-server/dix/getevents.c
+++ b/xorg-server/dix/getevents.c
@@ -112,6 +112,13 @@ key_autorepeats(DeviceIntPtr pDev, int key_code)
(1 << (key_code & 7)));
}
+#ifdef _MSC_VER
+float roundf(float f)
+{
+ return ((f<0.0f) ? ceil(f-.5) : floor (f+.5));
+}
+#endif
+
/**
* Rescale the coord between the two axis ranges.
*/
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index 0527621e7..c4d362a36 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -248,6 +248,7 @@ int main(int argc, char *argv[], char *envp[])
int i;
HWEventQueueType alwaysCheckForInput[2];
+ ptw32_processInitialize();
display = "0";
InitRegions();
@@ -457,8 +458,8 @@ int main(int argc, char *argv[], char *envp[])
return(0);
}
-static int VendorRelease = VENDOR_RELEASE;
-static char *VendorString = VENDOR_NAME;
+static int VendorRelease = XORG_VERSION_CURRENT;
+static char *VendorString = "HMCA" ;
void
SetVendorRelease(int release)
diff --git a/xorg-server/dix/makefile b/xorg-server/dix/makefile
new file mode 100644
index 000000000..f15ccd91a
--- /dev/null
+++ b/xorg-server/dix/makefile
@@ -0,0 +1,36 @@
+DEFINES += FONTDEBUG
+
+LIBRARY=libdix
+
+CSRCS=\
+ atom.c \
+ colormap.c \
+ cursor.c \
+ deprecated.c \
+ devices.c \
+ dispatch.c \
+ dixfonts.c \
+ dixutils.c \
+ enterleave.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 \
+ ptrveloc.c \
+ registry.c \
+ resource.c \
+ selection.c \
+ swaprep.c \
+ swapreq.c \
+ tables.c \
+ window.c
+
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c
index e9d4e882f..58b6a81da 100644
--- a/xorg-server/dix/ptrveloc.c
+++ b/xorg-server/dix/ptrveloc.c
@@ -26,12 +26,17 @@
#include <dix-config.h>
#endif
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#endif
+
#include <math.h>
#include <ptrveloc.h>
#include <inputstr.h>
#include <assert.h>
#include <os.h>
+
/*****************************************************************************
* Predictable pointer acceleration
*
@@ -58,6 +63,10 @@
*
****************************************************************************/
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
/* fwds */
static inline void
FeedFilterStage(FilterStagePtr s, float value, int tdiff);
diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c
index e0b0decce..7b1af49cb 100644
--- a/xorg-server/dix/window.c
+++ b/xorg-server/dix/window.c
@@ -3087,11 +3087,14 @@ NotClippedByChildren(WindowPtr pWin)
void
SendVisibilityNotify(WindowPtr pWin)
{
+#ifndef NO_XINERAMA_PORT
+ unsigned int visibility;
+#endif
xEvent event;
if (!MapUnmapEventsEnabled(pWin))
return;
#ifndef NO_XINERAMA_PORT
- unsigned int visibility = pWin->visibility;
+ visibility = pWin->visibility;
#endif
#ifdef PANORAMIX
/* This is not quite correct yet, but it's close */
diff --git a/xorg-server/exa/exa_accel.c b/xorg-server/exa/exa_accel.c
index dac6e6c79..9e65d74a1 100644
--- a/xorg-server/exa/exa_accel.c
+++ b/xorg-server/exa/exa_accel.c
@@ -258,7 +258,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 4623eccdd..17dd87e4c 100644
--- a/xorg-server/exa/exa_migration.c
+++ b/xorg-server/exa/exa_migration.c
@@ -167,7 +167,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;
}
}
@@ -353,8 +353,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);
@@ -394,8 +394,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);
@@ -588,7 +588,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/exa_render.c b/xorg-server/exa/exa_render.c
index 9a79b4781..e4fb13cf1 100644
--- a/xorg-server/exa/exa_render.c
+++ b/xorg-server/exa/exa_render.c
@@ -1054,15 +1054,15 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
BoxRec bounds;
if (maskFormat) {
+ PicturePtr pPicture;
+ INT16 xDst, yDst;
+ INT16 xRel, yRel;
+
miTrapezoidBounds (ntrap, traps, &bounds);
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
return;
- PicturePtr pPicture;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
xDst = traps[0].left.p1.x >> 16;
yDst = traps[0].left.p1.y >> 16;
@@ -1118,15 +1118,15 @@ exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
BoxRec bounds;
if (maskFormat) {
+ PicturePtr pPicture;
+ INT16 xDst, yDst;
+ INT16 xRel, yRel;
+
miTriangleBounds (ntri, tris, &bounds);
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
return;
- PicturePtr pPicture;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
xDst = tris[0].p1.x >> 16;
yDst = tris[0].p1.y >> 16;
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 1355e9071..2d965fdfe 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/makefile b/xorg-server/fb/makefile
new file mode 100644
index 000000000..717c07332
--- /dev/null
+++ b/xorg-server/fb/makefile
@@ -0,0 +1,37 @@
+
+LIBRARY=libfb
+
+CCFLAGS:=$(CCFLAGS:-RTCc=)
+
+
+CSRCS = \
+ fb24_32.c \
+ fballpriv.c \
+ fbarc.c \
+ fbbits.c \
+ fbblt.c \
+ fbbltone.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 \
+ fbpush.c \
+ fbscreen.c \
+ fbseg.c \
+ fbsetsp.c \
+ fbsolid.c \
+ fbstipple.c \
+ fbtile.c \
+ fbtrap.c \
+ fbutil.c \
+ fbwindow.c \
+ fbcmap_mi.c
diff --git a/xorg-server/fonts.src/100dpi/makefile b/xorg-server/fonts.src/100dpi/makefile
new file mode 100644
index 000000000..24057f7e6
--- /dev/null
+++ b/xorg-server/fonts.src/100dpi/makefile
@@ -0,0 +1,352 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+all: $(BDFTOPCF)
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\100dpi
+
+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_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+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)
+
+$(DESTDIR)\%-ISO8859-1.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-1.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-1.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-1.bdf)
+
+$(DESTDIR)\%-ISO8859-2.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-2.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-2.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-2.bdf)
+
+$(DESTDIR)\%-ISO8859-3.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-3.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-3.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-3.bdf)
+
+$(DESTDIR)\%-ISO8859-4.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-4.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-4.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-4.bdf)
+
+$(DESTDIR)\%-ISO8859-9.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-9.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-9.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-9.bdf)
+
+$(DESTDIR)\%-ISO8859-10.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-10.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-10.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-10.bdf)
+
+$(DESTDIR)\%-ISO8859-13.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-13.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-13.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-13.bdf)
+
+$(DESTDIR)\%-ISO8859-14.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-14.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-14.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-14.bdf)
+
+$(DESTDIR)\%-ISO8859-15.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-15.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-15.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-15.bdf)
+
+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)
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..e5c8002f0
--- /dev/null
+++ b/xorg-server/fonts.src/75dpi/makefile
@@ -0,0 +1,348 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+all: $(BDFTOPCF)
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\75dpi
+
+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_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+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)
+
+$(DESTDIR)\%-ISO8859-1.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-1.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-1.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-1.bdf)
+
+$(DESTDIR)\%-ISO8859-2.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-2.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-2.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-2.bdf)
+
+$(DESTDIR)\%-ISO8859-3.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-3.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-3.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-3.bdf)
+
+$(DESTDIR)\%-ISO8859-4.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-4.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-4.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-4.bdf)
+
+$(DESTDIR)\%-ISO8859-9.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-9.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-9.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-9.bdf)
+
+$(DESTDIR)\%-ISO8859-10.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-10.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-10.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-10.bdf)
+
+$(DESTDIR)\%-ISO8859-13.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-13.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-13.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-13.bdf)
+
+$(DESTDIR)\%-ISO8859-14.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-14.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-14.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-14.bdf)
+
+$(DESTDIR)\%-ISO8859-15.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-15.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-15.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-15.bdf)
+
+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)
+
+all: $(DESTDIR) $(UCS2ANY) $(DESTDIR)\fonts.scale $(DESTDIR)\fonts.dir $(DESTDIR)\fonts.alias
+
+$(DESTDIR)\fonts.scale: $(font_DATA) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..e15018a64
--- /dev/null
+++ b/xorg-server/fonts.src/OTF/makefile
@@ -0,0 +1,52 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\OTF
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..87f66559a
--- /dev/null
+++ b/xorg-server/fonts.src/Speedo/makefile
@@ -0,0 +1,37 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\Speedo
+
+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) $(MKFONTSCALE)
+ 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..39b753ab1
--- /dev/null
+++ b/xorg-server/fonts.src/TTF/makefile
@@ -0,0 +1,53 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\TTF
+
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..bc2b6b06f
--- /dev/null
+++ b/xorg-server/fonts.src/Type1/makefile
@@ -0,0 +1,93 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\Type1
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..47a455a17
--- /dev/null
+++ b/xorg-server/fonts.src/cyrillic/makefile
@@ -0,0 +1,114 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\cyrillic
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ 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..0f168d046
--- /dev/null
+++ b/xorg-server/fonts.src/encodings/large/makefile
@@ -0,0 +1,40 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\encodings\large
+
+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..548d56ce5
--- /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 MAKESERVER=0 DEBUG=0
+
+INC_BDF_RULES=1
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\encodings
+
+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..13e196a03
--- /dev/null
+++ b/xorg-server/fonts.src/font-util/makefile
@@ -0,0 +1,5 @@
+TTYAPP = ucs2any
+
+CSRCS = ucs2any.c
+
+DEFINES += NEED_BASENAME
diff --git a/xorg-server/fonts.src/makefile b/xorg-server/fonts.src/makefile
new file mode 100644
index 000000000..9dce92d67
--- /dev/null
+++ b/xorg-server/fonts.src/makefile
@@ -0,0 +1 @@
+SUBDIRS=font-util 75dpi 100dpi cyrillic encodings misc OTF Speedo TTF Type1
diff --git a/xorg-server/fonts.src/misc/makefile b/xorg-server/fonts.src/misc/makefile
new file mode 100644
index 000000000..290ae173a
--- /dev/null
+++ b/xorg-server/fonts.src/misc/makefile
@@ -0,0 +1,340 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+INC_BDF_RULES=1
+
+all: $(BDFTOPCF)
+
+DESTDIR=$(MHMAKECONF)\xorg-server\fonts\misc
+
+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_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-1.pcf.gz)
+
+ISO8859_2_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-2.pcf.gz)
+
+ISO8859_3_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-3.pcf.gz)
+
+ISO8859_4_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-4.pcf.gz)
+
+ISO8859_5_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-5.pcf.gz)
+
+ISO8859_7_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-7.pcf.gz)
+
+ISO8859_8_PCF_FILES = $(BDF2UCS_8_FONT_FILES:%=$(DESTDIR)\%-ISO8859-8.pcf.gz)
+
+ISO8859_9_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-9.pcf.gz)
+
+ISO8859_10_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-10.pcf.gz)
+
+ISO8859_11_PCF_FILES = $(BDF2UCS_11_FONT_FILES:%=$(DESTDIR)\%-ISO8859-11.pcf.gz)
+
+ISO8859_13_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-13.pcf.gz)
+
+ISO8859_14_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-14.pcf.gz)
+
+ISO8859_15_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-15.pcf.gz)
+
+ISO8859_16_PCF_FILES = $(BDF2UCS_FONT_FILES:%=$(DESTDIR)\%-ISO8859-16.pcf.gz)
+
+KOI8_R_PCF_FILES = $(BDF2UCS_KOI8_FONT_FILES:%=$(DESTDIR)\%-KOI8-R.pcf.gz)
+
+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)
+
+$(DESTDIR)\%-ISO8859-1.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-1.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-1 ISO8859-1
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-1.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-1.bdf)
+
+$(DESTDIR)\%-ISO8859-2.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-2.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-2 ISO8859-2
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-2.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-2.bdf)
+
+$(DESTDIR)\%-ISO8859-3.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-3.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-3 ISO8859-3
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-3.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-3.bdf)
+
+$(DESTDIR)\%-ISO8859-4.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-4.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-4 ISO8859-4
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-4.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-4.bdf)
+
+$(DESTDIR)\%-ISO8859-5.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-5.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-5 ISO8859-5
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-5.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-5.bdf)
+
+$(DESTDIR)\%-ISO8859-7.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-7.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-7 ISO8859-7
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-7.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-7.bdf)
+
+$(DESTDIR)\%-ISO8859-8.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-8.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-8 ISO8859-8
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-8.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-8.bdf)
+
+$(DESTDIR)\%-ISO8859-9.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-9.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-9 ISO8859-9
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-9.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-9.bdf)
+
+$(DESTDIR)\%-ISO8859-10.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-10.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-10 ISO8859-10
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-10.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-10.bdf)
+
+$(DESTDIR)\%-ISO8859-11.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-11.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-11 ISO8859-11
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-11.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-11.bdf)
+
+$(DESTDIR)\%-ISO8859-13.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-13.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-13 ISO8859-13
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-13.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-13.bdf)
+
+$(DESTDIR)\%-ISO8859-14.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-14.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-14 ISO8859-14
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-14.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-14.bdf)
+
+$(DESTDIR)\%-ISO8859-15.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-15.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-15 ISO8859-15
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-15.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-15.bdf)
+
+$(DESTDIR)\%-ISO8859-16.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-ISO8859-16.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-ISO8859-16 ISO8859-16
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-ISO8859-16.bdf) | gzip > $@
+ @del $(<:%.bdf=%-ISO8859-16.bdf)
+
+$(DESTDIR)\%-KOI8-R.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-KOI8-R.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-KOI8-R KOI8-R
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-KOI8-R.bdf) | gzip > $@
+ @del $(<:%.bdf=%-KOI8-R.bdf)
+
+$(DESTDIR)\%-JISX0201.1976-0.pcf.gz: %.bdf
+ @del -e $(<:%.bdf=%-JISX0201.1976-0.bdf)
+ $(UCS2ANY) $< $(UTIL_DIR)\map-JISX0201.1976-0 JISX0201.1976-0
+ @del -e $@
+ $(BDFTOPCF) -t $(<:%.bdf=%-JISX0201.1976-0.bdf) | gzip > $@
+ @del $(<:%.bdf=%-JISX0201.1976-0.bdf)
+
+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)
+
+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) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) .
+
+$(DESTDIR)\fonts.dir: $(font_DATA) $(MKFONTSCALE)
+ del -e $@
+ cd $(DESTDIR) & $(MKFONTSCALE) -b -s -l .
+
+$(DESTDIR)\fonts.alias: fonts.alias
+ copy $< $@
+
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 ff8b126be..d95d0b116 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -32,6 +32,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 65edf6991..04b0a380b 100644
--- a/xorg-server/glx/glxcmdsswap.c
+++ b/xorg-server/glx/glxcmdsswap.c
@@ -32,6 +32,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 64606ab5a..ca868d2fc 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 f8c441e65..0a122d90a 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;
@@ -243,7 +255,11 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
(*screen->core->destroyScreen)(screen->driScreen);
+#ifdef _MSC_VER
+ FreeLibrary(screen->driver);
+#else
dlclose(screen->driver);
+#endif
__glXScreenDestroy(baseScreen);
@@ -454,14 +470,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());
@@ -509,7 +533,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 ca1d2ec8d..1598e27a6 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -31,6 +31,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 95d35eb67..d232e888c 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -30,6 +30,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 a5ca0a20b..824bac07b 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -54,6 +54,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/indirect_dispatch.c b/xorg-server/glx/indirect_dispatch.c
index 6547f5d96..adb67c41c 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 0b8c27cac..02fed4872 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 c47f01ee9..562b8e371 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 80f81dec6..7b8fa49cd 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"
@@ -888,7 +895,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..0debc92a0
--- /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 \
+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 a86a22acb..db285f430 100644
--- a/xorg-server/glx/render2.c
+++ b/xorg-server/glx/render2.c
@@ -31,6 +31,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 49449ff6f..f13b765eb 100644
--- a/xorg-server/glx/render2swap.c
+++ b/xorg-server/glx/render2swap.c
@@ -31,6 +31,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 17deb33c4..b3ce012f7 100644
--- a/xorg-server/glx/renderpix.c
+++ b/xorg-server/glx/renderpix.c
@@ -31,6 +31,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 ebb20cfda..b71ca356e 100644
--- a/xorg-server/glx/renderpixswap.c
+++ b/xorg-server/glx/renderpixswap.c
@@ -31,6 +31,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 5c6b1500d..aa8c6a0ab 100644
--- a/xorg-server/glx/rensize.c
+++ b/xorg-server/glx/rensize.c
@@ -30,6 +30,10 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <GL/gl.h>
@@ -219,7 +223,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;
@@ -258,11 +264,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:
@@ -273,8 +281,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 d8b259269..590efaa23 100644
--- a/xorg-server/glx/single2.c
+++ b/xorg-server/glx/single2.c
@@ -31,6 +31,10 @@
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+
+#include "glheader.h"
+
#endif
#include <string.h>
@@ -336,6 +340,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 fcb0657d4..9a716e041 100644
--- a/xorg-server/glx/single2swap.c
+++ b/xorg-server/glx/single2swap.c
@@ -31,6 +31,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 6611b0380..24ee61d1a 100644
--- a/xorg-server/glx/singlepix.c
+++ b/xorg-server/glx/singlepix.c
@@ -31,6 +31,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 b546ec864..77ca7c479 100644
--- a/xorg-server/glx/singlepixswap.c
+++ b/xorg-server/glx/singlepixswap.c
@@ -31,6 +31,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 9e95dd3d3..a9a2be66b 100644
--- a/xorg-server/glx/singlesize.c
+++ b/xorg-server/glx/singlesize.c
@@ -30,6 +30,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 6df373a16..1230abe5b 100644
--- a/xorg-server/glx/xfont.c
+++ b/xorg-server/glx/xfont.c
@@ -31,6 +31,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 6a0c259ec..b9b18a85a 100644
--- a/xorg-server/hw/dmx/dmxinit.c
+++ b/xorg-server/hw/dmx/dmxinit.c
@@ -844,6 +844,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 ab8459cfc..d0f02a16d 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;
@@ -430,8 +433,6 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
Rotation randr;
int n = 0;
- EPHYR_LOG("mark");
-
struct { int width, height; } sizes[] =
{
{ 1600, 1200 },
@@ -452,6 +453,8 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
{ 0, 0 }
};
+ EPHYR_LOG("mark");
+
*rotations = RR_Rotate_All|RR_Reflect_All;
if (!hostx_want_preexisting_window (screen)
@@ -803,21 +806,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 1399d7aaa..e5ca089b1 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/ephyrlog.h b/xorg-server/hw/kdrive/ephyr/ephyrlog.h
index a07a0a097..ba52a3bce 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrlog.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyrlog.h
@@ -43,14 +43,14 @@
#ifndef EPHYR_LOG
#define EPHYR_LOG(...) \
LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, "in %s:%d:%s: ",\
- __FILE__, __LINE__, __func__) ; \
+ __FILE__, __LINE__, __FUNCTION__) ; \
LogMessageVerb(X_NOTICE, INFO_LOG_LEVEL, __VA_ARGS__)
#endif /*nomadik_log*/
#ifndef EPHYR_LOG_ERROR
#define EPHYR_LOG_ERROR(...) \
LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, "Error:in %s:%d:%s: ",\
- __FILE__, __LINE__, __func__) ; \
+ __FILE__, __LINE__, __FUNCTION__) ; \
LogMessageVerb(X_NOTICE, ERROR_LOG_LEVEL, __VA_ARGS__)
#endif /*EPHYR_LOG_ERROR*/
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index d289d7335..9a31b0b94 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -47,9 +47,11 @@
#include <string.h> /* for memset */
#include <time.h>
+#ifndef _MSC_VER
#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);
@@ -634,7 +644,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);
}
@@ -649,10 +659,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
{
@@ -668,6 +682,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 );
@@ -693,6 +710,7 @@ hostx_screen_init (EphyrScreenInfo screen,
XShmAttach(HostX.dpy, &host_screen->shminfo);
shm_success = True;
}
+#endif
}
if (!shm_success)
@@ -821,9 +839,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
{
@@ -839,6 +861,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);
@@ -854,6 +879,7 @@ hostx_paint_debug_rect (struct EphyrHostScreen *host_screen,
/* nanosleep seems to work better than usleep for me... */
nanosleep(&tspec, NULL);
+#endif
}
void
@@ -1288,8 +1314,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) {
@@ -1325,8 +1355,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) {
@@ -1341,12 +1375,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 c1b1958de..ebc15822a 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 97d167e1e..4b9634f97 100644
--- a/xorg-server/hw/kdrive/src/kdrive.c
+++ b/xorg-server/hw/kdrive/src/kdrive.c
@@ -325,6 +325,7 @@ KdProcessSwitch (void)
KdEnableScreens ();
}
+#ifndef _MSC_VER
void
AbortDDX(void)
{
@@ -347,6 +348,7 @@ ddxGiveUp ()
{
AbortDDX ();
}
+#endif
Bool kdDumbDriver;
Bool kdSoftCursor;
@@ -1371,12 +1373,15 @@ KdInitOutput (ScreenInfo *pScreenInfo,
signal(SIGSEGV, KdBacktrace);
}
+#ifndef _MSC_VER
void
OsVendorFatalError(void)
{
}
+#endif
#ifdef DPMSExtension
+#ifndef _MSC_VER
int
DPMSSet(ClientPtr client, int level)
{
@@ -1394,4 +1399,6 @@ DPMSSupported (void)
return FALSE;
}
#endif
-
+#endif
+#ifndef _MSC_VER
+#endif
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index 8e6a475d1..cef47c74e 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
@@ -512,11 +532,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)
@@ -535,6 +557,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)
{
@@ -550,7 +573,7 @@ DDXRingBell(int volume, int pitch, int duration)
}
}
}
-
+#endif
void
KdRingBell(KdKeyboardInfo *ki, int volume, int pitch, int duration)
{
@@ -2348,6 +2371,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs =
KdWarpCursor
};
+#ifndef _MSC_VER
void
ProcessInputEvents ()
{
@@ -2357,6 +2381,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 60e8ae134..a10c9ec09 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..db710ec4f
--- /dev/null
+++ b/xorg-server/hw/kdrive/src/makefile
@@ -0,0 +1,15 @@
+LIBRARY = libkdrive
+
+CSRCS = \
+ kcmap.c \
+ kcurscol.c \
+ kinfo.c \
+ kkeymap.c \
+ kmap.c \
+ kmode.c \
+ kshadow.c \
+ kinput.c \
+ kdrive.c
+
+
+
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index 285d9a3f6..a14daea25 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
@@ -1493,13 +1493,13 @@ inl(unsigned short port)
# define uint_t unsigned int
# define uchar_t unsigned char
# endif /* __UNIXWARE__ */
-# if !defined(__SUNPRO_C)
+# if !defined(__SUNPRO_C) && !defined(_MSC_VER)
# include <sys/inline.h>
# endif
# else
# include "scoasm.h"
# endif
-# if !defined(__HIGHC__) && !defined(__SUNPRO_C) || \
+# if (!defined(__HIGHC__) && !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 550c5a04e..65572ccd8 100644
--- a/xorg-server/hw/xwin/InitInput.c
+++ b/xorg-server/hw/xwin/InitInput.c
@@ -31,6 +31,7 @@
#endif
#include "win.h"
#include "dixstruct.h"
+#include "inputstr.h"
/*
@@ -94,13 +95,18 @@ ProcessInputEvents (void)
#endif
mieqProcessInputEvents ();
- miPointerUpdate ();
+ miPointerUpdateSprite(inputInfo.pointer);
#if 0
ErrorF ("ProcessInputEvents - returning\n");
#endif
}
+void DDXRingBell(int volume, int pitch, int duration)
+{
+ /* winKeybdBell is used instead */
+ return;
+}
int
TimeSinceLastInputEvent ()
@@ -138,14 +144,16 @@ InitInput (int argc, char *argv[])
}
#endif
- pMouse = AddInputDevice (winMouseProc, TRUE);
- pKeyboard = AddInputDevice (winKeybdProc, TRUE);
+ pMouse = AddInputDevice (serverClient, winMouseProc, TRUE);
+ pKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE);
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 abc35b943..d2c6e27b7 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
@@ -67,12 +70,13 @@ extern int g_iLastScreen;
extern char * g_pszCommandLine;
extern Bool g_fSilentFatalError;
-extern char * g_pszLogFile;
+extern const char * g_pszLogFile;
extern Bool g_fLogFileChanged;
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
@@ -178,9 +185,6 @@ winClipboardShutdown (void)
/* Wait for the clipboard thread to exit */
pthread_join (g_ptClipboardProc, NULL);
- g_fClipboardLaunched = FALSE;
- g_fClipboardStarted = FALSE;
-
winDebug ("winClipboardShutdown - Clipboard thread has exited.\n");
}
}
@@ -241,7 +245,7 @@ ddxGiveUp (void)
#endif
if (!g_fLogInited) {
- LogInit (g_pszLogFile, NULL);
+ g_pszLogFile = LogInit (g_pszLogFile, NULL);
g_fLogInited = TRUE;
}
LogClose ();
@@ -424,7 +428,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 +638,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 +683,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 +694,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 +710,6 @@ OsVendorInit (void)
/* Re-initialize global variables on server reset */
winInitializeGlobals ();
- LogInit (NULL, NULL);
- LogSetParameter (XLOG_VERBOSITY, g_iLogVerbose);
-
winFixupPaths();
#ifdef DDXOSVERRORF
@@ -704,7 +724,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 +897,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 +927,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 +935,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);
}
/* See Porting Layer Definition - p. 20 */
@@ -960,9 +980,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
@@ -1026,7 +1043,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
@@ -1038,6 +1055,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
* Apply locale specified in LANG environment variable.
*/
setlocale (LC_ALL, "");
+
+ glx_debugging();
}
#endif
@@ -1066,7 +1085,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;
@@ -1113,7 +1132,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;
}
@@ -1121,19 +1140,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..43bbe4941 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,55 @@
*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 VcXsrv"
+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 "VcXsrv X Server ", IDC_STATIC, 36, 8, 220, 8
+ LTEXT "Version 1.0.2 (6 Aug 2009)", IDC_STATIC, 36, 18, 220, 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 "VcXsrv"
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 +83,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 +99,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/ddraw.h b/xorg-server/hw/xwin/ddraw.h
deleted file mode 100644
index 2eb7c2674..000000000
--- a/xorg-server/hw/xwin/ddraw.h
+++ /dev/null
@@ -1,2106 +0,0 @@
-#ifndef __XWIN_DDRAW_H
-#define __XWIN_DDRAW_H
-
-#include <winnt.h>
-#include <wingdi.h>
-#include <objbase.h>
-
-#if defined(NONAMELESSUNION) && !defined(DUMMYUNIONNAME1)
-#define DUMMYUNIONNAME1 u1
-#endif
-
-#define ICOM_CALL_( xfn, p, args) (p)->lpVtbl->xfn args
-
-# ifdef UNICODE
-# define WINELIB_NAME_AW(func) func##W
-# else
-# define WINELIB_NAME_AW(func) func##A
-# endif /* UNICODE */
-#define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-#ifndef DIRECTDRAW_VERSION
-#define DIRECTDRAW_VERSION 0x0700
-#endif /* DIRECTDRAW_VERSION */
-
-/*****************************************************************************
- * Predeclare the interfaces
- */
-DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
-DEFINE_GUID( CLSID_DirectDraw7, 0x3C305196,0x50DB,0x11D3,0x9C,0xFE,0x00,0xC0,0x4F,0xD9,0x30,0xC5 );
-DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
-DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
-DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
-DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
-DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
-DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
-DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
-DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
-DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
-DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
-DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
-
-typedef struct IDirectDraw *LPDIRECTDRAW;
-typedef struct IDirectDraw2 *LPDIRECTDRAW2;
-typedef struct IDirectDraw4 *LPDIRECTDRAW4;
-typedef struct IDirectDraw7 *LPDIRECTDRAW7;
-typedef struct IDirectDrawClipper *LPDIRECTDRAWCLIPPER;
-typedef struct IDirectDrawPalette *LPDIRECTDRAWPALETTE;
-typedef struct IDirectDrawSurface *LPDIRECTDRAWSURFACE;
-typedef struct IDirectDrawSurface2 *LPDIRECTDRAWSURFACE2;
-typedef struct IDirectDrawSurface3 *LPDIRECTDRAWSURFACE3;
-typedef struct IDirectDrawSurface4 *LPDIRECTDRAWSURFACE4;
-typedef struct IDirectDrawSurface7 *LPDIRECTDRAWSURFACE7;
-typedef struct IDirectDrawColorControl *LPDIRECTDRAWCOLORCONTROL;
-typedef struct IDirectDrawGammaControl *LPDIRECTDRAWGAMMACONTROL;
-
-
-#define DDENUMRET_CANCEL 0
-#define DDENUMRET_OK 1
-
-#define DD_OK 0
-
-
-#define _FACDD 0x876
-#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
-
-#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 )
-#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 )
-#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 )
-#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 )
-#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 )
-#define DDERR_GENERIC E_FAIL
-#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 )
-#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 )
-#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 )
-#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 )
-#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 )
-#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 )
-#define DDERR_INVALIDPARAMS E_INVALIDARG
-#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 )
-#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 )
-#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 )
-#define DDERR_NO3D MAKE_DDHRESULT( 170 )
-#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 )
-#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 )
-#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 )
-#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 )
-#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 )
-#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 )
-#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 )
-#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 )
-#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 )
-#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 )
-#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 )
-#define DDERR_NOGDI MAKE_DDHRESULT( 240 )
-#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 )
-#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 )
-#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 )
-#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 )
-#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 )
-#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 )
-#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 )
-#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 )
-#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 )
-#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 )
-#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 )
-#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 )
-#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 )
-#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 )
-#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 )
-#define DDERR_OUTOFMEMORY E_OUTOFMEMORY
-#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 )
-#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 )
-#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 )
-#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 )
-#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 )
-#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 )
-#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 )
-#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 )
-#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 )
-#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 )
-#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 )
-#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 )
-#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 )
-#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 )
-#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 )
-#define DDERR_UNSUPPORTED E_NOTIMPL
-#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 )
-#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 )
-#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 )
-#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 )
-#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 )
-#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 )
-#define DDERR_XALIGN MAKE_DDHRESULT( 560 )
-#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 )
-#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 )
-#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 )
-#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 )
-#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 )
-#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 )
-#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 )
-#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 )
-#define DDERR_NOHWND MAKE_DDHRESULT( 569 )
-#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 )
-#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 )
-#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 )
-#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 )
-#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 )
-#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 )
-#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 )
-#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 )
-#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 )
-#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 )
-#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 )
-#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 )
-#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 )
-#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 )
-#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 )
-#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 )
-#define DDERR_NODC MAKE_DDHRESULT( 586 )
-#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 )
-#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 )
-#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 )
-#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 )
-#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 )
-#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 )
-#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 )
-#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 )
-#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 )
-#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 )
-#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 )
-#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 )
-#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 )
-#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 )
-#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 )
-#define DDERR_MOREDATA MAKE_DDHRESULT( 690 )
-#define DDERR_EXPIRED MAKE_DDHRESULT( 691 )
-#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 )
-#define DDERR_NEWMODE MAKE_DDHRESULT( 693 )
-#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 )
-#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 )
-#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 )
-#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 )
-#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 )
-#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED
-
-/* dwFlags for Blt* */
-#define DDBLT_ALPHADEST 0x00000001
-#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002
-#define DDBLT_ALPHADESTNEG 0x00000004
-#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008
-#define DDBLT_ALPHAEDGEBLEND 0x00000010
-#define DDBLT_ALPHASRC 0x00000020
-#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040
-#define DDBLT_ALPHASRCNEG 0x00000080
-#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100
-#define DDBLT_ASYNC 0x00000200
-#define DDBLT_COLORFILL 0x00000400
-#define DDBLT_DDFX 0x00000800
-#define DDBLT_DDROPS 0x00001000
-#define DDBLT_KEYDEST 0x00002000
-#define DDBLT_KEYDESTOVERRIDE 0x00004000
-#define DDBLT_KEYSRC 0x00008000
-#define DDBLT_KEYSRCOVERRIDE 0x00010000
-#define DDBLT_ROP 0x00020000
-#define DDBLT_ROTATIONANGLE 0x00040000
-#define DDBLT_ZBUFFER 0x00080000
-#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000
-#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000
-#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000
-#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000
-#define DDBLT_WAIT 0x01000000
-#define DDBLT_DEPTHFILL 0x02000000
-#define DDBLT_DONOTWAIT 0x08000000
-
-/* dwTrans for BltFast */
-#define DDBLTFAST_NOCOLORKEY 0x00000000
-#define DDBLTFAST_SRCCOLORKEY 0x00000001
-#define DDBLTFAST_DESTCOLORKEY 0x00000002
-#define DDBLTFAST_WAIT 0x00000010
-#define DDBLTFAST_DONOTWAIT 0x00000020
-
-/* dwFlags for Flip */
-#define DDFLIP_WAIT 0x00000001
-#define DDFLIP_EVEN 0x00000002 /* only valid for overlay */
-#define DDFLIP_ODD 0x00000004 /* only valid for overlay */
-#define DDFLIP_NOVSYNC 0x00000008
-#define DDFLIP_STEREO 0x00000010
-#define DDFLIP_DONOTWAIT 0x00000020
-
-/* dwFlags for GetBltStatus */
-#define DDGBS_CANBLT 0x00000001
-#define DDGBS_ISBLTDONE 0x00000002
-
-/* dwFlags for IDirectDrawSurface7::GetFlipStatus */
-#define DDGFS_CANFLIP 1L
-#define DDGFS_ISFLIPDONE 2L
-
-/* dwFlags for IDirectDrawSurface7::SetPrivateData */
-#define DDSPD_IUNKNOWNPTR 1L
-#define DDSPD_VOLATILE 2L
-
-/* DDSCAPS.dwCaps */
-/* reserved1, was 3d capable */
-#define DDSCAPS_RESERVED1 0x00000001
-/* surface contains alpha information */
-#define DDSCAPS_ALPHA 0x00000002
-/* this surface is a backbuffer */
-#define DDSCAPS_BACKBUFFER 0x00000004
-/* complex surface structure */
-#define DDSCAPS_COMPLEX 0x00000008
-/* part of surface flipping structure */
-#define DDSCAPS_FLIP 0x00000010
-/* this surface is the frontbuffer surface */
-#define DDSCAPS_FRONTBUFFER 0x00000020
-/* this is a plain offscreen surface */
-#define DDSCAPS_OFFSCREENPLAIN 0x00000040
-/* overlay */
-#define DDSCAPS_OVERLAY 0x00000080
-/* palette objects can be created and attached to us */
-#define DDSCAPS_PALETTE 0x00000100
-/* primary surface (the one the user looks at currently)(right eye)*/
-#define DDSCAPS_PRIMARYSURFACE 0x00000200
-/* primary surface for left eye */
-#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400
-/* surface exists in systemmemory */
-#define DDSCAPS_SYSTEMMEMORY 0x00000800
-/* surface can be used as a texture */
-#define DDSCAPS_TEXTURE 0x00001000
-/* surface may be destination for 3d rendering */
-#define DDSCAPS_3DDEVICE 0x00002000
-/* surface exists in videomemory */
-#define DDSCAPS_VIDEOMEMORY 0x00004000
-/* surface changes immediately visible */
-#define DDSCAPS_VISIBLE 0x00008000
-/* write only surface */
-#define DDSCAPS_WRITEONLY 0x00010000
-/* zbuffer surface */
-#define DDSCAPS_ZBUFFER 0x00020000
-/* has its own DC */
-#define DDSCAPS_OWNDC 0x00040000
-/* surface should be able to receive live video */
-#define DDSCAPS_LIVEVIDEO 0x00080000
-/* should be able to have a hw codec decompress stuff into it */
-#define DDSCAPS_HWCODEC 0x00100000
-/* mode X (320x200 or 320x240) surface */
-#define DDSCAPS_MODEX 0x00200000
-/* one mipmap surface (1 level) */
-#define DDSCAPS_MIPMAP 0x00400000
-#define DDSCAPS_RESERVED2 0x00800000
-/* memory allocation delayed until Load() */
-#define DDSCAPS_ALLOCONLOAD 0x04000000
-/* Indicates that the surface will receive data from a video port */
-#define DDSCAPS_VIDEOPORT 0x08000000
-/* surface is in local videomemory */
-#define DDSCAPS_LOCALVIDMEM 0x10000000
-/* surface is in nonlocal videomemory */
-#define DDSCAPS_NONLOCALVIDMEM 0x20000000
-/* surface is a standard VGA mode surface (NOT ModeX) */
-#define DDSCAPS_STANDARDVGAMODE 0x40000000
-/* optimized? surface */
-#define DDSCAPS_OPTIMIZED 0x80000000
-
-typedef struct _DDSCAPS {
- DWORD dwCaps; /* capabilities of surface wanted */
-} DDSCAPS,*LPDDSCAPS;
-
-/* DDSCAPS2.dwCaps2 */
-/* indicates the surface will receive data from a video port using
- deinterlacing hardware. */
-#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000002
-/* indicates the surface will be locked very frequently. */
-#define DDSCAPS2_HINTDYNAMIC 0x00000004
-/* indicates surface can be re-ordered or retiled on load() */
-#define DDSCAPS2_HINTSTATIC 0x00000008
-/* indicates surface to be managed by directdraw/direct3D */
-#define DDSCAPS2_TEXTUREMANAGE 0x00000010
-/* reserved bits */
-#define DDSCAPS2_RESERVED1 0x00000020
-#define DDSCAPS2_RESERVED2 0x00000040
-/* indicates surface will never be locked again */
-#define DDSCAPS2_OPAQUE 0x00000080
-/* set at CreateSurface() time to indicate antialising will be used */
-#define DDSCAPS2_HINTANTIALIASING 0x00000100
-/* set at CreateSurface() time to indicate cubic environment map */
-#define DDSCAPS2_CUBEMAP 0x00000200
-/* face flags for cube maps */
-#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
-#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
-#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
-#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
-#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
-#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
-/* specifies all faces of a cube for CreateSurface() */
-#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\
- DDSCAPS2_CUBEMAP_NEGATIVEX |\
- DDSCAPS2_CUBEMAP_POSITIVEY |\
- DDSCAPS2_CUBEMAP_NEGATIVEY |\
- DDSCAPS2_CUBEMAP_POSITIVEZ |\
- DDSCAPS2_CUBEMAP_NEGATIVEZ )
-/* set for mipmap sublevels on DirectX7 and later. ignored by CreateSurface() */
-#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000
-/* indicates texture surface to be managed by Direct3D *only* */
-#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000
-/* indicates managed surface that can safely be lost */
-#define DDSCAPS2_DONOTPERSIST 0x00040000
-/* indicates surface is part of a stereo flipping chain */
-#define DDSCAPS2_STEREOSURFACELEFT 0x00080000
-
-typedef struct _DDSCAPS2 {
- DWORD dwCaps; /* capabilities of surface wanted */
- DWORD dwCaps2; /* additional capabilities */
- DWORD dwCaps3; /* reserved capabilities */
- DWORD dwCaps4; /* more reserved capabilities */
-} DDSCAPS2,*LPDDSCAPS2;
-
-#define DD_ROP_SPACE (256/32) /* space required to store ROP array */
-
-typedef struct _DDCAPS_DX7 /* DirectX 7 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
- DDSCAPS2 ddsCaps; /* surface capabilities */
-} DDCAPS_DX7,*LPDDCAPS_DX7;
-
-typedef struct _DDCAPS_DX6 /* DirectX 6 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
- /* and one new member for DirectX 6 */
- DDSCAPS2 ddsCaps; /* surface capabilities */
-} DDCAPS_DX6,*LPDDCAPS_DX6;
-
-typedef struct _DDCAPS_DX5 /* DirectX5 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- /* the following are the new DirectX 5 members */
- DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
- DWORD dwCurrVideoPorts; /* current number of video ports used */
- DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
- DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
- DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
- DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
- DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
- DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
-} DDCAPS_DX5,*LPDDCAPS_DX5;
-
-typedef struct _DDCAPS_DX3 /* DirectX3 version of caps struct */
-{
- DWORD dwSize; /* size of the DDDRIVERCAPS structure */
- DWORD dwCaps; /* driver specific capabilities */
- DWORD dwCaps2; /* more driver specific capabilites */
- DWORD dwCKeyCaps; /* color key capabilities of the surface */
- DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
- DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
- DWORD dwPalCaps; /* palette capabilities */
- DWORD dwSVCaps; /* stereo vision capabilities */
- DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
- DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
- DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
- DWORD dwVidMemTotal; /* total amount of video memory */
- DWORD dwVidMemFree; /* amount of free video memory */
- DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
- DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
- DWORD dwNumFourCCCodes; /* number of four cc codes */
- DWORD dwAlignBoundarySrc; /* source rectangle alignment */
- DWORD dwAlignSizeSrc; /* source rectangle byte size */
- DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
- DWORD dwAlignSizeDest; /* dest rectangle byte size */
- DWORD dwAlignStrideAlign; /* stride alignment */
- DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
- DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
- DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
- DWORD dwReserved1;
- DWORD dwReserved2;
- DWORD dwReserved3;
- DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
- DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
- DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
- DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
- DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
- DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
- DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
- DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
- DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
- DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
- DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
- DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
- DWORD dwReserved4;
- DWORD dwReserved5;
- DWORD dwReserved6;
-} DDCAPS_DX3,*LPDDCAPS_DX3;
-
-/* set caps struct according to DIRECTDRAW_VERSION */
-
-#if DIRECTDRAW_VERSION <= 0x300
-typedef DDCAPS_DX3 DDCAPS;
-#elif DIRECTDRAW_VERSION <= 0x500
-typedef DDCAPS_DX5 DDCAPS;
-#elif DIRECTDRAW_VERSION <= 0x600
-typedef DDCAPS_DX6 DDCAPS;
-#else
-typedef DDCAPS_DX7 DDCAPS;
-#endif
-
-typedef DDCAPS *LPDDCAPS;
-
-/* DDCAPS.dwCaps */
-#define DDCAPS_3D 0x00000001
-#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002
-#define DDCAPS_ALIGNSIZEDEST 0x00000004
-#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008
-#define DDCAPS_ALIGNSIZESRC 0x00000010
-#define DDCAPS_ALIGNSTRIDE 0x00000020
-#define DDCAPS_BLT 0x00000040
-#define DDCAPS_BLTQUEUE 0x00000080
-#define DDCAPS_BLTFOURCC 0x00000100
-#define DDCAPS_BLTSTRETCH 0x00000200
-#define DDCAPS_GDI 0x00000400
-#define DDCAPS_OVERLAY 0x00000800
-#define DDCAPS_OVERLAYCANTCLIP 0x00001000
-#define DDCAPS_OVERLAYFOURCC 0x00002000
-#define DDCAPS_OVERLAYSTRETCH 0x00004000
-#define DDCAPS_PALETTE 0x00008000
-#define DDCAPS_PALETTEVSYNC 0x00010000
-#define DDCAPS_READSCANLINE 0x00020000
-#define DDCAPS_STEREOVIEW 0x00040000
-#define DDCAPS_VBI 0x00080000
-#define DDCAPS_ZBLTS 0x00100000
-#define DDCAPS_ZOVERLAYS 0x00200000
-#define DDCAPS_COLORKEY 0x00400000
-#define DDCAPS_ALPHA 0x00800000
-#define DDCAPS_COLORKEYHWASSIST 0x01000000
-#define DDCAPS_NOHARDWARE 0x02000000
-#define DDCAPS_BLTCOLORFILL 0x04000000
-#define DDCAPS_BANKSWITCHED 0x08000000
-#define DDCAPS_BLTDEPTHFILL 0x10000000
-#define DDCAPS_CANCLIP 0x20000000
-#define DDCAPS_CANCLIPSTRETCHED 0x40000000
-#define DDCAPS_CANBLTSYSMEM 0x80000000
-
-/* DDCAPS.dwCaps2 */
-#define DDCAPS2_CERTIFIED 0x00000001
-#define DDCAPS2_NO2DDURING3DSCENE 0x00000002
-#define DDCAPS2_VIDEOPORT 0x00000004
-#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008
-#define DDCAPS2_CANBOBINTERLEAVED 0x00000010
-#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020
-#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040
-#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080
-#define DDCAPS2_CANDROPZ16BIT 0x00000100
-#define DDCAPS2_NONLOCALVIDMEM 0x00000200
-#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400
-#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800
-#define DDCAPS2_WIDESURFACES 0x00001000
-#define DDCAPS2_CANFLIPODDEVEN 0x00002000
-#define DDCAPS2_CANBOBHARDWARE 0x00004000
-#define DDCAPS2_COPYFOURCC 0x00008000
-#define DDCAPS2_PRIMARYGAMMA 0x00020000
-#define DDCAPS2_CANRENDERWINDOWED 0x00080000
-#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000
-#define DDCAPS2_FLIPINTERVAL 0x00200000
-#define DDCAPS2_FLIPNOVSYNC 0x00400000
-#define DDCAPS2_CANMANAGETEXTURE 0x00800000
-#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000
-#define DDCAPS2_STEREO 0x02000000
-#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000
-
-
-/* Set/Get Colour Key Flags */
-#define DDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */
-#define DDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */
-#define DDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */
-#define DDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */
-#define DDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */
-
-typedef struct _DDCOLORKEY
-{
- DWORD dwColorSpaceLowValue;/* low boundary of color space that is to
- * be treated as Color Key, inclusive
- */
- DWORD dwColorSpaceHighValue;/* high boundary of color space that is
- * to be treated as Color Key, inclusive
- */
-} DDCOLORKEY,*LPDDCOLORKEY;
-
-/* ddCKEYCAPS bits */
-#define DDCKEYCAPS_DESTBLT 0x00000001
-#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002
-#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004
-#define DDCKEYCAPS_DESTBLTYUV 0x00000008
-#define DDCKEYCAPS_DESTOVERLAY 0x00000010
-#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020
-#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
-#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
-#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100
-#define DDCKEYCAPS_SRCBLT 0x00000200
-#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400
-#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
-#define DDCKEYCAPS_SRCBLTYUV 0x00001000
-#define DDCKEYCAPS_SRCOVERLAY 0x00002000
-#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
-#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
-#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
-#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000
-#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000
-
-typedef struct _DDPIXELFORMAT {
- DWORD dwSize; /* 0: size of structure */
- DWORD dwFlags; /* 4: pixel format flags */
- DWORD dwFourCC; /* 8: (FOURCC code) */
- union {
- DWORD dwRGBBitCount; /* C: how many bits per pixel */
- DWORD dwYUVBitCount; /* C: how many bits per pixel */
- DWORD dwZBufferBitDepth; /* C: how many bits for z buffers */
- DWORD dwAlphaBitDepth; /* C: how many bits for alpha channels*/
- DWORD dwLuminanceBitCount;
- DWORD dwBumpBitCount;
- } DUMMYUNIONNAME1;
- union {
- DWORD dwRBitMask; /* 10: mask for red bit*/
- DWORD dwYBitMask; /* 10: mask for Y bits*/
- DWORD dwStencilBitDepth;
- DWORD dwLuminanceBitMask;
- DWORD dwBumpDuBitMask;
- } DUMMYUNIONNAME2;
- union {
- DWORD dwGBitMask; /* 14: mask for green bits*/
- DWORD dwUBitMask; /* 14: mask for U bits*/
- DWORD dwZBitMask;
- DWORD dwBumpDvBitMask;
- } DUMMYUNIONNAME3;
- union {
- DWORD dwBBitMask; /* 18: mask for blue bits*/
- DWORD dwVBitMask; /* 18: mask for V bits*/
- DWORD dwStencilBitMask;
- DWORD dwBumpLuminanceBitMask;
- } DUMMYUNIONNAME4;
- union {
- DWORD dwRGBAlphaBitMask; /* 1C: mask for alpha channel */
- DWORD dwYUVAlphaBitMask; /* 1C: mask for alpha channel */
- DWORD dwLuminanceAlphaBitMask;
- DWORD dwRGBZBitMask; /* 1C: mask for Z channel */
- DWORD dwYUVZBitMask; /* 1C: mask for Z channel */
- } DUMMYUNIONNAME5;
- /* 20: next structure */
-} DDPIXELFORMAT,*LPDDPIXELFORMAT;
-
-/* DDCAPS.dwFXCaps */
-#define DDFXCAPS_BLTALPHA 0x00000001
-#define DDFXCAPS_OVERLAYALPHA 0x00000004
-#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010
-#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020
-#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040
-#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080
-#define DDFXCAPS_BLTROTATION 0x00000100
-#define DDFXCAPS_BLTROTATION90 0x00000200
-#define DDFXCAPS_BLTSHRINKX 0x00000400
-#define DDFXCAPS_BLTSHRINKXN 0x00000800
-#define DDFXCAPS_BLTSHRINKY 0x00001000
-#define DDFXCAPS_BLTSHRINKYN 0x00002000
-#define DDFXCAPS_BLTSTRETCHX 0x00004000
-#define DDFXCAPS_BLTSTRETCHXN 0x00008000
-#define DDFXCAPS_BLTSTRETCHY 0x00010000
-#define DDFXCAPS_BLTSTRETCHYN 0x00020000
-#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000
-#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008
-#define DDFXCAPS_OVERLAYSHRINKX 0x00080000
-#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000
-#define DDFXCAPS_OVERLAYSHRINKY 0x00200000
-#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000
-#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000
-#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000
-#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000
-#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000
-#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000
-#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000
-
-#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY
-
-/* DDCAPS.dwFXAlphaCaps */
-#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001
-#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002
-#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004
-#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008
-#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010
-#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020
-#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040
-#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080
-#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100
-#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200
-
-/* DDCAPS.dwPalCaps */
-#define DDPCAPS_4BIT 0x00000001
-#define DDPCAPS_8BITENTRIES 0x00000002
-#define DDPCAPS_8BIT 0x00000004
-#define DDPCAPS_INITIALIZE 0x00000008
-#define DDPCAPS_PRIMARYSURFACE 0x00000010
-#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020
-#define DDPCAPS_ALLOW256 0x00000040
-#define DDPCAPS_VSYNC 0x00000080
-#define DDPCAPS_1BIT 0x00000100
-#define DDPCAPS_2BIT 0x00000200
-#define DDPCAPS_ALPHA 0x00000400
-
-/* DDCAPS.dwSVCaps */
-/* the first 4 of these are now obsolete */
-#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch occured */
-#define DDSVCAPS_RESERVED1 0x00000001
-#define DDSVCAPS_RESERVED2 0x00000002
-#define DDSVCAPS_RESERVED3 0x00000004
-#define DDSVCAPS_RESERVED4 0x00000008
-#else
-#define DDSVCAPS_ENIGMA 0x00000001
-#define DDSVCAPS_FLICKER 0x00000002
-#define DDSVCAPS_REDBLUE 0x00000004
-#define DDSVCAPS_SPLIT 0x00000008
-#endif
-#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010
-
-/* BitDepths */
-#define DDBD_1 0x00004000
-#define DDBD_2 0x00002000
-#define DDBD_4 0x00001000
-#define DDBD_8 0x00000800
-#define DDBD_16 0x00000400
-#define DDBD_24 0x00000200
-#define DDBD_32 0x00000100
-
-/* DDOVERLAYFX.dwDDFX */
-#define DDOVERFX_ARITHSTRETCHY 0x00000001
-#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002
-#define DDOVERFX_MIRRORUPDOWN 0x00000004
-
-/* UpdateOverlay flags */
-#define DDOVER_ALPHADEST 0x00000001
-#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002
-#define DDOVER_ALPHADESTNEG 0x00000004
-#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008
-#define DDOVER_ALPHAEDGEBLEND 0x00000010
-#define DDOVER_ALPHASRC 0x00000020
-#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040
-#define DDOVER_ALPHASRCNEG 0x00000080
-#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100
-#define DDOVER_HIDE 0x00000200
-#define DDOVER_KEYDEST 0x00000400
-#define DDOVER_KEYDESTOVERRIDE 0x00000800
-#define DDOVER_KEYSRC 0x00001000
-#define DDOVER_KEYSRCOVERRIDE 0x00002000
-#define DDOVER_SHOW 0x00004000
-#define DDOVER_ADDDIRTYRECT 0x00008000
-#define DDOVER_REFRESHDIRTYRECTS 0x00010000
-#define DDOVER_REFRESHALL 0x00020000
-#define DDOVER_DDFX 0x00080000
-#define DDOVER_AUTOFLIP 0x00100000
-#define DDOVER_BOB 0x00200000
-#define DDOVER_OVERRIDEBOBWEAVE 0x00400000
-#define DDOVER_INTERLEAVED 0x00800000
-
-/* DDCOLORKEY.dwFlags */
-#define DDPF_ALPHAPIXELS 0x00000001
-#define DDPF_ALPHA 0x00000002
-#define DDPF_FOURCC 0x00000004
-#define DDPF_PALETTEINDEXED4 0x00000008
-#define DDPF_PALETTEINDEXEDTO8 0x00000010
-#define DDPF_PALETTEINDEXED8 0x00000020
-#define DDPF_RGB 0x00000040
-#define DDPF_COMPRESSED 0x00000080
-#define DDPF_RGBTOYUV 0x00000100
-#define DDPF_YUV 0x00000200
-#define DDPF_ZBUFFER 0x00000400
-#define DDPF_PALETTEINDEXED1 0x00000800
-#define DDPF_PALETTEINDEXED2 0x00001000
-#define DDPF_ZPIXELS 0x00002000
-#define DDPF_STENCILBUFFER 0x00004000
-#define DDPF_ALPHAPREMULT 0x00008000
-#define DDPF_LUMINANCE 0x00020000
-#define DDPF_BUMPLUMINANCE 0x00040000
-#define DDPF_BUMPDUDV 0x00080000
-
-/* SetCooperativeLevel dwFlags */
-#define DDSCL_FULLSCREEN 0x00000001
-#define DDSCL_ALLOWREBOOT 0x00000002
-#define DDSCL_NOWINDOWCHANGES 0x00000004
-#define DDSCL_NORMAL 0x00000008
-#define DDSCL_EXCLUSIVE 0x00000010
-#define DDSCL_ALLOWMODEX 0x00000040
-#define DDSCL_SETFOCUSWINDOW 0x00000080
-#define DDSCL_SETDEVICEWINDOW 0x00000100
-#define DDSCL_CREATEDEVICEWINDOW 0x00000200
-#define DDSCL_MULTITHREADED 0x00000400
-#define DDSCL_FPUSETUP 0x00000800
-#define DDSCL_FPUPRESERVE 0x00001000
-
-
-/* DDSURFACEDESC.dwFlags */
-#define DDSD_CAPS 0x00000001
-#define DDSD_HEIGHT 0x00000002
-#define DDSD_WIDTH 0x00000004
-#define DDSD_PITCH 0x00000008
-#define DDSD_BACKBUFFERCOUNT 0x00000020
-#define DDSD_ZBUFFERBITDEPTH 0x00000040
-#define DDSD_ALPHABITDEPTH 0x00000080
-#define DDSD_LPSURFACE 0x00000800
-#define DDSD_PIXELFORMAT 0x00001000
-#define DDSD_CKDESTOVERLAY 0x00002000
-#define DDSD_CKDESTBLT 0x00004000
-#define DDSD_CKSRCOVERLAY 0x00008000
-#define DDSD_CKSRCBLT 0x00010000
-#define DDSD_MIPMAPCOUNT 0x00020000
-#define DDSD_REFRESHRATE 0x00040000
-#define DDSD_LINEARSIZE 0x00080000
-#define DDSD_TEXTURESTAGE 0x00100000
-#define DDSD_FVF 0x00200000
-#define DDSD_SRCVBHANDLE 0x00400000
-#define DDSD_ALL 0x007ff9ee
-
-/* EnumSurfaces flags */
-#define DDENUMSURFACES_ALL 0x00000001
-#define DDENUMSURFACES_MATCH 0x00000002
-#define DDENUMSURFACES_NOMATCH 0x00000004
-#define DDENUMSURFACES_CANBECREATED 0x00000008
-#define DDENUMSURFACES_DOESEXIST 0x00000010
-
-/* SetDisplayMode flags */
-#define DDSDM_STANDARDVGAMODE 0x00000001
-
-/* EnumDisplayModes flags */
-#define DDEDM_REFRESHRATES 0x00000001
-#define DDEDM_STANDARDVGAMODES 0x00000002
-
-/* WaitForVerticalDisplay flags */
-
-#define DDWAITVB_BLOCKBEGIN 0x00000001
-#define DDWAITVB_BLOCKBEGINEVENT 0x00000002
-#define DDWAITVB_BLOCKEND 0x00000004
-
-typedef struct _DDSURFACEDESC
-{
- DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
- DWORD dwFlags; /* 4: determines what fields are valid*/
- DWORD dwHeight; /* 8: height of surface to be created*/
- DWORD dwWidth; /* C: width of input surface*/
- union {
- LONG lPitch; /* 10: distance to start of next line (return value only)*/
- DWORD dwLinearSize;
- } DUMMYUNIONNAME1;
- DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
- union {
- DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
- DWORD dwZBufferBitDepth;/*18: depth of Z buffer requested*/
- DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
- } DUMMYUNIONNAME2;
- DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
- DWORD dwReserved; /* 20:reserved*/
- LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
- DDCOLORKEY ddckCKDestOverlay;/* 28: CK for dest overlay use*/
- DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
- DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
- DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
- DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
- DDSCAPS ddsCaps; /* 68: direct draw surface caps */
-} DDSURFACEDESC,*LPDDSURFACEDESC;
-
-typedef struct _DDSURFACEDESC2
-{
- DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
- DWORD dwFlags; /* 4: determines what fields are valid*/
- DWORD dwHeight; /* 8: height of surface to be created*/
- DWORD dwWidth; /* C: width of input surface*/
- union {
- LONG lPitch; /*10: distance to start of next line (return value only)*/
- DWORD dwLinearSize; /*10: formless late-allocated optimized surface size */
- } DUMMYUNIONNAME1;
- DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
- union {
- DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
- DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
- DWORD dwSrcVBHandle;/* 18:source used in VB::Optimize */
- } DUMMYUNIONNAME2;
- DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
- DWORD dwReserved; /* 20:reserved*/
- LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
- union {
- DDCOLORKEY ddckCKDestOverlay; /* 28: CK for dest overlay use*/
- DWORD dwEmptyFaceColor; /* 28: color for empty cubemap faces */
- } DUMMYUNIONNAME3;
- DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
- DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
- DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
-
- union {
- DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
- DWORD dwFVF; /* 48: vertex format description of vertex buffers */
- } DUMMYUNIONNAME4;
- DDSCAPS2 ddsCaps; /* 68: DDraw surface caps */
- DWORD dwTextureStage; /* 78: stage in multitexture cascade */
-} DDSURFACEDESC2,*LPDDSURFACEDESC2;
-
-/* DDCOLORCONTROL.dwFlags */
-#define DDCOLOR_BRIGHTNESS 0x00000001
-#define DDCOLOR_CONTRAST 0x00000002
-#define DDCOLOR_HUE 0x00000004
-#define DDCOLOR_SATURATION 0x00000008
-#define DDCOLOR_SHARPNESS 0x00000010
-#define DDCOLOR_GAMMA 0x00000020
-#define DDCOLOR_COLORENABLE 0x00000040
-
-typedef struct {
- DWORD dwSize;
- DWORD dwFlags;
- LONG lBrightness;
- LONG lContrast;
- LONG lHue;
- LONG lSaturation;
- LONG lSharpness;
- LONG lGamma;
- LONG lColorEnable;
- DWORD dwReserved1;
-} DDCOLORCONTROL,*LPDDCOLORCONTROL;
-
-typedef struct {
- WORD red[256];
- WORD green[256];
- WORD blue[256];
-} DDGAMMARAMP,*LPDDGAMMARAMP;
-
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID);
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID);
-DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK)
-
-typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
-typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID);
-
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR);
-typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
-DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACKEX)
-
-HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
-HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
-#define DirectDrawEnumerateEx WINELIB_NAME_AW(DirectDrawEnumerateEx)
-
-/* flags for DirectDrawEnumerateEx */
-#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001
-#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002
-#define DDENUM_NONDISPLAYDEVICES 0x00000004
-
-/* flags for DirectDrawCreate or IDirectDraw::Initialize */
-#define DDCREATE_HARDWAREONLY 1L
-#define DDCREATE_EMULATIONONLY 2L
-
-typedef struct _DDBLTFX
-{
- DWORD dwSize; /* size of structure */
- DWORD dwDDFX; /* FX operations */
- DWORD dwROP; /* Win32 raster operations */
- DWORD dwDDROP; /* Raster operations new for DirectDraw */
- DWORD dwRotationAngle; /* Rotation angle for blt */
- DWORD dwZBufferOpCode; /* ZBuffer compares */
- DWORD dwZBufferLow; /* Low limit of Z buffer */
- DWORD dwZBufferHigh; /* High limit of Z buffer */
- DWORD dwZBufferBaseDest; /* Destination base value */
- DWORD dwZDestConstBitDepth; /* Bit depth used to specify Z constant for destination */
- union
- {
- DWORD dwZDestConst; /* Constant to use as Z buffer for dest */
- LPDIRECTDRAWSURFACE lpDDSZBufferDest; /* Surface to use as Z buffer for dest */
- } DUMMYUNIONNAME1;
- DWORD dwZSrcConstBitDepth; /* Bit depth used to specify Z constant for source */
- union
- {
- DWORD dwZSrcConst; /* Constant to use as Z buffer for src */
- LPDIRECTDRAWSURFACE lpDDSZBufferSrc; /* Surface to use as Z buffer for src */
- } DUMMYUNIONNAME2;
- DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
- DWORD dwAlphaEdgeBlend; /* Alpha for edge blending */
- DWORD dwReserved;
- DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
- union
- {
- DWORD dwAlphaDestConst; /* Constant to use as Alpha Channel */
- LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as Alpha Channel */
- } DUMMYUNIONNAME3;
- DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
- union
- {
- DWORD dwAlphaSrcConst; /* Constant to use as Alpha Channel */
- LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as Alpha Channel */
- } DUMMYUNIONNAME4;
- union
- {
- DWORD dwFillColor; /* color in RGB or Palettized */
- DWORD dwFillDepth; /* depth value for z-buffer */
- DWORD dwFillPixel; /* pixel val for RGBA or RGBZ */
- LPDIRECTDRAWSURFACE lpDDSPattern; /* Surface to use as pattern */
- } DUMMYUNIONNAME5;
- DDCOLORKEY ddckDestColorkey; /* DestColorkey override */
- DDCOLORKEY ddckSrcColorkey; /* SrcColorkey override */
-} DDBLTFX,*LPDDBLTFX;
-
-/* dwDDFX */
-/* arithmetic stretching along y axis */
-#define DDBLTFX_ARITHSTRETCHY 0x00000001
-/* mirror on y axis */
-#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002
-/* mirror on x axis */
-#define DDBLTFX_MIRRORUPDOWN 0x00000004
-/* do not tear */
-#define DDBLTFX_NOTEARING 0x00000008
-/* 180 degrees clockwise rotation */
-#define DDBLTFX_ROTATE180 0x00000010
-/* 270 degrees clockwise rotation */
-#define DDBLTFX_ROTATE270 0x00000020
-/* 90 degrees clockwise rotation */
-#define DDBLTFX_ROTATE90 0x00000040
-/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
-#define DDBLTFX_ZBUFFERRANGE 0x00000080
-/* add dwZBufferBaseDest to every source z value before compare */
-#define DDBLTFX_ZBUFFERBASEDEST 0x00000100
-
-typedef struct _DDOVERLAYFX
-{
- DWORD dwSize; /* size of structure */
- DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
- DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */
- DWORD dwReserved;
- DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
- union
- {
- DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */
- LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as alpha channel for dest */
- } DUMMYUNIONNAME1;
- DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
- union
- {
- DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */
- LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as alpha channel for src */
- } DUMMYUNIONNAME2;
- DDCOLORKEY dckDestColorkey; /* DestColorkey override */
- DDCOLORKEY dckSrcColorkey; /* DestColorkey override */
- DWORD dwDDFX; /* Overlay FX */
- DWORD dwFlags; /* flags */
-} DDOVERLAYFX,*LPDDOVERLAYFX;
-
-typedef struct _DDBLTBATCH
-{
- LPRECT lprDest;
- LPDIRECTDRAWSURFACE lpDDSSrc;
- LPRECT lprSrc;
- DWORD dwFlags;
- LPDDBLTFX lpDDBltFx;
-} DDBLTBATCH,*LPDDBLTBATCH;
-
-#define MAX_DDDEVICEID_STRING 512
-
-typedef struct tagDDDEVICEIDENTIFIER {
- char szDriver[MAX_DDDEVICEID_STRING];
- char szDescription[MAX_DDDEVICEID_STRING];
- LARGE_INTEGER liDriverVersion;
- DWORD dwVendorId;
- DWORD dwDeviceId;
- DWORD dwSubSysId;
- DWORD dwRevision;
- GUID guidDeviceIdentifier;
-} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
-
-typedef struct tagDDDEVICEIDENTIFIER2 {
- char szDriver[MAX_DDDEVICEID_STRING]; /* user readable driver name */
- char szDescription[MAX_DDDEVICEID_STRING]; /* user readable description */
- LARGE_INTEGER liDriverVersion; /* driver version */
- DWORD dwVendorId; /* vendor ID, zero if unknown */
- DWORD dwDeviceId; /* chipset ID, zero if unknown */
- DWORD dwSubSysId; /* board ID, zero if unknown */
- DWORD dwRevision; /* chipset version, zero if unknown */
- GUID guidDeviceIdentifier; /* unique ID for this driver/chipset combination */
- DWORD dwWHQLLevel; /* Windows Hardware Quality Lab certification level */
-} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2;
-
-/*****************************************************************************
- * IDirectDrawPalette interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawPalette
-DECLARE_INTERFACE_(IDirectDrawPalette,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDWORD lpdwCaps) PURE;
- STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable) PURE;
- STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawPalette_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawPalette_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDrawPalette methods ***/
-#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL_(GetEntries,p,(p,a,b,c,d))
-#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL_(Initialize,p,(p,a,b,c))
-#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL_(SetEntries,p,(p,a,b,c,d))
-
-
-/*****************************************************************************
- * IDirectDrawClipper interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawClipper
-DECLARE_INTERFACE_(IDirectDrawClipper,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE;
- STDMETHOD(GetHWnd)(THIS_ HWND* lphWnd) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags) PURE;
- STDMETHOD(IsClipListChanged)(THIS_ BOOL* lpbChanged) PURE;
- STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE;
- STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawClipper_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawClipper_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDrawClipper methods ***/
-#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL_(GetClipList,p,(p,a,b,c))
-#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL_(GetHWnd,p,(p,a))
-#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL_(IsClipListChanged,p,(p,a))
-#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL_(SetClipList,p,(p,a,b))
-#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL_(SetHWnd,p,(p,a,b))
-
-
-/*****************************************************************************
- * IDirectDraw interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDraw
-DECLARE_INTERFACE_(IDirectDraw,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(Compact)(THIS) PURE;
- STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE* lplpDDSurface, IUnknown* pUnkOuter) PURE;
- STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE* lplpDupDDSurface) PURE;
- STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
- STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(FlipToGDISurface)(THIS) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
- STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
- STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE* lplpGDIDDSurface) PURE;
- STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
- STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
- STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE;
- STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE;
- STDMETHOD(RestoreDisplayMode)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
- STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD, DWORD) PURE;
- STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDraw_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDraw_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDraw methods ***/
-#define IDirectDraw_Compact(p) ICOM_CALL_(Compact,p,(p))
-#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c))
-#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d))
-#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c))
-#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b))
-#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d))
-#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d))
-#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p))
-#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b))
-#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a))
-#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b))
-#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a))
-#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a))
-#define IDirectDraw_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a))
-#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a))
-#define IDirectDraw_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a))
-#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p))
-#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b))
-#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c))
-#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b))
-
-
-/* flags for Lock() */
-#define DDLOCK_SURFACEMEMORYPTR 0x00000000
-#define DDLOCK_WAIT 0x00000001
-#define DDLOCK_EVENT 0x00000002
-#define DDLOCK_READONLY 0x00000010
-#define DDLOCK_WRITEONLY 0x00000020
-#define DDLOCK_NOSYSLOCK 0x00000800
-
-
-/*****************************************************************************
- * IDirectDraw2 interface
- */
-/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of
- * arguments of SetDisplayMode has changed !
- */
-#undef INTERFACE
-#define INTERFACE IDirectDraw2
-DECLARE_INTERFACE_(IDirectDraw2,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(Compact)(THIS) PURE;
- STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2* lplpDDSurface, IUnknown* pUnkOuter) PURE;
- STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurface, LPDIRECTDRAWSURFACE2* lplpDupDDSurface) PURE;
- STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
- STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(FlipToGDISurface)(THIS) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
- STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
- STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE2* lplpGDIDDSurface) PURE;
- STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
- STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
- STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE;
- STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE;
- STDMETHOD(RestoreDisplayMode)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
- STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
- STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
-
- STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDraw2_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDraw2_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDraw methods ***/
-#define IDirectDraw2_Compact(p) ICOM_CALL_(Compact,p,(p))
-#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c))
-#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d))
-#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c))
-#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b))
-#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d))
-#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d))
-#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p))
-#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b))
-#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a))
-#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b))
-#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a))
-#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a))
-#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a))
-#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a))
-#define IDirectDraw2_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a))
-#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p))
-#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b))
-#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e))
-#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b))
-/*** IDirectDraw2 methods ***/
-#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c))
-
-
-/*****************************************************************************
- * IDirectDraw4 interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDraw4
-DECLARE_INTERFACE_(IDirectDraw4,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(Compact)(THIS) PURE;
- STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4* lplpDDSurface, IUnknown* pUnkOuter) PURE;
- STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4* lplpDupDDSurface) PURE;
- STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE;
- STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback) PURE;
- STDMETHOD(FlipToGDISurface)(THIS) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
- STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
- STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
- STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4* lplpGDIDDSurface) PURE;
- STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
- STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
- STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE;
- STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE;
- STDMETHOD(RestoreDisplayMode)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
- STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
- STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
-
- STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
-
- STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE4* ) PURE;
- STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
- STDMETHOD(TestCooperativeLevel)(THIS) PURE;
- STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER , DWORD ) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDraw4_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDraw4_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDraw methods ***/
-#define IDirectDraw4_Compact(p) ICOM_CALL_(Compact,p,(p))
-#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c))
-#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d))
-#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c))
-#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b))
-#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d))
-#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d))
-#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p))
-#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b))
-#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a))
-#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b))
-#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a))
-#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a))
-#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a))
-#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a))
-#define IDirectDraw4_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a))
-#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p))
-#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b))
-#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e))
-#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b))
-/*** IDirectDraw2 methods ***/
-#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c))
-/*** IDirectDraw4 methods ***/
-#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b))
-#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL_(RestoreAllSurfaces,p,(p))
-#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p))
-#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b))
-
-
-/*****************************************************************************
- * IDirectDraw7 interface
- */
-/* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented
- * as not interchangeable with earlier DirectDraw interfaces.
- */
-#undef INTERFACE
-#define INTERFACE IDirectDraw7
-DECLARE_INTERFACE_(IDirectDraw7,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(Compact)(THIS) PURE;
- STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE* lplpDDPalette, IUnknown* pUnkOuter) PURE;
- STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7* lplpDDSurface, IUnknown* pUnkOuter) PURE;
- STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7* lplpDupDDSurface) PURE;
- STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE;
- STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE;
- STDMETHOD(FlipToGDISurface)(THIS) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
- STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
- STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
- STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7* lplpGDIDDSurface) PURE;
- STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
- STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
- STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL* lpbIsInVB) PURE;
- STDMETHOD(Initialize)(THIS_ GUID* lpGUID) PURE;
- STDMETHOD(RestoreDisplayMode)(THIS) PURE;
- STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
- STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
- STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
-
- STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
-
- STDMETHOD(GetSurfaceFromDC)(THIS_ HDC , LPDIRECTDRAWSURFACE7* ) PURE;
- STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
- STDMETHOD(TestCooperativeLevel)(THIS) PURE;
- STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2 , DWORD ) PURE;
-
- STDMETHOD(StartModeTest)(THIS_ LPSIZE , DWORD , DWORD ) PURE;
- STDMETHOD(EvaluateMode)(THIS_ DWORD , DWORD * ) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDraw7_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDraw7_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDraw methods ***/
-#define IDirectDraw7_Compact(p) ICOM_CALL_(Compact,p,(p))
-#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL_(CreateClipper,p,(p,a,b,c))
-#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL_(CreatePalette,p,(p,a,b,c,d))
-#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL_(CreateSurface,p,(p,a,b,c))
-#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL_(DuplicateSurface,p,(p,a,b))
-#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL_(EnumDisplayModes,p,(p,a,b,c,d))
-#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL_(EnumSurfaces,p,(p,a,b,c,d))
-#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL_(FlipToGDISurface,p,(p))
-#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL_(GetCaps,p,(p,a,b))
-#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL_(GetDisplayMode,p,(p,a))
-#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL_(GetFourCCCodes,p,(p,a,b))
-#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL_(GetGDISurface,p,(p,a))
-#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL_(GetMonitorFrequency,p,(p,a))
-#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL_(GetScanLine,p,(p,a))
-#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL_(GetVerticalBlankStatus,p,(p,a))
-#define IDirectDraw7_Initialize(p,a) ICOM_CALL_(Initialize,p,(p,a))
-#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL_(RestoreDisplayMode,p,(p))
-#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL_(SetCooperativeLevel,p,(p,a,b))
-#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL_(SetDisplayMode,p,(p,a,b,c,d,e))
-#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL_(WaitForVerticalBlank,p,(p,a,b))
-/*** added in IDirectDraw2 ***/
-#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL_(GetAvailableVidMem,p,(p,a,b,c))
-/*** added in IDirectDraw4 ***/
-#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL_(GetSurfaceFromDC,p,(p,a,b))
-#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL_(RestoreAllSurfaces,p,(p))
-#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL_(TestCooperativeLevel,p,(p))
-#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL_(GetDeviceIdentifier,p,(p,a,b))
-/*** added in IDirectDraw 7 ***/
-#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL_(StartModeTest,p,(p,a,b,c))
-#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL_(EvaluateMode,p,(p,a,b))
-
-
-/*****************************************************************************
- * IDirectDrawSurface interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawSurface
-DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE;
- STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
- STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
- STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
- STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
- STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE;
- STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
- STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
- STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE* lplpDDAttachedSurface) PURE;
- STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
- STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE;
- STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE;
- STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
- STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE;
- STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
- STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(IsLost)(THIS) PURE;
- STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
- STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
- STDMETHOD(Restore)(THIS) PURE;
- STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
- STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
- STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
- STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
- STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
- STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawSurface_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawSurface_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDrawSurface methods ***/
-#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a))
-#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a))
-#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c))
-#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b))
-#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c))
-#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b))
-#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a))
-#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a))
-#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b))
-#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a))
-#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a))
-#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a))
-#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a))
-#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a))
-#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawSurface_IsLost(p) ICOM_CALL_(IsLost,p,(p))
-#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d))
-#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a))
-#define IDirectDrawSurface_Restore(p) ICOM_CALL_(Restore,p,(p))
-#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a))
-#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b))
-#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a))
-#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a))
-#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a))
-#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b))
-
-
-/*****************************************************************************
- * IDirectDrawSurface2 interface
- */
-/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters
- * have been converted to LPDIRECTDRAWSURFACE2.
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawSurface2
-DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE;
- STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
- STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
- STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
- STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
- STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE;
- STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
- STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
- STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2* lplpDDAttachedSurface) PURE;
- STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
- STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE;
- STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE;
- STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
- STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE;
- STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
- STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(IsLost)(THIS) PURE;
- STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
- STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
- STDMETHOD(Restore)(THIS) PURE;
- STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
- STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
- STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
- STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
- STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
- STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference) PURE;
- /* added in v2 */
- STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE;
- STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawSurface2_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawSurface2_Release(p) ICOM_CALL_(Release,p,(p))
-/*** IDirectDrawSurface methods (almost) ***/
-#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a))
-#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a))
-#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c))
-#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b))
-#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c))
-#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b))
-#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a))
-#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a))
-#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b))
-#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a))
-#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a))
-#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a))
-#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a))
-#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a))
-#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawSurface2_IsLost(p) ICOM_CALL_(IsLost,p,(p))
-#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d))
-#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a))
-#define IDirectDrawSurface2_Restore(p) ICOM_CALL_(Restore,p,(p))
-#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a))
-#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b))
-#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a))
-#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a))
-#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a))
-#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b))
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a))
-#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a))
-#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a))
-
-
-/*****************************************************************************
- * IDirectDrawSurface3 interface
- */
-/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters
- * have been converted to LPDIRECTDRAWSURFACE3.
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawSurface3
-DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE;
- STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
- STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
- STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
- STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
- STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE;
- STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
- STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
- STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3* lplpDDAttachedSurface) PURE;
- STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
- STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE;
- STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE;
- STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
- STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE;
- STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
- STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(IsLost)(THIS) PURE;
- STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
- STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
- STDMETHOD(Restore)(THIS) PURE;
- STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
- STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
- STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
- STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
- STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
- STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference) PURE;
- /* added in v2 */
- STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE;
- STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
- /* added in v3 */
- STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawSurface3_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawSurface3_Release(p) ICOM_CALL_(Release,p,(p))
-/*** IDirectDrawSurface methods (almost) ***/
-#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a))
-#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a))
-#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c))
-#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b))
-#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c))
-#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b))
-#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a))
-#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a))
-#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b))
-#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a))
-#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a))
-#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a))
-#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a))
-#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a))
-#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawSurface3_IsLost(p) ICOM_CALL_(IsLost,p,(p))
-#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d))
-#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a))
-#define IDirectDrawSurface3_Restore(p) ICOM_CALL_(Restore,p,(p))
-#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a))
-#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b))
-#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a))
-#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a))
-#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a))
-#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b))
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a))
-#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a))
-#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a))
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b))
-
-
-/*****************************************************************************
- * IDirectDrawSurface4 interface
- */
-/* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2.
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawSurface4
-DECLARE_INTERFACE_(IDirectDrawSurface4,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE;
- STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
- STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
- STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
- STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
- STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE;
- STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
- STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
- STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
- STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE4* lplpDDAttachedSurface) PURE;
- STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE;
- STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE;
- STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE;
- STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
- STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE;
- STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
- STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
- STDMETHOD(IsLost)(THIS) PURE;
- STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
- STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
- STDMETHOD(Restore)(THIS) PURE;
- STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
- STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
- STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
- STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE;
- STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
- STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference) PURE;
- /* added in v2 */
- STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE;
- STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
- /* added in v3 */
- STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE;
- /* added in v4 */
- STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE;
- STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE;
- STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE;
- STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE;
- STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawSurface4_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawSurface4_Release(p) ICOM_CALL_(Release,p,(p))
-/*** IDirectDrawSurface (almost) methods ***/
-#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a))
-#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a))
-#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c))
-#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b))
-#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c))
-#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b))
-#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a))
-#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a))
-#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b))
-#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a))
-#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a))
-#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a))
-#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a))
-#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a))
-#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawSurface4_IsLost(p) ICOM_CALL_(IsLost,p,(p))
-#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d))
-#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a))
-#define IDirectDrawSurface4_Restore(p) ICOM_CALL_(Restore,p,(p))
-#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a))
-#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b))
-#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a))
-#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a))
-#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a))
-#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b))
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a))
-#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a))
-#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a))
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b))
-/*** IDirectDrawSurface4 methods ***/
-#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d))
-#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c))
-#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a))
-#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a))
-#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p))
-
-
-/*****************************************************************************
- * IDirectDrawSurface7 interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawSurface7
-DECLARE_INTERFACE_(IDirectDrawSurface7,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE;
- STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
- STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
- STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
- STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
- STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE;
- STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE;
- STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback) PURE;
- STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
- STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7* lplpDDAttachedSurface) PURE;
- STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE;
- STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER* lplpDDClipper) PURE;
- STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(GetDC)(THIS_ HDC* lphDC) PURE;
- STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
- STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE* lplpDDPalette) PURE;
- STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
- STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
- STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
- STDMETHOD(IsLost)(THIS) PURE;
- STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
- STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
- STDMETHOD(Restore)(THIS) PURE;
- STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
- STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
- STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
- STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
- STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE;
- STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
- STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference) PURE;
- /* added in v2 */
- STDMETHOD(GetDDInterface)(THIS_ LPVOID* lplpDD) PURE;
- STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
- /* added in v3 */
- STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags) PURE;
- /* added in v4 */
- STDMETHOD(SetPrivateData)(THIS_ REFGUID , LPVOID , DWORD , DWORD ) PURE;
- STDMETHOD(GetPrivateData)(THIS_ REFGUID , LPVOID , LPDWORD ) PURE;
- STDMETHOD(FreePrivateData)(THIS_ REFGUID ) PURE;
- STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD ) PURE;
- STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
- /* added in v7 */
- STDMETHOD(SetPriority)(THIS_ DWORD prio) PURE;
- STDMETHOD(GetPriority)(THIS_ LPDWORD prio) PURE;
- STDMETHOD(SetLOD)(THIS_ DWORD lod) PURE;
- STDMETHOD(GetLOD)(THIS_ LPDWORD lod) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawSurface7_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawSurface7_Release(p) ICOM_CALL_(Release,p,(p))
-/*** IDirectDrawSurface (almost) methods ***/
-#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL_(AddAttachedSurface,p,(p,a))
-#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL_(AddOverlayDirtyRect,p,(p,a))
-#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL_(Blt,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL_(BltBatch,p,(p,a,b,c))
-#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL_(BltFast,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL_(DeleteAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL_(EnumAttachedSurfaces,p,(p,a,b))
-#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL_(EnumOverlayZOrders,p,(p,a,b,c))
-#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL_(Flip,p,(p,a,b))
-#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL_(GetAttachedSurface,p,(p,a,b))
-#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL_(GetBltStatus,p,(p,a))
-#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL_(GetCaps,p,(p,a))
-#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL_(GetClipper,p,(p,a))
-#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL_(GetColorKey,p,(p,a,b))
-#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL_(GetDC,p,(p,a))
-#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL_(GetFlipStatus,p,(p,a))
-#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL_(GetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL_(GetPalette,p,(p,a))
-#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL_(GetPixelFormat,p,(p,a))
-#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL_(GetSurfaceDesc,p,(p,a))
-#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL_(Initialize,p,(p,a,b))
-#define IDirectDrawSurface7_IsLost(p) ICOM_CALL_(IsLost,p,(p))
-#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL_(Lock,p,(p,a,b,c,d))
-#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL_(ReleaseDC,p,(p,a))
-#define IDirectDrawSurface7_Restore(p) ICOM_CALL_(Restore,p,(p))
-#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL_(SetClipper,p,(p,a))
-#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL_(SetColorKey,p,(p,a,b))
-#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL_(SetOverlayPosition,p,(p,a,b))
-#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL_(SetPalette,p,(p,a))
-#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL_(Unlock,p,(p,a))
-#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL_(UpdateOverlay,p,(p,a,b,c,d,e))
-#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL_(UpdateOverlayDisplay,p,(p,a))
-#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL_(UpdateOverlayZOrder,p,(p,a,b))
-/*** IDirectDrawSurface2 methods ***/
-#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL_(GetDDInterface,p,(p,a))
-#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL_(PageLock,p,(p,a))
-#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL_(PageUnlock,p,(p,a))
-/*** IDirectDrawSurface3 methods ***/
-#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL_(SetSurfaceDesc,p,(p,a,b))
-/*** IDirectDrawSurface4 methods ***/
-#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL_(SetPrivateData,p,(p,a,b,c,d))
-#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL_(GetPrivateData,p,(p,a,b,c))
-#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL_(FreePrivateData,p,(p,a))
-#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL_(GetUniquenessValue,p,(p,a))
-#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL_(ChangeUniquenessValue,p,(p))
-/*** IDirectDrawSurface7 methods ***/
-#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL_(SetPriority,p,(p,a))
-#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL_(GetPriority,p,(p,a))
-#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL_(SetLOD,p,(p,a))
-#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL_(GetLOD,p,(p,a))
-
-/*****************************************************************************
- * IDirectDrawColorControl interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawColorControl
-DECLARE_INTERFACE_(IDirectDrawColorControl,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE;
- STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawColorControl_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawColorControl_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDrawColorControl methods ***/
-#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL_(GetColorControls,p,(p,a))
-#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL_(SetColorControls,p,(p,a))
-
-/*****************************************************************************
- * IDirectDrawGammaControl interface
- */
-#undef INTERFACE
-#define INTERFACE IDirectDrawGammaControl
-DECLARE_INTERFACE_(IDirectDrawGammaControl,IUnknown)
-{
- STDMETHOD(QueryInterface)(THIS_ REFIID,LPVOID*) PURE;
- STDMETHOD_(ULONG,AddRef)(THIS) PURE;
- STDMETHOD_(ULONG,Release)(THIS) PURE;
- STDMETHOD(GetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE;
- STDMETHOD(SetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE;
-};
-
- /*** IUnknown methods ***/
-#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL_(QueryInterface,p,(p,a,b))
-#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL_(AddRef,p,(p))
-#define IDirectDrawGammaControl_Release(p) ICOM_CALL_(Release,p,(p))
- /*** IDirectDrawGammaControl methods ***/
-#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL_(GetGammaRamp,p,(p,a,b))
-#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL_(SetGammaRamp,p,(p,a,b))
-
-
-HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN);
-HRESULT WINAPI DirectDrawCreateEx(LPGUID,LPVOID*,REFIID,LPUNKNOWN);
-HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA,LPVOID);
-HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID);
-#define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate)
-HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,LPUNKNOWN);
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif /* __XWIN_DDRAW_H */
diff --git a/xorg-server/hw/xwin/makefile b/xorg-server/hw/xwin/makefile
new file mode 100644
index 000000000..74dcfaeed
--- /dev/null
+++ b/xorg-server/hw/xwin/makefile
@@ -0,0 +1,107 @@
+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_MULTIWINDOWEXTWM = \
+# winwin32rootless.c \
+# winwin32rootlesswindow.c \
+# winwin32rootlesswndproc.c \
+# winwindowswm.c
+#DEFINES += XWIN_MULTIWINDOWEXTWM
+
+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_MULTIWINDOWEXTWM) $(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 \
+ 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 ea54b997c..36987c095 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;
@@ -588,6 +595,11 @@ typedef struct _winPrivScreenRec
MoveWindowProcPtr MoveWindow;
SetShapeProcPtr SetShape;
+#ifdef XWIN_NATIVEGDI
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+#endif
+
winCursorRec cursor;
} winPrivScreenRec;
@@ -994,15 +1006,25 @@ int
winMouseProc (DeviceIntPtr pDeviceInt, int iState);
int
-winMouseWheel (ScreenPtr pScreen, int iDeltaZ);
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y);
void
-winMouseButtonsSendEvent (int iEventType, int iButton);
+winMouseButtonsSendEvent (int iEventType, int iButton, int x, int y);
+
+void winGetPtMouse(HWND hwnd, LPARAM lParam, POINT *ptMouse);
+void winGetPtMouseScreen(HWND hwnd, LPARAM lParam, POINT *ptMouse);
int
winMouseButtonsHandle (ScreenPtr pScreen,
- int iEventType, int iButton,
- WPARAM wParam);
+ int iEventType, int iButton,
+ WPARAM wParam, HWND hwnd, LPARAM lParam);
+int
+winMouseButtonsHandleScreen (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam, HWND hwnd, LPARAM lParam);
+
+void
+winEnqueueMotion(int x, int y);
#ifdef XWIN_NATIVEGDI
/*
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..6d41cbd3a 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
@@ -56,6 +62,7 @@ extern unsigned long serverGeneration;
extern unsigned int g_uiAuthDataLen;
extern char *g_pAuthData;
#endif
+extern Bool g_fClipboardLaunched;
extern Bool g_fClipboardStarted;
extern HWND g_hwndClipboard;
extern void *g_pClipboardDisplay;
@@ -122,14 +129,14 @@ winClipboardProc (void *pvNotUsed)
if (XInitThreads () == 0)
{
ErrorF ("winClipboardProc - XInitThreads failed.\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
ErrorF ("winClipboardProc - Locale not supported by X. Exiting.\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* Set jump point for Error exits */
@@ -142,13 +149,13 @@ winClipboardProc (void *pvNotUsed)
/* setjmp returned an unknown value, exit */
ErrorF ("winClipboardProc - setjmp returned: %d exiting\n",
iReturn);
- pthread_exit (NULL);
+ goto thread_errorexit;
}
else if (iReturn == WIN_JMP_ERROR_IO)
{
/* TODO: Cleanup the Win32 window and free any allocated memory */
ErrorF ("winClipboardProc - setjmp returned for IO Error Handler.\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
#if defined(XCSECURITY)
@@ -204,7 +211,7 @@ winClipboardProc (void *pvNotUsed)
if (pDisplay == NULL)
{
ErrorF ("winClipboardProc - Failed opening the display, giving up\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* Save the display in the screen privates */
@@ -218,11 +225,11 @@ 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);
- pthread_exit (NULL);
+ goto thread_errorexit;
}
/* Find max of our file descriptors */
@@ -231,15 +238,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);
@@ -255,9 +253,16 @@ winClipboardProc (void *pvNotUsed)
if (iWindow == 0)
{
ErrorF ("winClipboardProc - Could not create an X window.\n");
- pthread_exit (NULL);
+ goto thread_errorexit;
}
+ /* 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,19 +278,21 @@ 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);
+ goto thread_errorexit;
}
/* 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);
+ goto thread_errorexit;
}
}
@@ -295,14 +302,17 @@ winClipboardProc (void *pvNotUsed)
* because there may be events in local data structures
* already.
*/
- winClipboardFlushXEvents (hwnd,
+ /*winClipboardFlushXEvents (hwnd,
iWindow,
pDisplay,
fUseUnicode);
-
+ */
/* Pre-flush Windows messages */
if (!winClipboardFlushWindowsMessageQueue (hwnd))
- return 0;
+ {
+ ErrorF ("winClipboardFlushWindowsMessageQueue - returned 0\n");
+ goto thread_errorexit;
+ }
/* Signal that the clipboard client has started */
g_fClipboardStarted = TRUE;
@@ -433,8 +443,27 @@ winClipboardProc (void *pvNotUsed)
g_iClipboardWindow = None;
g_pClipboardDisplay = NULL;
g_hwndClipboard = NULL;
+ g_fClipboardLaunched = FALSE;
+ g_fClipboardStarted = FALSE;
return NULL;
+thread_errorexit:
+ if (g_pClipboardDisplay && g_iClipboardWindow)
+ {
+ iReturn = XDestroyWindow (g_pClipboardDisplay, g_iClipboardWindow);
+ if (iReturn == BadWindow)
+ ErrorF ("winClipboardProc - XDestroyWindow returned BadWindow.\n");
+ else
+ ErrorF ("winClipboardProc - XDestroyWindow succeeded.\n");
+ }
+ g_iClipboardWindow = None;
+ g_pClipboardDisplay = NULL;
+ g_hwndClipboard = NULL;
+ g_fClipboardLaunched = FALSE;
+ g_fClipboardStarted = FALSE;
+ //pthread_exit (NULL);
+ ErrorF ("Clipboard thread died.\n");
+ return 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..0518e25dd 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);
@@ -143,12 +145,6 @@ winProcessXEventsTimeout (HWND hwnd, int iWindow, Display *pDisplay,
* Process a given Windows message
*/
-/* BPS - Define our own message, which we'll post to ourselves to facilitate
- * resetting the delayed rendering mechanism after each paste from X app to
- * Windows app. TODO - Perhaps move to win.h with the other WM_USER messages.
- */
-#define WM_USER_PASTE_COMPLETE (WM_USER + 1003)
-
LRESULT CALLBACK
winClipboardWindowProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
@@ -260,12 +256,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 +352,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 +378,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 +392,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");
@@ -533,13 +529,6 @@ winClipboardWindowProc (HWND hwnd, UINT message,
SetClipboardData (CF_TEXT, NULL);
}
- /* BPS - Post ourselves a user message whose handler will reset the
- * delayed rendering mechanism after the paste is complete. This is
- * necessary because calling SetClipboardData() with a NULL argument
- * here will cause the data we just put on the clipboard to be lost!
- */
- PostMessage(g_hwndClipboard, WM_USER_PASTE_COMPLETE, 0, 0);
-
/* Special handling for WM_RENDERALLFORMATS */
if (message == WM_RENDERALLFORMATS)
{
@@ -557,37 +546,6 @@ winClipboardWindowProc (HWND hwnd, UINT message,
winDebug ("winClipboardWindowProc - WM_RENDER*FORMAT - Returning.\n");
return 0;
}
- /* BPS - This WM_USER message is posted by us. It gives us the opportunity
- * to reset the delayed rendering mechanism after each and every paste
- * from an X app to a Windows app. Without such a mechanism, subsequent
- * changes of selection in the X app owning the selection are not
- * reflected in pastes into Windows apps, since Windows won't send us the
- * WM_RENDERFORMAT message unless someone has set changed data (or NULL)
- * on the clipboard. */
- case WM_USER_PASTE_COMPLETE:
- {
- if (hwnd != GetClipboardOwner ())
- /* In case we've lost the selection since posting the message */
- return 0;
- winDebug ("winClipboardWindowProc - WM_USER_PASTE_COMPLETE\n");
-
- /* Set up for another delayed rendering callback */
- OpenClipboard (g_hwndClipboard);
-
- /* Take ownership of the Windows clipboard */
- EmptyClipboard ();
-
- /* Advertise Unicode if we support it */
- if (g_fUnicodeSupport)
- SetClipboardData (CF_UNICODETEXT, NULL);
-
- /* Always advertise regular text */
- SetClipboardData (CF_TEXT, NULL);
-
- /* Release the clipboard */
- CloseClipboard ();
- }
- return 0;
}
/* Let Windows perform default processing for unhandled messages */
diff --git a/xorg-server/hw/xwin/winclipboardwrappers.c b/xorg-server/hw/xwin/winclipboardwrappers.c
index 2cfe0ffce..1e4f910ba 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.
@@ -335,9 +342,20 @@ winProcSetSelectionOwner (ClientPtr client)
/* Abort if clipboard not completely initialized yet */
if (!g_fClipboardStarted)
{
- ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, "
- "aborting.\n");
- goto winProcSetSelectionOwner_Done;
+ if (g_fClipboardLaunched)
+ {
+ // Just wait until it is started
+ ErrorF ("winProcSetSelectionOwner - waiting to be started.\n");
+ while (g_fClipboardLaunched && !g_fClipboardStarted)
+ Sleep(0);
+ ErrorF ("winProcSetSelectionOwner - Clipboard started.\n");
+ }
+ else
+ {
+ ErrorF ("winProcSetSelectionOwner - Clipboard not yet started, "
+ "aborting.\n");
+ goto winProcSetSelectionOwner_Done;
+ }
}
/* Grab window if we have one */
@@ -504,8 +522,8 @@ winProcSetSelectionOwner (ClientPtr client)
/* Access the Windows clipboard */
if (!OpenClipboard (g_hwndClipboard))
{
- ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x\n",
- (int) GetLastError ());
+ ErrorF ("winProcSetSelectionOwner - OpenClipboard () failed: %08x, hwnd: %08x\n",
+ (int) GetLastError (),g_hwndClipboard);
goto winProcSetSelectionOwner_Done;
}
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..78aea0e47 100644
--- a/xorg-server/hw/xwin/wincreatewnd.c
+++ b/xorg-server/hw/xwin/wincreatewnd.c
@@ -88,14 +88,20 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
- else
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
+ else
+ {
+ char HostName[256];
+ gethostname(HostName,256);
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE,
+ HostName,
display,
(int) pScreenInfo->dwScreen);
-
+ }
/* Create the window */
*phwnd = CreateWindowExA (0, /* Extended styles */
WINDOW_CLASS, /* Class name */
@@ -331,13 +337,20 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE_XDMCP,
- g_pszQueryHost);
- else
+ g_pszQueryHost,
+ display,
+ (int) pScreenInfo->dwScreen);
+ else
+ {
+ char HostName[256];
+ gethostname(HostName,256);
snprintf (szTitle,
sizeof (szTitle),
WINDOW_TITLE,
+ HostName,
display,
(int) pScreenInfo->dwScreen);
+ }
/* Create the window */
*phwnd = CreateWindowExA (0, /* Extended styles */
diff --git a/xorg-server/hw/xwin/wincursor.c b/xorg-server/hw/xwin/wincursor.c
index 92775e404..4fa7c0929 100644
--- a/xorg-server/hw/xwin/wincursor.c
+++ b/xorg-server/hw/xwin/wincursor.c
@@ -62,7 +62,7 @@ extern Bool g_fSoftwareCursor;
*/
static void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y);
+winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
static Bool
winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y);
@@ -79,7 +79,7 @@ miPointerScreenFuncRec g_winPointerCursorFuncs =
static void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
+winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
winScreenPriv(pScreen);
RECT rcClient;
@@ -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);
@@ -119,7 +127,7 @@ winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
}
/* Call the mi warp procedure to do the actual warping in X. */
- miPointerWarpCursor (pScreen, x, y);
+ miPointerWarpCursor (pDev, pScreen, x, y);
}
static Bool
@@ -436,7 +444,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
* Convert the X cursor representation to native format if possible.
*/
static Bool
-winRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
+winRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
if(pCursor == NULL || pCursor->bits == NULL)
return FALSE;
@@ -452,7 +460,7 @@ winRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
* Free the storage space associated with a realized cursor.
*/
static Bool
-winUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+winUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
return TRUE;
}
@@ -463,7 +471,7 @@ winUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* Set the cursor sprite and position.
*/
static void
-winSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+winSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
POINT ptCurPos, ptTemp;
HWND hwnd;
@@ -541,16 +549,27 @@ winSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
* Move the cursor. This is a noop for us.
*/
static void
-winMoveCursor (ScreenPtr pScreen, int x, int y)
+winMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
}
+static Bool
+winDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+ return TRUE;
+}
+static void
+winDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+}
static miPointerSpriteFuncRec winSpriteFuncsRec = {
winRealizeCursor,
winUnrealizeCursor,
winSetCursor,
- winMoveCursor
+ winMoveCursor,
+ winDeviceInitialize,
+ winDeviceCleanup
};
@@ -600,9 +619,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 3eb6091e6..280761e72 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
@@ -63,10 +65,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..84b7d8d85 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,35 @@ 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:
+ case DEVICE_ON:
+ {
+ DeviceIntPtr master;
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)
+ master = (!pDeviceInt->isMaster && pDeviceInt->u.master) ? pDeviceInt->u.master : NULL;
+ if (master)
+ {
+ /* Force a copy of the key class into the VCK so that the layout
+ is transferred. */
+ if (!master->key)
+ master = GetPairedDevice(master);
+ CopyKeyClass(pDeviceInt, master);
+ }
+ }
+
break;
case DEVICE_CLOSE:
case DEVICE_OFF:
pDevice->on = FALSE;
- g_winInternalModeKeyStatesPtr = NULL;
break;
}
@@ -369,7 +392,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 +405,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 +605,7 @@ winKeybdReleaseKeys ()
void
winSendKeyEvent (DWORD dwKey, Bool fDown)
{
+ DeviceIntPtr pDev;
xEvent xCurrentEvent;
/*
@@ -593,11 +619,20 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
- xCurrentEvent.u.u.type = fDown ? KeyPress : KeyRelease;
+ xCurrentEvent.u.u.type = fDown ? DeviceKeyPress : DeviceKeyRelease;
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 be2b66a08..cf52bbaaf 100644
--- a/xorg-server/hw/xwin/winmouse.c
+++ b/xorg-server/hw/xwin/winmouse.c
@@ -36,13 +36,21 @@
#endif
#include "win.h"
-#if defined(XFree86Server)
+#ifdef XKB
+#ifndef XKB_IN_SERVER
+#define XKB_IN_SERVER
+#endif
+#include <xkbsrv.h>
+#endif
+
+#if 1
#include "inputstr.h"
/* Peek the internal button mapping */
static CARD8 const *g_winMouseButtonMap = NULL;
#endif
+#include <X11/extensions/XIproto.h>
/*
* Local prototypes
@@ -100,13 +108,12 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
InitPointerDeviceStruct (pDevice,
map,
lngMouseButtons + lngWheelEvents,
- GetMotionHistory,
winMouseCtrl,
GetMotionHistorySize(),
2);
free(map);
-#if defined(XFree86Server)
+#if 1
g_winMouseButtonMap = pDeviceInt->button->map;
#endif
break;
@@ -116,7 +123,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
break;
case DEVICE_CLOSE:
-#if defined(XFree86Server)
+#if 1
g_winMouseButtonMap = NULL;
#endif
case DEVICE_OFF:
@@ -129,7 +136,7 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
/* Handle the mouse wheel */
int
-winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ, int x, int y)
{
winScreenPriv(pScreen);
int button; /* Button4 or Button5 */
@@ -204,10 +211,10 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
while (iDeltaZ--)
{
/* Push the wheel button */
- winMouseButtonsSendEvent (ButtonPress, button);
+ winMouseButtonsSendEvent (DeviceButtonPress, button,x,y);
/* Release the wheel button */
- winMouseButtonsSendEvent (ButtonRelease, button);
+ winMouseButtonsSendEvent (DeviceButtonRelease, button,x,y);
}
return 0;
@@ -219,32 +226,62 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
*/
void
-winMouseButtonsSendEvent (int iEventType, int iButton)
+winMouseButtonsSendEvent (int iEventType, int iButton, int x, int y)
{
- xEvent xCurrentEvent;
+ DeviceIntPtr pDev;
+ deviceKeyButtonPointer xCurrentEvent;
+ deviceKeyButtonPointer *kbp = &xCurrentEvent;
/* Load an xEvent and enqueue the event */
- xCurrentEvent.u.u.type = iEventType;
-#if defined(XFree86Server)
+ kbp->type=iEventType;
+#if 1
if (g_winMouseButtonMap)
- xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
+ kbp->detail = g_winMouseButtonMap[iButton];
else
#endif
- xCurrentEvent.u.u.detail = iButton;
- xCurrentEvent.u.keyButtonPointer.time
- = g_c32LastInputEventTime = GetTickCount ();
- mieqEnqueue (&xCurrentEvent);
+ kbp->detail = iButton;
+ kbp->time = g_c32LastInputEventTime = GetTickCount ();
+
+ kbp->root_x = x;
+ kbp->root_y = y;
+
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if ((pDev->coreEvents && pDev != inputInfo.pointer) && pDev->button)
+ {
+ kbp->deviceid = pDev->id;
+ mieqEnqueue (pDev, (xEventPtr)kbp);
+ }
+}
+
+void winGetPtMouse(HWND hwnd, LPARAM lParam, POINT *ptMouse)
+{
+ /* Unpack the client area mouse coordinates */
+ ptMouse->x = GET_X_LPARAM(lParam);
+ ptMouse->y = GET_Y_LPARAM(lParam);
}
+void winGetPtMouseScreen(HWND hwnd, LPARAM lParam, POINT *ptMouse)
+{
+ /* Unpack the client area mouse coordinates */
+ ptMouse->x = GET_X_LPARAM(lParam);
+ ptMouse->y = GET_Y_LPARAM(lParam);
+
+ /* Translate the client area mouse coordinates to screen coordinates */
+ ClientToScreen (hwnd, ptMouse);
+
+ /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
+ ptMouse->x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
+ ptMouse->y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
+}
/*
* Decide what to do with a Windows mouse message
*/
-int
-winMouseButtonsHandle (ScreenPtr pScreen,
- int iEventType, int iButton,
- WPARAM wParam)
+static int
+_winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam, POINT *ptMouse)
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -253,12 +290,12 @@ winMouseButtonsHandle (ScreenPtr pScreen,
if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF)
{
/* Emulate 3 buttons is off, send the button event */
- winMouseButtonsSendEvent (iEventType, iButton);
+ winMouseButtonsSendEvent (iEventType, iButton, ptMouse->x, ptMouse->y);
return 0;
}
/* Emulate 3 buttons is on, let the fun begin */
- if (iEventType == ButtonPress
+ if (iEventType == DeviceButtonPress
&& pScreenPriv->iE3BCachedPress == 0
&& !pScreenPriv->fE3BFakeButton2Sent)
{
@@ -279,7 +316,7 @@ winMouseButtonsHandle (ScreenPtr pScreen,
pScreenInfo->iE3BTimeout,
NULL);
}
- else if (iEventType == ButtonPress
+ else if (iEventType == DeviceButtonPress
&& pScreenPriv->iE3BCachedPress != 0
&& pScreenPriv->iE3BCachedPress != iButton
&& !pScreenPriv->fE3BFakeButton2Sent)
@@ -294,12 +331,12 @@ winMouseButtonsHandle (ScreenPtr pScreen,
pScreenPriv->iE3BCachedPress = 0;
/* Send fake middle button */
- winMouseButtonsSendEvent (ButtonPress, Button2);
+ winMouseButtonsSendEvent (DeviceButtonPress, Button2, ptMouse->x, ptMouse->y);
/* Indicate that a fake middle button event was sent */
pScreenPriv->fE3BFakeButton2Sent = TRUE;
}
- else if (iEventType == ButtonRelease
+ else if (iEventType == DeviceButtonRelease
&& pScreenPriv->iE3BCachedPress == iButton)
{
/*
@@ -310,10 +347,10 @@ winMouseButtonsHandle (ScreenPtr pScreen,
pScreenPriv->iE3BCachedPress = 0;
/* Send cached press, then send release */
- winMouseButtonsSendEvent (ButtonPress, iButton);
- winMouseButtonsSendEvent (ButtonRelease, iButton);
+ winMouseButtonsSendEvent (DeviceButtonPress, iButton, ptMouse->x, ptMouse->y);
+ winMouseButtonsSendEvent (DeviceButtonRelease, iButton, ptMouse->x, ptMouse->y);
}
- else if (iEventType == ButtonRelease
+ else if (iEventType == DeviceButtonRelease
&& pScreenPriv->fE3BFakeButton2Sent
&& !(wParam & MK_LBUTTON)
&& !(wParam & MK_RBUTTON))
@@ -324,9 +361,9 @@ winMouseButtonsHandle (ScreenPtr pScreen,
pScreenPriv->fE3BFakeButton2Sent = FALSE;
/* Send middle mouse button release */
- winMouseButtonsSendEvent (ButtonRelease, Button2);
+ winMouseButtonsSendEvent (DeviceButtonRelease, Button2, ptMouse->x, ptMouse->y);
}
- else if (iEventType == ButtonRelease
+ else if (iEventType == DeviceButtonRelease
&& pScreenPriv->iE3BCachedPress == 0
&& !pScreenPriv->fE3BFakeButton2Sent)
{
@@ -334,8 +371,52 @@ winMouseButtonsHandle (ScreenPtr pScreen,
* Button was release, no button is cached,
* and there is no fake button 2 release is pending.
*/
- winMouseButtonsSendEvent (ButtonRelease, iButton);
+ winMouseButtonsSendEvent (DeviceButtonRelease, iButton, ptMouse->x, ptMouse->y);
}
return 0;
}
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam, HWND hwnd, LPARAM lParam)
+{
+ POINT ptMouse;
+ winGetPtMouse(hwnd,lParam,&ptMouse);
+ return _winMouseButtonsHandle(pScreen, iEventType, iButton, wParam ,&ptMouse);
+}
+
+int
+winMouseButtonsHandleScreen (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam, HWND hwnd, LPARAM lParam)
+{
+ POINT ptMouse;
+ winGetPtMouseScreen(hwnd,lParam,&ptMouse);
+ return _winMouseButtonsHandle(pScreen, iEventType, iButton, wParam ,&ptMouse);
+}
+
+
+/**
+ * Enqueue a motion event.
+ */
+void winEnqueueMotion(int x, int y)
+{
+ int i, nevents;
+ int valuators[2];
+ int MaxN=GetMaximumEventsNum();
+
+ EventListPtr events = InitEventList(MaxN);
+
+ 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].event);
+
+ FreeEventList(events,MaxN);
+}
+// 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 fbc516cde..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;
-
- winMultiWindowGetWMHints (pWin, &hints);
- if (!hints.icon_pixmap) return NULL;
+ HICON hIcon = NULL;
+ Bool net_wm_icon_found = FALSE;
- 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,36 +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 = malloc (stride * iconSize);
- imageMask = malloc (stride * iconSize);
- /* Default to a completely black mask */
- mask = calloc (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;
@@ -348,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
@@ -364,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)
@@ -375,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 62cddd0a1..28870646c 100644
--- a/xorg-server/hw/xwin/winmultiwindowshape.c
+++ b/xorg-server/hw/xwin/winmultiwindowshape.c
@@ -44,7 +44,6 @@ void
winSetShapeMultiWindow (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
@@ -72,6 +71,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;
}
@@ -207,3 +209,14 @@ winReshapeMultiWindow (WindowPtr pWin)
return;
}
+
+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 75bef9786..88e7700dc 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
*/
@@ -484,6 +479,7 @@ winCreateWindowsWindow (WindowPtr pWin)
int iWidth;
int iHeight;
HWND hWnd;
+ HWND hFore = NULL;
WNDCLASSEX wc;
winWindowPriv(pWin);
HICON hIcon;
@@ -494,6 +490,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);
@@ -502,20 +499,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 */
@@ -568,6 +561,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 */
@@ -579,7 +594,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..6a0928f06 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; /* VcXsrv 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..97f7e8945 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
@@ -40,6 +42,13 @@
#include "winmsg.h"
#include "inputstr.h"
+#ifdef XKB
+#ifndef XKB_IN_SERVER
+#define XKB_IN_SERVER
+#endif
+#include <xkbsrv.h>
+#endif
+
/*
* External global variables
*/
@@ -49,6 +58,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 +72,6 @@ static UINT_PTR g_uipMousePollingTimerID = 0;
* Constant defines
*/
-#define MOUSE_POLLING_INTERVAL 500
#define WIN_MULTIWINDOW_SHAPE YES
@@ -206,6 +216,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 +238,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 +299,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 +414,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
switch (message)
{
case WM_CREATE:
-
+{
+ RECT rWindow;
+ HRGN hRgnWindow;
/* */
SetProp (hwnd,
WIN_WINDOW_PROP,
@@ -396,13 +435,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)VCXSRV_SIGNATURE);
+}
return 0;
case WM_INIT_SYS_MENU:
@@ -479,16 +518,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
return 0;
case WM_MOUSEMOVE:
- /* Unpack the client area mouse coordinates */
- ptMouse.x = GET_X_LPARAM(lParam);
- ptMouse.y = GET_Y_LPARAM(lParam);
-
- /* Translate the client area mouse coordinates to screen coordinates */
- ClientToScreen (hwnd, &ptMouse);
-
- /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
- ptMouse.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
- ptMouse.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
+ winGetPtMouseScreen(hwnd, lParam, &ptMouse);
/* We can't do anything without privates */
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
@@ -535,9 +565,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 +591,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 +608,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,60 +617,82 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[0] = TRUE;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
-
+ SetCapture(hwnd);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button1, wParam, hwnd, lParam);
+
case WM_LBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[0] = FALSE;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button1, wParam, hwnd, lParam);
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[1] = TRUE;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
-
+ SetCapture(hwnd);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button2, wParam, hwnd, lParam);
+
case WM_MBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[1] = FALSE;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
-
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button2, wParam, hwnd, lParam);
+
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[2] = TRUE;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
-
+ SetCapture(hwnd);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, Button3, wParam, hwnd, lParam);
+
case WM_RBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
g_fButton[2] = FALSE;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, Button3, wParam, hwnd, lParam);
case WM_XBUTTONDBLCLK:
case WM_XBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
- return winMouseButtonsHandle (s_pScreen, ButtonPress, HIWORD(wParam) + 5, wParam);
+ SetCapture(hwnd);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonPress, HIWORD(wParam) + 5, wParam, hwnd, lParam);
+
case WM_XBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
+ ReleaseCapture();
+ winStartMousePolling(s_pScreenPriv);
+ return winMouseButtonsHandleScreen (s_pScreen, DeviceButtonRelease, HIWORD(wParam) + 5, wParam, hwnd, lParam);
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 +706,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 +811,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 +869,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);
+ else SetWindowLongPtr (hwnd, GWL_STYLE,
+ (WS_POPUP | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS)
+ & ~WS_CAPTION & ~WS_SIZEBOX);
- /* 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);
-
- /* 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)VCXSRV_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 +1013,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 d92dfdd8b..ad3b94c3d 100644
--- a/xorg-server/hw/xwin/winprefsyacc.c
+++ b/xorg-server/hw/xwin/winprefsyacc.c
@@ -59,6 +59,9 @@
/* Pull parsers. */
#define YYPULL 1
+#ifdef DEBUG
+#undef DEBUG
+#endif
/* Using locations. */
#define YYLSP_NEEDED 0
@@ -388,14 +391,14 @@ YYID (yyi)
# 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 25f6e2ab5..f299494c9 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 512109500..8c208709e 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/wintrayicon.c b/xorg-server/hw/xwin/wintrayicon.c
index 054a8e956..9cd1e5c3c 100644
--- a/xorg-server/hw/xwin/wintrayicon.c
+++ b/xorg-server/hw/xwin/wintrayicon.c
@@ -45,6 +45,7 @@ winInitNotifyIcon (winPrivScreenPtr pScreenPriv)
{
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
NOTIFYICONDATA nid = {0};
+ char HostName[256];
nid.cbSize = sizeof (NOTIFYICONDATA);
nid.hWnd = pScreenPriv->hwndScreen;
@@ -55,11 +56,14 @@ winInitNotifyIcon (winPrivScreenPtr pScreenPriv)
/* Save handle to the icon so it can be freed later */
pScreenPriv->hiconNotifyIcon = nid.hIcon;
+
+ gethostname(HostName,256);
/* Set display and screen-specific tooltip text */
snprintf (nid.szTip,
sizeof (nid.szTip),
- PROJECT_NAME " Server - %s:%d",
+ PROJECT_NAME " Server - %s:%s.%d",
+ HostName,
display,
(int) pScreenInfo->dwScreen);
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 32db6621b..a5315096c 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
@@ -523,16 +522,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
#if CYGMULTIWINDOW_DEBUG && 0
winDebug ("winMWExtWMWindowProc - WM_MOUSEMOVE\n");
#endif
- /* Unpack the client area mouse coordinates */
- ptMouse.x = GET_X_LPARAM(lParam);
- ptMouse.y = GET_Y_LPARAM(lParam);
-
- /* Translate the client area mouse coordinates to screen coordinates */
- ClientToScreen (hwnd, &ptMouse);
-
- /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
- ptMouse.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
- ptMouse.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
+ winGetPtMouse(hwnd,lParam,&ptMouse);
/* We can't do anything without privates */
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
@@ -571,9 +561,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:
@@ -632,7 +622,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
SetCapture (hwnd);
- return winMouseButtonsHandle (pScreen, ButtonPress, Button1, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceeButtonPress, Button1, wParam, hwnd, lParam);
case WM_LBUTTONUP:
#if CYGMULTIWINDOW_DEBUG
@@ -641,7 +631,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
ReleaseCapture ();
- return winMouseButtonsHandle (pScreen, ButtonRelease, Button1, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonRelease, Button1, wParam, hwnd, lParam);
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
@@ -651,7 +641,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
SetCapture (hwnd);
- return winMouseButtonsHandle (pScreen, ButtonPress, Button2, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonPress, Button2, wParam, hwnd, lParam);
case WM_MBUTTONUP:
#if CYGMULTIWINDOW_DEBUG
@@ -660,7 +650,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
ReleaseCapture ();
- return winMouseButtonsHandle (pScreen, ButtonRelease, Button2, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonRelease, Button2, wParam, hwnd, lParam);
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
@@ -670,7 +660,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
SetCapture (hwnd);
- return winMouseButtonsHandle (pScreen, ButtonPress, Button3, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonPress, Button3, wParam, hwnd, lParam);
case WM_RBUTTONUP:
#if CYGMULTIWINDOW_DEBUG
@@ -679,19 +669,19 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
ReleaseCapture ();
- return winMouseButtonsHandle (pScreen, ButtonRelease, Button3, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonRelease, Button3, wParam, hwnd, lParam);
case WM_XBUTTONDBLCLK:
case WM_XBUTTONDOWN:
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
SetCapture (hwnd);
- return winMouseButtonsHandle (pScreen, ButtonPress, HIWORD(wParam) + 5, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonPress, HIWORD(wParam) + 5, wParam, hwnd, lParam);
case WM_XBUTTONUP:
if (pScreenPriv == NULL || pScreenInfo->fIgnoreInput)
break;
ReleaseCapture ();
- return winMouseButtonsHandle (pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
+ return winMouseButtonsHandle (pScreen, DeviceButtonRelease, HIWORD(wParam) + 5, wParam, hwnd, lParam);
case WM_MOUSEWHEEL:
#if CYGMULTIWINDOW_DEBUG
diff --git a/xorg-server/hw/xwin/winwindow.c b/xorg-server/hw/xwin/winwindow.c
index 285a344f7..ec5983901 100644
--- a/xorg-server/hw/xwin/winwindow.c
+++ b/xorg-server/hw/xwin/winwindow.c
@@ -58,6 +58,7 @@ winReshapeRootless (WindowPtr pWin);
Bool
winCreateWindowNativeGDI (WindowPtr pWin)
{
+ Bool fResult;
ScreenPtr pScreen = pWin->drawable.pScreen;
winWindowPriv(pWin);
winScreenPriv(pScreen);
@@ -350,7 +351,6 @@ winPositionWindowRootless (WindowPtr pWin, int x, int y)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
@@ -376,7 +376,6 @@ winChangeWindowAttributesRootless (WindowPtr pWin, unsigned long mask)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -434,7 +433,6 @@ winMapWindowRootless (WindowPtr pWin)
{
Bool fResult = FALSE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -457,7 +455,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..fa4e3c59e 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
@@ -39,20 +41,20 @@
/* Constant strings */
#ifndef PROJECT_NAME
-# define PROJECT_NAME "Cygwin/X"
+# define PROJECT_NAME "VcXsrv"
#endif
-#define WINDOW_CLASS "cygwin/x"
-#define WINDOW_TITLE PROJECT_NAME " - %s:%d"
-#define WINDOW_TITLE_XDMCP PROJECT_NAME " - %s"
-#define WIN_SCR_PROP "cyg_screen_prop rl"
-#define WINDOW_CLASS_X "cygwin/x X rl"
+#define WINDOW_CLASS "VcXsrv/x"
+#define WINDOW_TITLE PROJECT_NAME " Server - %s:%s.%d"
+#define WINDOW_TITLE_XDMCP PROJECT_NAME " Server - %s:%s.%d"
+#define WIN_SCR_PROP "vcxsrv_screen_prop rl"
+#define WINDOW_CLASS_X "vcxsrv/x X rl"
#define WINDOW_TITLE_X PROJECT_NAME " X"
-#define WIN_WINDOW_PROP "cyg_window_prop_rl"
+#define WIN_WINDOW_PROP "vcxsrv_window_prop_rl"
#ifdef HAS_DEVWINDOWS
# define WIN_MSG_QUEUE_FNAME "/dev/windows"
#endif
-#define WIN_WID_PROP "cyg_wid_prop_rl"
-#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
+#define WIN_WID_PROP "vcxsrv_wid_prop_rl"
+#define WIN_NEEDMANAGE_PROP "vcxsrv_override_redirect_prop_rl"
#ifndef CYGMULTIWINDOW_DEBUG
#define CYGMULTIWINDOW_DEBUG NO
#endif
@@ -60,6 +62,8 @@
#define CYGWINDOWING_DEBUG NO
#endif
+#define VCXSRV_SIGNATURE 0xdeaddeadL
+
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 28bcb64c8..d72941c7c 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..de6b26404 100644
--- a/xorg-server/hw/xwin/winwndproc.c
+++ b/xorg-server/hw/xwin/winwndproc.c
@@ -44,6 +44,10 @@
#ifdef XKB
extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam);
+#ifndef XKB_IN_SERVER
+#define XKB_IN_SERVER
+#endif
+#include <xkbsrv.h>
#endif
extern void winFixShiftKeys (int iScanCode);
@@ -762,11 +766,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:
@@ -815,7 +819,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button1, wParam, hwnd, lParam);
case WM_LBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
@@ -826,7 +830,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button1, wParam, hwnd, lParam);
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
@@ -838,7 +842,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button2, wParam, hwnd, lParam);
case WM_MBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
@@ -849,7 +853,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button2, wParam, hwnd, lParam);
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
@@ -861,7 +865,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, Button3, wParam, hwnd, lParam);
case WM_RBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
@@ -872,7 +876,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, Button3, wParam, hwnd, lParam);
case WM_XBUTTONDBLCLK:
case WM_XBUTTONDOWN:
@@ -884,7 +888,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
SetCapture (hwnd);
- return winMouseButtonsHandle (s_pScreen, ButtonPress, HIWORD(wParam) + 5, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonPress, HIWORD(wParam) + 5, wParam, hwnd, lParam);
case WM_XBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
@@ -894,7 +898,7 @@ winWindowProc (HWND hwnd, UINT message,
#endif
)
ReleaseCapture ();
- return winMouseButtonsHandle (s_pScreen, ButtonRelease, HIWORD(wParam) + 5, wParam);
+ return winMouseButtonsHandle (s_pScreen, DeviceButtonRelease, HIWORD(wParam) + 5, wParam, hwnd, lParam);
case WM_TIMER:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
@@ -904,15 +908,20 @@ winWindowProc (HWND hwnd, UINT message,
switch (wParam)
{
case WIN_E3B_TIMER_ID:
- /* Send delayed button press */
- winMouseButtonsSendEvent (ButtonPress,
- s_pScreenPriv->iE3BCachedPress);
-
- /* Kill this timer */
- KillTimer (s_pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
-
- /* Clear screen privates flags */
- s_pScreenPriv->iE3BCachedPress = 0;
+ {
+ POINT Pos;
+ GetCursorPos(&Pos);
+ ScreenToClient(hwnd,&Pos);
+ /* Send delayed button press */
+ winMouseButtonsSendEvent (DeviceButtonPress,
+ s_pScreenPriv->iE3BCachedPress,Pos.x,Pos.y);
+
+ /* Kill this timer */
+ KillTimer (s_pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+
+ /* Clear screen privates flags */
+ s_pScreenPriv->iE3BCachedPress = 0;
+ }
break;
case WIN_POLLING_MOUSE_TIMER_ID:
@@ -923,14 +932,14 @@ winWindowProc (HWND hwnd, UINT message,
/* Get the current position of the mouse cursor */
GetCursorPos (&point);
+ ScreenToClient(hwnd,&point);
/* Map from screen (-X, -Y) to root (0, 0) */
- point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
- point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
-
+ //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);
@@ -939,6 +948,7 @@ winWindowProc (HWND hwnd, UINT message,
wR = (GetKeyState (VK_RBUTTON) & 0x8000)?MK_RBUTTON:0;
wShift = (GetKeyState (VK_SHIFT) & 0x8000)?MK_SHIFT:0;
wCtrl = (GetKeyState (VK_CONTROL) & 0x8000)?MK_CONTROL:0;
+ ScreenToClient(hwnd,&point);
lPos = MAKELPARAM(point.x, point.y);
if (g_fButton[0] & !wL)
PostMessage (hwnd, WM_LBUTTONUP, wCtrl|wM|wR|wShift, lPos);
@@ -956,14 +966,19 @@ winWindowProc (HWND hwnd, UINT message,
return 0;
case WM_MOUSEWHEEL:
+ {
+ POINT Pos;
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
#if CYGDEBUG
winDebug ("winWindowProc - WM_MOUSEWHEEL\n");
#endif
- winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam));
+ Pos.x=GET_X_LPARAM(lParam);
+ Pos.y=GET_Y_LPARAM(lParam);
+ ScreenToClient(hwnd,&Pos);
+ winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam),Pos.x,Pos.y);
break;
-
+ }
case WM_SETFOCUS:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
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..b3b1001ff 100644
--- a/xorg-server/hw/xwin/xlaunch/main.cc
+++ b/xorg-server/hw/xwin/xlaunch/main.cc
@@ -23,6 +23,10 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
+
+#define printf _not_used_ /* Make sure that we do not use the standard printf definition because
+ we are going to reimplement it in this file */
+
#include "window/util.h"
#include "window/wizard.h"
#include "resources/resources.h"
@@ -34,6 +38,68 @@
#include <X11/Xlib.h>
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+#include <fcntl.h>
+#include <io.h>
+#undef printf
+
+#if defined(_MSC_VER) && defined(_DLL)
+#define _CRTEXP __declspec(dllexport)
+#else
+#define _CRTEXP
+#endif
+
+_Check_return_opt_ _CRTEXP int __cdecl printf(_In_z_ _Printf_format_string_ const char * pFmt, ...)
+{
+ static int ConsoleCreated=0;
+ va_list arglist;
+ if (!ConsoleCreated)
+ {
+ int hConHandle;
+ long lStdHandle;
+ CONSOLE_SCREEN_BUFFER_INFO coninfo;
+
+ FILE *fp;
+ const unsigned int MAX_CONSOLE_LINES = 500;
+ ConsoleCreated=1;
+ if (!AttachConsole(ATTACH_PARENT_PROCESS))
+ AllocConsole();
+
+ // set the screen buffer to be big enough to let us scroll text
+ GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
+ coninfo.dwSize.Y = MAX_CONSOLE_LINES;
+ SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
+
+ // redirect unbuffered STDOUT to the console
+ lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
+ hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
+ fp = _fdopen( hConHandle, "w" );
+ *stdout = *fp;
+ setvbuf( stdout, NULL, _IONBF, 0 );
+
+ // redirect unbuffered STDIN to the console
+ lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE);
+ hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
+ fp = _fdopen( hConHandle, "r" );
+ *stdin = *fp;
+ setvbuf( stdin, NULL, _IONBF, 0 );
+
+ // redirect unbuffered STDERR to the console
+ lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
+ hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
+ fp = _fdopen( hConHandle, "w" );
+ *stderr = *fp;
+ setvbuf( stderr, NULL, _IONBF, 0 );
+
+ }
+
+ va_start(arglist, pFmt );
+ return vfprintf(stderr, pFmt, arglist);
+}
+
+
/// @brief Send WM_ENDSESSION to all program windows.
/// This will shutdown the started xserver
BOOL CALLBACK KillWindowsProc(HWND hwnd, LPARAM lParam)
@@ -108,7 +174,10 @@ class CMyWizard : public CWizard
}
// Check for valid input
if (config.display.empty())
+ {
+ MessageBox(hwndDlg,"Please fill in a display number.","Error",MB_OK);
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
+ }
else
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS);
return TRUE;
@@ -489,7 +558,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 +569,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 +646,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 +696,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 +705,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);
@@ -695,6 +764,42 @@ int main(int argc, char **argv)
}
}
-
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+{
+ int argc=1;
+ #define MAXNRARGS 20
+ char *argv[MAXNRARGS]={"plink"};
+ char *pTmp=lpCmdLine;
+ while (*pTmp && argc<MAXNRARGS-1)
+ {
+ char *pEnd;
+ if (*pTmp=='"')
+ {
+ pEnd=strchr(pTmp+1,'"');
+ }
+ else if (*pTmp!=' ')
+ {
+ pEnd=strchr(pTmp,' ');
+ }
+ else
+ {
+ pTmp++;
+ continue;
+ }
+ if (pEnd)
+ {
+ *pEnd=0;
+ argv[argc++]=pTmp;
+ pTmp=pEnd+1;
+ }
+ else
+ {
+ argv[argc++]=pTmp;
+ break;
+ }
+ }
+
+ return main(argc,argv);
+}
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/resources/resources.h b/xorg-server/hw/xwin/xlaunch/resources/resources.h
index 470005192..15e733844 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/resources.h
+++ b/xorg-server/hw/xwin/xlaunch/resources/resources.h
@@ -35,6 +35,8 @@
#define IDD_FONTPATH 106
#define IDD_CLIPBOARD 107
+#define IDI_XLAUNCH 108
+
#define IDS_DISPLAY_TITLE 300
#define IDS_DISPLAY_SUBTITLE 301
#define IDS_CLIENTS_TITLE 302
diff --git a/xorg-server/hw/xwin/xlaunch/resources/resources.rc b/xorg-server/hw/xwin/xlaunch/resources/resources.rc
index 07fd52f32..e3df4610a 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/resources.rc
+++ b/xorg-server/hw/xwin/xlaunch/resources/resources.rc
@@ -28,3 +28,5 @@
#include "resources.h"
#include "images.rc"
#include "dialog.rc"
+
+IDI_XLAUNCH ICON "..\\..\\X.ico"
diff --git a/xorg-server/hw/xwin/xlaunch/resources/strings.rc b/xorg-server/hw/xwin/xlaunch/resources/strings.rc
index 5a9cd281b..94db96659 100644
--- a/xorg-server/hw/xwin/xlaunch/resources/strings.rc
+++ b/xorg-server/hw/xwin/xlaunch/resources/strings.rc
@@ -60,15 +60,15 @@
#define STR_CAPTION_CLIPBOARD "Clipboard settings"
#define STR_CLIPBOARD "Clipboard"
#define STR_CLIPBOARD_DESC "Start the integrated clipboard manager"
-#define STR_EXTRA_PARAMS_DESC "Additional parameters for Xming"
+#define STR_EXTRA_PARAMS_DESC "Additional parameters for VcXsrv"
#define STR_CAPTION_FINISH "Finish configuration"
-#define STR_FINISH_DESC "Configuration is complete. Clish Finish to start Xming."
+#define STR_FINISH_DESC "Configuration is complete. Clish Finish to start VcXsrv."
#define STR_FINISH_SAVE_DESC "You may also save the configuration for later use."
#define STR_FINISH_SAVE "Save configuration"
#define STR_DISPLAY_TITLE "Select display settings"
-#define STR_DISPLAY_SUBTITLE "Choose how Xming display programs"
+#define STR_DISPLAY_SUBTITLE "Choose how VcXsrv display programs"
#define STR_CLIENTS_TITLE "Select how to start clients"
#define STR_CLIENTS_SUBTITLE ""
#define STR_PROGRAM_TITLE "Specify the program to start"
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.cc b/xorg-server/hw/xwin/xlaunch/window/util.cc
index fb7e87297..6f768348e 100644
--- a/xorg-server/hw/xwin/xlaunch/window/util.cc
+++ b/xorg-server/hw/xwin/xlaunch/window/util.cc
@@ -25,6 +25,8 @@
*/
#include "util.h"
+const char * MessageDebug::notify_names[NOTIFY_NAMES_LEN];
+
std::string win32_error::message(DWORD errorcode)
{
LPVOID lpMsgBuf;
diff --git a/xorg-server/hw/xwin/xlaunch/window/util.h b/xorg-server/hw/xwin/xlaunch/window/util.h
index cd21da657..a1196b115 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
{
@@ -39,7 +39,7 @@ class win32_error : public std::runtime_error
};
#define MESSAGE_NAMES_LEN 1024
-#define NOTIFY_NAMES_LEN 0
+#define NOTIFY_NAMES_LEN 1
class MessageDebug
{
protected:
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 4bfe3713c..3eac3d110 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/globals.h b/xorg-server/include/globals.h
index c3d2dcfa2..74b09e71d 100644
--- a/xorg-server/include/globals.h
+++ b/xorg-server/include/globals.h
@@ -46,9 +46,7 @@ extern Bool DPMSCapableFlag;
extern Bool PanoramiXExtensionDisabledHack;
#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 85f9e5d4f..f56c2c609 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -169,9 +169,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/os.h b/xorg-server/include/os.h
index 77e94486a..59f26898f 100644
--- a/xorg-server/include/os.h
+++ b/xorg-server/include/os.h
@@ -524,4 +524,8 @@ extern void LogPrintMarkers(void);
extern void xorg_backtrace(void);
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
#endif /* OS_H */
diff --git a/xorg-server/include/pixmapstr.h b/xorg-server/include/pixmapstr.h
index 702faf0ac..8002b170a 100644
--- a/xorg-server/include/pixmapstr.h
+++ b/xorg-server/include/pixmapstr.h
@@ -76,10 +76,8 @@ typedef struct _Pixmap {
int refcnt;
int devKind; /* This is the pitch of the pixmap, typically width*bpp/8. */
DevUnion devPrivate; /* When !NULL, devPrivate.ptr points to the raw pixel data. */
-#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 a309077ce..d2d4a659f 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 */
@@ -438,6 +438,10 @@ typedef void (* MarkUnrealizedWindowProcPtr)(
WindowPtr /*pWin*/,
Bool /*fromConfigure*/);
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
typedef Bool (* DeviceCursorInitializeProcPtr)(
DeviceIntPtr /* pDev */,
ScreenPtr /* pScreen */);
diff --git a/xorg-server/include/servermd.h b/xorg-server/include/servermd.h
index dec9f3b9e..8cc20f000 100644
--- a/xorg-server/include/servermd.h
+++ b/xorg-server/include/servermd.h
@@ -269,6 +269,12 @@ SOFTWARE.
#define GLYPHPADBYTES 4
#endif /* linux/s390 */
+#ifdef WIN32
+#define IMAGE_BYTE_ORDER LSBFirst
+#define BITMAP_BIT_ORDER LSBFirst
+#define GLYPHPADBYTES 4
+#endif
+
/* size of buffer to use with GetImage, measured in bytes. There's obviously
* a trade-off between the amount of heap used and the number of times the
* ddx routine has to be called.
diff --git a/xorg-server/include/site.h b/xorg-server/include/site.h
index fec87070b..56c802d07 100644
--- a/xorg-server/include/site.h
+++ b/xorg-server/include/site.h
@@ -52,7 +52,7 @@ SOFTWARE.
* server executable.
*/
#ifndef VENDOR_STRING
-#define VENDOR_STRING "The X.Org Foundation"
+#define VENDOR_STRING "HMCA"
#endif
/*
@@ -61,7 +61,7 @@ SOFTWARE.
* by the vendor.
*/
#ifndef VENDOR_RELEASE
-#define VENDOR_RELEASE 6600
+#define VENDOR_RELEASE XORG_VERSION_CURRENT
#endif
/*
diff --git a/xorg-server/include/windowstr.h b/xorg-server/include/windowstr.h
index a31fdc1df..e7f4691d9 100644
--- a/xorg-server/include/windowstr.h
+++ b/xorg-server/include/windowstr.h
@@ -162,7 +162,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
new file mode 100644
index 000000000..91c7957bf
--- /dev/null
+++ b/xorg-server/include/xkb-config.h
@@ -0,0 +1,24 @@
+/* include/xkb-config.h. Generated from xkb-config.h.in by configure. */
+/* xkb-config.h.in: not at all generated. -*- c -*-
+ *
+ */
+
+#ifndef _XKB_CONFIG_H_
+#define _XKB_CONFIG_H_
+
+/* Default set of XKB rules. */
+#define __XKBDEFRULES__ "xorg"
+
+/* Path to XKB definitions. */
+#define XKB_BASE_DIRECTORY "xkbdata"
+
+/* Path to xkbcomp. */
+#define XKB_BIN_DIRECTORY "."
+
+/* XKB output dir for compiled keymaps. */
+#define XKM_OUTPUT_DIR "xkbdata/compiled/"
+
+/* Do not have `strcasecmp'. */
+/* #undef NEED_STRCASECMP */
+
+#endif /* _XKB_CONFIG_H_ */
diff --git a/xorg-server/include/xkbsrv.h b/xorg-server/include/xkbsrv.h
index d43755e06..03bf1fb03 100644
--- a/xorg-server/include/xkbsrv.h
+++ b/xorg-server/include/xkbsrv.h
@@ -293,8 +293,8 @@ extern int XkbReqCode;
extern int XkbEventBase;
extern int XkbDisableLockActions;
extern int XkbKeyboardErrorCode;
-extern char * XkbBaseDirectory;
-extern char * XkbBinDirectory;
+extern const char * XkbBaseDirectory;
+extern const char * XkbBinDirectory;
extern char * XkbInitialMap;
extern unsigned int XkbXIUnsupported;
diff --git a/xorg-server/installer/genruntimeinclude.py b/xorg-server/installer/genruntimeinclude.py
new file mode 100644
index 000000000..ffc1c8d9f
--- /dev/null
+++ b/xorg-server/installer/genruntimeinclude.py
@@ -0,0 +1,51 @@
+PublicToken="1fc8b3b9a1e18e3b"
+
+Template=r"""!define MSVC_PUBLICTOKEN "<PUBLICTOKEN>"
+!define MSVC_VERSION "<VERSION>"
+!define MSVCR90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcr90.dll"
+!define MSVCM90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcm90.dll"
+!define MSVCP90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcp90.dll"
+!define MSVC_CAT "<WINSXSDIR>\manifests\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>.cat"
+!define MSVC_MANIFEST_PART "x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>.manifest"
+!define MSVC_MANIFEST "<WINSXSDIR>\manifests\${MSVC_MANIFEST_PART}"
+"""
+
+import glob,re,sys,os
+
+Files=glob.glob(r"c:\windows\winsxs\x86_Microsoft.VC90.CRT_%s_9.0.*"%PublicToken)
+
+SearchRe=re.compile(r"c:\\windows\\winsxs\\x86_Microsoft\.VC90\.CRT_%s_9\.0\.([0-9]+)\.([0-9]+)_(.*)"%PublicToken,re.I)
+
+MajorVersion=0
+MinorVersion=0
+LatestFile=None
+#Now Select the one with the latest version
+for File in Files:
+ # Extract version
+ Search=SearchRe.search(File)
+ Major=int(Search.group(1))
+ Minor=int(Search.group(2))
+ if Major>MajorVersion:
+ MajorVersion=Major
+ MinorVersion=Minor
+ LatestFile=File
+ Suffix=Search.group(3)
+ elif Major==MajorVersion and Minor>MinorVersion:
+ MinorVersion=Minor
+ LatestFile=File
+ Suffix=Search.group(3)
+
+
+Template=re.sub("<VERSION>","%d.%d"%(MajorVersion,MinorVersion),Template)
+Template=re.sub("<PUBLICTOKEN>",PublicToken,Template)
+Template=re.sub("<SUFFIX>",Suffix,Template)
+
+WinSxsDir=os.path.join(os.getenv("systemroot"),"WinSxS")
+Template=re.sub("<WINSXSDIR>",WinSxsDir,Template)
+
+if len(sys.argv)==3 and sys.argv[2]=="1":
+ Template=re.sub("<DEBUG>","Debug",Template)
+else:
+ Template=re.sub("<DEBUG>","",Template)
+
+open("runtime","w").write(Template)
diff --git a/xorg-server/installer/packageall.bat b/xorg-server/installer/packageall.bat
new file mode 100644
index 000000000..b68ffdfa1
--- /dev/null
+++ b/xorg-server/installer/packageall.bat
@@ -0,0 +1,3 @@
+if exist vcxsrv.*.installer.exe del vcxsrv.*.installer.exe
+python genruntimeinclude.py
+"C:\Program Files\NSIS\makensis.exe" vcxsrv.nsi \ No newline at end of file
diff --git a/xorg-server/installer/vcxsrv.nsi b/xorg-server/installer/vcxsrv.nsi
new file mode 100644
index 000000000..5b82d7af8
--- /dev/null
+++ b/xorg-server/installer/vcxsrv.nsi
@@ -0,0 +1,195 @@
+; example2.nsi
+;
+; This script is based on example1.nsi, but it remember the directory,
+; has uninstall support and (optionally) installs start menu shortcuts.
+;
+; It will install example2.nsi into a directory that the user selects,
+
+;--------------------------------
+
+; The name of the installer
+Name "VcXsrv"
+
+; The file to write
+OutFile "vcxsrv.1.0.2.installer.exe"
+
+; The default installation directory
+InstallDir $PROGRAMFILES\VcXsrv
+
+; Registry key to check for directory (so if you install again, it will
+; overwrite the old one automatically)
+InstallDirRegKey HKLM "Software\VcXsrv" "Install_Dir"
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+;--------------------------------
+InstType "Full"
+InstType "Minimal"
+
+; Pages
+
+Page components
+Page directory
+Page instfiles
+
+UninstPage uninstConfirm
+UninstPage instfiles
+
+SetPluginUnload alwaysoff
+; ShowInstDetails show
+XPStyle on
+
+!define FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID {8cedc215-ac4b-488b-93c0-a50a49cb2fb8}
+
+!include runtime
+
+;--------------------------------
+
+; The stuff to install
+Section "VcXsrv (required)"
+
+ SectionIn RO
+ SectionIn 1 2
+
+ ; Set output path to the installation directory.
+ SetOutPath $INSTDIR
+
+ ; Put files there
+ File "..\obj\servrelease\vcxsrv.exe"
+ File "..\protocol.txt"
+ File "..\system.XWinrc"
+ File "..\..\xkbcomp\obj\release\xkbcomp.exe"
+ File "..\xkeysymdb"
+ File "..\hw\xwin\xlaunch\obj\release\xlaunch.exe"
+ File "..\..\tools\plink\obj\release\plink.exe"
+ SetOutPath $INSTDIR\fonts
+ File /r "..\fonts\*.*"
+ SetOutPath $INSTDIR\xkbdata
+ File /r "..\xkbdata\*.*"
+ SetOutPath $INSTDIR\locale
+ File /r "..\locale\*.*"
+
+ ; Write the installation path into the registry
+ WriteRegStr HKLM SOFTWARE\VcXsrv "Install_Dir" "$INSTDIR"
+
+ ; Write the uninstall keys for Windows
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VcXsrv" "DisplayName" "VcXsrv"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VcXsrv" "UninstallString" '"$INSTDIR\uninstall.exe"'
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VcXsrv" "NoModify" 1
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VcXsrv" "NoRepair" 1
+ WriteUninstaller "uninstall.exe"
+
+ InitPluginsDir
+ SetOutPath $PLUGINSDIR
+ File "${MSVCR90_DLL}"
+ File "${MSVCM90_DLL}"
+ File "${MSVCP90_DLL}"
+ File "${MSVC_CAT}"
+ File "${MSVC_MANIFEST}"
+ DetailPrint "Installing CRT assembly..."
+ System::Call "sxs::CreateAssemblyCache(*i .r0, i 0) i.r1"
+ StrCmp $1 0 0 fail
+ # Fill a FUSION_INSTALL_REFERENCE.
+ # fir.cbSize = sizeof(FUSION_INSTALL_REFERENCE) == 32
+ # fir.dwFlags = 0
+ # fir.guidScheme = FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID
+ # fir.szIdentifier = "nsissxs"
+ # fir.szNonCanonicalData = 0
+ System::Call "*(i 32, i 0, i 2364391957, i 1217113163, i 178634899, i 3090139977, w 'nsissxs', w '') i.s"
+ Pop $2
+ # IAssemblyCache::InstallAssembly(0, manifestPath, fir)
+ System::Call "$0->7(i 0, w '$PLUGINSDIR\${MSVC_MANIFEST_PART}', i r2) i.r1"
+ System::Free $2
+ StrCmp $1 0 0 fail2
+ System::Call "$0->2()"
+ Goto end
+
+fail:
+ DetailPrint "CreateAssemblyCache failed."
+ DetailPrint $1
+ Goto end
+
+fail2:
+ DetailPrint "InstallAssembly failed."
+ DetailPrint $1
+ Goto end
+end:
+SectionEnd
+
+; Optional section (can be disabled by the user)
+Section "Start Menu Shortcuts"
+ SectionIn 1
+
+ SetOutPath $INSTDIR
+ CreateDirectory "$SMPROGRAMS\VcXsrv"
+ CreateShortCut "$SMPROGRAMS\VcXsrv\Uninstall VcXsrv.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
+ CreateShortCut "$SMPROGRAMS\VcXsrv\VcXsrv.lnk" "$INSTDIR\vcxsrv.exe" " :1 -ac -terminate -lesspointer -multiwindow -clipboard +kb" "$INSTDIR\vcxsrv.exe" 0
+ CreateShortCut "$SMPROGRAMS\VcXsrv\XLaunch.lnk" "$INSTDIR\xlaunch.exe" "" "$INSTDIR\xlaunch.exe" 0
+
+SectionEnd
+
+; Optional section (can be disabled by the user)
+Section "Desktop Shortcuts"
+ SectionIn 1
+
+ SetOutPath $INSTDIR
+ CreateShortCut "$DESKTOP\VcXsrv.lnk" "$INSTDIR\vcxsrv.exe" " :1 -ac -terminate -lesspointer -multiwindow -clipboard +kb" "$INSTDIR\vcxsrv.exe" 0
+ CreateShortCut "$DESKTOP\XLaunch.lnk" "$INSTDIR\xlaunch.exe" "" "$INSTDIR\xlaunch.exe" 0
+
+SectionEnd
+
+;--------------------------------
+
+; Uninstaller
+
+Section "Uninstall"
+
+ ; Remove registry keys
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VcXsrv"
+ DeleteRegKey HKLM SOFTWARE\VcXsrv
+
+ ; Remove files and uninstaller
+ Delete "$INSTDIR\vcxsrv.exe"
+ Delete "$INSTDIR\uninstall.exe"
+ Delete "$INSTDIR\protocol.txt"
+ Delete "$INSTDIR\system.XWinrc"
+ Delete "$INSTDIR\xkbcomp.exe"
+ Delete "$INSTDIR\xkeysymdb"
+ Delete "$INSTDIR\xlaunch.exe"
+
+ RMDir /r "$INSTDIR\fonts"
+ RMDir /r "$INSTDIR\xkbdata"
+ RMDir /r "$INSTDIR\locale"
+
+ ; Remove shortcuts, if any
+ Delete "$SMPROGRAMS\VcXsrv\*.*"
+ Delete "$DESKTOP\VcXsrv.lnk"
+ Delete "$DESKTOP\XLaunch.lnk"
+
+ ; Remove directories used
+ RMDir "$SMPROGRAMS\VcXsrv"
+ RMDir "$INSTDIR"
+
+ DetailPrint "Removing CRT assembly..."
+ System::Call "sxs::CreateAssemblyCache(*i .r0, i 0) i.r1"
+ StrCmp $1 0 0 fail
+ System::Call "*(i 32, i 0, i 2364391957, i 1217113163, i 178634899, i 3090139977, w 'nsissxs', w '') i.s"
+ Pop $2
+ System::Call "$0->3(i 0, w 'Microsoft.VC90.CRT,version=$\"9.0.${MSVC_VERSION}$\",type=$\"win32$\",processorArchitecture=$\"x86$\",publicKeyToken=$\"${MSVC_PUBLICTOKEN}$\"', i r2, *i . r3) i.r1"
+ StrCmp $1 0 0 fail2
+ DetailPrint "Disposition returned is $3"
+ System::Call "$0->2()"
+ Goto end
+ fail:
+ DetailPrint "CreateAssemblyCache failed."
+ DetailPrint $1
+ Goto end
+ fail2:
+ DetailPrint "UninstallAssembly failed."
+ DetailPrint $1
+ Goto end
+end:
+
+SectionEnd
+
diff --git a/xorg-server/locale/compose.dir b/xorg-server/locale/compose.dir
new file mode 100644
index 000000000..22391882f
--- /dev/null
+++ b/xorg-server/locale/compose.dir
@@ -0,0 +1,9 @@
+# $Xorg: compose.dir,v 1.3 2000/08/17 19:46:48 cpqbld Exp $
+#
+# This file contains compose table file name.
+# The first word is the compose table file name and
+# the second word is full locale name.
+#
+# $XFree86: xc/nls/compose.dir,v 1.24 2003/08/06 14:04:00 eich Exp $
+#
+iso8859-1/Compose: C
diff --git a/xorg-server/locale/locale.alias b/xorg-server/locale/locale.alias
new file mode 100644
index 000000000..da9751406
--- /dev/null
+++ b/xorg-server/locale/locale.alias
@@ -0,0 +1,16 @@
+# $XdotOrg: lib/X11/nls/locale.alias.pre,v 1.12 2005-09-30 07:52:46 daniels Exp $
+# $Xorg: locale.alias,v 1.3 2000/08/17 19:46:48 cpqbld Exp $
+#
+# This file contains alias name of locale.
+# Each alias name is described within one line.
+# The first word is the alias name (simplified locale name)
+# the second word is full locale name.
+#
+# $XFree86: xc/nls/locale.alias,v 1.65 2004/01/03 03:31:00 dawes Exp $
+#
+
+POSIX: C
+POSIX-UTF2: C
+C_C.C: C
+C.en: C
+English_United-States.437: C
diff --git a/xorg-server/locale/locale.dir b/xorg-server/locale/locale.dir
new file mode 100644
index 000000000..116fdf818
--- /dev/null
+++ b/xorg-server/locale/locale.dir
@@ -0,0 +1,11 @@
+# $XdotOrg: lib/X11/nls/locale.dir.pre,v 1.10 2005-09-30 07:52:46 daniels Exp $
+# $Xorg: locale.dir,v 1.3 2000/08/17 19:46:48 cpqbld Exp $
+#
+# This file contains locale database file names
+# The first word is the locale database file name and
+# the second word is the full locale name.
+#
+# $XFree86: xc/nls/locale.dir,v 1.44 2003/12/18 04:14:22 dawes Exp $
+#
+
+C/XLC_LOCALE: C
diff --git a/xorg-server/makefile b/xorg-server/makefile
new file mode 100644
index 000000000..a9f8160a9
--- /dev/null
+++ b/xorg-server/makefile
@@ -0,0 +1,110 @@
+ifneq ($(MAKESERVER),1)
+$(error Please specify MAKESERVER=1 on the command line or as environment variable)
+endif
+
+INCLUDELIBFILES = \
+ 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 \
+ 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)\libfontenc\src\$(OBJDIR)\libfontenc.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
+
+TTYAPP=vcxsrv
+
+ifeq ($(DEBUG),1)
+LINKLIBS += $(MHMAKECONF)\openssl\out32_d\libeay32.lib \
+ $(MHMAKECONF)\freetype\lib\freetype200b8MT_D.lib \
+ $(MHMAKECONF)\pthreads\pthreadVC2d.lib
+else
+LINKLIBS += $(MHMAKECONF)\openssl\out32\libeay32.lib \
+ $(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)\$(TTYAPP).exe: $(LINKLIBS)
+
+XKeysymDB: ..\libX11\src\XKeysymDB
+ copy $< $@
+
+$(TTYAPP).exe: $(OBJDIR)\$(TTYAPP).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 $< $@
+
+load_makefile ..\tools\plink\makefile MAKESERVER=0 DEBUG=$(DEBUG))
+
+plink.exe: ..\tools\plink\$(OBJDIR:obj\$(OBJDIRPREFIX)%=obj\%)\plink.exe
+ copy $< $@
+
+load_makefile ..\libX11\nls\makefile MAKESERVER=0 DEBUG=0
+load_makefile fonts.src\makefile MAKESERVER=0 DEBUG=0
+load_makefile xkbdata.src\makefile MAKESERVER=0 DEBUG=0
+
+all: $(TTYAPP).exe xlaunch.exe xkbcomp.exe protocol.txt XKeysymDB ..\libX11\nls\all fonts.src\all xkbdata.src\all \
+ plink.exe
+
+protocol.txt: dix\protocol.txt
+ copy $< $@
+
+
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 e6d814fc8..fe4adac56 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/mi/mioverlay.c b/xorg-server/mi/mioverlay.c
index 395b1aab2..4159935f2 100644
--- a/xorg-server/mi/mioverlay.c
+++ b/xorg-server/mi/mioverlay.c
@@ -3,6 +3,10 @@
#include <dix-config.h>
#endif
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
#include <X11/X.h>
#include "scrnintstr.h"
#include "validate.h"
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c
index e37316e71..85cc70de0 100644
--- a/xorg-server/mi/mipointer.c
+++ b/xorg-server/mi/mipointer.c
@@ -285,10 +285,10 @@ miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
static void
miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
+ SetupScreen(pScreen);
if (!pDev->isMaster && pDev->u.master)
return;
- SetupScreen(pScreen);
(*pScreenPriv->spriteFuncs->DeviceCursorCleanup)(pDev, pScreen);
xfree(dixLookupPrivate(&pDev->devPrivates, miPointerPrivKey));
dixSetPrivate(&pDev->devPrivates, miPointerPrivKey, NULL);
@@ -302,9 +302,9 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
miPointerPtr pPointer;
BOOL changedScreen = FALSE;
+ SetupScreen (pScreen);
pPointer = MIPOINTER(pDev);
- SetupScreen (pScreen);
if (pPointer->pScreen != pScreen)
{
diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c
index 692e6c97a..6c4318f37 100644
--- a/xorg-server/mi/misprite.c
+++ b/xorg-server/mi/misprite.c
@@ -430,7 +430,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
if (DevHasCursor(pDev))
{
pCursorInfo = MISPRITE(pDev);
- if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
+ if (pCursorInfo && pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen &&
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
x, y, width, height))
@@ -468,7 +468,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
/*
* Damage will take care of destination check
*/
- if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
+ if (pCursorInfo && pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
RECT_IN_REGION (pScreen, prgnSrc, &pCursorInfo->saved) != rgnOUT)
{
SPRITE_DEBUG (("CopyWindow remove\n"));
@@ -553,9 +553,12 @@ miSpriteInstallColormap (ColormapPtr pMap)
if (DevHasCursor(pDev))
{
pCursorInfo = MISPRITE(pDev);
- pCursorInfo->checkPixels = TRUE;
- if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
- miSpriteRemoveCursor(pDev, pScreen);
+ if (pCursorInfo)
+ {
+ pCursorInfo->checkPixels = TRUE;
+ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
+ miSpriteRemoveCursor(pDev, pScreen);
+ }
}
}
@@ -725,10 +728,10 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y)
{
miSpriteScreenPtr pScreenPriv;
+ miCursorInfoPtr pPointer;
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miSpriteScreenKey);
- miCursorInfoPtr pPointer;
if (!pDev->isMaster && !pDev->u.master)
{
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 5ce26bd2f..73eb6d5c1 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
@@ -88,9 +88,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;
}
@@ -111,6 +113,7 @@ rootlessHasRoot (ScreenPtr pScreen)
return WINREC (WindowTable[pScreen->myNum]) != NULL;
}
+#ifdef __APPLE__
void
RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
{
@@ -180,6 +183,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 2d2555ea5..ca104a4d7 100644
--- a/xorg-server/miext/rootless/rootlessWindow.h
+++ b/xorg-server/miext/rootless/rootlessWindow.h
@@ -52,7 +52,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 (WindowPtr pWin, 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 d6dd99553..7235708f7 100644
--- a/xorg-server/os/WaitFor.c
+++ b/xorg-server/os/WaitFor.c
@@ -208,6 +208,12 @@ WaitForSomething(int *pClientsReady)
wt = &waittime;
}
}
+ if (!wt)
+ {
+ wt = &waittime;
+ waittime.tv_sec = 0;
+ waittime.tv_usec = 100;
+ }
XFD_COPYSET(&AllSockets, &LastSelectMask);
}
SmartScheduleStopTimer ();
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 8f1f73e43..9148b4ea8 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -111,6 +111,10 @@ SOFTWARE.
#include "dixstruct.h"
#include "xace.h"
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
+
#define Pid_t pid_t
#ifdef DNETCONN
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index f07993e5a..afe6d99d4 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -914,6 +914,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__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 692e78ad3..ef34b1afe 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/oscolor.c b/xorg-server/os/oscolor.c
index 7f6b93880..4e1513f53 100644
--- a/xorg-server/os/oscolor.c
+++ b/xorg-server/os/oscolor.c
@@ -49,6 +49,10 @@ SOFTWARE.
#include <dix-config.h>
#endif
+#ifdef _MSC_VER
+#define strncasecmp _strnicmp
+#endif
+
#include <X11/keysym.h>
#include "os.h"
diff --git a/xorg-server/os/osinit.c b/xorg-server/os/osinit.c
index 74e2457f2..49dfe4999 100644
--- a/xorg-server/os/osinit.c
+++ b/xorg-server/os/osinit.c
@@ -139,8 +139,10 @@ OsInit(void)
#endif
}
+#ifndef _MSC_VER
if (getpgrp () == 0)
setpgid (0, 0);
+#endif
#ifdef RLIMIT_DATA
if (limitDataSpace >= 0)
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index b1009494b..2d73a0c2d 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__)
@@ -217,6 +218,9 @@ OsSignal(sig, handler)
int sig;
OsSigHandlerPtr handler;
{
+#ifdef X_NOT_POSIX
+ return signal(sig, handler);
+#else
struct sigaction act, oact;
sigemptyset(&act.sa_mask);
@@ -227,6 +231,7 @@ OsSignal(sig, handler)
if (sigaction(sig, &act, &oact))
perror("sigaction");
return oact.sa_handler;
+#endif
}
/*
@@ -252,7 +257,7 @@ OsSignal(sig, handler)
#endif
static Bool StillLocking = FALSE;
-static char LockFile[PATH_MAX];
+static char szLockFile[PATH_MAX];
static Bool nolock = FALSE;
/*
@@ -264,26 +269,34 @@ static Bool nolock = FALSE;
void
LockServer(void)
{
+#if defined(WIN32) && !defined(__CYGWIN__)
+ char MutexName[100];
+ sprintf(MutexName, "Global\\VcXsrv_Mutex_%d\n", getpid());
+ if (!CreateMutex(NULL,TRUE,MutexName) || GetLastError()== ERROR_ALREADY_EXISTS)
+ {
+ FatalError("Server is already active for display %d\n", atoi(display));
+ }
+#else
+ char port[20];
char tmp[PATH_MAX], pid_str[12];
int lfd, i, haslock, l_pid, t;
char *tmppath = NULL;
int len;
- char port[20];
if (nolock) return;
/*
* Path names
*/
tmppath = LOCK_DIR;
-
sprintf(port, "%d", atoi(display));
+
len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) :
strlen(LOCK_TMP_PREFIX);
len += strlen(tmppath) + strlen(port) + strlen(LOCK_SUFFIX) + 1;
- if (len > sizeof(LockFile))
+ if (len > sizeof(szLockFile))
FatalError("Display name `%s' is too long\n", port);
(void)sprintf(tmp, "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, port);
- (void)sprintf(LockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port);
+ (void)sprintf(szLockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port);
/*
* Create a temporary file containing our PID. Attempt three times
@@ -325,7 +338,7 @@ LockServer(void)
i = 0;
haslock = 0;
while ((!haslock) && (i++ < 3)) {
- haslock = (link(tmp,LockFile) == 0);
+ haslock = (link(tmp,szLockFile) == 0);
if (haslock) {
/*
* We're done.
@@ -336,17 +349,17 @@ LockServer(void)
/*
* Read the pid from the existing file
*/
- lfd = open(LockFile, O_RDONLY);
+ lfd = open(szLockFile, O_RDONLY);
if (lfd < 0) {
unlink(tmp);
- FatalError("Can't read lock file %s\n", LockFile);
+ FatalError("Can't read lock file %s\n", szLockFile);
}
pid_str[0] = '\0';
if (read(lfd, pid_str, 11) != 11) {
/*
* Bogus lock file.
*/
- unlink(LockFile);
+ unlink(szLockFile);
close(lfd);
continue;
}
@@ -363,7 +376,7 @@ LockServer(void)
/*
* Stale lock file.
*/
- unlink(LockFile);
+ unlink(szLockFile);
continue;
}
else if (((t < 0) && (errno == EPERM)) || (t == 0)) {
@@ -373,14 +386,15 @@ LockServer(void)
unlink(tmp);
FatalError("Server is already active for display %s\n%s %s\n%s\n",
port, "\tIf this server is no longer running, remove",
- LockFile, "\tand start again.");
+ szLockFile, "\tand start again.");
}
}
}
unlink(tmp);
if (!haslock)
- FatalError("Could not create server lock file: %s\n", LockFile);
+ FatalError("Could not create server lock file: %s\n", szLockFile);
StillLocking = FALSE;
+#endif
}
/*
@@ -394,7 +408,7 @@ UnlockServer(void)
if (!StillLocking){
- (void) unlink(LockFile);
+ (void) unlink(szLockFile);
}
}
@@ -424,7 +438,7 @@ GiveUp(int sig)
errno = olderrno;
}
-#if defined WIN32 && defined __MINGW32__
+#if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__)
_X_EXPORT CARD32
GetTimeInMillis (void)
{
@@ -1196,7 +1210,7 @@ XNFstrdup(const char *s)
}
-#ifdef SIGVTALRM
+#if defined(SIGVTALRM) && !defined(__CYGWIN__)
#define SMART_SCHEDULE_POSSIBLE
#endif
@@ -1634,6 +1648,7 @@ Fclose(pointer iop)
*/
/* Consider LD* variables insecure? */
+#ifndef _MSC_VER
#ifndef REMOVE_ENV_LD
#define REMOVE_ENV_LD 1
#endif
@@ -1642,6 +1657,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
@@ -1672,7 +1688,7 @@ Fclose(pointer iop)
#endif
#define MAX_ARG_LENGTH 128
-#define MAX_ENV_LENGTH 256
+#define MAX_ENV_LENGTH 2048
#define MAX_ENV_PATH_LENGTH 2048 /* Limit for *PATH and TERMCAP */
#if USE_ISPRINT
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/randr/makefile b/xorg-server/randr/makefile
new file mode 100644
index 000000000..9ec11e808
--- /dev/null
+++ b/xorg-server/randr/makefile
@@ -0,0 +1,16 @@
+LIBRARY=librandr
+
+CSRCS = \
+ mirandr.c \
+ randr.c \
+ rrcrtc.c \
+ rrdispatch.c \
+ rrinfo.c \
+ rrmode.c \
+ rroutput.c \
+ rrpointer.c \
+ rrproperty.c \
+ rrscreen.c \
+ rrsdispatch.c \
+ rrtransform.c
+
diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c
index 939c14dd9..bb1620cfd 100644
--- a/xorg-server/randr/rroutput.c
+++ b/xorg-server/randr/rroutput.c
@@ -24,6 +24,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 e7eb75cc2..dceb32f2e 100644
--- a/xorg-server/randr/rrscreen.c
+++ b/xorg-server/randr/rrscreen.c
@@ -23,6 +23,11 @@
#include "randrstr.h"
static const int padlength[4] = {0, 3, 2, 1};
+/* From render.h */
+#ifndef SubPixelUnknown
+#define SubPixelUnknown 0
+#endif
+
static CARD16
RR10CurrentSizeID (ScreenPtr pScreen);
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..dfd905a7c
--- /dev/null
+++ b/xorg-server/render/makefile
@@ -0,0 +1,16 @@
+
+LIBRARY=librender
+
+CSRCS = \
+ animcur.c \
+ filter.c \
+ glyph.c \
+ matrix.c \
+ miindex.c \
+ mipict.c \
+ mirect.c \
+ mitrap.c \
+ mitri.c \
+ picture.c \
+ render.c \
+ renderedge.c
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c
index 2fadd8c36..9836bd569 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..081c05a0e
--- /dev/null
+++ b/xorg-server/startmulti.bat
@@ -0,0 +1 @@
+vcxsrv :1 -ac -terminate -lesspointer -multiwindow -xkblayout be -xkbmodel pc105 -clipboard +kb
diff --git a/xorg-server/startxdmcp.bat b/xorg-server/startxdmcp.bat
new file mode 100644
index 000000000..d4f6f20e7
--- /dev/null
+++ b/xorg-server/startxdmcp.bat
@@ -0,0 +1,2 @@
+vcxsrv :1 -query 192.168.37.20 -clipboard -ac -xkblayout be -xkbmodel pc105 -logverbose 3 -once
+
diff --git a/xorg-server/system.XWinrc b/xorg-server/system.XWinrc
new file mode 100644
index 000000000..db1fd9100
--- /dev/null
+++ b/xorg-server/system.XWinrc
@@ -0,0 +1,124 @@
+# XWin Server Resource File - EXAMPLE
+# Earle F. Philhower, III
+
+# Place in ~/.XWinrc or in /etc/X11/system.XWinrc
+
+# Keywords are case insensitive, comments legal pretty much anywhere
+# you can have an end-of-line
+
+# Comments begin with "#" or "//" and go to the end-of-line
+
+# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc)
+
+# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons)
+
+# Menus are defined as...
+# MENU <name> {
+# <Menu Text> EXEC <command>
+# ^^ This command will have any "%display%"
+# string replaced with the proper display
+# variable (i.e. 127.0.0.1:<display>.0)
+# or <Menu Text> MENU <name-of-some-prior-defined-menu>
+# or <Menu Text> ALWAYSONTOP
+# ^^ Sets the window to display above all others
+# or <Menu Text> RELOAD
+# ^^ Causes ~/.XWinrc or the system.XWinrc file
+# to be reloaded and icons and menus regenerated
+# or SEPARATOR
+# ...
+# }
+
+# Set the taskmar menu with
+# ROOTMENU <name-of-some-prior-defined-menu>
+
+# If you want a menu to be applied to all popup window's system menu
+# DEFAULTSYSMENU <name-of-some-prior-defined-menu> <atstart|atend>
+
+# To choose a specific menu for a specific WM_CLASS or WM_NAME use ...
+# SYSMENU {
+# <class-or-name-of-window> <name-of-prior-defined-menu> <atstart|atend>
+# ...
+# }
+
+# When specifying an ICONFILE in the following commands several different
+# formats are allowed:
+# 1. Name of a regular Windows .ico format file
+# (ex: "cygwin.ico", "apple.ico")
+# 2. Name and index into a Windows .DLL
+# (ex: "c:\windows\system32\shell32.dll,4" gives the default folder icon
+# "c:\windows\system32\shell32.dll,5" gives the floppy drive icon)
+# 3. Index into XWin.EXE internal ICON resource
+# (ex: ",101" is the 1st icon inside XWin.exe)
+
+# To define where ICO files live (** Windows path**)
+# ICONDIRECTORY <windows-path i.e. c:\cygwin\usr\icons>
+# NOTE: If you specify a fully qualified path to an ICON below
+# (i.e. "c:\xxx" or "d:\xxxx")
+# this ICONDIRECTORY will not be prepended
+
+# To change the taskbar icon use...
+# TRAYICON <name-of-windows-ico-file-in-icondirectory>
+
+# To define a replacement for the standard X icon for apps w/o specified icons
+# DEFAULTICON <name-of-windows-ico-file-in-icondirectory>
+
+# To define substitute icons on a per-window basis use...
+# ICONS {
+# <class-or-name-of-window> <icon-file-name.ico>
+# ...
+# }
+# In the case where multiple matches occur, the first listed in the ICONS
+# section will be chosen.
+
+# To disable exit confirmation dialog add the line containing SilentExit
+
+# DEBUG <string> prints out the string to the XWin.log file
+
+// Below are just some silly menus to demonstrate writing your
+// own configuration file.
+
+// Make some menus...
+menu apps {
+ xterm exec "xterm"
+ notepad exec notepad
+ xload exec "xload -display %display%" # Comment
+}
+
+menu root {
+// Comments fit here, too...
+ "Reload system.XWinrc" RELOAD
+ "Applications" menu apps
+ Separator
+}
+
+menu aot {
+ Separator
+ "Always on Top" alwaysontop
+}
+
+menu xtermspecial {
+ "Emacs" exec "emacs"
+ "Always on Top" alwaysontop
+ Separator
+}
+
+RootMenu root
+
+DefaultSysMenu aot atend
+
+SysMenu {
+ "xterm" xtermspecial atstart
+}
+
+# IconDirectory "c:\winnt\"
+
+# DefaultIcon "reinstall.ico"
+
+# Icons {
+# "xterm" "uninstall.ico"
+# }
+
+# SilentExit
+
+# DEBUG "Done parsing the configuration file..."
+
diff --git a/xorg-server/vcxsrv.sln b/xorg-server/vcxsrv.sln
new file mode 100644
index 000000000..948ecfc63
--- /dev/null
+++ b/xorg-server/vcxsrv.sln
@@ -0,0 +1,16 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB9-8B4A-11D0-8D11-00A0C91BC942}") = "vcxsrv.exe", "vcxsrv.exe", "{0A7F2844-C7BA-43E2-B7AE-48070F7AA1A7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Default = Debug|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0A7F2844-C7BA-43E2-B7AE-48070F7AA1A7}.Debug|Default.ActiveCfg = Debug
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 02ff1fd57..fc83f0a4b 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..31b3a857b
--- /dev/null
+++ b/xorg-server/xkb/makefile
@@ -0,0 +1,46 @@
+DEFINES += HAVE_XKB_CONFIG_H
+
+DDX_SRCS = \
+ ddxBeep.c \
+ ddxCtrls.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 4ff2d5fef..08dd9862d 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -5581,6 +5581,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 aea479cd1..d50334999 100644
--- a/xorg-server/xkb/xkbActions.c
+++ b/xorg-server/xkb/xkbActions.c
@@ -1021,15 +1021,15 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
DeviceIntPtr dev;
int button;
- if (xkbi->device == 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 (xkbi->device == 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 3a0e375e8..a2993b6cd 100644
--- a/xorg-server/xkb/xkbInit.c
+++ b/xorg-server/xkb/xkbInit.c
@@ -87,10 +87,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 "base"
@@ -114,8 +114,8 @@ typedef struct _SrvXkmInfo {
#define XKB_DFLT_RULES_PROP True
#endif
-char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
-char * XkbBinDirectory= XKB_BIN_DIRECTORY;
+const char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
+const char * XkbBinDirectory= XKB_BIN_DIRECTORY;
static int XkbWantAccessX= 0;
static Bool rulesDefined= False;
diff --git a/xorg-server/xkbdata.src/compat/makefile b/xorg-server/xkbdata.src/compat/makefile
new file mode 100644
index 000000000..486ca5541
--- /dev/null
+++ b/xorg-server/xkbdata.src/compat/makefile
@@ -0,0 +1,20 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=compat
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+dist_xkbdata_compat_DATA = \
+accessx basic complete \
+default iso9995 \
+japan keypad ledcaps \
+lednum ledscroll level5 \
+misc mousekeys norepeat \
+olpc pc pc98 xfree86 \
+xtest README
+
+DATA_FILES=$(dist_xkbdata_compat_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/geometry/digital_vndr/makefile b/xorg-server/xkbdata.src/geometry/digital_vndr/makefile
new file mode 100644
index 000000000..12d4c37fc
--- /dev/null
+++ b/xorg-server/xkbdata.src/geometry/digital_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\geometry\digital_vndr
+
+dist_geom_DATA = \
+lk pc unix
+
+DATA_FILES=$(dist_geom_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..e4351158f
--- /dev/null
+++ b/xorg-server/xkbdata.src/geometry/makefile
@@ -0,0 +1,27 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=geometry
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+dist_xkbdata_geometry_DATA = \
+amiga ataritt chicony \
+dell everex fujitsu \
+hhk hp keytronic kinesis \
+macintosh microsoft nec \
+northgate pc sony thinkpad \
+sun winbook README
+
+DATA_FILES=$(dist_xkbdata_geometry_DATA:%=$(DESTDIR)\%)
+
+SUBDIRS = digital_vndr sgi_vndr
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+.PHONY: extrastuff
+
+extrastuff: $(SUBDIRS:%=%\all)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/geometry/sgi_vndr/makefile b/xorg-server/xkbdata.src/geometry/sgi_vndr/makefile
new file mode 100644
index 000000000..285067802
--- /dev/null
+++ b/xorg-server/xkbdata.src/geometry/sgi_vndr/makefile
@@ -0,0 +1,13 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\geometry\sgi_vndr
+
+
+dist_geom_DATA = \
+indigo indy O2
+
+DATA_FILES=$(dist_geom_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/keycodes/digital_vndr/makefile b/xorg-server/xkbdata.src/keycodes/digital_vndr/makefile
new file mode 100644
index 000000000..9cf1180e5
--- /dev/null
+++ b/xorg-server/xkbdata.src/keycodes/digital_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\keycodes\digital_vndr
+
+dist_keycodes_DATA = \
+lk pc
+
+DATA_FILES=$(dist_keycodes_DATA:%=$(DESTDIR)\%)
+
+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..4b127c396
--- /dev/null
+++ b/xorg-server/xkbdata.src/keycodes/makefile
@@ -0,0 +1,34 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=keycodes
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+SUBDIRS = digital_vndr sgi_vndr
+
+dist_xkbdata_keycodes_DATA = \
+ aliases \
+ amiga \
+ ataritt \
+ evdev \
+ fujitsu \
+ hp \
+ ibm \
+ macintosh \
+ sony \
+ sun \
+ xfree86 \
+ xfree98 \
+ README
+
+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/keycodes/sgi_vndr/makefile b/xorg-server/xkbdata.src/keycodes/sgi_vndr/makefile
new file mode 100644
index 000000000..e6c1defda
--- /dev/null
+++ b/xorg-server/xkbdata.src/keycodes/sgi_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\keycodes\sgi_vndr
+
+dist_keycodes_DATA = \
+indigo indy iris
+
+DATA_FILES=$(dist_keycodes_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/keymap/digital_vndr/makefile b/xorg-server/xkbdata.src/keymap/digital_vndr/makefile
new file mode 100644
index 000000000..09dd6f797
--- /dev/null
+++ b/xorg-server/xkbdata.src/keymap/digital_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\keymap\digital_vndr
+
+dist_keymap_DATA = \
+us
+
+DATA_FILES=$(dist_keymap_DATA:%=$(DESTDIR)\%)
+
+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..5e174d61e
--- /dev/null
+++ b/xorg-server/xkbdata.src/keymap/makefile
@@ -0,0 +1,24 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=keymap
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+SUBDIRS = digital_vndr sgi_vndr sun_vndr
+
+dist_xkbdata_keymap_DATA = \
+amiga ataritt macintosh \
+sony xfree86 xfree98 \
+README
+
+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/keymap/sgi_vndr/makefile b/xorg-server/xkbdata.src/keymap/sgi_vndr/makefile
new file mode 100644
index 000000000..d2cb6083e
--- /dev/null
+++ b/xorg-server/xkbdata.src/keymap/sgi_vndr/makefile
@@ -0,0 +1,20 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\keymap\sgi_vndr
+
+dist_keymap_DATA = \
+be bg ca \
+ch cz de \
+dk dvorak \
+es fi \
+fr gb \
+hu it jp \
+no pl pt \
+ru se sk \
+th us
+
+DATA_FILES=$(dist_keymap_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/keymap/sun_vndr/makefile b/xorg-server/xkbdata.src/keymap/sun_vndr/makefile
new file mode 100644
index 000000000..1a3996406
--- /dev/null
+++ b/xorg-server/xkbdata.src/keymap/sun_vndr/makefile
@@ -0,0 +1,15 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\keymap\sun_vndr
+
+dist_keymap_DATA = \
+all de es fi \
+fr no pl \
+ru se uk \
+us
+
+DATA_FILES=$(dist_keymap_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/makefile b/xorg-server/xkbdata.src/makefile
new file mode 100644
index 000000000..94c550947
--- /dev/null
+++ b/xorg-server/xkbdata.src/makefile
@@ -0,0 +1,9 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+SUBDIRS = compat geometry keycodes keymap rules semantics symbols types
+
+load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+all: $(SUBDIRS:%=%\all)
diff --git a/xorg-server/xkbdata.src/rules/compat/ln_s.sh b/xorg-server/xkbdata.src/rules/compat/ln_s.sh
index 7e17d8851..6fc8f4713 100644
--- a/xorg-server/xkbdata.src/rules/compat/ln_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/ln_s.sh
@@ -1,20 +1,10 @@
-#!/bin/sh
+@echo off
+set variant=%1
-variant=$1
+set OUTFILE=base.l%variant%_s.part
-INDIR=`dirname $0`
-OUTFILE=base.l${variant}_s.part
+if exist %OUTFILE% del %OUTFILE%
-> $OUTFILE
+gawk "{ if (index($2, """(""") == 0) { printf """ %%s = +%%s%%%%(v[%variant%]):%variant%\n""", $1, $2;} else { printf """ %%s = +%%s:%variant%\n""", $1, $2; } }" layoutRename.lst >> %OUTFILE%
-awk '{
- if (index($2, "(") == 0) {
- printf " %s = +%s%%(v['${variant}']):'${variant}'\n", $1, $2;
- } else {
- printf " %s = +%s:'${variant}'\n", $1, $2;
- }
-}' < $INDIR/layoutRename.lst >> $OUTFILE
-
-awk '{
- printf " %s(%s) = +%s(%s):'${variant}'\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ %%s(%%s) = +%%s(%%s):%variant%\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/lnv_s.sh b/xorg-server/xkbdata.src/rules/compat/lnv_s.sh
index ae699f95b..a2b828803 100644
--- a/xorg-server/xkbdata.src/rules/compat/lnv_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/lnv_s.sh
@@ -1,12 +1,8 @@
-#!/bin/sh
+@echo off
+set variant=%1
-variant=$1
+set OUTFILE=base.l%variant%v%variant%_s.part
-INDIR=`dirname $0`
-OUTFILE=base.l${variant}v${variant}_s.part
+if exist %OUTFILE% del %OUTFILE%
-> $OUTFILE
-
-awk '{
- printf " %s %s = +%s(%s):'${variant}'\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ %%s %%s = +%%s(%%s):%variant%\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/makefile b/xorg-server/xkbdata.src/rules/compat/makefile
new file mode 100644
index 000000000..1abfe775f
--- /dev/null
+++ b/xorg-server/xkbdata.src/rules/compat/makefile
@@ -0,0 +1,61 @@
+
+TRANSFORM_FILES=layoutRename.lst variantRename.lst
+
+TRANSFORM_SCRIPTS= \
+ln_s.sh \
+lnv_s.sh \
+ml_s.sh \
+mlv_s.sh \
+ml1_s.sh \
+ml1v_s.sh \
+ml1v1_s.sh
+
+SCRIPTS= \
+base.l2_s.part \
+base.l3_s.part \
+base.l4_s.part \
+base.l2v2_s.part \
+base.l3v3_s.part \
+base.l4v4_s.part \
+base.ml_s.part \
+base.ml1_s.part \
+base.mlv_s.part \
+base.ml1v1_s.part \
+base.ml_s.part
+
+SH=cmd /c
+
+%.bat: %.sh
+ copy $< $@
+
+base.l2_s.part: ln_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 2
+
+base.l3_s.part: ln_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 3
+
+base.l4_s.part: ln_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 4
+
+base.l2v2_s.part: lnv_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 2
+
+base.l3v3_s.part: lnv_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 3
+
+base.l4v4_s.part: lnv_s.bat $(TRANSFORM_FILES)
+ $(SH) $< 4
+
+base.ml_s.part: ml_s.bat $(TRANSFORM_FILES)
+ $(SH) $<
+
+base.ml1_s.part: ml1_s.bat $(TRANSFORM_FILES)
+ $(SH) $<
+
+base.mlv_s.part: mlv_s.bat $(TRANSFORM_FILES)
+ $(SH) $<
+
+base.ml1v1_s.part: ml1v1_s.bat $(TRANSFORM_FILES)
+ $(SH) $<
+
+all: $(SCRIPTS)
diff --git a/xorg-server/xkbdata.src/rules/compat/ml1_s.sh b/xorg-server/xkbdata.src/rules/compat/ml1_s.sh
index 327de2d9c..dedccdb45 100644
--- a/xorg-server/xkbdata.src/rules/compat/ml1_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/ml1_s.sh
@@ -1,18 +1,9 @@
-#!/bin/sh
+@echo off
-INDIR=`dirname $0`
-OUTFILE=base.ml1_s.part
+set OUTFILE=base.ml1_s.part
-> $OUTFILE
+if exist %OUTFILE% del %OUTFILE%
-awk '{
- if (index($2, "(") == 0) {
- printf " * %s = pc+%s%%(v[1])\n", $1, $2;
- } else {
- printf " * %s = pc+%s\n", $1, $2;
- }
-}' < $INDIR/layoutRename.lst >> $OUTFILE
+gawk "{if (index($2, """(""") == 0) { printf """ * %%s = pc+%%s%%%%(v[1])\n""", $1, $2;} else { printf """ * %%s = pc+%%s\n""", $1, $2;}}" layoutRename.lst >> %OUTFILE%
-awk '{
- printf " * %s(%s) = pc+%s(%s)\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ * %%s(%%s) = pc+%%s(%%s)\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/ml1v1_s.sh b/xorg-server/xkbdata.src/rules/compat/ml1v1_s.sh
index 9edcb8e8c..26de0ea38 100644
--- a/xorg-server/xkbdata.src/rules/compat/ml1v1_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/ml1v1_s.sh
@@ -1,10 +1,7 @@
-#!/bin/sh
+@echo off
-INDIR=`dirname $0`
-OUTFILE=base.ml1v1_s.part
+set OUTFILE=base.ml1v1_s.part
-> $OUTFILE
+if exist %OUTFILE% del %OUTFILE%
-awk '{
- printf " * %s %s = pc+%s(%s)\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ * %%s %%s = pc+%%s(%%s)\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/ml1v_s.sh b/xorg-server/xkbdata.src/rules/compat/ml1v_s.sh
index 02ae5726d..afd7d7b19 100644
--- a/xorg-server/xkbdata.src/rules/compat/ml1v_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/ml1v_s.sh
@@ -1,10 +1,7 @@
-#!/bin/sh
+@echo off
-INDIR=`dirname $0`
-OUTFILE=base.ml1v_s.part
+set OUTFILE=base.ml1v_s.part
-> $OUTFILE
+if exist %OUTFILE% del %OUTFILE%
-awk '{
- printf " * %s %s = pc+%s(%s)\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ * %%s %%s = pc+%%s(%%s)\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/ml_s.sh b/xorg-server/xkbdata.src/rules/compat/ml_s.sh
index f35087380..c0b945a26 100644
--- a/xorg-server/xkbdata.src/rules/compat/ml_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/ml_s.sh
@@ -1,14 +1,9 @@
-#!/bin/sh
+@echo off
-INDIR=`dirname $0`
-OUTFILE=base.ml_s.part
+set OUTFILE=base.ml_s.part
-> $OUTFILE
+if exist %OUTFILE% del %OUTFILE%
-awk '{
- printf " * %s = pc+%s\n", $1, $2;
-}' < $INDIR/layoutRename.lst >> $OUTFILE
+gawk "{ printf """ * %%s = pc+%%s\n""", $1, $2; }" layoutRename.lst >> %OUTFILE%
-awk '{
- printf " * %s(%s) = pc+%s(%s)\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
+gawk "{ printf """ * %%s(%%s) = pc+%%s(%%s)\n""", $1, $2, $3, $4;}" variantRename.lst >> %OUTFILE%
diff --git a/xorg-server/xkbdata.src/rules/compat/mlv_s.sh b/xorg-server/xkbdata.src/rules/compat/mlv_s.sh
index ea644dcab..4dbe7acb3 100644
--- a/xorg-server/xkbdata.src/rules/compat/mlv_s.sh
+++ b/xorg-server/xkbdata.src/rules/compat/mlv_s.sh
@@ -1,10 +1,8 @@
-#!/bin/sh
+@echo off
-INDIR=`dirname $0`
-OUTFILE=base.mlv_s.part
+set OUTFILE=base.mlv_s.part
-> $OUTFILE
+if exist %OUTFILE% del %OUTFILE%
+
+gawk "{ printf """ * %%s %%s = pc+%%s(%%s)\n""", $1, $2, $3, $4; }" variantRename.lst >> %OUTFILE%
-awk '{
- printf " * %s %s = pc+%s(%s)\n", $1, $2, $3, $4;
-}' < $INDIR/variantRename.lst >> $OUTFILE
diff --git a/xorg-server/xkbdata.src/rules/makefile b/xorg-server/xkbdata.src/rules/makefile
new file mode 100644
index 000000000..1bd5e839b
--- /dev/null
+++ b/xorg-server/xkbdata.src/rules/makefile
@@ -0,0 +1,157 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+load_makefile compat\makefile DEBUG=$(DEBUG)
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\rules
+
+BASE_PARTS_NO_COMPAT = base.hdr.part base.lists.part \
+HDR base.m_k.part \
+HDR base.l1_k.part \
+HDR base.l_k.part \
+HDR base.ml_g.part \
+HDR base.m_g.part \
+HDR base.mlv_s.part \
+HDR base.ml_s.part \
+HDR base.ml1_s.part \
+HDR \
+HDR base.l2_s.part \
+HDR base.l3_s.part \
+HDR base.l4_s.part \
+HDR HDR HDR \
+HDR base.m_s.part \
+HDR base.ml_c.part \
+HDR base.ml1_c.part \
+HDR base.m_t.part \
+HDR base.l1o_s.part \
+HDR base.l2o_s.part \
+HDR base.l3o_s.part \
+HDR base.l4o_s.part \
+HDR base.o_s.part \
+HDR base.o_c.part \
+HDR base.o_t.part
+
+EVDEV_PARTS_NO_COMPAT = base.hdr.part base.lists.part \
+HDR evdev.m_k.part \
+HDR base.l1_k.part \
+HDR base.l_k.part \
+HDR base.ml_g.part \
+HDR base.m_g.part \
+HDR base.mlv_s.part \
+HDR base.ml_s.part \
+HDR base.ml1_s.part \
+HDR \
+HDR base.l2_s.part \
+HDR base.l3_s.part \
+HDR base.l4_s.part \
+HDR HDR HDR \
+HDR evdev.m_s.part \
+HDR base.ml_c.part \
+HDR base.ml1_c.part \
+HDR base.m_t.part \
+HDR base.l1o_s.part \
+HDR base.l2o_s.part \
+HDR base.l3o_s.part \
+HDR base.l4o_s.part \
+HDR base.o_s.part \
+HDR base.o_c.part \
+HDR base.o_t.part
+
+BASE_PARTS = base.hdr.part base.lists.part \
+compat/base.lists.part \
+HDR base.m_k.part \
+HDR base.l1_k.part \
+HDR base.l_k.part \
+HDR base.o_k.part \
+HDR base.ml_g.part \
+HDR base.m_g.part \
+HDR compat/base.mlv_s.part base.mlv_s.part \
+HDR compat/base.ml_s.part base.ml_s.part \
+HDR compat/base.ml1_s.part base.ml1_s.part \
+HDR compat/base.ml1v1_s.part \
+HDR compat/base.l2_s.part base.l2_s.part \
+HDR compat/base.l3_s.part base.l3_s.part \
+HDR compat/base.l4_s.part base.l4_s.part \
+HDR compat/base.l2v2_s.part \
+HDR compat/base.l3v3_s.part \
+HDR compat/base.l4v4_s.part \
+HDR base.m_s.part \
+HDR base.ml_c.part \
+HDR base.ml1_c.part \
+HDR base.m_t.part \
+HDR base.lo_s.part \
+HDR base.l1o_s.part \
+HDR base.l2o_s.part \
+HDR base.l3o_s.part \
+HDR base.l4o_s.part \
+HDR compat/base.o_s.part base.o_s.part \
+HDR base.o_c.part \
+HDR base.o_t.part
+
+EVDEV_PARTS = base.hdr.part base.lists.part \
+compat/base.lists.part \
+HDR evdev.m_k.part \
+HDR base.l1_k.part \
+HDR base.l_k.part \
+HDR base.o_k.part \
+HDR base.ml_g.part \
+HDR base.m_g.part \
+HDR compat/base.mlv_s.part base.mlv_s.part \
+HDR compat/base.ml_s.part base.ml_s.part \
+HDR compat/base.ml1_s.part base.ml1_s.part \
+HDR compat/base.ml1v1_s.part \
+HDR compat/base.l2_s.part base.l2_s.part \
+HDR compat/base.l3_s.part base.l3_s.part \
+HDR compat/base.l4_s.part base.l4_s.part \
+HDR compat/base.l2v2_s.part \
+HDR compat/base.l3v3_s.part \
+HDR compat/base.l4v4_s.part \
+HDR evdev.m_s.part \
+HDR base.ml_c.part \
+HDR base.ml1_c.part \
+HDR base.m_t.part \
+HDR base.lo_s.part \
+HDR base.l1o_s.part \
+HDR base.l2o_s.part \
+HDR base.l3o_s.part \
+HDR base.l4o_s.part \
+HDR compat/base.o_s.part base.o_s.part \
+HDR base.o_c.part \
+HDR base.o_t.part
+
+RULES_FILES = base evdev xfree98
+
+LST_FILES = base.lst evdev.lst
+
+$(DESTDIR)\%.lst: $(DESTDIR)\%.xml
+ perl xml2lst.pl < $< > $@
+
+$(DESTDIR)\base: compat\all $(BASE_PARTS_NO_COMPAT)
+ merge $@ $(BASE_PARTS)
+
+$(DESTDIR)\evdev: compat\all $(EVDEV_PARTS_NO_COMPAT)
+ merge $@ $(EVDEV_PARTS)
+
+ALL_RULES_FILES = $(RULES_FILES) $(LST_FILES) \
+xkb.dtd README
+
+COMPATFILES=xorg xorg.xml xorg.lst
+$(DESTDIR)\xorg: $(DESTDIR)\base
+ copy $< $@
+$(DESTDIR)\xorg%: $(DESTDIR)\base%
+ copy $< $@
+
+rules_DATA = $(ALL_RULES_FILES) $(COMPATFILES)
+
+XML_IN_FILES = base.xml.in evdev.xml.in
+xml_DATA = $(XML_IN_FILES:%.xml.in=%.xml)
+
+$(DESTDIR)\%.xml: %.xml.in
+ copy $< $@
+
+
+
+DATA_FILES=$(rules_DATA:%=$(DESTDIR)\%) $(xml_DATA:%=$(DESTDIR)\%)
+
+include ..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/rules/merge.py b/xorg-server/xkbdata.src/rules/merge.py
new file mode 100644
index 000000000..442a866f2
--- /dev/null
+++ b/xorg-server/xkbdata.src/rules/merge.py
@@ -0,0 +1,13 @@
+import sys
+
+pOUT=open(sys.argv[1],"wb")
+pHDR=open("HDR","r")
+for item in sys.argv[2:]:
+ if item == 'HDR':
+ pOUT.write("\n")
+ pOUT.write(pHDR.readline())
+ else:
+ pOUT.write(open(item,"rb").read())
+
+pOUT.close()
+
diff --git a/xorg-server/xkbdata.src/semantics/makefile b/xorg-server/xkbdata.src/semantics/makefile
new file mode 100644
index 000000000..0181c169f
--- /dev/null
+++ b/xorg-server/xkbdata.src/semantics/makefile
@@ -0,0 +1,17 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=semantics
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+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/digital_vndr/makefile b/xorg-server/xkbdata.src/symbols/digital_vndr/makefile
new file mode 100644
index 000000000..cdfa2ef28
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/digital_vndr/makefile
@@ -0,0 +1,13 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\digital_vndr
+
+dist_symbols_DATA = \
+lk pc us \
+vt
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/fujitsu_vndr/makefile b/xorg-server/xkbdata.src/symbols/fujitsu_vndr/makefile
new file mode 100644
index 000000000..841c123d8
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/fujitsu_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\fujitsu_vndr
+
+dist_symbols_DATA = \
+jp us
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/hp_vndr/makefile b/xorg-server/xkbdata.src/symbols/hp_vndr/makefile
new file mode 100644
index 000000000..3e6a64f47
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/hp_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\hp_vndr
+
+dist_symbols_DATA = \
+us
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/level3 b/xorg-server/xkbdata.src/symbols/level3
index 79fdcea03..a52708e2e 100644
--- a/xorg-server/xkbdata.src/symbols/level3
+++ b/xorg-server/xkbdata.src/symbols/level3
@@ -11,7 +11,7 @@
default partial modifier_keys
xkb_symbols "ralt_switch" {
key <RALT> {
- type[Group1]="ONE_LEVEL",
+ type[Group1]="TWO_LEVEL",
symbols[Group1] = [ ISO_Level3_Shift ]
};
modifier_map Mod5 { ISO_Level3_Shift };
diff --git a/xorg-server/xkbdata.src/symbols/macintosh_vndr/makefile b/xorg-server/xkbdata.src/symbols/macintosh_vndr/makefile
new file mode 100644
index 000000000..542b7a665
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/macintosh_vndr/makefile
@@ -0,0 +1,16 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\macintosh_vndr
+
+dist_symbols_DATA = \
+apple ch de dk \
+es fi fr \
+gb is it \
+latam nl no pt \
+se us
+
+DATA_FILES=$(dist_symbols_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..3b68b5c7a
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/makefile
@@ -0,0 +1,50 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=symbols
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+SUBDIRS = digital_vndr fujitsu_vndr hp_vndr macintosh_vndr nec_vndr sgi_vndr sony_vndr sun_vndr xfree68_vndr
+
+dist_xkbdata_symbols_DATA = \
+ad af al \
+am ara az \
+be bd \
+bg br ba \
+bt by braille \
+ca cd \
+ch cn cz \
+de dk \
+ee es et epo \
+fi fo fr \
+gb ge gh gn \
+gr hr hu \
+ie il in iq \
+ir is it jp \
+kg kh kr kz \
+la latam latin \
+lk lt lv \
+ma mao me mk \
+mm mn mt mv \
+ng nl no np \
+pc pk pl pt \
+ro rs ru \
+se si sk \
+sy th \
+tj tr \
+ua us uz vn \
+za \
+altwin capslock compose ctrl eurosign group inet \
+keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl
+
+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/symbols/nec_vndr/makefile b/xorg-server/xkbdata.src/symbols/nec_vndr/makefile
new file mode 100644
index 000000000..6ab523a2b
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/nec_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\nec_vndr
+
+dist_symbols_DATA = \
+jp
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/sgi_vndr/makefile b/xorg-server/xkbdata.src/symbols/sgi_vndr/makefile
new file mode 100644
index 000000000..79a27fead
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/sgi_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\sgi_vndr
+
+dist_symbols_DATA = \
+jp
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/sony_vndr/makefile b/xorg-server/xkbdata.src/symbols/sony_vndr/makefile
new file mode 100644
index 000000000..c2c1fa757
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/sony_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\sony_vndr
+
+dist_symbols_DATA = \
+us
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/sun_vndr/makefile b/xorg-server/xkbdata.src/symbols/sun_vndr/makefile
new file mode 100644
index 000000000..5741501b3
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/sun_vndr/makefile
@@ -0,0 +1,17 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\sun_vndr
+
+dist_symbols_DATA = \
+ cs cz de dk es \
+ fi fr gb gr hu \
+ it jp ko lt lv \
+ nl no pl pt ru \
+ se solaris sw tr tuv \
+ tw us usb
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+include ..\..\xkbrules.mak
diff --git a/xorg-server/xkbdata.src/symbols/xfree68_vndr/makefile b/xorg-server/xkbdata.src/symbols/xfree68_vndr/makefile
new file mode 100644
index 000000000..c9c1b3ede
--- /dev/null
+++ b/xorg-server/xkbdata.src/symbols/xfree68_vndr/makefile
@@ -0,0 +1,12 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\symbols\xfree68_vndr
+
+dist_symbols_DATA = \
+amiga ataritt
+
+DATA_FILES=$(dist_symbols_DATA:%=$(DESTDIR)\%)
+
+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..cef304543
--- /dev/null
+++ b/xorg-server/xkbdata.src/types/makefile
@@ -0,0 +1,25 @@
+ifeq ($(MAKESERVER),1)
+$(error Please do not specify MAKESERVER=1)
+endif
+
+THISDIR=types
+
+DESTDIR=$(MHMAKECONF)\xorg-server\xkbdata\$(THISDIR)
+
+dist_xkbdata_types_DATA = \
+ basic \
+ cancel \
+ caps \
+ complete \
+ default \
+ extra \
+ iso9995 \
+ mousekeys \
+ numpad \
+ level5 \
+ 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