unit X11_Images; interface implementation { XYPixmap ZPixmap XShmAttach XShmCreateImage XShmCreatePixmap XShmDetach XShmGetEventBase XShmGetImage XShmPixmapFormat(display) == ZPixmap XShmPutImage XShmQueryExtension } //XShmQueryVersion(display, @major, @minor, @pixmaps{bool}); //XImage XShmCreateImage(display, visual, depth, ZPixmap, data, shminfo, width, height) //Pixmap XShmCreatePixmap(display, drawable, data, shminfo, width, height, depth) //Status XShmDetach(display, shminfo) //Status XShmAttach(display, XShmSegmentInfo* shminfo); should be != 0. { XOpenDisplay DefaultDepth(display, DefaultScreen(display)) DefaultScreenOfDisplay DefaultScreen(display)# DefaultVisualOfScreen(screen) XCreateSimpleWindow(display, RootWindowOfScreen..., InputOutput, visual); != 0 XSizeHints hints hints.flags = PSize or PMinSize or PMaxSize; hints.min_width := hints.max_width := hints.base_width := image_width; hints.min_height... XSetWMNormalHints(display, window, &hints); XStoreName(display, window, "Nice Title"); XSelectInput(display, window, ExposureMask or PKeyPressMask or KeyReleaseMask or ButtonPressMask); XCreateGC(display, window, 0, NULL) // XPutImage. } //XMap{Raised}(display, window); { XCreateImage(display, visual, depth, ZPixmap, offset, data, width, height, bitmap_pad, bytes_per_line) XPutImage(display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height) XDestroyImage XFreeGC XDestroyWindow XCloseDisplay XShmPutImage(display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height, send_completion_event) XFlush } { shmget(IPC_PRIVATE, bytes_per_line * height, IPC_CREAT|0666); < 0 error. addr = shmat(shmid, NULL, 0) == 0 error. readOnly = False. ... XShmDetach XDestroyImage shmdt shmctl(shmid, IPC_RMID, NULL); free seginfo Free GC Destroy Window. Close Display. // or maybe XSetWindowBackgroundPixmap. // event loop: // XNextEvent(display, &ev); // ev.type == KeyPress || ButtonPress. // XNextPevent flush the output buffer? // key codes: XK_Escape, ... } // XShmPutImage: see drawable. end.