Lines Matching defs:dpy
76 Display *dpy = NULL; /* X server being used */
133 if (dpy) {
134 XCloseDisplay (dpy);
135 dpy = NULL;
239 dpy = XOpenDisplay (displayname);
240 if (!dpy) {
255 allplanes = XAllPlanesQueryExtension(dpy, &tmp, &tmp);
259 wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
266 if (!pix_font) pix_font = XGetDefault (dpy, ProgramName, "font");
267 if (!pix_font) pix_font = XGetDefault (dpy, ProgramName, "Font");
269 if (!geometry) geometry = XGetDefault (dpy, ProgramName, "geometry");
270 if (!geometry) geometry = XGetDefault (dpy, ProgramName, "Geometry");
273 source_geometry = XGetDefault (dpy, ProgramName, "source");
275 source_geometry = XGetDefault (dpy, ProgramName, "Source");
278 char *tmp = XGetDefault (dpy, ProgramName, "magnification");
279 if (!tmp) tmp = XGetDefault (dpy, ProgramName, "Magnification");
285 char *tmp = XGetDefault (dpy, ProgramName, "borderWidth");
286 if (!tmp) tmp = XGetDefault (dpy, ProgramName, "BorderWidth");
292 border_color = XGetDefault (dpy, ProgramName, "borderColor");
294 border_color = XGetDefault (dpy, ProgramName, "BorderColor");
297 back_color = XGetDefault (dpy, ProgramName, "background");
299 back_color = XGetDefault (dpy, ProgramName, "Background");
305 screen = DefaultScreen (dpy);
306 cmap = DefaultColormap (dpy, screen);
307 visual = DefaultVisual(dpy,screen) ;
310 if (((def_vis = XGetVisualInfo(dpy,VisualIDMask|VisualScreenMask,
325 npixelvalues = DisplayCells (dpy, screen);
329 if ((vlist=XGetVisualInfo(dpy,VisualScreenMask,&vinfo_template,&num_vis))
335 root = RootWindow (dpy, screen);
336 pixmap_format = (DisplayPlanes (dpy, screen) > 1 ? ZPixmap : XYPixmap);
507 window_hints.x = DisplayWidth (dpy, screen) + window_hints.x -
511 window_hints.y = DisplayHeight (dpy, screen) + window_hints.y -
515 source_hints.x = DisplayWidth (dpy, screen) + source_hints.x -
519 source_hints.y = DisplayHeight (dpy, screen) + source_hints.y -
536 if (border_color && XParseColor (dpy, cmap, border_color, &cdef) &&
537 XAllocColor (dpy, cmap, &cdef)) {
540 border_pixel = BlackPixel (dpy, screen);
561 back_pixel = BlackPixel (dpy, screen);
579 } else if (XParseColor (dpy, cmap, back_color, &cdef) &&
580 XAllocColor (dpy, cmap, &cdef)) {
592 attr.cursor = XCreateFontCursor (dpy, XC_top_left_arrow);
602 if ((num_vis) > 1 && (XMatchVisualInfo(dpy, screen, 24, TrueColor, &vis))) {
605 FinalImage = XCreateImage(dpy, vis.visual, vis.depth, ZPixmap, 0,
609 w1 = XCreateWindow(dpy, root,
618 Colormap c = XCreateColormap(dpy, root, vis.visual, AllocNone);
621 w1 = XCreateWindow(dpy, root,
640 XDestroyWindow(dpy, w1);
656 w = XCreateWindow (dpy, root,
659 border_width, DefaultDepth (dpy, screen),
674 XSetWMProperties (dpy, w, &windowName, &iconName, Argv, Argc,
678 XSetWMProperties (dpy, w1, &windowName, &iconName, Argv, Argc,
691 fillGC = XCreateGC (dpy, w, (GCFunction | GCPlaneMask | GCFillStyle),
695 fillGC1 = XCreateGC (dpy, w1, (GCFunction | GCPlaneMask | GCFillStyle),
706 XGrabServer (dpy); /* ungrab is in do_magnify */
707 XSync (dpy, 0);
714 XGrabServer (dpy); /* ungrab is in do_magnify */
716 XSync (dpy, 1);
733 int dw = DisplayWidth (dpy, screen), dh = DisplayHeight (dpy, screen);
749 gcv.foreground = BlackPixel (dpy, screen);
751 invGC = XCreateGC (dpy, root, (GCFunction | GCSubwindowMode |
758 invCursor = XCreateFontCursor (dpy, XC_crosshair);
762 if (XGrabPointer (dpy, root, False, ButtonReleaseMask,
778 if (XPending (dpy) != 0) {
781 XNextEvent (dpy, &event);
794 } else if (!XQueryPointer (dpy, root, &root_window, &child_window,
827 XAllPlanesDrawLines (dpy, root, box, NPOINTS, CoordModeOrigin);
831 XDrawLines (dpy, root, invGC, box, NPOINTS, CoordModeOrigin);
836 XUngrabPointer (dpy, CurrentTime);
837 XFlush (dpy);
853 int dw = DisplayWidth (dpy, screen), dh = DisplayHeight (dpy, screen);
871 mvInit(dpy, screen, vlist, num_vis);
891 image = XGetImage (dpy, root, x, y, width, height,
901 image = XGetImage (dpy, root, x, y, width, height,
911 XUngrabServer (dpy);
912 XSync (dpy, 0);
943 XMapWindow (dpy, mw);
944 (void)XSetWMProtocols(dpy, mw, &wm_delete_window, 1);
953 XNextEvent (dpy, &event);
957 XCloseDisplay(dpy);
983 if (XQueryPointer(dpy,mw,&rootW,&childW,&rx,&ry,&x,&y,&mask)) {
1002 XQueryColor (dpy, cmap, &def);
1035 XUnmapWindow (dpy, mw);
1037 XSetWMNormalHints (dpy, mw, whp);
1072 XChangeGC (dpy, fGC, GCForeground, &gcv);
1131 XChangeGC (dpy, fGC, GCForeground, &gcv);
1134 XFillRectangle (dpy, mw, fGC,
1148 XChangeGC (dpy, fGC, GCForeground, &gcv);
1151 XFillRectangle (dpy, mw, fGC, r_x, r_y, r_width, r_height);
1157 XFlush (dpy);
1180 XGetGeometry (dpy, wind, &rootW, &x, &y, &w, &h, &bwide, &depth);
1184 pixfinfo = XLoadQueryFont (dpy, pix_font);
1198 XSetFont (dpy, fGC, pixfinfo->fid);
1202 pixwind = XCreateSimpleWindow (dpy, wind, 0, y, w, thigh,
1203 0, None, BlackPixel (dpy, screen));
1210 xsw.background_pixel = BlackPixel(dpy, screen);
1214 xsw.border_pixel = BlackPixel(dpy, screen);
1215 xsw.colormap = DefaultColormap(dpy, screen);
1216 pixwind = XCreateWindow(dpy, wind, 0, y, w, thigh, 0,
1217 DefaultDepth(dpy, screen), InputOutput,
1218 DefaultVisual(dpy, screen),
1225 pixGC = XCreateGC (dpy,pixwind,(GCFunction | GCPlaneMask | GCFillStyle),
1229 XMoveWindow (dpy, pixwind, 0, y);
1232 XMapWindow (dpy, pixwind);
1239 XClearWindow (dpy, pixwind);
1240 XSetForeground (dpy, pixGC, WhitePixel(dpy, screen));
1241 XDrawString (dpy, pixwind, pixGC, 4, 2 + pixfinfo->ascent,
1249 XUnmapWindow (dpy, pixwind);
1251 XDestroyWindow(dpy, pixwind);
1253 XFreeGC(dpy, pixGC);