亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品色在线观看| 亚洲午夜激情av| 欧美午夜片在线观看| 国产成人在线网站| 亚洲一二三四在线观看| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美亚洲动漫另类| 国产精品一二三区在线| 亚洲成人免费在线观看| 国产精品成人免费精品自在线观看| 91精品国产综合久久国产大片| 成人av在线看| 国产一区二区福利视频| 五月婷婷欧美视频| 国产精品免费aⅴ片在线观看| 日韩欧美在线网站| 欧美性色综合网| av在线不卡免费看| 国产98色在线|日韩| 裸体一区二区三区| 午夜精品一区二区三区三上悠亚| 国产日韩欧美一区二区三区乱码 | 国产成人高清在线| 裸体歌舞表演一区二区| 婷婷六月综合亚洲| 亚洲成人av中文| 亚洲网友自拍偷拍| 亚洲最新在线观看| 亚洲欧美日韩一区二区三区在线观看| 久久久www免费人成精品| 欧美一区二区播放| 欧美裸体一区二区三区| 欧美性色综合网| 在线观看亚洲a| 91丝袜美腿高跟国产极品老师 | 精品国产a毛片| 精品三级av在线| 欧美电视剧在线看免费| 欧美大片在线观看一区二区| 91麻豆精品国产91久久久 | 国产色产综合色产在线视频| 久久色中文字幕| 久久久夜色精品亚洲| 久久精品亚洲一区二区三区浴池| 精品99999| 国产欧美日韩精品一区| 国产欧美日韩另类一区| 亚洲国产精品成人综合| 中文字幕一区在线| 一区二区三区小说| 性久久久久久久| 免费在线欧美视频| 激情欧美日韩一区二区| 国产精品一区二区91| 成人自拍视频在线| 色中色一区二区| 欧美三级日韩在线| 日韩视频免费观看高清在线视频| 欧美一二三区精品| 久久精品人人做| 国产精品久久久久久户外露出| 亚洲色图20p| 亚洲h在线观看| 精品午夜久久福利影院| 豆国产96在线|亚洲| 91小视频免费观看| 欧美美女网站色| 久久综合久久综合九色| 亚洲国产精品精华液2区45| 亚洲日本在线天堂| 热久久免费视频| 成人网在线播放| 精品污污网站免费看| 精品国产麻豆免费人成网站| 国产精品亲子伦对白| 亚洲成人精品一区二区| 美国欧美日韩国产在线播放| 成人一区二区三区中文字幕| 欧洲av一区二区嗯嗯嗯啊| 欧美xxx久久| 18成人在线视频| 日本女人一区二区三区| 不卡一区二区三区四区| 欧美四级电影在线观看| 久久久久国产精品免费免费搜索| 亚洲激情第一区| 国产一区日韩二区欧美三区| 在线一区二区三区| 久久日韩精品一区二区五区| 亚洲免费观看高清完整版在线观看 | 色婷婷综合在线| 久久婷婷久久一区二区三区| 一区二区三区久久| 国产精品一级在线| 91精品视频网| 亚洲天天做日日做天天谢日日欢 | 激情成人午夜视频| 欧美在线观看禁18| 国产精品情趣视频| 久久不见久久见免费视频1| 色综合一区二区| 国产清纯在线一区二区www| 视频一区中文字幕| 色综合久久久久综合| 国产欧美日韩中文久久| 日韩成人精品在线| 欧美性猛交xxxx黑人交| 国产精品久久久久永久免费观看| 免费在线观看不卡| 欧美日免费三级在线| 自拍偷拍国产精品| 成人视屏免费看| 精品福利一区二区三区免费视频| 亚洲国产精品影院| 日本丰满少妇一区二区三区| 国产女主播一区| 国内精品免费在线观看| 欧美一区二区免费视频| 视频在线在亚洲| 欧美性受xxxx黑人xyx性爽| 国产精品每日更新| 国产成人午夜99999| 26uuu成人网一区二区三区| 麻豆视频观看网址久久| 88在线观看91蜜桃国自产| 亚洲六月丁香色婷婷综合久久 | 黑人精品欧美一区二区蜜桃| 5月丁香婷婷综合| 五月综合激情日本mⅴ| 欧美天天综合网| 亚洲成在人线在线播放| 欧美日韩在线播放| 亚洲一区二区高清| 欧美影院午夜播放| 午夜国产精品一区| 欧美精品久久99| 免费观看在线综合| 欧美电影精品一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 精品盗摄一区二区三区| 国产精品一卡二| 中文字幕在线不卡一区二区三区| av激情成人网| 夜夜操天天操亚洲| 欧美高清精品3d| 免费不卡在线观看| 久久亚洲春色中文字幕久久久| 国产精品自拍av| 中文字幕在线播放不卡一区| 色婷婷精品大在线视频| 亚洲五月六月丁香激情| 欧美一三区三区四区免费在线看 | 狠狠色2019综合网| 国产日韩三级在线| 色中色一区二区| 日韩影视精彩在线| 国产亚洲制服色| 99久久777色| 三级欧美在线一区| 精品91自产拍在线观看一区| 丁香五精品蜜臀久久久久99网站| 国产精品久久久久aaaa| 欧美亚洲综合色| 精品一区二区三区免费| 国产女人18水真多18精品一级做| 99精品久久久久久| 日韩精品一二三四| 国产欧美视频在线观看| 日本道在线观看一区二区| 奇米精品一区二区三区在线观看 | 91麻豆精品国产91久久久使用方法 | 亚洲午夜羞羞片| 欧美变态口味重另类| 91在线码无精品| 人人爽香蕉精品| 最新热久久免费视频| 欧美久久久久中文字幕| 国产a视频精品免费观看| 一二三四社区欧美黄| 精品久久久久久最新网址| 91亚洲永久精品| 蜜臀av国产精品久久久久| 欧美国产乱子伦 | 国产精品99久久久久久似苏梦涵| 亚洲日本欧美天堂| 欧美不卡激情三级在线观看| 91网站最新地址| 久久99国产精品麻豆| 一区二区三区在线视频观看58| 日韩三级视频在线看| 91极品视觉盛宴| 国产精品一级黄| 婷婷一区二区三区| 国产精品超碰97尤物18| 欧美成人vps| 欧美日韩一区 二区 三区 久久精品| 韩国一区二区三区| 亚洲国产日韩一级| 国产精品午夜电影| 欧美tk—视频vk|