#include "Utils.h" #include #include #include #include #include #include #define DEBUG 0 using namespace net::lliurex::mrpdi; using namespace std; unsigned char Utils::get_iface(unsigned int id,driver_device_info * supported_devices) { int n = 0; unsigned char value=0; while(supported_devices[n].id!=0xffffffff) { if(supported_devices[n].id==id) { value = supported_devices[n].iface; break; } n++; } return value; } void Utils::build_path(unsigned int address,unsigned char iface,char * out) { unsigned int bus,dev; ostringstream path(ostringstream::out); bus=(address & 0x00ff0000)>>16; dev=(address & 0x0000ff00)>>8; path.fill('0'); path.width(4); path<1) return v*ipow(v,n-1); else return v; } CalibrationScreen * CalibrationScreen::instance = NULL; CalibrationScreen * CalibrationScreen::get_CalibrationScreen() { if(CalibrationScreen::instance==NULL) { #if DEBUG cout<<"[CalibrationScreen]: get_CalibrationScreen()"<ncrtc;n++) { crtc_info=XRRGetCrtcInfo(dis,res,res->crtcs[n]); #if DEBUG cout<<"num of crtc: "<width<height<x<y<noutput;m++) { XRROutputInfo * output_info; output_info = XRRGetOutputInfo(dis,res,crtc_info->outputs[m]); #if DEBUG cout<<"\tOutput "<name<connection==RR_Connected) { #if DEBUG cout<<"Found a connected output"<width; height = crtc_info->height; win = XCreateSimpleWindow(dis, XDefaultRootWindow(dis), crtc_info->x, 0, crtc_info->width, height, 0, WhitePixel (dis, 0), WhitePixel(dis, 0)); XSelectInput(dis,win,StructureNotifyMask); XMapWindow(dis, win); gc= XCreateGC(dis, win, 0, NULL); #if DEBUG cout<<"Waiting for:"<0)break; else sleep(1); } } #if DEBUG cout<<"MapNotify received!"<