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

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

?? lib_mouse.c

?? ncurses-5.4 需要的就來下把 一定會(huì)有用的哦
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/**************************************************************************** * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              * *                                                                          * * Permission is hereby granted, free of charge, to any person obtaining a  * * copy of this software and associated documentation files (the            * * "Software"), to deal in the Software without restriction, including      * * without limitation the rights to use, copy, modify, merge, publish,      * * distribute, distribute with modifications, sublicense, and/or sell       * * copies of the Software, and to permit persons to whom the Software is    * * furnished to do so, subject to the following conditions:                 * *                                                                          * * The above copyright notice and this permission notice shall be included  * * in all copies or substantial portions of the Software.                   * *                                                                          * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    * * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               * *                                                                          * * Except as contained in this notice, the name(s) of the above copyright   * * holders shall not be used in advertising or otherwise to promote the     * * sale, use or other dealings in this Software without prior written       * * authorization.                                                           * ****************************************************************************//**************************************************************************** *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               * *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         * *     and: Thomas E. Dickey 1996-2003                                      * ****************************************************************************//* * This module is intended to encapsulate ncurses's interface to pointing * devices. * * The first method used is xterm's internal mouse-tracking facility. * The second is Alessandro Rubini's GPM server. * * Notes for implementors of new mouse-interface methods: * * The code is logically split into a lower level that accepts event reports * in a device-dependent format and an upper level that parses mouse gestures * and filters events.  The mediating data structure is a circular queue of * MEVENT structures. * * Functionally, the lower level's job is to pick up primitive events and * put them on the circular queue.  This can happen in one of two ways: * either (a) _nc_mouse_event() detects a series of incoming mouse reports * and queues them, or (b) code in lib_getch.c detects the kmous prefix in * the keyboard input stream and calls _nc_mouse_inline to queue up a series * of adjacent mouse reports. * * In either case, _nc_mouse_parse() should be called after the series is * accepted to parse the digested mouse reports (low-level MEVENTs) into * a gesture (a high-level or composite MEVENT). * * Don't be too shy about adding new event types or modifiers, if you can find * room for them in the 32-bit mask.  The API is written so that users get * feedback on which theoretical event types they won't see when they call * mousemask. There's one bit per button (the RESERVED_EVENT bit) not being * used yet, and a couple of bits open at the high end. */#ifdef __EMX__#  include <io.h>#  define  INCL_DOS#  define  INCL_VIO#  define  INCL_KBD#  define  INCL_MOU#  define  INCL_DOSPROCESS#  include <os2.h>		/* Need to include before the others */#endif#include <curses.priv.h>MODULE_ID("$Id: lib_mouse.c,v 1.68 2003/11/08 21:50:50 tom Exp $")#include <term.h>#include <tic.h>#if USE_GPM_SUPPORT#ifndef LINT			/* don't need this for llib-lncurses */#undef buttons			/* term.h defines this, and gpm uses it! */#include <gpm.h>#include <linux/keyboard.h>	/* defines KG_* macros */#endif#endif#if USE_SYSMOUSE#undef buttons			/* symbol conflict in consio.h */#undef mouse_info		/* symbol conflict in consio.h */#include <osreldate.h>#if (__FreeBSD_version >= 400017)#include <sys/consio.h>#include <sys/fbio.h>#else#include <machine/console.h>#endif#endif /* use_SYSMOUSE */#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT#define	MASK_RELEASE(x)		((001 << (6 * ((x) - 1))))#define	MASK_PRESS(x)		((002 << (6 * ((x) - 1))))#define	MASK_CLICK(x)		((004 << (6 * ((x) - 1))))#define	MASK_DOUBLE_CLICK(x)	((010 << (6 * ((x) - 1))))#define	MASK_TRIPLE_CLICK(x)	((020 << (6 * ((x) - 1))))#define	MASK_RESERVED_EVENT(x)	((040 << (6 * ((x) - 1))))#define BUTTON_CLICKED  (BUTTON1_CLICKED  | BUTTON2_CLICKED  | BUTTON3_CLICKED)#define BUTTON_PRESSED  (BUTTON1_PRESSED  | BUTTON2_PRESSED  | BUTTON3_PRESSED)#define BUTTON_RELEASED (BUTTON1_RELEASED | BUTTON2_RELEASED | BUTTON3_RELEASED)#define INVALID_EVENT	-1#define NORMAL_EVENT	0#if USE_GPM_SUPPORT#ifndef LINTstatic Gpm_Connect gpm_connect;#endif#endifstatic mmask_t eventmask;	/* current event mask */static bool _nc_mouse_parse(int);static void _nc_mouse_resume(SCREEN *);static void _nc_mouse_wrap(SCREEN *);/* maintain a circular list of mouse events *//* The definition of the circular list size (EV_MAX), is in curses.priv.h, so * wgetch() may refer to the size and call _nc_mouse_parse() before circular * list overflow. */static MEVENT events[EV_MAX];	/* hold the last mouse event seen */static MEVENT *eventp = events;	/* next free slot in event queue */#undef  NEXT#define NEXT(ep)	((ep == events + EV_MAX - 1) ? events : ep + 1)#undef  PREV#define PREV(ep)	((ep == events) ? events + EV_MAX - 1 : ep - 1)#ifdef TRACEstatic void_trace_slot(const char *tag){    MEVENT *ep;    _tracef(tag);    for (ep = events; ep < events + EV_MAX; ep++)	_tracef("mouse event queue slot %ld = %s",		(long) (ep - events),		_tracemouse(ep));}#endif#if USE_EMX_MOUSE#  define TOP_ROW          0#  define LEFT_COL         0static int mouse_wfd;static int mouse_thread;static int mouse_activated;static char mouse_buttons[] ={0, 1, 3, 2};#  define M_FD(sp) sp->_mouse_fdstatic voidwrite_event(int down, int button, int x, int y){    char buf[6];    unsigned long ignore;    strncpy(buf, key_mouse, 3);	/* should be "\033[M" */    buf[3] = ' ' + (button - 1) + (down ? 0 : 0x40);    buf[4] = ' ' + x - LEFT_COL + 1;    buf[5] = ' ' + y - TOP_ROW + 1;    DosWrite(mouse_wfd, buf, 6, &ignore);}static voidmouse_server(unsigned long ignored GCC_UNUSED){    unsigned short fWait = MOU_WAIT;    /* NOPTRRECT mourt = { 0,0,24,79 }; */    MOUEVENTINFO mouev;    HMOU hmou;    unsigned short mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN | MOUSE_BN3_DOWN;    int nbuttons = 3;    int oldstate = 0;    char err[80];    unsigned long rc;    /* open the handle for the mouse */    if (MouOpen(NULL, &hmou) == 0) {	rc = MouSetEventMask(&mask, hmou);	if (rc) {		/* retry with 2 buttons */	    mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN;	    rc = MouSetEventMask(&mask, hmou);	    nbuttons = 2;	}	if (rc == 0 && MouDrawPtr(hmou) == 0) {	    for (;;) {		/* sit and wait on the event queue */		rc = MouReadEventQue(&mouev, &fWait, hmou);		if (rc) {		    sprintf(err, "Error reading mouse queue, rc=%lu.\r\n", rc);		    break;		}		if (!mouse_activated)		    goto finish;		/*		 * OS/2 numbers a 3-button mouse inconsistently from other		 * platforms:		 *      1 = left		 *      2 = right		 *      3 = middle.		 */		if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN)		    write_event(mouev.fs & MOUSE_BN1_DOWN,				mouse_buttons[1], mouev.col, mouev.row);		if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN)		    write_event(mouev.fs & MOUSE_BN2_DOWN,				mouse_buttons[3], mouev.col, mouev.row);		if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN)		    write_event(mouev.fs & MOUSE_BN3_DOWN,				mouse_buttons[2], mouev.col, mouev.row);	      finish:		oldstate = mouev.fs;	    }	} else	    sprintf(err, "Error setting event mask, buttons=%d, rc=%lu.\r\n",		    nbuttons, rc);	DosWrite(2, err, strlen(err), &rc);	MouClose(hmou);    }    DosExit(EXIT_THREAD, 0L);}static voidserver_state(const int state){				/* It would be nice to implement pointer-off and stop looping... */    mouse_activated = state;}#endif /* USE_EMX_MOUSE */#if USE_SYSMOUSEstatic voidhandle_sysmouse(int sig GCC_UNUSED){    struct mouse_info the_mouse;    MEVENT *work;    the_mouse.operation = MOUSE_GETINFO;    if (SP != 0	&& SP->_mouse_fd >= 0	&& SP->_sysmouse_tail < FIFO_SIZE	&& ioctl(SP->_mouse_fd, CONS_MOUSECTL, &the_mouse) != -1) {	if (SP->_sysmouse_head > SP->_sysmouse_tail) {	    SP->_sysmouse_tail = 0;	    SP->_sysmouse_head = 0;	}	work = &(SP->_sysmouse_fifo[SP->_sysmouse_tail]);	memset(work, 0, sizeof(*work));	work->id = NORMAL_EVENT;	/* there's only one mouse... */	SP->_sysmouse_old_buttons = SP->_sysmouse_new_buttons;	SP->_sysmouse_new_buttons = the_mouse.u.data.buttons & 0x7;	if (SP->_sysmouse_new_buttons) {	    if (SP->_sysmouse_new_buttons & 1)		work->bstate |= BUTTON1_PRESSED;	    if (SP->_sysmouse_new_buttons & 2)		work->bstate |= BUTTON2_PRESSED;	    if (SP->_sysmouse_new_buttons & 4)		work->bstate |= BUTTON3_PRESSED;	} else {	    if (SP->_sysmouse_old_buttons & 1)		work->bstate |= BUTTON1_RELEASED;	    if (SP->_sysmouse_old_buttons & 2)		work->bstate |= BUTTON2_RELEASED;	    if (SP->_sysmouse_old_buttons & 4)		work->bstate |= BUTTON3_RELEASED;	}	/* for cosmetic bug in syscons.c on FreeBSD 3.[34] */	the_mouse.operation = MOUSE_HIDE;	ioctl(SP->_mouse_fd, CONS_MOUSECTL, &the_mouse);	the_mouse.operation = MOUSE_SHOW;	ioctl(SP->_mouse_fd, CONS_MOUSECTL, &the_mouse);	/*	 * We're only interested if the button is pressed or released.	 * FIXME: implement continuous event-tracking.	 */	if (SP->_sysmouse_new_buttons != SP->_sysmouse_old_buttons) {	    SP->_sysmouse_tail += 1;	}	work->x = the_mouse.u.data.x / SP->_sysmouse_char_width;	work->y = the_mouse.u.data.y / SP->_sysmouse_char_height;    }}#endifstatic int initialized;static voidinit_xterm_mouse(void){    SP->_mouse_type = M_XTERM;    SP->_mouse_xtermcap = tigetstr("XM");    if (!VALID_STRING(SP->_mouse_xtermcap))	SP->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";}#if !USE_EMX_MOUSEstatic voidenable_xterm_mouse(int enable){    putp(tparm(SP->_mouse_xtermcap, enable));}#endif /* !USE_EMX_MOUSE */static voidinitialize_mousetype(void){    static const char *xterm_kmous = "\033[M";    /* Try gpm first, because gpm may be configured to run in xterm */#if USE_GPM_SUPPORT    /* GPM does printf's without checking if stdout is a terminal */    if (isatty(fileno(stdout))) {	/* GPM: initialize connection to gpm server */	gpm_connect.eventMask = GPM_DOWN | GPM_UP;	gpm_connect.defaultMask = ~(gpm_connect.eventMask | GPM_HARD);	gpm_connect.minMod = 0;	gpm_connect.maxMod = ~((1 << KG_SHIFT) | (1 << KG_SHIFTL) | (1 << KG_SHIFTR));	if (Gpm_Open(&gpm_connect, 0) >= 0) {	/* returns the file-descriptor */	    SP->_mouse_type = M_GPM;	    SP->_mouse_fd = gpm_fd;	    return;	}    }#endif    /* OS/2 VIO */#if USE_EMX_MOUSE    if (!mouse_thread	&& strstr(cur_term->type.term_names, "xterm") == 0	&& key_mouse) {	int handles[2];	if (pipe(handles) < 0) {	    perror("mouse pipe error");	    return;	} else {	    int rc;	    if (!mouse_buttons[0]) {		char *s = getenv("MOUSE_BUTTONS_123");		mouse_buttons[0] = 1;		if (s && strlen(s) >= 3) {		    mouse_buttons[1] = s[0] - '0';		    mouse_buttons[2] = s[1] - '0';		    mouse_buttons[3] = s[2] - '0';		}	    }	    mouse_wfd = handles[1];	    M_FD(SP) = handles[0];	    /* Needed? */	    setmode(handles[0], O_BINARY);	    setmode(handles[1], O_BINARY);	    /* Do not use CRT functions, we may single-threaded. */	    rc = DosCreateThread((unsigned long *) &mouse_thread,				 mouse_server, 0, 0, 8192);	    if (rc) {		printf("mouse thread error %d=%#x", rc, rc);		return;	    } else {		SP->_mouse_type = M_XTERM;		return;	    }	}    }#endif#if USE_SYSMOUSE    {	struct mouse_info the_mouse;	char *the_device = 0;	if (isatty(SP->_ifd))	    the_device = ttyname(SP->_ifd);	if (the_device == 0)	    the_device = "/dev/tty";	SP->_mouse_fd = open(the_device, O_RDWR);	if (SP->_mouse_fd >= 0) {	    /*	     * sysmouse does not have a usable user interface for obtaining	     * mouse events.  The logical way to proceed (reading data on a	     * stream) only works if one opens the device as root.  Even in	     * that mode, careful examination shows we lose events	     * occasionally.  The interface provided for user programs is to	     * establish a signal handler.  really.	     *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品你懂的| 精品国产百合女同互慰| 日韩av一区二区在线影视| 久久久久99精品国产片| 欧美亚洲自拍偷拍| 国产激情一区二区三区桃花岛亚洲| 亚洲欧美激情在线| 26uuu精品一区二区在线观看| 色综合天天性综合| 国产乱子轮精品视频| 午夜影视日本亚洲欧洲精品| 国产午夜久久久久| 欧美一区二区免费观在线| 91在线视频网址| 国产一区三区三区| 日韩有码一区二区三区| 亚洲日本青草视频在线怡红院| 欧美va亚洲va| 欧美一区午夜视频在线观看| 色噜噜久久综合| 成人免费高清视频在线观看| 经典三级视频一区| 国产99久久久国产精品| 欧美高清在线一区| 99精品偷自拍| 亚洲福利一二三区| 日韩一区二区免费视频| 免费人成黄页网站在线一区二区| 91.成人天堂一区| 美女尤物国产一区| 欧美精品一区二| 99免费精品在线| 国产精品对白交换视频| 国产麻豆精品theporn| 麻豆视频一区二区| 天天色天天操综合| 亚洲国产乱码最新视频| 国产精品入口麻豆原神| 国产精品久久久久久久裸模| 91啦中文在线观看| 视频一区中文字幕国产| 国产精品入口麻豆原神| 欧美成人一区二区三区片免费| 国产日产欧美一区二区视频| 久色婷婷小香蕉久久| 在线不卡一区二区| 久久久亚洲高清| 国产欧美日韩在线视频| 欧美一级电影网站| 欧美亚洲国产一区二区三区| 欧美一区二区三区视频在线 | 欧美一区二区三区在| 国内成人精品2018免费看| 欧美大片一区二区| 色综合天天天天做夜夜夜夜做| 国产精品国产精品国产专区不蜜| 欧美日本韩国一区二区三区视频| 成人自拍视频在线| 国产一区二区伦理| 亚洲精品国产品国语在线app| 亚洲国产精品天堂| 国产剧情一区在线| 国产99一区视频免费| 精品午夜久久福利影院| 91国偷自产一区二区三区观看| 日本不卡中文字幕| 男男视频亚洲欧美| 国产一区高清在线| 国产成a人亚洲精| 美女脱光内衣内裤视频久久影院| 亚洲一二三区在线观看| 日本三级亚洲精品| 国产麻豆视频精品| av不卡免费电影| 91视视频在线观看入口直接观看www | 亚洲色图欧美在线| 国产精品免费视频网站| 久久久99精品免费观看不卡| 国产精品家庭影院| 亚洲视频资源在线| 久久精品二区亚洲w码| 捆绑变态av一区二区三区| 亚洲444eee在线观看| 久久国产尿小便嘘嘘尿| 亚洲一区二区三区四区的| 精品久久久久一区| 中文字幕在线观看一区二区| 丝袜亚洲另类丝袜在线| 国产一区二区三区久久久| 91久久精品网| 久久你懂得1024| 亚洲国产日韩在线一区模特| 九九**精品视频免费播放| 一本色道久久综合亚洲91| 欧美videofree性高清杂交| 亚洲老司机在线| 国产一区二区三区四区在线观看| 在线观看视频91| 国产视频不卡一区| 免费人成网站在线观看欧美高清| 91影视在线播放| 国产午夜亚洲精品午夜鲁丝片 | 久久爱www久久做| 91美女视频网站| 99视频精品在线| www.99精品| 日韩午夜三级在线| 一区二区三区四区在线免费观看| 激情国产一区二区| 欧美日韩精品一区二区天天拍小说 | 欧美性三三影院| 国产三级欧美三级日产三级99| 五月婷婷综合网| 99re这里都是精品| 久久精品亚洲精品国产欧美| 美女视频一区二区| 欧美美女一区二区三区| 亚洲精品美腿丝袜| av激情综合网| 国产精品麻豆一区二区 | 成人综合激情网| 欧美videossexotv100| 青青国产91久久久久久 | 欧美在线你懂的| 亚洲色图视频网站| av电影在线观看完整版一区二区 | 日本欧美一区二区三区乱码| 91豆麻精品91久久久久久| 国产精品欧美经典| 成人综合激情网| 中国色在线观看另类| 国产成人日日夜夜| 久久精品免费在线观看| 国产精品一卡二卡| 久久久久免费观看| 国产精品一区二区久久精品爱涩| 精品成人一区二区三区| 久久精品国产99国产精品| 欧美一区二区播放| 久久精品国产免费看久久精品| 91精品国产91久久久久久一区二区 | 欧美放荡的少妇| 五月综合激情日本mⅴ| 欧美日韩小视频| 日韩影院在线观看| 精品免费99久久| 国产精品一卡二卡在线观看| 国产亚洲va综合人人澡精品| 国产精品一二三四五| 国产午夜精品久久久久久久 | 日韩av中文字幕一区二区| 日韩一区二区三免费高清| 国产精品一级片在线观看| 国产一区二区不卡在线| 色哟哟精品一区| 亚洲午夜一二三区视频| 8v天堂国产在线一区二区| 久久99日本精品| 亚洲国产激情av| 91在线你懂得| 婷婷丁香久久五月婷婷| 精品欧美一区二区在线观看| 成人性生交大片免费看视频在线| 亚洲精品国产一区二区精华液| 欧美影视一区二区三区| 裸体一区二区三区| 中文字幕欧美日韩一区| 欧美午夜视频网站| 精品中文av资源站在线观看| 国产精品每日更新| 精品1区2区3区| 精品一区二区三区在线观看国产 | 日韩国产欧美在线观看| 国产高清在线观看免费不卡| 94色蜜桃网一区二区三区| 欧洲国内综合视频| 日本不卡一二三区黄网| 国产欧美精品一区| 欧美日韩一区久久| 国产精品77777竹菊影视小说| 亚洲精品ww久久久久久p站| 欧美成人综合网站| 日本久久电影网| 国产自产v一区二区三区c| 亚洲人成网站影音先锋播放| 欧美一级艳片视频免费观看| 波波电影院一区二区三区| 午夜天堂影视香蕉久久| 亚洲国产精品精华液2区45| 欧美高清hd18日本| 成人av网址在线| 精品一区二区三区免费毛片爱 | 日韩精品每日更新| 欧美激情在线一区二区三区| 欧美在线观看一二区| 国产盗摄一区二区三区| 爽好多水快深点欧美视频| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 久久久久高清精品| 4hu四虎永久在线影院成人|