====== std.x11 ====== Direkte Xlib-Bindings für das X Window System (X11R6). Öffnet Displays (''XOpenDisplay''), erstellt Fenster (''XCreateSimpleWindow''), zeichnet Linien, Rechtecke und Text (''XDrawLine'', ''XFillRectangle'', ''XDrawString''), verwaltet Farben (''XAllocColor'', ''XAllocNamedColor''), Schriftarten (''XLoadFont'') und Graphics Contexts. Event-Verarbeitung: Tastatur (''KeyPress''/''KeyRelease''), Maus (''ButtonPress'', ''MotionNotify'') und Fenster-Events (''Expose'', ''ConfigureNotify''). Einsatzbereiche: native Desktop-GUIs ohne GUI-Framework-Overhead, Visualisierungstools, Custom-Rendering-Engines, wissenschaftliche Darstellungen auf Linux. **Autor:** Andreas Röne\\ **Copyright:** 2024-2025 Andreas Röne ---- ===== Konstanten ===== ^ Name ^ Typ ^ Wert ^ Sichtbarkeit ^ | ''XFalse'' | ''int64'' | ''0'' | pub | | ''XTrue'' | ''int64'' | ''1'' | pub | | ''KeyPress'' | ''int64'' | ''2'' | pub | | ''KeyRelease'' | ''int64'' | ''3'' | pub | | ''ButtonPress'' | ''int64'' | ''4'' | pub | | ''ButtonRelease'' | ''int64'' | ''5'' | pub | | ''MotionNotify'' | ''int64'' | ''6'' | pub | | ''EnterNotify'' | ''int64'' | ''7'' | pub | | ''LeaveNotify'' | ''int64'' | ''8'' | pub | | ''FocusIn'' | ''int64'' | ''9'' | pub | | ''FocusOut'' | ''int64'' | ''10'' | pub | | ''Expose'' | ''int64'' | ''12'' | pub | | ''GraphicsExpose'' | ''int64'' | ''13'' | pub | | ''NoExpose'' | ''int64'' | ''14'' | pub | | ''VisibilityNotify'' | ''int64'' | ''15'' | pub | | ''CreateNotify'' | ''int64'' | ''16'' | pub | | ''DestroyNotify'' | ''int64'' | ''17'' | pub | | ''UnmapNotify'' | ''int64'' | ''18'' | pub | | ''MapNotify'' | ''int64'' | ''19'' | pub | | ''MapRequest'' | ''int64'' | ''20'' | pub | | ''ReparentNotify'' | ''int64'' | ''21'' | pub | | ''ConfigureNotify'' | ''int64'' | ''22'' | pub | | ''ConfigureRequest'' | ''int64'' | ''23'' | pub | | ''GravityNotify'' | ''int64'' | ''24'' | pub | | ''ResizeRequest'' | ''int64'' | ''25'' | pub | | ''CirculateNotify'' | ''int64'' | ''26'' | pub | | ''CirculateRequest'' | ''int64'' | ''27'' | pub | | ''PropertyNotify'' | ''int64'' | ''28'' | pub | | ''SelectionClear'' | ''int64'' | ''29'' | pub | | ''SelectionRequest'' | ''int64'' | ''30'' | pub | | ''SelectionNotify'' | ''int64'' | ''31'' | pub | | ''ColormapNotify'' | ''int64'' | ''32'' | pub | | ''ClientMessage'' | ''int64'' | ''33'' | pub | | ''MappingNotify'' | ''int64'' | ''34'' | pub | | ''GenericEvent'' | ''int64'' | ''35'' | pub | | ''ShiftMask'' | ''int64'' | ''1'' | pub | | ''LockMask'' | ''int64'' | ''2'' | pub | | ''ControlMask'' | ''int64'' | ''4'' | pub | | ''Mod1Mask'' | ''int64'' | ''8'' | pub | | ''Mod2Mask'' | ''int64'' | ''16'' | pub | | ''Mod3Mask'' | ''int64'' | ''32'' | pub | | ''Mod4Mask'' | ''int64'' | ''64'' | pub | | ''Mod5Mask'' | ''int64'' | ''128'' | pub | | ''Button1Mask'' | ''int64'' | ''256'' | pub | | ''Button2Mask'' | ''int64'' | ''512'' | pub | | ''Button3Mask'' | ''int64'' | ''1024'' | pub | | ''Button4Mask'' | ''int64'' | ''2048'' | pub | | ''Button5Mask'' | ''int64'' | ''4096'' | pub | | ''Button1'' | ''int64'' | ''1'' | pub | | ''Button2'' | ''int64'' | ''2'' | pub | | ''Button3'' | ''int64'' | ''3'' | pub | | ''Button4'' | ''int64'' | ''4'' | pub | | ''Button5'' | ''int64'' | ''5'' | pub | | ''CWBackPixmap'' | ''int64'' | ''1'' | pub | | ''CWBackPixel'' | ''int64'' | ''2'' | pub | | ''CWBorderPixmap'' | ''int64'' | ''4'' | pub | | ''CWBorderPixel'' | ''int64'' | ''8'' | pub | | ''CWBitGravity'' | ''int64'' | ''16'' | pub | | ''CWWinGravity'' | ''int64'' | ''32'' | pub | | ''CWBackingStore'' | ''int64'' | ''64'' | pub | | ''CWBackingPlanes'' | ''int64'' | ''128'' | pub | | ''CWBackingPixel'' | ''int64'' | ''256'' | pub | | ''CWOverrideRedirect'' | ''int64'' | ''512'' | pub | | ''CWSaveUnder'' | ''int64'' | ''1024'' | pub | | ''CWEventMask'' | ''int64'' | ''2048'' | pub | | ''CWDontPropagate'' | ''int64'' | ''4096'' | pub | | ''CWColormap'' | ''int64'' | ''8192'' | pub | | ''CWCursor'' | ''int64'' | ''16384'' | pub | | ''InputOutput'' | ''int64'' | ''1'' | pub | | ''InputOnly'' | ''int64'' | ''2'' | pub | ---- ===== Externe Funktionen ===== ^ Signatur ^ Beschreibung ^ | ''XOpenDisplay(displayName: int64): int64'' | Öffnet Verbindung zum X11-Display-Server | | ''XCloseDisplay(display: int64): int64'' | Schließt Verbindung zum Display-Server | | ''XDefaultScreen(display: int64): int64'' | Liefert Standard-Bildschirmnummer des Displays | | ''XDefaultDepth(display: int64, screen: int64): int64'' | Liefert Farbtiefe des Bildschirms | | ''XDefaultGC(display: int64, screen: int64): int64'' | Liefert Standard-Graphics-Context des Screens | | ''XDefaultColormap(display: int64, screen: int64): int64'' | Liefert Standard-Farbtabelle des Screens | | ''XDisplayWidth(display: int64, screen: int64): int64'' | Liefert Bildschirmbreite in Pixeln | | ''XDisplayHeight(display: int64, screen: int64): int64'' | Liefert Bildschirmhöhe in Pixeln | | ''XScreenOfDisplay(display: int64, screen: int64): int64'' | Liefert Screen-Objekt des Displays | | ''XRootWindow(display: int64, screen: int64): int64'' | Liefert Root-Fenster-ID des Screens | | ''XCreateWindow(display: int64, parent: int64, x: int64, y: int64, width: int64, height: int64, borderWidth: int64, depth: int64, windowClass: int64, visual: int64, mask: int64, attributes: int64): int64'' | Erstellt neues Fenster mit Attributen | | ''XDestroyWindow(display: int64, window: int64)'' | Zerstört Fenster und gibt Ressourcen frei | | ''XMapWindow(display: int64, window: int64)'' | Macht Fenster auf dem Screen sichtbar | | ''XUnmapWindow(display: int64, window: int64)'' | Versteckt Fenster ohne es zu zerstören | | ''XMapRaised(display: int64, window: int64)'' | Zeigt Fenster und bringt es in Vordergrund | | ''XGetWindowAttributes(display: int64, window: int64, attributes: int64): int64'' | Liest aktuelle Fensterattribute aus | | ''XSetWindowBackground(display: int64, window: int64, background: int64)'' | Setzt Hintergrundfarbe des Fensters | | ''XSetWindowBorderWidth(display: int64, window: int64, width: int64)'' | Setzt Rahmenbreite des Fensters | | ''XMoveWindow(display: int64, window: int64, x: int64, y: int64)'' | Verschiebt Fenster an neue Position | | ''XResizeWindow(display: int64, window: int64, width: int64, height: int64)'' | Ändert Größe des Fensters | | ''XMoveResizeWindow(display: int64, window: int64, x: int64, y: int64, width: int64, height: int64)'' | Verschiebt und skaliert Fenster gleichzeitig | | ''XSetWindowTitle(display: int64, window: int64, title: int64)'' | Setzt Titelleistentext des Fensters | | ''XSetWMName(display: int64, window: int64, property: int64)'' | Setzt Window-Manager-Namen des Fensters | | ''XNextEvent(display: int64, event: int64): int64'' | Liest nächstes Ereignis aus der Warteschlange | | ''XPeekEvent(display: int64, event: int64): int64'' | Liest Ereignis ohne es zu entfernen | | ''XPending(display: int64): int64'' | Liefert Anzahl ausstehender Ereignisse | | ''XSelectInput(display: int64, window: int64, eventMask: int64)'' | Legt abzufangende Ereignistypen fest | | ''XClearWindow(display: int64, window: int64)'' | Löscht gesamten Fensterinhalt | | ''XClearArea(display: int64, window: int64, x: int64, y: int64, width: int64, height: int64, exposures: int64)'' | Löscht rechteckigen Bereich im Fenster | | ''XFillRectangle(display: int64, window: int64, gc: int64, x: int64, y: int64, width: int64, height: int64)'' | Zeichnet gefülltes Rechteck | | ''XDrawRectangle(display: int64, window: int64, gc: int64, x: int64, y: int64, width: int64, height: int64)'' | Zeichnet Rechteckrahmen | | ''XDrawLine(display: int64, window: int64, gc: int64, x1: int64, y1: int64, x2: int64, y2: int64)'' | Zeichnet Linie zwischen zwei Punkten | | ''XDrawString(display: int64, window: int64, gc: int64, x: int64, y: int64, string: int64, length: int64)'' | Zeichnet Text an angegebener Position | | ''XCreateGC(display: int64, drawable: int64, mask: int64, values: int64): int64'' | Erstellt neuen Graphics-Context | | ''XFreeGC(display: int64, gc: int64)'' | Gibt Graphics-Context-Ressourcen frei | | ''XSetForeground(display: int64, gc: int64, foreground: int64)'' | Setzt Vordergrundfarbe im GC | | ''XSetBackground(display: int64, gc: int64, background: int64)'' | Setzt Hintergrundfarbe im GC | | ''XSetLineAttributes(display: int64, gc: int64, lineWidth: int64, lineStyle: int64, capStyle: int64, joinStyle: int64)'' | Konfiguriert Linienattribute im GC | | ''XAllocColor(display: int64, colormap: int64, screenInOut: int64): int64'' | Reserviert Farbe in der Farbtabelle | | ''XAllocNamedColor(display: int64, colormap: int64, colorName: int64, screenDef: int64, exactDef: int64): int64'' | Reserviert benannte Farbe in Farbtabelle | | ''XFreeColors(display: int64, colormap: int64, pixels: int64, npixels: int64, planes: int64)'' | Gibt reservierte Farben wieder frei | | ''XLoadFont(display: int64, name: int64): int64'' | Lädt Schriftart nach Namen | | ''XUnloadFont(display: int64, font: int64)'' | Gibt geladene Schriftart frei | | ''XSetFont(display: int64, gc: int64, font: int64)'' | Setzt aktive Schriftart im GC | | ''XFlush(display: int64): int64'' | Sendet gepufferte Befehle an Server | | ''XSync(display: int64, discard: int64)'' | Synchronisiert Client mit X-Server | | ''XInternAtom(display: int64, name: int64, onlyIfExists: int64): int64'' | Liefert oder erzeugt Atom für Namen | ---- ===== Typen ===== ==== XDisplay (struct) ==== ^ Feld ^ Typ ^ ==== XWindow (struct) ==== ^ Feld ^ Typ ^ ==== XGC (struct) ==== ^ Feld ^ Typ ^ ---- ===== Funktionen ===== ^ Signatur ^ Sichtbarkeit ^ Beschreibung ^ | ''XOpen(displayName: pchar): XDisplay'' | pub | Öffnet Display-Verbindung als XDisplay | | ''XClose(disp: XDisplay)'' | pub | Schließt XDisplay-Verbindung | | ''XScreenWidth(disp: XDisplay): int64'' | pub | Liefert Bildschirmbreite des Displays | | ''XScreenHeight(disp: XDisplay): int64'' | pub | Liefert Bildschirmhöhe des Displays | | ''GetRootWindow(display: int64): int64'' | pub | Liefert Root-Fenster-ID | | ''XCreateSimpleWindow(disp: XDisplay, parent: int64, x: int64, y: int64, width: int64, height: int64): XWindow'' | pub | Erstellt einfaches Fenster | | ''XMapDisplayWindow(disp: XDisplay, window: int64)'' | pub | Zeigt Fenster auf dem Display | | ''XSetDisplayWindowTitle(disp: XDisplay, window: int64, title: pchar)'' | pub | Setzt Fenstertitel des Displays | | ''XFlushDisplay(disp: XDisplay)'' | pub | Sendet gepufferte Display-Befehle | | ''XEventsPending(disp: XDisplay): int64'' | pub | Liefert Anzahl ausstehender Events |