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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? alert.c

?? 操作系統SunOS 4.1.3版本的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
#ifndef lint#ifdef sccsstatic char     sccsid[] = "@(#)alert.c 1.1 92/07/30";#endif#endif#ifndef ecd.alert/* * Copyright (c) 1986, 1987 by Sun Microsystems, Inc. */#include <stdio.h>#include <ctype.h>#include <varargs.h>#include <sys/file.h>#include <sys/types.h>#include <sys/time.h>#include <sys/ioctl.h>#include <sundev/kbd.h>#include <sundev/kbio.h>#include <sunwindow/sun.h>#include <sunwindow/defaults.h>#include <sunwindow/window_hs.h>#include <sunwindow/win_enum.h>#include <sunwindow/win_ioctl.h>	/* for journaling */#include <suntool/fullscreen.h>#include <suntool/sunview.h>#include <suntool/tool_struct.h>#include <suntool/panel.h>#include <suntool/help.h>#include <suntool/alert.h>#include <suntool/alert_impl.h>/* ------------------------------------------------------------------ *//* --------------------------- Globals ------------------------------ *//* ------------------------------------------------------------------ */static alert_handle		saved_alert;static struct pixfont		*button_font;static int			default_beeps;static int			alert_use_audible_bell;static int			alert_jump_cursor;static int			alert_ignore_optional;static int			alert_fd;static Rect			alert_screen_rect;static struct rect		irect, orect;static short alert_arrow_right[] = {#include <images/rightswoosh.icon>};mpr_static(alert_arrow_right_pr, 64, 64, 1, alert_arrow_right);static short alert_leftswoosh[] = {#include <images/leftswoosh.icon>};mpr_static(alert_leftswoosh_pr, 64, 64, 1, alert_leftswoosh);static short alert_bang[] = {#include <images/alert_bang32.pr>};mpr_static(alert_bang_pr, 32, 32, 1, alert_bang);static short alert_qmark[] = {#include <images/alert_qmark32.pr>};mpr_static(alert_qmark_pr, 32, 32, 1, alert_qmark);static short alert_gray50_data[] = {#include <images/square_50.pr>};mpr_static(alert_gray50_patch, 16, 16, 1, alert_gray50_data);/* ------------------------------------------------------------------ *//* --------------------------- DISPLAY PROCS ------------------------ *//* ------------------------------------------------------------------ */static int		alert_show();		/* display alert	 */static void		alert_get_alert_size(); /* determine rect        */static Pw_pixel_cache  *alert_drawbox();        /* draw outline & shadow */static void		alert_layout();		/* draw items            */static void		alert_build_button();	/* compute button pr     */static void		alert_outline_button(); /* draw std button       */static void		alert_yes_outline_button();  /* draw YES button  *//* ------------------------------------------------------------------ *//* --------------------------- UTILITY PROCS ------------------------ *//* ------------------------------------------------------------------ */static void		alert_select_button();static void		alert_unselect_button();static void		alert_preview_message_font();static void		alert_preview_button_font();static void 		alert_set_avlist();static void		alert_default();static void		alert_add_button_to_list();static int		alert_text_width();static int		alert_button_width();static int		alert_get_fd();static button_handle	alert_button_for_event();static int		alert_offset_from_baseline();static int		calc_max();static button_handle	create_button_struct();static void		free_button_structs();static void		alert_copy_event();static void		alert_do_bell();static void		alert_blocking_wait();/* ------------------------------------------------------------------ *//* --------------------------- STATICS ------------------------------ *//* ------------------------------------------------------------------ */static int		left_marg = 5;static int 		right_marg = 5;static int		top_marg = 5;static int		bottom_marg = 10;static int		row_gap = 4;static int		button_gap;static int		min_button_gap = 4;/* * In the case that the height of the swoosh is larger than the height of  * the total text, short_text_line is the number of the lines in the text. * Otherwise, it's 0. */static int		 short_text_line;static struct pixfont	*defpf;static int		 swoosh_height;#define BORDER			3	/* white space surounding text */#define SHADOW			6	/* thickness of shadow */#define BUTTON_HEIGHT_EXTRA	8  	/* max extra needed for yes button */#define YES_BUTTON_Y_DIFF	4	/* height diff between yes and no  */#define ALERT_ACTION_DO_IT	'\015'  /* simple return */#define SWOOSH_PIXRECTS_H_OFFSET	16#define SWOOSH_PIXRECTS_V_OFFSET		16#define MENU_BORDER		2/* * Number of pixels of the swoosh that is hanging outside the alert_box */#define SWOOSH_OUTSIDE_BOX		52/* * journaling */extern	int	sv_journal;extern	void	win_sync();/* ------------------------------------------------------------------ *//* ----------------------- Public Interface ------------------------- *//* ------------------------------------------------------------------ */intalert_init(){    if (!saved_alert)  {	char	*font_name;	int	my_fd;	saved_alert = (struct alert *)calloc(1, sizeof(struct alert));	if (!saved_alert) {	    (void)printf(stderr, "Alert ERROR: malloc failed.");	    return (1);	}	alert_use_audible_bell = (int)defaults_get_boolean(	    "/SunView/Audible_Bell", (Bool)TRUE, (int *)NULL);	alert_jump_cursor = (int)defaults_get_boolean(	    "/SunView/Alert_Jump_Cursor", (Bool)TRUE, (int *)NULL);	alert_ignore_optional = (int)defaults_get_boolean(	    "/SunView/Ignore_Optional_Alerts", (Bool)FALSE , (int *)NULL);	font_name = defaults_get_string(	    "/Menu/Font",		    "/usr/lib/fonts/fixedwidthfonts/screen.b.14", 		    (int *)0);	button_font = pf_open(font_name);	default_beeps = defaults_get_integer(		"/SunView/Alert_Bell", 1, (int *)NULL);	defpf = pw_pfsysopen();        if (!button_font)            button_font = defpf;	/*	 * assuming that the swoosh from the top of the alert_box proper, then	 * swoosh_height is the number of pixels from the top of the alert_box to	 * lowest point of the swoosh glyph.	 */	swoosh_height = alert_leftswoosh_pr.pr_size.x + SWOOSH_PIXRECTS_V_OFFSET +		    (alert_arrow_right_pr.pr_size.x - alert_leftswoosh_pr.pr_size.x);    }    if (alert_fd) {        win_getrect(alert_fd, &irect);        win_getsavedrect(alert_fd, &orect);    }    else {        if (alert_get_fd(&saved_alert->fd_for_fullscreen) == 0) {		return (1);        }    }    return (0);}/* VARARGS */intalert_prompt(client_frame, event, va_alist)    Frame	 client_frame;    Event	*event;    va_dcl{    va_list			valist;    int 			result;    for (;;) {	va_start(valist);	result = alert_show(client_frame, event, valist);	va_end(valist);	if (result != ALERT_HELP)	    break;	help_request(client_frame, saved_alert->help_data, event);    }    win_setrect(alert_fd, &irect);    win_setsavedrect(alert_fd, &orect);    return (result);}/* ------------------------------------------------------------------ *//* ----------------------PRIVATE PROCS------------------------------- *//* ------------------------------------------------------------------ */static intalert_show(client_frame, event, valist)    Frame	 client_frame;    Event	*event;    va_list	valist;{    Event			ie;    Alert_attribute		avlist[ATTR_STANDARD_SIZE];    register alert_handle	alert;    int				result, fd;    Pw_pixel_cache		*bitmap_under;    struct rect 		rectsaved, rect;    struct fullscreen 		*fs;    button_handle	button;    button_handle	current_button = NULL;    int			is_highlighted = FALSE;    int			old_mousex, old_mousey;    unsigned short	this_event;        if (alert_init())	return (ALERT_FAILED);    alert = saved_alert;    fd = alert->fd_for_fullscreen;    (void) alert_default(alert);    alert->event = (Event *)event;    alert->client_frame = client_frame;    attr_make (avlist, ATTR_STANDARD_SIZE, valist);    (void)alert_set_avlist (alert, avlist, FALSE);        /* only if ALERT_OPTIONAL && ALERT_BUTTON_YES && default option */    if (alert->is_optional &&		alert->yes_button_exists &&		(alert_ignore_optional == TRUE))        return (ALERT_YES);    alert_do_bell(alert, fd);    fs = fullscreen_init(fd); /* go fullscreen first */    if (fs == 0) {	return (ALERT_FAILED);  /* probably out of fds */    }    /*     * should get FULLSCREEN from <sunwindow/cursor_impl.h>     * but "fullscreen" macro conflicts with the use of     * "fullscreen" struct in <suntool/fullscreen.h>     */#define	FULLSCREEN	0x10    fs->fs_cachedcursor.flags = FULLSCREEN;    (void)win_setcursor(fs->fs_windowfd, &fs->fs_cachedcursor);    /* now determine the size of the alert */    (void)alert_get_alert_size(alert, &rect, fs->fs_windowfd);    if ((bitmap_under = alert_drawbox( /* then draw empty box */		fs->fs_pixwin, &rect, &rectsaved, fs)) == NULL)	goto RestoreState;    /* now fill in the box with the image, text, buttons etc */    (void)alert_layout(alert, &rect, fs->fs_pixwin);    if (alert_jump_cursor && alert->yes_button_exists) {	button_handle	curr;      	old_mousex = win_get_vuid_value(fd, LOC_X_ABSOLUTE);    	old_mousey = win_get_vuid_value(fd, LOC_Y_ABSOLUTE);	for (curr = alert->button_info; curr != NULL; curr = curr->next) 	    if (curr->is_yes)	    	win_setmouseposition(fd,	    	    curr->button_rect.r_left + curr->button_rect.r_width / 2,	    	    curr->button_rect.r_top + curr->button_rect.r_height / 2	    	    );    }    /*     * if journaling, send sync point.     */    if (sv_journal) 	win_sync(WIN_SYNC_ALERT, fd);    /*     * Change the owner of the windowfd(WMGR_ENV_PLACEHOLDER) so that     * when we go into the loop to read event, we will be able to do so.      * Otherwise the events will go to the original owner of the window,     * which is sunview.     */      win_setowner(fs->fs_windowfd, getpid());    /* Stay in fullscreen until a button is pressed, or trigger used */    for (;;) {	unsigned short	trigger = alert->default_input_code;    	if (input_readevent(fs->fs_windowfd, &ie) == -1)	    break;	this_event = event_action(&ie); /* get encoded event */		button = alert_button_for_event(alert, &ie);	if ((this_event == trigger) && ((trigger == (int)MS_LEFT) ? 	    (event_is_up(&ie) && (current_button == NULL)) : 1)) { 	    /* catch UP mouse left */	    alert->result = ALERT_TRIGGERED;	    (void) alert_copy_event(alert, &ie);	    goto Done;	} else if (((this_event == ACTION_STOP) || (this_event == WIN_STOP))	        && saved_alert->no_button_exists) {	    alert->result = ALERT_NO;	    (void) alert_copy_event(alert, &ie);	    goto Done;        } else if ((this_event == ACTION_DO_IT	         || this_event == ALERT_ACTION_DO_IT)		    && saved_alert->yes_button_exists) {	    alert->result = ALERT_YES;	    (void) alert_copy_event(alert, &ie);	    goto Done;	} else if ((this_event == MS_LEFT) && (alert->button_info)) {	    if (event_is_down(&ie) && (button != NULL)) {		alert_select_button(fs->fs_pixwin, button);		current_button = button;		is_highlighted = TRUE;	    } else if (event_is_up(&ie)) {		if ((current_button && is_highlighted)			&& (button != NULL)	                && (button == current_button)) {		    alert->result = button->value;		    (void) alert_copy_event(alert, &ie);		    goto Done;		} else if ((current_button && is_highlighted)		        && (button != NULL)	                && (button != current_button)) {		    alert->result = button->value;		    (void) alert_copy_event(alert, &ie);		    goto Done;		}	    }	} else if (this_event == ACTION_HELP) {	    if (event_is_down(&ie)) {		alert->result = ALERT_HELP;		(void) alert_copy_event(alert, &ie);		goto Done;	    }	} else if (this_event == LOC_DRAG) {/* mouse moved w/MS down */	    if (((current_button != NULL) && is_highlighted)		    && ((button == NULL))		    &&  (button != current_button)) {		alert_unselect_button(fs->fs_pixwin, current_button);		current_button = NULL;		is_highlighted = FALSE;	    }	    if ((button != current_button) && (is_highlighted == FALSE)) {		alert_select_button(fs->fs_pixwin, button);		current_button = button;		is_highlighted = TRUE;	    }	}    }Done:    pw_restore_pixels(fs->fs_pixwin, bitmap_under);RestoreState:    if (alert_jump_cursor && alert->yes_button_exists) 	    win_setmouseposition(fd, old_mousex, old_mousey);    fullscreen_destroy(fs);    free_button_structs(alert->button_info);    result = alert->result;    return (result);}static voidalert_copy_event(alert, event)    register alert_handle alert;    Event		 *event;{    if (saved_alert->event == (Event *) 0) {	return;    } else {	saved_alert->event->ie_code = event->ie_code;	saved_alert->event->ie_flags = event->ie_flags;	saved_alert->event->ie_shiftmask = event->ie_shiftmask;	saved_alert->event->ie_locx = event->ie_locx;	saved_alert->event->ie_locy = event->ie_locy;	saved_alert->event->ie_time.tv_sec = event->ie_time.tv_sec;	saved_alert->event->ie_time.tv_usec = event->ie_time.tv_usec;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区四区五区入口 | 色婷婷av一区二区三区之一色屋| 在线看国产一区二区| 日韩一区二区精品在线观看| 日本一区二区三区四区| 三级欧美韩日大片在线看| caoporen国产精品视频| 日韩欧美国产小视频| 一区二区不卡在线播放| 国产激情一区二区三区桃花岛亚洲| 91黄色免费看| 亚洲欧洲av在线| 国产一区二区三区香蕉 | 欧美成人猛片aaaaaaa| 亚洲精品免费在线| 大胆欧美人体老妇| 26uuu精品一区二区| 日韩影院免费视频| 欧美亚洲国产一区二区三区| 中文字幕视频一区| 丁香婷婷深情五月亚洲| 精品国精品自拍自在线| 免费在线观看视频一区| 欧美精品在线观看一区二区| 亚洲激情成人在线| 色婷婷av久久久久久久| 亚洲日本在线天堂| 99久久精品国产毛片| 欧美极品xxx| 欧美日韩免费在线视频| 亚洲男同性恋视频| 91蜜桃视频在线| 一区二区三区日本| 欧美性猛片aaaaaaa做受| 夜夜精品视频一区二区 | 成人欧美一区二区三区| 成人av网在线| 亚洲卡通欧美制服中文| 在线中文字幕不卡| 亚洲成av人片一区二区梦乃| 欧美日韩你懂的| 青椒成人免费视频| 日韩精品一区二区在线| 精品中文字幕一区二区| 国产午夜精品一区二区三区视频| 国产精品99精品久久免费| 国产精品免费视频观看| 91麻豆swag| 亚洲地区一二三色| 欧美一区午夜精品| 国产精品一级片在线观看| 国产精品护士白丝一区av| 91福利在线导航| 日韩av电影免费观看高清完整版在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲欧美日韩在线| 欧美性大战久久久久久久| 亚洲成a人片综合在线| 日韩免费福利电影在线观看| 国产成人精品网址| 亚洲午夜久久久久| 精品国产乱码久久久久久老虎| 国产91高潮流白浆在线麻豆| 亚洲欧美另类小说| 精品久久五月天| 91在线视频网址| 亚洲123区在线观看| 久久综合一区二区| 色婷婷亚洲精品| 韩国毛片一区二区三区| 亚洲精品综合在线| 久久色中文字幕| 欧美亚洲一区二区在线| 日韩不卡在线观看日韩不卡视频| 精品国产乱码久久久久久免费 | 欧美日韩一级片在线观看| 国产资源在线一区| 夜夜精品浪潮av一区二区三区| 777a∨成人精品桃花网| 99re热视频精品| 国产一区二区影院| 亚洲福利国产精品| 中文字幕一区二区三区在线播放| 欧美一区二区不卡视频| 色综合天天综合网天天狠天天| 婷婷开心久久网| 亚洲色图丝袜美腿| 久久精品视频一区二区| 欧美一区二区三区系列电影| 91天堂素人约啪| 国产精品系列在线观看| 奇米在线7777在线精品| 亚洲婷婷在线视频| 日本一区二区三区在线不卡| 欧美一区二区三区免费在线看| 一本一道久久a久久精品| 国产ts人妖一区二区| 免费观看一级特黄欧美大片| 亚洲国产综合色| 亚洲欧美视频一区| 欧美国产一区二区在线观看| 欧美成va人片在线观看| 欧美一区2区视频在线观看| 日本乱码高清不卡字幕| 91丝袜呻吟高潮美腿白嫩在线观看| 国产成a人亚洲精| 国产资源精品在线观看| 精品午夜一区二区三区在线观看| 日韩国产欧美视频| 日韩中文字幕区一区有砖一区| 亚洲美女一区二区三区| 亚洲靠逼com| 一区二区三区免费在线观看| 亚洲精品网站在线观看| 亚洲人成精品久久久久| 日韩一区在线免费观看| 亚洲色图欧美激情| 亚洲黄色片在线观看| 亚洲精品免费在线| 亚洲成人精品在线观看| 亚洲18色成人| 麻豆精品精品国产自在97香蕉| 美腿丝袜在线亚洲一区| 精品一区二区三区不卡| 国产精品一区二区男女羞羞无遮挡 | 欧美顶级少妇做爰| 亚洲人成在线播放网站岛国| 26uuu国产电影一区二区| 欧美精品一区男女天堂| 国产肉丝袜一区二区| 中文欧美字幕免费| 综合激情成人伊人| 亚洲国产另类精品专区| 欧美96一区二区免费视频| 韩国视频一区二区| 成人av电影在线| 91色.com| 日韩午夜小视频| 欧美激情资源网| 亚洲在线成人精品| 日本美女一区二区| 国产69精品久久久久777| 91视视频在线观看入口直接观看www | 一区二区三区四区不卡视频| 亚洲午夜一区二区三区| 麻豆精品蜜桃视频网站| 欧美成人精品福利| 国产成人精品aa毛片| 国产在线视频一区二区| 高清国产午夜精品久久久久久| 94-欧美-setu| 91精品欧美一区二区三区综合在 | 欧美人与禽zozo性伦| 精品国产免费人成电影在线观看四季| 欧美激情一区二区三区在线| 亚洲成人动漫精品| 国产黄色精品视频| 欧美日韩国产三级| 国产精品网曝门| 日本视频在线一区| 99精品国产热久久91蜜凸| 欧美一区二区精品久久911| 中文字幕亚洲一区二区av在线 | 精品国精品自拍自在线| 亚洲精品高清视频在线观看| 午夜欧美电影在线观看| 日产精品久久久久久久性色| 成人综合在线观看| 制服丝袜av成人在线看| 亚洲欧美偷拍三级| 国产精品影视在线观看| 欧美一区三区四区| 综合久久久久综合| 国内精品写真在线观看| 欧美精品久久99| 自拍偷在线精品自拍偷无码专区 | 亚洲一区二区三区影院| 国产成人综合在线播放| 欧美疯狂性受xxxxx喷水图片| 日韩一区有码在线| 成人一区二区视频| 日韩欧美一区二区久久婷婷| 亚洲精品欧美激情| 91麻豆6部合集magnet| 国产欧美日韩三区| 国产乱子伦视频一区二区三区 | 91在线你懂得| 国产精品成人一区二区三区夜夜夜| 精品一二线国产| 日韩免费福利电影在线观看| 日日夜夜精品视频天天综合网| 在线观看日韩高清av| 亚洲日本韩国一区| 91色视频在线| 亚洲精品v日韩精品| 99精品国产91久久久久久| 国产精品国产自产拍高清av王其| 成人免费福利片| 国产精品高潮久久久久无| 东方欧美亚洲色图在线|