lhide.c

来自「这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易」· C语言 代码 · 共 68 行

C
68
字号
#include <u.h>#include <libc.h>#include <draw.h>#include <memdraw.h>#include <memlayer.h>/* * Hide puts that portion of screenr now on the screen into the window's save area. * Expose puts that portion of screenr now in the save area onto the screen. * * Hide and Expose both require that the layer structures in the screen * match the geometry they are being asked to update, that is, they update the * save area (hide) or screen (expose) based on what those structures tell them. * This means they must be called at the correct time during window shuffles. */staticvoidlhideop(Memimage *src, Rectangle screenr, Rectangle clipr, void *etc, int insave){	Rectangle r;	Memlayer *l;	USED(clipr.min.x);	USED(insave);	l = etc;	if(src != l->save){	/* do nothing if src is already in save area */		r = rectsubpt(screenr, l->delta);		memdraw(l->save, r, src, screenr.min, nil, screenr.min, S);	}}voidmemlhide(Memimage *i, Rectangle screenr){	if(i->layer->save == nil)		return;	if(rectclip(&screenr, i->layer->screen->image->r) == 0)		return;	_memlayerop(lhideop, i, screenr, screenr, i->layer);}staticvoidlexposeop(Memimage *dst, Rectangle screenr, Rectangle clipr, void *etc, int insave){	Memlayer *l;	Rectangle r;	USED(clipr.min.x);	if(insave)	/* if dst is save area, don't bother */		return;	l = etc;	r = rectsubpt(screenr, l->delta);	if(l->save)		memdraw(dst, screenr, l->save, r.min, nil, r.min, S);	else		l->refreshfn(dst, r, l->refreshptr);}voidmemlexpose(Memimage *i, Rectangle screenr){	if(rectclip(&screenr, i->layer->screen->image->r) == 0)		return;	_memlayerop(lexposeop, i, screenr, screenr, i->layer);}

⌨️ 快捷键说明

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