]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/cfb/cfballpriv.c
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / cfb / cfballpriv.c
1 /*
2  * $XConsortium: cfballpriv.c,v 1.5 94/04/17 20:28:42 dpw Exp $
3  *
4 Copyright (c) 1991  X Consortium
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the name of the X Consortium shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from the X Consortium.
26  *
27  * Author:  Keith Packard, MIT X Consortium
28  */
29
30 #include "X.h"
31 #include "Xmd.h"
32 #include "servermd.h"
33 #include "scrnintstr.h"
34 #include "pixmapstr.h"
35 #include "resource.h"
36 #include "colormap.h"
37 #include "colormapst.h"
38 #include "cfb.h"
39 #include "mi.h"
40 #include "mistruct.h"
41 #include "dix.h"
42 #include "cfbmskbits.h"
43 #include "mibstore.h"
44
45 int cfbWindowPrivateIndex;
46 int cfbGCPrivateIndex;
47 #ifdef CFB_NEED_SCREEN_PRIVATE
48 int cfbScreenPrivateIndex;
49 #endif
50
51 extern RegionPtr (*cfbPuntCopyPlane)();
52
53 Bool
54 cfbAllocatePrivates(pScreen, window_index, gc_index)
55     ScreenPtr   pScreen;
56     int         *window_index, *gc_index;
57 {
58     if (!window_index || !gc_index ||
59         *window_index == -1 && *gc_index == -1)
60     {
61         if (!mfbAllocatePrivates(pScreen,
62                                  &cfbWindowPrivateIndex, &cfbGCPrivateIndex))
63             return FALSE;
64         if (window_index)
65             *window_index = cfbWindowPrivateIndex;
66         if (gc_index)
67             *gc_index = cfbGCPrivateIndex;
68     }
69     else
70     {
71         cfbWindowPrivateIndex = *window_index;
72         cfbGCPrivateIndex = *gc_index;
73     }
74     if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex,
75                                sizeof(cfbPrivWin)) ||
76         !AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
77         return FALSE;
78     cfbPuntCopyPlane = miCopyPlane;
79 #ifdef CFB_NEED_SCREEN_PRIVATE
80     cfbScreenPrivateIndex = AllocateScreenPrivateIndex ();
81     if (cfbScreenPrivateIndex == -1)
82         return FALSE;
83 #endif
84     return TRUE;
85 }