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

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

?? text.c

?? 一個很有名的瀏覽器
?? C
字號:
/* Text widget implementation. *//* $Id: text.c,v 1.116.4.1 2005/04/05 21:11:05 jonas Exp $ */#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <ctype.h>#include <stdlib.h>#include <string.h>#include "elinks.h"#include "bfu/dialog.h"#include "bfu/text.h"#include "config/kbdbind.h"#include "intl/gettext/libintl.h"#include "terminal/draw.h"#include "terminal/mouse.h"#include "terminal/terminal.h"#include "util/color.h"#define is_unsplitable(pos) (*(pos) && *(pos) != '\n' && !isspace(*(pos)))voidadd_dlg_text(struct dialog *dlg, unsigned char *text,	     enum format_align align, int bottom_pad){	struct widget *widget;	widget = &dlg->widgets[dlg->number_of_widgets++];	widget->type = WIDGET_TEXT;	widget->text = text;	widget->info.text.align = align;	widget->info.text.is_label = !!bottom_pad;}/* Returns length of substring (from start of @text) before a split. */static inline intsplit_line(unsigned char *text, int max_width){	unsigned char *split = text;	if (max_width <= 0) return 0;	while (*split && *split != '\n') {		unsigned char *next_split = split + 1;		while (is_unsplitable(next_split))			next_split++;		if (next_split - text > max_width) {			/* Force a split if no position was found yet,			 * meaning there's no splittable substring under			 * requested width. */			if (split == text) {				split = &text[max_width];				/* Give preference to split on a punctuation				 * if any. Note that most of the time				 * punctuation char is followed by a space so				 * this rule will not match often.				 * We match dash and quotes too. */				while (--split != text) {					if (!ispunct(*split)) continue;					split++;					break;				}				/* If no way to do a clean split, just return				 * requested maximal width. */				if (split == text)					return max_width;			}			break;		}		split = next_split;	}	return split - text;}#undef is_unsplitable#define LINES_GRANULARITY 0x7#define realloc_lines(x, o, n) mem_align_alloc(x, o, n, unsigned char *, LINES_GRANULARITY)/* Find the start of each line with the current max width */static unsigned char **split_lines(struct widget_data *widget_data, int max_width){	unsigned char *text = widget_data->widget->text;	unsigned char **lines = (unsigned char **) widget_data->cdata;	int line = 0;	if (widget_data->info.text.max_width == max_width) return lines;	/* We want to recalculate the max line width */	widget_data->box.width = 0;	while (*text) {		int width;		/* Skip first leading \n or space. */		if (isspace(*text)) text++;		if (!*text) break;		width = split_line(text, max_width);		/* split_line() may return 0. */		if (width < 1) {			width = 1; /* Infinite loop prevention. */		}		int_lower_bound(&widget_data->box.width, width);		if (!realloc_lines(&lines, line, line + 1))			break;		lines[line++] = text;		text += width;	}	/* Yes it might be a bit ugly on the other hand it will be autofreed	 * for us. */	widget_data->cdata = (unsigned char *) lines;	widget_data->info.text.lines = line;	widget_data->info.text.max_width = max_width;	return lines;}/* Format text according to dialog box and alignment. */voiddlg_format_text_do(struct terminal *term, unsigned char *text,		int x, int *y, int width, int *real_width,		struct color_pair *color, enum format_align align){	int line_width;	int firstline = 1;	for (; *text; text += line_width, (*y)++) {		int shift;		/* Skip first leading \n or space. */		if (!firstline && isspace(*text))			text++;		else			firstline = 0;		if (!*text) break;		line_width = split_line(text, width);		/* split_line() may return 0. */		if (line_width < 1) {			line_width = 1; /* Infinite loop prevention. */			continue;		}		if (real_width) int_lower_bound(real_width, line_width);		if (!term || !line_width) continue;		/* Calculate the number of chars to indent */		if (align == ALIGN_CENTER)			shift = (width - line_width) / 2;		else if (align == ALIGN_RIGHT)			shift = width - line_width;		else			shift = 0;		assert(line_width <= width && shift < width);		draw_text(term, x + shift, *y, text, line_width, 0, color);	}}voiddlg_format_text(struct terminal *term, struct widget_data *widget_data,		int x, int *y, int width, int *real_width, int max_height){	unsigned char *text = widget_data->widget->text;	unsigned char saved = 0;	unsigned char *saved_pos = NULL;	/* If we are drawing set up the box before setting up the	 * scrolling. */	set_box(&widget_data->box, x, *y,		widget_data->box.width, int_max(0, max_height - 3));	if (widget_data->box.height == 0) return;	/* Can we scroll and do we even have to? */	if (widget_data->widget->info.text.is_scrollable	    && (widget_data->info.text.max_width != width		|| widget_data->box.height < widget_data->info.text.lines))	{		unsigned char **lines;		int current;		int visible;		/* Ensure that the current split is valid but don't		 * split if we don't have to */		if (widget_data->box.width != width		    && !split_lines(widget_data, width))			return;		lines = (unsigned char **) widget_data->cdata;		/* Make maximum number of lines available */		visible = int_max(widget_data->info.text.lines - widget_data->box.height,				  widget_data->box.height);		int_bounds(&widget_data->info.text.current, 0, visible);		current = widget_data->info.text.current;		/* Set the current position */		text = lines[current];		/* Do we have to force a text end ? */		visible = widget_data->info.text.lines - current;		if (visible > widget_data->box.height) {			int lines_pos = current + widget_data->box.height;			saved_pos = lines[lines_pos];			/* We save the start of lines so backtrack to see			 * if the previous line has a line end that should			 * also be trimmed. */			if (lines_pos > 0 && saved_pos[-1] == '\n')				saved_pos--;			saved = *saved_pos;			*saved_pos = '\0';		}		/* Force dialog to be the width of the longest line */		if (real_width) int_lower_bound(real_width, widget_data->box.width);	} else {		/* Always reset @current if we do not need to scroll */		widget_data->info.text.current = 0;	}	dlg_format_text_do(term, text,		x, y, width, real_width,		get_bfu_color(term, "dialog.text"),		widget_data->widget->info.text.align);	if (widget_data->widget->info.text.is_label) (*y)--;	/* If we scrolled and something was trimmed restore it */	if (saved && saved_pos) *saved_pos = saved;}static t_handler_event_statusdisplay_text(struct dialog_data *dlg_data, struct widget_data *widget_data){	struct window *win = dlg_data->win;	struct box box;	int scale, current, step;	int lines = widget_data->info.text.lines;	set_box(&box,		dlg_data->box.x + dlg_data->box.width - DIALOG_LEFT_BORDER - 1,		widget_data->box.y,		1,		widget_data->box.height);	if (!text_is_scrollable(widget_data) || box.height <= 0)		return EVENT_PROCESSED;	draw_box(win->term, &box, ' ', 0,		 get_bfu_color(win->term, "dialog.scrollbar"));	current = widget_data->info.text.current;	scale = (box.height + 1) * 100 / lines;	/* Scale the offset of @current */	step = (current + 1) * scale / 100;	int_bounds(&step, 0, widget_data->box.height - 1);	/* Scale the number of visible lines */	box.height = (box.height + 1) * scale / 100;	int_bounds(&box.height, 1, int_max(widget_data->box.height - step, 1));	/* Ensure we always step to the last position too */	if (lines - widget_data->box.height == current) {		step = widget_data->box.height - box.height;	}	box.y += step;#ifdef CONFIG_MOUSE	/* Save infos about selected scrollbar position and size.	 * We'll use it when handling mouse. */	widget_data->info.text.scroller_height = box.height;	widget_data->info.text.scroller_y = box.y;#endif	draw_box(win->term, &box, ' ', 0,		 get_bfu_color(win->term, "dialog.scrollbar-selected"));	/* Hope this is at least a bit reasonable. Set cursor	 * and window pointer to start of the first text line. */	set_cursor(win->term, widget_data->box.x, widget_data->box.y, 1);	set_window_ptr(win, widget_data->box.x, widget_data->box.y);	return EVENT_PROCESSED;}static voidformat_and_display_text(struct widget_data *widget_data,			struct dialog_data *dlg_data,			int current){	struct terminal *term = dlg_data->win->term;	int y = widget_data->box.y;	int height = dialog_max_height(term);	int lines = widget_data->info.text.lines;	assert(lines >= 0);	assert(widget_data->box.height >= 0);	int_bounds(&current, 0, lines - widget_data->box.height);	if (widget_data->info.text.current == current) return;	widget_data->info.text.current = current;	draw_box(term, &widget_data->box, ' ', 0,		 get_bfu_color(term, "dialog.generic"));	dlg_format_text(term, widget_data,			widget_data->box.x, &y, widget_data->box.width, NULL,			height);	display_text(dlg_data, widget_data);	redraw_from_window(dlg_data->win);}static t_handler_event_statuskbd_text(struct dialog_data *dlg_data, struct widget_data *widget_data){	int current = widget_data->info.text.current;	struct term_event *ev = dlg_data->term_event;	switch (kbd_action(KEYMAP_MENU, ev, NULL)) {		case ACT_MENU_UP:			current--;			break;		case ACT_MENU_DOWN:			current++;			break;		case ACT_MENU_PAGE_UP:			current -= widget_data->box.height;			break;		case ACT_MENU_PAGE_DOWN:			current += widget_data->box.height;			break;		case ACT_MENU_HOME:			current = 0;			break;		case ACT_MENU_END:			current = widget_data->info.text.lines;			break;		default:			return EVENT_NOT_PROCESSED;	}	format_and_display_text(widget_data, dlg_data, current);	return EVENT_PROCESSED;}static t_handler_event_statusmouse_text(struct dialog_data *dlg_data, struct widget_data *widget_data){#ifdef CONFIG_MOUSE	int border = DIALOG_LEFT_BORDER + DIALOG_LEFT_INNER_BORDER;	int current = widget_data->info.text.current;	int scroller_y = widget_data->info.text.scroller_y;	int scroller_height = widget_data->info.text.scroller_height;	int scroller_middle = scroller_y + scroller_height/2			      - widget_data->info.text.scroller_last_dir;	struct box scroller_box;	struct term_event *ev = dlg_data->term_event;	set_box(&scroller_box,		dlg_data->box.x + dlg_data->box.width - 1 - border,		widget_data->box.y,		DIALOG_LEFT_INNER_BORDER * 2 + 1,		widget_data->box.height);	/* One can scroll by clicking or rolling the wheel on the scrollbar	 * or one or two cells to its left or its right. */	if (!check_mouse_position(ev, &scroller_box))		return EVENT_NOT_PROCESSED;	switch (get_mouse_button(ev)) {	case B_LEFT:		/* Left click scrolls up or down by one step. */		if (ev->info.mouse.y <= scroller_middle)			current--;		else			current++;		break;	case B_RIGHT:		/* Right click scrolls up or down by more than one step.		 * Faster. */		if (ev->info.mouse.y <= scroller_middle)			current -= 5;		else			current += 5;		break;	case B_WHEEL_UP:		/* Mouse wheel up scrolls up. */		current--;		break;	case B_WHEEL_DOWN:		/* Mouse wheel up scrolls down. */		current++;		break;	default:		return EVENT_NOT_PROCESSED;	}	/* Save last direction used. */	if (widget_data->info.text.current < current)		widget_data->info.text.scroller_last_dir = 1;	else		widget_data->info.text.scroller_last_dir = -1;	format_and_display_text(widget_data, dlg_data, current);#endif /* CONFIG_MOUSE */	return EVENT_PROCESSED;}struct widget_ops text_ops = {	display_text,	NULL,	mouse_text,	kbd_text,	NULL,	NULL,};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久蜜桃| 国产精品福利av| 91精品国产91热久久久做人人| 在线欧美日韩精品| 色婷婷亚洲精品| 色婷婷精品大在线视频 | 欧美一区二区三区四区高清| 欧美性感一区二区三区| 欧美在线观看18| 欧美性受极品xxxx喷水| 欧美少妇性性性| 欧美一区二区啪啪| 日韩久久久精品| 久久久噜噜噜久噜久久综合| 国产视频亚洲色图| 自拍偷拍亚洲欧美日韩| 亚洲精品乱码久久久久久黑人| 亚洲综合一区二区| 午夜电影久久久| 蜜桃一区二区三区在线| 国产一区二区三区日韩| 成人激情视频网站| 91在线一区二区| 欧美日韩中文字幕一区| 日韩欧美资源站| 国产三级欧美三级日产三级99| 国产精品国产a级| 亚洲一区二区五区| 毛片不卡一区二区| 国产盗摄一区二区| 色悠悠久久综合| 91精品国产91久久久久久最新毛片| 欧美哺乳videos| 综合电影一区二区三区| 日韩精品一二三区| 国产一区欧美日韩| 色综合久久久久久久久久久| 制服丝袜成人动漫| 国产人成亚洲第一网站在线播放| 最新国产の精品合集bt伙计| 日韩不卡一区二区三区| 国产精品主播直播| 日本韩国精品在线| 精品久久久久久综合日本欧美| 亚洲国产成人在线| 五月天中文字幕一区二区| 国产成人免费视频网站| 欧美三级在线看| 久久久精品日韩欧美| 亚洲高清三级视频| 成人午夜精品在线| 69堂成人精品免费视频| 亚洲欧洲精品天堂一级 | 成人在线视频一区| 欧美一区二区私人影院日本| 国产精品嫩草影院av蜜臀| 亚洲www啪成人一区二区麻豆| 国产精品一级在线| 91精品国产综合久久久蜜臀粉嫩| 日本一区二区久久| 青青草原综合久久大伊人精品| 99视频一区二区三区| 欧美zozo另类异族| 亚洲午夜一区二区| 成人短视频下载| 精品久久久久久亚洲综合网| 亚洲成人第一页| 97国产精品videossex| 久久一夜天堂av一区二区三区| 亚洲国产精品久久一线不卡| 成人av网在线| 久久久青草青青国产亚洲免观| 香港成人在线视频| 色诱视频网站一区| 国产精品美女久久久久久久网站| 久久精品国产一区二区三区免费看| 日本精品裸体写真集在线观看| 欧美国产日产图区| 久草在线在线精品观看| 欧美男女性生活在线直播观看| 国产精品三级久久久久三级| 国产一区二区三区四区五区入口| 欧美一级一级性生活免费录像| 亚洲一区欧美一区| 色素色在线综合| 中文字幕一区免费在线观看 | 欧美日韩精品二区第二页| 自拍偷拍亚洲欧美日韩| 成人激情免费视频| 日本一区二区成人| 福利一区二区在线| 国产亚洲精品资源在线26u| 久久精品国产色蜜蜜麻豆| 538在线一区二区精品国产| 一区二区三区四区激情| 91网站在线观看视频| 国产欧美一区二区精品性色超碰| 久久99久久久久久久久久久| 日韩一区二区电影网| 免费视频最近日韩| 日韩免费高清视频| 麻豆精品新av中文字幕| 日韩欧美一级精品久久| 免费观看一级特黄欧美大片| 欧美精品 国产精品| 91黄色小视频| 亚洲乱码国产乱码精品精的特点 | 日本欧美久久久久免费播放网| 91色婷婷久久久久合中文| 亚洲视频狠狠干| 色婷婷综合激情| 亚洲综合无码一区二区| 欧美日韩在线精品一区二区三区激情| 亚洲综合免费观看高清完整版在线 | 日韩色视频在线观看| 久久99在线观看| 国产色综合久久| 99精品国产热久久91蜜凸| 日韩理论片中文av| 欧美丝袜丝交足nylons图片| 亚洲成人中文在线| 精品国精品自拍自在线| 国产毛片精品视频| 国产精品白丝在线| 日本精品一级二级| 久久综合精品国产一区二区三区 | 视频一区视频二区中文| 国产成人夜色高潮福利影视| 国产日韩欧美电影| av电影天堂一区二区在线观看| 亚洲视频在线观看一区| 欧美日韩久久久| 久久99精品久久久久久| 国产欧美1区2区3区| 97久久人人超碰| 日韩在线卡一卡二| 26uuu欧美| 白白色亚洲国产精品| 午夜一区二区三区视频| 精品毛片乱码1区2区3区 | 精品日韩在线观看| 成人国产精品免费网站| 亚洲成av人片一区二区三区| 亚洲精品一区二区三区在线观看| 成人小视频在线| 亚洲bt欧美bt精品| 久久亚洲综合色| 在线免费观看日本欧美| 国产主播一区二区三区| 亚洲激情在线激情| 精品国产一区二区三区久久影院| bt7086福利一区国产| 日本系列欧美系列| 中文字幕亚洲不卡| 欧美一级欧美三级在线观看 | 欧美mv日韩mv国产| 在线亚洲欧美专区二区| 国内精品国产三级国产a久久| 日韩久久一区二区| 久久综合久久99| 精品国产免费久久| 欧美性感一区二区三区| 福利视频网站一区二区三区| 日本在线观看不卡视频| 中文字幕日韩欧美一区二区三区| 91精品国产91综合久久蜜臀| 色综合婷婷久久| 国产精品99久久久久久似苏梦涵| 亚洲在线中文字幕| 国产精品美女久久久久久久久 | av午夜精品一区二区三区| 免费不卡在线视频| 亚洲精品亚洲人成人网| 久久久久久免费| 91精品国产综合久久婷婷香蕉 | 国产午夜久久久久| 日韩欧美一级精品久久| 欧美日韩精品一区二区三区四区 | 99久久精品国产毛片| 久久激情五月激情| 五月天丁香久久| 综合网在线视频| 国产精品另类一区| 久久久久久一二三区| 欧美疯狂性受xxxxx喷水图片| 色综合色综合色综合色综合色综合 | 中文字幕中文字幕一区| 久久久亚洲高清| 日韩一二三四区| 欧美一区二区三区成人| 在线观看欧美黄色| 99精品热视频| 成人国产精品免费观看| 国产不卡在线播放| 国产一区二区三区久久久| 久久se精品一区精品二区| 日本一不卡视频| 麻豆精品一区二区三区| 久久国产综合精品| 青娱乐精品视频|