|
|
@ -39,23 +39,25 @@ to deal with privates changing in xorg versions
|
|
|
|
|
|
|
|
|
|
|
|
#include "rdpPri.h"
|
|
|
|
#include "rdpPri.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* not sure if these versions are right */
|
|
|
|
#if XORG_VERSION_CURRENT < (((1) * 10000000) + ((5) * 100000) + ((0) * 1000) + 0)
|
|
|
|
#if XORG_VERSION_CURRENT < (((1) * 10000000) + ((5) * 100000) + ((1) * 1000) + 0)
|
|
|
|
/* 1.1, 1.2, 1.3, 1.4 */
|
|
|
|
#define FBDEV_PRI 1
|
|
|
|
#define XRDP_PRI 1
|
|
|
|
#elif XORG_VERSION_CURRENT < (((1) * 10000000) + ((7) * 100000) + ((7) * 1000) + 1)
|
|
|
|
#elif XORG_VERSION_CURRENT < (((1) * 10000000) + ((9) * 100000) + ((0) * 1000) + 0)
|
|
|
|
#define FBDEV_PRI 2
|
|
|
|
/* 1.5, 1.6, 1.7, 1.8 */
|
|
|
|
|
|
|
|
#define XRDP_PRI 2
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#define FBDEV_PRI 3
|
|
|
|
/* 1.9, 1.10, 1.11, 1.12 */
|
|
|
|
|
|
|
|
#define XRDP_PRI 3
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#define PTR2INT(_ptr) ((int) ((long) ((void*) (_ptr))))
|
|
|
|
#define PTR2INT(_ptr) ((int) ((long) ((void*) (_ptr))))
|
|
|
|
#define INT2PTR(_int) ((void *) ((long) ((int) (_int))))
|
|
|
|
#define INT2PTR(_int) ((void *) ((long) ((int) (_int))))
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 3
|
|
|
|
#if XRDP_PRI == 3
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecGC;
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecGC;
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecPixmap;
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecPixmap;
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecWindow;
|
|
|
|
static DevPrivateKeyRec g_privateKeyRecWindow;
|
|
|
|
#elif FBDEV_PRI == 2
|
|
|
|
#elif XRDP_PRI == 2
|
|
|
|
static int g_privateKeyRecGC = 0;
|
|
|
|
static int g_privateKeyRecGC = 0;
|
|
|
|
static int g_privateKeyRecPixmap = 0;
|
|
|
|
static int g_privateKeyRecPixmap = 0;
|
|
|
|
static int g_privateKeyRecWindow = 0;
|
|
|
|
static int g_privateKeyRecWindow = 0;
|
|
|
@ -67,10 +69,10 @@ rdpAllocateGCPrivate(ScreenPtr pScreen, int bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = INT2PTR(AllocateGCPrivateIndex());
|
|
|
|
rv = INT2PTR(AllocateGCPrivateIndex());
|
|
|
|
AllocateGCPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
AllocateGCPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
#elif FBDEV_PRI == 2
|
|
|
|
#elif XRDP_PRI == 2
|
|
|
|
dixRequestPrivate(&g_privateKeyRecGC, bytes);
|
|
|
|
dixRequestPrivate(&g_privateKeyRecGC, bytes);
|
|
|
|
rv = &g_privateKeyRecGC;
|
|
|
|
rv = &g_privateKeyRecGC;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -86,10 +88,10 @@ rdpAllocatePixmapPrivate(ScreenPtr pScreen, int bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = INT2PTR(AllocatePixmapPrivateIndex());
|
|
|
|
rv = INT2PTR(AllocatePixmapPrivateIndex());
|
|
|
|
AllocatePixmapPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
AllocatePixmapPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
#elif FBDEV_PRI == 2
|
|
|
|
#elif XRDP_PRI == 2
|
|
|
|
dixRequestPrivate(&g_privateKeyRecPixmap, bytes);
|
|
|
|
dixRequestPrivate(&g_privateKeyRecPixmap, bytes);
|
|
|
|
rv = &g_privateKeyRecPixmap;
|
|
|
|
rv = &g_privateKeyRecPixmap;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -105,10 +107,10 @@ rdpAllocateWindowPrivate(ScreenPtr pScreen, int bytes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
rdpDevPrivateKey rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = INT2PTR(AllocateWindowPrivateIndex());
|
|
|
|
rv = INT2PTR(AllocateWindowPrivateIndex());
|
|
|
|
AllocateWindowPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
AllocateWindowPrivate(pScreen, PTR2INT(rv), bytes);
|
|
|
|
#elif FBDEV_PRI == 2
|
|
|
|
#elif XRDP_PRI == 2
|
|
|
|
dixRequestPrivate(&g_privateKeyRecWindow, bytes);
|
|
|
|
dixRequestPrivate(&g_privateKeyRecWindow, bytes);
|
|
|
|
rv = &g_privateKeyRecWindow;
|
|
|
|
rv = &g_privateKeyRecWindow;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -124,7 +126,7 @@ rdpGetGCPrivate(GCPtr pGC, rdpDevPrivateKey key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void *rv;
|
|
|
|
void *rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = pGC->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
rv = pGC->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
rv = dixLookupPrivate(&(pGC->devPrivates), key);
|
|
|
|
rv = dixLookupPrivate(&(pGC->devPrivates), key);
|
|
|
@ -138,7 +140,7 @@ rdpGetPixmapPrivate(PixmapPtr pPixmap, rdpDevPrivateKey key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void *rv;
|
|
|
|
void *rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = pPixmap->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
rv = pPixmap->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
rv = dixLookupPrivate(&(pPixmap->devPrivates), key);
|
|
|
|
rv = dixLookupPrivate(&(pPixmap->devPrivates), key);
|
|
|
@ -152,7 +154,7 @@ rdpGetWindowPrivate(WindowPtr pWindow, rdpDevPrivateKey key)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void *rv;
|
|
|
|
void *rv;
|
|
|
|
|
|
|
|
|
|
|
|
#if FBDEV_PRI == 1
|
|
|
|
#if XRDP_PRI == 1
|
|
|
|
rv = pWindow->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
rv = pWindow->devPrivates[PTR2INT(key)].ptr;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
rv = dixLookupPrivate(&(pWindow->devPrivates), key);
|
|
|
|
rv = dixLookupPrivate(&(pWindow->devPrivates), key);
|
|
|
@ -164,7 +166,7 @@ rdpGetWindowPrivate(WindowPtr pWindow, rdpDevPrivateKey key)
|
|
|
|
int
|
|
|
|
int
|
|
|
|
rdpPrivateInit(void)
|
|
|
|
rdpPrivateInit(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if FBDEV_PRI == 3
|
|
|
|
#if XRDP_PRI == 3
|
|
|
|
memset(&g_privateKeyRecGC, 0, sizeof(g_privateKeyRecGC));
|
|
|
|
memset(&g_privateKeyRecGC, 0, sizeof(g_privateKeyRecGC));
|
|
|
|
memset(&g_privateKeyRecWindow, 0, sizeof(g_privateKeyRecWindow));
|
|
|
|
memset(&g_privateKeyRecWindow, 0, sizeof(g_privateKeyRecWindow));
|
|
|
|
memset(&g_privateKeyRecPixmap, 0, sizeof(g_privateKeyRecPixmap));
|
|
|
|
memset(&g_privateKeyRecPixmap, 0, sizeof(g_privateKeyRecPixmap));
|
|
|
|