亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qgfxlinuxfb_qws.cpp

?? qte2.3.2版本,但是里面沒有configure文件.需要重新添加
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* $Id: qt/src/kernel/qgfxlinuxfb_qws.cpp   2.3.2   edited 2001-10-08 $**** Implementation of QLinuxFbScreen (unaccelerated Linux framebuffer) class for** Embedded Qt** Created : 940721**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the kernel module of the Qt GUI Toolkit.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses for Qt/Embedded may use this file in accordance with the** Qt Embedded Commercial License Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "qgfxraster_qws.h"#include "qmemorymanager_qws.h"#include "qwsdisplay_qws.h"#include "qpixmap.h"#include <unistd.h>#include <sys/ioctl.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/mman.h>#include <fcntl.h>#include <errno.h>#include "qgfxlinuxfb_qws.h"#include "qwindowsystem_qws.h"// Used when there's no hardware acceleration, since there's no point// in storing the state in shared memorystatic int dummy_optype = 0;static int dummy_lastop = 0;/*!  \class QLinuxFbScreen  \brief QLinuxFbScreen manages the Linux framebuffer. Accelerated drivers  for Linux should inherit from it; it contains code for reading information  about the framebuffer from the Linux framebuffer interface, managing  the color palette, managing offscreen graphics memory and mapping the   framebuffer interface itself, removing the need for drivers to do this.  It also acts as a factory for the unaccelerated screen cursor and  unaccelerated QGfxes. QLinuxFbScreen is a descendant of QScreen;  there is precisely one per Qt/Embedded application.*/// Unaccelerated screen/driver setup. Can be overridden by accelerated// drivers/*!  \fn QLinuxFbScreen::QLinuxFbScreen( int display_id   Constructs a QLinuxFbScreen.*/QLinuxFbScreen::QLinuxFbScreen( int display_id ) : QScreen( display_id ){    canaccel=false;}/*!  \fn QLinuxFbScreen::~QLinuxFbScreen()  Destroys a QLinuxFbScreen.*/QLinuxFbScreen::~QLinuxFbScreen(){}/*!  \fn bool QLinuxFbScreen::connect( const QString &displaySpec )  This is called by Qt/Embedded clients to map in the framebuffer.  It should be reimplemented by accelerated drivers to map in graphics  card registers; those drivers should then call this method in order to set   up offscreen memory management.*/bool QLinuxFbScreen::connect( const QString &displaySpec ){    // Check for explicitly specified device    QRegExp r( "/dev/fb[0-9]+" );    int len;    int m = r.match( displaySpec, 0, &len );    QString dev = (m>=0) ? displaySpec.mid( m, len ) : QString("/dev/fb0");    fd=open( dev.latin1(), O_RDWR );    if (fd<0) {	qWarning("Can't open framebuffer device %s",dev.latin1());	return FALSE;    }    fb_fix_screeninfo finfo;    fb_var_screeninfo vinfo;    /* Get fixed screen information */    if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) {	perror("reading /dev/fb0");	qWarning("Error reading fixed information");	return FALSE;    }    /* Get variable screen information */    if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) {	perror("reading /dev/fb0");	qWarning("Error reading variable information");	return FALSE;    }    d=vinfo.bits_per_pixel;    lstep=finfo.line_length;    int xoff = vinfo.xoffset;    int yoff = vinfo.yoffset;    const char* qwssize;    if((qwssize=getenv("QWS_SIZE"))) {	sscanf(qwssize,"%dx%d",&w,&h);	if ( (uint)w > vinfo.xres ) w = vinfo.xres;	if ( (uint)h > vinfo.xres ) h = vinfo.yres;	dw=w;	dh=h;	xoff += (vinfo.xres - w)/2;	yoff += (vinfo.yres - h)/2;    } else {	dw=w=vinfo.xres;	dh=h=vinfo.yres;    }    dataoffset = yoff * lstep + xoff * d / 8;    //qDebug("Using %dx%dx%d screen",w,h,d);    /* Figure out the size of the screen in bytes */    size = h * lstep;    //    qDebug("Framebuffer base at %lx",finfo.smem_start);    //    qDebug("Registers base %lx",finfo.mmio_start);    mapsize=finfo.smem_len;    data = (unsigned char *)mmap(0, mapsize, PROT_READ | PROT_WRITE,				 MAP_SHARED, fd, 0);    data += dataoffset;    #ifdef QT_QWS_PSION    data += 32;    #endif    if ((int)data == -1) {	perror("mapping /dev/fb0");	qWarning("Error: failed to map framebuffer device to memory.");	return FALSE;    }    canaccel=useOffscreen();    if(mapsize-size<16384) {	canaccel=false;    }    if(canaccel) {	// Figure out position of offscreen memory	// Fetch size of pool entries table from memory	// Set up pool entries pointer table and 64-bit align it	int pos=(int)data;	pos+=size;	pos+=4096;	pos+=8;	pos&=~0x7;	entryp=((int *)pos);	lowest=((unsigned int *)pos)+1;	optype=((int *)pos)+2;	lastop=((int *)pos)+3;	pos+=(sizeof(int))*4;	entries=(QPoolEntry *)pos;    } else {	optype = &dummy_optype;	lastop = &dummy_lastop;    }    // Now read in palette    if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4)) {	screencols= (vinfo.bits_per_pixel==8) ? 256 : 16;	int loopc;	startcmap = new fb_cmap;	startcmap->start=0;	startcmap->len=screencols;	startcmap->red=(unsigned short int *)		 malloc(sizeof(unsigned short int)*screencols);	startcmap->green=(unsigned short int *)		   malloc(sizeof(unsigned short int)*screencols);	startcmap->blue=(unsigned short int *)		  malloc(sizeof(unsigned short int)*screencols);	startcmap->transp=(unsigned short int *)		    malloc(sizeof(unsigned short int)*screencols);	ioctl(fd,FBIOGETCMAP,startcmap);	for(loopc=0;loopc<screencols;loopc++) {	    screenclut[loopc]=qRgb(startcmap->red[loopc] >> 8,				   startcmap->green[loopc] >> 8,				   startcmap->blue[loopc] >> 8);	}    } else {	screencols=0;    }    initted=true;    return TRUE;}/*!\fn void QLinuxFbScreen::disconnect()This simply unmaps the framebuffer*/void QLinuxFbScreen::disconnect(){    data -= dataoffset;    munmap((char*)data,mapsize);    close(fd);}//#define DEBUG_VINFOstatic void writeTerm(const char* termctl, int sizeof_termctl){    const char* tt[]={"/dev/console","/dev/tty","/dev/tty0",0};    const char** dev=tt;    while (*dev) {	int tty=::open(*dev,O_WRONLY);	if ( tty>=0 ) {	    ::write(tty,termctl,sizeof_termctl);	    ::close(tty);	}	dev++;    }}/*!\fn bool QLinuxFbScreen::initDevice()This is called by the Qt/Embedded server at startup time.It turns off console blinking, sets up the color palette, enableswrite combining on the framebuffer and initialises the offscreenmemory manager.*/bool QLinuxFbScreen::initDevice(){    // No blankin' screen, no blinkin' cursor!, no cursor!    const char termctl[]="\033[9;0]\033[?33l\033[?25l";    writeTerm(termctl,sizeof(termctl));    // Grab current mode so we can reset it    fb_var_screeninfo vinfo;    fb_fix_screeninfo finfo;    if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) {	qFatal("Error reading variable information in card init");	return false;    }#ifdef DEBUG_VINFO    qDebug("Greyscale %d",vinfo.grayscale);    qDebug("Nonstd %d",vinfo.nonstd);    qDebug("Red %d %d %d",vinfo.red.offset,vinfo.red.length,	   vinfo.red.msb_right);    qDebug("Green %d %d %d",vinfo.green.offset,vinfo.green.length,	   vinfo.green.msb_right);    qDebug("Blue %d %d %d",vinfo.blue.offset,vinfo.blue.length,	   vinfo.blue.msb_right);    qDebug("Transparent %d %d %d",vinfo.transp.offset,vinfo.transp.length,	   vinfo.transp.msb_right);#endif    startupw=vinfo.xres;    startuph=vinfo.yres;    startupd=vinfo.bits_per_pixel;    if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) {	qFatal("Error reading fixed information in card init");	// It's not an /error/ as such, though definitely a bad sign	// so we return true	return true;    }#ifdef __i386__    // Now init mtrr    if(!getenv("QWS_NOMTRR")) {	int mfd=open("/proc/mtrr",O_WRONLY,0);	// MTRR entry goes away when file is closed - i.e.	// hopefully when QWS is killed	if(mfd==-1) {	    // /proc/mtrr not writable - oh well.	} else {	    mtrr_sentry sentry;	    sentry.base=(unsigned long int)finfo.smem_start;	    //qDebug("Physical framebuffer address %p",(void*)finfo.smem_start);	    // Size needs to be in 4k chunks, but that's not always	    // what we get thanks to graphics card registers. Write combining	    // these is Not Good, so we write combine what we can	    // (which is not much - 4 megs on an 8 meg card, it seems)	    unsigned int size=finfo.smem_len;	    size=size >> 22;	    size=size << 22;	    sentry.size=size;	    sentry.type=MTRR_TYPE_WRCOMB;	    if(ioctl(mfd,MTRRIOC_ADD_ENTRY,&sentry)==-1) {		//printf("Couldn't add mtrr entry for %lx %lx, %s\n",		       //sentry.base,sentry.size,strerror(errno));	    }	}    }#endif    if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4)) {	screencols= (vinfo.bits_per_pixel==8) ? 256 : 16;	fb_cmap cmap;	cmap.start=0;	cmap.len=screencols;	cmap.red=(unsigned short int *)		 malloc(sizeof(unsigned short int)*screencols);	cmap.green=(unsigned short int *)		   malloc(sizeof(unsigned short int)*screencols);	cmap.blue=(unsigned short int *)		  malloc(sizeof(unsigned short int)*screencols);	cmap.transp=(unsigned short int *)		    malloc(sizeof(unsigned short int)*screencols);		if (screencols==16) {	    if ( finfo.type == FB_TYPE_PACKED_PIXELS ) {		// We'll setup a greyscale cmap for 4bpp linear		int val = 0;		for (int idx = 0; idx < 16; idx++, val += 17) {		    cmap.red[idx] = (val<<8)|val;		    cmap.green[idx] = (val<<8)|val;		    cmap.blue[idx] = (val<<8)|val;		    screenclut[idx]=qRgb( val, val, val );		}	    } else {		// Default 16 colour palette		// Green is now trolltech green so certain images look nicer 		//			     black  d_grey l_grey white  red  green  blue cyan magenta yellow		unsigned char reds[16]   = { 0x00, 0x7F, 0xBF, 0xFF, 0xFF, 0xA2, 0x00, 0xFF, 0xFF, 0x00, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x82 };		unsigned char greens[16] = { 0x00, 0x7F, 0xBF, 0xFF, 0x00, 0xC5, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F };		unsigned char blues[16]  = { 0x00, 0x7F, 0xBF, 0xFF, 0x00, 0x11, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x7F, 0x7F, 0x7F, 0x00, 0x00 };		for (int idx = 0; idx < 16; idx++) {		    cmap.red[idx] = ((reds[idx]) << 8)|reds[idx];		    cmap.green[idx] = ((greens[idx]) << 8)|greens[idx];		    cmap.blue[idx] = ((blues[idx]) << 8)|blues[idx];		    cmap.transp[idx] = 0;		    screenclut[idx]=qRgb( reds[idx], greens[idx], blues[idx] );		}	    }	} else {#ifndef QT_NO_QWS_DEPTH_8GRAYSCALE	    // Build greyscale palette	    unsigned int loopc;	    for(loopc=0;loopc<256;loopc++) {		cmap.red[loopc]=loopc << 8;		cmap.green[loopc]=loopc << 8;		cmap.blue[loopc]=loopc << 8;		cmap.transp[loopc]=0;		screenclut[loopc]=qRgb(loopc,loopc,loopc);	    }#else	    // 6x6x6 216 color cube	    int idx = 0;	    for( int ir = 0x0; ir <= 0xff; ir+=0x33 ) {		for( int ig = 0x0; ig <= 0xff; ig+=0x33 ) {		    for( int ib = 0x0; ib <= 0xff; ib+=0x33 ) {			cmap.red[idx] = (ir << 8)|ir;			cmap.green[idx] = (ig << 8)|ig;			cmap.blue[idx] = (ib << 8)|ib;			cmap.transp[idx] = 0;			screenclut[idx]=qRgb( ir, ig, ib );			idx++;		    }		}	    }	    // Fill in rest with 0	    for ( int loopc=0; loopc<40; loopc++ ) {		screenclut[idx]=0;		idx++;	    }	    screencols=idx;#endif	}		ioctl(fd,FBIOPUTCMAP,&cmap);	free(cmap.red);	free(cmap.green);	free(cmap.blue);	free(cmap.transp);    } else if(finfo.visual==FB_VISUAL_DIRECTCOLOR) {	screencols=256;	fb_cmap cmap;	cmap.start=0;	int rbits=0,gbits=0,bbits=0;	switch (vinfo.bits_per_pixel) {	  case 8:		rbits=vinfo.red.length;		gbits=vinfo.green.length;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产另类ts人妖一区二区| 色婷婷亚洲精品| 91在线视频免费91| 欧美一区二区精品在线| 亚洲国产电影在线观看| 亚洲大型综合色站| 国产精品自拍网站| 欧美日本在线一区| 中文字幕中文字幕中文字幕亚洲无线| 亚洲h动漫在线| 91在线国内视频| 久久五月婷婷丁香社区| 亚洲国产成人高清精品| 成人app软件下载大全免费| 日韩无一区二区| 午夜视频一区二区三区| 色哟哟精品一区| 亚洲国产成人一区二区三区| 精品亚洲国产成人av制服丝袜| 欧美视频日韩视频在线观看| 成人免费在线观看入口| 国产aⅴ综合色| 精品日本一线二线三线不卡| 秋霞午夜av一区二区三区| 欧美无砖砖区免费| 亚洲综合激情另类小说区| 99久久99久久免费精品蜜臀| 中文字幕在线观看不卡视频| 国产成人av电影在线| 久久久三级国产网站| 国产一区二区三区免费| 精品国产乱码久久久久久免费| 蜜臀久久99精品久久久久久9| 欧美日韩电影在线播放| 丝袜亚洲另类欧美综合| 欧美日本乱大交xxxxx| 亚洲成人自拍偷拍| 欧美日韩国产综合一区二区| 午夜国产不卡在线观看视频| 欧美日韩视频在线第一区| 亚洲高清在线精品| 在线播放一区二区三区| 全国精品久久少妇| 欧美大胆一级视频| 国产在线精品一区在线观看麻豆| 精品处破学生在线二十三| 国产精品一区二区在线观看不卡 | 久久综合九色综合欧美98| 麻豆精品视频在线观看视频| 精品日产卡一卡二卡麻豆| 国产在线国偷精品免费看| 久久综合久久综合亚洲| 国产91清纯白嫩初高中在线观看| 国产精品电影一区二区| 日本乱人伦一区| 首页欧美精品中文字幕| 精品国产一区二区三区忘忧草| 国产成人免费av在线| 亚洲视频中文字幕| 91精品免费观看| 国产精品18久久久久久vr| 亚洲视频在线观看一区| 91精品国产综合久久久蜜臀图片 | 精品日韩av一区二区| 国产精品综合视频| 一区二区三区小说| 91精品国产色综合久久| 国产 日韩 欧美大片| 一级女性全黄久久生活片免费| 日韩视频免费观看高清完整版 | 久久国产综合精品| 欧美激情在线一区二区三区| 欧洲亚洲精品在线| 久久99精品国产91久久来源| 中文字幕一区二区三区蜜月| 欧美精品 日韩| 成人av电影免费在线播放| 青草av.久久免费一区| 国产日韩精品久久久| 欧美日韩中文字幕一区二区| 国产精品一级在线| 亚洲电影第三页| 国产精品色一区二区三区| 欧美伊人久久久久久午夜久久久久| 精品一区二区影视| 亚洲国产一区视频| 国产欧美视频一区二区| 在线不卡a资源高清| 99免费精品视频| 久久国产夜色精品鲁鲁99| 亚洲制服欧美中文字幕中文字幕| 国产欧美精品一区| 91精品国产丝袜白色高跟鞋| 色婷婷国产精品| 国产精品资源在线看| 天使萌一区二区三区免费观看| 亚洲视频一区在线| 久久久久久久久99精品| 欧美一区二区美女| 精品视频免费在线| 91视视频在线观看入口直接观看www | 午夜精品福利在线| 日韩美女视频一区| 国产丝袜美腿一区二区三区| 欧美一区二区女人| 欧美嫩在线观看| 欧美丝袜丝交足nylons图片| 91丨porny丨蝌蚪视频| 懂色av中文一区二区三区| 极品少妇xxxx精品少妇| 亚洲.国产.中文慕字在线| 一区二区三区精品视频| 亚洲欧美福利一区二区| 国产精品久久毛片a| 国产日韩欧美不卡| 欧美激情中文字幕| 中文字幕精品在线不卡| 久久精品一区二区三区不卡 | 国产精品灌醉下药二区| 亚洲国产精品99久久久久久久久| 久久久精品人体av艺术| 国产偷国产偷精品高清尤物| 中文字幕 久热精品 视频在线| 中文字幕第一页久久| 国产精品欧美一区二区三区| 国产精品久久久久精k8 | 成人激情图片网| 99久久综合国产精品| 99re成人精品视频| 欧洲av一区二区嗯嗯嗯啊| 欧美日韩二区三区| 欧美一区二区三区喷汁尤物| 欧美一级生活片| 26uuu国产一区二区三区| 久久综合九色欧美综合狠狠| 国产欧美日韩视频一区二区| 亚洲三级在线看| 亚洲成av人片在线| 日本欧美一区二区| 国产乱人伦偷精品视频不卡| 99久久婷婷国产| 欧美日韩aaa| 久久精品人人做人人综合| 国产精品麻豆一区二区| 亚洲美女屁股眼交| 日韩成人一区二区三区在线观看| 国产在线精品一区二区不卡了| 91在线观看下载| 欧美精品丝袜中出| 久久先锋影音av鲁色资源网| 亚洲视频在线观看三级| 日韩中文字幕亚洲一区二区va在线 | 国产精品美女久久久久高潮| 一区二区三区成人| 喷水一区二区三区| www.亚洲色图| 9191久久久久久久久久久| 久久久亚洲高清| 午夜成人在线视频| 丁香天五香天堂综合| 欧美日韩国产精选| 中文字幕精品一区二区三区精品 | 亚洲欧美激情插| 激情综合五月天| 色狠狠av一区二区三区| 欧美成人在线直播| 亚洲精品日韩专区silk| 国内成+人亚洲+欧美+综合在线 | 大白屁股一区二区视频| 欧美精品tushy高清| 国产精品免费av| 美国三级日本三级久久99| 99re免费视频精品全部| 久久久久久久久久久久久久久99 | 国产成人综合在线| 精品视频免费在线| 国产精品久久看| 国产一区二区主播在线| 欧美挠脚心视频网站| 伊人婷婷欧美激情| 国产麻豆午夜三级精品| 欧美精品丝袜久久久中文字幕| 亚洲精品美国一| 不卡视频一二三四| 久久久不卡网国产精品二区| 日本视频免费一区| 欧美另类一区二区三区| 一区二区在线免费| 99精品视频一区| 亚洲欧美在线视频| 成人久久18免费网站麻豆| 日韩欧美中文字幕公布| 五月开心婷婷久久| 欧美性极品少妇| 一区二区不卡在线视频 午夜欧美不卡在| 国产不卡视频在线观看| 26uuu成人网一区二区三区| 精品一区二区三区不卡 | 乱一区二区av| 日韩一区二区三区视频|