setattributes.c

来自「Nxlib,一个模拟xlib的程序。使用microwindows的库来运行需要x」· C语言 代码 · 共 63 行

C
63
字号
#include "nxlib.h"intXChangeWindowAttributes(Display * display, Window w, unsigned long valuemask,			XSetWindowAttributes * attributes){printf("XChangeWindowAttributes: valuemask 0x%X\n", valuemask);	if (valuemask & CWBackPixel)		XSetWindowBackground(display, w, attributes->background_pixel);	if (valuemask & CWBorderPixel)		XSetWindowBorder(display, w, attributes->border_pixel);	if (valuemask & CWEventMask)		XSelectInput(display, w, attributes->event_mask);	if (valuemask & CWOverrideRedirect) {		GR_WM_PROPERTIES props;		GrGetWMProperties(w, &props);		if (props.title)			free(props.title);		props.flags = GR_WM_FLAGS_PROPS;		if (attributes->override_redirect)			props.props |= GR_WM_PROPS_NODECORATE;		else props.props &= ~GR_WM_PROPS_NODECORATE;		GrSetWMProperties(w, &props);	}	// FIXME handle additional attributes	return 1;}intXSetLineAttributes(Display * display, GC gc, unsigned int line_width,		   int line_style, int cap_style, int join_style){	unsigned long ls;	switch (line_style) {	case LineOnOffDash:	case LineDoubleDash:		/*ls = GR_LINE_DOUBLE_DASH;*/ /* nyi*/		ls = GR_LINE_ONOFF_DASH;		break;	default:		ls = GR_LINE_SOLID;		break;	}	if (line_width > 1)		printf("XSetLineAttributes: width %d\n", line_width);	if (join_style != JoinMiter)		printf("XSetLineAttributes: We don't support join style yet\n");	GrSetGCLineAttributes(gc->gid, ls);	return 1;}

⌨️ 快捷键说明

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