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

📄 tkwinwindow.c

📁 linux系统下的音频通信
💻 C
📖 第 1 页 / 共 2 页
字号:
 * * Results: *	None. * * Side effects: *	Generates lots of events. * *---------------------------------------------------------------------- */static voidNotifyVisibility(eventPtr, winPtr)    XEvent *eventPtr;		/* Initialized VisibilityNotify event. */    TkWindow *winPtr;		/* Window to notify. */{    if (winPtr->atts.event_mask & VisibilityChangeMask) {	eventPtr->xvisibility.window = winPtr->window;	Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL);    }    for (winPtr = winPtr->childList; winPtr != NULL; 	    winPtr = winPtr->nextPtr) {	if (winPtr->flags & TK_MAPPED) {	    NotifyVisibility(eventPtr, winPtr);	}    }}/* *---------------------------------------------------------------------- * * XUnmapWindow -- * *	Cause the given window to become invisible. * * Results: *	None * * Side effects: *	Causes the window state to change, and generates an UnmapNotify *	event. * *---------------------------------------------------------------------- */voidXUnmapWindow(display, w)    Display* display;    Window w;{    XEvent event;    TkWindow *winPtr = TkWinGetWinPtr(w);    display->request++;    /*     * Bug fix: Don't short circuit this routine based on TK_MAPPED because     * it will be cleared before XUnmapWindow is called.     */    ShowWindow(TkWinGetHWND(w), SW_HIDE);    winPtr->flags &= ~TK_MAPPED;    if (winPtr->flags & TK_TOP_LEVEL) {	event.type = UnmapNotify;	event.xunmap.serial = display->request;	event.xunmap.send_event = False;	event.xunmap.display = display;	event.xunmap.event = winPtr->window;	event.xunmap.window = winPtr->window;	event.xunmap.from_configure = False;	Tk_HandleEvent(&event);    }}/* *---------------------------------------------------------------------- * * XMoveResizeWindow -- * *	Move and resize a window relative to its parent. * * Results: *	None. * * Side effects: *	Repositions and resizes the specified window. * *---------------------------------------------------------------------- */voidXMoveResizeWindow(display, w, x, y, width, height)    Display* display;    Window w;    int x;			/* Position relative to parent. */    int y;    unsigned int width;    unsigned int height;{    display->request++;    MoveWindow(TkWinGetHWND(w), x, y, width, height, TRUE);}/* *---------------------------------------------------------------------- * * XMoveWindow -- * *	Move a window relative to its parent. * * Results: *	None. * * Side effects: *	Repositions the specified window. * *---------------------------------------------------------------------- */voidXMoveWindow(display, w, x, y)    Display* display;    Window w;    int x;    int y;{    TkWindow *winPtr = TkWinGetWinPtr(w);    display->request++;    MoveWindow(TkWinGetHWND(w), x, y, winPtr->changes.width,	    winPtr->changes.height, TRUE);}/* *---------------------------------------------------------------------- * * XResizeWindow -- * *	Resize a window. * * Results: *	None. * * Side effects: *	Resizes the specified window. * *---------------------------------------------------------------------- */voidXResizeWindow(display, w, width, height)    Display* display;    Window w;    unsigned int width;    unsigned int height;{    TkWindow *winPtr = TkWinGetWinPtr(w);    display->request++;    MoveWindow(TkWinGetHWND(w), winPtr->changes.x, winPtr->changes.y, width,	    height, TRUE);}/* *---------------------------------------------------------------------- * * XRaiseWindow -- * *	Change the stacking order of a window. * * Results: *	None. * * Side effects: *	Changes the stacking order of the specified window. * *---------------------------------------------------------------------- */voidXRaiseWindow(display, w)    Display* display;    Window w;{    HWND window = TkWinGetHWND(w);    display->request++;    SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,	    SWP_NOMOVE | SWP_NOSIZE);}/* *---------------------------------------------------------------------- * * XConfigureWindow -- * *	Change the size, position, stacking, or border of the specified *	window. * * Results: *	None. * * Side effects: *	Changes the attributes of the specified window.  Note that we *	ignore the passed in values and use the values stored in the *	TkWindow data structure. * *---------------------------------------------------------------------- */voidXConfigureWindow(display, w, value_mask, values)    Display* display;    Window w;    unsigned int value_mask;    XWindowChanges* values;{    TkWindow *winPtr = TkWinGetWinPtr(w);    HWND hwnd = TkWinGetHWND(w);    display->request++;    /*     * Change the shape and/or position of the window.     */    if (value_mask & (CWX|CWY|CWWidth|CWHeight)) {	MoveWindow(hwnd, winPtr->changes.x, winPtr->changes.y,		winPtr->changes.width, winPtr->changes.height, TRUE);    }    /*     * Change the stacking order of the window.     */    if (value_mask & CWStackMode) {	HWND sibling;	if ((value_mask & CWSibling) && (values->sibling != None)) {	    sibling = Tk_GetHWND(values->sibling);	} else {	    sibling = NULL;	}	TkWinSetWindowPos(hwnd, sibling, values->stack_mode);    }}/* *---------------------------------------------------------------------- * * XClearWindow -- * *	Clears the entire window to the current background color. * * Results: *	None. * * Side effects: *	Erases the current contents of the window. * *---------------------------------------------------------------------- *//*notused, Leo*/voidXClearWindow(display, w)    Display* display;    Window w;{    RECT rc;    HBRUSH brush;    HPALETTE palette;#ifndef USE_CKGRAPH_IMP    HPALETTE oldPalette;#endif    TkWindow *winPtr;    HWND hwnd = TkWinGetHWND(w);    HDC dc = CkGetDC(hwnd);    palette = TkWinGetPalette(display->screens[0].cmap);#ifdef USE_CKGRAPH_IMP    CkSelectPalette(dc, palette, FALSE);#else    oldPalette = CkSelectPalette(dc, palette, FALSE);#endif    display->request++;    winPtr = TkWinGetWinPtr(w);    brush = CkCreateSolidBrush(winPtr->atts.background_pixel);    GetWindowRect(hwnd, &rc);    rc.right = rc.right - rc.left;    rc.bottom = rc.bottom - rc.top;    rc.left = rc.top = 0;    CkFillRect(dc, &rc, brush);    CkDeleteObject(brush);#ifndef USE_CKGRAPH_IMP    CkSelectPalette(dc, oldPalette, TRUE);#endif    CkReleaseDC(hwnd, dc);}/* *---------------------------------------------------------------------- * * XChangeWindowAttributes -- * *	This function is called when the attributes on a window are *	updated.  Since Tk maintains all of the window state, the only *	relevant value is the cursor. * * Results: *	None. * * Side effects: *	May cause the mouse position to be updated. * *---------------------------------------------------------------------- */voidXChangeWindowAttributes(display, w, valueMask, attributes)    Display* display;    Window w;    unsigned long valueMask;    XSetWindowAttributes* attributes;{    if (valueMask & CWCursor) {	XDefineCursor(display, w, attributes->cursor);    }}/* *---------------------------------------------------------------------- * * TkWinSetWindowPos -- * *	Adjust the stacking order of a window relative to a second *	window (or NULL). * * Results: *	None. * * Side effects: *	Moves the specified window in the stacking order. * *---------------------------------------------------------------------- */voidTkWinSetWindowPos(hwnd, siblingHwnd, pos)    HWND hwnd;			/* Window to restack. */    HWND siblingHwnd;		/* Sibling window. */    int pos;			/* One of Above or Below. */{    HWND temp;    /*     * Since Windows does not support Above mode, we place the     * specified window below the sibling and then swap them.     */    if (siblingHwnd) {	if (pos == Above) {	    SetWindowPos(hwnd, siblingHwnd, 0, 0, 0, 0,		    SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);	    temp = hwnd;	    hwnd = siblingHwnd;	    siblingHwnd = temp;	}    } else {	siblingHwnd = (pos == Above) ? HWND_TOP : HWND_BOTTOM;    }    SetWindowPos(hwnd, siblingHwnd, 0, 0, 0, 0,	    SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);}/* *---------------------------------------------------------------------- * * TkpWindowWasRecentlyDeleted -- * *	Determines whether we know if the window given as argument was *	recently deleted. Called by the generic code error handler to *	handle BadWindow events. * * Results: *	Always 0. We do not keep this information on Windows. * * Side effects: *	None. * *---------------------------------------------------------------------- */intTkpWindowWasRecentlyDeleted(win, dispPtr)    Window win;    TkDisplay *dispPtr;{    return 0;}

⌨️ 快捷键说明

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