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

📄 wmgr_findspace.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
字号:
#ifndef lint#ifdef sccsstatic  char sccsid[] = "@(#)wmgr_findspace.c 1.1 92/07/30";#endif#endif/* * Copyright (c) 1986 by Sun Microsystems, Inc. */#include <sunwindow/window_hs.h>#include <sunwindow/win_ioctl.h>#include <sunwindow/win_enum.h>#include "sunwindow/sv_malloc.h"#include <suntool/wmgr_policy.h>#define WMGR_MAX_NODES	32#define is_open(nodep)	((nodep->flags&WIN_NODE_OPEN) != 0)struct rectlist *wmgr_findspace(rootfd, selector, ignorefd)    Window_handle   rootfd, ignorefd;    int             selector;{    register Win_enum_node                   *nodep, *limit;    register int    ignore, result;    Rect            root_rect;    Rectlist       *rl;    Win_enum_node   nodes[WMGR_MAX_NODES];    char *malloc();    rl = (Rectlist *) (LINT_CAST(sv_malloc(sizeof(Rectlist))));    ignore = (ignorefd == 0) ? -1 : win_fdtonumber(ignorefd);    (void)win_getrect(rootfd, &root_rect);    (void)rl_initwithrect(&root_rect, rl);    if ((result = win_get_tree_layer(rootfd, sizeof nodes, (char *)nodes)) < 0)	return (Rectlist *) 0;    limit = nodes + (result / sizeof(Win_enum_node));    for (nodep = nodes; nodep < limit; nodep++) {	if (nodep->me == ignore)	    continue;	switch (selector) {	  case WFS_CURRENT:	    if (is_open(nodep)) {		(void)rl_rectdifference(&nodep->open_rect, rl, rl);	    } else {		(void)rl_rectdifference(&nodep->icon_rect, rl, rl);	    }	    break;	  case WFS_BOTH:	    (void)rl_rectdifference(&nodep->open_rect, rl, rl);	    (void)rl_rectdifference(&nodep->icon_rect, rl, rl);	    break;	  case WFS_OPEN:	    (void)rl_rectdifference(&nodep->open_rect, rl, rl);	    break;	  case WFS_ICONS:	    (void)rl_rectdifference(&nodep->icon_rect, rl, rl);	    break;	}    }    return rl;}intwmgr_is_child_inserted(parent, child)    Window_handle   parent, child;{    register Win_enum_node                   *nodep, *limit;    register int  my_num, result;    Win_enum_node   nodes[WMGR_MAX_NODES];    my_num = win_fdtonumber(child);    if ((result = win_get_tree_layer(parent, sizeof nodes, (char *)nodes)) < 0)	return FALSE;    limit = nodes + (result / sizeof(Win_enum_node));    for (nodep = nodes;nodep < limit; nodep++) {	if (nodep->me == my_num)	    return ((nodep->flags & WIN_NODE_INSERTED) != 0);    }    return FALSE;}

⌨️ 快捷键说明

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