From 9e3371021541dbb7d8428b419c2e77156b166f1a Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:30 +0200 Subject: Imported nxagent-3.1.0-2.tar.gz Summary: Imported nxagent-3.1.0-2.tar.gz Keywords: Imported nxagent-3.1.0-2.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 159 ++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 nx-X11/programs/Xserver/hw/nxagent/Visual.c (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c new file mode 100644 index 000000000..2a8283a30 --- /dev/null +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -0,0 +1,159 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* */ +/* NXAGENT, NX protocol compression and NX extensions to this software */ +/* are copyright of NoMachine. Redistribution and use of the present */ +/* software is allowed according to terms specified in the file LICENSE */ +/* which comes in the source distribution. */ +/* */ +/* Check http://www.nomachine.com/licensing.html for applicability. */ +/* */ +/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* */ +/* All rights reserved. */ +/* */ +/**************************************************************************/ + +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#include "scrnintstr.h" +#include "dix.h" +#include "mi.h" +#include "mibstore.h" +#include "resource.h" + +#include "X.h" +#include "Xproto.h" + +#include "Agent.h" +#include "Display.h" +#include "Visual.h" + +#define PANIC +#define WARNING +#undef TEST +#undef DEBUG + +/* + * Predefined visual used for drawables + * having a 32 bits depth. + */ + +Visual nxagentAlphaVisual; + +Visual *nxagentVisual(VisualPtr pVisual) +{ + XVisualInfo visual; + + int i; + + visual.class = pVisual->class; + visual.bits_per_rgb = pVisual->bitsPerRGBValue; + visual.colormap_size = pVisual->ColormapEntries; + visual.depth = pVisual->nplanes; + visual.red_mask = pVisual->redMask; + visual.green_mask = pVisual->greenMask; + visual.blue_mask = pVisual->blueMask; + + for (i = 0; i < nxagentNumVisuals; i++) + { + if (nxagentCompareVisuals(visual, nxagentVisuals[i]) == 1) + { + return nxagentVisuals[i].visual; + } + } + + return NULL; +} + +Visual *nxagentVisualFromID(ScreenPtr pScreen, VisualID visual) +{ + int i; + + for (i = 0; i < pScreen->numVisuals; i++) + { + if (pScreen->visuals[i].vid == visual) + { + return nxagentVisual(&pScreen->visuals[i]); + } + } + + return NULL; +} + +Colormap nxagentDefaultVisualColormap(Visual *visual) +{ + int i; + + for (i = 0; i < nxagentNumVisuals; i++) + { + if (nxagentVisuals[i].visual == visual) + { + return nxagentDefaultColormaps[i]; + } + } + + return None; +} + +/* + * This is currently unused. It should serve + * the scope of matching a visual whenever + * a drawable has a different depth than the + * real display. + */ + +Visual *nxagentVisualFromDepth(ScreenPtr pScreen, int depth) +{ + int i; + + for (i = 0; i < pScreen->numVisuals; i++) + { + if (pScreen->visuals[i].nplanes == depth) + { + return nxagentVisual(&pScreen->visuals[i]); + } + } + + return NULL; +} + +/* + * Create a fake 32 bits depth visual and + * initialize it based on the endianess + * of the remote display. + */ + +void nxagentInitAlphaVisual() +{ + nxagentAlphaVisual.visualid = XAllocID(nxagentDisplay); + + /* + * Color masks are referred to bits inside + * the pixel. This is independent from the + * endianess. + */ + + nxagentAlphaVisual.red_mask = 0x00ff0000; + nxagentAlphaVisual.green_mask = 0x0000ff00; + nxagentAlphaVisual.blue_mask = 0x000000ff; + + #ifdef TEST + fprintf(stderr,"nxagentInitAlphaVisual: Set alpha visual with id [0x%lx] mask [0x%lx,0x%lx,0x%lx].\n", + nxagentAlphaVisual.visualid, nxagentAlphaVisual.red_mask, + nxagentAlphaVisual.green_mask, nxagentAlphaVisual.blue_mask); + #endif +} -- cgit v1.2.3 From e9132da09462b3d2607a97e2f580cbd3144819eb Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:57 +0200 Subject: Imported nxagent-3.4.0-11.tar.gz Summary: Imported nxagent-3.4.0-11.tar.gz Keywords: Imported nxagent-3.4.0-11.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index 2a8283a30..f38931677 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ -- cgit v1.2.3 From 25af86cd3aaa61dc4a3d69825aa523177c2229e1 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:57 +0200 Subject: Imported nxagent-3.4.0-16.tar.gz Summary: Imported nxagent-3.4.0-16.tar.gz Keywords: Imported nxagent-3.4.0-16.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index f38931677..b086c0e9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ -- cgit v1.2.3 From d30ef0340e759378964b75e8143625ecaea245b0 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:58 +0200 Subject: Imported nxagent-3.4.0-3.tar.gz Summary: Imported nxagent-3.4.0-3.tar.gz Keywords: Imported nxagent-3.4.0-3.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index b086c0e9a..46fe90f39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ -- cgit v1.2.3 From c078024019d334eb96fbfaf922c64297c9a0c6e0 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:59 +0200 Subject: Imported nxagent-3.4.0-5.tar.gz Summary: Imported nxagent-3.4.0-5.tar.gz Keywords: Imported nxagent-3.4.0-5.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index 46fe90f39..f38931677 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ -- cgit v1.2.3 From 39b738a67a14dde67b2a811d56ac84934fcef52d Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:59:00 +0200 Subject: Imported nxagent-3.5.0-2.tar.gz Summary: Imported nxagent-3.5.0-2.tar.gz Keywords: Imported nxagent-3.5.0-2.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Visual.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index f38931677..b086c0e9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ -- cgit v1.2.3