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

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

?? window.c

?? 遠(yuǎn)程登陸工具軟件源碼 用于遠(yuǎn)程登陸unix
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
    int ret;

    if (reentering)
	return;			       /* don't unpend the pending */

    pending_netevent = FALSE;

    reentering = 1;
    ret = select_result(pend_netevent_wParam, pend_netevent_lParam);
    reentering = 0;

    if (ret == 0 && !session_closed) {
	/* Abnormal exits will already have set session_closed and taken
	 * appropriate action. */
	if (cfg.close_on_exit == FORCE_ON ||
	    cfg.close_on_exit == AUTO) PostQuitMessage(0);
	else {
	    char morestuff[100];
	    session_closed = TRUE;
	    sprintf(morestuff, "%.70s (inactive)", appname);
	    set_icon(NULL, morestuff);
	    set_title(NULL, morestuff);
	    MessageBox(hwnd, "Connection closed by remote host",
		       appname, MB_OK | MB_ICONINFORMATION);
	}
    }
}

/*
 * Copy the colour palette from the configuration data into defpal.
 * This is non-trivial because the colour indices are different.
 */
static void cfgtopalette(void)
{
    int i;
    static const int ww[] = {
	6, 7, 8, 9, 10, 11, 12, 13,
	14, 15, 16, 17, 18, 19, 20, 21,
	0, 1, 2, 3, 4, 4, 5, 5
    };

    for (i = 0; i < 24; i++) {
	int w = ww[i];
	defpal[i].rgbtRed = cfg.colours[w][0];
	defpal[i].rgbtGreen = cfg.colours[w][1];
	defpal[i].rgbtBlue = cfg.colours[w][2];
    }

    /* Override with system colours if appropriate */
    if (cfg.system_colour)
        systopalette();
}

/*
 * Override bit of defpal with colours from the system.
 * (NB that this takes a copy the system colours at the time this is called,
 * so subsequent colour scheme changes don't take effect. To fix that we'd
 * probably want to be using GetSysColorBrush() and the like.)
 */
static void systopalette(void)
{
    int i;
    static const struct { int nIndex; int norm; int bold; } or[] =
    {
	{ COLOR_WINDOWTEXT,	16, 17 }, /* Default Foreground */
	{ COLOR_WINDOW,		18, 19 }, /* Default Background */
	{ COLOR_HIGHLIGHTTEXT,	20, 21 }, /* Cursor Text */
	{ COLOR_HIGHLIGHT,	22, 23 }, /* Cursor Colour */
    };

    for (i = 0; i < (sizeof(or)/sizeof(or[0])); i++) {
	COLORREF colour = GetSysColor(or[i].nIndex);
	defpal[or[i].norm].rgbtRed =
	   defpal[or[i].bold].rgbtRed = GetRValue(colour);
	defpal[or[i].norm].rgbtGreen =
	   defpal[or[i].bold].rgbtGreen = GetGValue(colour);
	defpal[or[i].norm].rgbtBlue =
	   defpal[or[i].bold].rgbtBlue = GetBValue(colour);
    }
}

/*
 * Set up the colour palette.
 */
static void init_palette(void)
{
    int i;
    HDC hdc = GetDC(hwnd);
    if (hdc) {
	if (cfg.try_palette && GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) {
	    /*
	     * This is a genuine case where we must use smalloc
	     * because the snew macros can't cope.
	     */
	    logpal = smalloc(sizeof(*logpal)
			     - sizeof(logpal->palPalEntry)
			     + NCOLOURS * sizeof(PALETTEENTRY));
	    logpal->palVersion = 0x300;
	    logpal->palNumEntries = NCOLOURS;
	    for (i = 0; i < NCOLOURS; i++) {
		logpal->palPalEntry[i].peRed = defpal[i].rgbtRed;
		logpal->palPalEntry[i].peGreen = defpal[i].rgbtGreen;
		logpal->palPalEntry[i].peBlue = defpal[i].rgbtBlue;
		logpal->palPalEntry[i].peFlags = PC_NOCOLLAPSE;
	    }
	    pal = CreatePalette(logpal);
	    if (pal) {
		SelectPalette(hdc, pal, FALSE);
		RealizePalette(hdc);
		SelectPalette(hdc, GetStockObject(DEFAULT_PALETTE), FALSE);
	    }
	}
	ReleaseDC(hwnd, hdc);
    }
    if (pal)
	for (i = 0; i < NCOLOURS; i++)
	    colours[i] = PALETTERGB(defpal[i].rgbtRed,
				    defpal[i].rgbtGreen,
				    defpal[i].rgbtBlue);
    else
	for (i = 0; i < NCOLOURS; i++)
	    colours[i] = RGB(defpal[i].rgbtRed,
			     defpal[i].rgbtGreen, defpal[i].rgbtBlue);
}

/*
 * Initialise all the fonts we will need initially. There may be as many as
 * three or as few as one.  The other (poentially) twentyone fonts are done
 * if/when they are needed.
 *
 * We also:
 *
 * - check the font width and height, correcting our guesses if
 *   necessary.
 *
 * - verify that the bold font is the same width as the ordinary
 *   one, and engage shadow bolding if not.
 * 
 * - verify that the underlined font is the same width as the
 *   ordinary one (manual underlining by means of line drawing can
 *   be done in a pinch).
 */
static void init_fonts(int pick_width, int pick_height)
{
    TEXTMETRIC tm;
    CPINFO cpinfo;
    int fontsize[3];
    int i;
    HDC hdc;
    int fw_dontcare, fw_bold;

    for (i = 0; i < FONT_MAXNO; i++)
	fonts[i] = NULL;

    bold_mode = cfg.bold_colour ? BOLD_COLOURS : BOLD_FONT;
    und_mode = UND_FONT;

    if (cfg.font.isbold) {
	fw_dontcare = FW_BOLD;
	fw_bold = FW_HEAVY;
    } else {
	fw_dontcare = FW_DONTCARE;
	fw_bold = FW_BOLD;
    }

    hdc = GetDC(hwnd);

    if (pick_height)
	font_height = pick_height;
    else {
	font_height = cfg.font.height;
	if (font_height > 0) {
	    font_height =
		-MulDiv(font_height, GetDeviceCaps(hdc, LOGPIXELSY), 72);
	}
    }
    font_width = pick_width;

#define f(i,c,w,u) \
    fonts[i] = CreateFont (font_height, font_width, 0, 0, w, FALSE, u, FALSE, \
			   c, OUT_DEFAULT_PRECIS, \
		           CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, \
			   FIXED_PITCH | FF_DONTCARE, cfg.font.name)

    f(FONT_NORMAL, cfg.font.charset, fw_dontcare, FALSE);

    lfont.lfHeight = font_height;
    lfont.lfWidth = font_width;
    lfont.lfEscapement = 0;
    lfont.lfOrientation  = 0;
    lfont.lfWeight  = fw_dontcare;
    lfont.lfItalic = FALSE;
    lfont.lfUnderline = FALSE;
    lfont.lfStrikeOut = FALSE;
    lfont.lfCharSet = cfg.font.charset;
    lfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
    lfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
    lfont.lfQuality = DEFAULT_QUALITY;
    lfont.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
    strncpy(lfont.lfFaceName, cfg.font.name, LF_FACESIZE);

    SelectObject(hdc, fonts[FONT_NORMAL]);
    GetTextMetrics(hdc, &tm);

    if (pick_width == 0 || pick_height == 0) {
	font_height = tm.tmHeight;
	font_width = tm.tmAveCharWidth;
    }
    font_dualwidth = (tm.tmAveCharWidth != tm.tmMaxCharWidth);

#ifdef RDB_DEBUG_PATCH
    debug(23, "Primary font H=%d, AW=%d, MW=%d",
	    tm.tmHeight, tm.tmAveCharWidth, tm.tmMaxCharWidth);
#endif

    {
	CHARSETINFO info;
	DWORD cset = tm.tmCharSet;
	memset(&info, 0xFF, sizeof(info));

	/* !!! Yes the next line is right */
	if (cset == OEM_CHARSET)
	    ucsdata.font_codepage = GetOEMCP();
	else
	    if (TranslateCharsetInfo ((DWORD *) cset, &info, TCI_SRCCHARSET))
		ucsdata.font_codepage = info.ciACP;
	else
	    ucsdata.font_codepage = -1;

	GetCPInfo(ucsdata.font_codepage, &cpinfo);
	ucsdata.dbcs_screenfont = (cpinfo.MaxCharSize > 1);
    }

    f(FONT_UNDERLINE, cfg.font.charset, fw_dontcare, TRUE);

    /*
     * Some fonts, e.g. 9-pt Courier, draw their underlines
     * outside their character cell. We successfully prevent
     * screen corruption by clipping the text output, but then
     * we lose the underline completely. Here we try to work
     * out whether this is such a font, and if it is, we set a
     * flag that causes underlines to be drawn by hand.
     *
     * Having tried other more sophisticated approaches (such
     * as examining the TEXTMETRIC structure or requesting the
     * height of a string), I think we'll do this the brute
     * force way: we create a small bitmap, draw an underlined
     * space on it, and test to see whether any pixels are
     * foreground-coloured. (Since we expect the underline to
     * go all the way across the character cell, we only search
     * down a single column of the bitmap, half way across.)
     */
    {
	HDC und_dc;
	HBITMAP und_bm, und_oldbm;
	int i, gotit;
	COLORREF c;

	und_dc = CreateCompatibleDC(hdc);
	und_bm = CreateCompatibleBitmap(hdc, font_width, font_height);
	und_oldbm = SelectObject(und_dc, und_bm);
	SelectObject(und_dc, fonts[FONT_UNDERLINE]);
	SetTextAlign(und_dc, TA_TOP | TA_LEFT | TA_NOUPDATECP);
	SetTextColor(und_dc, RGB(255, 255, 255));
	SetBkColor(und_dc, RGB(0, 0, 0));
	SetBkMode(und_dc, OPAQUE);
	ExtTextOut(und_dc, 0, 0, ETO_OPAQUE, NULL, " ", 1, NULL);
	gotit = FALSE;
	for (i = 0; i < font_height; i++) {
	    c = GetPixel(und_dc, font_width / 2, i);
	    if (c != RGB(0, 0, 0))
		gotit = TRUE;
	}
	SelectObject(und_dc, und_oldbm);
	DeleteObject(und_bm);
	DeleteDC(und_dc);
	if (!gotit) {
	    und_mode = UND_LINE;
	    DeleteObject(fonts[FONT_UNDERLINE]);
	    fonts[FONT_UNDERLINE] = 0;
	}
    }

    if (bold_mode == BOLD_FONT) {
	f(FONT_BOLD, cfg.font.charset, fw_bold, FALSE);
    }
#undef f

    descent = tm.tmAscent + 1;
    if (descent >= font_height)
	descent = font_height - 1;

    for (i = 0; i < 3; i++) {
	if (fonts[i]) {
	    if (SelectObject(hdc, fonts[i]) && GetTextMetrics(hdc, &tm))
		fontsize[i] = tm.tmAveCharWidth + 256 * tm.tmHeight;
	    else
		fontsize[i] = -i;
	} else
	    fontsize[i] = -i;
    }

    ReleaseDC(hwnd, hdc);

    if (fontsize[FONT_UNDERLINE] != fontsize[FONT_NORMAL]) {
	und_mode = UND_LINE;
	DeleteObject(fonts[FONT_UNDERLINE]);
	fonts[FONT_UNDERLINE] = 0;
    }

    if (bold_mode == BOLD_FONT &&
	fontsize[FONT_BOLD] != fontsize[FONT_NORMAL]) {
	bold_mode = BOLD_SHADOW;
	DeleteObject(fonts[FONT_BOLD]);
	fonts[FONT_BOLD] = 0;
    }
    fontflag[0] = fontflag[1] = fontflag[2] = 1;

    init_ucs(&cfg, &ucsdata);
}

static void another_font(int fontno)
{
    int basefont;
    int fw_dontcare, fw_bold;
    int c, u, w, x;
    char *s;

    if (fontno < 0 || fontno >= FONT_MAXNO || fontflag[fontno])
	return;

    basefont = (fontno & ~(FONT_BOLDUND));
    if (basefont != fontno && !fontflag[basefont])
	another_font(basefont);

    if (cfg.font.isbold) {
	fw_dontcare = FW_BOLD;
	fw_bold = FW_HEAVY;
    } else {
	fw_dontcare = FW_DONTCARE;
	fw_bold = FW_BOLD;
    }

    c = cfg.font.charset;
    w = fw_dontcare;
    u = FALSE;
    s = cfg.font.name;
    x = font_width;

    if (fontno & FONT_WIDE)
	x *= 2;
    if (fontno & FONT_NARROW)
	x = (x+1)/2;
    if (fontno & FONT_OEM)
	c = OEM_CHARSET;
    if (fontno & FONT_BOLD)
	w = fw_bold;
    if (fontno & FONT_UNDERLINE)
	u = TRUE;

    fonts[fontno] =
	CreateFont(font_height * (1 + !!(fontno & FONT_HIGH)), x, 0, 0, w,
		   FALSE, u, FALSE, c, OUT_DEFAULT_PRECIS,
		   CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
		   FIXED_PITCH | FF_DONTCARE, s);

    fontflag[fontno] = 1;
}

static void deinit_fonts(void)
{
    int i;
    for (i = 0; i < FONT_MAXNO; i++) {
	if (fonts[i])
	    DeleteObject(fonts[i]);
	fonts[i] = 0;
	fontflag[i] = 0;
    }
}

void request_resize(void *frontend, int w, int h)
{
    int width, height;

    /* If the window is maximized supress resizing attempts */
    if (IsZoomed(hwnd)) {
	if (cfg.resize_action == RESIZE_TERM)
	    return;
    }

    if (cfg.resize_action == RESIZE_DISABLED) return;
    if (h == term->rows && w == term->cols) return;

    /* Sanity checks ... */
    {
	static int first_time = 1;
	static RECT ss;

	switch (first_time) {
	  case 1:
	    /* Get the size of the screen */
	    if (get_fullscreen_rect(&ss))
		/* first_time = 0 */ ;
	    else {
		first_time = 2;
		break;
	    }
	  case 0:
	    /* Make sure the values are sane */
	    width = (ss.right - ss.left - extra_width) / 4;
	    height = (ss.bottom - ss.top - extra_height) / 6;

	    if (w > width || h > height)
		return;
	    if (w < 15)
		w = 15;
	    if (h < 1)
		h = 1;
	}
    }

    term_size(term, h, w, cfg.savelines);

    if (cfg.resize_action != RESIZE_FONT && !IsZoomed(hwnd)) {
	width = extra_width + font_width * w;
	height = extra_height + font_height * h;

	SetWindowPos(hwnd, NULL, 0, 0, width, height,
	    SWP_NOACTIVATE | SWP_NOCOPYBITS |
	    SWP_NOMOVE | SWP_NOZORDER);
    } else
	reset_window(0);

    InvalidateRect(hwnd, NULL, TRUE);
}

static void reset_window(int reinit) {
    /*
     * This function decides how to resize or redraw when the 
     * user changes something. 
     *
     * This function doesn't like to change the terminal size but if the
     * font size is locked that may be it's only soluion.
     */
    int win_width, win_height;
    RECT cr, wr;

#ifdef RDB_DEBUG_PATCH
    debug((27, "reset_window()"));
#endif

    /* Current window sizes ... */
    GetWindowRect(hwnd, &wr);
    GetClientRect(hwnd, &cr);

    win_width  = cr.right - cr.left;
    win_height = cr.bottom - cr.top;

    if (cfg.resize_action == RESIZE_DISABLED) reinit = 2;

    /* Are we being forced to reload the fonts ? */
    if (reinit>1) {
#ifdef RDB_DEBUG_PATCH
	debug((27, "reset_window() -- Forced deinit"));
#endif
	deinit_fonts();
	init_fonts(0,0);
    }

    /* Oh, looks like we're minimised */
    if (win_width == 0 || win_height == 0)
	return;

    /* Is the window out of position ? */
    if ( !reinit && 
	    (offset_width != (win_width-font_width*term->cols)/2 ||
	     offset_height != (win_height-font_height*term->rows)/2) ){
	offset_width = (win_width-font_width*term->cols)/2;
	offset_height = (win_height-font_height*term->rows)/2;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
884aa四虎影成人精品一区| 欧美一区二区三区视频在线观看 | 欧美α欧美αv大片| 成人av在线看| 久久成人免费网站| 亚洲国产aⅴ天堂久久| 国产精品成人午夜| 久久婷婷色综合| 欧美精品乱人伦久久久久久| 94色蜜桃网一区二区三区| 国模套图日韩精品一区二区 | 久久久精品国产99久久精品芒果| 在线影院国内精品| 不卡av在线网| 国产精品1区2区3区| 日本午夜一本久久久综合| 亚洲女同女同女同女同女同69| 久久日韩精品一区二区五区| 欧美人牲a欧美精品| 欧亚洲嫩模精品一区三区| 99久久综合狠狠综合久久| 精品中文字幕一区二区| 日本女人一区二区三区| 亚洲综合色区另类av| 国产精品久久777777| 国产亚洲短视频| 久久亚洲一区二区三区四区| 欧美大片日本大片免费观看| 欧美日韩美女一区二区| 在线观看免费成人| 在线观看日韩高清av| 在线一区二区三区四区| 欧美亚洲日本国产| 91福利社在线观看| 欧美午夜寂寞影院| 欧美视频在线不卡| 欧美日韩免费一区二区三区视频| 在线观看av不卡| 欧美午夜不卡在线观看免费| 欧美三级三级三级| 91精品国产91热久久久做人人| 在线观看亚洲精品视频| 欧美亚洲国产一区二区三区va| 在线精品视频一区二区| 欧美亚洲一区三区| 91精品国产手机| 日韩精品中文字幕一区| 久久久久久久久久久电影| 国产亚洲欧美一级| 亚洲欧洲日韩在线| 亚洲国产视频直播| 日本午夜一区二区| 国产一区二区三区四区五区美女| 国产精品1024| 91香蕉视频污在线| 欧美日韩一区二区在线视频| 日韩三级高清在线| 久久久亚洲高清| 成人欧美一区二区三区视频网页| 亚洲精品视频免费观看| 亚洲va国产天堂va久久en| 久久黄色级2电影| 国产91丝袜在线观看| 色婷婷av一区二区三区gif | 欧美日韩精品欧美日韩精品| 91麻豆精品国产91久久久久久 | 欧美视频在线一区| 亚洲精品写真福利| 一卡二卡三卡日韩欧美| 蜜臀av一区二区在线观看| 国产一区二区不卡老阿姨| 成人免费观看视频| 欧美午夜精品一区二区蜜桃| 精品三级在线看| 自拍偷拍亚洲激情| 麻豆国产91在线播放| 成人久久18免费网站麻豆| 欧美片在线播放| 国产三级一区二区| 亚洲va欧美va天堂v国产综合| 国产一区二区女| 精品视频一区三区九区| 久久午夜老司机| 亚洲国产欧美在线人成| 国产激情一区二区三区桃花岛亚洲| 日本精品一区二区三区高清 | 国产麻豆视频精品| 欧美在线一区二区三区| 久久一留热品黄| 亚洲成人自拍一区| 成人国产在线观看| 日韩网站在线看片你懂的| 亚洲乱码国产乱码精品精小说 | 男人的天堂久久精品| 91亚洲精品一区二区乱码| 亚洲精品在线三区| 亚洲图片自拍偷拍| 成人国产一区二区三区精品| 日韩精品资源二区在线| 亚洲高清视频中文字幕| 成人午夜在线免费| 日韩欧美久久久| 亚洲成人动漫在线免费观看| av激情成人网| 久久久精品蜜桃| 麻豆国产一区二区| 欧美精品久久一区| 亚洲欧美日韩成人高清在线一区| 国产美女在线观看一区| 欧美一区二区在线免费播放 | 九九**精品视频免费播放| 欧美日韩久久久一区| 亚洲欧美国产77777| 高清国产午夜精品久久久久久| 日韩精品一区二区三区在线观看 | 亚洲成av人影院在线观看网| 99在线热播精品免费| 国产亚洲欧美日韩在线一区| 美女被吸乳得到大胸91| 欧美日韩你懂得| 亚洲成人中文在线| 欧美三级韩国三级日本三斤| 亚洲精品中文字幕乱码三区| 成人18视频日本| 中文字幕精品—区二区四季| 国产一区二区三区精品视频| 精品福利在线导航| 久久成人免费网| 精品国产髙清在线看国产毛片 | 成人网在线免费视频| 国产日韩影视精品| 国产精品18久久久| 国产欧美日韩另类一区| 国产91丝袜在线播放九色| 久久久精品国产免费观看同学| 国产九色sp调教91| 欧美高清在线一区| 成人免费不卡视频| 国产精品久久久久久久第一福利| 大尺度一区二区| 亚洲天堂2016| 色成年激情久久综合| 亚洲一区免费观看| 日韩一区二区三区免费观看| 久久超级碰视频| 国产色91在线| 91免费看视频| 亚洲不卡在线观看| 欧美一区二区三区在线观看视频| 免费欧美在线视频| 久久久精品2019中文字幕之3| 国产黄色91视频| 亚洲视频在线观看三级| 欧美性色黄大片| 免费在线成人网| 国产亚洲成av人在线观看导航| 成人精品视频一区二区三区 | 欧美高清性hdvideosex| 免费成人在线视频观看| 久久精品欧美一区二区三区不卡 | 久久精品欧美日韩精品| 99re热这里只有精品视频| 亚洲国产aⅴ天堂久久| 日韩免费高清av| 成人激情免费网站| 亚洲韩国精品一区| 精品黑人一区二区三区久久| 成人黄色在线视频| 亚洲无线码一区二区三区| 久久―日本道色综合久久| 一本色道久久综合狠狠躁的推荐 | 亚洲精品精品亚洲| 日韩亚洲欧美高清| 成人av网站在线观看免费| 亚洲第一久久影院| 国产亚洲va综合人人澡精品| 色屁屁一区二区| 国内成人精品2018免费看| 亚洲黄色小说网站| 精品国产一区a| 在线精品视频小说1| 国产精品亚洲视频| 亚洲一区二区三区四区在线 | 国产精品99久久久久久久vr | 亚洲成人免费在线| 日本一区二区免费在线观看视频| 欧美午夜片在线看| 成人影视亚洲图片在线| 奇米综合一区二区三区精品视频| 18成人在线观看| 久久免费精品国产久精品久久久久| 91国产精品成人| 成人av在线资源网站| 奇米影视一区二区三区| 亚洲人午夜精品天堂一二香蕉| 精品成人私密视频| 欧美日本不卡视频| 色综合色综合色综合| 高清不卡一区二区| 久久99精品久久久|