~ubuntu-branches/ubuntu/edgy/xorg-server/edgy-updates

« back to all changes in this revision

Viewing changes to Xi/chgprop.c

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Parra Novo
  • Date: 2006-07-25 20:06:28 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060725200628-gjmmd9gxfxdc4ejs
Tags: 1:1.1.1-0ubuntu1
* New Upstream version
* Changed Build-Depends from mesa-swrast-source to mesa-swx11-source,
  following Debian package nomenclature
* Re-did 12_security_policy_in_etc.diff for 1.1.1
* Dropped 15_security_allocate_local.diff (applied upstream)
* Dropped 16_SECURITY_setuid.diff (applied upstream)
* Dropped 000_ubuntu_fix_read_kernel_mapping.patch (applied upstream)
* Dropped 002_ubuntu_fix_for_certain_intel_chipsets.patch (applied upstream)
* Updated versioned Build-Depends on mesa-swx11-source to version
  6.5.0.cvs.20060725-0ubuntu1
* Added arrayobj.c, arrayobj.h, bitset.h & rbadaptors.h to
  GL/symlink-mesa.sh (linked from mesa-swx11-source)
* Added arrayobj.c to default build target on GL/mesa/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Xorg: chgprop.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
2
 
 
3
1
/************************************************************
4
2
 
5
3
Copyright 1989, 1998  The Open Group
45
43
SOFTWARE.
46
44
 
47
45
********************************************************/
48
 
/* $XFree86: xc/programs/Xserver/Xi/chgprop.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
49
46
 
50
47
/***********************************************************************
51
48
 *
59
56
#include <dix-config.h>
60
57
#endif
61
58
 
62
 
#include <X11/X.h>                              /* for inputstr.h    */
63
 
#include <X11/Xproto.h>                 /* Request macro     */
64
 
#include "inputstr.h"                   /* DeviceIntPtr      */
 
59
#include <X11/X.h>      /* for inputstr.h    */
 
60
#include <X11/Xproto.h> /* Request macro     */
 
61
#include "inputstr.h"   /* DeviceIntPtr      */
65
62
#include "windowstr.h"
66
63
#include <X11/extensions/XI.h>
67
64
#include <X11/extensions/XIproto.h>
68
65
#include "extnsionst.h"
69
 
#include "extinit.h"                    /* LookupDeviceIntRec */
 
66
#include "extinit.h"    /* LookupDeviceIntRec */
70
67
 
71
68
#include "exevents.h"
72
69
#include "exglobals.h"
81
78
 */
82
79
 
83
80
int
84
 
SProcXChangeDeviceDontPropagateList(client)
85
 
    register ClientPtr client;
86
 
    {
 
81
SProcXChangeDeviceDontPropagateList(register ClientPtr client)
 
82
{
87
83
    register char n;
88
84
    register long *p;
89
85
    register int i;
93
89
    REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
94
90
    swapl(&stuff->window, n);
95
91
    swaps(&stuff->count, n);
96
 
    p = (long *) &stuff[1];
97
 
    for (i=0; i<stuff->count; i++)
98
 
        {
99
 
        swapl(p, n);
 
92
    p = (long *)&stuff[1];
 
93
    for (i = 0; i < stuff->count; i++) {
 
94
        swapl(p, n);
100
95
        p++;
101
 
        }
102
 
    return(ProcXChangeDeviceDontPropagateList(client));
103
96
    }
 
97
    return (ProcXChangeDeviceDontPropagateList(client));
 
98
}
104
99
 
105
100
/***********************************************************************
106
101
 *
109
104
 */
110
105
 
111
106
int
112
 
ProcXChangeDeviceDontPropagateList (client)
113
 
    register ClientPtr client;
114
 
    {
115
 
    int                 i;
116
 
    WindowPtr           pWin;
117
 
    struct              tmask tmp[EMASKSIZE];
118
 
    OtherInputMasks     *others;
 
107
ProcXChangeDeviceDontPropagateList(register ClientPtr client)
 
108
{
 
109
    int i;
 
110
    WindowPtr pWin;
 
111
    struct tmask tmp[EMASKSIZE];
 
112
    OtherInputMasks *others;
119
113
 
120
114
    REQUEST(xChangeDeviceDontPropagateListReq);
121
115
    REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
122
116
 
123
 
    if (stuff->length !=(sizeof(xChangeDeviceDontPropagateListReq)>>2) + 
124
 
        stuff->count)
125
 
        {
126
 
        SendErrorToClient (client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
127
 
            BadLength);
128
 
        return Success;
129
 
        }
130
 
 
131
 
    pWin = (WindowPtr) LookupWindow (stuff->window, client);
132
 
    if (!pWin)
133
 
        {
134
 
        client->errorValue = stuff->window;
135
 
        SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0, 
136
 
                BadWindow);
137
 
        return Success;
138
 
        }
139
 
 
140
 
    if (stuff->mode != AddToList && stuff->mode != DeleteFromList)
141
 
        {
142
 
        client->errorValue = stuff->window;
143
 
        SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0, 
144
 
                BadMode);
145
 
        return Success;
146
 
        }
147
 
 
148
 
    if (CreateMaskFromList (client, (XEventClass *)&stuff[1], 
149
 
        stuff->count, tmp, NULL, X_ChangeDeviceDontPropagateList) != Success)
150
 
            return Success;
 
117
    if (stuff->length != (sizeof(xChangeDeviceDontPropagateListReq) >> 2) +
 
118
        stuff->count) {
 
119
        SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
 
120
                          BadLength);
 
121
        return Success;
 
122
    }
 
123
 
 
124
    pWin = (WindowPtr) LookupWindow(stuff->window, client);
 
125
    if (!pWin) {
 
126
        client->errorValue = stuff->window;
 
127
        SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
 
128
                          BadWindow);
 
129
        return Success;
 
130
    }
 
131
 
 
132
    if (stuff->mode != AddToList && stuff->mode != DeleteFromList) {
 
133
        client->errorValue = stuff->window;
 
134
        SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
 
135
                          BadMode);
 
136
        return Success;
 
137
    }
 
138
 
 
139
    if (CreateMaskFromList(client, (XEventClass *) & stuff[1],
 
140
                           stuff->count, tmp, NULL,
 
141
                           X_ChangeDeviceDontPropagateList) != Success)
 
142
        return Success;
151
143
 
152
144
    others = wOtherInputMasks(pWin);
153
145
    if (!others && stuff->mode == DeleteFromList)
154
146
        return Success;
155
 
    for (i=0; i<EMASKSIZE; i++)
156
 
        {
 
147
    for (i = 0; i < EMASKSIZE; i++) {
157
148
        if (tmp[i].mask == 0)
158
149
            continue;
159
150
 
162
153
        else if (others)
163
154
            tmp[i].mask |= others->dontPropagateMask[i];
164
155
 
165
 
        if (DeviceEventSuppressForWindow (pWin,client,tmp[i].mask,i) != Success)
166
 
            {
167
 
            SendErrorToClient ( client, IReqCode, X_ChangeDeviceDontPropagateList, 0, 
168
 
                BadClass);
 
156
        if (DeviceEventSuppressForWindow(pWin, client, tmp[i].mask, i) !=
 
157
            Success) {
 
158
            SendErrorToClient(client, IReqCode,
 
159
                              X_ChangeDeviceDontPropagateList, 0, BadClass);
169
160
            return Success;
170
 
            }
171
161
        }
 
162
    }
172
163
 
173
164
    return Success;
174
 
    }
 
165
}