📄 pw_window.c
字号:
cld_win = cld_win->next; } IPW_TRACE1(WN1, d, win->mapped); /* If window not mapped we are done */ if (!win->mapped) { IPW_TRACE_EXIT(WN3); return; } /* Copy window clip region */ _WINDOW_COPY_CLIP_REGION(&clip_old, &win->clip_reg); /* Update this window clip region */ _WindowUpdateClipRegion(win); /* Update clip regions for windows below this window */ _WindowUpdateClipRegionsBelow(win); /* * Repaint parent window using the old clip region of this window * (if we use the bounds of the old clip region or the old whole * window area we have to repaint all of this window parent children) */ if (PW_NULL != win->parent) { reg = clip_old.regs; while (PW_NULL != reg) { IPW_TRACE_RECT(WN1, ®->area); _WindowRepaint(win->parent, ®->area, FALSE); reg = reg->next; } } IPW_TRACE_RECT(WN1, &clip_old.bounds); /* * Repaint windows below this window using this window old * clip region bounds */ _WindowRepaintBelow(win, &clip_old.bounds); /* Repaint this window */ _WindowRepaint(win, PW_NULL, TRUE); /* Refresh the display */ _DisplayRefresh(win->dpy, &clip_old.bounds, &win->clip_reg.bounds); /* Send window reshaped event */ IPw_EventSendReshaped(win); /* Free window old clip region */ _WINDOW_FREE_CLIP_REGION(&clip_old); IPW_CHECK_WINDOW(win); IPW_TRACE_EXIT(WN3);}/** * Raise window @p win by one. * Brings window win one window closer to the top. * @param win pointer to window */ void Pw_WindowRaiseOne(Pw_Window* win){ Pw_Window* awin; IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR(win); IPW_CHECK_WINDOW(win); IPW_TRACE3(WN2, p, win, win->prev, win->parent); /* Get window above */ awin = win->prev; /* If window on top do nothing */ if (PW_NULL == awin) { IPW_TRACE_EXIT(WN3); return; } /* Switch windows */ if (PW_NULL != awin->prev) awin->prev->next = win; if (PW_NULL != win->next) win->next->prev = awin; awin->next = win->next; win->next = awin; win->prev = awin->prev; awin->prev = win; /* If window on top correct parent's first child ptr */ if (PW_NULL == win->prev && PW_NULL != win->parent) win->parent->children = win; IPW_TRACE1(WN1, p, win->parent->children); IPW_TRACE2(WN1, d, win->mapped, awin->mapped); /* If one of the windows switched is not mapped return */ if (!win->mapped || !awin->mapped) { IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(awin); IPW_TRACE_EXIT(WN3); return; } /* Correct windows clip regions */ _WindowUpdateClipRegion(win); _WindowUpdateClipRegion(awin); /* Repaint window */ _WindowRepaint(win, PW_NULL, TRUE); /* Refresh the display */ _DisplayRefresh(win->dpy, &win->clip_reg.bounds, PW_NULL); IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(awin); IPW_TRACE_EXIT(WN3);} /** * Lower window @p win by one. * Brings window win one window closer to the bottom. * @param win pointer to window */ void Pw_WindowLowerOne(Pw_Window* win){ Pw_Window* bwin; IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR(win); IPW_CHECK_WINDOW(win); IPW_TRACE3(WN2, p, win, win->next, win->parent); /* Get window below */ bwin = win->next; /* If window on bottom do nothing */ if (PW_NULL == bwin) { IPW_TRACE_EXIT(WN3); return; } /* Switch windows */ if (PW_NULL != win->prev) win->prev->next = bwin; if (PW_NULL != bwin->next) bwin->next->prev = win; win->next = bwin->next; bwin->next = win; bwin->prev = win->prev; win->prev = bwin; /* If window on top correct parent's first child ptr */ if (PW_NULL == bwin->prev && PW_NULL != bwin->parent) bwin->parent->children = bwin; IPW_TRACE1(WN1, p, win->parent->children); IPW_TRACE2(WN1, d, win->mapped, bwin->mapped); /* If one of the windows switched is not mapped return */ if (!win->mapped || !bwin->mapped) { IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(bwin); IPW_TRACE_EXIT(WN3); return; } /* Correct windows clip regions */ _WindowUpdateClipRegion(win); _WindowUpdateClipRegion(bwin); /* Repaint window above */ _WindowRepaint(bwin, PW_NULL, TRUE); /* Refresh the display */ _DisplayRefresh(bwin->dpy, &bwin->clip_reg.bounds, PW_NULL); IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(bwin); IPW_TRACE_EXIT(WN3);}/** * Places window @p win just above window @p rwin. * @param win pointer to window * @param rwin pointer to window */ void Pw_WindowPlaceAbove(Pw_Window* win, Pw_Window* rwin){ IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR2(win, rwin); IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(rwin); IPW_TRACE4(WN2, p, win, win->prev, win->next, win->parent); IPW_TRACE4(WN2, p, rwin, rwin->prev, rwin->next, rwin->parent); IPW_CHECK_COND(win != rwin); IPW_CHECK_COND(win->parent == rwin->parent); if (win->parent != rwin->parent || win == rwin) { IPW_TRACE_EXIT(WN3); return; } /* Take window win out of the window list */ if (PW_NULL == win->prev) { /* Window win is at the top of the list */ win->parent->children = win->next; if (PW_NULL != win->next) win->next->prev = PW_NULL; } else { /* Window win is somewhere in the list */ win->prev->next = win->next; if (PW_NULL != win->next) win->next->prev = win->prev; } /* Now insert window win above window rwin */ if (PW_NULL == rwin->prev) { /* Window rwin is at the top of the list */ win->parent->children = win; win->prev = PW_NULL; win->next = rwin; rwin->prev = win; } else { /* Window rwin is somewhere in the list */ win->prev = rwin->prev; win->next = rwin; rwin->prev->next = win; rwin->prev = win; } IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(rwin); /* If window win is not mapped return */ if (!win->mapped) { IPW_TRACE_EXIT(WN3); return; } /* Correct windows clip regions */ _WindowUpdateClipRegion(win->parent->children); _WindowUpdateClipRegionsBelow(win->parent->children); /* Repaint windows */ _WindowRepaint(win->parent, &win->clip_reg.bounds, TRUE); /* Refresh the display */ _DisplayRefresh(win->dpy, &win->clip_reg.bounds, PW_NULL); IPW_TRACE_EXIT(WN3);}/** * Places window @p win just below window @p rwin. * @param win pointer to window * @param rwin pointer to window */ void Pw_WindowPlaceBelow(Pw_Window* win, Pw_Window* rwin){ IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR2(win, rwin); IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(rwin); IPW_TRACE4(WN2, p, win, win->prev, win->next, win->parent); IPW_TRACE4(WN2, p, rwin, rwin->prev, rwin->next, rwin->parent); IPW_CHECK_COND(win != rwin); IPW_CHECK_COND(win->parent == rwin->parent); if (win->parent != rwin->parent || win == rwin) { IPW_TRACE_EXIT(WN3); return; } /* Take window win out of the window list */ if (PW_NULL == win->prev) { /* Window win is at the top of the list */ win->parent->children = win->next; if (PW_NULL != win->next) win->next->prev = PW_NULL; } else { /* Window win is somewhere in the list */ win->prev->next = win->next; if (PW_NULL != win->next) win->next->prev = win->prev; } /* Now insert window win below window rwin */ if (PW_NULL == rwin->next) { /* Window rwin is at the bottom of the list */ win->prev = rwin; win->next = PW_NULL; rwin->next = win; } else { /* Window rwin is somewhere in the list */ win->prev = rwin; win->next = rwin->next; rwin->next->prev = win; rwin->next = win; } IPW_CHECK_WINDOW(win); IPW_CHECK_WINDOW(rwin); /* If window win is not mapped return */ if (!win->mapped) { IPW_TRACE_EXIT(WN3); return; } /* Correct windows clip regions */ _WindowUpdateClipRegion(win->parent->children); _WindowUpdateClipRegionsBelow(win->parent->children); /* Repaint windows */ _WindowRepaint(win->parent, &win->clip_reg.bounds, TRUE); /* Refresh the display */ _DisplayRefresh(win->dpy, &win->clip_reg.bounds, PW_NULL); IPW_TRACE_EXIT(WN3);}/** * Places window @p win on top. * @param win pointer to window */ void Pw_WindowPlaceOnTop(Pw_Window* win){ IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR2(win, win->parent); if (win != win->parent->children) Pw_WindowPlaceAbove(win, win->parent->children); IPW_TRACE_EXIT(WN3);}/** * Places window @p win on bottom. * @param win pointer to window */ void Pw_WindowPlaceOnBottom(Pw_Window* win){ Pw_Window* bwin; IPW_TRACE_ENTER(WN3); IPW_CHECK_PTR2(win, win->parent); bwin = win; while (PW_NULL != bwin->next) bwin = bwin->next; if (win != bwin) Pw_WindowPlaceBelow(win, bwin); IPW_TRACE_EXIT(WN3);}/** * Gets the free client data id to use when * setting/retrieving client data to/from windows. * @return new client data id * @see Pw_WindowGetClientData * @see Pw_WindowGetClientDataId * @see Pw_WindowSetClientData */ Pw_Int Pw_WindowGetNewClientDataId(void){ IPW_TRACE_ENTER(WN3); IPW_TRACE_EXIT_V(WN3, d, _cdata_next_id); return(_cdata_next_id++);}
Pw_Window * GetTopChildVisibleVindow(Pw_Window * win) {
Pw_Window * cld_win;
cld_win = win->children;
if (!cld_win) return NULL;
while (PW_NULL != cld_win) { if (Pw_WindowIsMapped(cld_win)) {
return (cld_win);
} cld_win = cld_win->next; } return NULL;
}
/*---------------------------------------------------------------------------// end of pw_window.c//--------------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -