⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcmap.c

📁 su 的源代码库
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       *//* LCMAP: $Revision: 1.8 $ ; $Date: 2004/07/21 17:47:44 $	*//*********************** self documentation **********************//*  * LCMAP - List Color Map of root window of default screen  *  * Usage:   lcmap  *  */ /**************** end self doc ********************************/#include <X11/Xlib.h>#include <X11/Xutil.h>#include <X11/Xatom.h>#include <stdio.h>#include <stdlib.h>int	main(int argc, char**argv){	Display *dpy;	Screen *scr;	XWindowAttributes attr;	Colormap cmap;	XColor color;	int i;	/* connect to X server */	if ((dpy=XOpenDisplay(NULL))==NULL) {		fprintf(stderr,"Cannot connect to display %s\n",			XDisplayName(NULL));		exit(-1);	}	scr = XDefaultScreenOfDisplay(dpy);	/* determine colormap ID */	if (!XGetWindowAttributes(dpy,RootWindowOfScreen(scr),&attr)) {		fprintf(stderr,"Cannot get RootWindow attributes\n");		exit(-1);	}	cmap = attr.colormap;	printf("Root Window Colormap ID = %ld\n",cmap);	/* list colors */	for (i=0; i<CellsOfScreen(scr); i++) {		color.pixel = i;		XQueryColor(dpy,cmap,&color);		printf("pixel = %d \tred = %d \tgreen = %d \tblue = %d\n",		       (int) color.pixel,		       (int) color.red,		       (int) color.green,		       (int) color.blue);	}	/* close connection to X server */	XCloseDisplay(dpy);        return( 0 );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -