亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tkunixmenubu.c

?? NS2網(wǎng)絡(luò)仿真軟件是目前最為流行的網(wǎng)絡(luò)仿真模擬軟件
?? C
字號(hào):
/*  * tkUnixMenubu.c -- * *	This file implements the Unix specific portion of the *	menubutton widget. * * Copyright (c) 1996-1997 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tkUnixMenubu.c,v 1.6.4.1 2003/11/17 23:29:36 hobbs Exp $ */#include "tkMenubutton.h"/* * The structure below defines menubutton class behavior by means of * procedures that can be invoked from generic window code. */Tk_ClassProcs tkpMenubuttonClass = {    sizeof(Tk_ClassProcs),	/* size */    TkMenuButtonWorldChanged,	/* worldChangedProc */};/* *---------------------------------------------------------------------- * * TkpCreateMenuButton -- * *	Allocate a new TkMenuButton structure. * * Results: *	Returns a newly allocated TkMenuButton structure. * * Side effects: *	Registers an event handler for the widget. * *---------------------------------------------------------------------- */TkMenuButton *TkpCreateMenuButton(tkwin)    Tk_Window tkwin;{    return (TkMenuButton *)ckalloc(sizeof(TkMenuButton));}/* *---------------------------------------------------------------------- * * TkpDisplayMenuButton -- * *	This procedure is invoked to display a menubutton widget. * * Results: *	None. * * Side effects: *	Commands are output to X to display the menubutton in its *	current mode. * *---------------------------------------------------------------------- */voidTkpDisplayMenuButton(clientData)    ClientData clientData;	/* Information about widget. */{    register TkMenuButton *mbPtr = (TkMenuButton *) clientData;    GC gc;    Tk_3DBorder border;    Pixmap pixmap;    int x = 0;			/* Initialization needed only to stop				 * compiler warning. */    int y = 0;    register Tk_Window tkwin = mbPtr->tkwin;    int width=0, height=0, fullWidth=0, fullHeight=0;    int textXOffset, textYOffset;    int imageWidth, imageHeight;    int imageXOffset, imageYOffset; /* image information that will be used to				     * restrict disabled pixmap as well */    int haveImage = 0, haveText = 0;    mbPtr->flags &= ~REDRAW_PENDING;    if ((mbPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {	return;    }    if ((mbPtr->state == STATE_DISABLED) && (mbPtr->disabledFg != NULL)) {	gc = mbPtr->disabledGC;	border = mbPtr->normalBorder;    } else if ((mbPtr->state == STATE_ACTIVE)	       && !Tk_StrictMotif(mbPtr->tkwin)) {	gc = mbPtr->activeTextGC;	border = mbPtr->activeBorder;    } else {	gc = mbPtr->normalTextGC;	border = mbPtr->normalBorder;    }    if (mbPtr->image != None) {	Tk_SizeOfImage(mbPtr->image, &width, &height);	haveImage = 1;    } else if (mbPtr->bitmap != None) {	Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);	haveImage = 1;    }    imageWidth  = width;    imageHeight = height;    haveText = (mbPtr->textWidth != 0 && mbPtr->textHeight != 0);    /*     * In order to avoid screen flashes, this procedure redraws     * the menu button in a pixmap, then copies the pixmap to the     * screen in a single operation.  This means that there's no     * point in time where the on-sreen image has been cleared.     */    pixmap = Tk_GetPixmap(mbPtr->display, Tk_WindowId(tkwin),	    Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));    Tk_Fill3DRectangle(tkwin, pixmap, border, 0, 0, Tk_Width(tkwin),	    Tk_Height(tkwin), 0, TK_RELIEF_FLAT);    imageXOffset = 0;    imageYOffset = 0;    textXOffset = 0;    textYOffset = 0;    fullWidth = 0;    fullHeight = 0;    if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) {        switch ((enum compound) mbPtr->compound) {            case COMPOUND_TOP:            case COMPOUND_BOTTOM: {                /* Image is above or below text */                if (mbPtr->compound == COMPOUND_TOP) {                    textYOffset = height + mbPtr->padY;                } else {                    imageYOffset = mbPtr->textHeight + mbPtr->padY;                }                fullHeight = height + mbPtr->textHeight + mbPtr->padY;                fullWidth = (width > mbPtr->textWidth ? width :                        mbPtr->textWidth);                textXOffset = (fullWidth - mbPtr->textWidth)/2;                imageXOffset = (fullWidth - width)/2;                break;            }            case COMPOUND_LEFT:            case COMPOUND_RIGHT: {                /* Image is left or right of text */                if (mbPtr->compound == COMPOUND_LEFT) {                    textXOffset = width + mbPtr->padX;                } else {                    imageXOffset = mbPtr->textWidth + mbPtr->padX;                }                fullWidth = mbPtr->textWidth + mbPtr->padX + width;                fullHeight = (height > mbPtr->textHeight ? height :                        mbPtr->textHeight);                textYOffset = (fullHeight - mbPtr->textHeight)/2;                imageYOffset = (fullHeight - height)/2;                break;            }            case COMPOUND_CENTER: {                /* Image and text are superimposed */                fullWidth = (width > mbPtr->textWidth ? width :                        mbPtr->textWidth);                fullHeight = (height > mbPtr->textHeight ? height :                        mbPtr->textHeight);                textXOffset = (fullWidth - mbPtr->textWidth)/2;                imageXOffset = (fullWidth - width)/2;                textYOffset = (fullHeight - mbPtr->textHeight)/2;                imageYOffset = (fullHeight - height)/2;                break;            }            case COMPOUND_NONE: {break;}        }        TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,		mbPtr->indicatorWidth + fullWidth, fullHeight, &x, &y);	imageXOffset += x;	imageYOffset += y;	if (mbPtr->image != NULL) {	    Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,		    imageXOffset, imageYOffset);	} else if (mbPtr->bitmap != None) {	    XSetClipOrigin(mbPtr->display, gc, imageXOffset, imageYOffset);	    XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,		    gc, 0, 0, (unsigned) width, (unsigned) height, 		    imageXOffset, imageYOffset, 1);	    XSetClipOrigin(mbPtr->display, gc, 0, 0);	}	Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout,		x + textXOffset, y + textYOffset, 0, -1);	Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout,		x + textXOffset, y + textYOffset, mbPtr->underline);    } else if (haveImage) {	TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,		width + mbPtr->indicatorWidth, height, &x, &y);	imageXOffset += x;	imageYOffset += y;	if (mbPtr->image != NULL) {	    Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,		    imageXOffset, imageYOffset);	} else if (mbPtr->bitmap != None) {	    XSetClipOrigin(mbPtr->display, gc, x, y);	    XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,		    gc, 0, 0, (unsigned) width, (unsigned) height, 		    x, y, 1);	    XSetClipOrigin(mbPtr->display, gc, 0, 0);	}    } else {	TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY,		mbPtr->textWidth + mbPtr->indicatorWidth,		mbPtr->textHeight, &x, &y);	Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, 		x + textXOffset, y + textYOffset, 0, -1);	Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc,		mbPtr->textLayout, x + textXOffset, y + textYOffset,		mbPtr->underline);    }    /*     * If the menu button is disabled with a stipple rather than a special     * foreground color, generate the stippled effect.     */    if ((mbPtr->state == STATE_DISABLED)             && ((mbPtr->disabledFg == NULL) || (mbPtr->image != NULL))) {	/*	 * Stipple the whole button if no disabledFg was specified,	 * otherwise restrict stippling only to displayed image	 */	if (mbPtr->disabledFg == NULL) {	    XFillRectangle(mbPtr->display, pixmap, mbPtr->stippleGC,		    mbPtr->inset, mbPtr->inset,		    (unsigned) (Tk_Width(tkwin) - 2*mbPtr->inset),		    (unsigned) (Tk_Height(tkwin) - 2*mbPtr->inset));	} else {	    XFillRectangle(mbPtr->display, pixmap, mbPtr->stippleGC,		    imageXOffset, imageYOffset,		    (unsigned) imageWidth, (unsigned) imageHeight);	}    }    /*     * Draw the cascade indicator for the menu button on the     * right side of the window, if desired.     */    if (mbPtr->indicatorOn) {	int borderWidth;	borderWidth = (mbPtr->indicatorHeight+1)/3;	if (borderWidth < 1) {	    borderWidth = 1;	}	/*y += mbPtr->textHeight / 2;*/	Tk_Fill3DRectangle(tkwin, pixmap, border,		Tk_Width(tkwin) - mbPtr->inset - mbPtr->indicatorWidth		+ mbPtr->indicatorHeight,		((int) (Tk_Height(tkwin) - mbPtr->indicatorHeight))/2,		mbPtr->indicatorWidth - 2*mbPtr->indicatorHeight,		mbPtr->indicatorHeight, borderWidth, TK_RELIEF_RAISED);    }    /*     * Draw the border and traversal highlight last.  This way, if the     * menu button's contents overflow onto the border they'll be covered     * up by the border.     */    if (mbPtr->relief != TK_RELIEF_FLAT) {	Tk_Draw3DRectangle(tkwin, pixmap, border,		mbPtr->highlightWidth, mbPtr->highlightWidth,		Tk_Width(tkwin) - 2*mbPtr->highlightWidth,		Tk_Height(tkwin) - 2*mbPtr->highlightWidth,		mbPtr->borderWidth, mbPtr->relief);    }    if (mbPtr->highlightWidth != 0) {	GC gc;	if (mbPtr->flags & GOT_FOCUS) {	    gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap);	} else {	    gc = Tk_GCForColor(mbPtr->highlightBgColorPtr, pixmap);	}	Tk_DrawFocusHighlight(tkwin, gc, mbPtr->highlightWidth, pixmap);    }    /*     * Copy the information from the off-screen pixmap onto the screen,     * then delete the pixmap.     */    XCopyArea(mbPtr->display, pixmap, Tk_WindowId(tkwin),	    mbPtr->normalTextGC, 0, 0, (unsigned) Tk_Width(tkwin),	    (unsigned) Tk_Height(tkwin), 0, 0);    Tk_FreePixmap(mbPtr->display, pixmap);}/* *---------------------------------------------------------------------- * * TkpDestroyMenuButton -- * *	Free data structures associated with the menubutton control. * * Results: *	None. * * Side effects: *	Restores the default control state. * *---------------------------------------------------------------------- */voidTkpDestroyMenuButton(mbPtr)    TkMenuButton *mbPtr;{}/* *---------------------------------------------------------------------- * * TkpComputeMenuButtonGeometry -- * *	After changes in a menu button's text or bitmap, this procedure *	recomputes the menu button's geometry and passes this information *	along to the geometry manager for the window. * * Results: *	None. * * Side effects: *	The menu button's window may change size. * *---------------------------------------------------------------------- */voidTkpComputeMenuButtonGeometry(mbPtr)    TkMenuButton *mbPtr;	/* Widget record for menu button. */{    int width, height, mm, pixels;    int  avgWidth, txtWidth, txtHeight;    int haveImage = 0, haveText = 0;    Tk_FontMetrics fm;    mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;    width = 0;    height = 0;    txtWidth = 0;    txtHeight = 0;    avgWidth = 0;    if (mbPtr->image != None) {	Tk_SizeOfImage(mbPtr->image, &width, &height);	haveImage = 1;    } else if (mbPtr->bitmap != None) {	Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);	haveImage = 1;    }    if (haveImage == 0 || mbPtr->compound != COMPOUND_NONE) {	Tk_FreeTextLayout(mbPtr->textLayout);	mbPtr->textLayout = Tk_ComputeTextLayout(mbPtr->tkfont, mbPtr->text,		-1, mbPtr->wrapLength, mbPtr->justify, 0, &mbPtr->textWidth,		&mbPtr->textHeight);	txtWidth = mbPtr->textWidth;	txtHeight = mbPtr->textHeight;        avgWidth = Tk_TextWidth(mbPtr->tkfont, "0", 1);        Tk_GetFontMetrics(mbPtr->tkfont, &fm);        haveText = (txtWidth != 0 && txtHeight != 0);    }    /*     * If the menubutton is compound (ie, it shows both an image and text),     * the new geometry is a combination of the image and text geometry.     * We only honor the compound bit if the menubutton has both text and     * an image, because otherwise it is not really a compound menubutton.     */    if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) {        switch ((enum compound) mbPtr->compound) {            case COMPOUND_TOP:            case COMPOUND_BOTTOM: {                /* Image is above or below text */                height += txtHeight + mbPtr->padY;                width = (width > txtWidth ? width : txtWidth);                break;            }            case COMPOUND_LEFT:            case COMPOUND_RIGHT: {                /* Image is left or right of text */                width += txtWidth + mbPtr->padX;                height = (height > txtHeight ? height : txtHeight);                break;            }            case COMPOUND_CENTER: {                /* Image and text are superimposed */                width = (width > txtWidth ? width : txtWidth);                height = (height > txtHeight ? height : txtHeight);                break;            }            case COMPOUND_NONE: {break;}        }        if (mbPtr->width > 0) {            width = mbPtr->width;        }        if (mbPtr->height > 0) {            height = mbPtr->height;        }        width += 2*mbPtr->padX;        height += 2*mbPtr->padY;    } else {	if (haveImage) {            if (mbPtr->width > 0) {                width = mbPtr->width;            }            if (mbPtr->height > 0) {                height = mbPtr->height;            }	} else {	    width = txtWidth;	    height = txtHeight;            if (mbPtr->width > 0) {                width = mbPtr->width * avgWidth;            }            if (mbPtr->height > 0) {                height = mbPtr->height * fm.linespace;            }	}    }    if (! haveImage) {        width += 2*mbPtr->padX;        height += 2*mbPtr->padY;    }    if (mbPtr->indicatorOn) {        mm = WidthMMOfScreen(Tk_Screen(mbPtr->tkwin));        pixels = WidthOfScreen(Tk_Screen(mbPtr->tkwin));        mbPtr->indicatorHeight= (INDICATOR_HEIGHT * pixels)/(10*mm);        mbPtr->indicatorWidth = (INDICATOR_WIDTH * pixels)/(10*mm)    	    + 2*mbPtr->indicatorHeight;        width += mbPtr->indicatorWidth;    } else {        mbPtr->indicatorHeight = 0;        mbPtr->indicatorWidth = 0;    }    Tk_GeometryRequest(mbPtr->tkwin, (int) (width + 2*mbPtr->inset),	    (int) (height + 2*mbPtr->inset));    Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国精品**一区二区三区在线蜜桃| 国产精品超碰97尤物18| 成人av电影在线| 日本成人在线看| 国产精品初高中害羞小美女文| 日韩欧美一区在线| 91成人免费网站| 国产精品69久久久久水密桃| 日本中文在线一区| 午夜精品一区二区三区三上悠亚| 亚洲精品成a人| 欧美极品aⅴ影院| 久久久亚洲综合| 欧美不卡激情三级在线观看| 亚洲视频综合在线| 国产精品视频一区二区三区不卡| 欧美成人官网二区| 93久久精品日日躁夜夜躁欧美| 国产一区二区不卡在线| 激情成人综合网| 国产在线精品一区二区不卡了| 麻豆91在线观看| 精品一区二区免费在线观看| 免费成人小视频| 蜜臀av一区二区在线免费观看| 喷水一区二区三区| 蜜桃av一区二区三区电影| 美女视频黄免费的久久| 蜜桃免费网站一区二区三区| 奇米色777欧美一区二区| 麻豆91在线播放| 日本欧美一区二区三区乱码| 蜜桃久久av一区| 狠狠v欧美v日韩v亚洲ⅴ| 国产在线观看免费一区| 国产精品自拍一区| 岛国av在线一区| 97久久精品人人澡人人爽| 91黄色激情网站| 欧美日韩精品一区二区天天拍小说| 欧美日韩在线播放| 91麻豆精品国产自产在线观看一区| 日韩欧美国产三级| 国产三级久久久| 亚洲美女区一区| 一区二区三区美女| 日本一不卡视频| 国产+成+人+亚洲欧洲自线| 国产在线精品一区在线观看麻豆| 国产91丝袜在线观看| 99久久99精品久久久久久| 色又黄又爽网站www久久| 欧美日韩精品高清| 久久一区二区三区国产精品| 国产精品无遮挡| 亚洲自拍偷拍欧美| 精品在线播放免费| zzijzzij亚洲日本少妇熟睡| 欧美午夜宅男影院| 精品国产区一区| 国产精品国模大尺度视频| 亚洲成av人片在线| 成人国产一区二区三区精品| 91精品国产综合久久久久久| 中文字幕在线一区免费| 麻豆精品久久久| 欧美综合一区二区三区| 国产亚洲精品免费| 麻豆精品新av中文字幕| 欧美伊人精品成人久久综合97| 国产欧美一区二区三区在线老狼| 亚洲成人免费影院| 99精品桃花视频在线观看| 精品国产乱码久久久久久久久 | 久久精品一二三| 亚洲va中文字幕| 97se狠狠狠综合亚洲狠狠| 精品处破学生在线二十三| 亚洲18色成人| 91久久一区二区| 国产精品国产三级国产aⅴ无密码| 久久精品国产99国产精品| 欧美在线观看一区二区| 成人欧美一区二区三区白人| 国产九九视频一区二区三区| 制服视频三区第一页精品| 亚洲最新视频在线播放| av电影天堂一区二区在线| 国产人成亚洲第一网站在线播放| 麻豆国产一区二区| 日韩网站在线看片你懂的| 亚洲3atv精品一区二区三区| 色综合久久天天| 亚洲欧美偷拍三级| 99久久综合色| 中文字幕佐山爱一区二区免费| 国产美女精品一区二区三区| 日韩欧美黄色影院| 久久精品国产亚洲aⅴ| 欧美一区二区三区性视频| 亚洲v中文字幕| 欧美日韩高清不卡| 午夜精品久久一牛影视| 欧美视频三区在线播放| 亚洲一级二级在线| 欧美色大人视频| 亚洲午夜在线视频| 欧美日韩一二三| 日日夜夜一区二区| 欧美一区二区大片| 美国三级日本三级久久99| 欧美一区二区在线免费播放| 免费不卡在线视频| 亚洲精品在线电影| 国产精品亚洲视频| 国产精品天干天干在观线| 成人精品小蝌蚪| 亚洲人成影院在线观看| 欧美专区日韩专区| 天天av天天翘天天综合网| 欧美一级欧美三级| 国产一区二区91| 国产精品二三区| 91久久国产综合久久| 亚洲午夜私人影院| 制服.丝袜.亚洲.中文.综合| 久久精工是国产品牌吗| 久久精品亚洲精品国产欧美kt∨ | 久久精品国产亚洲一区二区三区 | 亚洲电影在线播放| 欧美一区二区三区在线观看视频 | 亚洲美女视频在线| 91欧美激情一区二区三区成人| 17c精品麻豆一区二区免费| 日本乱码高清不卡字幕| 日韩国产一区二| 国产亚洲一二三区| 色综合久久88色综合天天| 日韩高清欧美激情| 欧美精品一区二区三区蜜臀| 成人黄色免费短视频| 亚洲午夜久久久久久久久久久| 91精品国产色综合久久 | 日韩午夜在线影院| 粉嫩av亚洲一区二区图片| 亚洲欧美另类小说| 91精品国产黑色紧身裤美女| 国产成人综合在线| 一区二区三区小说| 精品国产区一区| 91麻豆国产香蕉久久精品| 日韩成人午夜精品| 国产精品美女久久福利网站| 欧美三级三级三级爽爽爽| 国产在线播放一区三区四| 中文字幕一区二区三区不卡 | 欧美日韩国产中文| 国产成人午夜高潮毛片| 亚洲一级电影视频| 国产偷国产偷精品高清尤物| 欧美日韩色一区| 国产aⅴ精品一区二区三区色成熟| 亚洲激情av在线| 久久精品视频免费观看| 欧美精品v国产精品v日韩精品 | 成人av网在线| 免费人成精品欧美精品| 综合久久国产九一剧情麻豆| 欧美大黄免费观看| 91成人免费在线| 成人在线一区二区三区| 免费人成精品欧美精品| 亚洲黄色录像片| 日本一区二区视频在线观看| 欧美一级理论片| 在线视频综合导航| bt欧美亚洲午夜电影天堂| 激情综合色播激情啊| 午夜久久电影网| 亚洲激情自拍偷拍| 高清成人免费视频| 蓝色福利精品导航| 亚洲bt欧美bt精品| 一区二区三区高清| 自拍av一区二区三区| 国产欧美1区2区3区| 欧美大胆人体bbbb| 欧美精品 日韩| 欧美日韩精品电影| 欧美午夜理伦三级在线观看| av成人免费在线观看| 国产经典欧美精品| 国内精品写真在线观看| 天天操天天色综合| 亚洲v日本v欧美v久久精品| 一区二区国产盗摄色噜噜| 自拍av一区二区三区| 国产精品久久久久久久蜜臀| 国产女主播在线一区二区| 久久久久久综合|