Exemple #1
0
static void
SetPanning(XRRScreenResources * xsr, RRCrtc crtc, int on)
{
   XRRPanning         *xpa;

   xpa = XRRGetPanning(disp, xsr, crtc);
   if (!xpa)
      return;

   Dprintf("Panning-A: %d,%d %dx%d trk: %d,%d %dx%d bdr: %d,%d,%d,%d\n",
	   xpa->left, xpa->top, xpa->width, xpa->height,
	   xpa->track_left, xpa->track_top,
	   xpa->track_width, xpa->track_height,
	   xpa->border_left, xpa->border_top,
	   xpa->border_right, xpa->border_bottom);

   xpa->timestamp = EGetTimestamp();
   xpa->left = xpa->top = 0;
   if (on)
     {
	xpa->width = WinGetW(VROOT);
	xpa->height = WinGetH(VROOT);
	xpa->track_width = xpa->track_height = 1;
     }
   else
     {
	xpa->width = xpa->height = 0;
	xpa->track_width = xpa->track_height = 0;
     }
   xpa->track_left = xpa->track_top = 0;
   xpa->border_left = xpa->border_top = 0;
   xpa->border_right = xpa->border_bottom = 0;

   Dprintf("Panning-B: %d,%d %dx%d trk: %d,%d %dx%d bdr: %d,%d,%d,%d\n",
	   xpa->left, xpa->top, xpa->width, xpa->height,
	   xpa->track_left, xpa->track_top,
	   xpa->track_width, xpa->track_height,
	   xpa->border_left, xpa->border_top,
	   xpa->border_right, xpa->border_bottom);

   XRRSetPanning(disp, xsr, crtc, xpa);
   XRRFreePanning(xpa);
}
Exemple #2
0
static crtc_t* createCrtcChain(Display *dpy,
                    XRRScreenResources *resources,
                    RRCrtc customCrtc, XRRCrtcInfo *customCrtcInfo,
                    Rotation customRotation, int customX, int customY, 
                    XRRModeInfo *customModeInfo) 
{
    crtc_t *root_crtc = NULL;
    crtc_t *iter_crtc = NULL;
    int i;
    for(i=0; i<resources->ncrtc; i++) {
        crtc_t *next_crtc = calloc(1, sizeof(crtc_t));
        if( NULL == iter_crtc ) {
            root_crtc = next_crtc;
        } else {
            iter_crtc->next = next_crtc;
        }
        iter_crtc = next_crtc;

        RRCrtc crtcId = resources->crtcs[i];
        iter_crtc->crtc_id = crtcId;
        if( crtcId == customCrtc && 0 != customCrtc ) {
            iter_crtc->rotation = customRotation;
            iter_crtc->x = customX;
            iter_crtc->y = customY;
            iter_crtc->mode_info = customModeInfo;
            iter_crtc->mode_id = customModeInfo->id;
            iter_crtc->crtc_info = customCrtcInfo;
        } else {
            XRRCrtcInfo *xrrCrtcInfo = XRRGetCrtcInfo (dpy, resources, crtcId);
            iter_crtc->rotation = xrrCrtcInfo->rotation;
            iter_crtc->x = xrrCrtcInfo->x;
            iter_crtc->y = xrrCrtcInfo->y;
            iter_crtc->mode_id = xrrCrtcInfo->mode;
            iter_crtc->mode_info = findMode(resources, iter_crtc->mode_id);
            iter_crtc->crtc_info = xrrCrtcInfo;
        }
        iter_crtc->panning_info = XRRGetPanning(dpy, resources, crtcId);
    }
    return root_crtc;
}