Lines Matching +full:int +full:- +full:property
28 static int
34 dixLookupResourceByType((void **) &pHead, pWin->drawable.id, in DeliverPropertyEvent()
39 for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { in DeliverPropertyEvent()
40 if (!(pRREvent->mask & RROutputPropertyNotifyMask)) in DeliverPropertyEvent()
43 event->window = pRREvent->window->drawable.id; in DeliverPropertyEvent()
44 WriteEventsToClient(pRREvent->client, 1, (xEvent *) event); in DeliverPropertyEvent()
60 free(prop->valid_values); in RRDestroyOutputProperty()
61 free(prop->current.data); in RRDestroyOutputProperty()
62 free(prop->pending.data); in RRDestroyOutputProperty()
72 .output = output->id, in RRDeleteProperty()
74 .atom = prop->propertyName, in RRDeleteProperty()
78 RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); in RRDeleteProperty()
88 for (prop = output->properties; prop; prop = next) { in RRDeleteAllOutputProperties()
89 next = prop->next; in RRDeleteAllOutputProperties()
97 property_value->type = None; in RRInitOutputPropertyValue()
98 property_value->format = 0; in RRInitOutputPropertyValue()
99 property_value->size = 0; in RRInitOutputPropertyValue()
100 property_value->data = NULL; in RRInitOutputPropertyValue()
104 RRCreateOutputProperty(Atom property) in RRCreateOutputProperty() argument
111 prop->next = NULL; in RRCreateOutputProperty()
112 prop->propertyName = property; in RRCreateOutputProperty()
113 prop->is_pending = FALSE; in RRCreateOutputProperty()
114 prop->range = FALSE; in RRCreateOutputProperty()
115 prop->immutable = FALSE; in RRCreateOutputProperty()
116 prop->num_valid = 0; in RRCreateOutputProperty()
117 prop->valid_values = NULL; in RRCreateOutputProperty()
118 RRInitOutputPropertyValue(&prop->current); in RRCreateOutputProperty()
119 RRInitOutputPropertyValue(&prop->pending); in RRCreateOutputProperty()
124 RRDeleteOutputProperty(RROutputPtr output, Atom property) in RRDeleteOutputProperty() argument
128 for (prev = &output->properties; (prop = *prev); prev = &(prop->next)) in RRDeleteOutputProperty()
129 if (prop->propertyName == property) { in RRDeleteOutputProperty()
130 *prev = prop->next; in RRDeleteOutputProperty()
137 RRNoticePropertyChange(RROutputPtr output, Atom property, RRPropertyValuePtr value) in RRNoticePropertyChange() argument
142 if (property == non_desktop_prop) { in RRNoticePropertyChange()
143 if (value->type == XA_INTEGER && value->format == 32 && value->size >= 1) { in RRNoticePropertyChange()
147 memcpy(&nonDesktopData, value->data, sizeof (nonDesktopData)); in RRNoticePropertyChange()
150 if (nonDesktop != output->nonDesktop) { in RRNoticePropertyChange()
151 output->nonDesktop = nonDesktop; in RRNoticePropertyChange()
153 RRTellChanged(output->pScreen); in RRNoticePropertyChange()
159 int
160 RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, in RRChangeOutputProperty() argument
161 int format, int mode, unsigned long len, in RRChangeOutputProperty()
165 rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); in RRChangeOutputProperty()
166 int size_in_bytes; in RRChangeOutputProperty()
174 /* first see if property already exists */ in RRChangeOutputProperty()
175 prop = RRQueryOutputProperty(output, property); in RRChangeOutputProperty()
177 prop = RRCreateOutputProperty(property); in RRChangeOutputProperty()
183 if (pending && prop->is_pending) in RRChangeOutputProperty()
184 prop_value = &prop->pending; in RRChangeOutputProperty()
186 prop_value = &prop->current; in RRChangeOutputProperty()
188 /* To append or prepend to a property the request format and type in RRChangeOutputProperty()
189 must match those of the already defined property. The in RRChangeOutputProperty()
193 if ((format != prop_value->format) && (mode != PropModeReplace)) in RRChangeOutputProperty()
195 if ((prop_value->type != type) && (mode != PropModeReplace)) in RRChangeOutputProperty()
201 total_len = prop_value->size + len; in RRChangeOutputProperty()
223 (prop_value->size * size_in_bytes)); in RRChangeOutputProperty()
229 (prop_value->size * size_in_bytes)); in RRChangeOutputProperty()
235 memcpy((char *) old_data, (char *) prop_value->data, in RRChangeOutputProperty()
236 prop_value->size * size_in_bytes); in RRChangeOutputProperty()
238 if (pending && pScrPriv->rrOutputSetProperty && in RRChangeOutputProperty()
239 !pScrPriv->rrOutputSetProperty(output->pScreen, output, in RRChangeOutputProperty()
240 prop->propertyName, &new_value)) { in RRChangeOutputProperty()
246 free(prop_value->data); in RRChangeOutputProperty()
255 prop->next = output->properties; in RRChangeOutputProperty()
256 output->properties = prop; in RRChangeOutputProperty()
259 if (pending && prop->is_pending) in RRChangeOutputProperty()
260 output->pendingProperties = TRUE; in RRChangeOutputProperty()
262 if (!(pending && prop->is_pending)) in RRChangeOutputProperty()
263 RRNoticePropertyChange(output, prop->propertyName, prop_value); in RRChangeOutputProperty()
269 .output = output->id, in RRChangeOutputProperty()
271 .atom = prop->propertyName, in RRChangeOutputProperty()
274 RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); in RRChangeOutputProperty()
284 RRPropertyPtr property; in RRPostPendingProperties() local
287 if (!output->pendingProperties) in RRPostPendingProperties()
290 output->pendingProperties = FALSE; in RRPostPendingProperties()
291 for (property = output->properties; property; property = property->next) { in RRPostPendingProperties()
292 /* Skip non-pending properties */ in RRPostPendingProperties()
293 if (!property->is_pending) in RRPostPendingProperties()
296 pending_value = &property->pending; in RRPostPendingProperties()
297 current_value = &property->current; in RRPostPendingProperties()
303 if (pending_value->type == current_value->type && in RRPostPendingProperties()
304 pending_value->format == current_value->format && in RRPostPendingProperties()
305 pending_value->size == current_value->size && in RRPostPendingProperties()
306 !memcmp(pending_value->data, current_value->data, in RRPostPendingProperties()
307 pending_value->size * (pending_value->format / 8))) in RRPostPendingProperties()
310 if (RRChangeOutputProperty(output, property->propertyName, in RRPostPendingProperties()
311 pending_value->type, pending_value->format, in RRPostPendingProperties()
312 PropModeReplace, pending_value->size, in RRPostPendingProperties()
313 pending_value->data, TRUE, FALSE) != Success) in RRPostPendingProperties()
320 RRQueryOutputProperty(RROutputPtr output, Atom property) in RRQueryOutputProperty() argument
324 for (prop = output->properties; prop; prop = prop->next) in RRQueryOutputProperty()
325 if (prop->propertyName == property) in RRQueryOutputProperty()
331 RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending) in RRGetOutputProperty() argument
333 RRPropertyPtr prop = RRQueryOutputProperty(output, property); in RRGetOutputProperty()
334 rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); in RRGetOutputProperty()
338 if (pending && prop->is_pending) in RRGetOutputProperty()
339 return &prop->pending; in RRGetOutputProperty()
342 /* If we can, try to update the property value first */ in RRGetOutputProperty()
343 if (pScrPriv->rrOutputGetProperty) in RRGetOutputProperty()
344 pScrPriv->rrOutputGetProperty(output->pScreen, output, in RRGetOutputProperty()
345 prop->propertyName); in RRGetOutputProperty()
347 return &prop->current; in RRGetOutputProperty()
351 int
352 RRConfigureOutputProperty(RROutputPtr output, Atom property, in RRConfigureOutputProperty() argument
354 int num_values, const INT32 *values) in RRConfigureOutputProperty()
356 RRPropertyPtr prop = RRQueryOutputProperty(output, property); in RRConfigureOutputProperty()
361 prop = RRCreateOutputProperty(property); in RRConfigureOutputProperty()
366 else if (prop->immutable && !immutable) in RRConfigureOutputProperty()
388 * Property moving from pending to non-pending in RRConfigureOutputProperty()
391 if (prop->is_pending && !pending) { in RRConfigureOutputProperty()
392 free(prop->pending.data); in RRConfigureOutputProperty()
393 RRInitOutputPropertyValue(&prop->pending); in RRConfigureOutputProperty()
396 prop->is_pending = pending; in RRConfigureOutputProperty()
397 prop->range = range; in RRConfigureOutputProperty()
398 prop->immutable = immutable; in RRConfigureOutputProperty()
399 prop->num_valid = num_values; in RRConfigureOutputProperty()
400 free(prop->valid_values); in RRConfigureOutputProperty()
401 prop->valid_values = new_values; in RRConfigureOutputProperty()
404 prop->next = output->properties; in RRConfigureOutputProperty()
405 output->properties = prop; in RRConfigureOutputProperty()
411 int
417 int numProps = 0; in ProcRRListOutputProperties()
423 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); in ProcRRListOutputProperties()
425 for (prop = output->properties; prop; prop = prop->next) in ProcRRListOutputProperties()
433 .sequenceNumber = client->sequence, in ProcRRListOutputProperties()
437 if (client->swapped) { in ProcRRListOutputProperties()
445 /* Copy property name atoms to reply buffer */ in ProcRRListOutputProperties()
447 for (prop = output->properties; prop; prop = prop->next) in ProcRRListOutputProperties()
448 *temppAtoms++ = prop->propertyName; in ProcRRListOutputProperties()
450 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcRRListOutputProperties()
457 int
468 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); in ProcRRQueryOutputProperty()
470 prop = RRQueryOutputProperty(output, stuff->property); in ProcRRQueryOutputProperty()
474 if (prop->num_valid) { in ProcRRQueryOutputProperty()
475 extra = xallocarray(prop->num_valid, sizeof(INT32)); in ProcRRQueryOutputProperty()
482 .sequenceNumber = client->sequence, in ProcRRQueryOutputProperty()
483 .length = prop->num_valid, in ProcRRQueryOutputProperty()
484 .pending = prop->is_pending, in ProcRRQueryOutputProperty()
485 .range = prop->range, in ProcRRQueryOutputProperty()
486 .immutable = prop->immutable in ProcRRQueryOutputProperty()
489 if (client->swapped) { in ProcRRQueryOutputProperty()
494 if (prop->num_valid) { in ProcRRQueryOutputProperty()
495 memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); in ProcRRQueryOutputProperty()
496 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcRRQueryOutputProperty()
497 WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), in ProcRRQueryOutputProperty()
504 int
509 int num_valid; in ProcRRConfigureOutputProperty()
513 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); in ProcRRConfigureOutputProperty()
519 stuff->length - bytes_to_int32(sizeof(xRRConfigureOutputPropertyReq)); in ProcRRConfigureOutputProperty()
520 return RRConfigureOutputProperty(output, stuff->property, stuff->pending, in ProcRRConfigureOutputProperty()
521 stuff->range, FALSE, num_valid, in ProcRRConfigureOutputProperty()
525 int
532 int sizeInBytes; in ProcRRChangeOutputProperty()
533 int totalSize; in ProcRRChangeOutputProperty()
534 int err; in ProcRRChangeOutputProperty()
538 format = stuff->format; in ProcRRChangeOutputProperty()
539 mode = stuff->mode; in ProcRRChangeOutputProperty()
542 client->errorValue = mode; in ProcRRChangeOutputProperty()
546 client->errorValue = format; in ProcRRChangeOutputProperty()
549 len = stuff->nUnits; in ProcRRChangeOutputProperty()
550 if (len > bytes_to_int32((0xffffffff - sizeof(xChangePropertyReq)))) in ProcRRChangeOutputProperty()
556 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); in ProcRRChangeOutputProperty()
558 if (!ValidAtom(stuff->property)) { in ProcRRChangeOutputProperty()
559 client->errorValue = stuff->property; in ProcRRChangeOutputProperty()
562 if (!ValidAtom(stuff->type)) { in ProcRRChangeOutputProperty()
563 client->errorValue = stuff->type; in ProcRRChangeOutputProperty()
567 err = RRChangeOutputProperty(output, stuff->property, in ProcRRChangeOutputProperty()
568 stuff->type, (int) format, in ProcRRChangeOutputProperty()
569 (int) mode, len, (void *) &stuff[1], TRUE, in ProcRRChangeOutputProperty()
577 int
586 VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); in ProcRRDeleteOutputProperty()
591 if (!ValidAtom(stuff->property)) { in ProcRRDeleteOutputProperty()
592 client->errorValue = stuff->property; in ProcRRDeleteOutputProperty()
596 prop = RRQueryOutputProperty(output, stuff->property); in ProcRRDeleteOutputProperty()
598 client->errorValue = stuff->property; in ProcRRDeleteOutputProperty()
602 if (prop->immutable) { in ProcRRDeleteOutputProperty()
603 client->errorValue = stuff->property; in ProcRRDeleteOutputProperty()
607 RRDeleteOutputProperty(output, stuff->property); in ProcRRDeleteOutputProperty()
611 int
623 if (stuff->delete) in ProcRRGetOutputProperty()
625 VERIFY_RR_OUTPUT(stuff->output, output, in ProcRRGetOutputProperty()
626 stuff->delete ? DixWriteAccess : DixReadAccess); in ProcRRGetOutputProperty()
628 if (!ValidAtom(stuff->property)) { in ProcRRGetOutputProperty()
629 client->errorValue = stuff->property; in ProcRRGetOutputProperty()
632 if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) { in ProcRRGetOutputProperty()
633 client->errorValue = stuff->delete; in ProcRRGetOutputProperty()
636 if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) { in ProcRRGetOutputProperty()
637 client->errorValue = stuff->type; in ProcRRGetOutputProperty()
641 for (prev = &output->properties; (prop = *prev); prev = &prop->next) in ProcRRGetOutputProperty()
642 if (prop->propertyName == stuff->property) in ProcRRGetOutputProperty()
647 .sequenceNumber = client->sequence in ProcRRGetOutputProperty()
655 if (client->swapped) { in ProcRRGetOutputProperty()
666 if (prop->immutable && stuff->delete) in ProcRRGetOutputProperty()
669 prop_value = RRGetOutputProperty(output, stuff->property, stuff->pending); in ProcRRGetOutputProperty()
674 property information, but not the data. */ in ProcRRGetOutputProperty()
676 if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType)) in ProcRRGetOutputProperty()
678 reply.bytesAfter = prop_value->size; in ProcRRGetOutputProperty()
679 reply.format = prop_value->format; in ProcRRGetOutputProperty()
682 reply.propertyType = prop_value->type; in ProcRRGetOutputProperty()
683 if (client->swapped) { in ProcRRGetOutputProperty()
697 n = (prop_value->format / 8) * prop_value->size; /* size (bytes) of prop */ in ProcRRGetOutputProperty()
698 ind = stuff->longOffset << 2; in ProcRRGetOutputProperty()
704 client->errorValue = stuff->longOffset; in ProcRRGetOutputProperty()
708 len = min(n - ind, 4 * stuff->longLength); in ProcRRGetOutputProperty()
715 reply.bytesAfter = n - (ind + len); in ProcRRGetOutputProperty()
716 reply.format = prop_value->format; in ProcRRGetOutputProperty()
718 if (prop_value->format) in ProcRRGetOutputProperty()
719 reply.nItems = len / (prop_value->format / 8); in ProcRRGetOutputProperty()
722 reply.propertyType = prop_value->type; in ProcRRGetOutputProperty()
724 if (stuff->delete && (reply.bytesAfter == 0)) { in ProcRRGetOutputProperty()
728 .output = output->id, in ProcRRGetOutputProperty()
730 .atom = prop->propertyName, in ProcRRGetOutputProperty()
733 RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); in ProcRRGetOutputProperty()
736 if (client->swapped) { in ProcRRGetOutputProperty()
745 memcpy(extra, (char *) prop_value->data + ind, len); in ProcRRGetOutputProperty()
748 client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; in ProcRRGetOutputProperty()
751 client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; in ProcRRGetOutputProperty()
754 client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient; in ProcRRGetOutputProperty()
761 if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ in ProcRRGetOutputProperty()
762 *prev = prop->next; in ProcRRGetOutputProperty()