Index: distinfo =================================================================== --- distinfo (revision 261) +++ distinfo (working copy) @@ -23,3 +23,4 @@ SHA1 (patch-sc) = 815186051e80bfca78968e994c73918ac0c412fd SHA1 (patch-sd) = 074b806b58f5ffb4a7418164deff2d96160aa61d SHA1 (patch-se) = c11b61ec7ad37221fd96fbf9d835894e27297705 +SHA1 (patch-xp) = c1b85ff0d0b17b8bdc227c51b1ca2f43e93f0086 Index: patches/patch-xp =================================================================== --- patches/patch-xp (revision 0) +++ patches/patch-xp (revision 0) @@ -0,0 +1,3258 @@ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/configure.ac ./configure.ac +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/configure.ac 2010-03-29 23:02:33.000000000 +0200 ++++ ./configure.ac 2010-03-29 22:58:44.000000000 +0200 +@@ -559,6 +559,7 @@ + AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) + AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) + AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) ++AC_ARG_ENABLE(xphoton, AS_HELP_STRING([--enable-xphoton], [Build Xphoton server for QNX (default: no)]), [XPHOTON=$enableval], [XPHOTON=no]) + AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addigion to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) + AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) + dnl kdrive and its subsystems +@@ -648,7 +649,6 @@ + XQUARTZ=no + fi + fi +- + if test "x$XQUARTZ" = xyes ; then + XQUARTZ=yes + XVFB=no +@@ -662,6 +662,19 @@ + ;; + esac + ++if test x$XPHOTON = xyes; then ++ XPHOTON=yes ++ XVFB=no ++ XNEST=no ++ COMPOSITE=no ++ DGA=no ++ GLX=no ++ GLXEXT=no ++ DPMSExtension=no ++ XF86VIDMODE=no ++ DRI=no ++fi ++ + dnl --------------------------------------------------------------------------- + dnl Extension section + dnl --------------------------------------------------------------------------- +@@ -1577,6 +1590,18 @@ + AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) + AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) + ++dnl QNX ++if test "x$XPHOTON" = xyes; then ++ AC_DEFINE(XPHOTON,1,[Have Photon]) ++ AC_DEFINE(ROOTLESS,1,[Build Rootless code]) ++ ++ PHOTON_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" ++ AC_SUBST([PHOTON_LIBS]) ++ ++ XPHOTON=yes ++fi ++AM_CONDITIONAL(XPHOTON, [test "x$XPHOTON" = xyes]) ++ + dnl DMX DDX + + PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no]) +@@ -1895,6 +1920,7 @@ + hw/xquartz/mach-startup/Makefile + hw/xquartz/pbproxy/Makefile + hw/xquartz/xpr/Makefile ++hw/xphoton/Makefile + hw/kdrive/Makefile + hw/kdrive/ephyr/Makefile + hw/kdrive/fake/Makefile +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/Makefile.am ./hw/Makefile.am +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/Makefile.am 2008-10-13 01:18:43.000000000 +0200 ++++ ./hw/Makefile.am 2010-03-16 00:33:26.000000000 +0100 +@@ -26,6 +26,10 @@ + XQUARTZ_SUBDIRS = xquartz + endif + ++if XPHOTON ++XPHOTON_SUBDIRS = xphoton ++endif ++ + SUBDIRS = \ + $(XORG_SUBDIRS) \ + $(XWIN_SUBDIRS) \ +@@ -33,9 +37,10 @@ + $(XNEST_SUBDIRS) \ + $(DMX_SUBDIRS) \ + $(KDRIVE_SUBDIRS) \ +- $(XQUARTZ_SUBDIRS) ++ $(XQUARTZ_SUBDIRS) \ ++ $(XPHOTON_SUBDIRS) + +-DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive ++DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xphoton + + relink: + for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/Makefile.am ./hw/xphoton/Makefile.am +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/Makefile.am 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,36 @@ ++bin_PROGRAMS = Xphoton ++ ++AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) ++AM_OBJCFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) ++AM_CPPFLAGS = \ ++ -DINXPHOTON \ ++ -I$(top_srcdir)/miext/rootless \ ++ -DXSERVER_VERSION=\"$(VERSION)\" \ ++ -DUSE_NEW_CLUT \ ++ -DXFree86Server \ ++ -DBUILD_DATE=\"$(BUILD_DATE)\" \ ++ -DX11LIBDIR=\"$(libdir)\" ++ ++SRCS = \ ++ $(top_srcdir)/fb/fbcmap_mi.c \ ++ $(top_srcdir)/mi/miinitext.c \ ++ nto.c \ ++ ntoEvents.c \ ++ ntoKeyboard.c \ ++ ntoXinput.c \ ++ photon.c \ ++ photonAudio.c \ ++ photonCursor.c \ ++ rootlessPhotonGlue.c \ ++ rootlessPhotonImp.c ++ ++ ++XPHOTON_LIBS = \ ++ @PHOTON_LIBS@ \ ++ ../../miext/rootless/.libs/librootless.a \ ++ $(XSERVER_LIBS) ++ ++Xphoton_SOURCES = $(SRCS) ++Xphoton_LDADD = $(XPHOTON_LIBS) $(XSERVER_SYS_LIBS) $(XPHOTON_SYS_LIBS) -lph ++Xphoton_DEPENDENCIES = $(XPHOTON_LIBS) ++ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/defmap.h ./hw/xphoton/defmap.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/defmap.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/defmap.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,121 @@ ++#ifdef NEED_DEFMAP ++#define XK_TECHNICAL ++#include "X11/keysym.h" ++ ++/* Must have a default xmodmap ++ * The following generated (indirectly) from xkeycaps 2.46 ++ * (http://www.jwz.org/xkeycaps/) ++ * This can, of course be changed at runtime with xmodmap ++ */ ++ ++struct { ++ unsigned char scan; ++ unsigned short s1, s2, s3, s4; ++} defmap[] = { ++ { 0x09, XK_Escape, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x0a, XK_1, XK_exclam, NoSymbol, NoSymbol }, ++ { 0x0b, XK_2, XK_at, NoSymbol, NoSymbol }, ++ { 0x0c, XK_3, XK_numbersign, NoSymbol, NoSymbol }, ++ { 0x0d, XK_4, XK_dollar, NoSymbol, NoSymbol }, ++ { 0x0f, XK_5, XK_percent, NoSymbol, NoSymbol }, ++ { 0x10, XK_6, XK_asciicircum, NoSymbol, NoSymbol }, ++ { 0x11, XK_7, XK_ampersand, NoSymbol, NoSymbol }, ++ { 0x12, XK_8, XK_asterisk, NoSymbol, NoSymbol }, ++ { 0x13, XK_9, XK_parenleft, NoSymbol, NoSymbol }, ++ { 0x14, XK_0, XK_parenright, NoSymbol, NoSymbol }, ++ { 0x15, XK_minus, XK_underscore, NoSymbol, NoSymbol }, ++ { 0x16, XK_equal, XK_plus, NoSymbol, NoSymbol }, ++ { 0x17, XK_BackSpace, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x18, XK_Tab, XK_ISO_Left_Tab, NoSymbol, NoSymbol }, ++ { 0x19, XK_q, XK_Q, NoSymbol, NoSymbol }, ++ { 0x1a, XK_w, XK_W, NoSymbol, NoSymbol }, ++ { 0x1b, XK_e, XK_E, NoSymbol, NoSymbol }, ++ { 0x1c, XK_r, XK_R, NoSymbol, NoSymbol }, ++ { 0x1d, XK_t, XK_T, NoSymbol, NoSymbol }, ++ { 0x1e, XK_y, XK_Y, NoSymbol, NoSymbol }, ++ { 0x1f, XK_u, XK_U, NoSymbol, NoSymbol }, ++ { 0x20, XK_i, XK_I, NoSymbol, NoSymbol }, ++ { 0x21, XK_o, XK_O, NoSymbol, NoSymbol }, ++ { 0x22, XK_p, XK_P, NoSymbol, NoSymbol }, ++ { 0x23, XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol }, ++ { 0x24, XK_bracketright, XK_braceright, NoSymbol, NoSymbol }, ++ { 0x25, XK_Return, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x26, XK_Control_L, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x27, XK_a, XK_A, NoSymbol, NoSymbol }, ++ { 0x28, XK_s, XK_S, NoSymbol, NoSymbol }, ++ { 0x29, XK_d, XK_D, NoSymbol, NoSymbol }, ++ { 0x2a, XK_f, XK_F, NoSymbol, NoSymbol }, ++ { 0x2b, XK_g, XK_G, NoSymbol, NoSymbol }, ++ { 0x2c, XK_h, XK_H, NoSymbol, NoSymbol }, ++ { 0x2d, XK_j, XK_J, NoSymbol, NoSymbol }, ++ { 0x2e, XK_k, XK_K, NoSymbol, NoSymbol }, ++ { 0x2f, XK_l, XK_L, NoSymbol, NoSymbol }, ++ { 0x30, XK_semicolon, XK_colon, NoSymbol, NoSymbol }, ++ { 0x31, XK_apostrophe, XK_quotedbl, NoSymbol, NoSymbol }, ++ { 0x32, XK_grave, XK_asciitilde, NoSymbol, NoSymbol }, ++ { 0x33, XK_Shift_L, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x34, XK_backslash, XK_bar, NoSymbol, NoSymbol }, ++ { 0x35, XK_z, XK_Z, NoSymbol, NoSymbol }, ++ { 0x36, XK_x, XK_X, NoSymbol, NoSymbol }, ++ { 0x37, XK_c, XK_C, NoSymbol, NoSymbol }, ++ { 0x38, XK_v, XK_V, NoSymbol, NoSymbol }, ++ { 0x39, XK_b, XK_B, NoSymbol, NoSymbol }, ++ { 0x3a, XK_n, XK_N, NoSymbol, NoSymbol }, ++ { 0x3b, XK_m, XK_M, NoSymbol, NoSymbol }, ++ { 0x3c, XK_comma, XK_less, NoSymbol, NoSymbol }, ++ { 0x3d, XK_period, XK_greater, NoSymbol, NoSymbol }, ++ { 0x3e, XK_slash, XK_question, NoSymbol, NoSymbol }, ++ { 0x3f, XK_Shift_R, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x40, XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x41, XK_Alt_L, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x42, XK_space, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x43, XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x44, XK_F1, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x45, XK_F2, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x46, XK_F3, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x47, XK_F4, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x48, XK_F5, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x49, XK_F6, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x4a, XK_F7, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x4b, XK_F8, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x4c, XK_F9, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x4d, XK_F10, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x4e, XK_Num_Lock, XK_Pointer_EnableKeys, NoSymbol, NoSymbol }, ++ { 0x4f, XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x50, XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol }, ++ { 0x51, XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol }, ++ { 0x52, XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol }, ++ { 0x53, XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x54, XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol }, ++ { 0x55, XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol }, ++ { 0x56, XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol }, ++ { 0x57, XK_KP_Add, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x58, XK_KP_End, XK_KP_1, NoSymbol, NoSymbol }, ++ { 0x59, XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol }, ++ { 0x5a, XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol }, ++ { 0x5b, XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol }, ++ { 0x5c, XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol }, ++ { 0x5d, XK_Alt_R, NoSymbol, NoSymbol, NoSymbol }, ++ // ?? ++ { 0x60, XK_F11, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x61, XK_F12, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x62, XK_Home, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x63, XK_Up, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x64, XK_Prior, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x65, XK_Left, NoSymbol, NoSymbol, NoSymbol }, ++ // ?? ++ { 0x67, XK_Right, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x68, XK_End, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x69, XK_Down, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6a, XK_Next, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6b, XK_Insert, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6c, XK_Delete, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6d, XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6e, XK_Control_R, NoSymbol, NoSymbol, NoSymbol }, ++ { 0x6f, XK_Pause, XK_Break, NoSymbol, NoSymbol }, ++ { 0x70, XK_Print, XK_Execute, NoSymbol, NoSymbol }, ++ { 0x71, XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol }, ++}; ++ ++int num_defmap = sizeof(defmap) / sizeof(defmap[0]); ++#endif +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/fakeBoxRec.h ./hw/xphoton/fakeBoxRec.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/fakeBoxRec.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/fakeBoxRec.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,26 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/fakeBoxRec.h,v 1.1 2001/07/01 02:13:41 torrey Exp $ */ ++ ++#ifndef FAKEBOXREC_H ++#define FAKEBOXREC_H ++ ++// This struct is byte-compatible with X11's BoxRec, for use in ++// code that can't include X headers. ++typedef struct _fakeBox { ++ short x1; ++ short y1; ++ short x2; ++ short y2; ++} fakeBoxRec; ++ ++#endif +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/nto.c ./hw/xphoton/nto.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/nto.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/nto.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,441 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++ ++/** ++ * nto.c ++ * ++ * Main entry point and shared routines for NTO stuff ++ * ++ * @author XQuartz authors ++ * @author Sean Beaudreau of QNX ++ * @author André Wösten ++ * @package xphoton ++ */ ++ ++#define NEED_X11 ++#define NEED_PHOTON ++#include "xphoton.h" ++ ++// X server shared global variables ++NtoFramebufferRec dfb; ++int photonConsole = 0; ++UInt32 ntoScreenNumber = 0; ++int ntoEventReadFD = -1; ++int ntoEventWriteFD = -1; ++qnxPixDataType gdrawfrom = DRAW_FROM_OFFSCREEN; ++ ++DeviceIntPtr ntoPointer = NULL; ++DeviceIntPtr ntoKeyboard = NULL; ++ ++// Common pixmap formats ++static PixmapFormatRec formats[] = { ++ { 1, 1, BITMAP_SCANLINE_PAD }, ++ { 4, 8, BITMAP_SCANLINE_PAD }, ++ { 8, 8, BITMAP_SCANLINE_PAD }, ++ { 15, 16, BITMAP_SCANLINE_PAD }, ++ { 16, 16, BITMAP_SCANLINE_PAD }, ++ { 24, 32, BITMAP_SCANLINE_PAD }, ++ { 32, 32, BITMAP_SCANLINE_PAD } ++}; ++const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); ++ ++#ifndef OSNAME ++#define OSNAME " QNX(Neutrino) " ++#endif ++#ifndef OSVENDOR ++#define OSVENDOR "QNX Software Systems Ltd. " ++#endif ++#ifndef PRE_RELEASE ++#define PRE_RELEASE XORG_VERSION_SNAP ++#endif ++ ++ ++void ++DDXRingBell(int volume, int pitch, int duration) ++{ ++ // FIXME -- make some noise, yo ++} ++ ++static void ++NtoPrintBanner(void) ++{ ++ // this should change depending on which specific server we are building ++ ErrorF("Xphoton starting:\n"); ++ ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE ); ++} ++ ++ ++/* ++ * NtoSaveScreen ++ * X screensaver support. Not implemented. ++ */ ++static Bool ++NtoSaveScreen(ScreenPtr pScreen, int on) ++{ ++ // FIXME ++ if (on == SCREEN_SAVER_FORCER) { ++ } else if (on == SCREEN_SAVER_ON) { ++ } else { ++ } ++ return TRUE; ++} ++ ++/* ++ * NtoAddScreen ++ * This is a callback from X during AddScreen() from InitOutput() ++ * ++ * Define the ScreenInit() function. This is called at the start of each server generation, ++ * and should fill in as much of the ScreenRec as possible as well as any other data that is ++ * initialised once per generation. It should initialise the framebuffer layers it is using, ++ * and initialise the initial video mode. ++ */ ++static Bool ++NtoAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) ++{ ++ int bitsPerRGB, i, dpi; ++ VisualPtr visual; ++ ++ // Communicate the information about our initialized screen back to X ++ bitsPerRGB = dfb.pixelInfo.bitsPerComponent; ++ ++ // Reset the visual list ++ miClearVisualTypes(); ++ ++ // Setup a single visual appropriate for our pixel type ++ if (!miSetVisualTypes( dfb.colorBitsPerPixel, TrueColorMask, bitsPerRGB, TrueColor )) { ++ return FALSE; ++ } ++ ++ miSetPixmapDepths(); ++ ++ // Machine independent screen init, setup _Screen structure in pScreen ++ dpi = (monitorResolution) ? monitorResolution : 75; ++ ++ // initialize fb ++ if (! fbScreenInit( ++ pScreen, ++ dfb.framebuffer, // pointer to screen bitmap ++ dfb.width, dfb.height, // screen size in pixels ++ dpi, dpi, // dots per inch ++ dfb.pitch/(dfb.bitsPerPixel/8), // pixel width of framebuffer ++ dfb.bitsPerPixel)) // bits per pixel for screen ++ { ++ return FALSE; ++ } ++ ++ // Set the RGB order correctly for TrueColor ++ if (dfb.bitsPerPixel > 8) { ++ for (i = 0, visual = pScreen->visuals; i < pScreen->numVisuals; i++, visual++) { ++ if (visual->class == TrueColor) { ++ visual->offsetRed = bitsPerRGB * 2; ++ visual->offsetGreen = bitsPerRGB; ++ visual->offsetBlue = 0; ++#if TRUE ++ visual->redMask = ((1<offsetRed; ++ visual->greenMask = ((1<offsetGreen; ++ visual->blueMask = ((1<offsetBlue; ++#else ++ visual->redMask = dfb.pixelInfo.componentMasks[0]; ++ visual->greenMask = dfb.pixelInfo.componentMasks[1]; ++ visual->blueMask = dfb.pixelInfo.componentMasks[2]; ++#endif ++ } ++ } ++ } ++ ++#ifdef RENDER ++ if (! fbPictureInit(pScreen, 0, 0)) { ++ return FALSE; ++ } ++#endif ++ ++#ifdef MITSHM ++ ShmRegisterFbFuncs(pScreen); ++#endif ++ ++ // This must be initialized (why doesn't X have a default?) ++ pScreen->SaveScreen = NtoSaveScreen; ++ ++ // Perform operations specific to the screen interface ++ if (! PhotonAddScreen(pScreen)) { ++ return FALSE; ++ } ++ ++ // Create and install the default colormap and ++ // Set pScreen->blackPixel / pScreen->white ++ if (!miCreateDefColormap( pScreen )) { ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++ ++/* ++ * NtoMouseProc ++ * Handle the initialization, etc. of a mouse ++ */ ++static int ++NtoMouseProc(DeviceIntPtr pPointer, int what) ++{ ++ // 0 | 1 | 2 | 3 | 4 | 5 ++ // unused | left | right | middle | scroll up | scroll down ++ CARD8 map[6] = {0, 1, 2, 3, 4, 5}; ++ ++ XPH_PRINTF("NtoMouseProc(%p,%d)", pPointer, what); ++ ++ switch (what) { ++ case DEVICE_INIT: ++ // Set button map. ++ InitPointerDeviceStruct((DevicePtr)pPointer, map, 5, (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2); ++ pPointer->valuator->mode = Absolute; ++ InitAbsoluteClassDeviceStruct(pPointer); ++ break; ++ case DEVICE_ON: ++ pPointer->public.on = TRUE; ++ AddEnabledDevice( ntoEventReadFD ); ++ return Success; ++ case DEVICE_CLOSE: ++ case DEVICE_OFF: ++ pPointer->public.on = FALSE; ++ RemoveEnabledDevice( ntoEventReadFD ); ++ return Success; ++ } ++ ++ return Success; ++} ++ ++ ++/* ++ * NtoKeybdProc ++ * Callback from X ++ */ ++static int ++NtoKeybdProc(DeviceIntPtr pDev, int onoff) ++{ ++ XPH_PRINTF("NtoKeybdProc(%p,%d)", pDev, onoff); ++ ++ switch ( onoff ) { ++ case DEVICE_INIT: ++ pDev->public.on = TRUE; ++ NtoKeyboardInit( pDev ); ++ break; ++ case DEVICE_ON: ++ pDev->public.on = TRUE; ++ AddEnabledDevice( ntoEventReadFD ); ++ break; ++ case DEVICE_OFF: ++ pDev->public.on = FALSE; ++ RemoveEnabledDevice( ntoEventReadFD ); ++ break; ++ case DEVICE_CLOSE: ++ break; ++ } ++ ++ return Success; ++} ++ ++ ++/* ++ * InitInput ++ * Register the keyboard and mouse devices ++ */ ++void ++InitInput( int argc, char **argv ) ++{ ++ XPH_PRINTF("InitInput(%d,...)", argc); ++ ++ ntoPointer = AddInputDevice(serverClient, NtoMouseProc, TRUE); ++ RegisterPointerDevice( ntoPointer ); ++ ntoPointer->name = strdup("pointer"); ++ ++ ntoKeyboard = AddInputDevice(serverClient, NtoKeybdProc, TRUE); ++ RegisterKeyboardDevice( ntoKeyboard ); ++ ntoKeyboard->name = strdup("keyboard"); ++ ++ NtoEQInit(); ++} ++ ++ ++/* ++ * InitOutput ++ * Initialize screenInfo for all actually accessible framebuffers. ++ */ ++void ++InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) ++{ ++ int i; ++ ++ XPH_PRINTF("InitOutput(%p,%d...)", pScreenInfo, argc); ++ ++ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; ++ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; ++ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; ++ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; ++ ++ // list how we want common pixmap formats to be padded ++ pScreenInfo->numPixmapFormats = NUMFORMATS; ++ for (i = 0; i < NUMFORMATS; i++) { ++ pScreenInfo->formats[i] = formats[i]; ++ } ++ ++ AddScreen( NtoAddScreen, argc, argv ); ++ ++ /* We get a SIGHUP when Photon goes away... */ ++ AddEnabledDevice(PhReattach(NULL)->fd); ++ OsSignal(SIGHUP, PhotonExit); ++} ++ ++ ++/* ++ * OsVendorFataError ++ */ ++void ++OsVendorFatalError( void ) ++{ ++ ErrorF( " OsVendorFatalError\n" ); ++} ++ ++ ++/* ++ * OsVendorInit ++ * Initialization of Nto support. ++ * Initialize display and event handling. ++ */ ++void ++OsVendorInit(void) ++{ ++ XPH_ENTRY; ++ ++ NtoPrintBanner(); ++ PhotonOsVendorInit(); ++} ++ ++ ++/* ++ * ddxProcessArgument ++ * Process device-dependent command line args. Returns 0 if argument is ++ * not device dependent, otherwise Count of number of elements of argv ++ * hat are part of a device dependent commandline option. ++ */ ++int ++ddxProcessArgument( int argc, char *argv[], int i ) ++{ ++ if ( !strcmp( argv[i], "-screen" ) ) { ++ if ( i == argc-1 ) { ++ FatalError( "-screen must be followed by a number\n" ); ++ } ++ ntoScreenNumber = atoi( argv[i+1] ); ++ ErrorF( "Attempting to use screen number %i\n", ntoScreenNumber ); ++ return 2; ++ } ++ ++ if ( !strcmp( argv[i], "-pixtype" ) ) { ++ if ( i == argc-1 ) { ++ FatalError( "-pixtype must be followed by a number\n" ); ++ } ++ switch (atoi( argv[i+1])) { ++ case 2: ++ gdrawfrom = DRAW_FROM_OFFSCREEN; ++ break; ++ case 1: ++ gdrawfrom = DRAW_FROM_SHMEM; ++ break; ++ case 0: ++ default: ++ gdrawfrom = DRAW_FROM_MEMORY; ++ break; ++ } ++ ++ ErrorF( "Attempting to draw from %s\n", ++ gdrawfrom == DRAW_FROM_OFFSCREEN ? "offscreen" : DRAW_FROM_SHMEM ? "shared memory" : "malloced memory" ); ++ ++ return 2; ++ } ++ ++ ++ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) { ++ NtoPrintBanner(); ++ exit(0); ++ } ++ ++ return 0; ++} ++ ++ ++/* ++ * ddxUseMsg ++ * Print out correct use of device dependent commandline options. ++ * Maybe the user now knows what really to do ... ++ */ ++void ++ddxUseMsg( void ) ++{ ++ ErrorF("\n"); ++ ErrorF("\n"); ++ ErrorF("Device Dependent Usage:\n"); ++ ErrorF("\n"); ++ ErrorF("-version : show the server version.\n"); ++ ErrorF("\n"); ++} ++ ++/* ++ * ddxGiveUp ++ * Device dependent cleanup. Called by dix before normal server death. ++ */ ++void ++ddxGiveUp( void ) ++{ ++ ErrorF( "Quitting...\n" ); ++ ++ PhotonGiveUp(); ++} ++ ++ ++/* ++ * AbortDDX ++ * DDX - specific abort routine. Called by AbortServer(). The attempt is ++ * made to restore all original setting of the displays. Also all devices ++ * are closed. ++ */ ++void ++AbortDDX( void ) ++{ ++ ErrorF( " AbortDDX\n" ); ++ /* ++ * This is needed for a abnormal server exit, since the normal exit stuff ++ * MUST also be performed (i.e. the vt must be left in a defined state) ++ */ ++ ddxGiveUp(); ++} ++ ++ ++#ifdef DPMSExtension ++Bool ++DPMSSupported(void) ++{ ++ return 0; ++} ++ ++ ++void ++DPMSSet(int level) ++{ ++ return; ++} ++ ++int ++DPMSGet(int *plevel) ++{ ++ return 0; ++} ++#endif +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/nto.h ./hw/xphoton/nto.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/nto.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/nto.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,69 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.7 2001/08/06 04:14:36 torrey Exp $ */ ++ ++#ifndef XPHOTON_NTO_H ++#define XPHOTON_NTO_H ++ ++typedef int io_connect_t; ++typedef struct { ++ int bitsPerComponent; ++ int pixelType; ++ int componentCount; ++} IOPixelInformation; ++typedef int StdFBShmem_t; ++typedef _Uint32t UInt32; ++typedef _Int32t IOIndex; ++typedef _Int32t SInt32; ++ ++typedef struct { ++ pthread_t hidThread; ++ io_connect_t fbService; ++ io_connect_t hidService; ++ io_connect_t hidParam; ++ void *framebuffer; ++ int width; ++ int height; ++ int pitch; ++ int bitsPerPixel; ++ int colorBitsPerPixel; ++ IOPixelInformation pixelInfo; ++ StdFBShmem_t *cursorShmem; ++ PdOffscreenContext_t *os; ++} NtoFramebufferRec; ++ ++typedef enum { ++ DRAW_FROM_MEMORY, ++ DRAW_FROM_SHMEM, ++ DRAW_FROM_OFFSCREEN ++} qnxPixDataType; ++ ++void NtoKeyboardInit(DeviceIntPtr pDev); ++int NtoModifierKeycode(int modifier, int side); ++ ++#undef assert ++#define assert(x) { if ((x) == 0) \ ++ FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); } ++#define kern_assert(x) { if ((x) != KERN_SUCCESS) \ ++ FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \ ++ __LINE__, __FILE__, x); } ++ ++#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0... ++ ++// Global variables from nto.c ++extern NtoFramebufferRec dfb; ++extern UInt32 ntoScreenNumber; ++extern qnxPixDataType gdrawfrom; ++extern int ntoEventReadFD; ++extern int ntoEventWriteFD; ++ ++#endif /* XPHOTON_NTO_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoEvents.c ./hw/xphoton/ntoEvents.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoEvents.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/ntoEvents.c 2010-03-16 00:39:18.000000000 +0100 +@@ -0,0 +1,129 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++ ++/** ++ * ntoEvents.c ++ * ++ * Responsible for controlling the machine independant event queue of the X server ++ * ++ * @author André Wösten ++ * @package xphoton ++ */ ++ ++// FIXME: Is this really needed? ++#ifdef HAVE_DIX_CONFIG_H ++#include ++#endif ++ ++#define NEED_X11 ++#include "xphoton.h" ++ ++extern DeviceIntPtr ntoPointer; ++extern DeviceIntPtr ntoKeyboard; ++ ++ ++/** ++ * Read and process events from the event pipe until it is empty. ++ * ++ * Called from the DIX dispatcher (see dix/dispatch.c) ++ * ++ * According to mi/mieq.c mieqProcessInputEvents should be called ++ * there, which is dispatching all input events. ++ */ ++void ++ProcessInputEvents(void) ++{ ++ mieqProcessInputEvents(); ++} ++ ++ ++/** ++ * Initializes the event queue ++ * ++ * Called from InitInput in nto.c, which registers keyboard and ++ * mouse devices in the initalization (see dix/main.c) of the X server ++ */ ++void ++NtoEQInit(void) ++{ ++ EventList *events = NULL; ++ int fd[2]; ++ ++ XPH_ENTRY; ++ ++ // Create pipe for Event communication ++ assert(pipe(fd) == 0); ++ ntoEventReadFD = fd[0]; ++ ntoEventWriteFD = fd[1]; ++ fcntl(ntoEventReadFD, F_SETFL, O_NONBLOCK); ++ ++ // Initialize X event queue ++ mieqInit(); ++ ++ // Get initial event list (see dix/getevents.c) ++ GetEventList(&events); ++} ++ ++ ++/** ++ * Sends a null byte to the event queue to force events to be processed ++ * Yes, this is a hack :-( ++ */ ++void ++NtoEQPoke(void) { ++ // We send a null byte to force mieqProcessInputEvents to execute ++ char nullbyte = 0; ++ write(ntoEventWriteFD, &nullbyte, 1); ++} ++ ++ ++/** ++ * Pointer events are mouse events, which are processed here and ++ * enqueued into the MIEQ ++ */ ++int ++NtoProcessPointerEvent(int type, int buttons, int x, int y) { ++ EventList *events = NULL; ++ int valuators[2]; ++ int i, n; ++ ++ valuators[0] = x; ++ valuators[1] = y; ++ ++ GetEventList(&events); ++ n = GetPointerEvents(events, ntoPointer, type, buttons, POINTER_ABSOLUTE, 0, 2, valuators); ++ for(i = 0; i < n; i++) { ++ mieqEnqueue(ntoPointer, (events + i)->event); ++ } ++ NtoEQPoke(); ++ ++ return n; ++} ++ ++ ++/** ++ * Process keyboard input and enqueue them into the MIEQ ++ */ ++int ++NtoProcessKeyboardEvent(int type, int keycode) { ++ EventList *events = NULL; ++ int i, n; ++ ++ GetEventList(&events); ++ n = GetKeyboardEvents(events, ntoKeyboard, type, keycode); ++ for(i = 0; i < n; i++) { ++ mieqEnqueue(ntoKeyboard, (events + i)->event); ++ } ++ NtoEQPoke(); ++ ++ return n; ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoEvents.h ./hw/xphoton/ntoEvents.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoEvents.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/ntoEvents.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,9 @@ ++#ifndef XPHOTON_NTO_EVENTS_H ++#define XPHOTON_NTO_EVENTS_H ++ ++void NtoEQInit(void); ++void NtoEQPoke(void); ++int NtoProcessPointerEvent(int type, int buttons, int x, int y); ++int NtoProcessKeyboardEvent(int type, int keycode); ++ ++#endif /* XPHOTON_NTO_EVENTS_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoKeyboard.c ./hw/xphoton/ntoKeyboard.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoKeyboard.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/ntoKeyboard.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,263 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++//============================================================================= ++// ++// Keyboard support for the Darwin X Server ++// ++// By Torrey T. Lyons ++// ++// The code to parse the Darwin keymap is derived from dumpkeymap.c ++// by Eric Sunshine, which includes the following license: ++// ++//----------------------------------------------------------------------------- ++// ++// Copyright (C) 1999,2000 by Eric Sunshine ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are met: ++// ++// 1. Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// 2. Redistributions in binary form must reproduce the above copyright ++// notice, this list of conditions and the following disclaimer in the ++// documentation and/or other materials provided with the distribution. ++// 3. The name of the author may not be used to endorse or promote products ++// derived from this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN ++// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ++// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++// ++//============================================================================= ++ ++/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.5 2001/04/25 02:23:47 torrey Exp $ */ ++ ++/* ++=========================================================================== ++ ++ An X keyCode must be in the range XkbMinLegalKeyCode (8) to ++ XkbMaxLegalKeyCode(255). ++ ++ The keyCodes we get from the kernel range from 0 to 127, so we need to ++ offset the range before passing the keyCode to X. ++ ++ An X KeySym is an extended ascii code that is device independent. ++ ++ The modifier map is accessed by the keyCode, but the normal map is ++ accessed by keyCode - MIN_KEYCODE. Sigh. ++ ++=========================================================================== ++*/ ++ ++// Define this to get a diagnostic output to stderr which is helpful ++// in determining how the X server is interpreting the Darwin keymap. ++#undef DUMP_NTO_KEYMAP ++ ++#define NEED_DEFMAP ++#define NEED_XKB ++#include "xphoton.h" ++ ++#define GLYPHS_PER_KEY 4 ++#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better ++#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 ++#define NX_NUMMODIFIERS MAP_LENGTH ++ ++static CARD8 modMap[MAP_LENGTH]; ++static KeySym map[MAP_LENGTH * GLYPHS_PER_KEY]; ++static unsigned char modifierKeycodes[NX_NUMMODIFIERS][2]; ++ ++struct { ++ unsigned char scan; ++ unsigned char mask; ++} defaultMods[] = { ++ { 0x32, ShiftMask }, /* Shift_L */ ++ { 0x3E, ShiftMask }, /* Shift_R */ ++ { 0x42, LockMask }, /* Caps_Lock */ ++ { 0x25, ControlMask }, /* Control_L */ ++ { 0x6D, ControlMask }, /* Control_R */ ++ { 0x40, Mod1Mask }, /* Alt_L */ ++ { 0x71, Mod1Mask }, /* Alt_R */ ++ { 0x4D, Mod2Mask }, /* Num_Lock */ ++ { 0x4E, Mod5Mask }, /* Scroll_Lock */ ++}; ++int num_defaultMods = sizeof(defaultMods)/sizeof(defaultMods[0]); ++ ++ ++typedef struct ++{ ++ char* ntokeyboardfile; ++ char* xkbmodel; ++ char* xkblayout; ++ char* xkbvariant; ++ char* xkboptions; ++ char* layoutname; ++} NtoKBLayoutRec, *NtoKBLayoutPtr; ++ ++NtoKBLayoutRec ntoKBLayouts[] = { ++ { "de_DE_102.kbd", "pc102", "de", "nodeadkeys", NULL, "German (Germany)" }, ++ { NULL, NULL, NULL, NULL, NULL, NULL } ++}; ++ ++ ++static void ++NtoChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl ) { ++ // keyclick, bell volume / pitch, autorepead, LED's ++} ++ ++ ++/* ++ * NtoKeyboardInit ++ * Get the Nto keyboard map and compute an equivalent ++ * X keyboard map and modifier map. Set the new keyboard ++ * device structure. ++ */ ++void ++NtoKeyboardInit(DeviceIntPtr pDev) ++{ ++ FILE *f; ++ int fallback = 0; ++ int found = 0; ++ char ntoLayout[32]; ++ char line[1024]; ++ const char* trapfile = "/etc/system/trap/.KEYBOARD"; ++ KeySymsRec keySyms; ++ int i; ++ ++ memset( modMap, NoSymbol, sizeof( modMap ) ); ++ memset( map, 0, sizeof( map ) ); ++ ++ for (i=0;ixkblayout != NULL; pLayout++) { ++ fprintf(stderr, "%s <-> %s\n", pLayout->ntokeyboardfile, ntoLayout); ++ // Skip unmatched records ++ if(strcmp(pLayout->ntokeyboardfile, ntoLayout)) continue; ++ ++ // Found. ++ memset(&names, 0, sizeof(XkbComponentNamesRec)); ++ ++ XkbSetRulesDflts( ++ "xorg", ++ pLayout->xkbmodel, ++ pLayout->xkblayout, ++ pLayout->xkbvariant, ++ pLayout->xkboptions ++ ); ++ ++ XkbInitKeyboardDeviceStruct( ++ pDev, ++ &names, ++ &keySyms, ++ modMap, ++ (BellProcPtr)PhotonBell, ++ NtoChangeKeyboardControl ++ ); ++ ++ fprintf(stderr, "Keyboard initialized\n"); ++ ++ goto cont; ++ } ++ ++ fallback = 1; ++ } ++ ++cont: ++ // Call fallback variant if needed ++ if(fallback) { ++ fprintf(stderr, "Keyboard fallback\n"); ++ ++ assert( ++ InitKeyboardDeviceStruct( ++ (DevicePtr)pDev, ++ &keySyms, ++ modMap, ++ (BellProcPtr)PhotonBell, ++ NtoChangeKeyboardControl ++ ) ++ ); ++ } ++} ++ ++ ++/* ++ * NtoModifierKeycode ++ * Return the keycode + MIN_KEYCODE for an NX_MODIFIERKEY_* modifier. ++ * side = 0 for left or 1 for right. ++ */ ++int NtoModifierKeycode(int modifier, int side) ++{ ++ return modifierKeycodes[modifier][side]; ++} ++ ++ ++/* ++ * LegalModifier ++ * This allows the driver level to prevent some keys from being remapped ++ * as modifier keys. ++ * I have no idea why this is useful. ++ */ ++Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) ++{ ++ return 1; ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoXinput.c ./hw/xphoton/ntoXinput.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/ntoXinput.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/ntoXinput.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,246 @@ ++/* ++ * X server support of the XINPUT extension for xquartz ++ * ++ * This is currently a copy of Xi/stubs.c, but eventually this ++ * should include more complete XINPUT support. ++ */ ++ ++/************************************************************ ++ ++Copyright 1989, 1998 The Open Group ++ ++Permission to use, copy, modify, distribute, and sell this software and its ++documentation for any purpose is hereby granted without fee, provided that ++the above copyright notice appear in all copies and that both that ++copyright notice and this permission notice appear in supporting ++documentation. ++ ++The above copyright notice and this permission notice shall be included in ++all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ++AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ ++Except as contained in this notice, the name of The Open Group shall not be ++used in advertising or otherwise to promote the sale, use or other dealings ++in this Software without prior written authorization from The Open Group. ++ ++Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. ++ ++ All Rights Reserved ++ ++Permission to use, copy, modify, and distribute this software and its ++documentation for any purpose and without fee is hereby granted, ++provided that the above copyright notice appear in all copies and that ++both that copyright notice and this permission notice appear in ++supporting documentation, and that the name of Hewlett-Packard not be ++used in advertising or publicity pertaining to distribution of the ++software without specific, written prior permission. ++ ++HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ++ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ++HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ++ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ++WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ++ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++SOFTWARE. ++ ++********************************************************/ ++ ++#define NEED_EVENTS ++#ifdef HAVE_DIX_CONFIG_H ++#include ++#endif ++ ++#define NEED_XINPUT ++#include "xphoton.h" ++ ++/*********************************************************************** ++ * ++ * Caller: ProcXCloseDevice ++ * ++ * Take care of implementation-dependent details of closing a device. ++ * Some implementations may actually close the device, others may just ++ * remove this clients interest in that device. ++ * ++ * The default implementation is to do nothing (assume all input devices ++ * are initialized during X server initialization and kept open). ++ * ++ */ ++ ++void ++CloseInputDevice(DeviceIntPtr d, ClientPtr client) ++{ ++// DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client); ++} ++ ++/*********************************************************************** ++ * ++ * Caller: ProcXListInputDevices ++ * ++ * This is the implementation-dependent routine to initialize an input ++ * device to the point that information about it can be listed. ++ * Some implementations open all input devices when the server is first ++ * initialized, and never close them. Other implementations open only ++ * the X pointer and keyboard devices during server initialization, ++ * and only open other input devices when some client makes an ++ * XOpenDevice request. If some other process has the device open, the ++ * server may not be able to get information about the device to list it. ++ * ++ * This procedure should be used by implementations that do not initialize ++ * all input devices at server startup. It should do device-dependent ++ * initialization for any devices not previously initialized, and call ++ * AddInputDevice for each of those devices so that a DeviceIntRec will be ++ * created for them. ++ * ++ * The default implementation is to do nothing (assume all input devices ++ * are initialized during X server initialization and kept open). ++ * The commented-out sample code shows what you might do if you don't want ++ * the default. ++ * ++ */ ++ ++void ++AddOtherInputDevices(void) ++{ ++ /********************************************************************** ++ for each uninitialized device, do something like: ++ ++ DeviceIntPtr dev; ++ DeviceProc deviceProc; ++ pointer private; ++ ++ dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE); ++ dev->public.devicePrivate = private; ++ RegisterOtherDevice(dev); ++ dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); ++ ************************************************************************/ ++// DEBUG_LOG("AddOtherInputDevices\n"); ++} ++ ++/*********************************************************************** ++ * ++ * Caller: ProcXOpenDevice ++ * ++ * This is the implementation-dependent routine to open an input device. ++ * Some implementations open all input devices when the server is first ++ * initialized, and never close them. Other implementations open only ++ * the X pointer and keyboard devices during server initialization, ++ * and only open other input devices when some client makes an ++ * XOpenDevice request. This entry point is for the latter type of ++ * implementation. ++ * ++ * If the physical device is not already open, do it here. In this case, ++ * you need to keep track of the fact that one or more clients has the ++ * device open, and physically close it when the last client that has ++ * it open does an XCloseDevice. ++ * ++ * The default implementation is to do nothing (assume all input devices ++ * are opened during X server initialization and kept open). ++ * ++ */ ++ ++void ++OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status) ++{ ++// DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status); ++} ++ ++/**************************************************************************** ++ * ++ * Caller: ProcXSetDeviceMode ++ * ++ * Change the mode of an extension device. ++ * This function is used to change the mode of a device from reporting ++ * relative motion to reporting absolute positional information, and ++ * vice versa. ++ * The default implementation below is that no such devices are supported. ++ * ++ */ ++ ++int ++SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) ++{ ++// DEBUG_LOG("SetDeviceMode(%p, %p, %d)\n", client, dev, mode); ++ return BadMatch; ++} ++ ++/**************************************************************************** ++ * ++ * Caller: ProcXSetDeviceValuators ++ * ++ * Set the value of valuators on an extension input device. ++ * This function is used to set the initial value of valuators on ++ * those input devices that are capable of reporting either relative ++ * motion or an absolute position, and allow an initial position to be set. ++ * The default implementation below is that no such devices are supported. ++ * ++ */ ++ ++int ++SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, ++ int *valuators, int first_valuator, int num_valuators) ++{ ++// DEBUG_LOG("SetDeviceValuators(%p, %p, %p, %d, %d)\n", client, ++// dev, valuators, first_valuator, num_valuators); ++ return BadMatch; ++} ++ ++/**************************************************************************** ++ * ++ * Caller: ProcXChangeDeviceControl ++ * ++ * Change the specified device controls on an extension input device. ++ * ++ */ ++ ++int ++ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, ++ xDeviceCtl * control) ++{ ++ ++// DEBUG_LOG("ChangeDeviceControl(%p, %p, %p)\n", client, dev, control); ++ switch (control->control) { ++ case DEVICE_RESOLUTION: ++ return (BadMatch); ++ case DEVICE_ABS_CALIB: ++ case DEVICE_ABS_AREA: ++ return (BadMatch); ++ case DEVICE_CORE: ++ return (BadMatch); ++ default: ++ return (BadMatch); ++ } ++} ++ ++ ++/**************************************************************************** ++ * ++ * Caller: configAddDevice (and others) ++ * ++ * Add a new device with the specified options. ++ * ++ */ ++int ++NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) ++{ ++// DEBUG_LOG("NewInputDeviceRequest(%p, %p)\n", options, pdev); ++ return BadValue; ++} ++ ++/**************************************************************************** ++ * ++ * Caller: configRemoveDevice (and others) ++ * ++ * Remove the specified device previously added. ++ * ++ */ ++void ++DeleteInputDeviceRequest(DeviceIntPtr dev) ++{ ++// DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev); ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photon.c ./hw/xphoton/photon.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photon.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photon.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,175 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/************************************************************** ++ * ++ * Quartz-specific support for the Darwin X Server ++ * ++ * By Gregory Robert Parker ++ * ++ **************************************************************/ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.14 2001/08/12 00:10:01 torrey Exp $ */ ++ ++#include "xphoton.h" ++ ++#define kNtoMaxScreens 100 ++ ++static ScreenPtr ntoScreens[kNtoMaxScreens]; ++static int ntoNumScreens = 0; ++static BOOL xhidden = FALSE; ++PtWidget_t *photonRootWindow; ++ ++/* ++ * PhotonStoreColors ++ * FIXME: need to implement if XPhoton supports PsuedoColor ++static void PhotonStoreColors( ++ ColormapPtr pmap, ++ int numEntries, ++ xColorItem *pdefs) ++{ ++} ++ */ ++ ++ ++Bool ++PhotonAddScreen(ScreenPtr pScreen) ++{ ++ if (ntoNumScreens == kNtoMaxScreens) { ++ return FALSE; ++ } ++ ntoScreens[ntoNumScreens++] = pScreen; ++ ++ // Setup cursor support ++ if (!PhotonInitCursor(pScreen)) { ++ return FALSE; ++ } ++ ++ // Setup rootless screen ++ if (!PhotonRootlessAddScreen(pScreen)) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++ ++/** ++ * PhotonCapture ++ * Capture the screen so we can draw. ++ */ ++void ++PhotonCapture(void) ++{ ++} ++ ++ ++/** ++ * PhotonRelease ++ * Release the screen so others can draw. ++ */ ++static void ++PhotonRelease(void) ++{ ++ /* PhotonMessageMainThread(kPhotonServerHidden); */ ++} ++ ++ ++/** ++ * PhotonOsVendorInit ++ * Photon display initialization. ++ */ ++void ++PhotonOsVendorInit(void) ++{ ++ ErrorF("Display mode: Rootless Photon\n"); ++ ++ PhotonAudioInit(); ++ PhotonGlueDisplayInit(); ++} ++ ++ ++/** ++ * PhotonShow ++ * Show the X server on screen. Does nothing if already ++ * shown. Restore the X clip regions the X server cursor state. ++ */ ++void ++PhotonShow( ++ int x, //cursor location ++ int y) ++{ ++ int i; ++ ++ if (xhidden) { ++ for (i = 0; i < ntoNumScreens; i++) { ++ if (ntoScreens[i]) { ++ PhotonResumeXCursor(ntoScreens[i], x, y); ++ } ++ } ++ } ++ ++ xhidden = FALSE; ++} ++ ++ ++/** ++ * PhotonHide ++ * Remove the X server display from the screen. Does ++ * nothing if already hidden. Release the screen, set X clip regions ++ * to prevent drawing, and restore the Photon cursor. ++ */ ++void ++PhotonHide(void) ++{ ++ int i; ++ ++ if (!xhidden) { ++ for (i = 0; i < ntoNumScreens; i++) { ++ if (ntoScreens[i]) { ++ PhotonSuspendXCursor(ntoScreens[i]); ++ } ++ } ++ } ++ ++ PhotonRelease(); ++ xhidden = TRUE; ++} ++ ++ ++/** ++ * PhotonGiveUp ++ * Cleanup before X server shutdown ++ * Release the screen and restore the Photon cursor. ++ */ ++void ++PhotonGiveUp(void) ++{ ++ int i; ++ ++ for (i = 0; i < ntoNumScreens; i++) { ++ if (ntoScreens[i]) { ++ PhotonSuspendXCursor(ntoScreens[i]); ++ } ++ } ++ ++ PhotonRelease(); ++} ++ ++ ++/** ++ * PhotonExit ++ * Signal handler, if XPhoton receives SIGHUP from Photon manager ++ */ ++int ++PhotonExit(int sig) ++{ ++ ErrorF("Exit from signal %d\n",sig); ++ exit(1); ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photon.h ./hw/xphoton/photon.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photon.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photon.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,38 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* ++ photon.h ++ ++ Photon-specific functions and definitions ++*/ ++/* ++ quartz.h ++ ++ Quartz-specific functions and definitions ++*/ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.h,v 1.5 2001/08/01 05:34:06 torrey Exp $ */ ++ ++ ++#ifndef _PHOTON_H ++#define _PHOTON_H ++ ++#include "X11/Xproto.h" ++#include "screenint.h" ++ ++void PhotonOsVendorInit(void); ++Bool PhotonAddScreen(ScreenPtr screen); ++void PhotonGiveUp(void); ++void PhotonHide(void); ++void PhotonShow(int x, int y); ++int PhotonExit(int sig); ++ ++#endif +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonAudio.c ./hw/xphoton/photonAudio.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonAudio.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photonAudio.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,41 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++ ++ ++#include "xphoton.h" ++ ++ ++/* ++ * PhotonBell ++ * Ring the bell ++ */ ++void PhotonBell( ++ int volume, ++ DeviceIntPtr pDevice, ++ pointer ctrl, ++ int class ++) { ++ // We use the standard system beep here ++ write(1, "\7", 1); ++ ++ return; ++} ++ ++ ++/* ++ * PhotonAudioInit ++ * Prepare to play the bell with the CoreAudio API ++ */ ++void PhotonAudioInit(void) ++{ ++ return; ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonAudio.h ./hw/xphoton/photonAudio.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonAudio.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photonAudio.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,21 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++ ++#ifndef PHOTON_AUDIO_H ++#define PHOTON_AUDIO_H ++ ++#include "input.h" ++ ++void PhotonAudioInit(void); ++void PhotonBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class); ++ ++#endif /* PHOTON_AUDIO_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonCursor.c ./hw/xphoton/photonCursor.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonCursor.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photonCursor.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,153 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/************************************************************** ++ * ++ * Support for using the Photon cursor ++ * ++ **************************************************************/ ++ ++/************************************************************** ++ * ++ * Support for using the Quartz Window Manager cursor ++ * ++ **************************************************************/ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.5 2001/08/07 01:52:24 torrey Exp $ */ ++ ++#include "xphoton.h" ++ ++ ++static Bool ++PhotonCursorOffScreen(ScreenPtr *p, int *x, int *y) ++{ ++ XPH_ENTRY; ++ return FALSE; ++} ++ ++ ++static void ++PhotonCrossScreen(ScreenPtr p, int e) ++{ ++ XPH_ENTRY; ++ return; ++} ++ ++ ++static void ++PhotonWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) ++{ ++ // something missing??? ++ miPointerWarpCursor(pDev, pScreen, x, y); ++ miPointerUpdateSprite(pDev); ++} ++ ++ ++static Bool ++PhotonRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) ++{ ++ XPH_ENTRY; ++ return TRUE; ++} ++ ++ ++static Bool ++PhotonUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) ++{ ++ XPH_ENTRY; ++ return TRUE; ++} ++ ++ ++static void ++PhotonSetCursor(DeviceIntPtr pDev, ScreenPtr p, CursorPtr c, int x, int y) ++{ ++ XPH_ENTRY; ++ return; ++} ++ ++ ++static void ++PhotonMoveCursor(DeviceIntPtr pDev, ScreenPtr p, int x, int y) ++{ ++ XPH_ENTRY; ++ return; ++} ++ ++ ++static Bool ++PhotonDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr) ++{ ++ XPH_ENTRY; ++ return TRUE; ++} ++ ++ ++static void ++PhotonDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) ++{ ++ XPH_ENTRY; ++} ++ ++ ++static miPointerScreenFuncRec photonScreenFuncsRec = { ++ PhotonCursorOffScreen, ++ PhotonCrossScreen, ++ PhotonWarpCursor, ++ NULL, ++ NULL, ++}; ++ ++/* ++ * PhotonInitCursor ++ * Initialize cursor support ++ */ ++Bool ++PhotonInitCursor(ScreenPtr pScreen ) ++{ ++ miPointerScreenPtr PointPriv; ++ ++ // initialize software cursor handling (always needed as backup) ++ if (!miDCInitialize(pScreen, &photonScreenFuncsRec)) { ++ return FALSE; ++ } ++ ++ // Look into miPointer.c for more information about how these callbacks are called. ++ PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); ++ PointPriv->spriteFuncs->RealizeCursor = PhotonRealizeCursor; ++ PointPriv->spriteFuncs->UnrealizeCursor = PhotonUnrealizeCursor; ++ PointPriv->spriteFuncs->SetCursor = PhotonSetCursor; ++ PointPriv->spriteFuncs->MoveCursor = PhotonMoveCursor; ++ ++ return TRUE; ++} ++ ++ ++void ++PhotonSuspendXCursor(ScreenPtr pScreen) ++{ ++} ++ ++ ++// Taken from XQuartz ++void ++PhotonResumeXCursor(ScreenPtr pScreen, int x, int y) ++{ ++ WindowPtr pWin; ++ CursorPtr pCursor; ++ ++ pWin = GetSpriteWindow(ntoPointer); ++ if(pWin->drawable.pScreen != pScreen) return; ++ ++ pCursor = GetSpriteCursor(ntoPointer); ++ if(!pCursor) return; ++ ++ PhotonSetCursor(ntoPointer, pScreen, pCursor, x, y); ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonCursor.h ./hw/xphoton/photonCursor.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/photonCursor.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/photonCursor.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,25 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* ++ * photonCursor.h ++ * ++ * Photon hardware cursor ++ */ ++ ++#ifndef XPHOTON_PHOTONCURSOR_H ++#define XPHOTON_PHOTONCURSOR_H ++ ++Bool PhotonInitCursor(ScreenPtr pScreen); ++void PhotonSuspendXCursor(ScreenPtr pScreen); ++void PhotonResumeXCursor(ScreenPtr pScreen, int x, int y); ++ ++#endif /* XPHOTON_PHOTONCURSOR_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhoton.h ./hw/xphoton/rootlessPhoton.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhoton.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/rootlessPhoton.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,25 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* ++ * Rootless setup for Aqua ++ * ++ * Greg Parker gparker@cs.stanford.edu ++ */ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAqua.h,v 1.2 2001/08/01 05:34:06 torrey Exp $ */ ++ ++#ifndef XPHOTON_ROOTLESSPHOTON_H ++#define XPHOTON_ROOTLESSPHOTON_H ++ ++Bool PhotonRootlessAddScreen(ScreenPtr pScreen); ++void PhotonGlueDisplayInit(void); ++ ++#endif /* XPHOTON_ROOTLESSPHOTON_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonGlue.c ./hw/xphoton/rootlessPhotonGlue.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonGlue.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/rootlessPhotonGlue.c 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,230 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* ++ * Generic rootless to Photon specific glue code ++ * ++ * This code acts as a glue between the generic rootless X server code ++ * and the Photon specific implementation, which includes definitions that ++ * conflict with stardard X types. ++ * ++ * Greg Parker gparker@cs.stanford.edu ++ */ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAquaGlue.c,v 1.3 2001/08/01 05:34:06 torrey Exp $ */ ++ ++#include "xphoton.h" ++ ++typedef struct wid2frame_t { ++ RootlessFrameID wid; ++ RootlessWindowPtr frame; ++} wid2frame; ++ ++wid2frame* w2ftable = NULL; ++ ++static Bool ++PhotonGlueCreateFrame( ++ RootlessWindowPtr pFrame, ++ ScreenPtr pScreen, ++ int newX, ++ int newY, ++ RegionPtr pShape ++) { ++ int depth, bpp; ++ wid2frame* p = w2ftable; ++ // fixme won't work for multi-screen ++ // fixme hardcoded monitor stuff ++ ++ // Create new window and write Photon Widget ID in wid of RootlessWindowPtr ++ pFrame->wid = PhotonNewWindow( ++ NULL, ++ newX, ++ newY, ++ pFrame->width, ++ pFrame->height, ++ 0, ++ pFrame->win ++ ); ++ ++ // Allocate a table ++ if(!w2ftable) { ++ // Table doesn't exist, allocate space for it ++ p = w2ftable = (wid2frame*)malloc(2 * sizeof(wid2frame)); ++ } else { ++ int s = 1; ++ ++ // Table exists, go to the end and resize the Table ++ while(p->wid != NULL) p++, s++; ++ fprintf(stderr, "Table size: %d\n", s); ++ w2ftable = (wid2frame*)realloc(w2ftable, (s+1) * sizeof(wid2frame)); ++ p--; ++ } ++ ++ // Insert data ++ p[0].wid = pFrame->wid; ++ p[0].frame = pFrame; ++ p[1].wid = NULL; ++ p[1].frame = NULL; ++ ++ // Get new Pixmap ++ PhotonGetPixmap( ++ pFrame->wid, ++ &pFrame->pixelData, ++ &pFrame->bytesPerRow, ++ &depth, ++ &bpp ++ ); ++ ++ return TRUE; ++} ++ ++ ++static void ++PhotonGlueDestroyFrame(RootlessFrameID wid) ++{ ++ PhotonDestroyWindow(wid); ++} ++ ++static void ++PhotonGlueMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) ++{ ++ PhotonMoveWindow(wid, newX, newY); ++} ++ ++ ++static void ++PhotonGlueResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, ++ int newX, int newY, ++ unsigned int newW, unsigned int newH, unsigned int gravity) ++{ ++ int depth, bpp; ++ wid2frame* p = w2ftable; ++ ++ PhotonStartResizeWindow(wid, newX, newY, newW, newH); ++ PhotonFinishResizeWindow(wid, newX, newY, newW, newH); ++ ++ // Search frame in Table ++ while(p->wid != NULL) { ++ fprintf(stderr, "- %p %p\n", p->wid, p->frame); ++ if(p->wid == wid) { ++ fprintf(stderr, "- found %08X\n", (unsigned int)wid); ++ PhotonGetPixmap( ++ wid, ++ &p->frame->pixelData, ++ &p->frame->bytesPerRow, ++ &depth, ++ &bpp ++ ); ++ ++ break; ++ } ++ ++ p++; ++ } ++} ++ ++ ++static void ++PhotonGlueRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) ++{ ++ PhotonRestackWindow(wid, nextWid ? nextWid : NULL); ++} ++ ++static void ++PhotonGlueReshapeFrame(RootlessFrameID wid, RegionPtr pShape) ++{ ++ PhotonReshapeWindow(wid, (fakeBoxRec *) REGION_RECTS(pShape), REGION_NUM_RECTS(pShape)); ++} ++ ++static void ++PhotonGlueUnmapFrame(RootlessFrameID wid) ++{ ++ PhotonUnmapWindow(wid); ++} ++ ++static void ++PhotonGlueStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) ++{ ++} ++ ++static void ++PhotonGlueStopDrawing(RootlessFrameID wid, Bool flush) ++{ ++} ++ ++static void ++PhotonGlueUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) ++{ ++ PhotonFlush(wid); ++} ++ ++static void ++PhotonGlueDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, int shift_x, int shift_y) ++{ ++ PhotonUpdateRects(wid, (fakeBoxRec*)rects, nrects); ++} ++ ++static RootlessFrameProcsRec photonRootlessProcs = { ++ PhotonGlueCreateFrame, ++ PhotonGlueDestroyFrame, ++ PhotonGlueMoveFrame, ++ PhotonGlueResizeFrame, ++ PhotonGlueRestackFrame, ++ PhotonGlueReshapeFrame, ++ PhotonGlueUnmapFrame, ++ PhotonGlueStartDrawing, ++ PhotonGlueStopDrawing, ++ PhotonGlueUpdateRegion, ++ PhotonGlueDamageRects, ++ ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++}; ++ ++ ++/////////////////////////////////////// ++// Rootless mode initialization. ++// Exported by rootlessPhoton.h ++ ++/* ++ * PhotonGlueDisplayInit ++ * Init the framebuffer and record pixmap parameters for the screen. ++ */ ++void ++PhotonGlueDisplayInit(void) ++{ ++ dfb.pixelInfo.pixelType = 0; ++ PhotonDisplayInit( ++ &dfb.width, ++ &dfb.height, ++ &dfb.pitch, ++ (unsigned long *)&dfb.pixelInfo.bitsPerComponent, ++ (unsigned long *)&dfb.pixelInfo.componentCount, &dfb.bitsPerPixel ++ ); ++ dfb.colorBitsPerPixel = dfb.pixelInfo.bitsPerComponent * dfb.pixelInfo.componentCount; ++ ++ // No frame buffer - it's all in window pixmaps. ++ dfb.framebuffer = NULL; // malloc(dfb.pitch * dfb.height); ++} ++ ++ ++Bool ++PhotonRootlessAddScreen(ScreenPtr pScreen) ++{ ++ if (!RootlessInit(pScreen, &photonRootlessProcs)) { ++ return FALSE; ++ } ++ ++ return TRUE; ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonImp.c ./hw/xphoton/rootlessPhotonImp.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonImp.c 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/rootlessPhotonImp.c 2010-03-29 16:27:12.000000000 +0200 +@@ -0,0 +1,730 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++ ++#define NEED_X11 ++#define NEED_XKB ++#include "xphoton.h" ++ ++extern CARD32 ntoGetTimeInMillis(); ++extern int ntoEventWriteFD; ++ ++typedef struct { ++ PtWidget_t *wdw; ++ char *bits; ++ int x, y; ++ int w, h; ++ int bitsPerPixel; ++ int isRoot; ++ PdOffscreenContext_t *os; ++ WindowPtr xwin; ++} PhotonWindowRec; ++ ++static WindowPtr lastinput = NULL; /* positioning overrideRedirects */ ++static int from_x_resize = 0; /* avoid recursive resizing */ ++#define PHWINREC(rw) ((PhotonWindowRec *)rw) ++ ++/* rootlessPhotonImp.m */ ++void ++PhotonDisplayInit(int *width, int *height, int *rowBytes, unsigned long *bps, unsigned long *spp, int *bpp) ++{ ++ PhRect_t extent; ++ ++ PtInit(NULL); ++ RL_DEBUG_MSG("PtInit\n"); ++ if (PhWindowQueryVisible(Ph_QUERY_CONSOLE,0L,PhInputGroup(NULL),&extent) == 0) { ++ *width = extent.lr.x-extent.ul.x+1; ++ *height = extent.lr.y-extent.ul.y+1; ++ *rowBytes = *width * 4; ++ } else { ++ *width = 1600; ++ *height = 1280; ++ *rowBytes = *width * 4; ++ } ++ *bps = 8; ++ *spp = 3; ++ *bpp = 32; ++ return; ++} ++ ++ ++#define _MOUSE_LEFT Ph_BUTTON_SELECT ++#define _MOUSE_RIGHT Ph_BUTTON_MENU ++#define _MOUSE_MIDDLE Ph_BUTTON_ADJUST ++void ++pgmev(int x, int y, unsigned buttons) ++{ ++ static unsigned button_state = 0; ++ xEvent xev; ++ extern DeviceIntPtr ntoPointer; ++ int n, i, valuators[2]; ++ ++ //fprintf(stderr, "pgmev: %d,%d %d\n", x, y, buttons); ++ ++ ++ /* ++ * dix expects a motion event before press/release if x,y have changed ++ */ ++ if (button_state == buttons) { ++ NtoProcessPointerEvent(MotionNotify, 0, x, y); ++ } ++ if (button_state != buttons) { ++ if (buttons & _MOUSE_LEFT) { ++ if (!(button_state & _MOUSE_LEFT)) { ++ NtoProcessPointerEvent(ButtonPress, Button1, x, y); ++ } ++ } else { ++ if (button_state & _MOUSE_LEFT) { ++ NtoProcessPointerEvent(ButtonRelease, Button1, x, y); ++ } ++ } ++ if (buttons & _MOUSE_MIDDLE) { ++ if (!(button_state & _MOUSE_MIDDLE)) { ++ NtoProcessPointerEvent(ButtonPress, Button2, x, y); ++ } ++ } else { ++ if (button_state & _MOUSE_MIDDLE) { ++ NtoProcessPointerEvent(ButtonRelease, Button2, x, y); ++ } ++ } ++ if (buttons & _MOUSE_RIGHT) { ++ if (!(button_state & _MOUSE_RIGHT)) { ++ NtoProcessPointerEvent(ButtonPress, Button3, x, y); ++ } ++ } else { ++ if (button_state & _MOUSE_RIGHT) { ++ NtoProcessPointerEvent(ButtonRelease, Button3, x, y); ++ } ++ } ++ } ++ button_state = buttons; ++} ++ ++void ++pgkev(unsigned long flags, unsigned long cap, unsigned long scan, unsigned long mods) ++{ ++ extern DeviceIntPtr ntoKeyboard; ++ KeyClassPtr keyc = ntoKeyboard->key; ++ unsigned char xmods, phmods, diffmods, i, mask; ++ ++ fprintf(stderr, "flags: %08X / cap: %08X / scan: %08X / mods: %08X\n", flags, cap, scan, mods); ++ ++ fprintf(stderr, "- cap valid : %d\n", flags & Pk_KF_Cap_Valid); ++ fprintf(stderr, "- scan valid : %d\n", flags & Pk_KF_Scan_Valid); ++ fprintf(stderr, "- sym valid : %d\n", flags & Pk_KF_Sym_Valid); ++ fprintf(stderr, "- compose : %d\n", flags & Pk_KF_Compose); ++ fprintf(stderr, "- key down : %d\n", flags & Pk_KF_Key_Down); ++ fprintf(stderr, "- key repeat : %d\n", flags & Pk_KF_Key_Repeat); ++ ++ /* ++ * X defaults can be xmodmap'd away ++ * Shift = Shift_L Shift_R ++ * Lock = Caps_Lock ++ * Control = Control_L Control_R ++ * Mod1 = Alt_L Alt_R ++ * Mod2 = Num_Lock ++ * Mod5 = Scroll_Lock ++ */ ++ ++ xmods = keyc->state; ++ /* FIXME this only handles 6 of the ~23 Photon key mods */ ++ /* (only matters when it happens outside an X window) */ ++ phmods = ++ (mods & Pk_KM_Shift) ? ShiftMask : 0 | ++ (mods & Pk_KM_Caps_Lock) ? LockMask : 0 | ++ (mods & Pk_KM_Ctrl) ? ControlMask : 0 | ++ (mods & Pk_KM_Alt) ? Mod1Mask : 0 | ++ (mods & Pk_KM_Num_Lock) ? Mod2Mask : 0 | ++ (mods & Pk_KM_Scroll_Lock) ? Mod5Mask : 0; ++ diffmods = (xmods ^ phmods); ++ ++ /* if mods != x mods, set x mods directly */ ++ /* FIXME Japanese keyboard Caps_lock is not a modifier... */ ++ for (i = 0, mask = 1; diffmods; i++, mask <<= 1) { ++ if (mask & diffmods) { ++ if (mask & phmods) { /* turn on for X */ ++ keyc->modifierKeyCount[i]++; ++ keyc->state |= mask; ++ } else {/* turn off for X */ ++ keyc->state &= ~mask; ++ keyc->modifierKeyCount[i] = 0; ++ } ++ diffmods &= ~mask; ++ } ++ } ++ /* if cap valid, send event */ ++ if (flags & Pk_KF_Scan_Valid) { ++ int found, j, type; ++ ++ if (flags & Pk_KF_Key_Down) { ++ type = KeyPress; ++ } else { ++ type = KeyRelease; ++ } ++ ++ NtoProcessKeyboardEvent(type, (scan & 0x7F) + MIN_KEYCODE); ++ } ++} ++ ++void ++BringToTop(WindowPtr p) ++{ ++ Mask mask = CWStackMode; ++ XID vlist[2]; ++ ++ mieqProcessInputEvents(); ++ vlist[0] = Above; ++ ConfigureWindow(p,mask,vlist,wClient(p)); ++ return; ++} ++ ++int ++raw_callbackfn(PtWidget_t * w, void *d, PtCallbackInfo_t * info) ++{ ++ WindowPtr p = (WindowPtr) d; ++ ++ switch (info->event->type) { ++ case Ph_EV_EXPOSE: ++ { ++ int i; ++ PhRect_t *r = PhGetRects(info->event); ++ ++ //fprintf(stderr, "raw_callbackfn: expose\n"); ++ ++ for (i = 0; i < info->event->num_rects; i++, r++) { ++ RootlessDamageRect( ++ p, ++ r->ul.x - 1, ++ r->ul.y - 1, ++ r->lr.x - r->ul.x + 2, ++ r->lr.y - r->ul.y + 2 ++ ); ++ } ++ } ++ break; ++ case Ph_EV_BUT_PRESS: ++ case Ph_EV_BUT_RELEASE: ++ case Ph_EV_PTR_MOTION_BUTTON: ++ case Ph_EV_PTR_MOTION_NOBUTTON: ++ { ++ PhRect_t *rect = PhGetRects(info->event); ++ PhPointerEvent_t *mouevent = PhGetData(info->event); ++ ++ //fprintf(stderr, "raw_callbackfn: mouse\n"); ++ ++ /* bring to top */ ++ if (!((WindowPtr) d)->overrideRedirect) { ++ lastinput = (WindowPtr) d; ++ } ++ BringToTop((WindowPtr)d); ++ pgmev(rect->ul.x + p->drawable.x, rect->ul.y + p->drawable.y, mouevent->button_state); ++ } ++ break; ++ case Ph_EV_KEY: ++ { ++ PhKeyEvent_t *keyevent = PhGetData(info->event); ++ ++ //fprintf(stderr, "raw_callbackfn: key\n"); ++ ++ /* bring to top */ ++ if (!((WindowPtr) d)->overrideRedirect) { ++ lastinput = (WindowPtr) d; ++ } ++ BringToTop((WindowPtr)d); ++ pgkev(keyevent->key_flags, keyevent->key_cap, keyevent->key_scan, keyevent->key_mods); ++ } ++ break; ++ default: ++ break; ++ } ++ return Pt_CONTINUE; ++} ++ ++static void ++UpdatePhotonTitle(WindowPtr pWin, PtWidget_t *wdw) ++{ ++ PropertyPtr pProp; ++ ++ if (!pWin->optional) ++ return; ++ pProp = pWin->optional->userProps; ++ while (pProp) { ++ if ((pProp->propertyName == XA_WM_NAME) && (pProp->type == XA_STRING)) { ++ int len = (pProp->size*pProp->format/8); ++ char *p; ++ ++ p = malloc(len + 1); ++ if (!p) break; ++ memset(p,0,len + 1); ++ strncpy(p,pProp->data,len); ++ PtSetResource(wdw,Pt_ARG_WINDOW_TITLE,p,1); ++ free(p); ++ break; ++ } ++ pProp = pProp->next; ++ } ++} ++ ++int ++got_focusfn(PtWidget_t * w, void *d, PtCallbackInfo_t * info) ++{ ++ fprintf(stderr, "got_focusfn\n"); ++ ++ lastinput = (WindowPtr) d; ++ UpdatePhotonTitle((WindowPtr)d,w); ++ BringToTop((WindowPtr)d); ++ return Pt_CONTINUE; ++} ++ ++int ++lost_focusfn(PtWidget_t * w, void *d, PtCallbackInfo_t * info) ++{ ++ fprintf(stderr, "lost_focusfn\n"); ++ ++ if (lastinput == (WindowPtr) d) { ++ lastinput = (WindowPtr) NULL; ++ } ++ return Pt_CONTINUE; ++} ++ ++int ++window_closingfn(PtWidget_t * w, void *d, PtCallbackInfo_t * info) ++{ ++ WindowPtr p = (WindowPtr)d; ++ unsigned long prot,dele; ++ PhWindowEvent_t *we = info->cbdata; ++ extern DeviceIntPtr ntoPointer; ++ ++ if (we->event_f == Ph_WM_CLOSE) { ++ RL_DEBUG_MSG("WM closing wdw = %p\n",w); ++ prot = MakeAtom("WM_PROTOCOLS",12,1); ++ dele = MakeAtom("WM_DELETE_WINDOW",16,1); ++ if (prot && prot != BAD_RESOURCE && dele && dele != BAD_RESOURCE) { ++ xEvent clev; ++ ++ memset(&clev,0,sizeof(clev)); ++ clev.u.u.type = ClientMessage /*| 0x80*/; // events.c ??? ++ clev.u.u.detail = 32; ++ clev.u.clientMessage.window = p->drawable.id; ++ clev.u.clientMessage.u.l.type = prot; ++ clev.u.clientMessage.u.l.longs0 = dele; ++ (void)DeliverEventsToWindow(ntoPointer, p, &clev, 1, 0, NullGrab, 0); ++ } else { ++ CloseDownClient(wClient(p)); ++ } ++ } ++ //PtDestroyWidget(w); ++ return Pt_CONTINUE; ++} ++ ++int ++resizefn(PtWidget_t * w, void *d, PtCallbackInfo_t * info) ++{ ++ PtContainerCallback_t *pcb = (PtContainerCallback_t *)info->cbdata; ++ WindowPtr p = (WindowPtr)d; ++ WindowPtr tmp = lastinput; ++ Mask mask; ++ XID vlist[4]; ++ ++ RL_DEBUG_MSG("WM resize to %dx%d from x %d\n",pcb->new_dim.w,pcb->new_dim.h,from_x_resize); ++ if (!from_x_resize) { ++#if 1 ++ if (pcb->new_dim.w == pcb->old_dim.w && ++ pcb->new_dim.h == pcb->old_dim.h) ++ return Pt_CONTINUE; ++ if ((pcb->new_dim.w == (p->drawable.width + (p->borderWidth * 2))) && ++ (pcb->new_dim.h == (p->drawable.height + (p->borderWidth * 2)))) ++ return Pt_CONTINUE; ++#endif ++ mask = (CWWidth | CWHeight); ++ vlist[0] = pcb->new_dim.w - (p->borderWidth * 2); ++ vlist[1] = pcb->new_dim.h - (p->borderWidth * 2); ++ ++ lastinput = NULL; ++ ConfigureWindow(p,mask,vlist,wClient(p)); ++ lastinput = tmp; ++ } ++ return Pt_CONTINUE; ++} ++ ++int ++rootless_os_callbackfn(PtWidget_t * w, void *d, PtCallbackInfo_t * cbinfo) ++{ ++ if(cbinfo->event->subtype == Ph_OFFSCREEN_INVALID) { ++ PhotonWindowRec *pwin = (PhotonWindowRec *)d; ++ if (pwin->os) { ++ PhDCRelease(pwin->os); ++ } ++ pwin->os = PdCreateOffscreenContext(0,pwin->w,pwin->h,Pg_OSC_MEM_PAGE_ALIGN); ++ if ((pwin->os) && (pwin->os->format != Pg_IMAGE_DIRECT_8888)) { ++ PhDCRelease(pwin->os); ++ pwin->os = NULL; ++ return Pt_CONTINUE; ++ } ++ if (pwin->os) { ++ unsigned char *p = PdGetOffscreenContextPtr(pwin->os); ++ if (p) ++ memcpy(p,pwin->bits,pwin->w*pwin->h*4); ++ } ++ } ++ return Pt_CONTINUE; ++} ++ ++#if 0 ++static void ++PrintPropertys(pWin) ++ WindowPtr pWin; ++{ ++ PropertyPtr pProp; ++ ++ if (!pWin->optional) ++ return; ++ pProp = pWin->optional->userProps; ++ while (pProp) { ++ if ((pProp->propertyName == XA_WM_NAME) && (pProp->type == XA_STRING)) { ++ RL_DEBUG_MSG("XA_WM_NAME %s\n", pProp->data); ++ } ++ if (pProp->propertyName == XA_WM_TRANSIENT_FOR) { ++ RL_DEBUG_MSG("XA_WM_TRANSIENT_FOR\n"); ++ } ++ pProp = pProp->next; ++ } ++} ++#endif ++ ++void * ++PhotonNewWindow(void *upperw, int x, int y, int w, int h, int isRoot, WindowPtr p) ++{ ++ PhotonWindowRec *new; ++ PtArg_t arg[10]; ++ int i = 0; ++ PhDim_t dim,min_dim; ++ PhPoint_t pos = {0, 0}; ++ PtWidget_t *tmpwdw; ++ char shmname[80]; ++ extern char *display; ++ ++ fprintf(stderr, "New Window %d,%d %dx%d root %d Redirect %d\n", x, y, w, h, isRoot, p->overrideRedirect); ++#if 0 ++ PrintPropertys(p); ++#endif ++ sprintf(&shmname[0],"/X%s.%8.8X.%d.%d",display,p->drawable.id,w,h); ++ new = malloc(sizeof(*new)); ++ memset(new,0,sizeof(*new)); ++ new->os = NULL; ++ if (isRoot) ++ new->bits = NULL; ++ else ++ switch (gdrawfrom) { ++ case DRAW_FROM_OFFSCREEN: ++ new->os = PdCreateOffscreenContext(0,w,h,Pg_OSC_MEM_PAGE_ALIGN); ++ if (new->os) { ++ if (new->os->format != Pg_IMAGE_DIRECT_8888) { ++ PhDCRelease(new->os); ++ new->os = NULL; ++ } ++ } ++ /* fall through */ ++ case DRAW_FROM_SHMEM: ++ new->bits = PgShmemCreate((w * 4 * h) + 100, NULL); ++ break; ++ case DRAW_FROM_MEMORY: ++ default: ++ new->bits = malloc((w * 4 * h) + 100); ++ break; ++ } ++ new->x = x; ++ new->y = y; ++ new->w = w; ++ new->h = h; ++ new->xwin = p; ++ dim.h = h; ++ dim.w = w; ++ new->isRoot = isRoot; ++ if (isRoot || !p->viewable) { ++ new->wdw = NULL; ++ } else { ++ PtSetArg(&arg[i], Pt_ARG_DIM, &dim, 0); ++ i++; ++ min_dim.w = min_dim.h = 1; ++ PtSetArg(&arg[i], Pt_ARG_MINIMUM_DIM, &min_dim, 0); ++ i++; ++ PtSetArg(&arg[i], Pt_ARG_WINDOW_MANAGED_FLAGS, Ph_WM_APP_DEF_MANAGED & ~Ph_WM_CLOSE, Ph_WM_APP_DEF_MANAGED); ++ i++; ++ if (p->overrideRedirect) { ++ /* no decorations */ ++ PtSetArg(&arg[i], Pt_ARG_WINDOW_RENDER_FLAGS, 0, ~0); ++ i++; ++ } ++ if (p->overrideRedirect && lastinput) { ++ /* position relative to lastinput */ ++ RootlessWindowRec *prec = WINREC(lastinput); ++ PtGetAbsPosition(PHWINREC(prec->wid)->wdw, &pos.x, &pos.y); ++ pos.x += p->drawable.x - lastinput->drawable.x; ++ pos.y += p->drawable.y - lastinput->drawable.y; ++ fprintf(stderr, "relative to lastinput pos at %d,%d\n", pos.x, pos.y); ++ PtSetArg(&arg[i], Pt_ARG_POS, &pos, 0); ++ i++; ++ } else { ++ /* position relative to current Photon console */ ++ PhRect_t extent; ++ ++ if (PhWindowQueryVisible(Ph_QUERY_CONSOLE,0L,PhInputGroup(NULL),&extent) == 0) { ++ pos.x = extent.ul.x; ++ pos.y = extent.ul.y; ++ } else { ++ /* if we get here, we're in trouble anyway... */ ++ pos.x = pos.y = 0; ++ } ++ pos.x += p->drawable.x; ++ pos.y += p->drawable.y; ++ PtSetArg(&arg[i], Pt_ARG_POS, &pos, 0); ++ i++; ++ } ++ new->wdw = tmpwdw = PtCreateWidget(PtWindow, Pt_NO_PARENT, i, &arg[0]); ++ fprintf(stderr, "create wdw = %p, wid = %p\n", new->wdw, new); ++ PtAddEventHandler(new->wdw, Ph_EV_EXPOSE | Ph_EV_PTR_ALL | Ph_EV_KEY, raw_callbackfn, p); ++ PtAddEventHandler(new->wdw, Ph_EV_INFO , rootless_os_callbackfn, new); ++ PtAddCallback(new->wdw, Pt_CB_GOT_FOCUS, got_focusfn, p); ++ PtAddCallback(new->wdw, Pt_CB_LOST_FOCUS, lost_focusfn, p); ++ PtAddCallback(new->wdw, Pt_CB_WINDOW, window_closingfn, p); ++ PtAddCallback(new->wdw, Pt_CB_RESIZE, resizefn, p); ++ UpdatePhotonTitle(p,new->wdw); ++ from_x_resize = 1; ++ errno = 0; ++ i = PtRealizeWidget(new->wdw); ++ fprintf(stderr, "PtRealizeWidget ret = %d (errno %d) rid = %d\n",i,errno,PtWidgetRid(new->wdw)); ++ from_x_resize = 0; ++ } ++ ++ return new; ++} ++ ++void ++PhotonDestroyWindow(void *rw) ++{ ++ if (!rw) return; ++ fprintf(stderr, "destroy wdw = %p\n",PHWINREC(rw)->wdw); ++ if (PHWINREC(rw)->bits) ++ switch (gdrawfrom) { ++ case DRAW_FROM_OFFSCREEN: ++ if (PHWINREC(rw)->os) { ++ PhDCRelease(PHWINREC(rw)->os); ++ } ++ /* fall through */ ++ case DRAW_FROM_SHMEM: ++ PgShmemDestroy(PHWINREC(rw)->bits); ++ break; ++ case DRAW_FROM_MEMORY: ++ default: ++ free(PHWINREC(rw)->bits); ++ break; ++ } ++ if (PHWINREC(rw)->wdw) ++ PtDestroyWidget(PHWINREC(rw)->wdw); ++ free(rw); ++ return; ++} ++ ++void ++PhotonMoveWindow(void *rw, int x, int y) ++{ ++ RL_DEBUG_MSG("move to %d,%d\n", x, y); ++ return; ++} ++ ++void ++PhotonStartResizeWindow(void *rw, int x, int y, int w, int h) ++{ ++ PtArg_t arg[5]; ++ int i = 0; ++ PhDim_t dim; ++ PhPoint_t pos; ++ char shmname[80]; ++ extern char *display; ++ ++ fprintf(stderr, "start resize to %d,%d %dx%d\n", x, y, w, h); ++ if (!rw) return; ++ sprintf(&shmname[0],"/X%s.%8.8X.%d.%d",display,PHWINREC(rw)->xwin->drawable.id,w,h); ++ from_x_resize = 1; ++ if (PHWINREC(rw)->bits) ++ switch (gdrawfrom) { ++ case DRAW_FROM_OFFSCREEN: ++ if (PHWINREC(rw)->os) { ++ PhDCRelease(PHWINREC(rw)->os); ++ } ++ /* fall through */ ++ case DRAW_FROM_SHMEM: ++ PgShmemDestroy(PHWINREC(rw)->bits); ++ break; ++ case DRAW_FROM_MEMORY: ++ default: ++ free(PHWINREC(rw)->bits); ++ break; ++ } ++ switch (gdrawfrom) { ++ case DRAW_FROM_OFFSCREEN: ++ PHWINREC(rw)->os = PdCreateOffscreenContext(0,w,h,Pg_OSC_MEM_PAGE_ALIGN); ++ if (PHWINREC(rw)->os) { ++ if (PHWINREC(rw)->os->format != Pg_IMAGE_DIRECT_8888) { ++ PhDCRelease(PHWINREC(rw)->os); ++ PHWINREC(rw)->os = NULL; ++ } ++ } ++ /* fall through */ ++ case DRAW_FROM_SHMEM: ++ PHWINREC(rw)->bits = PgShmemCreate((w * 4 * h) + 100, NULL); ++ break; ++ case DRAW_FROM_MEMORY: ++ default: ++ PHWINREC(rw)->bits = malloc((w * 4 * h) + 100); ++ break; ++ } ++ PHWINREC(rw)->x = x; ++ PHWINREC(rw)->y = y; ++ PHWINREC(rw)->w = w; ++ PHWINREC(rw)->h = h; ++ dim.w = w; ++ dim.h = h; ++ if (PHWINREC(rw)->wdw) { ++ PtSetArg(&arg[i], Pt_ARG_DIM, &dim, 0); ++ i++; ++ if (lastinput) { ++ RootlessWindowRec *prec = WINREC(lastinput); ++ PtGetAbsPosition(PHWINREC(prec->wid)->wdw, &pos.x, &pos.y); ++ pos.x += x - lastinput->drawable.x; ++ pos.y += y - lastinput->drawable.y; ++ RL_DEBUG_MSG(" relative to lastinput pos at %d,%d\n", pos.x, pos.y); ++ PtSetArg(&arg[i], Pt_ARG_POS, &pos, 0); ++ i++; ++ } ++ PtSetResources(PHWINREC(rw)->wdw, i, &arg[0]); ++ } ++ return; ++} ++ ++void ++PhotonFinishResizeWindow(void *rw, int x, int y, int w, int h) ++{ ++ fprintf(stderr, "finish resize to %d,%d %dx%d\n", x, y, w, h); ++ from_x_resize = 0; ++ return; ++} ++ ++void ++PhotonUpdateRects(void *rw, fakeBoxRec * rects, int count) ++{ ++ int i; ++ PhPoint_t pos; ++ PhDim_t size; ++ ++ if (!rw) return; ++ if (PHWINREC(rw)->wdw) { ++ //fprintf(stderr, "update wdw = %p rid = %d\n",PHWINREC(rw)->wdw,PtWidgetRid(PHWINREC(rw)->wdw)); ++ PgSetRegion(PtWidgetRid(PHWINREC(rw)->wdw)); ++ for (i = 0; i < count; i++) { ++ unsigned char *p; ++ int bpl = PHWINREC(rw)->w * 4; ++ ++ if (gdrawfrom == DRAW_FROM_OFFSCREEN && PHWINREC(rw)->os) { ++ int y; ++ unsigned char *psrc,*pdst; ++ ++ /* update the offscreen context */ ++ psrc = PHWINREC(rw)->bits + (rects[i].y1 * bpl) + (rects[i].x1 * 4); ++ pdst = PdGetOffscreenContextPtr(PHWINREC(rw)->os); ++ if (!pdst) continue; ++ pdst += (rects[i].y1 * bpl) + (rects[i].x1 * 4); ++ for (y=0;y<(rects[i].y2 - rects[i].y1);y++) { ++ memcpy(pdst,psrc,(rects[i].x2 - rects[i].x1) * 4); ++ psrc += bpl; ++ pdst += bpl; ++ } ++ /* luckily the rect layout is the same... */ ++ PgContextBlit(PHWINREC(rw)->os,(PhRect_t *)&rects[i],NULL,(PhRect_t *)&rects[i]); ++ } else { ++ int ++ left = rects[i].x1, ++ right = rects[i].x2, ++ top = rects[i].y1, ++ bottom = rects[i].y2; ++ ++ // Child windows ++ left -= PHWINREC(rw)->xwin->drawable.x; ++ top -= PHWINREC(rw)->xwin->drawable.y; ++ right -= PHWINREC(rw)->xwin->drawable.x; ++ bottom -= PHWINREC(rw)->xwin->drawable.y; ++ ++ // Calc drawing rectangle ++ pos.x = left; ++ pos.y = top; ++ size.w = right - left; ++ size.h = bottom - top; ++ ++ // Calc drawing offset ++ p = PHWINREC(rw)->bits + (pos.y * bpl) + (pos.x * 4); ++ ++ //fprintf(stderr, "x,y,h,w: %d,%d,%d,%d\n", pos.x, pos.y, size.w, size.h); ++ ++ // Draw! ++ PgDrawImagemx(p, Pg_IMAGE_DIRECT_8888, &pos, &size, bpl, 0); ++ } ++ } ++ } ++} ++ ++void ++PhotonFlush(void *rw) ++{ ++ PgFlush(); ++} ++ ++void ++PhotonRestackWindow(void *rw, void *upperw) ++{ ++ if(upperw == NULL) { ++ unsigned long flags; ++ ++ PtGetResource(PHWINREC(rw)->wdw, Pt_ARG_FLAGS, &flags, 0); ++ ++ if(!(flags & Pt_REALIZED)) { ++ PtRealizeWidget(PHWINREC(rw)->wdw); ++ } ++ } else { ++ // TODO ++ fprintf(stderr, "AUch das passiert mal ...\n"); ++ } ++ ++ return; ++} ++ ++void ++PhotonReshapeWindow(void *rw, fakeBoxRec * rects, int count) ++{ ++ return; ++} ++ ++void ++PhotonGetPixmap(void *rw, char **bits, int *rowBytes, int *depth, int *bpp) ++{ ++ if (!rw) return; ++ *bits = PHWINREC(rw)->bits; ++ *rowBytes = PHWINREC(rw)->w * 4; ++ *depth = 24; ++ *bpp = 32; ++ return; ++} ++ ++void ++PhotonUnmapWindow(void *rw) ++{ ++ PtUnrealizeWidget(PHWINREC(rw)->wdw); ++} +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonImp.h ./hw/xphoton/rootlessPhotonImp.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/rootlessPhotonImp.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/rootlessPhotonImp.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,50 @@ ++/* ++Copyright 2001, QNX Software Systems Ltd. All Rights Reserved ++ ++This source code has been published by QNX Software Systems Ltd. (QSSL). ++However, any use, reproduction, modification, distribution or transfer of ++this software, or any software which includes or is based upon any of this ++code, is only permitted under the terms of the QNX Open Community License ++version 1.0 (see licensing.qnx.com for details) or as otherwise expressly ++authorized by a written license agreement from QSSL. For more information, ++please email licensing@qnx.com. ++*/ ++/* ++ * Rootless implementation for Mac OS X Aqua environment ++ * ++ * Greg Parker gparker@cs.stanford.edu ++ */ ++/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/rootlessAquaImp.h,v 1.3 2001/08/01 05:34:06 torrey Exp $ */ ++ ++#ifndef _ROOTLESSPHOTONIMP_H ++#define _ROOTLESSPHOTONIMP_H ++ ++#include "fakeBoxRec.h" ++ ++void PhotonDisplayInit(int *width, int *height, int *rowBytes, ++ unsigned long *bps, unsigned long *spp, int *bpp); ++ ++void *PhotonNewWindow(void *upperw, int x, int y, int w, int h, int isRoot, WindowPtr p); ++ ++void PhotonDestroyWindow(void *rw); ++ ++void PhotonMoveWindow(void *rw, int x, int y); ++ ++void PhotonStartResizeWindow(void *rw, int x, int y, int w, int h); ++ ++void PhotonFinishResizeWindow(void *rw, int x, int y, int w, int h); ++ ++void PhotonUpdateRects(void *rw, fakeBoxRec *rects, int count); ++ ++void PhotonRestackWindow(void *rw, void *lowerw); ++ ++void PhotonUnmapWindow(void *rw); ++ ++void PhotonReshapeWindow(void *rw, fakeBoxRec *rects, int count); ++ ++void PhotonGetPixmap(void *rw, char **bits, ++ int *rowBytes, int *depth, int *bpp); ++ ++void PhotonFlush(void *rw); ++ ++#endif /* _ROOTLESSPHOTONIMP_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/xphoton.h ./hw/xphoton/xphoton.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/hw/xphoton/xphoton.h 1970-01-01 01:00:00.000000000 +0100 ++++ ./hw/xphoton/xphoton.h 2010-03-16 00:33:26.000000000 +0100 +@@ -0,0 +1,97 @@ ++#ifndef XPHOTON_GLOBALS_H ++#define XPHOTON_GLOBALS_H ++ ++// System headers ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++// X-server internal headers ++#include "os.h" ++#include "servermd.h" ++#include "screenint.h" ++#include "mibstore.h" // mi backing store implementation ++#include "mipointer.h" // mi software cursor ++#include "micmap.h" // mi colormap code ++#include "fb.h" // fb framebuffer code ++#include "site.h" ++#include "globals.h" ++#include "dix.h" ++#include "input.h" ++#include "inputstr.h" ++#include "defmap.h" ++#include "mi.h" ++#include "scrnintstr.h" ++#include "cursorstr.h" ++#include "mipointrst.h" ++#include "fakeBoxRec.h" ++#include "windowstr.h" ++#include "propertyst.h" ++#include "property.h" ++ ++// X11 headers ++#ifdef NEED_X11 ++# include ++# include ++# include ++# include ++# include ++# include ++#endif ++ ++// XKB headers ++#ifdef NEED_XKB ++// Needed to get XK_Escape ++# define XK_TECHNICAL ++# include ++# include ++# include ++#endif ++ ++// XINPUT headers ++#ifdef NEED_XINPUT ++# include ++# include ++# include "XIstubs.h" ++#endif ++ ++// SHM headers ++#ifdef MITSHM ++# define _XSHM_SERVER_ ++# include ++#endif ++ ++// Photon headers ++#include ++#include ++ ++// Some headers used nearly everywhere in XPhoton ++#include "nto.h" ++#include "ntoEvents.h" ++#include "fakeBoxRec.h" ++#include "photon.h" ++#include "photonAudio.h" ++#include "photonCursor.h" ++#include "rootlessPhoton.h" ++#include "rootlessPhotonImp.h" ++#include ++#include ++ ++// Debugging stuff ++#define XPHOTON_DEBUG 1 ++#if XPHOTON_DEBUG ++# define XPH_ENTRY do { fprintf(stderr, "(%-20s | %05d | %s): >>>\n", __FILE__, __LINE__, __FUNCTION__); } while(0); ++# define XPH_PRINTF(__fmt,...) do { fprintf(stderr, "(%-20s | %05d | %s ): " __fmt "\n", __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); } while(0); ++#endif ++ ++// Externals ++extern DeviceIntPtr ntoPointer; ++ ++#endif /* XPHOTON_GLOBALS_H */ +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/Makefile.am ./miext/Makefile.am +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/Makefile.am 2009-07-07 19:48:58.000000000 +0200 ++++ ./miext/Makefile.am 2010-03-16 00:33:26.000000000 +0100 +@@ -5,4 +5,7 @@ + if XQUARTZ + SUBDIRS += rootless + endif ++if XPHOTON ++SUBDIRS += rootless ++endif + DIST_SUBDIRS = damage shadow cw rootless +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessConfig.h ./miext/rootless/rootlessConfig.h +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessConfig.h 2008-10-13 01:19:05.000000000 +0200 ++++ ./miext/rootless/rootlessConfig.h 2010-03-29 16:25:19.000000000 +0200 +@@ -34,7 +34,7 @@ + #ifndef _ROOTLESSCONFIG_H + #define _ROOTLESSCONFIG_H + +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined(__QNXNTO__) + + # define ROOTLESS_GLOBAL_COORDS TRUE + # define ROOTLESS_PROTECT_ALPHA TRUE +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessScreen.c ./miext/rootless/rootlessScreen.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessScreen.c 2009-07-07 19:48:58.000000000 +0200 ++++ ./miext/rootless/rootlessScreen.c 2010-03-29 16:06:49.000000000 +0200 +@@ -622,6 +622,10 @@ + ScreenPtr pScreen = pbdata; + RootlessScreenRec *screenRec = SCREENREC(pScreen); + ++ extern void PtBkgdHandlerProcess(void); ++ ++ PtBkgdHandlerProcess(); ++ + if (screenRec->redisplay_expired) { + screenRec->redisplay_expired = FALSE; + +@@ -634,6 +638,7 @@ + RootlessWakeupHandler(pointer data, int i, pointer LastSelectMask) + { + // nothing here ++ mieqProcessInputEvents(); + } + + +diff -u --unidirectional-new-file -r /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessWindow.c ./miext/rootless/rootlessWindow.c +--- /usr/ports/x11/modular-xorg-server/work/xorg-server-1.6.3/miext/rootless/rootlessWindow.c 2009-07-07 19:48:58.000000000 +0200 ++++ ./miext/rootless/rootlessWindow.c 2010-03-29 16:06:49.000000000 +0200 +@@ -2,7 +2,7 @@ + * Rootless window management + */ + /* +- * Copyright (c) 2001 Greg Parker. All Rights Reserved. ++ * Copyright (c) 2001 Greg Parker. All Rights Reserved. + * Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * +@@ -84,6 +84,7 @@ + static Bool windows_hidden; + // TODO - abstract xp functions + ++#ifdef XQUARTZ + static inline int + configure_window (xp_window_id id, unsigned int mask, + const xp_window_changes *values) +@@ -93,6 +94,7 @@ + else + return XP_Success; + } ++#endif + + /*static inline unsigned long + current_time_in_seconds (void) +@@ -111,6 +113,7 @@ + return WINREC (WindowTable[pScreen->myNum]) != NULL; + } + ++#ifdef XQUARTZ + void + RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state) + { +@@ -125,7 +128,9 @@ + winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0); + pWin->rootlessUnhittable = winRec->is_offscreen; + } ++#endif + ++#ifdef XQUARTZ + void RootlessNativeWindowMoved (WindowPtr pWin) { + xp_box bounds; + int sx, sy, err; +@@ -160,7 +165,9 @@ + ConfigureWindow (pWin, mask, vlist, pClient); + no_configure_window = FALSE; + } ++#endif + ++#ifdef XQUARTZ + /* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */ + static void + set_screen_origin (WindowPtr pWin) +@@ -180,6 +187,7 @@ + dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(), + XA_INTEGER, 32, PropModeReplace, 2, data, TRUE); + } ++#endif + + /* + * RootlessCreateWindow +@@ -445,12 +453,13 @@ + #endif + } + +- ++#ifdef XQUARTZ + Bool + RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors) + { + return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch); + } ++#endif + + /* + * RootlessEnsureFrame +@@ -1484,7 +1493,7 @@ + } + } + +- ++#ifdef XQUARTZ + void + RootlessFlushWindowColormap (WindowPtr pWin) + { +@@ -1503,6 +1512,12 @@ + + configure_window (MAKE_WINDOW_ID(winRec->wid), XP_COLORMAP, &wc); + } ++#else ++void ++RootlessFlushWindowColormap(WindowPtr pWin) ++{ ++} ++#endif + + /* + * RootlessChangeBorderWidth +@@ -1617,6 +1632,7 @@ + DeleteProperty (serverClient, pRoot, xa_native_window_id ()); + } + ++#ifdef XQUARTZ + void + RootlessHideAllWindows (void) + { +@@ -1691,3 +1707,5 @@ + RootlessScreenExpose (pScreen); + } + } ++ ++#endif Index: Makefile =================================================================== --- Makefile (revision 261) +++ Makefile (working copy) @@ -16,7 +16,7 @@ GNU_CONFIGURE= yes USE_LIBTOOL= yes -USE_TOOLS+= gmake pkg-config autoconf +USE_TOOLS+= gmake pkg-config autoconf automake aclocal PKGCONFIG_OVERRIDE+= xorg-server.pc.in SHLIBTOOL_OVERRIDE= # empty @@ -49,7 +49,8 @@ CONFIGURE_ARGS+= --with-os-name=${MACHINE_PLATFORM:Q} CONFIGURE_ARGS+= --with-vendor-web="http://www.pkgsrc.org/" -CONFIGURE_ARGS+= --enable-xorg +CONFIGURE_ARGS+= --disable-xorg +CONFIGURE_ARGS+= --enable-xphoton CONFIGURE_ARGS+= --disable-config-hal CONFIGURE_ARGS+= --disable-dmx @@ -74,6 +75,10 @@ CONFIGURE_ENV+= ac_cv_header_sys_event_h=no .endif +.if empty(PKGSRC_COMPILER:Mgcc) +CONFIGURE_ENV+= ac_cv_path_RAWCPP="cc -E -Uunix -" +.endif + INSTALLATION_DIRS+= lib/xorg/modules/drivers lib/xorg/modules/input BUILDLINK_API_DEPENDS.MesaLib+= MesaLib>=7.1.0