亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产丝袜欧美中文另类| 国产亚洲女人久久久久毛片| 九九国产精品视频| 亚洲日本一区二区| 欧美xfplay| 在线观看免费成人| 成人激情黄色小说| 久草这里只有精品视频| 亚洲福利视频一区| 中文字幕日韩av资源站| 久久精品视频一区| 日韩欧美一区二区免费| 欧美日韩亚洲综合| 色88888久久久久久影院野外| 国产在线看一区| 久久www免费人成看片高清| 天堂精品中文字幕在线| 亚洲综合视频网| 亚洲视频一二三| 中文字幕av一区二区三区免费看| 精品电影一区二区三区| 欧美成人乱码一区二区三区| 欧美日韩视频在线第一区| 91蜜桃网址入口| 91在线云播放| 99国产欧美另类久久久精品| 成人免费毛片app| 国产精品自拍av| 国产精品一区2区| 国产毛片精品国产一区二区三区| 精品亚洲国内自在自线福利| 麻豆91在线观看| 蜜臀av性久久久久蜜臀aⅴ| 午夜天堂影视香蕉久久| 亚洲第一综合色| 偷偷要91色婷婷| 日本成人在线视频网站| 免费在线观看视频一区| 免费不卡在线观看| 日本欧美加勒比视频| 麻豆精品久久久| 国产精品一二一区| 成人h版在线观看| 91视视频在线直接观看在线看网页在线看| 成人免费观看视频| 国产欧美一区二区三区鸳鸯浴 | 国产精品网友自拍| 国产欧美一区二区精品性| 日本一区二区三区久久久久久久久不| 久久久精品综合| 中文字幕av一区二区三区免费看| 成人免费小视频| 亚洲动漫第一页| 强制捆绑调教一区二区| 久久se精品一区精品二区| 国产精品1024| 色综合久久久网| 欧美日韩国产首页在线观看| 欧美r级在线观看| 欧美国产精品劲爆| 一区二区三区电影在线播| 天天亚洲美女在线视频| 麻豆精品国产传媒mv男同| 国产精品18久久久久久久网站| 成人教育av在线| 欧美日韩国产小视频| 久久亚洲精精品中文字幕早川悠里| 欧美高清在线精品一区| 亚洲综合丁香婷婷六月香| 青青草国产精品亚洲专区无| 高清不卡在线观看av| 91福利视频网站| 欧美va天堂va视频va在线| 国产精品网站一区| 日本欧美久久久久免费播放网| 国产69精品久久99不卡| 欧美在线你懂的| 久久亚洲一区二区三区四区| 综合久久久久久久| 91精品欧美福利在线观看| 久久毛片高清国产| 一区二区三区在线免费| 麻豆国产精品官网| 色婷婷精品久久二区二区蜜臀av| 日韩欧美一级二级| 亚洲乱码中文字幕| 国精品**一区二区三区在线蜜桃| 91福利国产成人精品照片| 欧美xxxxxxxxx| 亚洲一区二区三区三| 国产精品夜夜嗨| 欧美肥妇bbw| 亚洲精品国产成人久久av盗摄| 寂寞少妇一区二区三区| 91麻豆视频网站| 久久久久久久久久久久电影| 性做久久久久久免费观看| 不卡电影免费在线播放一区| 欧美一区二区国产| 亚洲日本va午夜在线电影| 国产一区日韩二区欧美三区| 欧美区在线观看| 亚洲黄色免费网站| 豆国产96在线|亚洲| 日韩免费视频一区二区| 亚洲第一会所有码转帖| 99v久久综合狠狠综合久久| 精品毛片乱码1区2区3区| 亚洲成av人片在线观看| 91免费看片在线观看| 欧美国产日韩精品免费观看| 蜜桃免费网站一区二区三区| √…a在线天堂一区| 国产69精品久久777的优势| 欧美变态口味重另类| 日本大胆欧美人术艺术动态| 欧美色综合网站| 亚洲欧美日韩人成在线播放| 粉嫩av一区二区三区在线播放| 日韩欧美在线网站| 五月天久久比比资源色| 欧美日韩一二三| 亚洲高清久久久| 欧美日韩一卡二卡| 亚洲丶国产丶欧美一区二区三区| 91官网在线观看| 亚洲午夜电影在线观看| 欧美性生交片4| 亚洲成人av电影| 欧美精选午夜久久久乱码6080| 亚洲美女视频在线| 91丝袜美腿高跟国产极品老师 | 欧美一区二区三区系列电影| 亚洲在线视频网站| 欧美在线免费观看视频| 亚洲自拍偷拍麻豆| 欧美三区在线观看| 亚洲国产欧美日韩另类综合| 欧美视频日韩视频在线观看| 亚洲不卡在线观看| 欧美福利电影网| 免费成人在线影院| 久久综合精品国产一区二区三区| 久久草av在线| 亚洲国产精品黑人久久久| 白白色 亚洲乱淫| 亚洲欧美二区三区| 在线免费不卡视频| 三级久久三级久久久| 精品国产91久久久久久久妲己| 国产又黄又大久久| 国产午夜精品久久| 97se亚洲国产综合自在线不卡| 亚洲激情五月婷婷| 在线成人av影院| 国产最新精品精品你懂的| 久久精品视频网| 色88888久久久久久影院按摩| 亚洲成人av电影| 久久久久久亚洲综合影院红桃| av电影在线观看完整版一区二区| 一区二区三区四区国产精品| 在线观看91av| 国产精品69毛片高清亚洲| 亚洲精品一二三四区| 欧美一三区三区四区免费在线看 | 国产成人午夜高潮毛片| 亚洲欧美电影院| 日韩亚洲欧美高清| 不卡一卡二卡三乱码免费网站| 亚洲一区二区三区中文字幕| 欧美一区二区成人6969| 成人深夜在线观看| 亚洲h在线观看| 国产亚洲精品资源在线26u| 91丝袜国产在线播放| 青青草精品视频| 日韩一区有码在线| 欧美一级片免费看| 国产欧美综合在线观看第十页| 日本韩国精品一区二区在线观看| 免费av成人在线| 亚洲日本乱码在线观看| 精品美女在线播放| 欧洲中文字幕精品| 国产老女人精品毛片久久| 亚洲最大的成人av| 久久久精品欧美丰满| 欧美日韩精品福利| av午夜一区麻豆| 国产一区二区三区香蕉| 亚洲国产一区二区三区青草影视| 国产日韩欧美一区二区三区乱码| 精品视频全国免费看| 国产成人精品aa毛片| 麻豆一区二区在线| 亚洲综合色婷婷| 亚洲国产精品国自产拍av| 欧美一级xxx| 欧美日韩中文另类|