Lines Matching defs:monitor
88 RRMonitorSetFromServer(RRCrtcPtr crtc, RRMonitorPtr monitor)
92 monitor->name = RRMonitorCrtcName(crtc);
93 monitor->pScreen = crtc->pScreen;
94 monitor->numOutputs = crtc->numOutputs;
95 monitor->outputs = calloc(crtc->numOutputs, sizeof(RROutput));
96 if (!monitor->outputs)
99 monitor->outputs[o] = crtc->outputs[o]->id;
100 monitor->primary = RRMonitorCrtcPrimary(crtc);
101 monitor->automatic = TRUE;
102 RRMonitorGetCrtcGeometry(crtc, &monitor->geometry);
107 RRMonitorAutomaticGeometry(RRMonitorPtr monitor)
109 return (monitor->geometry.box.x1 == 0 &&
110 monitor->geometry.box.y1 == 0 &&
111 monitor->geometry.box.x2 == 0 &&
112 monitor->geometry.box.y2 == 0);
116 RRMonitorGetGeometry(RRMonitorPtr monitor, RRMonitorGeometryPtr geometry)
118 if (RRMonitorAutomaticGeometry(monitor) && monitor->numOutputs > 0) {
119 ScreenPtr screen = monitor->pScreen;
127 for (o = 0; o < monitor->numOutputs; o++) {
136 if (monitor->outputs[o] == crtc->outputs[co]->id)
163 *geometry = monitor->geometry;
168 RRMonitorSetFromClient(RRMonitorPtr client_monitor, RRMonitorPtr monitor)
170 monitor->name = client_monitor->name;
171 monitor->pScreen = client_monitor->pScreen;
172 monitor->numOutputs = client_monitor->numOutputs;
173 monitor->outputs = calloc(client_monitor->numOutputs, sizeof (RROutput));
174 if (!monitor->outputs && client_monitor->numOutputs)
176 memcpy(monitor->outputs, client_monitor->outputs, client_monitor->numOutputs * sizeof (RROutput));
177 monitor->primary = client_monitor->primary;
178 monitor->automatic = client_monitor->automatic;
179 RRMonitorGetGeometry(client_monitor, &monitor->geometry);
248 RRMonitorPtr monitor = pScrPriv->monitors[m];
252 RRMonitorGetGeometry(monitor, &geom);
259 if (monitor->primary && mon_list->client_primary == -1)
261 for (o = 0; o < monitor->numOutputs; o++) {
267 if (crtc->outputs[co]->id == monitor->outputs[o]) {
277 * those not covered by a client monitor, as well
331 /* Fill in the primary monitor data first
401 RRMonitorFree(RRMonitorPtr monitor)
403 free(monitor);
409 RRMonitorPtr monitor;
411 monitor = calloc(1, sizeof (RRMonitorRec) + noutput * sizeof (RROutput));
412 if (!monitor)
414 monitor->numOutputs = noutput;
415 monitor->outputs = (RROutput *) (monitor + 1);
416 return monitor;
431 RRMonitorPtr monitor = pScrPriv->monitors[m];
432 if (monitor->name == name) {
436 RRMonitorFree(monitor);
463 RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
477 if (RRMonitorMatchesOutputName(screen, monitor->name)) {
478 client->errorValue = monitor->name;
486 if (RRMonitorMatchesOutputName(secondary, monitor->name)) {
487 client->errorValue = monitor->name;
497 if (pScrPriv->monitors[m]->name == monitor->name) {
498 client->errorValue = monitor->name;
525 if (existing->name == monitor->name) {
530 if (monitor->primary)
536 pScrPriv->monitors[pScrPriv->numMonitors++] = monitor;
584 /* XXX should take client monitor changes into account */
639 RRMonitorPtr monitor = &monitors[m];
641 .name = monitor->name,
642 .primary = monitor->primary,
643 .automatic = monitor->automatic,
644 .noutput = monitor->numOutputs,
645 .x = monitor->geometry.box.x1,
646 .y = monitor->geometry.box.y1,
647 .width = monitor->geometry.box.x2 - monitor->geometry.box.x1,
648 .height = monitor->geometry.box.y2 - monitor->geometry.box.y1,
649 .widthInMillimeters = monitor->geometry.mmWidth,
650 .heightInMillimeters = monitor->geometry.mmHeight,
664 WriteSwappedDataToClient(client, monitor->numOutputs * sizeof (RROutput), monitor->outputs);
678 RRMonitorPtr monitor;
683 if (stuff->monitor.noutput != stuff->length - (SIZEOF(xRRSetMonitorReq) >> 2))
691 if (!ValidAtom(stuff->monitor.name))
694 /* Allocate the new monitor */
695 monitor = RRMonitorAlloc(stuff->monitor.noutput);
696 if (!monitor)
700 monitor->pScreen = screen;
701 monitor->name = stuff->monitor.name;
702 monitor->primary = stuff->monitor.primary;
703 monitor->automatic = FALSE;
704 memcpy(monitor->outputs, stuff + 1, stuff->monitor.noutput * sizeof (RROutput));
705 monitor->geometry.box.x1 = stuff->monitor.x;
706 monitor->geometry.box.y1 = stuff->monitor.y;
707 monitor->geometry.box.x2 = stuff->monitor.x + stuff->monitor.width;
708 monitor->geometry.box.y2 = stuff->monitor.y + stuff->monitor.height;
709 monitor->geometry.mmWidth = stuff->monitor.widthInMillimeters;
710 monitor->geometry.mmHeight = stuff->monitor.heightInMillimeters;
712 r = RRMonitorAdd(client, screen, monitor);
716 RRMonitorFree(monitor);