📄 xlib.c
字号:
Display *display;GC gc;int fs;{ xtrace("XSetFillStyle\n"); gc->values.fill_style=fs; gc->dirty |= GCFillStyle; return 0;}intXSetDashes(Display *display, GC gc, int dash_offset, const char * dash_list, int n){ xtrace("XSetDashes\n"); return 0;}intXChangeWindowAttributes(display,w,vmask,attr)Display *display;Window w;unsigned long vmask;XSetWindowAttributes *attr;{ xtrace("XChangeWindowAttributes\n"); return 0;}/*****************************************************************\ Function: XLowerWindow Inputs: display, window to be lowered. Comments: Make sure if the window has a frame that that gets lowered too.\*****************************************************************/intXLowerWindow(display,w)Display *display;Window w;{ NT_window *ntw=(NT_window *)w; xtrace("XLowerWindow\n"); SetWindowPos((HWND)ntw->w,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); return 0;}/*****************************************************************\ Function: XMapRaised Inputs: display, window. Comments: Frames get raised first.\*****************************************************************/intXMapRaised(display,w)Display *display;Window w;{ NT_window *ntw=(NT_window *)w; xtrace("XMapRaised\n"); XMapWindow(display,w); SetWindowPos(ntw->w,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); return 0;}/*****************************************************************\ Function: XMapSubwindows Inputs: display, window. Comments: Unfortunately, the optimisations normally made by the X server are not made here.\*****************************************************************/intXMapSubwindows(display,w)Display *display;Window w;{ NT_window *ntw=(NT_window *)w; struct NT_child *tmp; xtrace("XMapSubWindows\n"); tmp=ntw->child; while (tmp!=NULL) { XMapWindow(display,(Window)tmp->w); tmp=tmp->next; } return 0;}/*****************************************************************\ Function: XQueryTree Inputs: display, window. Returned: root window, parent window, list of children, status. Comments: Not fully implemented. The child field is wrong.\*****************************************************************/StatusDefXQueryTree(display,w,root,parent,ch,n)Display *display;Window w;Window* root;Window* parent;Window** ch;unsigned int *n;{ NT_window *ntw=(NT_window *)w; StatusDef status=1; xtrace("XQueryTree\n"); *parent=(Window)ntw->parent; if (ntw->parent==NULL) status=0; *root=display->screens[0].root; *ch=NULL; *n=0; return (status);}/*****************************************************************\ Function: XRaiseWindow Inputs: display, window. Comments: Recursive raising of window and its children.\*****************************************************************/intXRaiseWindow(display,w)Display *display;Window w;{ NT_window *ntw=(NT_window *)w; struct NT_child *tmp; xtrace("XRaiseWindows\n"); BringWindowToTop(ntw->w); tmp=ntw->child; while (tmp!=NULL) { XRaiseWindow(display,(Window)tmp->w); tmp=tmp->next; } return 0;}/*****************************************************************\ Function: XRootWindow Inputs: display, screen number Returned: root window ID. Comments: Info taken from display structure.\*****************************************************************/WindowXRootWindow(display,scr)Display *display;int scr;{ xtrace("XRootWindow\n"); return(display->screens[0].root);}/*****************************************************************\ Function: XRootWindowOfScreen Inputs: screen pointer Returned: root window ID. Comments: ZZzzz...\*****************************************************************/WindowXRootWindowOfScreen(scr)Screen *scr;{ xtrace("XRootWindowOfScreen\n"); return(scr->root);}/*****************************************************************\ Function: XTranslateCoordinates Inputs: display, source window, destination window, source x, y. Returned: destination x, y, child window if any. Comments: Seems to work properly.\*****************************************************************/BoolDefXTranslateCoordinates(display,sw,dw,sx,sy,dx,dy,ch)Display *display;Window sw,dw;int sx,sy,*dx,*dy;Window *ch;{ xtrace("XTranslateCoordinates\n"); return (True);}/*****************************************************************\ Function: XUnmapWindow Inputs: display, window. Comments: Removes a window and its frame, if it has one, from the screen.\*****************************************************************/intXUnmapWindow(display,w)Display *display;Window w;{ NT_window *ntw=(NT_window *)w; xtrace("XUnmapWindow\n"); ShowWindow(ntw->w,SW_HIDE); return 0;}/*****************************************************************\ Function: XCopyGC Inputs: display, source gc, values mask, destination gc. Comments: Copies masked elements from source to destination.\*****************************************************************/intXCopyGC(display,sgc,vmask,dgc)Display *display;GC sgc,dgc;unsigned long vmask;{ xtrace("XCopyGC\n"); if (vmask&GCFunction) dgc->values.function=sgc->values.function; if (vmask&GCPlaneMask) dgc->values.plane_mask=sgc->values.plane_mask; if (vmask&GCForeground) dgc->values.foreground=sgc->values.foreground; if (vmask&GCBackground) dgc->values.background=sgc->values.background; if (vmask&GCLineWidth) dgc->values.line_width=sgc->values.line_width; if (vmask&GCLineStyle) dgc->values.line_style=sgc->values.line_style; if (vmask&GCCapStyle) dgc->values.cap_style=sgc->values.cap_style; if (vmask&GCJoinStyle) dgc->values.join_style=sgc->values.join_style; if (vmask&GCFillStyle) dgc->values.fill_style=sgc->values.fill_style; if (vmask&GCFillRule) dgc->values.fill_rule=sgc->values.fill_rule; if (vmask&GCTile) dgc->values.tile=sgc->values.tile; if (vmask&GCStipple) dgc->values.stipple=sgc->values.stipple; if (vmask&GCTileStipXOrigin) dgc->values.ts_x_origin=sgc->values.ts_x_origin; if (vmask&GCTileStipYOrigin) dgc->values.ts_y_origin=sgc->values.ts_y_origin; if (vmask&GCFont) dgc->values.font=sgc->values.font; if (vmask&GCSubwindowMode) dgc->values.subwindow_mode=sgc->values.subwindow_mode; if (vmask&GCGraphicsExposures) dgc->values.graphics_exposures=sgc->values.graphics_exposures; if (vmask&GCClipXOrigin) dgc->values.clip_x_origin=sgc->values.clip_x_origin; if (vmask&GCClipYOrigin) dgc->values.clip_y_origin=sgc->values.clip_y_origin; if (vmask&GCClipMask) dgc->values.clip_mask=sgc->values.clip_mask; if (vmask&GCDashList) dgc->values.dashes=sgc->values.dashes; if (vmask&GCArcMode) dgc->values.arc_mode=sgc->values.arc_mode; dgc->dirty = 0xFFFF; return 0;}intXSetClipMask(display,gc,cmask)Display *display;GC gc;Pixmap cmask;{ xtrace("XSetClipMask\n"); return 0;}intXSetClipRectangles(display,gc,clx,cly,rs,n,order)Display *display;GC gc;int clx,cly;XRectangle *rs;int n,order;{ xtrace("XSetClipRectangles\n"); return 0;}/*****************************************************************\ Function: XSetFunction Inputs: display, gc, graphics operation. Comments: ZZzzz...\*****************************************************************/intXSetFunction(display,gc,fn)Display *display;GC gc;int fn;{ xtrace("XSetFunction\n"); gc->values.function=fn; gc->dirty |= GCFunction; return 0;}/*****************************************************************\ Function: XSetLineAttributes Inputs: display, gc, line width, line style, cap style, join style. Comments: These all have windows equivalents.\*****************************************************************/intXSetLineAttributes(display,gc,lw,ls,cs,js)Display *display;GC gc;unsigned int lw;int ls,cs,js;{ xtrace("XSetLineAttributes\n"); gc->values.line_width=lw; gc->values.line_style=ls; gc->values.cap_style=cs; gc->values.join_style=js; gc->dirty |= GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle; return 0;}/*****************************************************************\ Function: XSetPlaneMask Inputs: display, gc, plane mask. Comments: What's a plane mask?\*****************************************************************/intXSetPlaneMask(display,gc,pmask)Display *display;GC gc;unsigned long pmask;{ xtrace("XSetPlaneMask\n"); gc->values.plane_mask=pmask; return 0;}intXSetTile(display,gc,tile)Display *display;GC gc;Pixmap tile;{ xtrace("XSetTile\n"); return 0;}StatusDefXAllocColorCells(display,cmap,cont,pmasks,np,pixels,nc)Display *display;Colormap cmap;BoolDef cont;unsigned long *pmasks;unsigned int np;unsigned long *pixels;unsigned int nc;{ unsigned int i; xtrace("XAllocColorCells\n"); for (i = 0;i<nc;i++) pixels[i] = i; if(np==1) { *pmasks = nc; } return 1;}/*****************************************************************\ Function: XAllocColorPlanes Inputs: display, colour map, contiguous flag, pixel value list, number of colours, number of reds, greens, blues. Returned: red mask, green mask, blue mask, status. Comments: Works for True Colour only.\*****************************************************************/StatusDefXAllocColorPlanes(display,cmap,cont,pixels,nc,nr,ng,nb,rmask,gmask,bmask)Display *display;Colormap cmap;BoolDef cont;unsigned long *pixels;int nc;int nr,ng,nb;unsigned long *rmask,*gmask,*bmask;{ xtrace("XAllocColorPlanes\n"); *rmask=255; *gmask=255<<8; *bmask=255<<16; return (1);}StatusDefXAllocNamedColor(Display *display, Colormap cmap, const char *cname, XColor *cell, XColor *rgb){ xtrace("XAllocNamedColor\n"); return 0;}ColormapXCreateColormap(display,w,visual,alloc)Display *display;Window w;Visual *visual;int alloc;{ xtrace("XCreateColormap\n"); return 0;}StatusDefXGetStandardColormap(display,w,cmapinf,prop)Display *display;Window w;XStandardColormap *cmapinf;Atom prop;{ xtrace("XGetStandardColormap\n"); return 0;}StatusDefXAllocColor(display,cmap,xc)Display *display;Colormap cmap;XColor *xc;{ xtrace("XAllocColor\n"); xc->pixel = RGB((BYTE) (xc->red>>8)&0xff, (BYTE) (xc->green>>8)&0xff, (BYTE) (xc->blue>>8)&0xff); return 1;}intXQueryColor(display,cmap,cell)Display *display;Colormap cmap;XColor *cell;{ xtrace("XQueryColor\n"); cell->red = (cell->pixel>>8)&0x0ff00; cell->green = (cell->pixel)&0x0ff00; cell->blue = (cell->pixel<<8)&0x0ff00; return 1;}intXQueryColors(display,cmap,cells,nc)Display *display;Colormap cmap;XColor *cells;int nc;{ int i; xtrace("XQueryColors\n"); for (i=0;i<nc;i++) { cells[i].red=(cells[i].pixel>>8)&0xff00; cells[i].green=(cells[i].pixel)&0xff00; cells[i].blue=(cells[i].pixel<<8)&0xff00; } return 0;}intXStoreColor(display,cmap,cell)Display *display;Colormap cmap;XColor *cell;{ xtrace("XStoreColor\n"); return 0;}intXStoreColors(display,cmap,cells,nc)Display *display;Colormap cmap;XColor *cells;int nc;{ int i; xtrace("XStoreColors\n"); return 0;}char **XGetFontPath(display,nps)Display *display;int *nps;{ xtrace("XGetFontPath\n"); return (NULL);}BoolDefXGetFontProperty(fstruct,atom,val)XFontStruct *fstruct;Atom atom;unsigned long *val;{ xtrace("XGetFontProperty\n"); return (0);}static BYTEgetCharSetFromName(const char *name,char **lang){ static struct { char *label; BYTE id; } charset[] = {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -