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

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

?? textfield.c

?? NIST Net – A Linux-based Network Emulation Tool, It is a raw IP packet filter with many controllable
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*----------------------------------------------------------------------------- * TextField	A single line text entry widget * * Copyright (c) 1995 Robert W. McMullen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * Author: Rob McMullen <rwmcm@orion.ae.utexas.edu> *         http://www.ae.utexas.edu/~rwmcm */#define _TextField_#include <X11/IntrinsicP.h>#include <X11/StringDefs.h>#include <X11/Xatom.h>#include <X11/Xmu/Xmu.h>#include <stdio.h>/*#include <stdlib.h> */#include "TextFieldP.h"#define offset(field) XtOffsetOf(TextFieldRec, text.field)static XtResource resources[] ={  {XtNallowSelection, XtCBoolean, XtRBoolean, sizeof(Boolean),    offset(AllowSelection), XtRString, "True"},  {XtNdisplayCaret, XtCBoolean, XtRBoolean, sizeof(Boolean),    offset(DisplayCursor), XtRString, "True"},  {XtNecho, XtCBoolean, XtRBoolean, sizeof(Boolean),    offset(Echo), XtRString, "True"},  {XtNeditable, XtCBoolean, XtRBoolean, sizeof(Boolean),    offset(Editable), XtRString, "True"},  {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),    offset(font), XtRString, XtDefaultFont},  {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),    offset(foreground_pixel), XtRString, XtDefaultForeground},  {XtNinsertPosition, XtCInsertPosition, XtRInt, sizeof(int),    offset(CursorPos), XtRString, "0"},  {XtNlength, XtCLength, XtRInt, sizeof(int),    offset(TextMaxLen), XtRString, "0"},  {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension),    offset(Margin), XtRString, "3"},  {XtNpendingDelete, XtCBoolean, XtRBoolean, sizeof(Boolean),    offset(PendingDelete), XtRString, "True"},  {XtNstring, XtCString, XtRString, sizeof(char *),    offset(DefaultString), XtRString, NULL},  {XtNactivateCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(ActivateCallback), XtRCallback, NULL},  {XtNfocusCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(focusCallback), XtRCallback, NULL},  {XtNlosingFocusCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(losingFocusCallback), XtRCallback, NULL},  {XtNgainPrimaryCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(gainPrimaryCallback), XtRCallback, NULL},  {XtNlosePrimaryCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(losePrimaryCallback), XtRCallback, NULL},  {XtNmodifyVerifyCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(modifyVerifyCallback), XtRCallback, NULL},  {XtNvalueChangedCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(valueChangedCallback), XtRCallback, NULL},  {XtNmotionVerifyCallback, XtCCallback, XtRCallback, sizeof(XtPointer),    offset(motionVerifyCallback), XtRCallback, NULL},};#undef offsetstatic void Initialize();static void Destroy();static void Redisplay();static void Resize();static Boolean SetValues();static void Draw(), DrawInsert(), MassiveChangeDraw(), DrawTextReposition(),  ClearHighlight(), DrawHighlight(), DrawCursor(), EraseCursor();static Boolean PositionCursor(), MassiveCursorAdjust();static void Nothing(), Activate(), InsertChar(), ForwardChar(), BackwardChar(),  DeleteNext(), DeletePrev(), SelectStart(), ExtendStart(), ExtendAdjust(),  ExtendEnd(), InsertSelection();static void TfFocusIn(), TfFocusOut(), HomeChar(), EndChar() ;/* * In order for tab-chaining of fields not to be too irritating, * you ought to be able to get back to a previous field by * clicking on it, even if you haven't moved the mouse.  This is * why I added focus-in() to Btn1Down.  Note that what we end up * with is kind of a weird hybrid between "pointer focus" and * "explicit focus" - you can change focus to a particular field * either by moving the mouse into it, or by clicking on it, if * the mouse is already in it.  This may seem weird, but for me * it works ok.  - Mark */static char defaultTranslations[] ="<Key>Right:	forward-char()\n\ <Key>KP_Right:	forward-char()\n\ Ctrl<Key>F:	forward-char()\n\ <Key>Left:	backward-char()\n\ <Key>KP_Left:	backward-char()\n\ Ctrl<Key>B:	backward-char()\n\ <Key>Home:	home-char()\n\ <Key>KP_Home:	home-char()\n\ Ctrl<Key>A:	home-char()\n\ <Key>End:	end-char()\n\ <Key>KP_End:	end-char()\n\ Ctrl<Key>E:	end-char()\n\ <Key>Delete:	delete-next-char()\n\ <Key>BackSpace:	delete-previous-char()\n\ <Key>Return:	activate()\n\ <Key>:		insert-char()\n\ Shift<Btn1Down>:	extend-start()\n\ <Btn1Down>:	select-start() focus-in()\n\ <Btn1Motion>:	extend-adjust()\n\ <Btn1Up>:	extend-end()\n\ <Btn2Down>:	insert-selection()\n\ <Btn3Down>:	extend-start()\n\ <Btn3Motion>:	extend-adjust()\n\ <Btn3Up>:	extend-end()\n\ <EnterWindow>:	focus-in() enter-window()\n\ <LeaveWindow>:	focus-out() leave-window()\n\ <FocusIn>:	focus-in()\n\ <FocusOut>:	focus-out()";static XtActionsRec actions[] ={  {"insert-char", InsertChar},  {"forward-char", ForwardChar},  {"backward-char", BackwardChar},  {"home-char", HomeChar},  {"end-char", EndChar},  {"delete-next-char", DeleteNext},  {"delete-previous-char", DeletePrev},  {"activate", Activate},  {"select-start", SelectStart},  {"extend-start", ExtendStart},  {"extend-adjust", ExtendAdjust},  {"extend-end", ExtendEnd},  {"insert-selection", InsertSelection},  {"enter-window", Nothing},  {"leave-window", Nothing},  {"focus-in", TfFocusIn},  {"focus-out", TfFocusOut},};TextFieldClassRec textfieldClassRec ={  {	/* core_class fields     */	/* superclass            */ (WidgetClass) & widgetClassRec,	/* class_name            */ "TextField",	/* widget_size           */ sizeof(TextFieldRec),	/* class_initialize      */ NULL,	/* class_part_initialize */ NULL,	/* class_inited          */ False,	/* initialize            */ Initialize,	/* initialize_hook       */ NULL,	/* realize               */ XtInheritRealize,	/* actions               */ actions,	/* num_actions           */ XtNumber(actions),	/* resources             */ resources,	/* num_resources         */ XtNumber(resources),	/* xrm_class             */ NULLQUARK,	/* compress_motion       */ True,	/* compress_exposure     */ XtExposeCompressMultiple,	/* compress_enterleave   */ True,	/* visible_interest      */ True,	/* destroy               */ Destroy,	/* resize                */ Resize,	/* expose                */ Redisplay,	/* set_values            */ SetValues,	/* set_values_hook       */ NULL,	/* set_values_almost     */ XtInheritSetValuesAlmost,	/* get_values_hook       */ NULL,	/* accept_focus          */ NULL,	/* version               */ XtVersion,	/* callback_private      */ NULL,	/* tm_table              */ defaultTranslations,	/* query_geometry        */ XtInheritQueryGeometry,	/* display_accelerator   */ XtInheritDisplayAccelerator,	/* extension             */ NULL  },  {	/* extension		*/ NULL  }};WidgetClass textfieldWidgetClass = (WidgetClass) & textfieldClassRec;/* Convenience macros */#define TopMargin(w) (int)(w->text.Margin - 1)#define BottomMargin(w) (int)(w->text.Margin)/* Font functions */#define FontHeight(f)  (int)(f->max_bounds.ascent + f->max_bounds.descent)#define FontDescent(f) (int)(f->max_bounds.descent)#define FontAscent(f)  (int)(f->max_bounds.ascent)#define FontTextWidth(f,c,l) (int)XTextWidth(f, c, l)static voidInitializeGC(TextFieldWidget w){  static char dots[] =  {2, 1, 1};  XGCValues values;  XtGCMask mask;  values.line_style = LineSolid;  values.line_width = 0;  values.fill_style = FillSolid;  values.font = w->text.font->fid;  values.background = w->core.background_pixel;  values.foreground = w->text.foreground_pixel;  mask = GCLineStyle | GCLineWidth | GCFillStyle | GCForeground | GCBackground | GCFont;  w->text.drawGC = XtGetGC((Widget) w, mask, &values);  values.foreground = w->core.background_pixel;  values.background = w->text.foreground_pixel;  w->text.highlightGC = XtGetGC((Widget) w, mask, &values);  values.line_style = LineSolid;  values.line_width = 0;  values.background = w->core.background_pixel;  values.foreground = w->text.foreground_pixel;  mask = GCLineStyle | GCLineWidth | GCForeground | GCBackground;  w->text.cursorGC = XtGetGC((Widget) w, mask, &values);  values.foreground = w->core.background_pixel;  values.background = w->text.foreground_pixel;  w->text.eraseGC = XtGetGC((Widget) w, mask, &values);  values.line_style = LineOnOffDash;  values.background = w->core.background_pixel;  values.foreground = w->text.foreground_pixel;  w->text.dashGC = XtGetGC((Widget) w, mask, &values);  XSetDashes(XtDisplay(w), w->text.dashGC, 0, &dots[1],    (int) dots[0]);  w->text.YOffset = TopMargin(w) + FontAscent(w->text.font);}static voidClipGC(TextFieldWidget w){  XRectangle clip;  clip.x = 0;  clip.y = w->text.YOffset - FontAscent(w->text.font) + 1;  clip.width = w->text.ViewWidth + 1;  clip.height = FontHeight(w->text.font);  XSetClipRectangles(XtDisplay((Widget) w), w->text.drawGC,    w->text.Margin, 0, &clip, 1, Unsorted);  XSetClipRectangles(XtDisplay((Widget) w), w->text.highlightGC,    w->text.Margin, 0, &clip, 1, Unsorted);}static voidSetString(TextFieldWidget w, char *s){  int len;  if (s) {    len = strlen(s);    if (len > w->text.TextAlloc) {      w->text.TextAlloc += len;      w->text.Text = XtRealloc(w->text.Text, w->text.TextAlloc);    }    strcpy(w->text.Text, s);    w->text.TextLen = len;    w->text.TextWidth = w->text.OldTextWidth =      FontTextWidth(w->text.font, w->text.Text,      w->text.TextLen);    if ((w->text.TextMaxLen > 0) && (w->text.TextLen > w->text.TextMaxLen))      w->text.TextMaxLen = w->text.TextLen;  }  w->text.DefaultString = w->text.Text;}static voidInitialize(Widget treq, Widget tnew, ArgList args, Cardinal * num){  TextFieldWidget new;  int height;  new = (TextFieldWidget) tnew;  new->text.timer_id = (XtIntervalId) 0;  new->text.multi_click_time = XtGetMultiClickTime(XtDisplay((Widget) new));  new->text.highlight_time = new->text.multi_click_time / 2;  if (new->text.TextMaxLen > 0) {    new->text.TextAlloc = new->text.TextMaxLen + 1;  }  else {    new->text.TextAlloc = TEXTFIELD_ALLOC_SIZE;  }  new->text.Text = (char *) XtMalloc(new->text.TextAlloc);  new->text.TextLen = 0;  new->text.SelectionText = NULL;  new->text.TextWidth = new->text.OldTextWidth = 0;  if (new->text.DefaultString)    SetString(new, new->text.DefaultString);  if (new->text.CursorPos > 0) {    if (new->text.CursorPos > new->text.TextLen) {      new->text.CursorPos = new->text.TextLen;    }  }  else {    new->text.CursorPos = 0;  }  new->text.OldCursorX = -1;  new->text.HighlightStart = new->text.HighlightEnd = -1;  new->text.OldHighlightStart = new->text.OldHighlightEnd = -1;  height = FontHeight(new->text.font);  if (treq->core.height == 0)    new->core.height = (Dimension) height + TopMargin(new) + BottomMargin(new);  if (treq->core.width == 0) {    new->text.ViewWidth = 200;    new->core.width = new->text.ViewWidth + 2 * new->text.Margin;  }  else {    int width;    width = (int) new->core.width - 2 * new->text.Margin;    if (width < 0)      new->text.ViewWidth = new->core.width;    else      new->text.ViewWidth = width;  }  new->text.XOffset = new->text.OldXOffset = 0;  InitializeGC(new);  ClipGC(new);}static voidDestroy(TextFieldWidget w){  XtReleaseGC((Widget) w, w->text.drawGC);  XtReleaseGC((Widget) w, w->text.highlightGC);  if (w->text.SelectionText)    XtFree(w->text.SelectionText);  XtFree(w->text.Text);}static voidRedisplay(Widget aw, XExposeEvent * event, Region region){  TextFieldWidget w = (TextFieldWidget) aw;  Draw(w);}static BooleanSetValues(Widget current, Widget request, Widget reply,  ArgList args, Cardinal * nargs){  TextFieldWidget w = (TextFieldWidget) current;  TextFieldWidget new = (TextFieldWidget) reply;  Boolean redraw = False;  if ((w->text.foreground_pixel != new->text.foreground_pixel) ||    (w->core.background_pixel != new->core.background_pixel) ||    (w->text.font != new->text.font)) {    XtReleaseGC((Widget) w, w->text.drawGC);    XtReleaseGC((Widget) w, w->text.highlightGC);    XtReleaseGC((Widget) w, w->text.cursorGC);    XtReleaseGC((Widget) w, w->text.eraseGC);    XtReleaseGC((Widget) w, w->text.dashGC);    InitializeGC(new);    redraw = True;  }  if ((w->text.CursorPos != new->text.CursorPos) ||    (w->text.DisplayCursor != new->text.DisplayCursor)) {    redraw = True;  }  if (w->text.DefaultString != new->text.DefaultString) {    redraw = True;    SetString(new, new->text.DefaultString);    new->text.HighlightStart = new->text.HighlightEnd = -1;    new->text.CursorPos = new->text.TextLen;#ifdef DEBUG_TF    printf("SetValues: %s\n", new->text.DefaultString);#endif  }  return redraw;}static voidResize(Widget aw){  TextFieldWidget w = (TextFieldWidget) aw;  int width, height;if (!w->core.width || !w->core.height) {	fprintf(stderr, "Somebody's forcing %d x %d dims on us!\n",		w->core.width, w->core.height);}  width = w->core.width - 2 * w->text.Margin;  if (width < 0)    w->text.ViewWidth = w->core.width;  else    w->text.ViewWidth = width;  height = (((int) w->core.height - FontHeight(w->text.font)) / 2) +    FontAscent(w->text.font);  w->text.YOffset = height;  ClipGC(w);  MassiveChangeDraw(w);}static voidTextDelete(TextFieldWidget w, int start, int len){  int i;  if (len > 0) {    for (i = start + len; i < w->text.TextLen; i++)      w->text.Text[i - len] = w->text.Text[i];    w->text.TextLen -= len;    w->text.TextWidth = FontTextWidth(w->text.font, w->text.Text,      w->text.TextLen);    w->text.Text[w->text.TextLen] = 0;  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲同性gay激情无套| 亚洲国产一区二区在线播放| 91麻豆精东视频| 婷婷丁香久久五月婷婷| 国产片一区二区三区| 欧美日韩三级在线| 成人黄色777网| 日本欧美在线观看| 亚洲日本丝袜连裤袜办公室| 亚洲精品一区二区三区在线观看| 色综合久久久久综合99| 国产不卡视频一区| 蜜桃视频在线观看一区二区| 一区二区三区在线视频免费 | 欧美一卡二卡三卡| 91免费视频网| 丁香激情综合国产| 黄一区二区三区| 日本在线不卡视频| 亚洲风情在线资源站| 中文字幕日韩精品一区| 久久久高清一区二区三区| 88在线观看91蜜桃国自产| 91亚洲精品久久久蜜桃| 成人性生交大片免费看中文| 蜜桃视频一区二区三区在线观看 | 视频一区视频二区中文| 亚洲女爱视频在线| 国产精品久久久久久亚洲毛片 | 国产一区欧美日韩| 久久国产精品色| 日韩综合一区二区| 天天色综合成人网| 亚洲国产日韩一级| 亚洲一区在线免费观看| 亚洲欧美日韩国产成人精品影院 | 99re这里只有精品6| 国产精品一区二区男女羞羞无遮挡| 日韩二区三区在线观看| 天使萌一区二区三区免费观看| 亚洲午夜精品网| 亚洲伊人伊色伊影伊综合网| 亚洲码国产岛国毛片在线| 国产精品美女久久久久高潮| 中文字幕乱码日本亚洲一区二区| 久久在线观看免费| 久久蜜桃av一区二区天堂| 精品99久久久久久| 久久久久9999亚洲精品| 国产女人18水真多18精品一级做| 欧美国产欧美亚州国产日韩mv天天看完整| 久久久亚洲欧洲日产国码αv| 久久精品日韩一区二区三区| 国产精品久久看| 亚洲尤物在线视频观看| 日韩高清不卡在线| 国产一区视频网站| 91在线看国产| 欧美日韩三级一区| 久久众筹精品私拍模特| 国产精品青草综合久久久久99| 亚洲欧美色一区| 日日骚欧美日韩| 国产精品99久久久久久似苏梦涵| 成人性视频免费网站| 色综合久久久久| 在线观看91av| 久久综合色婷婷| 国产精品久久久久久久久晋中| 亚洲欧美日韩国产手机在线| 天天色天天操综合| 国产精品综合网| 91麻豆国产福利在线观看| 在线亚洲一区二区| 日韩精品最新网址| 国产精品麻豆视频| 午夜欧美在线一二页| 久久99精品久久久久婷婷| 国产乱色国产精品免费视频| 91蝌蚪porny九色| 欧美一二区视频| 国产精品灌醉下药二区| 日韩中文字幕区一区有砖一区| 国产在线看一区| 亚洲精品一区二区三区四区高清 | 国产精品久久久久久久午夜片 | 久久这里只精品最新地址| 亚洲人被黑人高潮完整版| 日本午夜精品视频在线观看| 盗摄精品av一区二区三区| 欧美日韩电影一区| 欧美激情综合网| 日本vs亚洲vs韩国一区三区 | 国产午夜亚洲精品理论片色戒| 亚洲一区二三区| 国产精品羞羞答答xxdd| 欧美日免费三级在线| 国产三区在线成人av| 亚洲国产精品久久久久秋霞影院| 国产成人亚洲综合a∨婷婷 | 国产精品一区二区无线| 欧美视频一区二区三区在线观看| 欧美国产一区视频在线观看| 日本人妖一区二区| 欧洲一区二区av| 欧美国产丝袜视频| 蜜乳av一区二区| 欧美系列亚洲系列| 国产精品久久久久影视| 国产乱国产乱300精品| 日韩欧美色电影| 亚洲电影在线免费观看| 91婷婷韩国欧美一区二区| 久久精品一区二区三区不卡牛牛| 午夜av一区二区| 欧美午夜精品久久久| 日韩理论片一区二区| 国产盗摄视频一区二区三区| 精品久久五月天| 免费成人在线网站| 欧美日韩精品欧美日韩精品一综合| 亚洲人吸女人奶水| 91麻豆免费在线观看| 国产精品传媒在线| www.性欧美| 国产精品不卡在线观看| 成人黄色网址在线观看| 亚洲国产精品高清| 国产福利一区二区三区视频| 国产无人区一区二区三区| 国产一区二区三区在线观看精品 | 欧美日韩在线播放三区四区| 亚洲综合一二区| 91久久免费观看| 亚洲最大成人综合| 日本道精品一区二区三区| 亚洲精品亚洲人成人网在线播放| 91偷拍与自偷拍精品| 亚洲在线中文字幕| 欧美日韩国产精品成人| 日日夜夜免费精品| 精品国产a毛片| 国产盗摄一区二区| ...av二区三区久久精品| 91偷拍与自偷拍精品| 亚洲午夜影视影院在线观看| 欧美色图激情小说| 首页欧美精品中文字幕| 欧美mv日韩mv亚洲| 成人午夜精品一区二区三区| 国产精品福利一区| 欧美日韩一区在线| 久久精品久久精品| 国产亚洲成aⅴ人片在线观看 | 麻豆精品在线看| 久久网这里都是精品| 成人免费视频视频在线观看免费 | 久久精品人人做人人综合| 粉嫩av一区二区三区| 一区二区三区国产豹纹内裤在线| 欧美日韩在线播放| 国产精品资源在线看| 亚洲视频一二三| 91精品国产综合久久久蜜臀粉嫩| 久久国产欧美日韩精品| 国产精品久久久久三级| 欧美三级日韩在线| 国产伦精品一区二区三区视频青涩| 欧美激情在线看| 欧美午夜理伦三级在线观看| 久久精品国产免费看久久精品| 国产女人aaa级久久久级 | 日日夜夜精品视频天天综合网| 欧美精品一区二区三区在线| 92国产精品观看| 欧美96一区二区免费视频| 国产精品热久久久久夜色精品三区| 欧美性视频一区二区三区| 久久99精品视频| 亚洲自拍与偷拍| 国产日韩精品视频一区| 欧美丝袜自拍制服另类| 国产一区二区调教| 亚洲一区二区三区四区在线| 精品久久久久久久久久久院品网| 91在线播放网址| 乱中年女人伦av一区二区| 自拍av一区二区三区| 亚洲精品在线网站| 欧美熟乱第一页| 成人激情免费视频| 久久福利资源站| 亚洲成av人片在线观看| 欧美国产日韩精品免费观看| 日韩一区二区三区视频在线观看| 91丨九色丨黑人外教| 国产麻豆一精品一av一免费 | 欧美精品一区二区在线播放| 91福利在线看| 成人免费看视频|