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

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

?? sdl_x11wm.c

?? Simple DirectMedia Layer - Simple DirectMedia Layer 是一個跨平臺的多媒體庫設計用來提供快速圖形framebuffer和音頻驅動。應用MPEG為軟件
?? C
字號:
/*    SDL - Simple DirectMedia Layer    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga    This library is free software; you can redistribute it and/or    modify it under the terms of the GNU Library General Public    License as published by the Free Software Foundation; either    version 2 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    Library General Public License for more details.    You should have received a copy of the GNU Library General Public    License along with this library; if not, write to the Free    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    Sam Lantinga    slouken@libsdl.org*/#ifdef SAVE_RCSIDstatic char rcsid = "@(#) $Id: SDL_x11wm.c,v 1.9 2002/03/06 11:23:08 slouken Exp $";#endif#include <stdlib.h>#include <string.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include "SDL_version.h"#include "SDL_error.h"#include "SDL_timer.h"#include "SDL_video.h"#include "SDL_syswm.h"#include "SDL_events_c.h"#include "SDL_pixels_c.h"#include "SDL_x11modes_c.h"#include "SDL_x11wm_c.h"static Uint8 reverse_byte(Uint8 x){	x = (x & 0xaa) >> 1 | (x & 0x55) << 1;	x = (x & 0xcc) >> 2 | (x & 0x33) << 2;	x = (x & 0xf0) >> 4 | (x & 0x0f) << 4;	return x;}void X11_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask){	SDL_Surface *sicon;	XWMHints *wmhints;	XImage *icon_image;	Pixmap icon_pixmap;	Pixmap mask_pixmap;	Window icon_window = None;	GC gc;	XGCValues GCvalues;	int i, dbpp;	SDL_Rect bounds;	Uint8 *LSBmask;	Visual *dvis;	char *p;	int masksize;	SDL_Lock_EventThread();	/* The icon must use the default visual, depth and colormap of the	   screen, so it might need a conversion */	dvis = DefaultVisual(SDL_Display, SDL_Screen);	dbpp = DefaultDepth(SDL_Display, SDL_Screen);	for(i = 0; i < this->hidden->nvisuals; i++) {		if(this->hidden->visuals[i].visual == dvis) {			dbpp = this->hidden->visuals[i].bpp;			break;		}	}	/* The Visual struct is supposed to be opaque but we cheat a little */	sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,				     dbpp,				     dvis->red_mask, dvis->green_mask,				     dvis->blue_mask, 0);	if ( sicon == NULL )		goto done;	if(dbpp == 8) {		/* Default visual is 8bit; we need to allocate colours from		   the default colormap */		SDL_Color want[256], got[256];		int nwant;		Colormap dcmap;		int missing;		dcmap = DefaultColormap(SDL_Display, SDL_Screen);		if(icon->format->palette) {			/* The icon has a palette as well - we just have to			   find those colours */			nwant = icon->format->palette->ncolors;			memcpy(want, icon->format->palette->colors,			       nwant * sizeof want[0]);		} else {			/* try the standard 6x6x6 cube for lack of better			   ideas */			int r, g, b, i;			for(r = i = 0; r < 256; r += 0x33)				for(g = 0; g < 256; g += 0x33)					for(b = 0; b < 256; b += 0x33, i++) {						want[i].r = r;						want[i].g = g;						want[i].b = b;					}			nwant = 216;		}		if(SDL_iconcolors) {			/* free already allocated colours first */			unsigned long freelist[512];			int nfree = 0;			for(i = 0; i < 256; i++) {				while(SDL_iconcolors[i]) {					freelist[nfree++] = i;					SDL_iconcolors[i]--;				}			}			XFreeColors(GFX_Display, dcmap, freelist, nfree, 0);		}		if(!SDL_iconcolors)			SDL_iconcolors = malloc(256 * sizeof *SDL_iconcolors);		memset(SDL_iconcolors, 0, 256 * sizeof *SDL_iconcolors);		/* try to allocate the colours */		memset(got, 0, sizeof got);		missing = 0;		for(i = 0; i < nwant; i++) {			XColor c;			c.red = want[i].r << 8;			c.green = want[i].g << 8;			c.blue = want[i].b << 8;			c.flags = DoRed | DoGreen | DoBlue;			if(XAllocColor(GFX_Display, dcmap, &c)) {				/* got the colour */				SDL_iconcolors[c.pixel]++;				got[c.pixel] = want[i];			} else {				missing = 1;			}		}		if(missing) {			/* Some colours were apparently missing, so we just			   allocate all the rest as well */			XColor cols[256];			for(i = 0; i < 256; i++)				cols[i].pixel = i;			XQueryColors(GFX_Display, dcmap, cols, 256);			for(i = 0; i < 256; i++) {				got[i].r = cols[i].red >> 8;				got[i].g = cols[i].green >> 8;				got[i].b = cols[i].blue >> 8;				if(!SDL_iconcolors[i]) {					if(XAllocColor(GFX_Display, dcmap,							cols + i)) {						SDL_iconcolors[i] = 1;					} else {						/* index not available */						got[i].r = 0;						got[i].g = 0;						got[i].b = 0;					}				}			}		}		SDL_SetColors(sicon, got, 0, 256);	}	bounds.x = 0;	bounds.y = 0;	bounds.w = icon->w;	bounds.h = icon->h;	if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 )		goto done;	/* We need the mask as given, except in LSBfirst format instead of	   MSBfirst. Reverse the bits in each byte. */	masksize = ((sicon->w + 7) >> 3) * sicon->h;	LSBmask = malloc(masksize);	if ( LSBmask == NULL ) {		goto done;	}	memset(LSBmask, 0, masksize);	for(i = 0; i < masksize; i++)		LSBmask[i] = reverse_byte(mask[i]);	mask_pixmap = XCreatePixmapFromBitmapData(SDL_Display, WMwindow,						  (char *)LSBmask,						  sicon->w, sicon->h,						  1L, 0L, 1);	/* Transfer the image to an X11 pixmap */	icon_image = XCreateImage(SDL_Display,				  DefaultVisual(SDL_Display, SDL_Screen),				  DefaultDepth(SDL_Display, SDL_Screen),				  ZPixmap, 0, sicon->pixels,				  sicon->w, sicon->h,				  32, 0);	icon_image->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)		                 ? MSBFirst : LSBFirst;	icon_pixmap = XCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h,				    DefaultDepth(SDL_Display, SDL_Screen));	gc = XCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues);	XPutImage(SDL_Display, icon_pixmap, gc, icon_image,		  0, 0, 0, 0, sicon->w, sicon->h);	XFreeGC(SDL_Display, gc);	XDestroyImage(icon_image);	free(LSBmask);	sicon->pixels = NULL;	/* Some buggy window managers (some versions of Enlightenment, it	   seems) need an icon window *and* icon pixmap to work properly, while	   it screws up others. The default is only to use a pixmap. */	p = getenv("SDL_VIDEO_X11_ICONWIN");	if(p && *p) {		icon_window = XCreateSimpleWindow(SDL_Display, SDL_Root,						  0, 0, sicon->w, sicon->h, 0,						  CopyFromParent,						  CopyFromParent);		XSetWindowBackgroundPixmap(SDL_Display, icon_window,					   icon_pixmap);		XClearWindow(SDL_Display, icon_window);	}	/* Set the window icon to the icon pixmap (and icon window) */	wmhints = XAllocWMHints();	wmhints->flags = (IconPixmapHint | IconMaskHint);	wmhints->icon_pixmap = icon_pixmap;	wmhints->icon_mask = mask_pixmap;	if(icon_window != None) {		wmhints->flags |= IconWindowHint;		wmhints->icon_window = icon_window;	}	XSetWMHints(SDL_Display, WMwindow, wmhints);	XFree(wmhints);	XSync(SDL_Display, False);  done:	SDL_Unlock_EventThread();	SDL_FreeSurface(sicon);}void X11_SetCaption(_THIS, const char *title, const char *icon){	XTextProperty titleprop, iconprop;	/* Lock the event thread, in multi-threading environments */	SDL_Lock_EventThread();	if ( title != NULL ) {		XStringListToTextProperty((char **)&title, 1, &titleprop);		XSetWMName(SDL_Display, WMwindow, &titleprop);		XFree(titleprop.value);	}	if ( icon != NULL ) {		XStringListToTextProperty((char **)&icon, 1, &iconprop);		XSetWMIconName(SDL_Display, WMwindow, &iconprop);		XFree(iconprop.value);	}	XSync(SDL_Display, False);	SDL_Unlock_EventThread();}/* Iconify the window */int X11_IconifyWindow(_THIS){	int result;	SDL_Lock_EventThread();	result = XIconifyWindow(SDL_Display, WMwindow, SDL_Screen);	XSync(SDL_Display, False);	SDL_Unlock_EventThread();	return(result);}SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode){	int result;	if ( this->screen == NULL ) {		return(SDL_GRAB_OFF);	}	if ( ! SDL_Window ) {		return(mode);	/* Will be set later on mode switch */	}	if ( mode == SDL_GRAB_OFF ) {		XUngrabPointer(SDL_Display, CurrentTime);		XUngrabKeyboard(SDL_Display, CurrentTime);	} else {		if ( this->screen->flags & SDL_FULLSCREEN ) {			/* Unbind the mouse from the fullscreen window */			XUngrabPointer(SDL_Display, CurrentTime);		}		/* Try to grab the mouse */#if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */		for ( numtries = 0; numtries < 10; ++numtries ) {#else		while ( 1 ) {#endif			result = XGrabPointer(SDL_Display, SDL_Window, True, 0,						GrabModeAsync, GrabModeAsync,						SDL_Window, None, CurrentTime);			if ( result == GrabSuccess ) {				break;			}			SDL_Delay(100);		}		if ( result != GrabSuccess ) {			/* Uh, oh, what do we do here? */ ;		}		/* Now grab the keyboard */		XGrabKeyboard(SDL_Display, WMwindow, True,				GrabModeAsync, GrabModeAsync, CurrentTime);		/* Raise the window if we grab the mouse */		if ( !(this->screen->flags & SDL_FULLSCREEN) )			XRaiseWindow(SDL_Display, WMwindow);		/* Make sure we register input focus */		SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);	}	XSync(SDL_Display, False);	return(mode);}SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode){	SDL_Lock_EventThread();	mode = X11_GrabInputNoLock(this, mode);	SDL_Unlock_EventThread();	return(mode);}/* If 'info' is the right version, this function fills it and returns 1.   Otherwise, in case of a version mismatch, it returns -1.*/static void lock_display(void){	SDL_Lock_EventThread();}static void unlock_display(void){	/* Make sure any X11 transactions are completed */	SDL_VideoDevice *this = current_video;	XSync(SDL_Display, False);	SDL_Unlock_EventThread();}int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info){	if ( info->version.major <= SDL_MAJOR_VERSION ) {		info->subsystem = SDL_SYSWM_X11;		info->info.x11.display = SDL_Display;		info->info.x11.window = SDL_Window;		if ( SDL_VERSIONNUM(info->version.major,		                    info->version.minor,		                    info->version.patch) >= 1002 ) {			info->info.x11.fswindow = FSwindow;			info->info.x11.wmwindow = WMwindow;		}		info->info.x11.lock_func = lock_display;		info->info.x11.unlock_func = unlock_display;		return(1);	} else {		SDL_SetError("Application not compiled with SDL %d.%d\n",					SDL_MAJOR_VERSION, SDL_MINOR_VERSION);		return(-1);	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产乱子精品免费女| 在线一区二区观看| 国产精品538一区二区在线| 国产黄色精品网站| 欧美天天综合网| 久久在线观看免费| 中文字幕中文在线不卡住| 国产日韩欧美制服另类| 亚洲成人动漫在线免费观看| 精品亚洲porn| 欧美午夜理伦三级在线观看| 亚洲不卡在线观看| 欧美va在线播放| 亚洲黄色小视频| 国产一区二区调教| 日韩欧美国产1| 亚洲国产成人av好男人在线观看| 高清在线不卡av| 日韩一区二区影院| 亚洲国产裸拍裸体视频在线观看乱了| 欧美日本一区二区三区| 亚洲一区精品在线| 91九色最新地址| 裸体一区二区三区| 欧美中文字幕一区二区三区亚洲| 欧美精彩视频一区二区三区| 日本韩国欧美一区二区三区| 美洲天堂一区二卡三卡四卡视频 | 精品一二三四区| 国产欧美一区二区在线观看| 在线日韩av片| 国产精品99久| 亚洲aaa精品| 欧美高清在线视频| 国产成人aaa| 五月婷婷激情综合| 欧美日韩国产在线观看| 国产精品一区在线| 亚洲国产精品尤物yw在线观看| 精品成人免费观看| 国产河南妇女毛片精品久久久| 樱花影视一区二区| 中文字幕精品三区| 日韩免费看的电影| 欧美视频一区二区三区在线观看| 国产乱妇无码大片在线观看| 亚洲国产精品精华液网站| 国产精品毛片久久久久久| 色综合天天视频在线观看| 亚洲精品一卡二卡| 久久久国产一区二区三区四区小说| 国产毛片精品一区| 人人精品人人爱| 欧美成va人片在线观看| 在线观看不卡视频| www.日韩av| 一区视频在线播放| 97久久久精品综合88久久| 一区二区在线观看视频| 中文欧美字幕免费| 久久久久久亚洲综合| 精品少妇一区二区三区 | 成人av电影在线| 亚洲一区二区四区蜜桃| 国产精品美女久久久久久久久| 精品福利一二区| 日韩精品一区二区三区在线播放| 欧美日韩久久久久久| 精品视频一区二区不卡| 精彩视频一区二区| 麻豆精品一区二区av白丝在线| 亚洲成在人线免费| 亚洲国产一区二区在线播放| 亚洲人成小说网站色在线| 日韩精品中文字幕在线不卡尤物| 在线电影欧美成精品| www.成人网.com| 99久久精品国产麻豆演员表| 成人视屏免费看| 奇米四色…亚洲| 免费在线观看一区| 另类人妖一区二区av| 精品一区二区影视| 国产超碰在线一区| 成人毛片在线观看| 色综合久久中文综合久久97 | 亚洲国产精品综合小说图片区| 亚洲综合一区二区三区| 亚洲电影视频在线| 日韩精品一二三四| 亚洲欧美另类小说| 亚洲精品久久7777| 欧美a一区二区| 国产成人免费在线| 91玉足脚交白嫩脚丫在线播放| 毛片基地黄久久久久久天堂| 久久99在线观看| 成人性生交大片免费看中文网站| 成人sese在线| 欧美美女一区二区在线观看| 欧美本精品男人aⅴ天堂| 国产欧美日韩另类视频免费观看| 自拍偷拍亚洲激情| 国产精品久久久久久久午夜片| 亚洲特黄一级片| 美女尤物国产一区| 成人午夜激情影院| 欧美性色黄大片| 精品国产一区二区精华| 国产精品免费丝袜| 午夜成人免费视频| 国产成人综合视频| 欧美亚洲日本国产| 久久综合色8888| 亚洲美女视频在线观看| 麻豆精品蜜桃视频网站| 处破女av一区二区| 在线不卡免费av| 国产精品国产馆在线真实露脸| 亚洲成人动漫在线免费观看| 国产精品12区| 欧美日韩国产123区| 欧美韩日一区二区三区四区| 亚洲午夜久久久久久久久电影网| 国内精品写真在线观看| 激情综合网激情| 91色.com| 久久久久久久av麻豆果冻| 亚洲一区二区在线免费观看视频| 国产美女视频91| 制服丝袜成人动漫| 欧美一区二区视频在线观看2022| 欧美日韩一区不卡| 国产精品美日韩| 精品综合久久久久久8888| 欧美这里有精品| 中文字幕免费不卡在线| 石原莉奈在线亚洲三区| 91亚洲精华国产精华精华液| 精品99999| 天堂午夜影视日韩欧美一区二区| 99热99精品| 国产亚洲精品免费| 亚洲欧美电影院| 成人免费av网站| 2023国产一二三区日本精品2022| 亚洲chinese男男1069| 99国内精品久久| 国产精品久久久久久久久晋中| 国产在线国偷精品产拍免费yy| 91精品国产免费久久综合| 一区二区三区四区亚洲| 免费的成人av| 欧美日韩不卡一区| 樱桃国产成人精品视频| 99久久精品国产一区| 欧美激情综合在线| 国产v日产∨综合v精品视频| wwwwxxxxx欧美| 国产成人免费视频网站| 久久精品人人做人人爽97| 韩国一区二区在线观看| 日韩三级免费观看| 麻豆精品新av中文字幕| 欧美电视剧免费全集观看| 免费精品99久久国产综合精品| 欧美日韩一本到| 天天色综合成人网| 717成人午夜免费福利电影| 日韩成人午夜精品| 99re6这里只有精品视频在线观看| 国产精品日韩精品欧美在线| 成人国产精品视频| 成人免费一区二区三区视频| 97精品国产露脸对白| 亚洲精品免费播放| 欧美午夜不卡视频| 日本sm残虐另类| 久久免费的精品国产v∧| 国产成人激情av| 亚洲男人电影天堂| 精品视频免费看| 久久丁香综合五月国产三级网站 | 久久毛片高清国产| 国产.精品.日韩.另类.中文.在线.播放 | 最新久久zyz资源站| 91美女在线观看| 亚洲国产你懂的| 26uuu亚洲综合色欧美| 高清不卡在线观看av| 亚洲免费成人av| 欧美一区二区黄| 丁香啪啪综合成人亚洲小说| 亚洲视频在线一区观看| 欧美日韩综合色| 国产精品一区三区| 一区二区三区丝袜| 日韩免费看网站| 色av成人天堂桃色av| 麻豆成人在线观看|