unit X11; {$MODE OBJFPC} interface uses X11_Objects, SYSV, type_fixes, ctypes, xlib; type { just some metadata about it: } TFontInfo = record dummy : Integer; // FIXME. end; IFont = interface(X11_Objects.IObject) ['{2453f726-e4d8-11dd-b4ce-69f2cdbe153b}'] end; TLineAttributes = record LineWidth : cint; LineStyle : cint; CapStyle : cint; JoinStyle : cint; end; IPixmap = interface(X11_Objects.IObject) ['{19f75264-e4d8-11dd-859b-0771be3a8bdc}'] end; IXImage = interface ['{15f0fbe8-e4d8-11dd-9557-dd279f2ab68f}'] function GetHandle() : PXImage; property Handle : PXImage read GetHandle; end; IVisual = interface ['{1327a500-e4d9-11dd-ba81-89a3d6be09d3}'] function GetHandle() : PVisual; property Handle : PVisual read GetHandle; end; IDeviceContext = interface ['{fdd0659c-e4d9-11dd-921e-9943da7d2a44}'] function GetFont() : IFont; procedure SetFont(const aValue : IFont); function GetForeground() : TUINT32; procedure SetForeground(aValue : TUINT32); function GetLineAttributes() : TLineAttributes; procedure SetLineAttributes(const aValue : TLineAttributes); function GetHandle() : PXGC; property Font : IFont read GetFont write SetFont; property Foreground : TUINT32 read GetForeground write SetForeground; property LineAttributes : TLineAttributes read GetLineAttributes write SetLineAttributes; property Handle : PXGC read GetHandle; end; IDrawable = interface(X11_Objects.IObject) ['{11521806-e4d8-11dd-9ac6-494247a465a6}'] // TODO draw line, rectangle, ... procedure DrawString(const aGC : IDeviceContext; aX, aY : TInteger; const aText : ANSIString; aTextLength : TInteger = -1); procedure SHMPutImage(const aGC : IDeviceContext; const aImage : IXImage; aSrcX, aSrcY, aDestX, aDest : TInteger; aWidth, aHeight : TCardinal; aBSendCompletionEvent : Boolean); procedure PutImage(const aGC : IDeviceContext; const aImage : IXImage; aSrcX, aSrcY, aDestX, aDestY : TInteger; aWidth, aHeight : TCardinal); end; IWindow = interface(IDrawable) ['{0c3a5e3c-e4d8-11dd-a777-adb328a192d2}'] // TODO title, icon, ... Background Pixmap, ..., GC, ... procedure Map; procedure Unmap; procedure UnmapSubWindows; procedure Raise_; procedure Lower; procedure Clear; function GetBackgroundPixmap : IPixmap; procedure SetBackgroundPixmap(const aValue : IPixmap); property BackgroundPixmap : IPixmap read GetBackgroundPixmap write SetBackgroundPixmap; function GetTitle : ANSIString; procedure SetTitle(aValue : ANSIString); property Title : ANSIString read GetTitle write SetTitle; end; {IScreen = interface(X11_Objects.IObject) function GetRootWindow : IWindow; property RootWindow : IWindow read GetRootWindow; end;} ISHMSegment = interface(X11_Objects.IObject) // this locks a shared memory segment to a single display. I don't think this is a problem in practise. ['{fff1b558-e4d7-11dd-ac2c-338a4c7b492b}'] function GetSharedMemory : ISharedMemory; function GetBReadOnly : TBoolean; property SharedMemory : ISharedMemory read GetSharedMemory; property BReadOnly : TBoolean read GetBReadOnly; end; {IDisplay = interface // (X11_Objects.IObject) function GetScreen(aIndex : TCardinal) : IScreen; function GetScreenCount : TCardinal; property Screens[index : TCardinal] : IScreen read GetScreen; property ScreenCount : TCardinal read GetScreenCount; procedure Flush; end;} TPixmapFormat = record depth : Integer; bits_per_pixel : Integer; scanline_pad : Integer; end; ISHMExtension = interface ['{f5c0a79c-e4d7-11dd-85c5-ef21b52f76f7}'] function GetMajorVersion : Integer; function GetMinorVersion : Integer; function GetBSharedMemoryPixmaps : Boolean; function GetPixmapFormat : TPixmapFormat; property MajorVersion : Integer read GetMajorVersion; property MinorVersion : Integer read GetMinorVersion; property BSharedMemoryPixmaps : Boolean read GetBSharedMemoryPixmaps; property PixmapFormat : TPixmapFormat read GetPixmapFormat; // depth, bits_per_pixel, scanline_pad. end; implementation end.