summaryrefslogtreecommitdiffstats
path: root/xorg/server/module/rdpPri.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg/server/module/rdpPri.c')
-rw-r--r--xorg/server/module/rdpPri.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/xorg/server/module/rdpPri.c b/xorg/server/module/rdpPri.c
index 6a10c59b..3de181a8 100644
--- a/xorg/server/module/rdpPri.c
+++ b/xorg/server/module/rdpPri.c
@@ -39,23 +39,25 @@ to deal with privates changing in xorg versions
#include "rdpPri.h"
-/* not sure if these versions are right */
-#if XORG_VERSION_CURRENT < (((1) * 10000000) + ((5) * 100000) + ((1) * 1000) + 0)
-#define FBDEV_PRI 1
-#elif XORG_VERSION_CURRENT < (((1) * 10000000) + ((7) * 100000) + ((7) * 1000) + 1)
-#define FBDEV_PRI 2
+#if XORG_VERSION_CURRENT < (((1) * 10000000) + ((5) * 100000) + ((0) * 1000) + 0)
+/* 1.1, 1.2, 1.3, 1.4 */
+#define XRDP_PRI 1
+#elif XORG_VERSION_CURRENT < (((1) * 10000000) + ((9) * 100000) + ((0) * 1000) + 0)
+/* 1.5, 1.6, 1.7, 1.8 */
+#define XRDP_PRI 2
#else
-#define FBDEV_PRI 3
+/* 1.9, 1.10, 1.11, 1.12 */
+#define XRDP_PRI 3
#endif
#define PTR2INT(_ptr) ((int) ((long) ((void*) (_ptr))))
#define INT2PTR(_int) ((void *) ((long) ((int) (_int))))
-#if FBDEV_PRI == 3
+#if XRDP_PRI == 3
static DevPrivateKeyRec g_privateKeyRecGC;
static DevPrivateKeyRec g_privateKeyRecPixmap;
static DevPrivateKeyRec g_privateKeyRecWindow;
-#elif FBDEV_PRI == 2
+#elif XRDP_PRI == 2
static int g_privateKeyRecGC = 0;
static int g_privateKeyRecPixmap = 0;
static int g_privateKeyRecWindow = 0;
@@ -67,10 +69,10 @@ rdpAllocateGCPrivate(ScreenPtr pScreen, int bytes)
{
rdpDevPrivateKey rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = INT2PTR(AllocateGCPrivateIndex());
AllocateGCPrivate(pScreen, PTR2INT(rv), bytes);
-#elif FBDEV_PRI == 2
+#elif XRDP_PRI == 2
dixRequestPrivate(&g_privateKeyRecGC, bytes);
rv = &g_privateKeyRecGC;
#else
@@ -86,10 +88,10 @@ rdpAllocatePixmapPrivate(ScreenPtr pScreen, int bytes)
{
rdpDevPrivateKey rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = INT2PTR(AllocatePixmapPrivateIndex());
AllocatePixmapPrivate(pScreen, PTR2INT(rv), bytes);
-#elif FBDEV_PRI == 2
+#elif XRDP_PRI == 2
dixRequestPrivate(&g_privateKeyRecPixmap, bytes);
rv = &g_privateKeyRecPixmap;
#else
@@ -105,10 +107,10 @@ rdpAllocateWindowPrivate(ScreenPtr pScreen, int bytes)
{
rdpDevPrivateKey rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = INT2PTR(AllocateWindowPrivateIndex());
AllocateWindowPrivate(pScreen, PTR2INT(rv), bytes);
-#elif FBDEV_PRI == 2
+#elif XRDP_PRI == 2
dixRequestPrivate(&g_privateKeyRecWindow, bytes);
rv = &g_privateKeyRecWindow;
#else
@@ -124,7 +126,7 @@ rdpGetGCPrivate(GCPtr pGC, rdpDevPrivateKey key)
{
void *rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = pGC->devPrivates[PTR2INT(key)].ptr;
#else
rv = dixLookupPrivate(&(pGC->devPrivates), key);
@@ -138,7 +140,7 @@ rdpGetPixmapPrivate(PixmapPtr pPixmap, rdpDevPrivateKey key)
{
void *rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = pPixmap->devPrivates[PTR2INT(key)].ptr;
#else
rv = dixLookupPrivate(&(pPixmap->devPrivates), key);
@@ -152,7 +154,7 @@ rdpGetWindowPrivate(WindowPtr pWindow, rdpDevPrivateKey key)
{
void *rv;
-#if FBDEV_PRI == 1
+#if XRDP_PRI == 1
rv = pWindow->devPrivates[PTR2INT(key)].ptr;
#else
rv = dixLookupPrivate(&(pWindow->devPrivates), key);
@@ -164,7 +166,7 @@ rdpGetWindowPrivate(WindowPtr pWindow, rdpDevPrivateKey key)
int
rdpPrivateInit(void)
{
-#if FBDEV_PRI == 3
+#if XRDP_PRI == 3
memset(&g_privateKeyRecGC, 0, sizeof(g_privateKeyRecGC));
memset(&g_privateKeyRecWindow, 0, sizeof(g_privateKeyRecWindow));
memset(&g_privateKeyRecPixmap, 0, sizeof(g_privateKeyRecPixmap));