flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Linux32(not only 32 anymore) Xlib GUI program template

Author
Thread Post new topic Reply to topic
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 03 Jun 2020, 07:41
for a long time linux had only console examples

what to add?:
examples/template/template.asm
Code:
format ELF executable 3
entry start

include 'linux/x86.inc'

interpreter '/lib/ld-linux.so.2'
needed 'libX11.so.6'

include 'os_specs/linux/api/x86/libx11.inc'

segment readable executable
start:
        cinvoke libx11.XOpenDisplay, 0
        or      eax, eax
        jz      .failXserver
        mov     [hdisplay], eax
        cinvoke libx11.XDefaultScreen, eax
        cinvoke libx11.XDefaultRootWindow, [hdisplay]
        cinvoke libx11.XCreateSimpleWindow, [hdisplay], eax, 10, 20, 400, 200, 0, $000000, $D4D0C8
        or      eax, eax
        jz      .failCreateWindow
        mov     [hwnd], eax
        cinvoke libx11.XSelectInput, [hdisplay], [hwnd], 0
        cinvoke libx11.XStoreName, [hdisplay], [hwnd], _title
        cinvoke libx11.XMapRaised, [hdisplay], [hwnd]
        or      eax, eax
        jz      .failShow
        cinvoke libx11.XCreateGC, [hdisplay], [hwnd], 0, 0
        mov     [hGC], eax
        cinvoke libx11.XSetForeground, [hdisplay], [hGC], $000000
        cinvoke libx11.XSetBackground, [hdisplay], [hGC], $ffffff
.msg_pump:
        cinvoke libx11.XNextEvent, [hdisplay], event
        jmp     .msg_pump
        stdcall Xshutdown
.failShow:
.failCreateWindow:
.failXserver:
        mov     [con_handle],2
        mov     esi,_error
        call    display_string
        mov     al,-1
exit_program:
        movzx   ebx,al
        lcall   sys_exit,ebx
Xshutdown:
        cinvoke libx11.XFreeGC, [hdisplay], [hGC]
        cinvoke libx11.XDestroyWindow, [hwnd], [hdisplay]
        cinvoke libx11.XSetErrorHandler, [oError]
        xor     eax, eax
        retn

display_string:
        push    ebx
        mov     edi,esi
        mov     edx,esi
        or      ecx,-1
        xor     al,al
        repne   scasb
        neg     ecx
        sub     ecx,2
        xchg    ecx,edx
        lcall   sys_write,[con_handle],ecx,edx
        pop     ebx
        retn

segment readable writeable
        _title          db 'Linux32 Xlib GUI program template',0
        _error          db 'Startup failed.',0
        con_handle      dd 0
        oError          dd 0
        hGC             dd 0
        hwnd            dd 0
        hdisplay        dd 0
        event           rd 132    


what will needed
Code:
-includes
 +--formats
 |  +--elf
 |     +--equates
 |     |  +--equates.inc
 |     +--macro
 |        +--import32.inc
 +--generic
 |  +--macro
 |     +--struct.inc
 +--linux
 |  +--x86.inc
 +--os_specs
    +--linux
    |  +--api
    |  |  +--x86
    |  |     +--libx11.inc
    |  +--equates
    |  |  +--libx11.inc
    |  |  +--syscalls
    |  |     +--x86.inc
    |  +--macro
    |  |  +--x86
    |  |     +--syscall.inc
    |  +--structs
    |     +--x86
    |        +--libx11.inc
    +--nix
    |  +--macro
    |     +--x86
    |        +--calls32.inc
    +--windows
       +--macro
          +--x86
             +--proc32.inc    


start with includes/linux/x86.inc
Code:
; Linux programming headers

;====== fundamental macros ======================
include '../generic/macro/struct.inc'
;====== OS specific macros ======================
include '../os_specs/windows/macro/x86/proc32.inc'
include '../os_specs/nix/macro/x86/calls32.inc'
include '../os_specs/linux/macro/x86/syscall.inc'
;====== file format specific macros =============
include '../formats/elf/macro/import32.inc'
;====== OS specific equates =====================
include '../os_specs/linux/equates/syscalls/x86.inc'
include '../os_specs/linux/equates/libx11.inc'
;====== file format specific macros =============
include '../formats/elf/equates/equates.inc'
;====== OS specific structures ==================
include '../os_specs/linux/structs/x86/libx11.inc'    


includes/generic/macro/struct.inc - already known
includes/os_specs/windows/macro/x86/proc32.inc - already known
includes/os_specs/nix/macro/x86/calls32.inc - already known (libc calling convention)
includes/os_specs/linux/macro/x86/syscall.inc
Code:
macro __mov reg,a,b {
        match any,a \{
                if ~(a eq reg)
                        mov reg,a
                end if \} }

macro lcall a,b,c,d,e,f {
        __mov   edi,f
        __mov   esi,e
        __mov   edx,d
        __mov   ecx,c
        __mov   ebx,b
        __mov   eax,a
        int     $80 }    


includes/formats/elf/macro/import32.inc (standart one was for messed all imports in one import flow, I extend it to separate imports to standalone files):
Code:
macro Elf32_Sym name,value,size,bind,type,other,shndx {
        dd name+0
        dd value+0
        dd size+0
        db bind+0 + type+0
        db other+0
        dw shndx+0 }

virtual at 0
 Elf32_Sym
 sizeof.Elf32_Sym = $
end virtual

macro Elf32_Rel offset,symbol,type
{
  dd offset+0
  dd (symbol+0) shl 8 + (type+0)
}

virtual at 0
 Elf32_Rel
 sizeof.Elf32_Rel = $
end virtual

macro Elf32_Rela offset,symbol,type,addend
{
  dd offset+0
  dd (symbol+0) shl 8 + (type+0)
  dd addend+0
}

virtual at 0
 Elf32_Rela
 sizeof.Elf32_Rela = $
end virtual

macro interpreter [library] {
        define interpreter@ library }

macro needed [library] {
 local str
 match needed,needed@dynamic \{ define needed@dynamic needed,str:library \}
 match ,needed@dynamic \{ define needed@dynamic str:library \} }

define needed@dynamic

macro import [name,string] {
 local str
 match import,import@strtab \{ define import@strtab import,str:name:string \}
 match ,import@strtab \{ define import@strtab str:name:string \} }

define import@strtab

postpone {
        match library,interpreter@ \{
                segment interpreter readable
                db library,0 \}
        match needed,needed@dynamic \{ match import,import@strtab \\{
                segment dynamic readable
                local strtab,strsz,symtab,rel,relsz,hash,counter
                irp item,needed \\\{
                        match str:library,item \\\\{
                                dd DT_NEEDED,str-strtab \\\\} \\\}
                dd DT_STRTAB,strtab
                dd DT_STRSZ,strsz
                dd DT_SYMTAB,symtab
                dd DT_SYMENT,sizeof.Elf32_Sym
                dd DT_REL,rel
                dd DT_RELSZ,relsz
                dd DT_RELENT,sizeof.Elf32_Rel
                dd DT_HASH,hash
                dd DT_NULL,0

                segment readable writeable
                symtab: Elf32_Sym
                counter = 1
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        Elf32_Sym fstr-strtab,0,0,STB_GLOBAL,STT_FUNC,0,0
                                end if \\\\} \\\}
                rel:
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        Elf32_Rel name,counter,R_386_32
                                        counter = counter+1
                                end if \\\\} \\\}
                relsz = $-rel
                hash:
                dd 1,counter
                ;repeat bundlecounter
                        ;if %=bundlecounter
                                dd 0
                        ;else
                                ;dd %
                        ;end if
                ;end repeat
                repeat counter
                        if %=counter
                                dd 0
                        else
                                dd %
                        end if
                end repeat
                strtab:
                db '',0
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        fstr db string,0
                                end if \\\\} \\\}
                irp item,needed \\\{
                        match str:library,item \\\\{
                                str db library,0 \\\\} \\\}
                strsz = $-strtab
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        name dd 0
                                end if \\\\} \\\} \\} \} }
    


includes/os_specs/linux/equates/syscalls/x86.inc (just for my own convinience):
Code:
sys_exit        = 1
sys_write       = 4    


includes/os_specs/linux/equates/libx11.inc (it is not final variant of X constant naming)
Code:
; LIBX11.SO constants

; X Protocol
 X_PROTOCOL             = 11
 X_PROTOCOL_REVISION    = 0

; X Constants
PARENT_RELATIVE         = 1
COPY_FROM_PARENT        = 0
POINTER_WINDOW          = 0
INPUT_FOCUS             = 1
POINTER_ROOT            = 1
ANY_PROPERTY_TYPE       = 0
ANY_KEY                 = 0
ANY_BUTTON              = 0
ALL_TEMPORARY           = 0
CURRENT_TIME            = 0
NO_SYMBOL               = 0

; Event Masks
;EVM_NO_EVENT                    = 0
EVM_KEY_PRESS                    = $00000001
EVM_KEY_RELEASE                  = $00000002
EVM_BTN_PRESS                    = $00000004
EVM_BTN_RELEASE                  = $00000008
EVM_ENTER_WINDOW                 = $00000010
EVM_LEAVE_WINDOW                 = $00000020
EVM_MOUSE_MOVE                   = $00000040
EVM_MOUSE_HINT                   = $00000080
EVM_BTN1_MOTION                  = $00000100
EVM_BTN2_MOTION                  = $00000200
EVM_BTN3_MOTION                  = $00000400
EVM_BTN4_MOTION                  = $00000800
EVM_BTN5_MOTION                  = $00001000
EVM_BTN_MOTION                   = $00002000
EVM_KEYMAP_STATE                 = $00004000
EVM_EXPOSURE                     = $00008000
EVM_VISIBILITY_CHANGE            = $00010000
EVM_STRUCTURE_NOTIFY             = $00020000
EVM_RESIZE_REDIRECT              = $00040000
EVM_SUBSTRUCTURE_NOTIFY          = $00080000
EVM_SUBSTRUCTURE_REDIRECT        = $00100000
EVM_FOCUS_CHANGE                 = $00200000
EVM_PROPERTY_CHANGE              = $00400000
EVM_COLORMAP_CHANGE              = $00800000
EVM_OWNER_GRAB_BTN               = $01000000

EVM_ALL_ENENTS                   = $01FBFF7F; w/o EV_MOUSE_HINT & EV_RESIZE_REDIRECT

; Events
EV_KEY_PRESS            =  2
EV_KEY_RELEASE          =  3
EV_BTN_PRESS            =  4
EV_BTN_RELEASE          =  5
EV_MOUSE_MOVE           =  6
EV_MOUSE_ENTER          =  7
EV_MOUSE_LEAVE          =  8
EV_FOCUS                =  9
EV_LOST_FOCUS           = 10
EV_KEYMAP_NOTIFY        = 11
EV_EXPOSE               = 12
EV_GRAPHICS_EXPOSE      = 13
EV_NO_EXPOSE            = 14
EV_VISIBILITY_CHANGED   = 15
EV_CREATE_NOTIFY        = 16
EV_DESTROY_NOTIFY       = 17
EV_UNMAP_NOTIFY         = 18
EV_MAP_NOTIFY           = 19
EV_MAP_REQUEST          = 20
EV_REPARENT_NOTIFY      = 21
EV_CONFIGURE_NOTIFY     = 22
EV_CONFIGURE_REQUEST    = 23
EV_GRAVITY_NOTIFY       = 24
EV_RESIZE_REQUEST       = 25
EV_CIRCULATE_NOTIFY     = 26
EV_CIRCULATE_REQUEST    = 27
EV_PROPERTY_NOTIFY      = 28
EV_SELECTION_CLEAR      = 29
EV_SELECTION_REQUEST    = 30
EV_SELECTION_NOTIFY     = 31
EV_COLORMAP_NOTIFY      = 32
EV_CLIENT_MESSAGE       = 33
EV_MAPPING_NOTIFY       = 34
EV_LAST_EVENT           = 35

; Key masks
KEYM_SHIFT      = $00000001
KEYM_LOCK       = $00000002
KEYM_CONTROL    = $00000004
KEYM_MOD1       = $00000008
KEYM_MOD2       = $00000010
KEYM_MOD3       = $00000020
KEYM_MOD4       = $00000040
KEYM_MOD5       = $00000080

; Key modifiers
KEYM_INX_SHIFT          = 0
KEYM_INX_LOCK           = 1
KEYM_INX_CONTROL        = 2
KEYM_INX_MOD1           = 3
KEYM_INX_MOD2           = 4
KEYM_INX_MOD3           = 5
KEYM_INX_MOD4           = 6
KEYM_INX_MOD5           = 7

; Button masks
KEYM_BTN1       = $00000100
KEYM_BTN2       = $00000200
KEYM_BTN3       = $00000400
KEYM_BTN4       = $00000800
KEYM_BTN5       = $00001000
KEYM_ANY_MOD    = $00010000

; Buttons
MB_BUTTON1      = 1
MB_BUTTON2      = 2
MB_BUTTON3      = 3
MB_BUTTON4      = 4
MB_BUTTON5      = 5

; Notify modes
NM_NORMAL               = 0
NM_HINT                 = 1
NM_GRAB                 = 1
NM_UNGRAB               = 2
NM_WHILE_GRABBED        = 3

; Notify detail
ND_ANCESTOR             = 0
ND_VIRTUAL              = 1
ND_INFERRIOR            = 2
ND_NONLINEAR            = 3
ND_NONLINEAR_VIRTUAL    = 4
ND_POINTER              = 5
ND_POINTER_ROOT         = 6
ND_DETAIL_NONE          = 7

; Visibility notify
NOTIFY_VISIBILITY_UNOBSCURED            = 0
NOTIFY_VISIBILITY_PARTIALLY_OBSCURED    = 1
NOTIFY_VISIBILITY_FULLY_OBSCURED        = 2

; Circulation request
WP_PLACE_ON_TOP         = 0
WP_PLACE_ON_BOTTOM      = 1

; X Protocol families
XPF_INTERNET    = 0
XPF_DECNET      = 1
XPF_CHAOS       = 2
XPF_INTERNET6   = 6
; unspecific authentication families
XPF_SERVER_INTERPRETED  = 5

; Property notify
NOTIFY_PROPERTY_NEW_VALUE       = 0
NOTIFY_PROPERTY_DELETE          = 1

; Color map notify
NOTIFY_COLORMAP_UNINSTALLED     = 0
NOTIFY_COLORMAP_INSTALLED       = 1

; Grab modes
GRABMODE_SYNC   = 0
GRABMODE_ASYNC  = 1

; Grab reply status
ST_GRAB_SUCCESS         = 0
ST_GRAB_ALREADY         = 1
ST_GRAB_INVALID_TIME    = 2
ST_GRAB_NOT_VIEWABLE    = 3
ST_GRAB_FROZEN          = 4

; AllowEvents modes
AEV_ASYNC_MOUSE         = 0
AEV_SYNC_MOUSE          = 1
AEV_REPLAY_MOUSE        = 2
AEV_ASYNC_KEYBOARD      = 3
AEV_SYNC_KEYBOARD       = 4
AEV_REPLAY_KEYBOARD     = 5
AEV_ASYNC_BOTH          = 6
AEV_SYNC_BOTH           = 7

; InputFocus specific
REVERT_TO_NONE          = 0
REVERT_TO_POINTER_ROOT  = POINTER_ROOT
REVERT_TO_PARENT        = 2

; X error codes
XERR_SUCCESS            = 0
XERR_BADREQUEST         = 1
XERR_BADVALUE           = 2
XERR_BADWINDOW          = 3
XERR_BADPIXMAP          = 4
XERR_BADATOM            = 5
XERR_BADCURSOR          = 6
XERR_BADFONT            = 7
XERR_BADMATCH           = 8
XERR_BADDRAWABLE        = 9
XERR_BADACCESS          = 10
XERR_BADALLOC           = 11
XERR_BADCOLOR           = 12
XERR_BADGC              = 13
XERR_BADIDCHOISE        = 14
XERR_BADNAME            = 15
XERR_BADLENGTH          = 16
XERR_BADIMPLEMENTATION  = 17
XERR_EXTENSION_FIRST    = 128
XERR_EXTENSION_LAST     = 255

; Window classes
WC_INPUT_OUTPUT = 1
WC_INPUT_ONLY   = 2

; Window attributes
CW_BACK_PIXMAP          = $0001
CW_BACK_PIXEL           = $0002
CW_BORDER_PIXMAP        = $0004
CW_BORDER_PIXEL         = $0008
CW_BIT_GRAVITY          = $0010
CW_WIN_GRAVITY          = $0020
CW_BACKING_STORE        = $0040
CW_BACKING_PLANES       = $0080
CW_BACKING_PIXEL        = $0100
CW_OVERRIDE_REDIRECT    = $0200
CW_SAVE_UNDER           = $0400
CW_EVENT_MASK           = $0800
CW_DONT_PROPAGATE       = $1000
CW_COLORMAP             = $2000
CW_CURSOR               = $4000

; ConfigureWindow structure
CW_X            = $01
CW_Y            = $02
CW_WIDTH        = $04
CW_HEIGHT       = $08
CW_BORDERWIDTH  = $10
CW_SIBLING      = $20
CW_STACKMODE    = $40

; Bit gravity
GRAVITY_FORGET          =  0
GRAVITY_NORTHWEST       =  1
GRAVITY_NORTH           =  2
GRAVITY_NORTHEAST       =  3
GRAVITY_WEST            =  4
GRAVITY_CENTER          =  5
GRAVITY_EAST            =  6
GRAVITY_SOUTHWEST       =  7
GRAVITY_SOUTH           =  8
GRAVITY_SOUTHEAST       =  9
GRAVITY_STATIC          = 10
; Window gravity
GRAVITY_UNMAP           =  0

; CreateWindow backing-store hint
CW_NOT_USEFULL  = 0
CW_WHEN_MAPPED  = 1
CW_ALWAYS       = 2

; GetWindowAttributes reply
WA_IS_UNMAPPED          = 0
WA_IS_UNVIEWABLE        = 1
WA_IS_VIEWABLE          = 2

; Used in ChangeSaveSet
SETMODE_INSERT  = 0
SETMODE_DELETE  = 1

; Used in ChangeCloseDownMode
MODE_DEASTROY_ALL       = 0
MODE_RETAIN_PERMANENT   = 1
MODE_RETAIN_TEMPORARY   = 2

; Window stacking method (in configureWindow)
CFGWND_ABOVE    = 0
CFGWND_BELOW    = 1
CFGWND_TOPIF    = 2
CFGWND_BOTTOMIF = 3
CFGWND_OPPOSITE = 4

; Circulation direction
CRCL_DIR_RAISELOWER     = 0
CRCL_DIR_LOWERHIGHEST   = 1

; Property modes
PROPMODE_REPLACE        = 0
PROPMODE_PREPEND        = 1
PROPMODE_APPEND         = 2

; Graphics Functions
GX_CLEAR        = $00
GX_AND          = $01
GX_ANDREVERSE   = $02
GX_COPY         = $03
GX_ANDINVERTED  = $04
GX_NOOP         = $05
GX_XOR          = $06
GX_OR           = $07
GX_NOR          = $08
GX_EQUIV        = $09
GX_INVERT       = $10
GX_ORREVERSE    = $11
GX_COPYINVERTED = $12
GX_ORINVERTED   = $13
GX_NAND         = $14
GX_SET          = $15

; LineStyle
LINE_SOLID      = 0
LINE_ONOFFDASH  = 1
LINE_DOUBLEDASH = 2

; CapStyle
CAP_NOTLAST     = 0
CAP_BUTT        = 1
CAP_ROUND       = 2
CAP_PROHECTING  = 3

; JoinStyle
JOIN_MITER      = 0
JOIN_ROUND      = 1
JOIN_BEVEL      = 2

; FillStyle
FILL_SOLID              = 0
FILL_TILED              = 1
FILL_STIPPLED           = 2
FILL_OPAQUESTIPPLED     = 3

; FillRule
FILL_EVENODD    = 0
FILL_WINDING    = 1

; Subwindow mode
SUBWNDMODE_CLIPBYCHILDREN       = 0
SUBWNDMODE_INCLUDEINFERIORS     = 1

; SetClipRectangles ordering
CLIPRECT_UNSORTED       = 0
CLIPRECT_YSORTED        = 1
CLIPRECT_YXSORTED       = 2
CLIPRECT_YXBANDED       = 3

; CoordinateMode for drawing routines
COORDMODE_ORIGIN        = 0
COORDMODE_PREVIOUS      = 1

; Polygon shapes
PLGNSHAPE_COMPLEX       = 0
PLGNSHAPE_NONCONVEX     = 1
PLGNSHAPE_CONVEX        = 2

; Arc modes for PolyFillArc
ARC_CHORD       = 0
ARC_PIE_SLICE   = 1

; GC components
GC_FUNCTION             = $00000001
GC_PLANE_MASK           = $00000002
GC_FOREGROUND           = $00000004
GC_BACKGROUND           = $00000008
GC_LINE_WIDTH           = $00000010
GC_LINE_STYLE           = $00000020
GC_CAP_STYLE            = $00000040
GC_JOIN_STYLE           = $00000080
GC_FILL_STYLE           = $00000100
GC_FILL_RULE            = $00000200
GC_TILE                 = $00000400
GC_STIPPLE              = $00000800
GC_TILE_STIP_XORIGIN    = $00001000
GC_TILE_STIP_YORIGIN    = $00002000
GC_FONT                 = $00004000
GC_SUBWINDOW_MODE       = $00008000
GC_GRAPHICS_EXPOSURES   = $00010000
GC_CLIP_XORIGIN         = $00020000
GC_CLIP_YORIGIN         = $00040000
GC_CLIP_MASK            = $00080000
GC_DASH_OFFSET          = $00100000
GC_DASH_LIST            = $00200000
GC_ARC_MODE             = $00400000

GC_LASTBIT              = 22

; Used in QueryFont - draw direction
FONT_LEFTTORIGHT        = 0
FONT_RIGHTTOLEFT        = 1

FONT_CHANGE     = 255

; ImageFormat - PutImage, GetImage
IMGFMT_XYBITMAP = 0
IMGFMT_XYPIXMAP = 1
IMGFMT_ZPIXMAP  = 2

; For CreateColormap
CC_ALLOC_NONE   = 0
CC_ALLOC_ALL    = 1

; Flags used in StoreNamedColor, StoreColors
STORE_RED       = 1
STORE_GREEN     = 2
STORE_BLUE      = 4

; QueryBestSize class
SHAPE_CURSOR    = 0
SHAPE_TILE      = 1
SHAPE_STIPPLE   = 2

; Keyboard pointer stuff
AUTOREPEAT_MODE_OFF     = 0
AUTOREPEAT_MODE_ON      = 1
AUTOREPEAT_MODE_DEFAULT = 2

LED_MODE_OFF    = 0
LED_MODE_ON     = 1

; masks for ChangeKeyboardControl
KBCTL_KEYCLICKPERCENT   = $01
KBCTL_BELLPERCENT       = $02
KBCTL_BELLPITCH         = $04
KBCTL_BELLDURATION      = $08
KBCTL_LED               = $10
KBCTL_LEDMODE           = $20
KBCTL_KEY               = $40
KBCTL_AUTOREPEAT_MODE   = $80

;
MAPPING_SUCCESS         = 0
MAPPING_BUSY            = 1
MAPPING_FAILED          = 2
;
MAPPING_MODIFIER        = 0
MAPPING_KEYBOARD        = 1
MAPPING_POINTER         = 2

; Screensaver stuff
SCRSVR_DONTPREFERBLANKING       = 0
SCRSVR_PREFERBLANKING           = 1
SCRSVR_DEFAULTBLANKING          = 2

SCRSVR_DISABLE          = 0
SCRSVR_DISABLE_INTERVAL = 0

SCRSVR_DONTALLOWEXPOSURES       = 0
SCRSVR_ALLOWEXPOSURES           = 1
SCRSVR_DEFAULTEXPOSURES         = 2

; for ForceScreenSaver
SCRSVR_RESET    = 0
SCRSVR_ACTIVE   = 1

; for ChangeHosts
HOST_INSERT     = 0
HOST_DELETE     = 1

; for ChangeAccessControl
ACCESS_ENABLE   = 1
ACCESS_DISABLE  = 0

; display classes
DISPLAY_STATICGRAY      = 0
DISPLAY_GRAYSCALE       = 1
DISPLAY_STATICCOLOR     = 2
DISPLAY_PSEUDOCOLOR     = 3
DISPLAY_TRUECOLOR       = 4
DISPLAY_DIRECTCOLOR     = 5


; Byte order used in imageByteOrder and bitmapBitOrder
IMG_LSBFIRST    = 0
IMG_MSBFIRST    = 1    


includes/formats/elf/equates/equates.inc:
Code:
; Elf class
ELFCLASSNONE    = 0
ELFCLASS32      = 1
ELFCLASS64      = 2

; Data encoding order
ELFDATANONE     = 0
ELFDATA2LSB     = 1
ELFDATA2MSB     = 2

; Elf version
EV_CURRENT      = 1

; Elf OS ABI
ELFOSABI_NONE           = 0
ELFOSABI_HPUX           = 1
ELFOSABI_NETBSD         = 2
ELFOSABI_GNU            = 3
ELFOSABI_LINUX          = 3
ELFOSABI_HURD           = 4
ELFOSABI_SOLARIS        = 6
ELFOSABI_AIX            = 7
ELFOSABI_IRIX           = 8
ELFOSABI_FREEBSD        = 9
ELFOSABI_TRU64          = 10
ELFOSABI_MODESTO        = 11
ELFOSABI_OPENBSD        = 12
ELFOSABI_OPENVMS        = 13
ELFOSABI_NSK            = 14
ELFOSABI_AROS           = 15
ELFOSABI_FENIXOS        = 16
ELFOSABI_CLOUDABI       = 17
ELFOSABI_OPENVOS        = 18
ELFOSABI_FIRST_ARCH     = 64
ELFOSABI_AMDGPU_HSA     = ELFOSABI_FIRST_ARCH + 0
ELFOSABI_AMDGPU_PAL     = ELFOSABI_FIRST_ARCH + 1
ELFOSABI_AMDGPU_MESA3D  = ELFOSABI_FIRST_ARCH + 2
ELFOSABI_ARM            = ELFOSABI_FIRST_ARCH + 33
ELFOSABI_C6000_ELFABI   = ELFOSABI_FIRST_ARCH + 0
ELFOSABI_C6000_LINUX    = ELFOSABI_FIRST_ARCH + 1
ELFOSABI_STANDALONE     = ELFOSABI_FIRST_ARCH + 191
ELFOSABI_LAST_ARCH      = ELFOSABI_FIRST_ARCH + 191

; File type
ET_NONE         = $0000
ET_REL          = $0001
ET_EXEC         = $0002
ET_DYN          = $0003
ET_CORE         = $0004
ET_NUM          = $0005
ET_LOOS         = $FE00
ET_HIOS         = $FEFF
ET_LOPROC       = $FF00
ET_HIPROC       = $FFFF

; Architecture
EM_NONE                 =   0
EM_M32                  =   1
EM_SPARC                =   2
EM_386                  =   3
EM_68K                  =   4
EM_88K                  =   5
EM_860                  =   7
EM_MIPS                 =   8
EM_S370                 =   9
EM_MIPS_RS3_LE          =  10
EM_PARISC               =  15
EM_VPP500               =  17
EM_SPARC32PLUS          =  18
EM_960                  =  19
EM_PPC                  =  20
EM_PPC64                =  21
EM_S390                 =  22
EM_V800                 =  36
EM_FR20                 =  37
EM_RH32                 =  38
EM_RCE                  =  39
EM_ARM                  =  40
EM_FAKE_ALPHA           =  41
EM_SH                   =  42
EM_SPARCV9              =  43
EM_TRICORE              =  44
EM_ARC                  =  45
EM_H8_300               =  46
EM_H8_300H              =  47
EM_H8S                  =  48
EM_H8_500               =  49
EM_IA_64                =  50
EM_MIPS_X               =  51
EM_COLDFIRE             =  52
EM_68HC12               =  53
EM_MMA                  =  54
EM_PCP                  =  55
EM_NCPU                 =  56
EM_NDR1                 =  57
EM_STARCORE             =  58
EM_ME16                 =  59
EM_ST100                =  60
EM_TINYJ                =  61
EM_X86_64               =  62
EM_PDSP                 =  63
EM_FX66                 =  66
EM_ST9PLUS              =  67
EM_ST7                  =  68
EM_68HC16               =  69
EM_68HC11               =  70
EM_68HC08               =  71
EM_68HC05               =  72
EM_SVX                  =  73
EM_ST19                 =  74
EM_VAX                  =  75
EM_CRIS                 =  76
EM_JAVELIN              =  77
EM_FIREPATH             =  78
EM_ZSP                  =  79
EM_MMIX                 =  80
EM_HUANY                =  81
EM_PRISM                =  82
EM_AVR                  =  83
EM_FR30                 =  84
EM_D10V                 =  85
EM_D30V                 =  86
EM_V850                 =  87
EM_M32R                 =  88
EM_MN10300              =  89
EM_MN10200              =  90
EM_PJ                   =  91
EM_OPENRISC             =  92
EM_ARC_A5               =  93
EM_XTENSA               =  94
EM_VIDEOCORE            =  95
EM_TMM_GPP              =  96
EM_NS32K                =  97
EM_TPC                  =  98
EM_SNP1K                =  99
EM_ST200                = 100
EM_IP2K                 = 101
EM_MAX                  = 102
EM_CR                   = 103
EM_F2MC16               = 104
EM_MSP430               = 105
EM_BLACKFIN             = 106
EM_SE_C33               = 107
EM_SEP                  = 108
EM_ARCA                 = 109
EM_UNICORE              = 110
EM_EXCESS               = 111
EM_DXP                  = 112
EM_ALTERA_NIOS2         = 113
EM_CRX                  = 114
EM_XGATE                = 115
EM_C166                 = 116
EM_M16C                 = 117
EM_M16C                 = 118
EM_CE                   = 119
EM_M32C                 = 120
EM_TSK3000              = 131
EM_RS08                 = 132
EM_SHARC                = 133
EM_ECOG2                = 134
EM_SCORE7               = 135
EM_DSP24                = 136
EM_VIDEOCORE3           = 137
EM_LATTICEMICO32        = 138
EM_SE_C17               = 139
EM_TI_C6000             = 140
EM_TI_C2000             = 141
EM_TI_C5500             = 142
EM_TI_ARP32             = 143
EM_TI_PRU               = 144
EM_MMDSP_PLUS           = 160
EM_CYPRESS_M8C          = 161
EM_R32C                 = 162
EM_TRIMEDIA             = 163
EM_QDSP6                = 164
EM_8051                 = 165
EM_STXP7X               = 166
EM_NDS32                = 167
EM_ECOG1X               = 168
EM_MAXQ30               = 169
EM_XIMO16               = 170
EM_MANIK                = 171
EM_CRAYNV2              = 172
EM_RX                   = 173
EM_METAG                = 174
EM_MCST_ELBRUS          = 175
EM_ECOG16               = 176
EM_CR16                 = 177
EM_ETPU                 = 178
EM_SLE9X                = 179
EM_L10M                 = 180
EM_K10M                 = 181
EM_AARCH64              = 183
EM_AVR32                = 185
EM_STM8                 = 186
EM_TILE64               = 187
EM_TILEPRO              = 188
EM_MICROBLAZE           = 189
EM_CUDA                 = 190
EM_TILEGX               = 191
EM_CLOUDSHIELD          = 192
EM_COREA_1ST            = 193
EM_COREA_2ND            = 194
EM_ARC_COMPACT2         = 195
EM_OPEN8                = 196
EM_RL78                 = 197
EM_VIDEOCORE5           = 198
EM_78KOR                = 199
EM_56800EX              = 200
EM_BA1                  = 201
EM_BA2                  = 202
EM_XCORE                = 203
EM_MCHP_PIC             = 204
EM_KM32                 = 210
EM_KMX32                = 211
EM_EMX16                = 212
EM_EMX8                 = 213
EM_KVARC                = 214
EM_CDP                  = 215
EM_COGE                 = 216
EM_COOL                 = 217
EM_NORC                 = 218
EM_CSR_KALIMBA          = 219
EM_Z80                  = 220
EM_VISIUM               = 221
EM_FT32                 = 222
EM_MOXIE                = 223
EM_AMDGPU               = 224
EM_RISCV                = 243
EM_BPF                  = 247
EM_CSKY                 = 252
EM_NUM                  = 253

; Elf version
EV_NONE         = 0
EV_CURRENT      = 1
EV_NUM          = 2

; Elf segment types
PT_NULL         = 0
PT_LOAD         = 1
PT_DYNAMIC      = 2
PT_INTERP       = 3
PT_NOTE         = 4
PT_SHLIB        = 5
PT_PHDR         = 6
PT_TLS          = 7
PT_NUM          = 8
PT_LOSUNW       = $6FFFFFFA
PT_SUNWBSS      = $6FFFFFFB
PT_SUNWSTACK    = $6FFFFFFA
PT_HISUNW       = $6FFFFFFF
PT_LOPROC       = $70000000
PT_HIPROC       = $7FFFFFFF

; Elf segment permissions
PF_X            = 1
PF_W            = 2
PF_R            = 4
PF_MASKOS       = $0FF00000
PF_MASKPROC     = $F0000000

; Dynamic array tags
DT_NULL                         = 0
DT_NEEDED                       = 1
DT_PLTRELSZ                     = 2
DT_PLTGOT                       = 3
DT_HASH                         = 4
DT_STRTAB                       = 5
DT_SYMTAB                       = 6
DT_RELA                         = 7
DT_RELASZ                       = 8
DT_RELAENT                      = 9
DT_STRSZ                        = 10
DT_SYMENT                       = 11
DT_INIT                         = 12
DT_FINI                         = 13
DT_SONAME                       = 14
DT_RPATH                        = 15
DT_SYMBOLIC                     = 16
DT_REL                          = 17
DT_RELSZ                        = 18
DT_RELENT                       = 19
DT_PLTREL                       = 20
DT_DEBUG                        = 21
DT_TEXTREL                      = 22
DT_JMPREL                       = 23
DT_BIND_NOW                     = 24
DT_INIT_ARRAY                   = 25
DT_FINI_ARRAY                   = 26
DT_INIT_ARRAYSZ                 = 27
DT_FINI_ARRAYSZ                 = 28
DT_RUNPATH                      = 29
DT_FLAGS                        = 30
DT_ENCODING                     = 32

DT_LOOS                         = $6000000D
DT_HIOS                         = $6FFFF000
DT_VALRNGLO                     = $6FFFFD00
DT_CHECKSUM                     = $6FFFFDF8
DT_PLTPADSZ                     = $6FFFFDF9
DT_MOVEENT                      = $6FFFFDFA
DT_MOVESZ                       = $6FFFFDFB
DT_POSFLAG_1                    = $6FFFFDFD
DT_SYMINSZ                      = $6FFFFDFE
DT_SYMINENT                     = $6FFFFDFF
DT_VALRNGHI                     = $6FFFFDFF
DT_ADDRRNGLO                    = $6FFFFE00
DT_CONFIG                       = $6FFFFEFA
DT_DEPAUDIT                     = $6FFFFEFB
DT_AUDIT                        = $6FFFFEFC
DT_PLTPAD                       = $6FFFFEFD
DT_MOVETAB                      = $6FFFFEFE
DT_SYMINFO                      = $6FFFFEFF
DT_ADDRRNGHI                    = $6FFFFEFF
DT_RELACOUNT                    = $6FFFFFF9
DT_RELCOUNT                     = $6FFFFFFA
DT_FLAGS_1                      = $6FFFFFFB
DT_VERDEF                       = $6FFFFFFC
DT_VERDEFNUM                    = $6FFFFFFD
DT_VERNEED                      = $6FFFFFFE
DT_VERNEEDNUM                   = $6FFFFFFF
DT_LOPROC                       = $70000000
DT_SPARC_REGISTER               = $70000001
DT_AUXILIARY                    = $7FFFFFFD
DT_USED                         = $7FFFFFFE
DT_FILTER                       = $7FFFFFFF
DT_HIPROC                       = $7FFFFFFF

; Symbol's type and binding attributes
STT_NOTYPE      = $00
STT_OBJECT      = $01
STT_FUNC        = $02
STT_SECTION     = $03
STT_FILE        = $04
STT_COMMON      = $05
STT_TLS         = $06
STT_NUM         = $07
STT_LOOS        = $0A
STT_HIOS        = $0C
STT_LOPROC      = $0D
STT_HIPROC      = $0F
; ...
STB_LOCAL       = $00
STB_GLOBAL      = $10
STB_WEAK        = $20
STB_NUM         = $30
STB_LOOS        = $A0
STB_HIOS        = $C0
STB_LOPROC      = $D0
STB_HIPROC      = $F0

; Symbol`s visibility
STV_DEFAULT     = 0
STV_INTERNAL    = 1
STV_HIDDEN      = 2
STV_PROTECTED   = 3

; Relocation types
R_386_NONE     = 0
R_386_32       = 1
R_386_PC32     = 2
R_386_GOT32    = 3
R_386_PLT32    = 4
R_386_COPY     = 5
R_386_GLOB_DAT = 6
R_386_JMP_SLOT = 7
R_386_RELATIVE = 8
R_386_GOTOFF   = 9
R_386_GOTPC    = 10    


includes/os_specs/linux/structs/x86/libx11.inc:
Code:
; LIBX11.SO structures

struct XAnyEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        window          dd ?
ends

struct XAnyExtEvent XAnyEvent
        root            dd ?
        subwindow       dd ?
        time            dd ?
        x               dd ?
        y               dd ?
        x_root          dd ?
        y_root          dd ?
ends

struct XButtonEvent XAnyExtEvent
        state           dd ?
        button          dd ?
        same_screen     dd ?
ends

struct XKeyEvent XAnyExtEvent
        state           dd ?
        keycode         dd ?
        same_screen     dd ?
ends

struct XMotionEvent XAnyExtEvent
        state           dd ?
        is_hint         db ?
        same_screen     dd ?
ends

struct XCrossingEvent XAnyExtEvent
        mode            dd ?
        detail          dd ?
        same_screen     dd ?
        focus           dd ?
        state           dd ?
ends

struct XFocusChangeEvent XAnyEvent
        mode      dd ?
        detail    dd ?
ends

struct XKeymapEvent XAnyEvent
        key_vector      rb 32
ends

struct XExposeEvent XAnyEvent
        x       dd ?
        y       dd ?
        width   dd ?
        height  dd ?
        count   dd ?
ends

struct XPropertyEvent XAnyEvent
        atom      dd ?
        time      dd ?
        state     dd ?
ends

struct XColormapEvent XAnyEvent
        colormap  dd ?
        new       dd ?
        state     dd ?
ends

struct XMappingEvent XAnyEvent
        request         dd ?
        first_keycode   dd ?
        count           dd ?
ends

struct XSelectionClearEvent XAnyEvent
        selection       dd ?
        time            dd ?
ends

struct XVisibilityEvent XAnyEvent
        state     dd ?
ends

struct XClientMessageEvent XAnyEvent
        message_type    dd ?
       \format          dd ?
       \data            rb 20
ends



struct XDestroyWindowEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        event           dd ?
        window          dd ?
ends

struct XCirculateEvent XDestroyWindowEvent
        place           dd ?
ends

struct XMapEvent XDestroyWindowEvent
        override_redirect       dd ?
ends

struct XUnmapEvent XDestroyWindowEvent
        from_configure       dd ?
ends

struct XReparentEvent XDestroyWindowEvent
        parent                  dd ?
        x                       dd ?
        y                       dd ?
        override_redirect       dd ?
ends

struct XGravityEvent XDestroyWindowEvent
        x                       dd ?
        y                       dd ?
ends

struct XConfigureEvent XGravityEvent
        width                   dd ?
        height                  dd ?
        border_width            dd ?
        above                   dd ?
        override_redirect       dd ?
ends

struct XMapRequestEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        parent          dd ?
        window          dd ?
ends

struct XCirculateRequestEvent XMapRequestEvent
        place   dd ?
ends

struct XConfigureRequestEvent XMapRequestEvent
        x               dd ?
        y               dd ?
        width           dd ?
        height          dd ?
        border_width    dd ?
        above           dd ?
        detail          dd ?
        value_mask      dd ?
ends

struct XCreateWindowEvent XMapRequestEvent
        x                       dd ?
        y                       dd ?
        width                   dd ?
        height                  dd ?
        border_width            dd ?
        override_redirect       dd ?
ends

struct XDrawEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        drawable        dd ?
ends

struct XGraphicsExposeEvent XDrawEvent
        x               dd ?
        y               dd ?
        width           dd ?
        height          dd ?
        count           dd ?
        major_code      dd ?
        minor_code      dd ?
ends

struct XNoExposeEvent XDrawEvent
        major_code      dd ?
        minor_code      dd ?
ends

struct XSelectionEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        requestor       dd ?
        selection       dd ?
        target          dd ?
        property        dd ?
        time            dd ?
ends

struct XSelectionRequestEvent
        type            dd ?
        serial          dd ?
        send_event      dd ?
       \display         dd ?
        owner           dd ?
        requestor       dd ?
        selection       dd ?
        target          dd ?
        property        dd ?
        time            dd ?
ends

struct XResizeEvent
        type            dd ?
        serial          dd ?
       \display         dd ?
        window          dd ?
        width           dd ?
        height          dd ?
ends

struct XErrorEvent
        type            dd ?
        serial          dd ?
        error_code      dd ?
        request_code    dd ?
        minor_code      dd ?
        resourceid      dd ?
ends


struct XKeyboardControl
        key_click_percent       dd ?
        bell_percent            dd ?
        bell_pitch              dd ?
        bell_duration           dd ?
        led                     dd ?
        led_mode                dd ?
        key                     dd ?
        auto_repeat_mode        dd ?
ends

struct XModifierKeymap
        max_keypermod   dd ?
        modifiermap     dd ?
ends


struct XWindowAttributes
        x                     dd  ?     ; location of window
        y                     dd  ?     ;
        width                 dd  ?     ; width and height of window
        height                dd  ?     ;
        border_width          dd  ?     ; border width of window
        depth                 dd  ?     ; depth of window
        pVisual               dd  ?     ; the associated visual structure
        root                  dd  ?     ; root of screen containing window
        class                 dd  ?     ; InputOutput, InputOnly
        bit_gravity           dd  ?     ; one of the bit gravity values
        win_gravity           dd  ?     ; one of the window gravity values
        backing_store         dd  ?     ; NotUseful, WhenMapped, Always
        backing_planes        dd  ?     ; planes to be preserved if possible
        backing_pixel         dd  ?     ; value to be used when restoring planes
        save_under            dd  ?     ; boolean, should bits under be saved?
        colormap              dd  ?     ; color map to be associated with window
        map_installed         dd  ?     ; boolean, is color map currently installed
        map_state             dd  ?     ; IsUnmapped, IsUnviewable, IsViewable
        all_event_masks       dd  ?    ; set of events all people have interest in
        your_event_mask       dd  ?          ; my event mask
        do_not_propagate_mask dd  ?    ; set of events that should not propagate
        override_redirect     dd  ?    ; boolean value for override-redirect
        pScreen               dd  ?  ; back pointer to correct screen
ends



struct XCharStruct
        lbearing   dw ?       ; origin to left edge of raster
        rbearing   dw ?       ; origin to right edge of raster
        width      dw ?       ; advance to next char's origin
        ascent     dw ?       ; baseline to top edge of raster
        descent    dw ?       ; baseline to bottom edge of raster
        attributes dw ?       ; per char flags (not predefined)
ends


struct XFontStruct
        ext_data          dd   ?       ; hook for extension to hang data
        fid               dd   ?       ; Font id for this font
        direction         dd   ?       ; hint about the direction font is painted
        min_char_or_byte2 dd   ?       ; first character
        max_char_or_byte2 dd   ?       ; last character
        min_byte1         dd   ?       ; first row that exists
        max_byte1         dd   ?       ; last row that exists
        all_chars_exist   dd   ?       ; flag if all characters have nonzero size
        default_char      dd   ?       ; char to print for undefined character
        n_properties      dd   ?       ; how many properties there are
        properties        dd   ?       ; pointer to array of additional properties
        min_bounds        XCharStruct  ; minimum bounds over all existing char
        max_bounds        XCharStruct  ; maximum bounds over all existing char
        per_char          dd   ?       ; first_char to last_char information
        ascent            dd   ?       ; logical extent above baseline for spacing
        descent           dd   ?       ; logical decent below baseline for spacing
ends


struct XWindowChanges
        x            dd ?
        y            dd ?
        width        dd ?
        height       dd ?
        border_width dd ?
        sibling      dd ?
        stack_mode   dd ?
ends    


and finaly
includes/os_specs/linux/api/x86/libx11.inc:
Code:
; LIBX11 API calls

import  libx11.XActivateScreenSaver,              'XActivateScreenSaver'                  ,\
        libx11.XAddConnectionWatch,               'XAddConnectionWatch'                   ,\
        libx11.XAddExtension,                     'XAddExtension'                         ,\
        libx11.XAddHost,                          'XAddHost'                              ,\
        libx11.XAddHosts,                         'XAddHosts'                             ,\
        libx11.XAddPixel,                         'XAddPixel'                             ,\
        libx11.XAddToExtensionList,               'XAddToExtensionList'                   ,\
        libx11.XAddToSaveSet,                     'XAddToSaveSet'                         ,\
        libx11.XAllPlanes,                        'XAllPlanes'                            ,\
        libx11.XAllocClassHint,                   'XAllocClassHint'                       ,\
        libx11.XAllocColor,                       'XAllocColor'                           ,\
        libx11.XAllocColorCells,                  'XAllocColorCells'                      ,\
        libx11.XAllocColorPlanes,                 'XAllocColorPlanes'                     ,\
        libx11.XAllocIconSize,                    'XAllocIconSize'                        ,\
        libx11.XAllocNamedColor,                  'XAllocNamedColor'                      ,\
        libx11.XAllocSizeHints,                   'XAllocSizeHints'                       ,\
        libx11.XAllocStandardColormap,            'XAllocStandardColormap'                ,\
        libx11.XAllocWMHints,                     'XAllocWMHints'                         ,\
        libx11.XAllowEvents,                      'XAllowEvents'                          ,\
        libx11.XAutoRepeatOff,                    'XAutoRepeatOff'                        ,\
        libx11.XAutoRepeatOn,                     'XAutoRepeatOn'                         ,\
        libx11.XBaseFontNameListOfFontSet,        'XBaseFontNameListOfFontSet'            ,\
        libx11.XBell,                             'XBell'                                 ,\
        libx11.XBitmapBitOrder,                   'XBitmapBitOrder'                       ,\
        libx11.XBitmapPad,                        'XBitmapPad'                            ,\
        libx11.XBitmapUnit,                       'XBitmapUnit'                           ,\
        libx11.XBlackPixel,                       'XBlackPixel'                           ,\
        libx11.XBlackPixelOfScreen,               'XBlackPixelOfScreen'                   ,\
        libx11.XCellsOfScreen,                    'XCellsOfScreen'                        ,\
        libx11.XChangeActivePointerGrab,          'XChangeActivePointerGrab'              ,\
        libx11.XChangeGC,                         'XChangeGC'                             ,\
        libx11.XChangeKeyboardControl,            'XChangeKeyboardControl'                ,\
        libx11.XChangeKeyboardMapping,            'XChangeKeyboardMapping'                ,\
        libx11.XChangePointerControl,             'XChangePointerControl'                 ,\
        libx11.XChangeProperty,                   'XChangeProperty'                       ,\
        libx11.XChangeSaveSet,                    'XChangeSaveSet'                        ,\
        libx11.XChangeWindowAttributes,           'XChangeWindowAttributes'               ,\
        libx11.XCheckIfEvent,                     'XCheckIfEvent'                         ,\
        libx11.XCheckMaskEvent,                   'XCheckMaskEvent'                       ,\
        libx11.XCheckTypedEvent,                  'XCheckTypedEvent'                      ,\
        libx11.XCheckTypedWindowEvent,            'XCheckTypedWindowEvent'                ,\
        libx11.XCheckWindowEvent,                 'XCheckWindowEvent'                     ,\
        libx11.XCirculateSubwindows,              'XCirculateSubwindows'                  ,\
        libx11.XCirculateSubwindowsDown,          'XCirculateSubwindowsDown'              ,\
        libx11.XCirculateSubwindowsUp,            'XCirculateSubwindowsUp'                ,\
        libx11.XClearArea,                        'XClearArea'                            ,\
        libx11.XClearWindow,                      'XClearWindow'                          ,\
        libx11.XClipBox,                          'XClipBox'                              ,\
        libx11.XCloseDisplay,                     'XCloseDisplay'                         ,\
        libx11.XCloseIM,                          'XCloseIM'                              ,\
        libx11.XCloseOM,                          'XCloseOM'                              ,\
        libx11.XConfigureWindow,                  'XConfigureWindow'                      ,\
        libx11.XConnectionNumber,                 'XConnectionNumber'                     ,\
        libx11.XContextDependentDrawing,          'XContextDependentDrawing'              ,\
        libx11.XContextualDrawing,                'XContextualDrawing'                    ,\
        libx11.XConvertCase,                      'XConvertCase'                          ,\
        libx11.XConvertSelection,                 'XConvertSelection'                     ,\
        libx11.XCopyArea,                         'XCopyArea'                             ,\
        libx11.XCopyColormapAndFree,              'XCopyColormapAndFree'                  ,\
        libx11.XCopyGC,                           'XCopyGC'                               ,\
        libx11.XCopyPlane,                        'XCopyPlane'                            ,\
        libx11.XCreateBitmapFromData,             'XCreateBitmapFromData'                 ,\
        libx11.XCreateColormap,                   'XCreateColormap'                       ,\
        libx11.XCreateFontCursor,                 'XCreateFontCursor'                     ,\
        libx11.XCreateFontSet,                    'XCreateFontSet'                        ,\
        libx11.XCreateGC,                         'XCreateGC'                             ,\
        libx11.XCreateGlyphCursor,                'XCreateGlyphCursor'                    ,\
        libx11.XCreateIC,                         'XCreateIC'                             ,\
        libx11.XCreateImage,                      'XCreateImage'                          ,\
        libx11.XCreateOC,                         'XCreateOC'                             ,\
        libx11.XCreatePixmap,                     'XCreatePixmap'                         ,\
        libx11.XCreatePixmapCursor,               'XCreatePixmapCursor'                   ,\
        libx11.XCreatePixmapFromBitmapData,       'XCreatePixmapFromBitmapData'           ,\
        libx11.XCreateRegion,                     'XCreateRegion'                         ,\
        libx11.XCreateSimpleWindow,               'XCreateSimpleWindow'                   ,\
        libx11.XCreateWindow,                     'XCreateWindow'                         ,\
        libx11.XDefaultColormap,                  'XDefaultColormap'                      ,\
        libx11.XDefaultColormapOfScreen,          'XDefaultColormapOfScreen'              ,\
        libx11.XDefaultDepth,                     'XDefaultDepth'                         ,\
        libx11.XDefaultDepthOfScreen,             'XDefaultDepthOfScreen'                 ,\
        libx11.XDefaultGC,                        'XDefaultGC'                            ,\
        libx11.XDefaultGCOfScreen,                'XDefaultGCOfScreen'                    ,\
        libx11.XDefaultRootWindow,                'XDefaultRootWindow'                    ,\
        libx11.XDefaultScreen,                    'XDefaultScreen'                        ,\
        libx11.XDefaultScreenOfDisplay,           'XDefaultScreenOfDisplay'               ,\
        libx11.XDefaultString,                    'XDefaultString'                        ,\
        libx11.XDefaultVisual,                    'XDefaultVisual'                        ,\
        libx11.XDefaultVisualOfScreen,            'XDefaultVisualOfScreen'                ,\
        libx11.XDefineCursor,                     'XDefineCursor'                         ,\
        libx11.XDeleteContext,                    'XDeleteContext'                        ,\
        libx11.XDeleteModifiermapEntry,           'XDeleteModifiermapEntry'               ,\
        libx11.XDeleteProperty,                   'XDeleteProperty'                       ,\
        libx11.XDestroyIC,                        'XDestroyIC'                            ,\
        libx11.XDestroyImage,                     'XDestroyImage'                         ,\
        libx11.XDestroyOC,                        'XDestroyOC'                            ,\
        libx11.XDestroyRegion,                    'XDestroyRegion'                        ,\
        libx11.XDestroySubwindows,                'XDestroySubwindows'                    ,\
        libx11.XDestroyWindow,                    'XDestroyWindow'                        ,\
        libx11.XDirectionalDependentDrawing,      'XDirectionalDependentDrawing'          ,\
        libx11.XDisableAccessControl,             'XDisableAccessControl'                 ,\
        libx11.XDisplayCells,                     'XDisplayCells'                         ,\
        libx11.XDisplayHeight,                    'XDisplayHeight'                        ,\
        libx11.XDisplayHeightMM,                  'XDisplayHeightMM'                      ,\
        libx11.XDisplayKeycodes,                  'XDisplayKeycodes'                      ,\
        libx11.XDisplayMotionBufferSize,          'XDisplayMotionBufferSize'              ,\
        libx11.XDisplayName,                      'XDisplayName'                          ,\
        libx11.XDisplayOfIM,                      'XDisplayOfIM'                          ,\
        libx11.XDisplayOfOM,                      'XDisplayOfOM'                          ,\
        libx11.XDisplayOfScreen,                  'XDisplayOfScreen'                      ,\
        libx11.XDisplayPlanes,                    'XDisplayPlanes'                        ,\
        libx11.XDisplayString,                    'XDisplayString'                        ,\
        libx11.XDisplayWidth,                     'XDisplayWidth'                         ,\
        libx11.XDisplayWidthMM,                   'XDisplayWidthMM'                       ,\
        libx11.XDoesBackingStore,                 'XDoesBackingStore'                     ,\
        libx11.XDoesSaveUnders,                   'XDoesSaveUnders'                       ,\
        libx11.XDrawArc,                          'XDrawArc'                              ,\
        libx11.XDrawArcs,                         'XDrawArcs'                             ,\
        libx11.XDrawImageString,                  'XDrawImageString'                      ,\
        libx11.XDrawImageString16,                'XDrawImageString16'                    ,\
        libx11.XDrawLine,                         'XDrawLine'                             ,\
        libx11.XDrawLines,                        'XDrawLines'                            ,\
        libx11.XDrawPoint,                        'XDrawPoint'                            ,\
        libx11.XDrawPoints,                       'XDrawPoints'                           ,\
        libx11.XDrawRectangle,                    'XDrawRectangle'                        ,\
        libx11.XDrawRectangles,                   'XDrawRectangles'                       ,\
        libx11.XDrawSegments,                     'XDrawSegments'                         ,\
        libx11.XDrawString,                       'XDrawString'                           ,\
        libx11.XDrawString16,                     'XDrawString16'                         ,\
        libx11.XDrawText,                         'XDrawText'                             ,\
        libx11.XDrawText16,                       'XDrawText16'                           ,\
        libx11.XEHeadOfExtensionList,             'XEHeadOfExtensionList'                 ,\
        libx11.XESetBeforeFlush,                  'XESetBeforeFlush'                      ,\
        libx11.XESetCloseDisplay,                 'XESetCloseDisplay'                     ,\
        libx11.XESetCopyGC,                       'XESetCopyGC'                           ,\
        libx11.XESetCreateFont,                   'XESetCreateFont'                       ,\
        libx11.XESetCreateGC,                     'XESetCreateGC'                         ,\
        libx11.XESetError,                        'XESetError'                            ,\
        libx11.XESetErrorString,                  'XESetErrorString'                      ,\
        libx11.XESetEventToWire,                  'XESetEventToWire'                      ,\
        libx11.XESetFlushGC,                      'XESetFlushGC'                          ,\
        libx11.XESetFreeFont,                     'XESetFreeFont'                         ,\
        libx11.XESetFreeGC,                       'XESetFreeGC'                           ,\
        libx11.XESetPrintErrorValues,             'XESetPrintErrorValues'                 ,\
        libx11.XESetWireToError,                  'XESetWireToError'                      ,\
        libx11.XESetWireToEvent,                  'XESetWireToEvent'                      ,\
        libx11.XEmptyRegion,                      'XEmptyRegion'                          ,\
        libx11.XEnableAccessControl,              'XEnableAccessControl'                  ,\
        libx11.XEqualRegion,                      'XEqualRegion'                          ,\
        libx11.XEventMaskOfScreen,                'XEventMaskOfScreen'                    ,\
        libx11.XEventsQueued,                     'XEventsQueued'                         ,\
        libx11.XExtendedMaxRequestSize,           'XExtendedMaxRequestSize'               ,\
        libx11.XExtentsOfFontSet,                 'XExtentsOfFontSet'                     ,\
        libx11.XFetchBuffer,                      'XFetchBuffer'                          ,\
        libx11.XFetchBytes,                       'XFetchBytes'                           ,\
        libx11.XFetchName,                        'XFetchName'                            ,\
        libx11.XFillArc,                          'XFillArc'                              ,\
        libx11.XFillArcs,                         'XFillArcs'                             ,\
        libx11.XFillPolygon,                      'XFillPolygon'                          ,\
        libx11.XFillRectangle,                    'XFillRectangle'                        ,\
        libx11.XFillRectangles,                   'XFillRectangles'                       ,\
        libx11.XFilterEvent,                      'XFilterEvent'                          ,\
        libx11.XFindContext,                      'XFindContext'                          ,\
        libx11.XFindOnExtensionList,              'XFindOnExtensionList'                  ,\
        libx11.XFlush,                            'XFlush'                                ,\
        libx11.XFlushGC,                          'XFlushGC'                              ,\
        libx11.XFontsOfFontSet,                   'XFontsOfFontSet'                       ,\
        libx11.XForceScreenSaver,                 'XForceScreenSaver'                     ,\
        libx11.XFree,                             'XFree'                                 ,\
        libx11.XFreeColormap,                     'XFreeColormap'                         ,\
        libx11.XFreeColors,                       'XFreeColors'                           ,\
        libx11.XFreeCursor,                       'XFreeCursor'                           ,\
        libx11.XFreeExtensionList,                'XFreeExtensionList'                    ,\
        libx11.XFreeFont,                         'XFreeFont'                             ,\
        libx11.XFreeFontInfo,                     'XFreeFontInfo'                         ,\
        libx11.XFreeFontNames,                    'XFreeFontNames'                        ,\
        libx11.XFreeFontPath,                     'XFreeFontPath'                         ,\
        libx11.XFreeFontSet,                      'XFreeFontSet'                          ,\
        libx11.XFreeGC,                           'XFreeGC'                               ,\
        libx11.XFreeModifiermap,                  'XFreeModifiermap'                      ,\
        libx11.XFreePixmap,                       'XFreePixmap'                           ,\
        libx11.XFreeStringList,                   'XFreeStringList'                       ,\
        libx11.XGContextFromGC,                   'XGContextFromGC'                       ,\
        libx11.XGeometry,                         'XGeometry'                             ,\
        libx11.XGetAtomName,                      'XGetAtomName'                          ,\
        libx11.XGetAtomNames,                     'XGetAtomNames'                         ,\
        libx11.XGetClassHint,                     'XGetClassHint'                         ,\
        libx11.XGetCommand,                       'XGetCommand'                           ,\
        libx11.XGetDefault,                       'XGetDefault'                           ,\
        libx11.XGetErrorDatabaseText,             'XGetErrorDatabaseText'                 ,\
        libx11.XGetErrorText,                     'XGetErrorText'                         ,\
        libx11.XGetFontPath,                      'XGetFontPath'                          ,\
        libx11.XGetFontProperty,                  'XGetFontProperty'                      ,\
        libx11.XGetGCValues,                      'XGetGCValues'                          ,\
        libx11.XGetGeometry,                      'XGetGeometry'                          ,\
        libx11.XGetICValues,                      'XGetICValues'                          ,\
        libx11.XGetIMValues,                      'XGetIMValues'                          ,\
        libx11.XGetIconName,                      'XGetIconName'                          ,\
        libx11.XGetIconSizes,                     'XGetIconSizes'                         ,\
        libx11.XGetImage,                         'XGetImage'                             ,\
        libx11.XGetInputFocus,                    'XGetInputFocus'                        ,\
        libx11.XGetKeyboardControl,               'XGetKeyboardControl'                   ,\
        libx11.XGetKeyboardMapping,               'XGetKeyboardMapping'                   ,\
        libx11.XGetModifierMapping,               'XGetModifierMapping'                   ,\
        libx11.XGetMotionEvents,                  'XGetMotionEvents'                      ,\
        libx11.XGetNormalHints,                   'XGetNormalHints'                       ,\
        libx11.XGetOCValues,                      'XGetOCValues'                          ,\
        libx11.XGetOMValues,                      'XGetOMValues'                          ,\
        libx11.XGetPixel,                         'XGetPixel'                             ,\
        libx11.XGetPointerControl,                'XGetPointerControl'                    ,\
        libx11.XGetPointerMapping,                'XGetPointerMapping'                    ,\
        libx11.XGetRGBColormaps,                  'XGetRGBColormaps'                      ,\
        libx11.XGetScreenSaver,                   'XGetScreenSaver'                       ,\
        libx11.XGetSelectionOwner,                'XGetSelectionOwner'                    ,\
        libx11.XGetSizeHints,                     'XGetSizeHints'                         ,\
        libx11.XGetStandardColormap,              'XGetStandardColormap'                  ,\
        libx11.XGetSubImage,                      'XGetSubImage'                          ,\
        libx11.XGetTextProperty,                  'XGetTextProperty'                      ,\
        libx11.XGetTransientForHint,              'XGetTransientForHint'                  ,\
        libx11.XGetVisualInfo,                    'XGetVisualInfo'                        ,\
        libx11.XGetWMClientMachine,               'XGetWMClientMachine'                   ,\
        libx11.XGetWMColormapWindows,             'XGetWMColormapWindows'                 ,\
        libx11.XGetWMHints,                       'XGetWMHints'                           ,\
        libx11.XGetWMIconName,                    'XGetWMIconName'                        ,\
        libx11.XGetWMName,                        'XGetWMName'                            ,\
        libx11.XGetWMNormalHints,                 'XGetWMNormalHints'                     ,\
        libx11.XGetWMProtocols,                   'XGetWMProtocols'                       ,\
        libx11.XGetWMSizeHints,                   'XGetWMSizeHints'                       ,\
        libx11.XGetWindowAttributes,              'XGetWindowAttributes'                  ,\
        libx11.XGetWindowProperty,                'XGetWindowProperty'                    ,\
        libx11.XGetZoomHints,                     'XGetZoomHints'                         ,\
        libx11.XGrabButton,                       'XGrabButton'                           ,\
        libx11.XGrabKey,                          'XGrabKey'                              ,\
        libx11.XGrabKeyboard,                     'XGrabKeyboard'                         ,\
        libx11.XGrabPointer,                      'XGrabPointer'                          ,\
        libx11.XGrabServer,                       'XGrabServer'                           ,\
        libx11.XHeightMMOfScreen,                 'XHeightMMOfScreen'                     ,\
        libx11.XHeightOfScreen,                   'XHeightOfScreen'                       ,\
        libx11.XIMOfIC,                           'XIMOfIC'                               ,\
        libx11.XIconifyWindow,                    'XIconifyWindow'                        ,\
        libx11.XIfEvent,                          'XIfEvent'                              ,\
        libx11.XImageByteOrder,                   'XImageByteOrder'                       ,\
        libx11.XInitExtension,                    'XInitExtension'                        ,\
        libx11.XInitImage,                        'XInitImage'                            ,\
        libx11.XInitThreads,                      'XInitThreads'                          ,\
        libx11.XInsertModifiermapEntry,           'XInsertModifiermapEntry'               ,\
        libx11.XInstallColormap,                  'XInstallColormap'                      ,\
        libx11.XInternAtom,                       'XInternAtom'                           ,\
        libx11.XInternAtoms,                      'XInternAtoms'                          ,\
        libx11.XInternalConnectionNumbers,        'XInternalConnectionNumbers'            ,\
        libx11.XIntersectRegion,                  'XIntersectRegion'                      ,\
        libx11.XKeycodeToKeysym,                  'XKeycodeToKeysym'                      ,\
        libx11.XKeysymToKeycode,                  'XKeysymToKeycode'                      ,\
        libx11.XKeysymToString,                   'XKeysymToString'                       ,\
        libx11.XKillClient,                       'XKillClient'                           ,\
        libx11.XLastKnownRequestProcessed,        'XLastKnownRequestProcessed'            ,\
        libx11.XListDepths,                       'XListDepths'                           ,\
        libx11.XListExtensions,                   'XListExtensions'                       ,\
        libx11.XListFonts,                        'XListFonts'                            ,\
        libx11.XListFontsWithInfo,                'XListFontsWithInfo'                    ,\
        libx11.XListHosts,                        'XListHosts'                            ,\
        libx11.XListInstalledColormaps,           'XListInstalledColormaps'               ,\
        libx11.XListPixmapFormats,                'XListPixmapFormats'                    ,\
        libx11.XListProperties,                   'XListProperties'                       ,\
        libx11.XLoadFont,                         'XLoadFont'                             ,\
        libx11.XLoadQueryFont,                    'XLoadQueryFont'                        ,\
        libx11.XLocaleOfFontSet,                  'XLocaleOfFontSet'                      ,\
        libx11.XLocaleOfIM,                       'XLocaleOfIM'                           ,\
        libx11.XLocaleOfOM,                       'XLocaleOfOM'                           ,\
        libx11.XLockDisplay,                      'XLockDisplay'                          ,\
        libx11.XLookupColor,                      'XLookupColor'                          ,\
        libx11.XLookupKeysym,                     'XLookupKeysym'                         ,\
        libx11.XLookupString,                     'XLookupString'                         ,\
        libx11.XLowerWindow,                      'XLowerWindow'                          ,\
        libx11.XMapRaised,                        'XMapRaised'                            ,\
        libx11.XMapSubwindows,                    'XMapSubwindows'                        ,\
        libx11.XMapWindow,                        'XMapWindow'                            ,\
        libx11.XMaskEvent,                        'XMaskEvent'                            ,\
        libx11.XMatchVisualInfo,                  'XMatchVisualInfo'                      ,\
        libx11.XMaxCmapsOfScreen,                 'XMaxCmapsOfScreen'                     ,\
        libx11.XMaxRequestSize,                   'XMaxRequestSize'                       ,\
        libx11.XMinCmapsOfScreen,                 'XMinCmapsOfScreen'                     ,\
        libx11.XMoveResizeWindow,                 'XMoveResizeWindow'                     ,\
        libx11.XMoveWindow,                       'XMoveWindow'                           ,\
        libx11.XNewModifiermap,                   'XNewModifiermap'                       ,\
        libx11.XNextEvent,                        'XNextEvent'                            ,\
        libx11.XNextRequest,                      'XNextRequest'                          ,\
        libx11.XNoOp,                             'XNoOp'                                 ,\
        libx11.XOMOfOC,                           'XOMOfOC'                               ,\
        libx11.XOffsetRegion,                     'XOffsetRegion'                         ,\
        libx11.XOpenDisplay,                      'XOpenDisplay'                          ,\
        libx11.XOpenIM,                           'XOpenIM'                               ,\
        libx11.XOpenOM,                           'XOpenOM'                               ,\
        libx11.XParseColor,                       'XParseColor'                           ,\
        libx11.XParseGeometry,                    'XParseGeometry'                        ,\
        libx11.XPeekEvent,                        'XPeekEvent'                            ,\
        libx11.XPeekIfEvent,                      'XPeekIfEvent'                          ,\
        libx11.XPending,                          'XPending'                              ,\
        libx11.XPlanesOfScreen,                   'XPlanesOfScreen'                       ,\
        libx11.XPointInRegion,                    'XPointInRegion'                        ,\
        libx11.XPolygonRegion,                    'XPolygonRegion'                        ,\
        libx11.XProcessInternalConnection,        'XProcessInternalConnection'            ,\
        libx11.XProtocolRevision,                 'XProtocolRevision'                     ,\
        libx11.XProtocolVersion,                  'XProtocolVersion'                      ,\
        libx11.XPutBackEvent,                     'XPutBackEvent'                         ,\
        libx11.XPutImage,                         'XPutImage'                             ,\
        libx11.XPutPixel,                         'XPutPixel'                             ,\
        libx11.XQLength,                          'XQLength'                              ,\
        libx11.XQueryBestCursor,                  'XQueryBestCursor'                      ,\
        libx11.XQueryBestSize,                    'XQueryBestSize'                        ,\
        libx11.XQueryBestStipple,                 'XQueryBestStipple'                     ,\
        libx11.XQueryBestTile,                    'XQueryBestTile'                        ,\
        libx11.XQueryColor,                       'XQueryColor'                           ,\
        libx11.XQueryColors,                      'XQueryColors'                          ,\
        libx11.XQueryExtension,                   'XQueryExtension'                       ,\
        libx11.XQueryFont,                        'XQueryFont'                            ,\
        libx11.XQueryKeymap,                      'XQueryKeymap'                          ,\
        libx11.XQueryPointer,                     'XQueryPointer'                         ,\
        libx11.XQueryTextExtents,                 'XQueryTextExtents'                     ,\
        libx11.XQueryTextExtents16,               'XQueryTextExtents16'                   ,\
        libx11.XQueryTree,                        'XQueryTree'                            ,\
        libx11.XRaiseWindow,                      'XRaiseWindow'                          ,\
        libx11.XReadBitmapFile,                   'XReadBitmapFile'                       ,\
        libx11.XReadBitmapFileData,               'XReadBitmapFileData'                   ,\
        libx11.XRebindKeysym,                     'XRebindKeysym'                         ,\
        libx11.XRecolorCursor,                    'XRecolorCursor'                        ,\
        libx11.XReconfigureWMWindow,              'XReconfigureWMWindow'                  ,\
        libx11.XRectInRegion,                     'XRectInRegion'                         ,\
        libx11.XRefreshKeyboardMapping,           'XRefreshKeyboardMapping'               ,\
        libx11.XRegisterIMInstantiateCallback,    'XRegisterIMInstantiateCallback'        ,\
        libx11.XRemoveConnectionWatch,            'XRemoveConnectionWatch'                ,\
        libx11.XRemoveFromSaveSet,                'XRemoveFromSaveSet'                    ,\
        libx11.XRemoveHost,                       'XRemoveHost'                           ,\
        libx11.XRemoveHosts,                      'XRemoveHosts'                          ,\
        libx11.XReparentWindow,                   'XReparentWindow'                       ,\
        libx11.XResetScreenSaver,                 'XResetScreenSaver'                     ,\
        libx11.XResizeWindow,                     'XResizeWindow'                         ,\
        libx11.XResourceManagerString,            'XResourceManagerString'                ,\
        libx11.XRestackWindows,                   'XRestackWindows'                       ,\
        libx11.XRootWindow,                       'XRootWindow'                           ,\
        libx11.XRootWindowOfScreen,               'XRootWindowOfScreen'                   ,\
        libx11.XRotateBuffers,                    'XRotateBuffers'                        ,\
        libx11.XRotateWindowProperties,           'XRotateWindowProperties'               ,\
        libx11.XSaveContext,                      'XSaveContext'                          ,\
        libx11.XScreenCount,                      'XScreenCount'                          ,\
        libx11.XScreenNumberOfScreen,             'XScreenNumberOfScreen'                 ,\
        libx11.XScreenOfDisplay,                  'XScreenOfDisplay'                      ,\
        libx11.XScreenResourceString,             'XScreenResourceString'                 ,\
        libx11.XSelectInput,                      'XSelectInput'                          ,\
        libx11.XSendEvent,                        'XSendEvent'                            ,\
        libx11.XServerVendor,                     'XServerVendor'                         ,\
        libx11.XSetAccessControl,                 'XSetAccessControl'                     ,\
        libx11.XSetAfterFunction,                 'XSetAfterFunction'                     ,\
        libx11.XSetArcMode,                       'XSetArcMode'                           ,\
        libx11.XSetAuthorization,                 'XSetAuthorization'                     ,\
        libx11.XSetBackground,                    'XSetBackground'                        ,\
        libx11.XSetClassHint,                     'XSetClassHint'                         ,\
        libx11.XSetClipMask,                      'XSetClipMask'                          ,\
        libx11.XSetClipOrigin,                    'XSetClipOrigin'                        ,\
        libx11.XSetClipRectangles,                'XSetClipRectangles'                    ,\
        libx11.XSetCloseDownMode,                 'XSetCloseDownMode'                     ,\
        libx11.XSetCommand,                       'XSetCommand'                           ,\
        libx11.XSetDashes,                        'XSetDashes'                            ,\
        libx11.XSetErrorHandler,                  'XSetErrorHandler'                      ,\
        libx11.XSetFillRule,                      'XSetFillRule'                          ,\
        libx11.XSetFillStyle,                     'XSetFillStyle'                         ,\
        libx11.XSetFont,                          'XSetFont'                              ,\
        libx11.XSetFontPath,                      'XSetFontPath'                          ,\
        libx11.XSetForeground,                    'XSetForeground'                        ,\
        libx11.XSetFunction,                      'XSetFunction'                          ,\
        libx11.XSetGraphicsExposures,             'XSetGraphicsExposures'                 ,\
        libx11.XSetICFocus,                       'XSetICFocus'                           ,\
        libx11.XSetICValues,                      'XSetICValues'                          ,\
        libx11.XSetIMValues,                      'XSetIMValues'                          ,\
        libx11.XSetIOErrorHandler,                'XSetIOErrorHandler'                    ,\
        libx11.XSetIconName,                      'XSetIconName'                          ,\
        libx11.XSetIconSizes,                     'XSetIconSizes'                         ,\
        libx11.XSetInputFocus,                    'XSetInputFocus'                        ,\
        libx11.XSetLineAttributes,                'XSetLineAttributes'                    ,\
        libx11.XSetLocaleModifiers,               'XSetLocaleModifiers'                   ,\
        libx11.XSetModifierMapping,               'XSetModifierMapping'                   ,\
        libx11.XSetNormalHints,                   'XSetNormalHints'                       ,\
        libx11.XSetOCValues,                      'XSetOCValues'                          ,\
        libx11.XSetOMValues,                      'XSetOMValues'                          ,\
        libx11.XSetPlaneMask,                     'XSetPlaneMask'                         ,\
        libx11.XSetPointerMapping,                'XSetPointerMapping'                    ,\
        libx11.XSetRGBColormaps,                  'XSetRGBColormaps'                      ,\
        libx11.XSetRegion,                        'XSetRegion'                            ,\
        libx11.XSetScreenSaver,                   'XSetScreenSaver'                       ,\
        libx11.XSetSelectionOwner,                'XSetSelectionOwner'                    ,\
        libx11.XSetSizeHints,                     'XSetSizeHints'                         ,\
        libx11.XSetStandardColormap,              'XSetStandardColormap'                  ,\
        libx11.XSetStandardProperties,            'XSetStandardProperties'                ,\
        libx11.XSetState,                         'XSetState'                             ,\
        libx11.XSetStipple,                       'XSetStipple'                           ,\
        libx11.XSetSubwindowMode,                 'XSetSubwindowMode'                     ,\
        libx11.XSetTSOrigin,                      'XSetTSOrigin'                          ,\
        libx11.XSetTextProperty,                  'XSetTextProperty'                      ,\
        libx11.XSetTile,                          'XSetTile'                              ,\
        libx11.XSetTransientForHint,              'XSetTransientForHint'                  ,\
        libx11.XSetWMClientMachine,               'XSetWMClientMachine'                   ,\
        libx11.XSetWMColormapWindows,             'XSetWMColormapWindows'                 ,\
        libx11.XSetWMHints,                       'XSetWMHints'                           ,\
        libx11.XSetWMIconName,                    'XSetWMIconName'                        ,\
        libx11.XSetWMName,                        'XSetWMName'                            ,\
        libx11.XSetWMNormalHints,                 'XSetWMNormalHints'                     ,\
        libx11.XSetWMProperties,                  'XSetWMProperties'                      ,\
        libx11.XSetWMProtocols,                   'XSetWMProtocols'                       ,\
        libx11.XSetWMSizeHints,                   'XSetWMSizeHints'                       ,\
        libx11.XSetWindowBackground,              'XSetWindowBackground'                  ,\
        libx11.XSetWindowBackgroundPixmap,        'XSetWindowBackgroundPixmap'            ,\
        libx11.XSetWindowBorder,                  'XSetWindowBorder'                      ,\
        libx11.XSetWindowBorderPixmap,            'XSetWindowBorderPixmap'                ,\
        libx11.XSetWindowBorderWidth,             'XSetWindowBorderWidth'                 ,\
        libx11.XSetWindowColormap,                'XSetWindowColormap'                    ,\
        libx11.XSetZoomHints,                     'XSetZoomHints'                         ,\
        libx11.XShrinkRegion,                     'XShrinkRegion'                         ,\
        libx11.XStoreBuffer,                      'XStoreBuffer'                          ,\
        libx11.XStoreBytes,                       'XStoreBytes'                           ,\
        libx11.XStoreColor,                       'XStoreColor'                           ,\
        libx11.XStoreColors,                      'XStoreColors'                          ,\
        libx11.XStoreName,                        'XStoreName'                            ,\
        libx11.XStoreNamedColor,                  'XStoreNamedColor'                      ,\
        libx11.XStringListToTextProperty,         'XStringListToTextProperty'             ,\
        libx11.XStringToKeysym,                   'XStringToKeysym'                       ,\
        libx11.XSubImage,                         'XSubImage'                             ,\
        libx11.XSubtractRegion,                   'XSubtractRegion'                       ,\
        libx11.XSupportsLocale,                   'XSupportsLocale'                       ,\
        libx11.XSync,                             'XSync'                                 ,\
        libx11.XSynchronize,                      'XSynchronize'                          ,\
        libx11.XTextExtents,                      'XTextExtents'                          ,\
        libx11.XTextExtents16,                    'XTextExtents16'                        ,\
        libx11.XTextPropertyToStringList,         'XTextPropertyToStringList'             ,\
        libx11.XTextWidth,                        'XTextWidth'                            ,\
        libx11.XTextWidth16,                      'XTextWidth16'                          ,\
        libx11.XTranslateCoordinates,             'XTranslateCoordinates'                 ,\
        libx11.XUndefineCursor,                   'XUndefineCursor'                       ,\
        libx11.XUngrabButton,                     'XUngrabButton'                         ,\
        libx11.XUngrabKey,                        'XUngrabKey'                            ,\
        libx11.XUngrabKeyboard,                   'XUngrabKeyboard'                       ,\
        libx11.XUngrabPointer,                    'XUngrabPointer'                        ,\
        libx11.XUngrabServer,                     'XUngrabServer'                         ,\
        libx11.XUninstallColormap,                'XUninstallColormap'                    ,\
        libx11.XUnionRectWithRegion,              'XUnionRectWithRegion'                  ,\
        libx11.XUnionRegion,                      'XUnionRegion'                          ,\
        libx11.XUnloadFont,                       'XUnloadFont'                           ,\
        libx11.XUnlockDisplay,                    'XUnlockDisplay'                        ,\
        libx11.XUnmapSubwindows,                  'XUnmapSubwindows'                      ,\
        libx11.XUnmapWindow,                      'XUnmapWindow'                          ,\
        libx11.XUnregisterIMInstantiateCallback,  'XUnregisterIMInstantiateCallback'      ,\
        libx11.XUnsetICFocus,                     'XUnsetICFocus'                         ,\
        libx11.XVaCreateNestedList,               'XVaCreateNestedList'                   ,\
        libx11.XVendorRelease,                    'XVendorRelease'                        ,\
        libx11.XVisualIDFromVisual,               'XVisualIDFromVisual'                   ,\
        libx11.XWMGeometry,                       'XWMGeometry'                           ,\
        libx11.XWarpPointer,                      'XWarpPointer'                          ,\
        libx11.XWhitePixel,                       'XWhitePixel'                           ,\
        libx11.XWhitePixelOfScreen,               'XWhitePixelOfScreen'                   ,\
        libx11.XWidthMMOfScreen,                  'XWidthMMOfScreen'                      ,\
        libx11.XWidthOfScreen,                    'XWidthOfScreen'                        ,\
        libx11.XWindowEvent,                      'XWindowEvent'                          ,\
        libx11.XWithdrawWindow,                   'XWithdrawWindow'                       ,\
        libx11.XWriteBitmapFile,                  'XWriteBitmapFile'                      ,\
        libx11.XXorRegion,                        'XXorRegion'                            ,\
        libx11.XcmsAddColorSpace,                 'XcmsAddColorSpace'                     ,\
        libx11.XcmsAddFunctionSet,                'XcmsAddFunctionSet'                    ,\
        libx11.XcmsAllocColor,                    'XcmsAllocColor'                        ,\
        libx11.XcmsAllocNamedColor,               'XcmsAllocNamedColor'                   ,\
        libx11.XcmsCCCOfColormap,                 'XcmsCCCOfColormap'                     ,\
        libx11.XcmsCIELabClipL,                   'XcmsCIELabClipL'                       ,\
        libx11.XcmsCIELabClipLab,                 'XcmsCIELabClipLab'                     ,\
        libx11.XcmsCIELabClipab,                  'XcmsCIELabClipab'                      ,\
        libx11.XcmsCIELabColorSpace,              'XcmsCIELabColorSpace'                  ,\
        libx11.XcmsCIELabQueryMaxC,               'XcmsCIELabQueryMaxC'                   ,\
        libx11.XcmsCIELabQueryMaxL,               'XcmsCIELabQueryMaxL'                   ,\
        libx11.XcmsCIELabQueryMaxLC,              'XcmsCIELabQueryMaxLC'                  ,\
        libx11.XcmsCIELabQueryMinL,               'XcmsCIELabQueryMinL'                   ,\
        libx11.XcmsCIELabToCIEXYZ,                'XcmsCIELabToCIEXYZ'                    ,\
        libx11.XcmsCIELabWhiteShiftColors,        'XcmsCIELabWhiteShiftColors'            ,\
        libx11.XcmsCIELuvClipL,                   'XcmsCIELuvClipL'                       ,\
        libx11.XcmsCIELuvClipLuv,                 'XcmsCIELuvClipLuv'                     ,\
        libx11.XcmsCIELuvClipuv,                  'XcmsCIELuvClipuv'                      ,\
        libx11.XcmsCIELuvColorSpace,              'XcmsCIELuvColorSpace'                  ,\
        libx11.XcmsCIELuvQueryMaxC,               'XcmsCIELuvQueryMaxC'                   ,\
        libx11.XcmsCIELuvQueryMaxL,               'XcmsCIELuvQueryMaxL'                   ,\
        libx11.XcmsCIELuvQueryMaxLC,              'XcmsCIELuvQueryMaxLC'                  ,\
        libx11.XcmsCIELuvQueryMinL,               'XcmsCIELuvQueryMinL'                   ,\
        libx11.XcmsCIELuvToCIEuvY,                'XcmsCIELuvToCIEuvY'                    ,\
        libx11.XcmsCIELuvWhiteShiftColors,        'XcmsCIELuvWhiteShiftColors'            ,\
        libx11.XcmsCIEXYZColorSpace,              'XcmsCIEXYZColorSpace'                  ,\
        libx11.XcmsCIEXYZToCIELab,                'XcmsCIEXYZToCIELab'                    ,\
        libx11.XcmsCIEXYZToCIEuvY,                'XcmsCIEXYZToCIEuvY'                    ,\
        libx11.XcmsCIEXYZToCIExyY,                'XcmsCIEXYZToCIExyY'                    ,\
        libx11.XcmsCIEXYZToRGBi,                  'XcmsCIEXYZToRGBi'                      ,\
        libx11.XcmsCIEuvYColorSpace,              'XcmsCIEuvYColorSpace'                  ,\
        libx11.XcmsCIEuvYToCIELuv,                'XcmsCIEuvYToCIELuv'                    ,\
        libx11.XcmsCIEuvYToCIEXYZ,                'XcmsCIEuvYToCIEXYZ'                    ,\
        libx11.XcmsCIEuvYToTekHVC,                'XcmsCIEuvYToTekHVC'                    ,\
        libx11.XcmsCIExyYColorSpace,              'XcmsCIExyYColorSpace'                  ,\
        libx11.XcmsCIExyYToCIEXYZ,                'XcmsCIExyYToCIEXYZ'                    ,\
        libx11.XcmsClientWhitePointOfCCC,         'XcmsClientWhitePointOfCCC'             ,\
        libx11.XcmsConvertColors,                 'XcmsConvertColors'                     ,\
        libx11.XcmsCreateCCC,                     'XcmsCreateCCC'                         ,\
        libx11.XcmsDefaultCCC,                    'XcmsDefaultCCC'                        ,\
        libx11.XcmsDisplayOfCCC,                  'XcmsDisplayOfCCC'                      ,\
        libx11.XcmsFormatOfPrefix,                'XcmsFormatOfPrefix'                    ,\
        libx11.XcmsFreeCCC,                       'XcmsFreeCCC'                           ,\
        libx11.XcmsLinearRGBFunctionSet,          'XcmsLinearRGBFunctionSet'              ,\
        libx11.XcmsLookupColor,                   'XcmsLookupColor'                       ,\
        libx11.XcmsPrefixOfFormat,                'XcmsPrefixOfFormat'                    ,\
        libx11.XcmsQueryBlack,                    'XcmsQueryBlack'                        ,\
        libx11.XcmsQueryBlue,                     'XcmsQueryBlue'                         ,\
        libx11.XcmsQueryColor,                    'XcmsQueryColor'                        ,\
        libx11.XcmsQueryColors,                   'XcmsQueryColors'                       ,\
        libx11.XcmsQueryGreen,                    'XcmsQueryGreen'                        ,\
        libx11.XcmsQueryRed,                      'XcmsQueryRed'                          ,\
        libx11.XcmsQueryWhite,                    'XcmsQueryWhite'                        ,\
        libx11.XcmsRGBColorSpace,                 'XcmsRGBColorSpace'                     ,\
        libx11.XcmsRGBToRGBi,                     'XcmsRGBToRGBi'                         ,\
        libx11.XcmsRGBiColorSpace,                'XcmsRGBiColorSpace'                    ,\
        libx11.XcmsRGBiToCIEXYZ,                  'XcmsRGBiToCIEXYZ'                      ,\
        libx11.XcmsRGBiToRGB,                     'XcmsRGBiToRGB'                         ,\
        libx11.XcmsScreenNumberOfCCC,             'XcmsScreenNumberOfCCC'                 ,\
        libx11.XcmsScreenWhitePointOfCCC,         'XcmsScreenWhitePointOfCCC'             ,\
        libx11.XcmsSetCCCOfColormap,              'XcmsSetCCCOfColormap'                  ,\
        libx11.XcmsSetCompressionProc,            'XcmsSetCompressionProc'                ,\
        libx11.XcmsSetWhiteAdjustProc,            'XcmsSetWhiteAdjustProc'                ,\
        libx11.XcmsSetWhitePoint,                 'XcmsSetWhitePoint'                     ,\
        libx11.XcmsStoreColor,                    'XcmsStoreColor'                        ,\
        libx11.XcmsStoreColors,                   'XcmsStoreColors'                       ,\
        libx11.XcmsTekHVCClipC,                   'XcmsTekHVCClipC'                       ,\
        libx11.XcmsTekHVCClipV,                   'XcmsTekHVCClipV'                       ,\
        libx11.XcmsTekHVCClipVC,                  'XcmsTekHVCClipVC'                      ,\
        libx11.XcmsTekHVCColorSpace,              'XcmsTekHVCColorSpace'                  ,\
        libx11.XcmsTekHVCQueryMaxC,               'XcmsTekHVCQueryMaxC'                   ,\
        libx11.XcmsTekHVCQueryMaxV,               'XcmsTekHVCQueryMaxV'                   ,\
        libx11.XcmsTekHVCQueryMaxVC,              'XcmsTekHVCQueryMaxVC'                  ,\
        libx11.XcmsTekHVCQueryMaxVSamples,        'XcmsTekHVCQueryMaxVSamples'            ,\
        libx11.XcmsTekHVCQueryMinV,               'XcmsTekHVCQueryMinV'                   ,\
        libx11.XcmsTekHVCToCIEuvY,                'XcmsTekHVCToCIEuvY'                    ,\
        libx11.XcmsTekHVCWhiteShiftColors,        'XcmsTekHVCWhiteShiftColors'            ,\
        libx11.XcmsUNDEFINEDColorSpace,           'XcmsUNDEFINEDColorSpace'               ,\
        libx11.XcmsVisualOfCCC,                   'XcmsVisualOfCCC'                       ,\
        libx11.XkbAddDeviceLedInfo,               'XkbAddDeviceLedInfo'                   ,\
        libx11.XkbAddGeomColor,                   'XkbAddGeomColor'                       ,\
        libx11.XkbAddGeomDoodad,                  'XkbAddGeomDoodad'                      ,\
        libx11.XkbAddGeomKey,                     'XkbAddGeomKey'                         ,\
        libx11.XkbAddGeomKeyAlias,                'XkbAddGeomKeyAlias'                    ,\
        libx11.XkbAddGeomOutline,                 'XkbAddGeomOutline'                     ,\
        libx11.XkbAddGeomOverlay,                 'XkbAddGeomOverlay'                     ,\
        libx11.XkbAddGeomOverlayKey,              'XkbAddGeomOverlayKey'                  ,\
        libx11.XkbAddGeomOverlayRow,              'XkbAddGeomOverlayRow'                  ,\
        libx11.XkbAddGeomProperty,                'XkbAddGeomProperty'                    ,\
        libx11.XkbAddGeomRow,                     'XkbAddGeomRow'                         ,\
        libx11.XkbAddGeomSection,                 'XkbAddGeomSection'                     ,\
        libx11.XkbAddGeomShape,                   'XkbAddGeomShape'                       ,\
        libx11.XkbAddKeyType,                     'XkbAddKeyType'                         ,\
        libx11.XkbAllocClientMap,                 'XkbAllocClientMap'                     ,\
        libx11.XkbAllocCompatMap,                 'XkbAllocCompatMap'                     ,\
        libx11.XkbAllocControls,                  'XkbAllocControls'                      ,\
        libx11.XkbAllocDeviceInfo,                'XkbAllocDeviceInfo'                    ,\
        libx11.XkbAllocGeomColors,                'XkbAllocGeomColors'                    ,\
        libx11.XkbAllocGeomDoodads,               'XkbAllocGeomDoodads'                   ,\
        libx11.XkbAllocGeomKeyAliases,            'XkbAllocGeomKeyAliases'                ,\
        libx11.XkbAllocGeomKeys,                  'XkbAllocGeomKeys'                      ,\
        libx11.XkbAllocGeomOutlines,              'XkbAllocGeomOutlines'                  ,\
        libx11.XkbAllocGeomOverlayKeys,           'XkbAllocGeomOverlayKeys'               ,\
        libx11.XkbAllocGeomOverlayRows,           'XkbAllocGeomOverlayRows'               ,\
        libx11.XkbAllocGeomOverlays,              'XkbAllocGeomOverlays'                  ,\
        libx11.XkbAllocGeomPoints,                'XkbAllocGeomPoints'                    ,\
        libx11.XkbAllocGeomProps,                 'XkbAllocGeomProps'                     ,\
        libx11.XkbAllocGeomRows,                  'XkbAllocGeomRows'                      ,\
        libx11.XkbAllocGeomSectionDoodads,        'XkbAllocGeomSectionDoodads'            ,\
        libx11.XkbAllocGeomSections,              'XkbAllocGeomSections'                  ,\
        libx11.XkbAllocGeomShapes,                'XkbAllocGeomShapes'                    ,\
        libx11.XkbAllocGeometry,                  'XkbAllocGeometry'                      ,\
        libx11.XkbAllocIndicatorMaps,             'XkbAllocIndicatorMaps'                 ,\
        libx11.XkbAllocKeyboard,                  'XkbAllocKeyboard'                      ,\
        libx11.XkbAllocNames,                     'XkbAllocNames'                         ,\
        libx11.XkbAllocServerMap,                 'XkbAllocServerMap'                     ,\
        libx11.XkbApplyCompatMapToKey,            'XkbApplyCompatMapToKey'                ,\
        libx11.XkbApplyVirtualModChanges,         'XkbApplyVirtualModChanges'             ,\
        libx11.XkbBell,                           'XkbBell'                               ,\
        libx11.XkbBellEvent,                      'XkbBellEvent'                          ,\
        libx11.XkbChangeDeviceInfo,               'XkbChangeDeviceInfo'                   ,\
        libx11.XkbChangeEnabledControls,          'XkbChangeEnabledControls'              ,\
        libx11.XkbChangeKeycodeRange,             'XkbChangeKeycodeRange'                 ,\
        libx11.XkbChangeMap,                      'XkbChangeMap'                          ,\
        libx11.XkbChangeNames,                    'XkbChangeNames'                        ,\
        libx11.XkbChangeTypesOfKey,               'XkbChangeTypesOfKey'                   ,\
        libx11.XkbComputeEffectiveMap,            'XkbComputeEffectiveMap'                ,\
        libx11.XkbComputeRowBounds,               'XkbComputeRowBounds'                   ,\
        libx11.XkbComputeSectionBounds,           'XkbComputeSectionBounds'               ,\
        libx11.XkbComputeShapeBounds,             'XkbComputeShapeBounds'                 ,\
        libx11.XkbComputeShapeTop,                'XkbComputeShapeTop'                    ,\
        libx11.XkbCopyKeyType,                    'XkbCopyKeyType'                        ,\
        libx11.XkbCopyKeyTypes,                   'XkbCopyKeyTypes'                       ,\
        libx11.XkbDeviceBell,                     'XkbDeviceBell'                         ,\
        libx11.XkbDeviceBellEvent,                'XkbDeviceBellEvent'                    ,\
        libx11.XkbFindOverlayForKey,              'XkbFindOverlayForKey'                  ,\
        libx11.XkbForceBell,                      'XkbForceBell'                          ,\
        libx11.XkbForceDeviceBell,                'XkbForceDeviceBell'                    ,\
        libx11.XkbFreeClientMap,                  'XkbFreeClientMap'                      ,\
        libx11.XkbFreeCompatMap,                  'XkbFreeCompatMap'                      ,\
        libx11.XkbFreeComponentList,              'XkbFreeComponentList'                  ,\
        libx11.XkbFreeControls,                   'XkbFreeControls'                       ,\
        libx11.XkbFreeDeviceInfo,                 'XkbFreeDeviceInfo'                     ,\
        libx11.XkbFreeGeomColors,                 'XkbFreeGeomColors'                     ,\
        libx11.XkbFreeGeomDoodads,                'XkbFreeGeomDoodads'                    ,\
        libx11.XkbFreeGeomKeyAliases,             'XkbFreeGeomKeyAliases'                 ,\
        libx11.XkbFreeGeomKeys,                   'XkbFreeGeomKeys'                       ,\
        libx11.XkbFreeGeomOutlines,               'XkbFreeGeomOutlines'                   ,\
        libx11.XkbFreeGeomOverlayKeys,            'XkbFreeGeomOverlayKeys'                ,\
        libx11.XkbFreeGeomOverlayRows,            'XkbFreeGeomOverlayRows'                ,\
        libx11.XkbFreeGeomOverlays,               'XkbFreeGeomOverlays'                   ,\
        libx11.XkbFreeGeomPoints,                 'XkbFreeGeomPoints'                     ,\
        libx11.XkbFreeGeomProperties,             'XkbFreeGeomProperties'                 ,\
        libx11.XkbFreeGeomRows,                   'XkbFreeGeomRows'                       ,\
        libx11.XkbFreeGeomSections,               'XkbFreeGeomSections'                   ,\
        libx11.XkbFreeGeomShapes,                 'XkbFreeGeomShapes'                     ,\
        libx11.XkbFreeGeometry,                   'XkbFreeGeometry'                       ,\
        libx11.XkbFreeIndicatorMaps,              'XkbFreeIndicatorMaps'                  ,\
        libx11.XkbFreeKeyboard,                   'XkbFreeKeyboard'                       ,\
        libx11.XkbFreeNames,                      'XkbFreeNames'                          ,\
        libx11.XkbFreeServerMap,                  'XkbFreeServerMap'                      ,\
        libx11.XkbGetAutoRepeatRate,              'XkbGetAutoRepeatRate'                  ,\
        libx11.XkbGetAutoResetControls,           'XkbGetAutoResetControls'               ,\
        libx11.XkbGetCompatMap,                   'XkbGetCompatMap'                       ,\
        libx11.XkbGetControls,                    'XkbGetControls'                        ,\
        libx11.XkbGetDetectableAutoRepeat,        'XkbGetDetectableAutoRepeat'            ,\
        libx11.XkbGetDeviceButtonActions,         'XkbGetDeviceButtonActions'             ,\
        libx11.XkbGetDeviceInfo,                  'XkbGetDeviceInfo'                      ,\
        libx11.XkbGetDeviceInfoChanges,           'XkbGetDeviceInfoChanges'               ,\
        libx11.XkbGetDeviceLedInfo,               'XkbGetDeviceLedInfo'                   ,\
        libx11.XkbGetGeometry,                    'XkbGetGeometry'                        ,\
        libx11.XkbGetIndicatorMap,                'XkbGetIndicatorMap'                    ,\
        libx11.XkbGetIndicatorState,              'XkbGetIndicatorState'                  ,\
        libx11.XkbGetKeyActions,                  'XkbGetKeyActions'                      ,\
        libx11.XkbGetKeyBehaviors,                'XkbGetKeyBehaviors'                    ,\
        libx11.XkbGetKeyExplicitComponents,       'XkbGetKeyExplicitComponents'           ,\
        libx11.XkbGetKeyModifierMap,              'XkbGetKeyModifierMap'                  ,\
        libx11.XkbGetKeySyms,                     'XkbGetKeySyms'                         ,\
        libx11.XkbGetKeyTypes,                    'XkbGetKeyTypes'                        ,\
        libx11.XkbGetKeyVirtualModMap,            'XkbGetKeyVirtualModMap'                ,\
        libx11.XkbGetKeyboard,                    'XkbGetKeyboard'                        ,\
        libx11.XkbGetKeyboardByName,              'XkbGetKeyboardByName'                  ,\
        libx11.XkbGetMap,                         'XkbGetMap'                             ,\
        libx11.XkbGetMapChanges,                  'XkbGetMapChanges'                      ,\
        libx11.XkbGetNamedDeviceIndicator,        'XkbGetNamedDeviceIndicator'            ,\
        libx11.XkbGetNamedGeometry,               'XkbGetNamedGeometry'                   ,\
        libx11.XkbGetNamedIndicator,              'XkbGetNamedIndicator'                  ,\
        libx11.XkbGetNames,                       'XkbGetNames'                           ,\
        libx11.XkbGetPerClientControls,           'XkbGetPerClientControls'               ,\
        libx11.XkbGetState,                       'XkbGetState'                           ,\
        libx11.XkbGetUpdatedMap,                  'XkbGetUpdatedMap'                      ,\
        libx11.XkbGetVirtualMods,                 'XkbGetVirtualMods'                     ,\
        libx11.XkbGetXlibControls,                'XkbGetXlibControls'                    ,\
        libx11.XkbIgnoreExtension,                'XkbIgnoreExtension'                    ,\
        libx11.XkbInitCanonicalKeyTypes,          'XkbInitCanonicalKeyTypes'              ,\
        libx11.XkbKeyTypesForCoreSymbols,         'XkbKeyTypesForCoreSymbols'             ,\
        libx11.XkbKeycodeToKeysym,                'XkbKeycodeToKeysym'                    ,\
        libx11.XkbKeysymToModifiers,              'XkbKeysymToModifiers'                  ,\
        libx11.XkbLatchGroup,                     'XkbLatchGroup'                         ,\
        libx11.XkbLatchModifiers,                 'XkbLatchModifiers'                     ,\
        libx11.XkbLibraryVersion,                 'XkbLibraryVersion'                     ,\
        libx11.XkbListComponents,                 'XkbListComponents'                     ,\
        libx11.XkbLockGroup,                      'XkbLockGroup'                          ,\
        libx11.XkbLockModifiers,                  'XkbLockModifiers'                      ,\
        libx11.XkbLookupKeyBinding,               'XkbLookupKeyBinding'                   ,\
        libx11.XkbLookupKeySym,                   'XkbLookupKeySym'                       ,\
        libx11.XkbNoteControlsChanges,            'XkbNoteControlsChanges'                ,\
        libx11.XkbNoteDeviceChanges,              'XkbNoteDeviceChanges'                  ,\
        libx11.XkbNoteMapChanges,                 'XkbNoteMapChanges'                     ,\
        libx11.XkbNoteNameChanges,                'XkbNoteNameChanges'                    ,\
        libx11.XkbOpenDisplay,                    'XkbOpenDisplay'                        ,\
        libx11.XkbQueryExtension,                 'XkbQueryExtension'                     ,\
        libx11.XkbRefreshKeyboardMapping,         'XkbRefreshKeyboardMapping'             ,\
        libx11.XkbResizeDeviceButtonActions,      'XkbResizeDeviceButtonActions'          ,\
        libx11.XkbResizeKeyActions,               'XkbResizeKeyActions'                   ,\
        libx11.XkbResizeKeySyms,                  'XkbResizeKeySyms'                      ,\
        libx11.XkbResizeKeyType,                  'XkbResizeKeyType'                      ,\
        libx11.XkbSelectEventDetails,             'XkbSelectEventDetails'                 ,\
        libx11.XkbSelectEvents,                   'XkbSelectEvents'                       ,\
        libx11.XkbSetAtomFuncs,                   'XkbSetAtomFuncs'                       ,\
        libx11.XkbSetAutoRepeatRate,              'XkbSetAutoRepeatRate'                  ,\
        libx11.XkbSetAutoResetControls,           'XkbSetAutoResetControls'               ,\
        libx11.XkbSetCompatMap,                   'XkbSetCompatMap'                       ,\
        libx11.XkbSetControls,                    'XkbSetControls'                        ,\
        libx11.XkbSetDebuggingFlags,              'XkbSetDebuggingFlags'                  ,\
        libx11.XkbSetDetectableAutoRepeat,        'XkbSetDetectableAutoRepeat'            ,\
        libx11.XkbSetDeviceButtonActions,         'XkbSetDeviceButtonActions'             ,\
        libx11.XkbSetDeviceInfo,                  'XkbSetDeviceInfo'                      ,\
        libx11.XkbSetDeviceLedInfo,               'XkbSetDeviceLedInfo'                   ,\
        libx11.XkbSetGeometry,                    'XkbSetGeometry'                        ,\
        libx11.XkbSetIgnoreLockMods,              'XkbSetIgnoreLockMods'                  ,\
        libx11.XkbSetIndicatorMap,                'XkbSetIndicatorMap'                    ,\
        libx11.XkbSetMap,                         'XkbSetMap'                             ,\
        libx11.XkbSetNamedDeviceIndicator,        'XkbSetNamedDeviceIndicator'            ,\
        libx11.XkbSetNamedIndicator,              'XkbSetNamedIndicator'                  ,\
        libx11.XkbSetNames,                       'XkbSetNames'                           ,\
        libx11.XkbSetPerClientControls,           'XkbSetPerClientControls'               ,\
        libx11.XkbSetServerInternalMods,          'XkbSetServerInternalMods'              ,\
        libx11.XkbSetXlibControls,                'XkbSetXlibControls'                    ,\
        libx11.XkbToControl,                      'XkbToControl'                          ,\
        libx11.XkbTranslateKey,                   'XkbTranslateKey'                       ,\
        libx11.XkbTranslateKeyCode,               'XkbTranslateKeyCode'                   ,\
        libx11.XkbTranslateKeySym,                'XkbTranslateKeySym'                    ,\
        libx11.XkbUpdateActionVirtualMods,        'XkbUpdateActionVirtualMods'            ,\
        libx11.XkbUpdateKeyTypeVirtualMods,       'XkbUpdateKeyTypeVirtualMods'           ,\
        libx11.XkbUpdateMapFromCore,              'XkbUpdateMapFromCore'                  ,\
        libx11.XkbUseExtension,                   'XkbUseExtension'                       ,\
        libx11.XkbVirtualModsToReal,              'XkbVirtualModsToReal'                  ,\
        libx11.XkbXlibControlsImplemented,        'XkbXlibControlsImplemented'            ,\
        libx11.XmbDrawImageString,                'XmbDrawImageString'                    ,\
        libx11.XmbDrawString,                     'XmbDrawString'                         ,\
        libx11.XmbDrawText,                       'XmbDrawText'                           ,\
        libx11.XmbLookupString,                   'XmbLookupString'                       ,\
        libx11.XmbResetIC,                        'XmbResetIC'                            ,\
        libx11.XmbSetWMProperties,                'XmbSetWMProperties'                    ,\
        libx11.XmbTextEscapement,                 'XmbTextEscapement'                     ,\
        libx11.XmbTextExtents,                    'XmbTextExtents'                        ,\
        libx11.XmbTextListToTextProperty,         'XmbTextListToTextProperty'             ,\
        libx11.XmbTextPerCharExtents,             'XmbTextPerCharExtents'                 ,\
        libx11.XmbTextPropertyToTextList,         'XmbTextPropertyToTextList'             ,\
        libx11.Xpermalloc,                        'Xpermalloc'                            ,\
        libx11.XrmCombineDatabase,                'XrmCombineDatabase'                    ,\
        libx11.XrmCombineFileDatabase,            'XrmCombineFileDatabase'                ,\
        libx11.XrmDestroyDatabase,                'XrmDestroyDatabase'                    ,\
        libx11.XrmEnumerateDatabase,              'XrmEnumerateDatabase'                  ,\
        libx11.XrmGetDatabase,                    'XrmGetDatabase'                        ,\
        libx11.XrmGetFileDatabase,                'XrmGetFileDatabase'                    ,\
        libx11.XrmGetResource,                    'XrmGetResource'                        ,\
        libx11.XrmGetStringDatabase,              'XrmGetStringDatabase'                  ,\
        libx11.XrmInitialize,                     'XrmInitialize'                         ,\
        libx11.XrmLocaleOfDatabase,               'XrmLocaleOfDatabase'                   ,\
        libx11.XrmMergeDatabases,                 'XrmMergeDatabases'                     ,\
        libx11.XrmParseCommand,                   'XrmParseCommand'                       ,\
        libx11.XrmPermStringToQuark,              'XrmPermStringToQuark'                  ,\
        libx11.XrmPutFileDatabase,                'XrmPutFileDatabase'                    ,\
        libx11.XrmPutLineResource,                'XrmPutLineResource'                    ,\
        libx11.XrmPutResource,                    'XrmPutResource'                        ,\
        libx11.XrmPutStringResource,              'XrmPutStringResource'                  ,\
        libx11.XrmQGetResource,                   'XrmQGetResource'                       ,\
        libx11.XrmQGetSearchList,                 'XrmQGetSearchList'                     ,\
        libx11.XrmQGetSearchResource,             'XrmQGetSearchResource'                 ,\
        libx11.XrmQPutResource,                   'XrmQPutResource'                       ,\
        libx11.XrmQPutStringResource,             'XrmQPutStringResource'                 ,\
        libx11.XrmQuarkToString,                  'XrmQuarkToString'                      ,\
        libx11.XrmSetDatabase,                    'XrmSetDatabase'                        ,\
        libx11.XrmStringToBindingQuarkList,       'XrmStringToBindingQuarkList'           ,\
        libx11.XrmStringToQuark,                  'XrmStringToQuark'                      ,\
        libx11.XrmStringToQuarkList,              'XrmStringToQuarkList'                  ,\
        libx11.XrmUniqueQuark,                    'XrmUniqueQuark'                        ,\
        libx11.Xutf8DrawImageString,              'Xutf8DrawImageString'                  ,\
        libx11.Xutf8DrawString,                   'Xutf8DrawString'                       ,\
        libx11.Xutf8DrawText,                     'Xutf8DrawText'                         ,\
        libx11.Xutf8LookupString,                 'Xutf8LookupString'                     ,\
        libx11.Xutf8ResetIC,                      'Xutf8ResetIC'                          ,\
        libx11.Xutf8SetWMProperties,              'Xutf8SetWMProperties'                  ,\
        libx11.Xutf8TextEscapement,               'Xutf8TextEscapement'                   ,\
        libx11.Xutf8TextExtents,                  'Xutf8TextExtents'                      ,\
        libx11.Xutf8TextListToTextProperty,       'Xutf8TextListToTextProperty'           ,\
        libx11.Xutf8TextPerCharExtents,           'Xutf8TextPerCharExtents'               ,\
        libx11.Xutf8TextPropertyToTextList,       'Xutf8TextPropertyToTextList'           ,\
        libx11.XwcDrawImageString,                'XwcDrawImageString'                    ,\
        libx11.XwcDrawString,                     'XwcDrawString'                         ,\
        libx11.XwcDrawText,                       'XwcDrawText'                           ,\
        libx11.XwcFreeStringList,                 'XwcFreeStringList'                     ,\
        libx11.XwcLookupString,                   'XwcLookupString'                       ,\
        libx11.XwcResetIC,                        'XwcResetIC'                            ,\
        libx11.XwcTextEscapement,                 'XwcTextEscapement'                     ,\
        libx11.XwcTextExtents,                    'XwcTextExtents'                        ,\
        libx11.XwcTextListToTextProperty,         'XwcTextListToTextProperty'             ,\
        libx11.XwcTextPerCharExtents,             'XwcTextPerCharExtents'                 ,\
        libx11.XwcTextPropertyToTextList,         'XwcTextPropertyToTextList'             ,\
        libx11.XUniqueContext,                    'XUniqueContext'    


It is only prototype of update (I compile example in windows environment where exists "include" variable & runned in linux (currently MINT MATE 19.2 x32 in VM).

I hope that libc will never take place in fasm standard linux api (there is no place for C lang stuff in assembly headers).

offtop: "Oh how I wish to say thanks in form of ubnormal matural lexic to author of elf dinamics technology and interpreeters. Why. Why dont split names from different librarys, why messed everything".

shortened (cutted off all content except described ones at this topic) to variant that compiled at windows - https://yadi.sk/d/8xBq7G_nLVE9Rw

(changing macros import32.inc and adding headers for xlib11 would be enoght for version shift)

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.


Last edited by ProMiNick on 11 Jun 2020, 20:36; edited 1 time in total
Post 03 Jun 2020, 07:41
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 03 Jun 2020, 08:08
I am generally no longer adding any new headers/examples to the classic fasm 1 packages, because I am not able to dedicate much attention to maintain them all. My hope was that community (on the forums) could take over and make more robust supplementary packages, although there were various problems with it.
Therefore this forum is right now the main official place for third-party material like this (even the Examples section just points here nowadays).
ProMiNick wrote:
I hope that libc will never take place in fasm standard linux api (there is no place for C lang stuff in assembly headers).
I don't understand why would you consider use of libc wrong when you are already using libx11. Both are just libraries of functions that you could implement yourself (if stubborn enough), but simply do not have to. I've been using libc malloc in fasmg (even though now I also have my own implementation as an alternative) and I see it as perfectly normal thing to do.
Post 03 Jun 2020, 08:08
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 03 Jun 2020, 09:08
make more robust supplementary packages - I already maintain fasmpack (linux GUI is already there - but only in mine offline variant). Yes, it is never in release state (even versions I share to Internet, they worked, but not everything in them worked), it always contains unfinished|unconsistent parts, but it always evolves.

Tomasz Grysztar wrote:
I don't understand why would you consider use of libc wrong when you are already using libx11
Actualy that was my 1st linux app (that I not simply compiled from examples, but adapt some code to my package with introducing elements that never presented in it and bring it to state when it became successfuly compiled & executed), because of it I have to use libx11. (before compile it I only exlpore in disassembler xlib_test from fresh & xlib compiled from C sources - not very large expirience of elf-linux internals). I hope in some future I could canceled from libx11 usage too.

I hope provide for newbies something convinient...
target is to extend fasm codebase (actualy it common codebase of fasm & fasmg due to simplicity of porting). that codebase is headers exactly, and examples of such headers usage.

(one more secret reasons why xlib)
by the way x11 present on androids, and all x86 related stuff I placed in x86 subdirs assuming that in future could be added ARM related stuff placed in ARM subdirs
(maybe I provide in fasmpack patches for fasmarm for elf-android described in another topic) & repeat above demo in android. But I still dont believe that elves launched on unrooted devices, so I going to provide compilable sources, but I not going to test will they work or not.

And in IOS x11 present too... but macho64 less supported by fasmg, and for macho32 no realization of ARM32 opcodeset. (but fasmg macho32 formatter realization via macros could be reproduced in fasm raw binary with all fasmarm instruction stuff). (I like android as user, but I not interested in programming for android at all, and I interested in assembly programming targeted to IOS - we far far from time it could be possible).

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 03 Jun 2020, 09:08
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 03 Jun 2020, 15:59
ProMiNick wrote:
but macho64 less supported by fasmg
Both 64-bit and 32-bit variants of Mach-O have been supported equally. Have you experienced any specific bugs with 64-bit?

I recall there was something peculiar about how linker adjusted call offsets on the machine I used for testing. It might have been actually a linker bug and thus I may have needlessly implemented an incorrect relocation generator to work around it. But that would only be a matter of correcting these few lines in "dword?" macro.
Post 03 Jun 2020, 15:59
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 03 Jun 2020, 17:01
I dont tested macho outputs.
from all formats macho newest and less explored by my opinion.
And as I remember using of libraries in macho64 had a problem in past and walkaround solution exists only for 32 bit.
Post 03 Jun 2020, 17:01
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 03 Jun 2020, 17:12
That thread has an example of 64-bit object files that were successfully linked and executed on a machine that I had shared with me for testing. If they do not work on some other machine, that might indicate that adjustments I had to make for the linker on my test machine were not correct (it might have even been a linker bug, as I mentioned). That would be easy to fix (as I said, just adjust the special handling of CPU_TYPE_X86_64 in "dword?" macro), but I currently have no reliable report of such problem nor access to a machine that would demonstrate it.
Post 03 Jun 2020, 17:12
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 353
Location: Poland
macgub 03 Jun 2020, 20:37
So, I don,t need to have an external linker to acces X from Fasm. Thanks ProMiNick for your example Exclamation
Post 03 Jun 2020, 20:37
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 04 Jun 2020, 04:33
That thanks originaly to JohnFound.
This code (with brilliant syntax against syntax among other fresh code) - is made by him. I only adapt couple of macroses.
Post 04 Jun 2020, 04:33
View user's profile Send private message Send e-mail Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 817
Location: Russian Federation, Sochi
ProMiNick 11 Jun 2020, 20:35
That is what thou thought (x64 Xlib GUI)
examples/template/x64/template.asm
Code:
format ELF64 executable 3
entry start

include 'linux/x64.inc'

interpreter '/lib64/ld-linux-x86-64.so.2'
needed 'libX11.so.6'

include 'os_specs/linux/api/x86/libx11.inc'

segment readable executable
start:
        sub     esp,8
        xor     edi,edi
        cinvoke libx11.XOpenDisplay;, rdi
        or      rax, rax
        jz      .failXserver
        mov     [hdisplay], rax
        mov     edi, [rax+XDISPLAY.default_screen]
        shl     edi, bsf sizeof.XSCREEN ; because sizeof.XSCREEN is power of 2
        add     rdi, [rax+XDISPLAY.screens]
        cinvoke libx11.XCreateSimpleWindow, rax, [rdi+XSCREEN.root], 10, 20, 400, 200, 0, [rdi+XSCREEN.black_pixel], [rdi+XSCREEN.white_pixel]
        or      rax, rax
        jz      .failCreateWindow
        mov     [hwnd], rax
        cinvoke libx11.XSelectInput, [hdisplay], rax, 0;$8001
        cinvoke libx11.XStoreName, [hdisplay], [hwnd], _title
        ;cinvoke libx11.XMapWindow, [hdisplay], [hwnd]
        cinvoke libx11.XMapRaised, [hdisplay], [hwnd]
        or      rax, rax
        jz      .failShow
        cinvoke libx11.XCreateGC, [hdisplay], [hwnd], 0, 0
        mov     [hGC], rax
        cinvoke libx11.XSetForeground, [hdisplay], [hGC], $000000
        cinvoke libx11.XSetBackground, [hdisplay], [hGC], $ffffff
.msg_pump:
        cinvoke libx11.XNextEvent, [hdisplay], event
        jmp     .msg_pump
        call    Xshutdown
.failShow:
.failCreateWindow:
.failXserver:
        mov     [con_handle],2
        mov     esi,_error
        call    display_string
        mov     al,-1
exit_program:
        movzx   edi,al
        lcall   sys_exit,edi
Xshutdown:
        cinvoke libx11.XFreeGC, [hdisplay], [hGC]
        cinvoke libx11.XDestroyWindow, [hwnd], [hdisplay]
        cinvoke libx11.XSetErrorHandler, [oError]
        xor     eax, eax
        retn

display_string:
        mov     rdi,rsi
        or      ecx,-1
        xor     al,al
        repne   scasb
        neg     ecx
        sub     ecx,2
        lcall   sys_write,[con_handle],rsi,rcx
        retn

segment readable writeable
        _title TCHAR 'Linux64 Xlib GUI program template',0
        _error TCHAR 'Startup failed.',0
        con_handle      dd 0
        oError          dd 0
        hGC             dq 0
        hwnd            dq 0
        hdisplay        dq 0
        event           rb $C0     
what will needed
Code:
-includes
 +--formats
 |  +--elf
 |     +--equates
 |     |  +--equates.inc
 |     |  +--x86-64.inc
 |     +--macro
 |        +--import64.inc
 +--generic
 |  +--macro
 |     +--struct.inc
 +--linux
 |  +--x64.inc
 +--os_specs
    +--linux
    |  +--api
    |  |  +--x86
    |  |     +--libx11.inc
    |  +--equates
    |  |  +--libx11.inc
    |  |  +--syscalls
    |  |     +--x64.inc
    |  +--macro
    |  |  +--x86
    |  |     +--proc64.inc
    |  +--structs
    |     +--x64
    |        +--libx11.inc       


start with includes/linux/x64.inc
Code:
; Linux programming headers

;====== fundamental macros ======================
include '../generic/macro/struct.inc'
;====== OS specific macros ======================
include '../os_specs/linux/macro/x86/proc64.inc'
;====== file format specific macros =============
include '../formats/elf/macro/import64.inc'
;====== OS specific equates =====================
include '../os_specs/linux/equates/syscalls/x64.inc'
include '../os_specs/linux/equates/libx11.inc'
;====== file format specific macros =============
include '../formats/elf/equates/equates.inc'
include '../formats/elf/equates/x86-64.inc'
;====== OS specific structures ==================
include '../os_specs/linux/structs/x64/libx11.inc'    


includes/generic/macro/struct.inc - already known
includes/os_specs/linux/macro/x86/proc64.inc - discussed in [help needed]: libccall (x64 linux cinvoke)
in addition to libccall there are syscall64 (it partialy use same helper macros as libccall)
Code:
; Macroinstructions for defining and calling procedures (x64 version)

macro invoke proc,[arg] { common libccall [proc],arg }

macro detect@argsize size, definition {
        local opcode,origin
        size = 0
        if definition eqtype 0 | definition eqtype 0f | type@param eq addr
                size = 8
        else if definition eqtype byte 0 | definition eqtype byte 0f
                match prefix value,definition \{
                        if prefix eq qword
                                size = 8
                        else if prefix eq dword
                                size = 4
                        else if prefix eq word
                                size = 2
                        else if prefix eq byte
                                size = 1
                        end if \}
        else if ~ definition in <xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15>
                virtual
                        origin = $
                        inc     definition
                        load opcode byte from origin
                        if opcode = 67h | opcode = 41h
                                load opcode byte from origin+1
                        end if
                        if opcode and 0F8h = 48h
                                size = 8
                        else if opcode = 66h
                                size = 2
                        else if opcode = 0FFh
                                size = 4
                        else
                                size = 1
                        end if
                end virtual
        end if }

macro __mov reg,src,regd,regw,regb,regxmm {
        define type@param
        define definition@param src
        match =float value,definition@param \{
                define definition@param value
                define type@param float \}
        match =addr value,definition@param \{
                define definition@param value
                define type@param addr \}
        detect@argsize size@param,definition@param
        if type@param eq float
                if ~ definition@param eq regxmm
                        if size@param = 4
                                if definition@param eqtype byte 0 | definition@param eqtype byte 0f
                                        mov eax,definition@param
                                        movd regxmm,eax
                                else
                                        movd regxmm,definition@param
                                end if
                        else
                                if definition@param eqtype 0 | definition@param eqtype 0f | definition@param eqtype byte 0 | definition@param eqtype byte 0f
                                        mov rax,definition@param
                                        movq regxmm,rax
                                else
                                        movq regxmm,definition@param
                                end if
                        end if
                end if
                if vararg@fastcall & ~ definition@param eq reg
                        movq reg,regxmm
                end if
        else if type@param eq addr
                if ~ definition@param eq reg
                        lea reg,[definition@param]
                end if
        else if size@param = 8
                if ~ definition@param eq reg
                        mov reg,definition@param
                end if
        else if size@param = 4
                if ~ definition@param eq regd
                        mov regd,definition@param
                end if
        else if size@param = 2
                if ~ definition@param eq regw
                        mov regw,definition@param
                end if
        else if size@param = 1
                if ~ definition@param eq regb
                        mov regb,definition@param
                end if
        end if }

macro __push value,offs{
        define type@param
        define definition@param value
        match =float value,definition@param \{
                define definition@param value
                define type@param float \}
        match =addr value,definition@param \{
                define definition@param value
                define type@param addr \}
        detect@argsize size@param,definition@param
        if type@param eq addr
                lea rax,[definition@param]
                mov [rsp+offs],rax
        else if definition@param eqtype [0] | definition@param eqtype byte [0]
                if size@param = 8
                        mov rax,definition@param
                        mov [rsp+offs],rax
                else if size@param = 4
                        mov eax,definition@param
                        mov [rsp+offs],eax
                else if size@param = 2
                        mov ax,definition@param
                        mov [rsp+offs],ax
                else
                        mov al,definition@param
                        mov [rsp+offs],al
                end if
        else if size@param = 8
                virtual
                        origin = $
                        mov rax,definition@param
                        load opcode byte from origin+1
                end virtual
                if opcode = 0B8h
                        mov rax,definition@param
                        mov [rsp+offs],rax
                else
                        mov qword [rsp+offs],definition@param
                end if
        else if definition@param in <xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15>
                movq [rsp+offs],definition@param
        else
                mov [rsp+offs],definition@param
        end if

}

macro fastcall proc,torcx:rcx,tordx:rdx,tor8:r8,tor9:r9,[arg] {
 common local stackspace,argscount,counter
        counter = 4*8
        if defined current@frame
                if current@frame<stackspace
                        current@frame = stackspace
                end if
        else
                sub rsp,stackspace
        end if
        if ~ arg eq
 forward
                counter = counter + 8
 common
        end if
        stackspace = counter + counter and 8
        if ~ arg eq
                counter = 8
 reverse
                __push arg,stackspace-counter
                counter = counter + 8
 common
        end if
        __mov r9,tor9,r9d,r9w,r9b,xmm3
        __mov r8,tor8,r8d,r8w,r8b,xmm2
        __mov rdx,tordx,edx,dx,dl,xmm1
        __mov rcx,torcx,ecx,cx,cl,xmm0
        call proc
        if stackspace & ~defined current@frame
                add rsp,stackspace
        end if }

macro libccall proc,tordi:rdi,torsi:rsi,torcx:rcx,tordx:rdx,tor8:r8,tor9:r9,[arg] {
 common local stackspace,counter
        counter = 6*8
        if defined current@frame
                if current@frame<stackspace
                        current@frame = stackspace
                end if
        else
                sub rsp,stackspace
        end if
        if ~ arg eq
 forward
                counter = counter + 8
 common
        end if
        stackspace = counter + counter and 8
        if ~ arg eq
                counter = 8
 reverse
                __push arg,stackspace-counter
                counter = counter + 8
 common
        end if
        __mov r9,tor9,r9d,r9w,r9b,xmm5
        __mov r8,tor8,r8d,r8w,r8b,xmm4
        __mov rdx,tordx,edx,dx,dl,xmm3
        __mov rcx,torcx,ecx,cx,cl,xmm2
        __mov rsi,torsi,esi,si,sil,xmm1
        __mov rdi,tordi,edi,di,dil,xmm0
        call proc
        if stackspace & ~defined current@frame
                add rsp,stackspace
        end if }

macro lcall proc_num,tordi:rdi,torsi:rsi,torcx:rcx,tordx:rdx,tor8:r8,tor9:r9 {
        __mov r9,tor9,r9d,r9w,r9b,xmm5
        __mov r8,tor8,r8d,r8w,r8b,xmm4
        __mov rdx,tordx,edx,dx,dl,xmm3
        __mov rcx,torcx,ecx,cx,cl,xmm2
        __mov rsi,torsi,esi,si,sil,xmm1
        __mov rdi,tordi,edi,di,dil,xmm0
        mov     eax,proc_num
        syscall }

macro proc [args]
 { common
    match name params, args>
    \{ define@proc name,<params \} }

prologue@proc equ prologuedef

macro prologuedef procname,flag,parmbytes,localbytes,reglist
 { local loc,fill,counter
   loc = (localbytes+15) and (not 15)
   parmbase@proc equ rbp+16
   localbase@proc equ rbp-loc
   push rbp
   mov rbp,rsp
   if loc+fill
    sub rsp,loc+fill
   end if
   counter = 0
   irps reg, reglist \{ push reg
                        counter = counter+1 \}
   fill = 8*(counter and 1) }

epilogue@proc equ epiloguedef

macro epiloguedef procname,flag,parmbytes,localbytes,reglist
 { irps reg, reglist \{ reverse pop reg \}
   leave
   retn }

close@proc equ

macro define@proc name,statement
 { local params,flag,regs,parmbytes,localbytes,current
   if used name
   name:
   match =stdcall args, statement \{ params equ args
                                     flag = 11b \}
   match =stdcall, statement \{ params equ
                                flag = 11b \}
   match =c args, statement \{ params equ args
                               flag = 10001b \}
   match =c, statement \{ params equ
                          flag = 10001b \}
   match =params, params \{ params equ statement
                            flag = 10000b \}
   match =uses reglist=,args, params \{ regs equ reglist
                                        params equ args \}
   match =regs =uses reglist, regs params \{ regs equ reglist
                                             params equ \}
   match =regs, regs \{ regs equ \}
   match prologue:reglist, prologue@proc:<regs> \{ prologue name,flag,parmbytes,localbytes,reglist \}
   virtual at parmbase@proc
   match =,args, params \{ defargs@proc args \}
   match =args@proc args, args@proc params \{ defargs@proc args \}
   parmbytes = $-(parmbase@proc)
   end virtual
   name # % = parmbytes/8
   all@vars equ
   current = 0
   macro locals
   \{ virtual at localbase@proc+current
      macro label def \\{ match . type,def> \\\{ deflocal@proc .,label,<type \\\} \\}
      struc db [val] \\{ \common deflocal@proc .,db,val \\}
      struc du [val] \\{ \common deflocal@proc .,du,val \\}
      struc dw [val] \\{ \common deflocal@proc .,dw,val \\}
      struc dp [val] \\{ \common deflocal@proc .,dp,val \\}
      struc dd [val] \\{ \common deflocal@proc .,dd,val \\}
      struc dt [val] \\{ \common deflocal@proc .,dt,val \\}
      struc dq [val] \\{ \common deflocal@proc .,dq,val \\}
      struc rb cnt \\{ deflocal@proc .,rb cnt, \\}
      struc rw cnt \\{ deflocal@proc .,rw cnt, \\}
      struc rp cnt \\{ deflocal@proc .,rp cnt, \\}
      struc rd cnt \\{ deflocal@proc .,rd cnt, \\}
      struc rt cnt \\{ deflocal@proc .,rt cnt, \\}
      struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \}
   macro endl
   \{ purge label
      restruc db,du,dw,dp,dd,dt,dq
      restruc rb,rw,rp,rd,rt,rq
      current = $-(localbase@proc)
      end virtual \}
   macro ret operand
   \{ match any, operand \\{ retn operand \\}
      match , operand \\{ match epilogue:reglist, epilogue@proc:<regs> \\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \}
   macro finish@proc
   \{ localbytes = current
      match close:reglist, close@proc:<regs> \\{ close name,flag,parmbytes,localbytes,reglist \\}
      end if \} }

macro defargs@proc [arg]
 { common
    if ~ arg eq
   forward
     local ..arg,current@arg
     match argname:type, arg
      \{ current@arg equ argname
         label ..arg type
         argname equ ..arg
         if qqword eq type
           dq ?,?,?,?
         else if dqword eq type
           dq ?,?
         else if tbyte eq type
           dq ?,?
         else
           dq ?
         end if \}
     match =current@arg,current@arg
      \{ current@arg equ arg
         arg equ ..arg
         ..arg dq ? \}
   common
     args@proc equ current@arg
   forward
     restore current@arg
   common
    end if }

macro deflocal@proc name,def,[val] { name def val }

macro deflocal@proc name,def,[val]
 { common
    match vars, all@vars \{ all@vars equ all@vars, \}
    all@vars equ all@vars name
   forward
    local ..var,..tmp
    ..var def val
    match =?, val \{ ..tmp equ \}
    match any =?, val \{ ..tmp equ \}
    match any (=?), val \{ ..tmp equ \}
    match =label, def \{ ..tmp equ \}
    match tmp : value, ..tmp : val
     \{ tmp: end virtual
        initlocal@proc ..var,def value
        virtual at tmp\}
   common
    match first rest, ..var, \{ name equ first \} }

struc label type { label . type }

macro initlocal@proc name,def
 { virtual at name
    def
    size@initlocal = $ - name
   end virtual
   position@initlocal = 0
   while size@initlocal > position@initlocal
    virtual at name
     def
     if size@initlocal - position@initlocal < 2
      current@initlocal = 1
      load byte@initlocal byte from name+position@initlocal
     else if size@initlocal - position@initlocal < 4
      current@initlocal = 2
      load word@initlocal word from name+position@initlocal
     else if size@initlocal - position@initlocal < 8
      current@initlocal = 4
      load dword@initlocal dword from name+position@initlocal
     else
      load qword@initlocal qword from name+position@initlocal
      if ( qword@initlocal > 0 & qword@initlocal < 80000000h ) | ( qword@initlocal < 0 & qword@initlocal >= -80000000h )
       current@initlocal = 8
      else
       current@initlocal = 4
       dword@initlocal = qword@initlocal and 0FFFFFFFFh
      end if
     end if
    end virtual
    if current@initlocal = 1
     mov byte [name+position@initlocal],byte@initlocal
    else if current@initlocal = 2
     mov word [name+position@initlocal],word@initlocal
    else if current@initlocal = 4
     mov dword [name+position@initlocal],dword@initlocal
    else
     mov qword [name+position@initlocal],qword@initlocal
    end if
    position@initlocal = position@initlocal + current@initlocal
   end while }

macro endp
 { purge ret,locals,endl
   finish@proc
   purge finish@proc
   restore regs@proc
   match all,args@proc \{ restore all \}
   restore args@proc
   match all,all@vars \{ restore all \} }

macro local [var]
 { common
    locals
   forward done@local equ
    match varname[count]:vartype, var
    \{ match =BYTE, vartype \\{ varname rb count
                                restore done@local \\}
       match =WORD, vartype \\{ varname rw count
                                restore done@local \\}
       match =DWORD, vartype \\{ varname rd count
                                 restore done@local \\}
       match =PWORD, vartype \\{ varname rp count
                                 restore done@local \\}
       match =QWORD, vartype \\{ varname rq count
                                 restore done@local \\}
       match =TBYTE, vartype \\{ varname rt count
                                 restore done@local \\}
       match =DQWORD, vartype \\{ label varname dqword
                                  rq count*2
                                  restore done@local \\}
       match =QQWORD, vartype \\{ label varname qqword
                                  rq count*4
                                  restore done@local \\}
       match =XWORD, vartype \\{ label varname xword
                                 rq count*2
                                 restore done@local \\}
       match =YWORD, vartype \\{ label varname yword
                                 rq count*4
                                 restore done@local \\}
       match , done@local \\{ virtual
                               varname vartype
                              end virtual
                              rb count*sizeof.\#vartype
                              restore done@local \\} \}
    match :varname:vartype, done@local:var
    \{ match =BYTE, vartype \\{ varname db ?
                                restore done@local \\}
       match =WORD, vartype \\{ varname dw ?
                                restore done@local \\}
       match =DWORD, vartype \\{ varname dd ?
                                 restore done@local \\}
       match =PWORD, vartype \\{ varname dp ?
                                 restore done@local \\}
       match =QWORD, vartype \\{ varname dq ?
                                 restore done@local \\}
       match =TBYTE, vartype \\{ varname dt ?
                                 restore done@local \\}
       match =DQWORD, vartype \\{ label varname dqword
                                  dq ?,?
                                  restore done@local \\}
       match =QQWORD, vartype \\{ label varname qqword
                                  dq ?,?,?,?
                                  restore done@local \\}
       match =XWORD, vartype \\{ label varname xword
                                 dq ?,?
                                 restore done@local \\}
       match =YWORD, vartype \\{ label varname yword
                                 dq ?,?,?,?
                                 restore done@local \\}
       match , done@local \\{ varname vartype
                              restore done@local \\} \}
    match ,done@local
    \{ var
       restore done@local \}
   common
    endl }

macro frame
 { local size,current
   if size
    sub rsp,size
   end if
   current = 0
   current@frame equ current
   size@frame equ size }

macro endf
 { size@frame = current@frame
   if size@frame
    add rsp,size@frame
   end if
   restore size@frame,current@frame }

macro static_rsp_prologue procname,flag,parmbytes,localbytes,reglist
 { local counter,loc,frame,current 
   counter = 0 
   irps reg, reglist \{ push reg 
                        counter = counter+1 \} 
   loc = (localbytes+7) and (not 7) 
   if frame & (counter+loc shr 3+1) and 1 
    loc = loc + 8 
   end if 
   framebytes@proc equ frame+loc 
   if framebytes@proc 
    sub rsp,framebytes@proc 
   end if 
   localbase@proc equ rsp+frame 
   regsbase@proc equ rsp+frame+loc 
   parmbase@proc equ rsp+frame+loc+counter*8+8 
   current = 0 
   current@frame equ current 
   size@frame equ frame } 

macro static_rsp_epilogue procname,flag,parmbytes,localbytes,reglist 
 { if framebytes@proc 
    add rsp,framebytes@proc 
   end if 
   irps reg, reglist \{ reverse pop reg \} 
   retn } 

macro static_rsp_close procname,flag,parmbytes,localbytes,reglist 
 { size@frame = current@frame 
   restore size@frame,current@frame }

stdcall fix fastcall

macro cinvoke proc,[arg]
 { common ccall [proc],arg }

macro ccall proc,[arg]
 { common vararg@fastcall = 1
          libccall proc,arg
          vararg@fastcall = 0 }

vararg@fastcall = 0    


includes/formats/elf/macro/import64.inc (x64 port of 32 bit one):
Code:
macro Elf64_Sym name,value,size,bind,type,other,shndx {
        dd name+0
        db bind+0 + type+0
        db other+0
        dw shndx+0
        dq value+0
        dq size+0  }

virtual at 0
 Elf64_Sym
 sizeof.Elf64_Sym = $
end virtual

macro Elf64_Rel offset,symbol,type
{
  dq offset+0
  dq (symbol+0) shl 32 + (type+0)
}

virtual at 0
 Elf64_Rel
 sizeof.Elf64_Rel = $
end virtual

macro Elf64_Rela offset,symbol,type,addend
{
  dq offset+0
  dq (symbol+0) shl 32 + (type+0)
  dq addend+0
}

virtual at 0
 Elf64_Rela
 sizeof.Elf64_Rela = $
end virtual

macro interpreter [library] {
        define interpreter@ library }

macro needed [library] {
 local str
 match needed,needed@dynamic \{ define needed@dynamic needed,str:library \}
 match ,needed@dynamic \{ define needed@dynamic str:library \} }

define needed@dynamic

macro import [name,string] {
 local str
 match import,import@strtab \{ define import@strtab import,str:name:string \}
 match ,import@strtab \{ define import@strtab str:name:string \} }

define import@strtab

postpone {
        match library,interpreter@ \{
                segment interpreter readable
                db library,0 \}
        match needed,needed@dynamic \{ match import,import@strtab \\{
                segment dynamic readable
                local strtab,strsz,symtab,rel,relsz,hash,counter
                irp item,needed \\\{
                        match str:library,item \\\\{
                                dq DT_NEEDED,str-strtab \\\\} \\\}
                dq DT_STRTAB,strtab
                dq DT_STRSZ,strsz
                dq DT_SYMTAB,symtab
                dq DT_SYMENT,sizeof.Elf64_Sym
                dq DT_REL,rel
                dq DT_RELSZ,relsz
                dq DT_RELENT,sizeof.Elf64_Rel
                dq DT_HASH,hash
                dq DT_NULL,0

                segment readable writeable
                symtab: Elf64_Sym
                counter = 1
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        Elf64_Sym fstr-strtab,0,0,STB_GLOBAL,STT_FUNC,0,0
                                end if \\\\} \\\}
                rel:
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        Elf64_Rel name,counter,R_X86_64_64
                                        counter = counter+1
                                end if \\\\} \\\}
                relsz = $-rel
                hash:
                dd 1,counter
                ;repeat bundlecounter
                        ;if %=bundlecounter
                                dd 0
                        ;else
                                ;dd %
                        ;end if
                ;end repeat
                repeat counter
                        if %=counter
                                dd 0
                        else
                                dd %
                        end if
                end repeat
                strtab:
                db '',0
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        fstr db string,0
                                end if \\\\} \\\}
                irp item,needed \\\{
                        match str:library,item \\\\{
                                str db library,0 \\\\} \\\}
                strsz = $-strtab
                irp item,import \\\{
                        match fstr:name:string,item \\\\{
                                if used name
                                        name dq 0
                                end if \\\\} \\\} \\} \} }    

includes/os_specs/linux/equates/syscalls/x86.inc (just for my own convinience):
Code:
sys_exit        = 60
sys_write       = 1     


includes/os_specs/linux/equates/libx11.inc (it is not final variant of X constant naming) - same as for 32bit version

includes/formats/elf/equates/equates.inc - same as for 32bit version

includes/formats/elf/equates/x86-64.inc:
Code:
; Relocation types
R_X86_64_NONE      = 0
R_X86_64_64        = 1
R_X86_64_PC32      = 2
R_X86_64_GOT32     = 3
R_X86_64_PLT32     = 4
R_X86_64_COPY      = 5
R_X86_64_GLOB_DAT  = 6
R_X86_64_JUMP_SLOT = 7
R_X86_64_RELATIVE  = 8
R_X86_64_GOTPCREL  = 9
R_X86_64_32        = 10
R_X86_64_32S       = 11
R_X86_64_16        = 12
R_X86_64_PC16      = 13
R_X86_64_8         = 14
R_X86_64_PC8       = 15
R_X86_64_DPTMOD64  = 16
R_X86_64_DTPOFF64  = 17
R_X86_64_TPOFF64   = 18
R_X86_64_TLSGD     = 19
R_X86_64_TLSLD     = 20
R_X86_64_DTPOFF32  = 21
R_X86_64_GOTTPOFF  = 22
R_X86_64_TPOFF32   = 23
R_X86_64_PC64      = 24
R_X86_64_GOTOFF64  = 25
R_X86_64_GOTPC32   = 26    


includes/os_specs/linux/structs/x64/libx11.inc:
Code:
; LIBX11.SO structures

struct XSCREEN
        ext_data                dq ?
       \display                 dq ?
        root                    dq ?
        width                   dd ?
        height                  dd ?
        mwidth                  dd ?
        mheight                 dd ?
        ndepths                 dd ?
                                dd ?
        depths                  dq ?
        root_depth              dd ?
                                dd ?
        root_visual             dq ?
        default_gc              dq ?
        cmap                    dq ?
        white_pixel             dq ?
        black_pixel             dq ?
        max_maps                dd ?
        min_maps                dd ?
        backing_store           dd ?
        save_unders             dd ?
        root_input_mask         dq ?
ends

struct XDISPLAY_CMS
        defaultCCCs             dq ?
        clientCmaps             dq ?
        perVisualIntensityMaps  dq ?
ends

struct XDISPLAY
        ext_data                dq ?
        free_funcs              dq ?
        fd                      dd ?
        conn_checker            dd ?
        proto_major_version     dd ?
        proto_minor_version     dd ?
        vendor                  dq ?
        resource_base           dq ?
        resource_mask           dq ?
        resource_id             dq ?
        resource_shift          dd ?
                                dd ?
        resource_alloc          dq ?
        byte_order              dd ?
        bitmap_unit             dd ?
        bitmap_pad              dd ?
        bitmap_bit_order        dd ?
        nformats                dd ?
                                dd ?
        pixmap_format           dq ?
        vnumber                 dd ?
        release                 dd ?
        head                    dq ?
        tail                    dq ?
        qlen                    dd ?
                                dd ?
        last_request_read       dq ?
        request                 dq ?
        last_req                dq ?
        buffer                  dq ?
        bufptr                  dq ?
        bufmax                  dq ?
        max_request_size        dd ?
                                dd ?
        database                dq ?
        synchandler             dq ?
        display_name            dq ?
        default_screen          dd ?
        nscreens                dd ?
        screens                 dq ?
        motion_buffer           dq ?
        flags                   dq ?
        min_keycode             dd ?
        max_keycode             dd ?
        keysyms                 dq ?
        modifiermap             dq ?
        keysyms_per_keycode     dd ?
                                dd ?
        xdefaults               dq ?
        scratch_buffer          dq ?
        scratch_length          dq ?
        ext_number              dd ?
                                dd ?
        ext_procs               dq ?
        event_vec               dq 128 dup (?)
        wire_vec                dq 128 dup (?)
        lock_meaning            dq ?
       \lock                    dq ?
        async_handlers          dq ?
        bigreq_size             dq ?
        lock_fns                dq ?
        idlist_alloc            dq ?
        key_bindings            dq ?
        cursor_font             dq ?
        atoms                   dq ?
        mode_switch             dd ?
        num_lock                dd ?
        context_db              dq ?
        error_vec               dq ?
        cms                     XDISPLAY_CMS
        im_filters              dq ?
        qfree                   dq ?
        next_event_serial_num   dq ?
        flushes                 dq ?
        im_fd_info              dq ?
        im_fd_length            dd ?
                                dd ?
        conn_watchers           dq ?
        watcher_count           dd ?
                                dd ?
        filedes                 dq ?
        savedsynchandler        dq ?
        resource_max            dq ?
        xcmisc_opcode           dd ?
                                dd ?
        xkb_info                dq ?
        trans_conn              dq ?
        xcb                     dq ?
        next_cookie             dd ?
                                dd ?
        generic_event_vec       dq 128 dup (?)
        generic_event_copy_vec  dq 128 dup (?)
        cookiejar               dq ?
ends

struct XAnyEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        window          dq ?
ends

struct XAnyExtEvent XAnyEvent
        root            dq ?
        subwindow       dq ?
        time            dq ?
        x               dd ?
        y               dd ?
        x_root          dd ?
        y_root          dd ?
ends

struct XButtonEvent XAnyExtEvent
        state           dd ?
        button          dd ?
        same_screen     dd ?
                        dd ?
ends

struct XKeyEvent XAnyExtEvent
        state           dd ?
        keycode         dd ?
        same_screen     dd ?
                        dd ?
ends

struct XMotionEvent XAnyExtEvent
        state           dd ?
        is_hint         db ?
                        db ?,?,?
        same_screen     dd ?
                        dd ?
ends

struct XCrossingEvent XAnyExtEvent
        mode            dd ?
        detail          dd ?
        same_screen     dd ?
        focus           dd ?
        state           dd ?
                        dd ?
ends

struct XFocusChangeEvent XAnyEvent
        mode      dd ?
        detail    dd ?
ends

struct XKeymapEvent XAnyEvent
        key_vector      rb 32
ends

struct XExposeEvent XAnyEvent
        x       dd ?
        y       dd ?
        width   dd ?
        height  dd ?
        count   dd ?
                dd ?
ends

struct XPropertyEvent XAnyEvent
        atom    dq ?
        time    dq ?
        state   dd ?
                dd ?
ends

struct XColormapEvent XAnyEvent
        colormap  dq ?
        new       dd ?
        state     dd ?
ends

struct XMappingEvent XAnyEvent
        request         dd ?
        first_keycode   dd ?
        count           dd ?
                        dd ?
ends

struct XSelectionClearEvent XAnyEvent
        selection       dq ?
        time            dq ?
ends

struct XVisibilityEvent XAnyEvent
        state   dd ?
                dd ?
ends

struct XClientMessageEvent XAnyEvent
        message_type    dq ?
       \format          dd ?
                        dd ?
       \data            rb 20
ends



struct XDestroyWindowEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        event           dq ?
        window          dq ?
ends

struct XCirculateEvent XDestroyWindowEvent
        place           dd ?
                        dd ?
ends

struct XMapEvent XDestroyWindowEvent
        override_redirect       dd ?
                                dd ?
ends

struct XUnmapEvent XDestroyWindowEvent
        from_configure  dd ?
                        dd ?
ends

struct XReparentEvent XDestroyWindowEvent
        parent                  dq ?
        x                       dd ?
        y                       dd ?
        override_redirect       dd ?
                                dd ?
ends

struct XGravityEvent XDestroyWindowEvent
        x                       dd ?
        y                       dd ?
ends

struct XConfigureEvent XGravityEvent
        width                   dd ?
        height                  dd ?
        border_width            dd ?
                                dd ?
        above                   dq ?
        override_redirect       dd ?
                                dd ?
ends

struct XMapRequestEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        parent          dq ?
        window          dq ?
ends

struct XCirculateRequestEvent XMapRequestEvent
        place   dd ?
                dd ?
ends

struct XConfigureRequestEvent XMapRequestEvent
        x               dd ?
        y               dd ?
        width           dd ?
        height          dd ?
        border_width    dd ?
                        dd ?
        above           dq ?
        detail          dd ?
                        dd ?
        value_mask      dq ?
ends

struct XCreateWindowEvent XMapRequestEvent
        x                       dd ?
        y                       dd ?
        width                   dd ?
        height                  dd ?
        border_width            dd ?
        override_redirect       dd ?
ends

struct XDrawEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        drawable        dq ?
ends

struct XGraphicsExposeEvent XDrawEvent
        x               dd ?
        y               dd ?
        width           dd ?
        height          dd ?
        count           dd ?
        major_code      dd ?
        minor_code      dd ?
                        dd ?
ends

struct XNoExposeEvent XDrawEvent
        major_code      dd ?
        minor_code      dd ?
ends

struct XSelectionEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        requestor       dq ?
        selection       dq ?
        target          dq ?
        property        dq ?
        time            dq ?
ends

struct XSelectionRequestEvent
        type            dd ?
                        dd ?
        serial          dq ?
        send_event      dd ?
                        dd ?
       \display         dq ?
        owner           dq ?
        requestor       dq ?
        selection       dq ?
        target          dq ?
        property        dq ?
        time            dq ?
ends

struct XResizeEvent
        type            dd ?
                        dd ?
        serial          dq ?
       \display         dq ?
        window          dq ?
        width           dd ?
        height          dd ?
ends

struct XErrorEvent
        type            dd ?
                        dd ?
       \display         dq ?
        resourceid      dq ?
        serial          dq ?
        error_code      db ?
        request_code    db ?
        minor_code      db ?
                        rb 5
ends


struct XKeyboardControl
        key_click_percent       dd ?
        bell_percent            dd ?
        bell_pitch              dd ?
        bell_duration           dd ?
        led                     dd ?
        led_mode                dd ?
        key                     dd ?
        auto_repeat_mode        dd ?
ends

struct XModifierKeymap
        max_keypermod   dd ?
        modifiermap     dd ?
ends


struct XWindowAttributes
        x                     dd  ?     ; location of window
        y                     dd  ?     ;
        width                 dd  ?     ; width and height of window
        height                dd  ?     ;
        border_width          dd  ?     ; border width of window
        depth                 dd  ?     ; depth of window
        pVisual               dd  ?     ; the associated visual structure
        root                  dd  ?     ; root of screen containing window
        class                 dd  ?     ; InputOutput, InputOnly
        bit_gravity           dd  ?     ; one of the bit gravity values
        win_gravity           dd  ?     ; one of the window gravity values
        backing_store         dd  ?     ; NotUseful, WhenMapped, Always
        backing_planes        dd  ?     ; planes to be preserved if possible
        backing_pixel         dd  ?     ; value to be used when restoring planes
        save_under            dd  ?     ; boolean, should bits under be saved?
        colormap              dd  ?     ; color map to be associated with window
        map_installed         dd  ?     ; boolean, is color map currently installed
        map_state             dd  ?     ; IsUnmapped, IsUnviewable, IsViewable
        all_event_masks       dd  ?    ; set of events all people have interest in
        your_event_mask       dd  ?          ; my event mask
        do_not_propagate_mask dd  ?    ; set of events that should not propagate
        override_redirect     dd  ?    ; boolean value for override-redirect
        pScreen               dd  ?  ; back pointer to correct screen
ends



struct XCharStruct
        lbearing   dw ?       ; origin to left edge of raster
        rbearing   dw ?       ; origin to right edge of raster
        width      dw ?       ; advance to next char's origin
        ascent     dw ?       ; baseline to top edge of raster
        descent    dw ?       ; baseline to bottom edge of raster
        attributes dw ?       ; per char flags (not predefined)
ends


struct XFontStruct
        ext_data          dd   ?       ; hook for extension to hang data
        fid               dd   ?       ; Font id for this font
        direction         dd   ?       ; hint about the direction font is painted
        min_char_or_byte2 dd   ?       ; first character
        max_char_or_byte2 dd   ?       ; last character
        min_byte1         dd   ?       ; first row that exists
        max_byte1         dd   ?       ; last row that exists
        all_chars_exist   dd   ?       ; flag if all characters have nonzero size
        default_char      dd   ?       ; char to print for undefined character
        n_properties      dd   ?       ; how many properties there are
        properties        dd   ?       ; pointer to array of additional properties
        min_bounds        XCharStruct  ; minimum bounds over all existing char
        max_bounds        XCharStruct  ; maximum bounds over all existing char
        per_char          dd   ?       ; first_char to last_char information
        ascent            dd   ?       ; logical extent above baseline for spacing
        descent           dd   ?       ; logical decent below baseline for spacing
ends


struct XWindowChanges
        x            dd ?
        y            dd ?
        width        dd ?
        height       dd ?
        border_width dd ?
        sibling      dd ?
        stack_mode   dd ?
ends    


and finaly
includes/os_specs/linux/api/x86/libx11.inc - they are same as 32 bit too.


LINUXERS I need thour help in import64.inc I used constant for relocation R_X86_64_64 - hope it is 64 absolute reloc?

NEVER USE THIS MACROSET AS IS - it is buggy - bug discussed [help needed]: libccall (x64 linux cinvoke)
Fact that it could produce valid elf64exe is kind of miracle.
Assign it as concept of linux 64 for GUI apps.

One more thing looks like in x64 there is no Xlib - is 64bit version of it exists?
Post 11 Jun 2020, 20:35
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.