commit
2264875237
72 changed files with 16 additions and 89561 deletions
|
|
@ -91,6 +91,10 @@ proc Remove*(list: var TLinkedList, entry: PListEntry) =
|
||||||
if entry.prev != nil: entry.prev.next = entry.next
|
if entry.prev != nil: entry.prev.next = entry.next
|
||||||
|
|
||||||
proc bringToFront*(list: var TLinkedList, entry: PListEntry) =
|
proc bringToFront*(list: var TLinkedList, entry: PListEntry) =
|
||||||
|
when true:
|
||||||
|
list.remove entry
|
||||||
|
list.prepend entry
|
||||||
|
else:
|
||||||
if entry == list.head: return
|
if entry == list.head: return
|
||||||
if entry == list.tail: list.tail = entry.prev
|
if entry == list.tail: list.tail = entry.prev
|
||||||
if entry.next != nil: entry.next.prev = entry.prev
|
if entry.next != nil: entry.next.prev = entry.prev
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ path="$lib/pure"
|
||||||
path="$lib/pure/collections"
|
path="$lib/pure/collections"
|
||||||
path="$lib/impure"
|
path="$lib/impure"
|
||||||
path="$lib/wrappers"
|
path="$lib/wrappers"
|
||||||
path="$lib/wrappers/cairo"
|
# path="$lib/wrappers/cairo"
|
||||||
path="$lib/wrappers/gtk"
|
# path="$lib/wrappers/gtk"
|
||||||
path="$lib/wrappers/lua"
|
# path="$lib/wrappers/lua"
|
||||||
path="$lib/wrappers/opengl"
|
# path="$lib/wrappers/opengl"
|
||||||
path="$lib/wrappers/pcre"
|
path="$lib/wrappers/pcre"
|
||||||
path="$lib/wrappers/readline"
|
path="$lib/wrappers/readline"
|
||||||
path="$lib/wrappers/sdl"
|
path="$lib/wrappers/sdl"
|
||||||
path="$lib/wrappers/x11"
|
# path="$lib/wrappers/x11"
|
||||||
path="$lib/wrappers/zip"
|
path="$lib/wrappers/zip"
|
||||||
path="$lib/windows"
|
path="$lib/windows"
|
||||||
path="$lib/posix"
|
path="$lib/posix"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
import cairo
|
|
||||||
|
|
||||||
var surface = image_surface_create(FORMAT_ARGB32, 240, 80)
|
|
||||||
var cr = create(surface)
|
|
||||||
|
|
||||||
select_font_face(cr, "serif", FONT_SLANT_NORMAL,
|
|
||||||
FONT_WEIGHT_BOLD)
|
|
||||||
set_font_size(cr, 32.0)
|
|
||||||
set_source_rgb(cr, 0.0, 0.0, 1.0)
|
|
||||||
move_to(cr, 10.0, 50.0)
|
|
||||||
show_text(cr, "Hello, world")
|
|
||||||
destroy(cr)
|
|
||||||
discard write_to_png(surface, "hello.png")
|
|
||||||
destroy(surface)
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
import
|
|
||||||
cairo, glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer) {.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
var
|
|
||||||
window: pWidget
|
|
||||||
nimrod_init()
|
|
||||||
window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex1.destroy), nil)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
var
|
|
||||||
window: PWidget
|
|
||||||
button: PWidget
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
button = button_new("Click me")
|
|
||||||
set_border_width(PContainer(Window), 5)
|
|
||||||
add(PContainer(window), button)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex2.destroy), nil)
|
|
||||||
show(button)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
proc newbutton(ALabel: cstring): PWidget =
|
|
||||||
Result = button_new(ALabel)
|
|
||||||
show(result)
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(WINDOW_TOPLEVEL) # Box to divide window in 2 halves:
|
|
||||||
var totalbox = vbox_new(true, 10)
|
|
||||||
show(totalbox) # A box for each half of the screen:
|
|
||||||
var hbox = hbox_new(false, 5)
|
|
||||||
show(hbox)
|
|
||||||
var vbox = vbox_new(true, 5)
|
|
||||||
show(vbox) # Put boxes in their halves
|
|
||||||
pack_start(totalbox, hbox, true, true, 0)
|
|
||||||
pack_start(totalbox, vbox, true, true, 0) # Now fill boxes with buttons.
|
|
||||||
|
|
||||||
pack_start(hbox, newbutton("Button 1"), false, false, 0)
|
|
||||||
pack_start(hbox, newbutton("Button 2"), false, false, 0)
|
|
||||||
pack_start(hbox, newbutton("Button 3"), false, false, 0) # Vertical box
|
|
||||||
pack_start(vbox, newbutton("Button A"), true, true, 0)
|
|
||||||
pack_start(vbox, newbutton("Button B"), true, true, 0)
|
|
||||||
pack_start(vbox, newbutton("Button C"), true, true, 0) # Put totalbox in window
|
|
||||||
set_border_width(PCONTAINER(Window), 5)
|
|
||||||
add(PContainer(window), totalbox)
|
|
||||||
discard signal_connect(window, "destroy", SIGNAL_FUNC(ex3.destroy), nil)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
proc newbutton(ALabel: cstring): PWidget =
|
|
||||||
Result = button_new(ALabel)
|
|
||||||
show(result)
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
var Maintable = table_new(6, 6, True)
|
|
||||||
|
|
||||||
proc AddToTable(Widget: PWidget, Left, Right, Top, Bottom: guint) =
|
|
||||||
attach_defaults(MainTable, Widget, Left, right, top, bottom)
|
|
||||||
|
|
||||||
show(MainTable)
|
|
||||||
AddToTable(newbutton("1,1 At 1,1"), 1, 2, 1, 2)
|
|
||||||
AddToTable(newbutton("2,2 At 3,1"), 3, 5, 1, 3)
|
|
||||||
AddToTable(newbutton("4,1 At 4,1"), 1, 5, 4, 5) # Put all in window
|
|
||||||
set_border_width(Window, 5)
|
|
||||||
add(window, maintable)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SignalFunc(ex4.destroy), nil)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
proc widgetDestroy(w: PWidget) {.cdecl.} =
|
|
||||||
destroy(w)
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
var button = button_new("Click me")
|
|
||||||
set_border_width(Window, 5)
|
|
||||||
add(window, button)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex5.destroy), nil)
|
|
||||||
discard signal_connect_object(button, "clicked",
|
|
||||||
SIGNAL_FUNC(widgetDestroy),
|
|
||||||
window)
|
|
||||||
show(button)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
type
|
|
||||||
TButtonSignalState = object
|
|
||||||
Obj: gtk2.PObject
|
|
||||||
SignalID: int32
|
|
||||||
Disable: bool
|
|
||||||
|
|
||||||
PButtonSignalState = ptr TButtonSignalState
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
proc widgetDestroy(w: PWidget) {.cdecl.} = destroy(w)
|
|
||||||
|
|
||||||
proc disablesignal(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
var s = cast[PButtonSignalState](Data)
|
|
||||||
if s.Disable:
|
|
||||||
signal_handler_block(s.Obj, s.SignalID)
|
|
||||||
else:
|
|
||||||
signal_handler_unblock(s.Obj, s.SignalID)
|
|
||||||
s.disable = not s.disable
|
|
||||||
|
|
||||||
var
|
|
||||||
QuitState: TButtonSignalState
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
var quitbutton = button_new("Quit program")
|
|
||||||
var disablebutton = button_new("Disable button")
|
|
||||||
var windowbox = vbox_new(TRUE, 10)
|
|
||||||
pack_start(windowbox, disablebutton, True, false, 0)
|
|
||||||
pack_start(windowbox, quitbutton, True, false, 0)
|
|
||||||
set_border_width(Window, 10)
|
|
||||||
add(window, windowbox)
|
|
||||||
discard signal_connect(window, "destroy", SIGNAL_FUNC(ex6.destroy), nil)
|
|
||||||
QuitState.Obj = QuitButton
|
|
||||||
quitState.SignalID = signal_connect_object(QuitState.Obj, "clicked",
|
|
||||||
SIGNAL_FUNC(widgetDestroy), window).int32
|
|
||||||
QuitState.Disable = True
|
|
||||||
discard signal_connect(disablebutton, "clicked",
|
|
||||||
SIGNAL_FUNC(disablesignal), addr(QuitState))
|
|
||||||
show(quitbutton)
|
|
||||||
show(disablebutton)
|
|
||||||
show(windowbox)
|
|
||||||
show(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
gdk2, glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
const
|
|
||||||
Inside: cstring = "Mouse is over label"
|
|
||||||
OutSide: cstring = "Mouse is not over label"
|
|
||||||
|
|
||||||
var
|
|
||||||
OverLabel: bool
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(gtk2.WINDOW_TOPLEVEL)
|
|
||||||
var stackbox = vbox_new(TRUE, 10)
|
|
||||||
var box1 = event_box_new()
|
|
||||||
var label1 = label_new("Move mouse over label")
|
|
||||||
add(box1, label1)
|
|
||||||
var box2 = event_box_new()
|
|
||||||
var label2 = label_new(OutSide)
|
|
||||||
add(box2, label2)
|
|
||||||
pack_start(stackbox, box1, TRUE, TRUE, 0)
|
|
||||||
pack_start(stackbox, box2, TRUE, TRUE, 0)
|
|
||||||
set_border_width(Window, 5)
|
|
||||||
add(window, stackbox)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex7.destroy), nil)
|
|
||||||
overlabel = False
|
|
||||||
|
|
||||||
|
|
||||||
proc ChangeLabel(P: PWidget, Event: gdk2.PEventCrossing,
|
|
||||||
Data: var bool){.cdecl.} =
|
|
||||||
if not Data: set_text(Label1, Inside)
|
|
||||||
else: set_text(Label2, Outside)
|
|
||||||
Data = not Data
|
|
||||||
|
|
||||||
|
|
||||||
discard signal_connect(box1, "enter_notify_event",
|
|
||||||
SIGNAL_FUNC(ChangeLabel), addr(Overlabel))
|
|
||||||
discard signal_connect(box1, "leave_notify_event",
|
|
||||||
SIGNAL_FUNC(ChangeLabel), addr(Overlabel))
|
|
||||||
show_all(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(WINDOW_TOPLEVEL)
|
|
||||||
var stackbox = vbox_new(TRUE, 10)
|
|
||||||
var label1 = label_new("Red label text")
|
|
||||||
var labelstyle = copy(get_style(label1))
|
|
||||||
LabelStyle.fg[STATE_NORMAL].pixel = 0
|
|
||||||
LabelStyle.fg[STATE_NORMAL].red = -1'i16
|
|
||||||
LabelStyle.fg[STATE_NORMAL].blue = 0'i16
|
|
||||||
LabelStyle.fg[STATE_NORMAL].green = 0'i16
|
|
||||||
set_style(label1, labelstyle)
|
|
||||||
# Uncomment this to see the effect of setting the default style.
|
|
||||||
# set_default_style(labelstyle)
|
|
||||||
var label2 = label_new("Black label text")
|
|
||||||
pack_start(stackbox, label1, TRUE, TRUE, 0)
|
|
||||||
pack_start(stackbox, label2, TRUE, TRUE, 0)
|
|
||||||
set_border_width(Window, 5)
|
|
||||||
add(window, stackbox)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex8.destroy), nil)
|
|
||||||
show_all(window)
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
gdk2, glib2, gtk2
|
|
||||||
|
|
||||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
|
||||||
main_quit()
|
|
||||||
|
|
||||||
const
|
|
||||||
Inside: cstring = "Mouse is over label"
|
|
||||||
OutSide: cstring = "Mouse is not over label"
|
|
||||||
|
|
||||||
var
|
|
||||||
OverButton: bool
|
|
||||||
|
|
||||||
nimrod_init()
|
|
||||||
var window = window_new(gtk2.WINDOW_TOPLEVEL)
|
|
||||||
var stackbox = vbox_new(TRUE, 10)
|
|
||||||
var button1 = button_new("Move mouse over button")
|
|
||||||
var buttonstyle = copy(get_style(Button1))
|
|
||||||
ButtonStyle.bg[STATE_PRELIGHT].pixel = 0
|
|
||||||
ButtonStyle.bg[STATE_PRELIGHT].red = -1'i16
|
|
||||||
ButtonStyle.bg[STATE_PRELIGHT].blue = 0'i16
|
|
||||||
ButtonStyle.bg[STATE_PRELIGHT].green = 0'i16
|
|
||||||
set_style(button1, buttonstyle)
|
|
||||||
var button2 = button_new()
|
|
||||||
var ALabel = label_new(Outside)
|
|
||||||
|
|
||||||
|
|
||||||
proc ChangeLabel(P: PWidget, Event: gdk2.PEventCrossing,
|
|
||||||
Data: var bool){.cdecl.} =
|
|
||||||
if Not Data: set_text(ALabel, Inside)
|
|
||||||
else: set_text(ALabel, Outside)
|
|
||||||
Data = Not Data
|
|
||||||
|
|
||||||
|
|
||||||
add(button2, ALAbel)
|
|
||||||
pack_start(stackbox, button1, TRUE, TRUE, 0)
|
|
||||||
pack_start(stackbox, button2, TRUE, TRUE, 0)
|
|
||||||
set_border_width(Window, 5)
|
|
||||||
add(window, stackbox)
|
|
||||||
discard signal_connect(window, "destroy",
|
|
||||||
SIGNAL_FUNC(ex9.destroy), nil)
|
|
||||||
overbutton = False
|
|
||||||
discard signal_connect(button1, "enter_notify_event",
|
|
||||||
SIGNAL_FUNC(ChangeLabel), addr(OverButton))
|
|
||||||
discard signal_connect(button1, "leave_notify_event",
|
|
||||||
SIGNAL_FUNC(ChangeLabel), addr(OverButton))
|
|
||||||
show_all(window)
|
|
||||||
main()
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
# Embedds Lua into a Nimrod application
|
|
||||||
|
|
||||||
import
|
|
||||||
lua, lualib, lauxlib
|
|
||||||
|
|
||||||
const
|
|
||||||
code = """
|
|
||||||
print 'hi'
|
|
||||||
"""
|
|
||||||
|
|
||||||
var L = newstate()
|
|
||||||
openlibs(L)
|
|
||||||
discard loadbuffer(L, code, code.len, "line")
|
|
||||||
discard pcall(L, 0, 0, 0)
|
|
||||||
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# Example to embed Python into your application
|
|
||||||
|
|
||||||
import python
|
|
||||||
|
|
||||||
# IMPORTANT: Python on Windows does not like CR characters, so
|
|
||||||
# we use only \L here.
|
|
||||||
|
|
||||||
Py_Initialize()
|
|
||||||
discard PyRun_SimpleString("from time import time,ctime\L" &
|
|
||||||
"print 'Today is',ctime(time())\L")
|
|
||||||
Py_Finalize()
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
# Example to embed TCL in Nimrod
|
|
||||||
|
|
||||||
import tcl, os
|
|
||||||
|
|
||||||
const
|
|
||||||
myScript = """puts "Hello, World - In quotes" """
|
|
||||||
myScript2 = """
|
|
||||||
package require Tk
|
|
||||||
pack [entry .e -textvar e -width 50]
|
|
||||||
bind .e <Return> {
|
|
||||||
set e [regsub { *=.*} $e ""] ;# remove evaluation (Chris)
|
|
||||||
catch {expr [string map {/ *1./} $e]} res
|
|
||||||
append e " = $res"
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
FindExecutable(getAppFilename())
|
|
||||||
var interp = CreateInterp()
|
|
||||||
if interp == nil: quit("cannot create TCL interpreter")
|
|
||||||
if Init(interp) != TCL_OK:
|
|
||||||
quit("cannot init interpreter")
|
|
||||||
if tcl.Eval(interp, myScript) != TCL_OK:
|
|
||||||
quit("cannot execute script.tcl")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# test a Windows GUI application
|
|
||||||
|
|
||||||
import
|
|
||||||
windows, shellapi, nb30, mmsystem, shfolder
|
|
||||||
|
|
||||||
#proc MessageBox(hWnd: int, lpText, lpCaption: CString, uType: uint): int
|
|
||||||
# {stdcall, import: "MessageBox", header: "<windows.h>"}
|
|
||||||
|
|
||||||
discard MessageBox(0, "Hello World!", "Nimrod GUI Application", 0)
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
import xlib, xutil, x, keysym
|
|
||||||
|
|
||||||
const
|
|
||||||
WINDOW_WIDTH = 400
|
|
||||||
WINDOW_HEIGHT = 300
|
|
||||||
|
|
||||||
var
|
|
||||||
width, height: cuint
|
|
||||||
display: PDisplay
|
|
||||||
screen: cint
|
|
||||||
depth: int
|
|
||||||
win: TWindow
|
|
||||||
sizeHints: TXSizeHints
|
|
||||||
|
|
||||||
proc create_window =
|
|
||||||
width = WINDOW_WIDTH
|
|
||||||
height = WINDOW_HEIGHT
|
|
||||||
|
|
||||||
display = XOpenDisplay(nil)
|
|
||||||
if display == nil:
|
|
||||||
echo("Verbindung zum X-Server fehlgeschlagen")
|
|
||||||
quit(1)
|
|
||||||
|
|
||||||
screen = XDefaultScreen(display)
|
|
||||||
depth = XDefaultDepth(display, screen)
|
|
||||||
var rootwin = XRootWindow(display, screen)
|
|
||||||
win = XCreateSimpleWindow(display, rootwin, 100, 10,
|
|
||||||
width, height, 5,
|
|
||||||
XBlackPixel(display, screen),
|
|
||||||
XWhitePixel(display, screen))
|
|
||||||
size_hints.flags = PSize or PMinSize or PMaxSize
|
|
||||||
size_hints.min_width = width.cint
|
|
||||||
size_hints.max_width = width.cint
|
|
||||||
size_hints.min_height = height.cint
|
|
||||||
size_hints.max_height = height.cint
|
|
||||||
discard XSetStandardProperties(display, win, "Simple Window", "window",
|
|
||||||
0, nil, 0, addr(size_hints))
|
|
||||||
discard XSelectInput(display, win, ButtonPressMask or KeyPressMask or
|
|
||||||
PointerMotionMask)
|
|
||||||
discard XMapWindow(display, win)
|
|
||||||
|
|
||||||
proc close_window =
|
|
||||||
discard XDestroyWindow(display, win)
|
|
||||||
discard XCloseDisplay(display)
|
|
||||||
|
|
||||||
var
|
|
||||||
xev: TXEvent
|
|
||||||
|
|
||||||
proc process_event =
|
|
||||||
var key: TKeySym
|
|
||||||
case int(xev.theType)
|
|
||||||
of KeyPress:
|
|
||||||
key = XLookupKeysym(cast[ptr TXKeyEvent](addr(xev)), 0)
|
|
||||||
if key.int != 0:
|
|
||||||
echo("keyboard event")
|
|
||||||
of ButtonPressMask, PointerMotionMask:
|
|
||||||
Echo("Mouse event")
|
|
||||||
else: nil
|
|
||||||
|
|
||||||
proc eventloop =
|
|
||||||
discard XFlush(display)
|
|
||||||
var num_events = int(XPending(display))
|
|
||||||
while num_events != 0:
|
|
||||||
dec(num_events)
|
|
||||||
discard XNextEvent(display, addr(xev))
|
|
||||||
process_event()
|
|
||||||
|
|
||||||
create_window()
|
|
||||||
while true:
|
|
||||||
eventloop()
|
|
||||||
close_window()
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,232 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2006 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
# NetBIOS 3.0 interface unit
|
|
||||||
|
|
||||||
# This module contains the definitions for portable NetBIOS 3.0 support.
|
|
||||||
|
|
||||||
{.deadCodeElim: on.}
|
|
||||||
|
|
||||||
import # Data structure templates
|
|
||||||
Windows
|
|
||||||
|
|
||||||
const
|
|
||||||
NCBNAMSZ* = 16 # absolute length of a net name
|
|
||||||
MAX_LANA* = 254 # lana's in range 0 to MAX_LANA inclusive
|
|
||||||
|
|
||||||
type # Network Control Block
|
|
||||||
PNCB* = ptr TNCB
|
|
||||||
TNCBPostProc* = proc (P: PNCB) {.stdcall.}
|
|
||||||
TNCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
|
|
||||||
# by an array of NAME_BUFFER structures.
|
|
||||||
ncb_command*: Char # command code
|
|
||||||
ncb_retcode*: Char # return code
|
|
||||||
ncb_lsn*: Char # local session number
|
|
||||||
ncb_num*: Char # number of our network name
|
|
||||||
ncb_buffer*: cstring # address of message buffer
|
|
||||||
ncb_length*: int16 # size of message buffer
|
|
||||||
ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote
|
|
||||||
ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname
|
|
||||||
ncb_rto*: Char # rcv timeout/retry count
|
|
||||||
ncb_sto*: Char # send timeout/sys timeout
|
|
||||||
ncb_post*: TNCBPostProc # POST routine address
|
|
||||||
ncb_lana_num*: Char # lana (adapter) number
|
|
||||||
ncb_cmd_cplt*: Char # 0xff => commmand pending
|
|
||||||
ncb_reserve*: array[0..9, Char] # reserved, used by BIOS
|
|
||||||
ncb_event*: THandle # HANDLE to Win32 event which
|
|
||||||
# will be set to the signalled
|
|
||||||
# state when an ASYNCH command
|
|
||||||
# completes
|
|
||||||
|
|
||||||
PAdapterStatus* = ptr TAdapterStatus
|
|
||||||
TAdapterStatus* {.final.} = object
|
|
||||||
adapter_address*: array[0..5, Char]
|
|
||||||
rev_major*: Char
|
|
||||||
reserved0*: Char
|
|
||||||
adapter_type*: Char
|
|
||||||
rev_minor*: Char
|
|
||||||
duration*: int16
|
|
||||||
frmr_recv*: int16
|
|
||||||
frmr_xmit*: int16
|
|
||||||
iframe_recv_err*: int16
|
|
||||||
xmit_aborts*: int16
|
|
||||||
xmit_success*: DWORD
|
|
||||||
recv_success*: DWORD
|
|
||||||
iframe_xmit_err*: int16
|
|
||||||
recv_buff_unavail*: int16
|
|
||||||
t1_timeouts*: int16
|
|
||||||
ti_timeouts*: int16
|
|
||||||
reserved1*: DWORD
|
|
||||||
free_ncbs*: int16
|
|
||||||
max_cfg_ncbs*: int16
|
|
||||||
max_ncbs*: int16
|
|
||||||
xmit_buf_unavail*: int16
|
|
||||||
max_dgram_size*: int16
|
|
||||||
pending_sess*: int16
|
|
||||||
max_cfg_sess*: int16
|
|
||||||
max_sess*: int16
|
|
||||||
max_sess_pkt_size*: int16
|
|
||||||
name_count*: int16
|
|
||||||
|
|
||||||
PNameBuffer* = ptr TNameBuffer
|
|
||||||
TNameBuffer* {.final.} = object
|
|
||||||
name*: array[0..NCBNAMSZ - 1, Char]
|
|
||||||
name_num*: Char
|
|
||||||
name_flags*: Char
|
|
||||||
|
|
||||||
|
|
||||||
const # values for name_flags bits.
|
|
||||||
NAME_FLAGS_MASK* = 0x00000087
|
|
||||||
GROUP_NAME* = 0x00000080
|
|
||||||
UNIQUE_NAME* = 0x00000000
|
|
||||||
REGISTERING* = 0x00000000
|
|
||||||
REGISTERED* = 0x00000004
|
|
||||||
DEREGISTERED* = 0x00000005
|
|
||||||
DUPLICATE* = 0x00000006
|
|
||||||
DUPLICATE_DEREG* = 0x00000007
|
|
||||||
|
|
||||||
type # Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
|
|
||||||
# by an array of SESSION_BUFFER structures. If the NCB_NAME starts with an
|
|
||||||
# asterisk then an array of these structures is returned containing the
|
|
||||||
# status for all names.
|
|
||||||
PSessionHeader* = ptr TSessionHeader
|
|
||||||
TSessionHeader* {.final.} = object
|
|
||||||
sess_name*: Char
|
|
||||||
num_sess*: Char
|
|
||||||
rcv_dg_outstanding*: Char
|
|
||||||
rcv_any_outstanding*: Char
|
|
||||||
|
|
||||||
PSessionBuffer* = ptr TSessionBuffer
|
|
||||||
TSessionBuffer* {.final.} = object
|
|
||||||
lsn*: Char
|
|
||||||
state*: Char
|
|
||||||
local_name*: array[0..NCBNAMSZ - 1, Char]
|
|
||||||
remote_name*: array[0..NCBNAMSZ - 1, Char]
|
|
||||||
rcvs_outstanding*: Char
|
|
||||||
sends_outstanding*: Char
|
|
||||||
|
|
||||||
|
|
||||||
const # Values for state
|
|
||||||
LISTEN_OUTSTANDING* = 0x00000001
|
|
||||||
CALL_PENDING* = 0x00000002
|
|
||||||
SESSION_ESTABLISHED* = 0x00000003
|
|
||||||
HANGUP_PENDING* = 0x00000004
|
|
||||||
HANGUP_COMPLETE* = 0x00000005
|
|
||||||
SESSION_ABORTED* = 0x00000006
|
|
||||||
|
|
||||||
type # Structure returned to the NCB command NCBENUM.
|
|
||||||
# On a system containing lana's 0, 2 and 3, a structure with
|
|
||||||
# length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned.
|
|
||||||
PLanaEnum* = ptr TLanaEnum
|
|
||||||
TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
|
|
||||||
# by an array of FIND_NAME_BUFFER structures.
|
|
||||||
len*: Char # Number of valid entries in lana[]
|
|
||||||
lana*: array[0..MAX_LANA, Char]
|
|
||||||
|
|
||||||
PFindNameHeader* = ptr TFindNameHeader
|
|
||||||
TFindNameHeader* {.final.} = object
|
|
||||||
node_count*: int16
|
|
||||||
reserved*: Char
|
|
||||||
unique_group*: Char
|
|
||||||
|
|
||||||
PFindNameBuffer* = ptr TFindNameBuffer
|
|
||||||
TFindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide
|
|
||||||
# transport specific extensions to netbios.
|
|
||||||
len*: Char
|
|
||||||
access_control*: Char
|
|
||||||
frame_control*: Char
|
|
||||||
destination_addr*: array[0..5, Char]
|
|
||||||
source_addr*: array[0..5, Char]
|
|
||||||
routing_info*: array[0..17, Char]
|
|
||||||
|
|
||||||
PActionHeader* = ptr TActionHeader
|
|
||||||
TActionHeader* {.final.} = object
|
|
||||||
transport_id*: int32
|
|
||||||
action_code*: int16
|
|
||||||
reserved*: int16
|
|
||||||
|
|
||||||
|
|
||||||
const # Values for transport_id
|
|
||||||
ALL_TRANSPORTS* = "M\0\0\0"
|
|
||||||
MS_NBF* = "MNBF" # Special values and constants
|
|
||||||
|
|
||||||
const # NCB Command codes
|
|
||||||
NCBCALL* = 0x00000010 # NCB CALL
|
|
||||||
NCBLISTEN* = 0x00000011 # NCB LISTEN
|
|
||||||
NCBHANGUP* = 0x00000012 # NCB HANG UP
|
|
||||||
NCBSEND* = 0x00000014 # NCB SEND
|
|
||||||
NCBRECV* = 0x00000015 # NCB RECEIVE
|
|
||||||
NCBRECVANY* = 0x00000016 # NCB RECEIVE ANY
|
|
||||||
NCBCHAINSEND* = 0x00000017 # NCB CHAIN SEND
|
|
||||||
NCBDGSEND* = 0x00000020 # NCB SEND DATAGRAM
|
|
||||||
NCBDGRECV* = 0x00000021 # NCB RECEIVE DATAGRAM
|
|
||||||
NCBDGSENDBC* = 0x00000022 # NCB SEND BROADCAST DATAGRAM
|
|
||||||
NCBDGRECVBC* = 0x00000023 # NCB RECEIVE BROADCAST DATAGRAM
|
|
||||||
NCBADDNAME* = 0x00000030 # NCB ADD NAME
|
|
||||||
NCBDELNAME* = 0x00000031 # NCB DELETE NAME
|
|
||||||
NCBRESET* = 0x00000032 # NCB RESET
|
|
||||||
NCBASTAT* = 0x00000033 # NCB ADAPTER STATUS
|
|
||||||
NCBSSTAT* = 0x00000034 # NCB SESSION STATUS
|
|
||||||
NCBCANCEL* = 0x00000035 # NCB CANCEL
|
|
||||||
NCBADDGRNAME* = 0x00000036 # NCB ADD GROUP NAME
|
|
||||||
NCBENUM* = 0x00000037 # NCB ENUMERATE LANA NUMBERS
|
|
||||||
NCBUNLINK* = 0x00000070 # NCB UNLINK
|
|
||||||
NCBSENDNA* = 0x00000071 # NCB SEND NO ACK
|
|
||||||
NCBCHAINSENDNA* = 0x00000072 # NCB CHAIN SEND NO ACK
|
|
||||||
NCBLANSTALERT* = 0x00000073 # NCB LAN STATUS ALERT
|
|
||||||
NCBACTION* = 0x00000077 # NCB ACTION
|
|
||||||
NCBFINDNAME* = 0x00000078 # NCB FIND NAME
|
|
||||||
NCBTRACE* = 0x00000079 # NCB TRACE
|
|
||||||
ASYNCH* = 0x00000080 # high bit set = asynchronous
|
|
||||||
# NCB Return codes
|
|
||||||
NRC_GOODRET* = 0x00000000 # good return
|
|
||||||
# also returned when ASYNCH request accepted
|
|
||||||
NRC_BUFLEN* = 0x00000001 # illegal buffer length
|
|
||||||
NRC_ILLCMD* = 0x00000003 # illegal command
|
|
||||||
NRC_CMDTMO* = 0x00000005 # command timed out
|
|
||||||
NRC_INCOMP* = 0x00000006 # message incomplete, issue another command
|
|
||||||
NRC_BADDR* = 0x00000007 # illegal buffer address
|
|
||||||
NRC_SNUMOUT* = 0x00000008 # session number out of range
|
|
||||||
NRC_NORES* = 0x00000009 # no resource available
|
|
||||||
NRC_SCLOSED* = 0x0000000A # session closed
|
|
||||||
NRC_CMDCAN* = 0x0000000B # command cancelled
|
|
||||||
NRC_DUPNAME* = 0x0000000D # duplicate name
|
|
||||||
NRC_NAMTFUL* = 0x0000000E # name table full
|
|
||||||
NRC_ACTSES* = 0x0000000F # no deletions, name has active sessions
|
|
||||||
NRC_LOCTFUL* = 0x00000011 # local session table full
|
|
||||||
NRC_REMTFUL* = 0x00000012 # remote session table full
|
|
||||||
NRC_ILLNN* = 0x00000013 # illegal name number
|
|
||||||
NRC_NOCALL* = 0x00000014 # no callname
|
|
||||||
NRC_NOWILD* = 0x00000015 # cannot put * in NCB_NAME
|
|
||||||
NRC_INUSE* = 0x00000016 # name in use on remote adapter
|
|
||||||
NRC_NAMERR* = 0x00000017 # name deleted
|
|
||||||
NRC_SABORT* = 0x00000018 # session ended abnormally
|
|
||||||
NRC_NAMCONF* = 0x00000019 # name conflict detected
|
|
||||||
NRC_IFBUSY* = 0x00000021 # interface busy, IRET before retrying
|
|
||||||
NRC_TOOMANY* = 0x00000022 # too many commands outstanding, retry later
|
|
||||||
NRC_BRIDGE* = 0x00000023 # NCB_lana_num field invalid
|
|
||||||
NRC_CANOCCR* = 0x00000024 # command completed while cancel occurring
|
|
||||||
NRC_CANCEL* = 0x00000026 # command not valid to cancel
|
|
||||||
NRC_DUPENV* = 0x00000030 # name defined by anther local process
|
|
||||||
NRC_ENVNOTDEF* = 0x00000034 # environment undefined. RESET required
|
|
||||||
NRC_OSRESNOTAV* = 0x00000035 # required OS resources exhausted
|
|
||||||
NRC_MAXAPPS* = 0x00000036 # max number of applications exceeded
|
|
||||||
NRC_NOSAPS* = 0x00000037 # no saps available for netbios
|
|
||||||
NRC_NORESOURCES* = 0x00000038 # requested resources are not available
|
|
||||||
NRC_INVADDRESS* = 0x00000039 # invalid ncb address or length > segment
|
|
||||||
NRC_INVDDID* = 0x0000003B # invalid NCB DDID
|
|
||||||
NRC_LOCKFAIL* = 0x0000003C # lock of user area failed
|
|
||||||
NRC_OPENERR* = 0x0000003F # NETBIOS not loaded
|
|
||||||
NRC_SYSTEM* = 0x00000040 # system error
|
|
||||||
NRC_PENDING* = 0x000000FF # asynchronous command is not yet finished
|
|
||||||
# main user entry point for NetBIOS 3.0
|
|
||||||
# Usage: Result = Netbios( pncb );
|
|
||||||
|
|
||||||
proc Netbios*(P: PNCB): Char{.stdcall, dynlib: "netapi32.dll",
|
|
||||||
importc: "Netbios".}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,208 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2006 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
windows
|
|
||||||
|
|
||||||
const
|
|
||||||
GUID_NULL*: TGUID = (D1: 0x00000000, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000])
|
|
||||||
IID_IUnknown*: TGUID = (D1: 0x00000000, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IClassFactory*: TGUID = (D1: 0x00000001, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IMarshal*: TGUID = (D1: 0x00000003, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IMalloc*: TGUID = (D1: 0x00000002, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IStdMarshalInfo*: TGUID = (D1: 0x00000018, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IExternalConnection*: TGUID = (D1: 0x00000019, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IEnumUnknown*: TGUID = (D1: 0x00000100, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IBindCtx*: TGUID = (D1: 0x0000000E, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumMoniker*: TGUID = (D1: 0x00000102, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IRunnableObject*: TGUID = (D1: 0x00000126, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IRunningObjectTable*: TGUID = (D1: 0x00000010, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IPersist*: TGUID = (D1: 0x0000010C, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IPersistStream*: TGUID = (D1: 0x00000109, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IMoniker*: TGUID = (D1: 0x0000000F, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumString*: TGUID = (D1: 0x00000101, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IStream*: TGUID = (D1: 0x0000000C, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumStatStg*: TGUID = (D1: 0x0000000D, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IStorage*: TGUID = (D1: 0x0000000B, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IPersistFile*: TGUID = (D1: 0x0000010B, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IPersistStorage*: TGUID = (D1: 0x0000010A, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_ILockBytes*: TGUID = (D1: 0x0000000A, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumFormatEtc*: TGUID = (D1: 0x00000103, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumStatData*: TGUID = (D1: 0x00000105, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IRootStorage*: TGUID = (D1: 0x00000012, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IAdviseSink*: TGUID = (D1: 0x0000010F, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IAdviseSink2*: TGUID = (D1: 0x00000125, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IDataObject*: TGUID = (D1: 0x0000010E, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IDataAdviseHolder*: TGUID = (D1: 0x00000110, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IMessageFilter*: TGUID = (D1: 0x00000016, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IRpcChannelBuffer*: TGUID = (D1: 0xD5F56B60, D2: 0x0000593B,
|
|
||||||
D3: 0x0000101A, D4: [0x000000B5, 0x00000069, 0x00000008, 0x00000000,
|
|
||||||
0x0000002B, 0x0000002D, 0x000000BF, 0x0000007A])
|
|
||||||
IID_IRpcProxyBuffer*: TGUID = (D1: 0xD5F56A34, D2: 0x0000593B, D3: 0x0000101A, D4: [
|
|
||||||
0x000000B5, 0x00000069, 0x00000008, 0x00000000, 0x0000002B, 0x0000002D,
|
|
||||||
0x000000BF, 0x0000007A])
|
|
||||||
IID_IRpcStubBuffer*: TGUID = (D1: 0xD5F56AFC, D2: 0x0000593B, D3: 0x0000101A, D4: [
|
|
||||||
0x000000B5, 0x00000069, 0x00000008, 0x00000000, 0x0000002B, 0x0000002D,
|
|
||||||
0x000000BF, 0x0000007A])
|
|
||||||
IID_IPSFactoryBuffer*: TGUID = (D1: 0xD5F569D0, D2: 0x0000593B,
|
|
||||||
D3: 0x0000101A, D4: [0x000000B5, 0x00000069, 0x00000008, 0x00000000,
|
|
||||||
0x0000002B, 0x0000002D, 0x000000BF, 0x0000007A])
|
|
||||||
IID_ICreateTypeInfo*: TGUID = (D1: 0x00020405, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_ICreateTypeLib*: TGUID = (D1: 0x00020406, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IDispatch*: TGUID = (D1: 0x00020400, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumVariant*: TGUID = (D1: 0x00020404, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_ITypeComp*: TGUID = (D1: 0x00020403, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_ITypeInfo*: TGUID = (D1: 0x00020401, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_ITypeLib*: TGUID = (D1: 0x00020402, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IErrorInfo*: TGUID = (D1: 0x1CF2B120, D2: 0x0000547D, D3: 0x0000101B, D4: [
|
|
||||||
0x0000008E, 0x00000065, 0x00000008, 0x00000000, 0x0000002B, 0x0000002B,
|
|
||||||
0x000000D1, 0x00000019])
|
|
||||||
IID_ICreateErrorInfo*: TGUID = (D1: 0x22F03340, D2: 0x0000547D,
|
|
||||||
D3: 0x0000101B, D4: [0x0000008E, 0x00000065, 0x00000008, 0x00000000,
|
|
||||||
0x0000002B, 0x0000002B, 0x000000D1, 0x00000019])
|
|
||||||
IID_ISupportErrorInfo*: TGUID = (D1: 0xDF0B3D60, D2: 0x0000548F,
|
|
||||||
D3: 0x0000101B, D4: [0x0000008E, 0x00000065, 0x00000008, 0x00000000,
|
|
||||||
0x0000002B, 0x0000002B, 0x000000D1, 0x00000019])
|
|
||||||
IID_IOleAdviseHolder*: TGUID = (D1: 0x00000111, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleCache*: TGUID = (D1: 0x0000011E, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleCache2*: TGUID = (D1: 0x00000128, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleCacheControl*: TGUID = (D1: 0x00000129, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IParseDisplayName*: TGUID = (D1: 0x0000011A, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleContainer*: TGUID = (D1: 0x0000011B, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleClientSite*: TGUID = (D1: 0x00000118, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleObject*: TGUID = (D1: 0x00000112, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleWindow*: TGUID = (D1: 0x00000114, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleLink*: TGUID = (D1: 0x0000011D, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IOleItemContainer*: TGUID = (D1: 0x0000011C, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleInPlaceUIWindow*: TGUID = (D1: 0x00000115, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleInPlaceActiveObject*: TGUID = (D1: 0x00000117, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleInPlaceFrame*: TGUID = (D1: 0x00000116, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleInPlaceObject*: TGUID = (D1: 0x00000113, D2: 0x00000000,
|
|
||||||
D3: 0x00000000, D4: [0x000000C0, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000046])
|
|
||||||
IID_IOleInPlaceSite*: TGUID = (D1: 0x00000119, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IViewObject*: TGUID = (D1: 0x0000010D, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IViewObject2*: TGUID = (D1: 0x00000127, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IDropSource*: TGUID = (D1: 0x00000121, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IDropTarget*: TGUID = (D1: 0x00000122, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
IID_IEnumOleVerb*: TGUID = (D1: 0x00000104, D2: 0x00000000, D3: 0x00000000, D4: [
|
|
||||||
0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
||||||
0x00000000, 0x00000046])
|
|
||||||
|
|
@ -1,202 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2009 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
|
|
||||||
# PSAPI interface unit
|
|
||||||
|
|
||||||
# Contains the definitions for the APIs provided by PSAPI.DLL
|
|
||||||
|
|
||||||
import # Data structure templates
|
|
||||||
Windows
|
|
||||||
|
|
||||||
const
|
|
||||||
psapiDll = "psapi.dll"
|
|
||||||
|
|
||||||
proc EnumProcesses*(lpidProcess: ptr DWORD, cb: DWORD,
|
|
||||||
cbNeeded: ptr DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumProcesses".}
|
|
||||||
proc EnumProcessModules*(hProcess: HANDLE, lphModule: ptr HMODULE, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumProcessModules".}
|
|
||||||
|
|
||||||
proc GetModuleBaseNameA*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleBaseNameA".}
|
|
||||||
proc GetModuleBaseNameW*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleBaseNameW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleBaseNameW".}
|
|
||||||
else:
|
|
||||||
proc GetModuleBaseName*(hProcess: HANDLE, hModule: HMODULE, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleBaseNameA".}
|
|
||||||
|
|
||||||
proc GetModuleFileNameExA*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleFileNameExA".}
|
|
||||||
proc GetModuleFileNameExW*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleFileNameExW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleFileNameExW".}
|
|
||||||
else:
|
|
||||||
proc GetModuleFileNameEx*(hProcess: HANDLE, hModule: HMODULE, lpFileNameEx: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleFileNameExA".}
|
|
||||||
|
|
||||||
type
|
|
||||||
MODULEINFO* {.final.} = object
|
|
||||||
lpBaseOfDll*: LPVOID
|
|
||||||
SizeOfImage*: DWORD
|
|
||||||
EntryPoint*: LPVOID
|
|
||||||
LPMODULEINFO* = ptr MODULEINFO
|
|
||||||
|
|
||||||
proc GetModuleInformation*(hProcess: HANDLE, hModule: HMODULE, lpmodinfo: LPMODULEINFO, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetModuleInformation".}
|
|
||||||
proc EmptyWorkingSet*(hProcess: HANDLE): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EmptyWorkingSet".}
|
|
||||||
proc QueryWorkingSet*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "QueryWorkingSet".}
|
|
||||||
proc QueryWorkingSetEx*(hProcess: HANDLE, pv: PVOID, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "QueryWorkingSetEx".}
|
|
||||||
proc InitializeProcessForWsWatch*(hProcess: HANDLE): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "InitializeProcessForWsWatch".}
|
|
||||||
|
|
||||||
type
|
|
||||||
PSAPI_WS_WATCH_INFORMATION* {.final.} = object
|
|
||||||
FaultingPc*: LPVOID
|
|
||||||
FaultingVa*: LPVOID
|
|
||||||
PPSAPI_WS_WATCH_INFORMATION* = ptr PSAPI_WS_WATCH_INFORMATION
|
|
||||||
|
|
||||||
proc GetWsChanges*(hProcess: HANDLE, lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetWsChanges".}
|
|
||||||
|
|
||||||
proc GetMappedFileNameA*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetMappedFileNameA".}
|
|
||||||
proc GetMappedFileNameW*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetMappedFileNameW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetMappedFileNameW".}
|
|
||||||
else:
|
|
||||||
proc GetMappedFileName*(hProcess: HANDLE, lpv: LPVOID, lpFilename: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetMappedFileNameA".}
|
|
||||||
|
|
||||||
proc EnumDeviceDrivers*(lpImageBase: LPVOID, cb: DWORD, lpcbNeeded: LPDWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumDeviceDrivers".}
|
|
||||||
|
|
||||||
proc GetDeviceDriverBaseNameA*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".}
|
|
||||||
proc GetDeviceDriverBaseNameW*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverBaseNameW".}
|
|
||||||
else:
|
|
||||||
proc GetDeviceDriverBaseName*(ImageBase: LPVOID, lpBaseName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverBaseNameA".}
|
|
||||||
|
|
||||||
proc GetDeviceDriverFileNameA*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".}
|
|
||||||
proc GetDeviceDriverFileNameW*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverFileNameW".}
|
|
||||||
else:
|
|
||||||
proc GetDeviceDriverFileName*(ImageBase: LPVOID, lpFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetDeviceDriverFileNameA".}
|
|
||||||
|
|
||||||
type
|
|
||||||
PROCESS_MEMORY_COUNTERS* {.final.} = object
|
|
||||||
cb*: DWORD
|
|
||||||
PageFaultCount*: DWORD
|
|
||||||
PeakWorkingSetSize: SIZE_T
|
|
||||||
WorkingSetSize: SIZE_T
|
|
||||||
QuotaPeakPagedPoolUsage: SIZE_T
|
|
||||||
QuotaPagedPoolUsage: SIZE_T
|
|
||||||
QuotaPeakNonPagedPoolUsage: SIZE_T
|
|
||||||
QuotaNonPagedPoolUsage: SIZE_T
|
|
||||||
PagefileUsage: SIZE_T
|
|
||||||
PeakPagefileUsage: SIZE_T
|
|
||||||
PPROCESS_MEMORY_COUNTERS* = ptr PROCESS_MEMORY_COUNTERS
|
|
||||||
|
|
||||||
type
|
|
||||||
PROCESS_MEMORY_COUNTERS_EX* {.final.} = object
|
|
||||||
cb*: DWORD
|
|
||||||
PageFaultCount*: DWORD
|
|
||||||
PeakWorkingSetSize: SIZE_T
|
|
||||||
WorkingSetSize: SIZE_T
|
|
||||||
QuotaPeakPagedPoolUsage: SIZE_T
|
|
||||||
QuotaPagedPoolUsage: SIZE_T
|
|
||||||
QuotaPeakNonPagedPoolUsage: SIZE_T
|
|
||||||
QuotaNonPagedPoolUsage: SIZE_T
|
|
||||||
PagefileUsage: SIZE_T
|
|
||||||
PeakPagefileUsage: SIZE_T
|
|
||||||
PrivateUsage: SIZE_T
|
|
||||||
PPROCESS_MEMORY_COUNTERS_EX* = ptr PROCESS_MEMORY_COUNTERS_EX
|
|
||||||
|
|
||||||
proc GetProcessMemoryInfo*(hProcess: HANDLE, ppsmemCounters: PPROCESS_MEMORY_COUNTERS, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetProcessMemoryInfo".}
|
|
||||||
|
|
||||||
type
|
|
||||||
PERFORMANCE_INFORMATION* {.final.} = object
|
|
||||||
cb*: DWORD
|
|
||||||
CommitTotal: SIZE_T
|
|
||||||
CommitLimit: SIZE_T
|
|
||||||
CommitPeak: SIZE_T
|
|
||||||
PhysicalTotal: SIZE_T
|
|
||||||
PhysicalAvailable: SIZE_T
|
|
||||||
SystemCache: SIZE_T
|
|
||||||
KernelTotal: SIZE_T
|
|
||||||
KernelPaged: SIZE_T
|
|
||||||
KernelNonpaged: SIZE_T
|
|
||||||
PageSize: SIZE_T
|
|
||||||
HandleCount*: DWORD
|
|
||||||
ProcessCount*: DWORD
|
|
||||||
ThreadCount*: DWORD
|
|
||||||
PPERFORMANCE_INFORMATION* = ptr PERFORMANCE_INFORMATION
|
|
||||||
# Skip definition of PERFORMACE_INFORMATION...
|
|
||||||
|
|
||||||
proc GetPerformanceInfo*(pPerformanceInformation: PPERFORMANCE_INFORMATION, cb: DWORD): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetPerformanceInfo".}
|
|
||||||
|
|
||||||
type
|
|
||||||
ENUM_PAGE_FILE_INFORMATION* {.final.} = object
|
|
||||||
cb*: DWORD
|
|
||||||
Reserved*: DWORD
|
|
||||||
TotalSize: SIZE_T
|
|
||||||
TotalInUse: SIZE_T
|
|
||||||
PeakUsage: SIZE_T
|
|
||||||
PENUM_PAGE_FILE_INFORMATION* = ptr ENUM_PAGE_FILE_INFORMATION
|
|
||||||
|
|
||||||
# Callback procedure
|
|
||||||
type
|
|
||||||
PENUM_PAGE_FILE_CALLBACKW* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.}
|
|
||||||
PENUM_PAGE_FILE_CALLBACKA* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.}
|
|
||||||
|
|
||||||
#TODO
|
|
||||||
proc EnumPageFilesA*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumPageFilesA".}
|
|
||||||
proc EnumPageFilesW*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumPageFilesW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, pContext: LPVOID): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumPageFilesW".}
|
|
||||||
type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCWSTR): WINBOOL{.stdcall.}
|
|
||||||
else:
|
|
||||||
proc EnumPageFiles*(pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, pContext: LPVOID): WINBOOL {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "EnumPageFilesA".}
|
|
||||||
type PENUM_PAGE_FILE_CALLBACK* = proc (pContext: LPVOID, pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, lpFilename: LPCSTR): WINBOOL{.stdcall.}
|
|
||||||
|
|
||||||
proc GetProcessImageFileNameA*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetProcessImageFileNameA".}
|
|
||||||
proc GetProcessImageFileNameW*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetProcessImageFileNameW".}
|
|
||||||
when defined(winUnicode):
|
|
||||||
proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPWSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetProcessImageFileNameW".}
|
|
||||||
else:
|
|
||||||
proc GetProcessImageFileName*(hProcess: HANDLE, lpImageFileName: LPSTR, nSize: DWORD): DWORD {.stdcall,
|
|
||||||
dynlib: psapiDll, importc: "GetProcessImageFileNameA".}
|
|
||||||
|
|
@ -1,863 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2006 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
|
|
||||||
{.deadCodeElim: on.}
|
|
||||||
|
|
||||||
# leave out unused functions so the unit can be used on win2000 as well
|
|
||||||
|
|
||||||
#+-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Microsoft Windows
|
|
||||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
#
|
|
||||||
# File: shellapi.h
|
|
||||||
#
|
|
||||||
# Header translation by Marco van de Voort for Free Pascal Platform
|
|
||||||
# SDK dl'ed January 2002
|
|
||||||
#
|
|
||||||
#--------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#
|
|
||||||
# shellapi.h - SHELL.DLL functions, types, and definitions
|
|
||||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
|
|
||||||
import
|
|
||||||
Windows
|
|
||||||
|
|
||||||
type
|
|
||||||
HDROP* = THandle
|
|
||||||
UINT_PTR* = ptr UINT
|
|
||||||
DWORD_PTR* = ptr DWORD
|
|
||||||
pHICON* = ptr HICON
|
|
||||||
pBool* = ptr BOOL
|
|
||||||
STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
|
|
||||||
cb*: DWORD
|
|
||||||
lpReserved*: LPTSTR
|
|
||||||
lpDesktop*: LPTSTR
|
|
||||||
lpTitle*: LPTSTR
|
|
||||||
dwX*: DWORD
|
|
||||||
dwY*: DWORD
|
|
||||||
dwXSize*: DWORD
|
|
||||||
dwYSize*: DWORD
|
|
||||||
dwXCountChars*: DWORD
|
|
||||||
dwYCountChars*: DWORD
|
|
||||||
dwFillAttribute*: DWORD
|
|
||||||
dwFlags*: DWORD
|
|
||||||
wShowWindow*: int16
|
|
||||||
cbReserved2*: int16
|
|
||||||
lpReserved2*: LPBYTE
|
|
||||||
hStdInput*: HANDLE
|
|
||||||
hStdOutput*: HANDLE
|
|
||||||
hStdError*: HANDLE
|
|
||||||
|
|
||||||
LPSTARTUPINFOW* = ptr STARTUPINFOW
|
|
||||||
TSTARTUPINFOW* = STARTUPINFOW
|
|
||||||
PSTARTUPINFOW* = ptr STARTUPINFOW #unicode
|
|
||||||
|
|
||||||
proc DragQueryFileA*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
|
|
||||||
proc DragQueryFileW*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
|
|
||||||
proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
|
|
||||||
proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
|
|
||||||
proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): BOOL{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DragQueryPoint".}
|
|
||||||
proc DragFinish*(arg1: HDROP){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "DragFinish".}
|
|
||||||
proc DragAcceptFiles*(hwnd: HWND, arg2: BOOL){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "DragAcceptFiles".}
|
|
||||||
proc ShellExecuteA*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
|
|
||||||
lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
|
|
||||||
proc ShellExecuteW*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
|
|
||||||
lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
|
|
||||||
proc ShellExecute*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
|
|
||||||
lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
|
|
||||||
proc ShellExecute*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
|
|
||||||
lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
|
|
||||||
proc FindExecutableA*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
|
|
||||||
proc FindExecutableW*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
|
|
||||||
proc FindExecutable*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
|
|
||||||
proc FindExecutable*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
|
|
||||||
proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): pLPWSTR{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "CommandLineToArgvW".}
|
|
||||||
proc ShellAboutA*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
|
|
||||||
proc ShellAboutW*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
|
|
||||||
HICON: hIcon): int32{.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "ShellAboutW".}
|
|
||||||
proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
|
|
||||||
proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
|
|
||||||
proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DuplicateIcon".}
|
|
||||||
proc ExtractAssociatedIconA*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
|
|
||||||
proc ExtractAssociatedIconW*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
|
|
||||||
proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
|
|
||||||
proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
|
|
||||||
proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
|
|
||||||
proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
|
|
||||||
proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
|
|
||||||
proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
|
|
||||||
# if(WINVER >= 0x0400)
|
|
||||||
type # init with sizeof(DRAGINFO)
|
|
||||||
DRAGINFOA* {.final.} = object
|
|
||||||
uSize*: UINT
|
|
||||||
pt*: POINT
|
|
||||||
fNC*: BOOL
|
|
||||||
lpFileList*: LPSTR
|
|
||||||
grfKeyState*: DWORD
|
|
||||||
|
|
||||||
TDRAGINFOA* = DRAGINFOA
|
|
||||||
LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO)
|
|
||||||
DRAGINFOW* {.final.} = object
|
|
||||||
uSize*: UINT
|
|
||||||
pt*: POINT
|
|
||||||
fNC*: BOOL
|
|
||||||
lpFileList*: LPWSTR
|
|
||||||
grfKeyState*: DWORD
|
|
||||||
|
|
||||||
TDRAGINFOW* = DRAGINFOW
|
|
||||||
LPDRAGINFOW* = ptr DRAGINFOW
|
|
||||||
|
|
||||||
when defined(UNICODE):
|
|
||||||
type
|
|
||||||
DRAGINFO* = DRAGINFOW
|
|
||||||
TDRAGINFO* = DRAGINFOW
|
|
||||||
LPDRAGINFO* = LPDRAGINFOW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
DRAGINFO* = DRAGINFOA
|
|
||||||
TDRAGINFO* = DRAGINFOW
|
|
||||||
LPDRAGINFO* = LPDRAGINFOA
|
|
||||||
const
|
|
||||||
ABM_NEW* = 0x00000000
|
|
||||||
ABM_REMOVE* = 0x00000001
|
|
||||||
ABM_QUERYPOS* = 0x00000002
|
|
||||||
ABM_SETPOS* = 0x00000003
|
|
||||||
ABM_GETSTATE* = 0x00000004
|
|
||||||
ABM_GETTASKBARPOS* = 0x00000005
|
|
||||||
ABM_ACTIVATE* = 0x00000006 # lParam == TRUE/FALSE means activate/deactivate
|
|
||||||
ABM_GETAUTOHIDEBAR* = 0x00000007
|
|
||||||
ABM_SETAUTOHIDEBAR* = 0x00000008 # this can fail at any time. MUST check the result
|
|
||||||
# lParam = TRUE/FALSE Set/Unset
|
|
||||||
# uEdge = what edge
|
|
||||||
ABM_WINDOWPOSCHANGED* = 0x00000009
|
|
||||||
ABM_SETSTATE* = 0x0000000A
|
|
||||||
ABN_STATECHANGE* = 0x00000000 # these are put in the wparam of callback messages
|
|
||||||
ABN_POSCHANGED* = 0x00000001
|
|
||||||
ABN_FULLSCREENAPP* = 0x00000002
|
|
||||||
ABN_WINDOWARRANGE* = 0x00000003 # lParam == TRUE means hide
|
|
||||||
# flags for get state
|
|
||||||
ABS_AUTOHIDE* = 0x00000001
|
|
||||||
ABS_ALWAYSONTOP* = 0x00000002
|
|
||||||
ABE_LEFT* = 0
|
|
||||||
ABE_TOP* = 1
|
|
||||||
ABE_RIGHT* = 2
|
|
||||||
ABE_BOTTOM* = 3
|
|
||||||
|
|
||||||
type
|
|
||||||
AppBarData* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
hWnd*: HWND
|
|
||||||
uCallbackMessage*: UINT
|
|
||||||
uEdge*: UINT
|
|
||||||
rc*: RECT
|
|
||||||
lParam*: LPARAM # message specific
|
|
||||||
|
|
||||||
TAPPBARDATA* = AppBarData
|
|
||||||
PAPPBARDATA* = ptr AppBarData
|
|
||||||
|
|
||||||
proc SHAppBarMessage*(dwMessage: DWORD, pData: APPBARDATA): UINT_PTR{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHAppBarMessage".}
|
|
||||||
#
|
|
||||||
# EndAppBar
|
|
||||||
#
|
|
||||||
proc DoEnvironmentSubstA*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
|
|
||||||
proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
|
|
||||||
proc DoEnvironmentSubst*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
|
|
||||||
proc DoEnvironmentSubst*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
|
|
||||||
#Macro
|
|
||||||
proc EIRESID*(x: int32): int32
|
|
||||||
proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
|
|
||||||
phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ExtractIconExA".}
|
|
||||||
proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
|
|
||||||
phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ExtractIconExW".}
|
|
||||||
proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32,
|
|
||||||
phiconLarge: var HICON, phiconSmall: var HIcon,
|
|
||||||
nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "ExtractIconExA".}
|
|
||||||
proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32,
|
|
||||||
phiconLarge: var HICON, phiconSmall: var HIcon,
|
|
||||||
nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "ExtractIconExW".}
|
|
||||||
proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
|
|
||||||
phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ExtractIconExA".}
|
|
||||||
proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
|
|
||||||
phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ExtractIconExW".}
|
|
||||||
proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: var HICON,
|
|
||||||
phiconSmall: var HIcon, nIcons: UINT): UINT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ExtractIconExA".}
|
|
||||||
proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32,
|
|
||||||
phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: UINT): UINT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "ExtractIconExW".}
|
|
||||||
#
|
|
||||||
# Shell File Operations
|
|
||||||
#
|
|
||||||
#ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h}
|
|
||||||
const
|
|
||||||
FO_MOVE* = 0x00000001
|
|
||||||
FO_COPY* = 0x00000002
|
|
||||||
FO_DELETE* = 0x00000003
|
|
||||||
FO_RENAME* = 0x00000004
|
|
||||||
FOF_MULTIDESTFILES* = 0x00000001
|
|
||||||
FOF_CONFIRMMOUSE* = 0x00000002
|
|
||||||
FOF_SILENT* = 0x00000004 # don't create progress/report
|
|
||||||
FOF_RENAMEONCOLLISION* = 0x00000008
|
|
||||||
FOF_NOCONFIRMATION* = 0x00000010 # Don't prompt the user.
|
|
||||||
FOF_WANTMAPPINGHANDLE* = 0x00000020 # Fill in SHFILEOPSTRUCT.hNameMappings
|
|
||||||
FOF_ALLOWUNDO* = 0x00000040 # Must be freed using SHFreeNameMappings
|
|
||||||
FOF_FILESONLY* = 0x00000080 # on *.*, do only files
|
|
||||||
FOF_SIMPLEPROGRESS* = 0x00000100 # means don't show names of files
|
|
||||||
FOF_NOCONFIRMMKDIR* = 0x00000200 # don't confirm making any needed dirs
|
|
||||||
FOF_NOERRORUI* = 0x00000400 # don't put up error UI
|
|
||||||
FOF_NOCOPYSECURITYATTRIBS* = 0x00000800 # dont copy NT file Security Attributes
|
|
||||||
FOF_NORECURSION* = 0x00001000 # don't recurse into directories.
|
|
||||||
#if (_WIN32_IE >= 0x0500)
|
|
||||||
FOF_NO_CONNECTED_ELEMENTS* = 0x00002000 # don't operate on connected elements.
|
|
||||||
FOF_WANTNUKEWARNING* = 0x00004000 # during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
|
|
||||||
#endif
|
|
||||||
#if (_WIN32_WINNT >= 0x0501)
|
|
||||||
FOF_NORECURSEREPARSE* = 0x00008000 # treat reparse points as objects, not containers
|
|
||||||
#endif
|
|
||||||
|
|
||||||
type
|
|
||||||
FILEOP_FLAGS* = int16
|
|
||||||
|
|
||||||
const
|
|
||||||
PO_DELETE* = 0x00000013 # printer is being deleted
|
|
||||||
PO_RENAME* = 0x00000014 # printer is being renamed
|
|
||||||
PO_PORTCHANGE* = 0x00000020 # port this printer connected to is being changed
|
|
||||||
# if this id is set, the strings received by
|
|
||||||
# the copyhook are a doubly-null terminated
|
|
||||||
# list of strings. The first is the printer
|
|
||||||
# name and the second is the printer port.
|
|
||||||
PO_REN_PORT* = 0x00000034 # PO_RENAME and PO_PORTCHANGE at same time.
|
|
||||||
# no POF_ flags currently defined
|
|
||||||
|
|
||||||
type
|
|
||||||
PRINTEROP_FLAGS* = int16 #endif}
|
|
||||||
# FO_MOVE
|
|
||||||
# implicit parameters are:
|
|
||||||
# if pFrom or pTo are unqualified names the current directories are
|
|
||||||
# taken from the global current drive/directory settings managed
|
|
||||||
# by Get/SetCurrentDrive/Directory
|
|
||||||
#
|
|
||||||
# the global confirmation settings
|
|
||||||
# only used if FOF_SIMPLEPROGRESS
|
|
||||||
|
|
||||||
type
|
|
||||||
SHFILEOPSTRUCTA* {.final.} = object
|
|
||||||
hwnd*: HWND
|
|
||||||
wFunc*: UINT
|
|
||||||
pFrom*: LPCSTR
|
|
||||||
pTo*: LPCSTR
|
|
||||||
fFlags*: FILEOP_FLAGS
|
|
||||||
fAnyOperationsAborted*: BOOL
|
|
||||||
hNameMappings*: LPVOID
|
|
||||||
lpszProgressTitle*: LPCSTR # only used if FOF_SIMPLEPROGRESS
|
|
||||||
|
|
||||||
TSHFILEOPSTRUCTA* = SHFILEOPSTRUCTA
|
|
||||||
LPSHFILEOPSTRUCTA* = ptr SHFILEOPSTRUCTA
|
|
||||||
SHFILEOPSTRUCTW* {.final.} = object
|
|
||||||
hwnd*: HWND
|
|
||||||
wFunc*: UINT
|
|
||||||
pFrom*: LPCWSTR
|
|
||||||
pTo*: LPCWSTR
|
|
||||||
fFlags*: FILEOP_FLAGS
|
|
||||||
fAnyOperationsAborted*: BOOL
|
|
||||||
hNameMappings*: LPVOID
|
|
||||||
lpszProgressTitle*: LPCWSTR
|
|
||||||
|
|
||||||
TSHFILEOPSTRUCTW* = SHFILEOPSTRUCTW
|
|
||||||
LPSHFILEOPSTRUCTW* = ptr SHFILEOPSTRUCTW
|
|
||||||
|
|
||||||
when defined(UNICODE):
|
|
||||||
type
|
|
||||||
SHFILEOPSTRUCT* = SHFILEOPSTRUCTW
|
|
||||||
TSHFILEOPSTRUCT* = SHFILEOPSTRUCTW
|
|
||||||
LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
SHFILEOPSTRUCT* = SHFILEOPSTRUCTA
|
|
||||||
TSHFILEOPSTRUCT* = SHFILEOPSTRUCTA
|
|
||||||
LPSHFILEOPSTRUCT* = LPSHFILEOPSTRUCTA
|
|
||||||
proc SHFileOperationA*(lpFileOp: LPSHFILEOPSTRUCTA): int32{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHFileOperationA".}
|
|
||||||
proc SHFileOperationW*(lpFileOp: LPSHFILEOPSTRUCTW): int32{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHFileOperationW".}
|
|
||||||
proc SHFileOperation*(lpFileOp: LPSHFILEOPSTRUCTA): int32{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHFileOperationA".}
|
|
||||||
proc SHFileOperation*(lpFileOp: LPSHFILEOPSTRUCTW): int32{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHFileOperationW".}
|
|
||||||
proc SHFreeNameMappings*(hNameMappings: THandle){.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHFreeNameMappings".}
|
|
||||||
type
|
|
||||||
SHNAMEMAPPINGA* {.final.} = object
|
|
||||||
pszOldPath*: LPSTR
|
|
||||||
pszNewPath*: LPSTR
|
|
||||||
cchOldPath*: int32
|
|
||||||
cchNewPath*: int32
|
|
||||||
|
|
||||||
TSHNAMEMAPPINGA* = SHNAMEMAPPINGA
|
|
||||||
LPSHNAMEMAPPINGA* = ptr SHNAMEMAPPINGA
|
|
||||||
SHNAMEMAPPINGW* {.final.} = object
|
|
||||||
pszOldPath*: LPWSTR
|
|
||||||
pszNewPath*: LPWSTR
|
|
||||||
cchOldPath*: int32
|
|
||||||
cchNewPath*: int32
|
|
||||||
|
|
||||||
TSHNAMEMAPPINGW* = SHNAMEMAPPINGW
|
|
||||||
LPSHNAMEMAPPINGW* = ptr SHNAMEMAPPINGW
|
|
||||||
|
|
||||||
when not(defined(UNICODE)):
|
|
||||||
type
|
|
||||||
SHNAMEMAPPING* = SHNAMEMAPPINGW
|
|
||||||
TSHNAMEMAPPING* = SHNAMEMAPPINGW
|
|
||||||
LPSHNAMEMAPPING* = LPSHNAMEMAPPINGW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
SHNAMEMAPPING* = SHNAMEMAPPINGA
|
|
||||||
TSHNAMEMAPPING* = SHNAMEMAPPINGA
|
|
||||||
LPSHNAMEMAPPING* = LPSHNAMEMAPPINGA
|
|
||||||
#
|
|
||||||
# End Shell File Operations
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Begin ShellExecuteEx and family
|
|
||||||
#
|
|
||||||
# ShellExecute() and ShellExecuteEx() error codes
|
|
||||||
# regular WinExec() codes
|
|
||||||
|
|
||||||
const
|
|
||||||
SE_ERR_FNF* = 2 # file not found
|
|
||||||
SE_ERR_PNF* = 3 # path not found
|
|
||||||
SE_ERR_ACCESSDENIED* = 5 # access denied
|
|
||||||
SE_ERR_OOM* = 8 # out of memory
|
|
||||||
SE_ERR_DLLNOTFOUND* = 32 # endif WINVER >= 0x0400
|
|
||||||
# error values for ShellExecute() beyond the regular WinExec() codes
|
|
||||||
SE_ERR_SHARE* = 26
|
|
||||||
SE_ERR_ASSOCINCOMPLETE* = 27
|
|
||||||
SE_ERR_DDETIMEOUT* = 28
|
|
||||||
SE_ERR_DDEFAIL* = 29
|
|
||||||
SE_ERR_DDEBUSY* = 30
|
|
||||||
SE_ERR_NOASSOC* = 31 #if(WINVER >= 0x0400)}
|
|
||||||
# Note CLASSKEY overrides CLASSNAME
|
|
||||||
SEE_MASK_CLASSNAME* = 0x00000001
|
|
||||||
SEE_MASK_CLASSKEY* = 0x00000003 # Note INVOKEIDLIST overrides IDLIST
|
|
||||||
SEE_MASK_IDLIST* = 0x00000004
|
|
||||||
SEE_MASK_INVOKEIDLIST* = 0x0000000C
|
|
||||||
SEE_MASK_ICON* = 0x00000010
|
|
||||||
SEE_MASK_HOTKEY* = 0x00000020
|
|
||||||
SEE_MASK_NOCLOSEPROCESS* = 0x00000040
|
|
||||||
SEE_MASK_CONNECTNETDRV* = 0x00000080
|
|
||||||
SEE_MASK_FLAG_DDEWAIT* = 0x00000100
|
|
||||||
SEE_MASK_DOENVSUBST* = 0x00000200
|
|
||||||
SEE_MASK_FLAG_NO_UI* = 0x00000400
|
|
||||||
SEE_MASK_UNICODE* = 0x00004000
|
|
||||||
SEE_MASK_NO_CONSOLE* = 0x00008000
|
|
||||||
SEE_MASK_ASYNCOK* = 0x00100000
|
|
||||||
SEE_MASK_HMONITOR* = 0x00200000 #if (_WIN32_IE >= 0x0500)
|
|
||||||
SEE_MASK_NOQUERYCLASSSTORE* = 0x01000000
|
|
||||||
SEE_MASK_WAITFORINPUTIDLE* = 0x02000000 #endif (_WIN32_IE >= 0x500)
|
|
||||||
#if (_WIN32_IE >= 0x0560)
|
|
||||||
SEE_MASK_FLAG_LOG_USAGE* = 0x04000000 #endif
|
|
||||||
# (_WIN32_IE >= 0x560)
|
|
||||||
|
|
||||||
type
|
|
||||||
SHELLEXECUTEINFOA* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
fMask*: ULONG
|
|
||||||
hwnd*: HWND
|
|
||||||
lpVerb*: LPCSTR
|
|
||||||
lpFile*: LPCSTR
|
|
||||||
lpParameters*: LPCSTR
|
|
||||||
lpDirectory*: LPCSTR
|
|
||||||
nShow*: int32
|
|
||||||
hInstApp*: HINST
|
|
||||||
lpIDList*: LPVOID
|
|
||||||
lpClass*: LPCSTR
|
|
||||||
hkeyClass*: HKEY
|
|
||||||
dwHotKey*: DWORD
|
|
||||||
hMonitor*: HANDLE # also: hIcon
|
|
||||||
hProcess*: HANDLE
|
|
||||||
|
|
||||||
TSHELLEXECUTEINFOA* = SHELLEXECUTEINFOA
|
|
||||||
LPSHELLEXECUTEINFOA* = ptr SHELLEXECUTEINFOA
|
|
||||||
SHELLEXECUTEINFOW* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
fMask*: ULONG
|
|
||||||
hwnd*: HWND
|
|
||||||
lpVerb*: lpcwstr
|
|
||||||
lpFile*: lpcwstr
|
|
||||||
lpParameters*: lpcwstr
|
|
||||||
lpDirectory*: lpcwstr
|
|
||||||
nShow*: int32
|
|
||||||
hInstApp*: HINST
|
|
||||||
lpIDList*: LPVOID
|
|
||||||
lpClass*: LPCWSTR
|
|
||||||
hkeyClass*: HKEY
|
|
||||||
dwHotKey*: DWORD
|
|
||||||
hMonitor*: HANDLE # also: hIcon
|
|
||||||
hProcess*: HANDLE
|
|
||||||
|
|
||||||
TSHELLEXECUTEINFOW* = SHELLEXECUTEINFOW
|
|
||||||
LPSHELLEXECUTEINFOW* = ptr SHELLEXECUTEINFOW
|
|
||||||
|
|
||||||
when defined(UNICODE):
|
|
||||||
type
|
|
||||||
SHELLEXECUTEINFO* = SHELLEXECUTEINFOW
|
|
||||||
TSHELLEXECUTEINFO* = SHELLEXECUTEINFOW
|
|
||||||
LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
SHELLEXECUTEINFO* = SHELLEXECUTEINFOA
|
|
||||||
TSHELLEXECUTEINFO* = SHELLEXECUTEINFOA
|
|
||||||
LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOA
|
|
||||||
proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ShellExecuteExA".}
|
|
||||||
proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ShellExecuteExW".}
|
|
||||||
proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ShellExecuteExA".}
|
|
||||||
proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "ShellExecuteExW".}
|
|
||||||
proc WinExecErrorA*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
|
|
||||||
lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "WinExecErrorA".}
|
|
||||||
proc WinExecErrorW*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
|
|
||||||
lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "WinExecErrorW".}
|
|
||||||
proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
|
|
||||||
lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "WinExecErrorA".}
|
|
||||||
proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
|
|
||||||
lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
|
|
||||||
importc: "WinExecErrorW".}
|
|
||||||
type
|
|
||||||
SHCREATEPROCESSINFOW* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
fMask*: ULONG
|
|
||||||
hwnd*: HWND
|
|
||||||
pszFile*: LPCWSTR
|
|
||||||
pszParameters*: LPCWSTR
|
|
||||||
pszCurrentDirectory*: LPCWSTR
|
|
||||||
hUserToken*: HANDLE
|
|
||||||
lpProcessAttributes*: LPSECURITY_ATTRIBUTES
|
|
||||||
lpThreadAttributes*: LPSECURITY_ATTRIBUTES
|
|
||||||
bInheritHandles*: BOOL
|
|
||||||
dwCreationFlags*: DWORD
|
|
||||||
lpStartupInfo*: LPSTARTUPINFOW
|
|
||||||
lpProcessInformation*: LPPROCESS_INFORMATION
|
|
||||||
|
|
||||||
TSHCREATEPROCESSINFOW* = SHCREATEPROCESSINFOW
|
|
||||||
PSHCREATEPROCESSINFOW* = ptr SHCREATEPROCESSINFOW
|
|
||||||
|
|
||||||
proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHCreateProcessAsUserW".}
|
|
||||||
#
|
|
||||||
# End ShellExecuteEx and family }
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# RecycleBin
|
|
||||||
#
|
|
||||||
# struct for query recycle bin info
|
|
||||||
type
|
|
||||||
SHQUERYRBINFO* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
i64Size*: int64
|
|
||||||
i64NumItems*: int64
|
|
||||||
|
|
||||||
TSHQUERYRBINFO* = SHQUERYRBINFO
|
|
||||||
LPSHQUERYRBINFO* = ptr SHQUERYRBINFO # flags for SHEmptyRecycleBin
|
|
||||||
|
|
||||||
const
|
|
||||||
SHERB_NOCONFIRMATION* = 0x00000001
|
|
||||||
SHERB_NOPROGRESSUI* = 0x00000002
|
|
||||||
SHERB_NOSOUND* = 0x00000004
|
|
||||||
|
|
||||||
proc SHQueryRecycleBinA*(pszRootPath: LPCSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinA".}
|
|
||||||
proc SHQueryRecycleBinW*(pszRootPath: LPCWSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinW".}
|
|
||||||
proc SHQueryRecycleBin*(pszRootPath: LPCSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinA".}
|
|
||||||
proc SHQueryRecycleBin*(pszRootPath: LPCWSTR, pSHQueryRBInfo: LPSHQUERYRBINFO): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHQueryRecycleBinW".}
|
|
||||||
proc SHEmptyRecycleBinA*(hwnd: HWND, pszRootPath: LPCSTR, dwFlags: DWORD): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinA".}
|
|
||||||
proc SHEmptyRecycleBinW*(hwnd: HWND, pszRootPath: LPCWSTR, dwFlags: DWORD): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinW".}
|
|
||||||
proc SHEmptyRecycleBin*(hwnd: HWND, pszRootPath: LPCSTR, dwFlags: DWORD): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinA".}
|
|
||||||
proc SHEmptyRecycleBin*(hwnd: HWND, pszRootPath: LPCWSTR, dwFlags: DWORD): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHEmptyRecycleBinW".}
|
|
||||||
#
|
|
||||||
# end of RecycleBin
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Tray notification definitions
|
|
||||||
#
|
|
||||||
type
|
|
||||||
NOTIFYICONDATAA* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
hWnd*: HWND
|
|
||||||
uID*: UINT
|
|
||||||
uFlags*: UINT
|
|
||||||
uCallbackMessage*: UINT
|
|
||||||
hIcon*: HICON
|
|
||||||
szTip*: array[0..127, CHAR]
|
|
||||||
dwState*: DWORD
|
|
||||||
dwStateMask*: DWORD
|
|
||||||
szInfo*: array[0..255, CHAR]
|
|
||||||
uTimeout*: UINT # also: uVersion
|
|
||||||
szInfoTitle*: array[0..63, CHAR]
|
|
||||||
dwInfoFlags*: DWORD
|
|
||||||
guidItem*: TGUID
|
|
||||||
|
|
||||||
TNOTIFYICONDATAA* = NOTIFYICONDATAA
|
|
||||||
PNOTIFYICONDATAA* = ptr NOTIFYICONDATAA
|
|
||||||
NOTIFYICONDATAW* {.final.} = object
|
|
||||||
cbSize*: DWORD
|
|
||||||
hWnd*: HWND
|
|
||||||
uID*: UINT
|
|
||||||
uFlags*: UINT
|
|
||||||
uCallbackMessage*: UINT
|
|
||||||
hIcon*: HICON
|
|
||||||
szTip*: array[0..127, WCHAR]
|
|
||||||
dwState*: DWORD
|
|
||||||
dwStateMask*: DWORD
|
|
||||||
szInfo*: array[0..255, WCHAR]
|
|
||||||
uTimeout*: UINT # also uVersion : UINT
|
|
||||||
szInfoTitle*: array[0..63, CHAR]
|
|
||||||
dwInfoFlags*: DWORD
|
|
||||||
guidItem*: TGUID
|
|
||||||
|
|
||||||
TNOTIFYICONDATAW* = NOTIFYICONDATAW
|
|
||||||
PNOTIFYICONDATAW* = ptr NOTIFYICONDATAW
|
|
||||||
|
|
||||||
when defined(UNICODE):
|
|
||||||
type
|
|
||||||
NOTIFYICONDATA* = NOTIFYICONDATAW
|
|
||||||
TNOTIFYICONDATA* = NOTIFYICONDATAW
|
|
||||||
PNOTIFYICONDATA* = PNOTIFYICONDATAW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
NOTIFYICONDATA* = NOTIFYICONDATAA
|
|
||||||
TNOTIFYICONDATA* = NOTIFYICONDATAA
|
|
||||||
PNOTIFYICONDATA* = PNOTIFYICONDATAA
|
|
||||||
const
|
|
||||||
NIN_SELECT* = WM_USER + 0
|
|
||||||
NINF_KEY* = 0x00000001
|
|
||||||
NIN_KEYSELECT* = NIN_SELECT or NINF_KEY
|
|
||||||
NIN_BALLOONSHOW* = WM_USER + 2
|
|
||||||
NIN_BALLOONHIDE* = WM_USER + 3
|
|
||||||
NIN_BALLOONTIMEOUT* = WM_USER + 4
|
|
||||||
NIN_BALLOONUSERCLICK* = WM_USER + 5
|
|
||||||
NIM_ADD* = 0x00000000
|
|
||||||
NIM_MODIFY* = 0x00000001
|
|
||||||
NIM_DELETE* = 0x00000002
|
|
||||||
NIM_SETFOCUS* = 0x00000003
|
|
||||||
NIM_SETVERSION* = 0x00000004
|
|
||||||
NOTIFYICON_VERSION* = 3
|
|
||||||
NIF_MESSAGE* = 0x00000001
|
|
||||||
NIF_ICON* = 0x00000002
|
|
||||||
NIF_TIP* = 0x00000004
|
|
||||||
NIF_STATE* = 0x00000008
|
|
||||||
NIF_INFO* = 0x00000010
|
|
||||||
NIF_GUID* = 0x00000020
|
|
||||||
NIS_HIDDEN* = 0x00000001
|
|
||||||
NIS_SHAREDICON* = 0x00000002 # says this is the source of a shared icon
|
|
||||||
# Notify Icon Infotip flags
|
|
||||||
NIIF_NONE* = 0x00000000 # icon flags are mutually exclusive
|
|
||||||
# and take only the lowest 2 bits
|
|
||||||
NIIF_INFO* = 0x00000001
|
|
||||||
NIIF_WARNING* = 0x00000002
|
|
||||||
NIIF_ERROR* = 0x00000003
|
|
||||||
NIIF_ICON_MASK* = 0x0000000F
|
|
||||||
NIIF_NOSOUND* = 0x00000010
|
|
||||||
|
|
||||||
proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
|
|
||||||
proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
|
|
||||||
proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
|
|
||||||
proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
|
|
||||||
#
|
|
||||||
# The SHGetFileInfo API provides an easy way to get attributes
|
|
||||||
# for a file given a pathname.
|
|
||||||
#
|
|
||||||
# PARAMETERS
|
|
||||||
#
|
|
||||||
# pszPath file name to get info about
|
|
||||||
# dwFileAttributes file attribs, only used with SHGFI_USEFILEATTRIBUTES
|
|
||||||
# psfi place to return file info
|
|
||||||
# cbFileInfo size of structure
|
|
||||||
# uFlags flags
|
|
||||||
#
|
|
||||||
# RETURN
|
|
||||||
# TRUE if things worked
|
|
||||||
#
|
|
||||||
# out: icon
|
|
||||||
# out: icon index
|
|
||||||
# out: SFGAO_ flags
|
|
||||||
# out: display name (or path)
|
|
||||||
# out: type name
|
|
||||||
type
|
|
||||||
SHFILEINFOA* {.final.} = object
|
|
||||||
hIcon*: HICON # out: icon
|
|
||||||
iIcon*: int32 # out: icon index
|
|
||||||
dwAttributes*: DWORD # out: SFGAO_ flags
|
|
||||||
szDisplayName*: array[0..(MAX_PATH) - 1, CHAR] # out: display name (or path)
|
|
||||||
szTypeName*: array[0..79, CHAR] # out: type name
|
|
||||||
|
|
||||||
TSHFILEINFOA* = SHFILEINFOA
|
|
||||||
pSHFILEINFOA* = ptr SHFILEINFOA
|
|
||||||
SHFILEINFOW* {.final.} = object
|
|
||||||
hIcon*: HICON # out: icon
|
|
||||||
iIcon*: int32 # out: icon index
|
|
||||||
dwAttributes*: DWORD # out: SFGAO_ flags
|
|
||||||
szDisplayName*: array[0..(MAX_PATH) - 1, WCHAR] # out: display name (or path)
|
|
||||||
szTypeName*: array[0..79, WCHAR] # out: type name
|
|
||||||
|
|
||||||
TSHFILEINFOW* = SHFILEINFOW
|
|
||||||
pSHFILEINFOW* = ptr SHFILEINFOW
|
|
||||||
|
|
||||||
when defined(UNICODE):
|
|
||||||
type
|
|
||||||
SHFILEINFO* = SHFILEINFOW
|
|
||||||
TSHFILEINFO* = SHFILEINFOW
|
|
||||||
pFILEINFO* = SHFILEINFOW
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
SHFILEINFO* = SHFILEINFOA
|
|
||||||
TSHFILEINFO* = SHFILEINFOA
|
|
||||||
pFILEINFO* = SHFILEINFOA
|
|
||||||
# NOTE: This is also in shlwapi.h. Please keep in synch.
|
|
||||||
|
|
||||||
const
|
|
||||||
SHGFI_ICON* = 0x00000100 # get Icon
|
|
||||||
SHGFI_DISPLAYNAME* = 0x00000200 # get display name
|
|
||||||
SHGFI_TYPENAME* = 0x00000400 # get type name
|
|
||||||
SHGFI_ATTRIBUTES* = 0x00000800 # get attributes
|
|
||||||
SHGFI_ICONLOCATION* = 0x00001000 # get icon location
|
|
||||||
SHGFI_EXETYPE* = 0x00002000 # return exe type
|
|
||||||
SHGFI_SYSICONINDEX* = 0x00004000 # get system icon index
|
|
||||||
SHGFI_LINKOVERLAY* = 0x00008000 # put a link overlay on icon
|
|
||||||
SHGFI_SELECTED* = 0x00010000 # show icon in selected state
|
|
||||||
SHGFI_ATTR_SPECIFIED* = 0x00020000 # get only specified attributes
|
|
||||||
SHGFI_LARGEICON* = 0x00000000 # get large icon
|
|
||||||
SHGFI_SMALLICON* = 0x00000001 # get small icon
|
|
||||||
SHGFI_OPENICON* = 0x00000002 # get open icon
|
|
||||||
SHGFI_SHELLICONSIZE* = 0x00000004 # get shell size icon
|
|
||||||
SHGFI_PIDL* = 0x00000008 # pszPath is a pidl
|
|
||||||
SHGFI_USEFILEATTRIBUTES* = 0x00000010 # use passed dwFileAttribute
|
|
||||||
SHGFI_ADDOVERLAYS* = 0x00000020 # apply the appropriate overlays
|
|
||||||
SHGFI_OVERLAYINDEX* = 0x00000040 # Get the index of the overlay
|
|
||||||
# in the upper 8 bits of the iIcon
|
|
||||||
|
|
||||||
proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
|
|
||||||
proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: pSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
|
|
||||||
proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
|
|
||||||
proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
|
|
||||||
proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
|
|
||||||
proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
|
|
||||||
proc SHGetFileInfo*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
|
|
||||||
psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
|
|
||||||
proc SHGetDiskFreeSpaceExA*(pszDirectoryName: LPCSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
|
|
||||||
proc SHGetDiskFreeSpaceExW*(pszDirectoryName: LPCWSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
|
|
||||||
proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
|
|
||||||
proc SHGetDiskFreeSpace*(pszDirectoryName: LPCSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
|
|
||||||
proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCWSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
|
|
||||||
proc SHGetDiskFreeSpace*(pszDirectoryName: LPCWSTR,
|
|
||||||
pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfBytes: pULARGE_INTEGER,
|
|
||||||
pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
|
|
||||||
proc SHGetNewLinkInfoA*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
|
|
||||||
pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
|
|
||||||
proc SHGetNewLinkInfoW*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
|
|
||||||
pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
|
|
||||||
proc SHGetNewLinkInfo*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
|
|
||||||
pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
|
|
||||||
proc SHGetNewLinkInfo*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
|
|
||||||
pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
|
|
||||||
const
|
|
||||||
SHGNLI_PIDL* = 0x00000001 # pszLinkTo is a pidl
|
|
||||||
SHGNLI_PREFIXNAME* = 0x00000002 # Make name "Shortcut to xxx"
|
|
||||||
SHGNLI_NOUNIQUE* = 0x00000004 # don't do the unique name generation
|
|
||||||
SHGNLI_NOLNK* = 0x00000008 # don't add ".lnk" extension
|
|
||||||
PRINTACTION_OPEN* = 0
|
|
||||||
PRINTACTION_PROPERTIES* = 1
|
|
||||||
PRINTACTION_NETINSTALL* = 2
|
|
||||||
PRINTACTION_NETINSTALLLINK* = 3
|
|
||||||
PRINTACTION_TESTPAGE* = 4
|
|
||||||
PRINTACTION_OPENNETPRN* = 5
|
|
||||||
PRINTACTION_DOCUMENTDEFAULTS* = 6
|
|
||||||
PRINTACTION_SERVERPROPERTIES* = 7
|
|
||||||
|
|
||||||
proc SHInvokePrinterCommandA*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
|
|
||||||
lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
|
|
||||||
proc SHInvokePrinterCommandW*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
|
|
||||||
lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
|
|
||||||
proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
|
|
||||||
lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
|
|
||||||
proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
|
|
||||||
lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
|
|
||||||
proc SHLoadNonloadedIconOverlayIdentifiers*(): HResult{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
|
|
||||||
proc SHIsFileAvailableOffline*(pwszPath: LPCWSTR, pdwStatus: LPDWORD): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHIsFileAvailableOffline".}
|
|
||||||
const
|
|
||||||
OFFLINE_STATUS_LOCAL* = 0x00000001 # If open, it's open locally
|
|
||||||
OFFLINE_STATUS_REMOTE* = 0x00000002 # If open, it's open remotely
|
|
||||||
OFFLINE_STATUS_INCOMPLETE* = 0x00000004 # The local copy is currently incomplete.
|
|
||||||
# The file will not be available offline
|
|
||||||
# until it has been synchronized.
|
|
||||||
# sets the specified path to use the string resource
|
|
||||||
# as the UI instead of the file system name
|
|
||||||
|
|
||||||
proc SHSetLocalizedName*(pszPath: LPWSTR, pszResModule: LPCWSTR, idsRes: int32): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHSetLocalizedName".}
|
|
||||||
proc SHEnumerateUnreadMailAccountsA*(hKeyUser: HKEY, dwIndex: DWORD,
|
|
||||||
pszMailAddress: LPSTR,
|
|
||||||
cchMailAddress: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsA".}
|
|
||||||
proc SHEnumerateUnreadMailAccountsW*(hKeyUser: HKEY, dwIndex: DWORD,
|
|
||||||
pszMailAddress: LPWSTR,
|
|
||||||
cchMailAddress: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsW".}
|
|
||||||
proc SHEnumerateUnreadMailAccounts*(hKeyUser: HKEY, dwIndex: DWORD,
|
|
||||||
pszMailAddress: LPWSTR,
|
|
||||||
cchMailAddress: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHEnumerateUnreadMailAccountsW".}
|
|
||||||
proc SHGetUnreadMailCountA*(hKeyUser: HKEY, pszMailAddress: LPCSTR,
|
|
||||||
pdwCount: PDWORD, pFileTime: PFILETIME,
|
|
||||||
pszShellExecuteCommand: LPSTR,
|
|
||||||
cchShellExecuteCommand: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetUnreadMailCountA".}
|
|
||||||
proc SHGetUnreadMailCountW*(hKeyUser: HKEY, pszMailAddress: LPCWSTR,
|
|
||||||
pdwCount: PDWORD, pFileTime: PFILETIME,
|
|
||||||
pszShellExecuteCommand: LPWSTR,
|
|
||||||
cchShellExecuteCommand: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetUnreadMailCountW".}
|
|
||||||
proc SHGetUnreadMailCount*(hKeyUser: HKEY, pszMailAddress: LPCSTR,
|
|
||||||
pdwCount: PDWORD, pFileTime: PFILETIME,
|
|
||||||
pszShellExecuteCommand: LPSTR,
|
|
||||||
cchShellExecuteCommand: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetUnreadMailCountA".}
|
|
||||||
proc SHGetUnreadMailCount*(hKeyUser: HKEY, pszMailAddress: LPCWSTR,
|
|
||||||
pdwCount: PDWORD, pFileTime: PFILETIME,
|
|
||||||
pszShellExecuteCommand: LPWSTR,
|
|
||||||
cchShellExecuteCommand: int32): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHGetUnreadMailCountW".}
|
|
||||||
proc SHSetUnreadMailCountA*(pszMailAddress: LPCSTR, dwCount: DWORD,
|
|
||||||
pszShellExecuteCommand: LPCSTR): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHSetUnreadMailCountA".}
|
|
||||||
proc SHSetUnreadMailCountW*(pszMailAddress: LPCWSTR, dwCount: DWORD,
|
|
||||||
pszShellExecuteCommand: LPCWSTR): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHSetUnreadMailCountW".}
|
|
||||||
proc SHSetUnreadMailCount*(pszMailAddress: LPCSTR, dwCount: DWORD,
|
|
||||||
pszShellExecuteCommand: LPCSTR): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHSetUnreadMailCountA".}
|
|
||||||
proc SHSetUnreadMailCount*(pszMailAddress: LPCWSTR, dwCount: DWORD,
|
|
||||||
pszShellExecuteCommand: LPCWSTR): HRESULT{.stdcall,
|
|
||||||
dynlib: "shell32.dll", importc: "SHSetUnreadMailCountW".}
|
|
||||||
proc SHGetImageList*(iImageList: int32, riid: TIID, ppvObj: ptr pointer): HRESULT{.
|
|
||||||
stdcall, dynlib: "shell32.dll", importc: "SHGetImageList".}
|
|
||||||
const
|
|
||||||
SHIL_LARGE* = 0 # normally 32x32
|
|
||||||
SHIL_SMALL* = 1 # normally 16x16
|
|
||||||
SHIL_EXTRALARGE* = 2
|
|
||||||
SHIL_SYSSMALL* = 3 # like SHIL_SMALL, but tracks system small icon metric correctly
|
|
||||||
SHIL_LAST* = SHIL_SYSSMALL
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc EIRESID(x: int32): int32 =
|
|
||||||
result = -x
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2006 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# shfolder.dll is distributed standard with IE5.5, so it should ship
|
|
||||||
# with 2000/XP or higher but is likely to be installed on NT/95/98 or
|
|
||||||
# ME as well. It works on all these systems.
|
|
||||||
#
|
|
||||||
# The info found here is also in the registry:
|
|
||||||
# HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\
|
|
||||||
# HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\
|
|
||||||
#
|
|
||||||
# Note that not all CSIDL_* constants are supported by shlfolder.dll,
|
|
||||||
# they should be supported by the shell32.dll, though again not on all
|
|
||||||
# systems.
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
{.deadCodeElim: on.}
|
|
||||||
|
|
||||||
import
|
|
||||||
windows
|
|
||||||
|
|
||||||
const
|
|
||||||
LibName* = "SHFolder.dll"
|
|
||||||
|
|
||||||
const
|
|
||||||
CSIDL_PROGRAMS* = 0x00000002 # %SYSTEMDRIVE%\Program Files
|
|
||||||
CSIDL_PERSONAL* = 0x00000005 # %USERPROFILE%\My Documents
|
|
||||||
CSIDL_FAVORITES* = 0x00000006 # %USERPROFILE%\Favorites
|
|
||||||
CSIDL_STARTUP* = 0x00000007 # %USERPROFILE%\Start menu\Programs\Startup
|
|
||||||
CSIDL_RECENT* = 0x00000008 # %USERPROFILE%\Recent
|
|
||||||
CSIDL_SENDTO* = 0x00000009 # %USERPROFILE%\Sendto
|
|
||||||
CSIDL_STARTMENU* = 0x0000000B # %USERPROFILE%\Start menu
|
|
||||||
CSIDL_MYMUSIC* = 0x0000000D # %USERPROFILE%\Documents\My Music
|
|
||||||
CSIDL_MYVIDEO* = 0x0000000E # %USERPROFILE%\Documents\My Videos
|
|
||||||
CSIDL_DESKTOPDIRECTORY* = 0x00000010 # %USERPROFILE%\Desktop
|
|
||||||
CSIDL_NETHOOD* = 0x00000013 # %USERPROFILE%\NetHood
|
|
||||||
CSIDL_TEMPLATES* = 0x00000015 # %USERPROFILE%\Templates
|
|
||||||
CSIDL_COMMON_STARTMENU* = 0x00000016 # %PROFILEPATH%\All users\Start menu
|
|
||||||
CSIDL_COMMON_PROGRAMS* = 0x00000017 # %PROFILEPATH%\All users\Start menu\Programs
|
|
||||||
CSIDL_COMMON_STARTUP* = 0x00000018 # %PROFILEPATH%\All users\Start menu\Programs\Startup
|
|
||||||
CSIDL_COMMON_DESKTOPDIRECTORY* = 0x00000019 # %PROFILEPATH%\All users\Desktop
|
|
||||||
CSIDL_APPDATA* = 0x0000001A # %USERPROFILE%\Application Data (roaming)
|
|
||||||
CSIDL_PRINTHOOD* = 0x0000001B # %USERPROFILE%\Printhood
|
|
||||||
CSIDL_LOCAL_APPDATA* = 0x0000001C # %USERPROFILE%\Local Settings\Application Data (non roaming)
|
|
||||||
CSIDL_COMMON_FAVORITES* = 0x0000001F # %PROFILEPATH%\All users\Favorites
|
|
||||||
CSIDL_INTERNET_CACHE* = 0x00000020 # %USERPROFILE%\Local Settings\Temporary Internet Files
|
|
||||||
CSIDL_COOKIES* = 0x00000021 # %USERPROFILE%\Cookies
|
|
||||||
CSIDL_HISTORY* = 0x00000022 # %USERPROFILE%\Local settings\History
|
|
||||||
CSIDL_COMMON_APPDATA* = 0x00000023 # %PROFILESPATH%\All Users\Application Data
|
|
||||||
CSIDL_WINDOWS* = 0x00000024 # %SYSTEMROOT%
|
|
||||||
CSIDL_SYSTEM* = 0x00000025 # %SYSTEMROOT%\SYSTEM32 (may be system on 95/98/ME)
|
|
||||||
CSIDL_PROGRAM_FILES* = 0x00000026 # %SYSTEMDRIVE%\Program Files
|
|
||||||
CSIDL_MYPICTURES* = 0x00000027 # %USERPROFILE%\My Documents\My Pictures
|
|
||||||
CSIDL_PROFILE* = 0x00000028 # %USERPROFILE%
|
|
||||||
CSIDL_PROGRAM_FILES_COMMON* = 0x0000002B # %SYSTEMDRIVE%\Program Files\Common
|
|
||||||
CSIDL_COMMON_TEMPLATES* = 0x0000002D # %PROFILEPATH%\All Users\Templates
|
|
||||||
CSIDL_COMMON_DOCUMENTS* = 0x0000002E # %PROFILEPATH%\All Users\Documents
|
|
||||||
CSIDL_COMMON_ADMINTOOLS* = 0x0000002F # %PROFILEPATH%\All Users\Start Menu\Programs\Administrative Tools
|
|
||||||
CSIDL_ADMINTOOLS* = 0x00000030 # %USERPROFILE%\Start Menu\Programs\Administrative Tools
|
|
||||||
CSIDL_COMMON_MUSIC* = 0x00000035 # %PROFILEPATH%\All Users\Documents\my music
|
|
||||||
CSIDL_COMMON_PICTURES* = 0x00000036 # %PROFILEPATH%\All Users\Documents\my pictures
|
|
||||||
CSIDL_COMMON_VIDEO* = 0x00000037 # %PROFILEPATH%\All Users\Documents\my videos
|
|
||||||
CSIDL_CDBURN_AREA* = 0x0000003B # %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
|
|
||||||
CSIDL_PROFILES* = 0x0000003E # %PROFILEPATH%
|
|
||||||
CSIDL_FLAG_CREATE* = 0x00008000 # (force creation of requested folder if it doesn't exist yet)
|
|
||||||
# Original entry points
|
|
||||||
|
|
||||||
proc SHGetFolderPathA*(Ahwnd: HWND, Csidl: int, Token: THandle, Flags: DWord,
|
|
||||||
Path: cstring): HRESULT{.stdcall, dynlib: LibName,
|
|
||||||
importc: "SHGetFolderPathA".}
|
|
||||||
proc SHGetFolderPathW*(Ahwnd: HWND, Csidl: int, Token: THandle, Flags: DWord,
|
|
||||||
Path: cstring): HRESULT{.stdcall, dynlib: LibName,
|
|
||||||
importc: "SHGetFolderPathW".}
|
|
||||||
proc SHGetFolderPath*(Ahwnd: HWND, Csidl: int, Token: THandle, Flags: DWord,
|
|
||||||
Path: cstring): HRESULT{.stdcall, dynlib: LibName,
|
|
||||||
importc: "SHGetFolderPathA".}
|
|
||||||
type
|
|
||||||
PFNSHGetFolderPathA* = proc (Ahwnd: HWND, Csidl: int, Token: THandle,
|
|
||||||
Flags: DWord, Path: cstring): HRESULT{.stdcall.}
|
|
||||||
PFNSHGetFolderPathW* = proc (Ahwnd: HWND, Csidl: int, Token: THandle,
|
|
||||||
Flags: DWord, Path: cstring): HRESULT{.stdcall.}
|
|
||||||
PFNSHGetFolderPath* = PFNSHGetFolderPathA
|
|
||||||
TSHGetFolderPathA* = PFNSHGetFolderPathA
|
|
||||||
TSHGetFolderPathW* = PFNSHGetFolderPathW
|
|
||||||
TSHGetFolderPath* = TSHGetFolderPathA
|
|
||||||
|
|
||||||
23945
lib/windows/windows.nim
23945
lib/windows/windows.nim
File diff suppressed because it is too large
Load diff
|
|
@ -1,733 +0,0 @@
|
||||||
#* cairo - a vector graphics library with display and print output
|
|
||||||
# *
|
|
||||||
# * Copyright © 2002 University of Southern California
|
|
||||||
# * Copyright © 2005 Red Hat, Inc.
|
|
||||||
# *
|
|
||||||
# * This library is free software; you can redistribute it and/or
|
|
||||||
# * modify it either under the terms of the GNU Lesser General Public
|
|
||||||
# * License version 2.1 as published by the Free Software Foundation
|
|
||||||
# * (the "LGPL") or, at your option, under the terms of the Mozilla
|
|
||||||
# * Public License Version 1.1 (the "MPL"). If you do not alter this
|
|
||||||
# * notice, a recipient may use your version of this file under either
|
|
||||||
# * the MPL or the LGPL.
|
|
||||||
# *
|
|
||||||
# * You should have received a copy of the LGPL along with this library
|
|
||||||
# * in the file COPYING-LGPL-2.1; if not, write to the Free Software
|
|
||||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
# * You should have received a copy of the MPL along with this library
|
|
||||||
# * in the file COPYING-MPL-1.1
|
|
||||||
# *
|
|
||||||
# * The contents of this file are subject to the Mozilla Public License
|
|
||||||
# * Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
# * compliance with the License. You may obtain a copy of the License at
|
|
||||||
# * http://www.mozilla.org/MPL/
|
|
||||||
# *
|
|
||||||
# * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
|
|
||||||
# * OF ANY KIND, either express or implied. See the LGPL or the MPL for
|
|
||||||
# * the specific language governing rights and limitations.
|
|
||||||
# *
|
|
||||||
# * The Original Code is the cairo graphics library.
|
|
||||||
# *
|
|
||||||
# * The Initial Developer of the Original Code is University of Southern
|
|
||||||
# * California.
|
|
||||||
# *
|
|
||||||
# * Contributor(s):
|
|
||||||
# * Carl D. Worth <cworth@cworth.org>
|
|
||||||
# #*
|
|
||||||
# * This FreePascal binding generated August 26, 2005
|
|
||||||
# * by Jeffrey Pohlmeyer <yetanothergeek@yahoo.com>
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
|
||||||
# - Updated to cairo version 1.4
|
|
||||||
# - Grouped OS specific fuctions in separated units
|
|
||||||
# - Organized the functions by group and ordered exactly as the c header
|
|
||||||
# - Cleared parameter list syntax according to pascal standard
|
|
||||||
#
|
|
||||||
# By Luiz Américo Pereira Câmara
|
|
||||||
# October 2007
|
|
||||||
#
|
|
||||||
|
|
||||||
include "cairo_pragma.nim"
|
|
||||||
|
|
||||||
type
|
|
||||||
PByte = cstring
|
|
||||||
TStatus* = enum
|
|
||||||
STATUS_SUCCESS = 0,
|
|
||||||
STATUS_NO_MEMORY,
|
|
||||||
STATUS_INVALID_RESTORE,
|
|
||||||
STATUS_INVALID_POP_GROUP,
|
|
||||||
STATUS_NO_CURRENT_POINT,
|
|
||||||
STATUS_INVALID_MATRIX,
|
|
||||||
STATUS_INVALID_STATUS,
|
|
||||||
STATUS_NULL_POINTER,
|
|
||||||
STATUS_INVALID_STRING,
|
|
||||||
STATUS_INVALID_PATH_DATA,
|
|
||||||
STATUS_READ_ERROR,
|
|
||||||
STATUS_WRITE_ERROR,
|
|
||||||
STATUS_SURFACE_FINISHED,
|
|
||||||
STATUS_SURFACE_TYPE_MISMATCH,
|
|
||||||
STATUS_PATTERN_TYPE_MISMATCH,
|
|
||||||
STATUS_INVALID_CONTENT,
|
|
||||||
STATUS_INVALID_FORMAT,
|
|
||||||
STATUS_INVALID_VISUAL,
|
|
||||||
STATUS_FILE_NOT_FOUND,
|
|
||||||
STATUS_INVALID_DASH,
|
|
||||||
STATUS_INVALID_DSC_COMMENT,
|
|
||||||
STATUS_INVALID_INDEX,
|
|
||||||
STATUS_CLIP_NOT_REPRESENTABLE,
|
|
||||||
STATUS_TEMP_FILE_ERROR,
|
|
||||||
STATUS_INVALID_STRIDE,
|
|
||||||
STATUS_FONT_TYPE_MISMATCH,
|
|
||||||
STATUS_USER_FONT_IMMUTABLE,
|
|
||||||
STATUS_USER_FONT_ERROR,
|
|
||||||
STATUS_NEGATIVE_COUNT,
|
|
||||||
STATUS_INVALID_CLUSTERS,
|
|
||||||
STATUS_INVALID_SLANT,
|
|
||||||
STATUS_INVALID_WEIGHT
|
|
||||||
|
|
||||||
|
|
||||||
TOperator* = enum
|
|
||||||
OPERATOR_CLEAR, OPERATOR_SOURCE, OPERATOR_OVER, OPERATOR_IN, OPERATOR_OUT,
|
|
||||||
OPERATOR_ATOP, OPERATOR_DEST, OPERATOR_DEST_OVER, OPERATOR_DEST_IN,
|
|
||||||
OPERATOR_DEST_OUT, OPERATOR_DEST_ATOP, OPERATOR_XOR, OPERATOR_ADD,
|
|
||||||
OPERATOR_SATURATE
|
|
||||||
TAntialias* = enum
|
|
||||||
ANTIALIAS_DEFAULT, ANTIALIAS_NONE, ANTIALIAS_GRAY, ANTIALIAS_SUBPIXEL
|
|
||||||
TFillRule* = enum
|
|
||||||
FILL_RULE_WINDING, FILL_RULE_EVEN_ODD
|
|
||||||
TLineCap* = enum
|
|
||||||
LINE_CAP_BUTT, LINE_CAP_ROUND, LINE_CAP_SQUARE
|
|
||||||
TLineJoin* = enum
|
|
||||||
LINE_JOIN_MITER, LINE_JOIN_ROUND, LINE_JOIN_BEVEL
|
|
||||||
TFontSlant* = enum
|
|
||||||
FONT_SLANT_NORMAL, FONT_SLANT_ITALIC, FONT_SLANT_OBLIQUE
|
|
||||||
TFontWeight* = enum
|
|
||||||
FONT_WEIGHT_NORMAL, FONT_WEIGHT_BOLD
|
|
||||||
TSubpixelOrder* = enum
|
|
||||||
SUBPIXEL_ORDER_DEFAULT, SUBPIXEL_ORDER_RGB, SUBPIXEL_ORDER_BGR,
|
|
||||||
SUBPIXEL_ORDER_VRGB, SUBPIXEL_ORDER_VBGR
|
|
||||||
THintStyle* = enum
|
|
||||||
HINT_STYLE_DEFAULT, HINT_STYLE_NONE, HINT_STYLE_SLIGHT, HINT_STYLE_MEDIUM,
|
|
||||||
HINT_STYLE_FULL
|
|
||||||
THintMetrics* = enum
|
|
||||||
HINT_METRICS_DEFAULT, HINT_METRICS_OFF, HINT_METRICS_ON
|
|
||||||
TPathDataType* = enum
|
|
||||||
PATH_MOVE_TO, PATH_LINE_TO, PATH_CURVE_TO, PATH_CLOSE_PATH
|
|
||||||
TContent* = enum
|
|
||||||
CONTENT_COLOR = 0x00001000, CONTENT_ALPHA = 0x00002000,
|
|
||||||
CONTENT_COLOR_ALPHA = 0x00003000
|
|
||||||
TFormat* = enum
|
|
||||||
FORMAT_ARGB32, FORMAT_RGB24, FORMAT_A8, FORMAT_A1
|
|
||||||
TExtend* = enum
|
|
||||||
EXTEND_NONE, EXTEND_REPEAT, EXTEND_REFLECT, EXTEND_PAD
|
|
||||||
TFilter* = enum
|
|
||||||
FILTER_FAST, FILTER_GOOD, FILTER_BEST, FILTER_NEAREST, FILTER_BILINEAR,
|
|
||||||
FILTER_GAUSSIAN
|
|
||||||
TFontType* = enum
|
|
||||||
FONT_TYPE_TOY, FONT_TYPE_FT, FONT_TYPE_WIN32, FONT_TYPE_ATSUI
|
|
||||||
TPatternType* = enum
|
|
||||||
PATTERN_TYPE_SOLID, PATTERN_TYPE_SURFACE, PATTERN_TYPE_LINEAR,
|
|
||||||
PATTERN_TYPE_RADIAL
|
|
||||||
TSurfaceType* = enum
|
|
||||||
SURFACE_TYPE_IMAGE, SURFACE_TYPE_PDF, SURFACE_TYPE_PS, SURFACE_TYPE_XLIB,
|
|
||||||
SURFACE_TYPE_XCB, SURFACE_TYPE_GLITZ, SURFACE_TYPE_QUARTZ,
|
|
||||||
SURFACE_TYPE_WIN32, SURFACE_TYPE_BEOS, SURFACE_TYPE_DIRECTFB,
|
|
||||||
SURFACE_TYPE_SVG, SURFACE_TYPE_OS2
|
|
||||||
TSvgVersion* = enum
|
|
||||||
SVG_VERSION_1_1, SVG_VERSION_1_2
|
|
||||||
PSurface* = ptr TSurface
|
|
||||||
PPSurface* = ptr PSurface
|
|
||||||
PContext* = ptr TContext
|
|
||||||
PPattern* = ptr TPattern
|
|
||||||
PFontOptions* = ptr TFontOptions
|
|
||||||
PFontFace* = ptr TFontFace
|
|
||||||
PScaledFont* = ptr TScaledFont
|
|
||||||
PBool* = ptr TBool
|
|
||||||
TBool* = int32
|
|
||||||
PMatrix* = ptr TMatrix
|
|
||||||
PUserDataKey* = ptr TUserDataKey
|
|
||||||
PGlyph* = ptr TGlyph
|
|
||||||
PTextExtents* = ptr TTextExtents
|
|
||||||
PFontExtents* = ptr TFontExtents
|
|
||||||
PPathDataType* = ptr TPathDataType
|
|
||||||
PPathData* = ptr TPathData
|
|
||||||
PPath* = ptr TPath
|
|
||||||
PRectangle* = ptr TRectangle
|
|
||||||
PRectangleList* = ptr TRectangleList
|
|
||||||
TDestroyFunc* = proc (data: Pointer){.cdecl.}
|
|
||||||
TWriteFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.}
|
|
||||||
TReadFunc* = proc (closure: Pointer, data: PByte, len: int32): TStatus{.cdecl.}
|
|
||||||
TContext*{.final.} = object #OPAQUE
|
|
||||||
TSurface*{.final.} = object #OPAQUE
|
|
||||||
TPattern*{.final.} = object #OPAQUE
|
|
||||||
TScaledFont*{.final.} = object #OPAQUE
|
|
||||||
TFontFace*{.final.} = object #OPAQUE
|
|
||||||
TFontOptions*{.final.} = object #OPAQUE
|
|
||||||
TMatrix*{.final.} = object
|
|
||||||
xx: float64
|
|
||||||
yx: float64
|
|
||||||
xy: float64
|
|
||||||
yy: float64
|
|
||||||
x0: float64
|
|
||||||
y0: float64
|
|
||||||
|
|
||||||
TUserDataKey*{.final.} = object
|
|
||||||
unused: int32
|
|
||||||
|
|
||||||
TGlyph*{.final.} = object
|
|
||||||
index: int32
|
|
||||||
x: float64
|
|
||||||
y: float64
|
|
||||||
|
|
||||||
TTextExtents*{.final.} = object
|
|
||||||
x_bearing: float64
|
|
||||||
y_bearing: float64
|
|
||||||
width: float64
|
|
||||||
height: float64
|
|
||||||
x_advance: float64
|
|
||||||
y_advance: float64
|
|
||||||
|
|
||||||
TFontExtents*{.final.} = object
|
|
||||||
ascent: float64
|
|
||||||
descent: float64
|
|
||||||
height: float64
|
|
||||||
max_x_advance: float64
|
|
||||||
max_y_advance: float64
|
|
||||||
|
|
||||||
TPathData*{.final.} = object #* _type : TCairoPathDataType;
|
|
||||||
# length : LongInt;
|
|
||||||
# end
|
|
||||||
x: float64
|
|
||||||
y: float64
|
|
||||||
|
|
||||||
TPath*{.final.} = object
|
|
||||||
status: TStatus
|
|
||||||
data: PPathData
|
|
||||||
num_data: int32
|
|
||||||
|
|
||||||
TRectangle*{.final.} = object
|
|
||||||
x, y, width, height: float64
|
|
||||||
|
|
||||||
TRectangleList*{.final.} = object
|
|
||||||
status: TStatus
|
|
||||||
rectangles: PRectangle
|
|
||||||
num_rectangles: int32
|
|
||||||
|
|
||||||
|
|
||||||
proc version*(): int32{.cdecl, importc: "cairo_version", libcairo.}
|
|
||||||
proc version_string*(): cstring{.cdecl, importc: "cairo_version_string",
|
|
||||||
libcairo.}
|
|
||||||
#Helper function to retrieve decoded version
|
|
||||||
proc version*(major, minor, micro: var int32)
|
|
||||||
#* Functions for manipulating state objects
|
|
||||||
proc create*(target: PSurface): PContext{.cdecl, importc: "cairo_create",
|
|
||||||
libcairo.}
|
|
||||||
proc reference*(cr: PContext): PContext{.cdecl, importc: "cairo_reference", libcairo.}
|
|
||||||
proc destroy*(cr: PContext){.cdecl, importc: "cairo_destroy", libcairo.}
|
|
||||||
proc get_reference_count*(cr: PContext): int32{.cdecl,
|
|
||||||
importc: "cairo_get_reference_count", libcairo.}
|
|
||||||
proc get_user_data*(cr: PContext, key: PUserDataKey): pointer{.cdecl,
|
|
||||||
importc: "cairo_get_user_data", libcairo.}
|
|
||||||
proc set_user_data*(cr: PContext, key: PUserDataKey, user_data: Pointer,
|
|
||||||
destroy: TDestroyFunc): TStatus{.cdecl,
|
|
||||||
importc: "cairo_set_user_data", libcairo.}
|
|
||||||
proc save*(cr: PContext){.cdecl, importc: "cairo_save", libcairo.}
|
|
||||||
proc restore*(cr: PContext){.cdecl, importc: "cairo_restore", libcairo.}
|
|
||||||
proc push_group*(cr: PContext){.cdecl, importc: "cairo_push_group", libcairo.}
|
|
||||||
proc push_group_with_content*(cr: PContext, content: TContent){.cdecl,
|
|
||||||
importc: "cairo_push_group_with_content", libcairo.}
|
|
||||||
proc pop_group*(cr: PContext): PPattern{.cdecl, importc: "cairo_pop_group",
|
|
||||||
libcairo.}
|
|
||||||
proc pop_group_to_source*(cr: PContext){.cdecl, importc: "cairo_pop_group_to_source",
|
|
||||||
libcairo.}
|
|
||||||
#* Modify state
|
|
||||||
proc set_operator*(cr: PContext, op: TOperator){.cdecl, importc: "cairo_set_operator",
|
|
||||||
libcairo.}
|
|
||||||
proc set_source*(cr: PContext, source: PPattern){.cdecl, importc: "cairo_set_source",
|
|
||||||
libcairo.}
|
|
||||||
proc set_source_rgb*(cr: PContext, red, green, blue: float64){.cdecl,
|
|
||||||
importc: "cairo_set_source_rgb", libcairo.}
|
|
||||||
proc set_source_rgba*(cr: PContext, red, green, blue, alpha: float64){.cdecl,
|
|
||||||
importc: "cairo_set_source_rgba", libcairo.}
|
|
||||||
proc set_source*(cr: PContext, surface: PSurface, x, y: float64){.cdecl,
|
|
||||||
importc: "cairo_set_source_surface", libcairo.}
|
|
||||||
proc set_tolerance*(cr: PContext, tolerance: float64){.cdecl,
|
|
||||||
importc: "cairo_set_tolerance", libcairo.}
|
|
||||||
proc set_antialias*(cr: PContext, antialias: TAntialias){.cdecl,
|
|
||||||
importc: "cairo_set_antialias", libcairo.}
|
|
||||||
proc set_fill_rule*(cr: PContext, fill_rule: TFillRule){.cdecl,
|
|
||||||
importc: "cairo_set_fill_rule", libcairo.}
|
|
||||||
proc set_line_width*(cr: PContext, width: float64){.cdecl,
|
|
||||||
importc: "cairo_set_line_width", libcairo.}
|
|
||||||
proc set_line_cap*(cr: PContext, line_cap: TLineCap){.cdecl,
|
|
||||||
importc: "cairo_set_line_cap", libcairo.}
|
|
||||||
proc set_line_join*(cr: PContext, line_join: TLineJoin){.cdecl,
|
|
||||||
importc: "cairo_set_line_join", libcairo.}
|
|
||||||
proc set_dash*(cr: PContext, dashes: openarray[float64], offset: float64){.cdecl,
|
|
||||||
importc: "cairo_set_dash", libcairo.}
|
|
||||||
proc set_miter_limit*(cr: PContext, limit: float64){.cdecl,
|
|
||||||
importc: "cairo_set_miter_limit", libcairo.}
|
|
||||||
proc translate*(cr: PContext, tx, ty: float64){.cdecl, importc: "cairo_translate",
|
|
||||||
libcairo.}
|
|
||||||
proc scale*(cr: PContext, sx, sy: float64){.cdecl, importc: "cairo_scale",
|
|
||||||
libcairo.}
|
|
||||||
proc rotate*(cr: PContext, angle: float64){.cdecl, importc: "cairo_rotate",
|
|
||||||
libcairo.}
|
|
||||||
proc transform*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_transform",
|
|
||||||
libcairo.}
|
|
||||||
proc set_matrix*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_set_matrix",
|
|
||||||
libcairo.}
|
|
||||||
proc identity_matrix*(cr: PContext){.cdecl, importc: "cairo_identity_matrix",
|
|
||||||
libcairo.}
|
|
||||||
proc user_to_device*(cr: PContext, x, y: var float64){.cdecl,
|
|
||||||
importc: "cairo_user_to_device", libcairo.}
|
|
||||||
proc user_to_device_distance*(cr: PContext, dx, dy: var float64){.cdecl,
|
|
||||||
importc: "cairo_user_to_device_distance", libcairo.}
|
|
||||||
proc device_to_user*(cr: PContext, x, y: var float64){.cdecl,
|
|
||||||
importc: "cairo_device_to_user", libcairo.}
|
|
||||||
proc device_to_user_distance*(cr: PContext, dx, dy: var float64){.cdecl,
|
|
||||||
importc: "cairo_device_to_user_distance", libcairo.}
|
|
||||||
#* Path creation functions
|
|
||||||
proc new_path*(cr: PContext){.cdecl, importc: "cairo_new_path", libcairo.}
|
|
||||||
proc move_to*(cr: PContext, x, y: float64){.cdecl, importc: "cairo_move_to",
|
|
||||||
libcairo.}
|
|
||||||
proc new_sub_path*(cr: PContext){.cdecl, importc: "cairo_new_sub_path",
|
|
||||||
libcairo.}
|
|
||||||
proc line_to*(cr: PContext, x, y: float64){.cdecl, importc: "cairo_line_to",
|
|
||||||
libcairo.}
|
|
||||||
proc curve_to*(cr: PContext, x1, y1, x2, y2, x3, y3: float64){.cdecl,
|
|
||||||
importc: "cairo_curve_to", libcairo.}
|
|
||||||
proc arc*(cr: PContext, xc, yc, radius, angle1, angle2: float64){.cdecl,
|
|
||||||
importc: "cairo_arc", libcairo.}
|
|
||||||
proc arc_negative*(cr: PContext, xc, yc, radius, angle1, angle2: float64){.cdecl,
|
|
||||||
importc: "cairo_arc_negative", libcairo.}
|
|
||||||
proc rel_move_to*(cr: PContext, dx, dy: float64){.cdecl, importc: "cairo_rel_move_to",
|
|
||||||
libcairo.}
|
|
||||||
proc rel_line_to*(cr: PContext, dx, dy: float64){.cdecl, importc: "cairo_rel_line_to",
|
|
||||||
libcairo.}
|
|
||||||
proc rel_curve_to*(cr: PContext, dx1, dy1, dx2, dy2, dx3, dy3: float64){.cdecl,
|
|
||||||
importc: "cairo_rel_curve_to", libcairo.}
|
|
||||||
proc rectangle*(cr: PContext, x, y, width, height: float64){.cdecl,
|
|
||||||
importc: "cairo_rectangle", libcairo.}
|
|
||||||
proc close_path*(cr: PContext){.cdecl, importc: "cairo_close_path", libcairo.}
|
|
||||||
#* Painting functions
|
|
||||||
proc paint*(cr: PContext){.cdecl, importc: "cairo_paint", libcairo.}
|
|
||||||
proc paint_with_alpha*(cr: PContext, alpha: float64){.cdecl,
|
|
||||||
importc: "cairo_paint_with_alpha", libcairo.}
|
|
||||||
proc mask*(cr: PContext, pattern: PPattern){.cdecl, importc: "cairo_mask",
|
|
||||||
libcairo.}
|
|
||||||
proc mask*(cr: PContext, surface: PSurface, surface_x, surface_y: float64){.
|
|
||||||
cdecl, importc: "cairo_mask_surface", libcairo.}
|
|
||||||
proc stroke*(cr: PContext){.cdecl, importc: "cairo_stroke", libcairo.}
|
|
||||||
proc stroke_preserve*(cr: PContext){.cdecl, importc: "cairo_stroke_preserve",
|
|
||||||
libcairo.}
|
|
||||||
proc fill*(cr: PContext){.cdecl, importc: "cairo_fill", libcairo.}
|
|
||||||
proc fill_preserve*(cr: PContext){.cdecl, importc: "cairo_fill_preserve",
|
|
||||||
libcairo.}
|
|
||||||
proc copy_page*(cr: PContext){.cdecl, importc: "cairo_copy_page", libcairo.}
|
|
||||||
proc show_page*(cr: PContext){.cdecl, importc: "cairo_show_page", libcairo.}
|
|
||||||
#* Insideness testing
|
|
||||||
proc in_stroke*(cr: PContext, x, y: float64): TBool{.cdecl, importc: "cairo_in_stroke",
|
|
||||||
libcairo.}
|
|
||||||
proc in_fill*(cr: PContext, x, y: float64): TBool{.cdecl, importc: "cairo_in_fill",
|
|
||||||
libcairo.}
|
|
||||||
#* Rectangular extents
|
|
||||||
proc stroke_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl,
|
|
||||||
importc: "cairo_stroke_extents", libcairo.}
|
|
||||||
proc fill_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl,
|
|
||||||
importc: "cairo_fill_extents", libcairo.}
|
|
||||||
#* Clipping
|
|
||||||
proc reset_clip*(cr: PContext){.cdecl, importc: "cairo_reset_clip", libcairo.}
|
|
||||||
proc clip*(cr: PContext){.cdecl, importc: "cairo_clip", libcairo.}
|
|
||||||
proc clip_preserve*(cr: PContext){.cdecl, importc: "cairo_clip_preserve",
|
|
||||||
libcairo.}
|
|
||||||
proc clip_extents*(cr: PContext, x1, y1, x2, y2: var float64){.cdecl,
|
|
||||||
importc: "cairo_clip_extents", libcairo.}
|
|
||||||
proc copy_clip_rectangle_list*(cr: PContext): PRectangleList{.cdecl,
|
|
||||||
importc: "cairo_copy_clip_rectangle_list", libcairo.}
|
|
||||||
proc rectangle_list_destroy*(rectangle_list: PRectangleList){.cdecl,
|
|
||||||
importc: "cairo_rectangle_list_destroy", libcairo.}
|
|
||||||
#* Font/Text functions
|
|
||||||
proc font_options_create*(): PFontOptions{.cdecl,
|
|
||||||
importc: "cairo_font_options_create", libcairo.}
|
|
||||||
proc copy*(original: PFontOptions): PFontOptions{.cdecl,
|
|
||||||
importc: "cairo_font_options_copy", libcairo.}
|
|
||||||
proc destroy*(options: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_font_options_destroy", libcairo.}
|
|
||||||
proc status*(options: PFontOptions): TStatus{.cdecl,
|
|
||||||
importc: "cairo_font_options_status", libcairo.}
|
|
||||||
proc merge*(options, other: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_font_options_merge", libcairo.}
|
|
||||||
proc equal*(options, other: PFontOptions): TBool{.cdecl,
|
|
||||||
importc: "cairo_font_options_equal", libcairo.}
|
|
||||||
proc hash*(options: PFontOptions): int32{.cdecl,
|
|
||||||
importc: "cairo_font_options_hash", libcairo.}
|
|
||||||
proc set_antialias*(options: PFontOptions, antialias: TAntialias){.
|
|
||||||
cdecl, importc: "cairo_font_options_set_antialias", libcairo.}
|
|
||||||
proc get_antialias*(options: PFontOptions): TAntialias{.cdecl,
|
|
||||||
importc: "cairo_font_options_get_antialias", libcairo.}
|
|
||||||
proc set_subpixel_order*(options: PFontOptions,
|
|
||||||
subpixel_order: TSubpixelOrder){.cdecl,
|
|
||||||
importc: "cairo_font_options_set_subpixel_order", libcairo.}
|
|
||||||
proc get_subpixel_order*(options: PFontOptions): TSubpixelOrder{.
|
|
||||||
cdecl, importc: "cairo_font_options_get_subpixel_order", libcairo.}
|
|
||||||
proc set_hint_style*(options: PFontOptions, hint_style: THintStyle){.
|
|
||||||
cdecl, importc: "cairo_font_options_set_hint_style", libcairo.}
|
|
||||||
proc get_hint_style*(options: PFontOptions): THintStyle{.cdecl,
|
|
||||||
importc: "cairo_font_options_get_hint_style", libcairo.}
|
|
||||||
proc set_hint_metrics*(options: PFontOptions,
|
|
||||||
hint_metrics: THintMetrics){.cdecl,
|
|
||||||
importc: "cairo_font_options_set_hint_metrics", libcairo.}
|
|
||||||
proc get_hint_metrics*(options: PFontOptions): THintMetrics{.cdecl,
|
|
||||||
importc: "cairo_font_options_get_hint_metrics", libcairo.}
|
|
||||||
#* This interface is for dealing with text as text, not caring about the
|
|
||||||
# font object inside the the TCairo.
|
|
||||||
proc select_font_face*(cr: PContext, family: cstring, slant: TFontSlant,
|
|
||||||
weight: TFontWeight){.cdecl,
|
|
||||||
importc: "cairo_select_font_face", libcairo.}
|
|
||||||
proc set_font_size*(cr: PContext, size: float64){.cdecl,
|
|
||||||
importc: "cairo_set_font_size", libcairo.}
|
|
||||||
proc set_font_matrix*(cr: PContext, matrix: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_set_font_matrix", libcairo.}
|
|
||||||
proc get_font_matrix*(cr: PContext, matrix: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_get_font_matrix", libcairo.}
|
|
||||||
proc set_font_options*(cr: PContext, options: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_set_font_options", libcairo.}
|
|
||||||
proc get_font_options*(cr: PContext, options: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_get_font_options", libcairo.}
|
|
||||||
proc set_font_face*(cr: PContext, font_face: PFontFace){.cdecl,
|
|
||||||
importc: "cairo_set_font_face", libcairo.}
|
|
||||||
proc get_font_face*(cr: PContext): PFontFace{.cdecl, importc: "cairo_get_font_face",
|
|
||||||
libcairo.}
|
|
||||||
proc set_scaled_font*(cr: PContext, scaled_font: PScaledFont){.cdecl,
|
|
||||||
importc: "cairo_set_scaled_font", libcairo.}
|
|
||||||
proc get_scaled_font*(cr: PContext): PScaledFont{.cdecl,
|
|
||||||
importc: "cairo_get_scaled_font", libcairo.}
|
|
||||||
proc show_text*(cr: PContext, utf8: cstring){.cdecl, importc: "cairo_show_text",
|
|
||||||
libcairo.}
|
|
||||||
proc show_glyphs*(cr: PContext, glyphs: PGlyph, num_glyphs: int32){.cdecl,
|
|
||||||
importc: "cairo_show_glyphs", libcairo.}
|
|
||||||
proc text_path*(cr: PContext, utf8: cstring){.cdecl, importc: "cairo_text_path",
|
|
||||||
libcairo.}
|
|
||||||
proc glyph_path*(cr: PContext, glyphs: PGlyph, num_glyphs: int32){.cdecl,
|
|
||||||
importc: "cairo_glyph_path", libcairo.}
|
|
||||||
proc text_extents*(cr: PContext, utf8: cstring, extents: PTextExtents){.cdecl,
|
|
||||||
importc: "cairo_text_extents", libcairo.}
|
|
||||||
proc glyph_extents*(cr: PContext, glyphs: PGlyph, num_glyphs: int32,
|
|
||||||
extents: PTextExtents){.cdecl,
|
|
||||||
importc: "cairo_glyph_extents", libcairo.}
|
|
||||||
proc font_extents*(cr: PContext, extents: PFontExtents){.cdecl,
|
|
||||||
importc: "cairo_font_extents", libcairo.}
|
|
||||||
#* Generic identifier for a font style
|
|
||||||
proc reference*(font_face: PFontFace): PFontFace{.cdecl,
|
|
||||||
importc: "cairo_font_face_reference", libcairo.}
|
|
||||||
proc destroy*(font_face: PFontFace){.cdecl,
|
|
||||||
importc: "cairo_font_face_destroy", libcairo.}
|
|
||||||
proc get_reference_count*(font_face: PFontFace): int32{.cdecl,
|
|
||||||
importc: "cairo_font_face_get_reference_count", libcairo.}
|
|
||||||
proc status*(font_face: PFontFace): TStatus{.cdecl,
|
|
||||||
importc: "cairo_font_face_status", libcairo.}
|
|
||||||
proc get_type*(font_face: PFontFace): TFontType{.cdecl,
|
|
||||||
importc: "cairo_font_face_get_type", libcairo.}
|
|
||||||
proc get_user_data*(font_face: PFontFace, key: PUserDataKey): pointer{.
|
|
||||||
cdecl, importc: "cairo_font_face_get_user_data", libcairo.}
|
|
||||||
proc set_user_data*(font_face: PFontFace, key: PUserDataKey,
|
|
||||||
user_data: pointer, destroy: TDestroyFunc): TStatus{.
|
|
||||||
cdecl, importc: "cairo_font_face_set_user_data", libcairo.}
|
|
||||||
#* Portable interface to general font features
|
|
||||||
proc scaled_font_create*(font_face: PFontFace, font_matrix: PMatrix,
|
|
||||||
ctm: PMatrix, options: PFontOptions): PScaledFont{.
|
|
||||||
cdecl, importc: "cairo_scaled_font_create", libcairo.}
|
|
||||||
proc reference*(scaled_font: PScaledFont): PScaledFont{.cdecl,
|
|
||||||
importc: "cairo_scaled_font_reference", libcairo.}
|
|
||||||
proc destroy*(scaled_font: PScaledFont){.cdecl,
|
|
||||||
importc: "cairo_scaled_font_destroy", libcairo.}
|
|
||||||
proc get_reference_count*(scaled_font: PScaledFont): int32{.cdecl,
|
|
||||||
importc: "cairo_scaled_font_get_reference_count", libcairo.}
|
|
||||||
proc status*(scaled_font: PScaledFont): TStatus{.cdecl,
|
|
||||||
importc: "cairo_scaled_font_status", libcairo.}
|
|
||||||
proc get_type*(scaled_font: PScaledFont): TFontType{.cdecl,
|
|
||||||
importc: "cairo_scaled_font_get_type", libcairo.}
|
|
||||||
proc get_user_data*(scaled_font: PScaledFont, key: PUserDataKey): Pointer{.
|
|
||||||
cdecl, importc: "cairo_scaled_font_get_user_data", libcairo.}
|
|
||||||
proc set_user_data*(scaled_font: PScaledFont, key: PUserDataKey,
|
|
||||||
user_data: Pointer, destroy: TDestroyFunc): TStatus{.
|
|
||||||
cdecl, importc: "cairo_scaled_font_set_user_data", libcairo.}
|
|
||||||
proc extents*(scaled_font: PScaledFont, extents: PFontExtents){.
|
|
||||||
cdecl, importc: "cairo_scaled_font_extents", libcairo.}
|
|
||||||
proc text_extents*(scaled_font: PScaledFont, utf8: cstring,
|
|
||||||
extents: PTextExtents){.cdecl,
|
|
||||||
importc: "cairo_scaled_font_text_extents", libcairo.}
|
|
||||||
proc glyph_extents*(scaled_font: PScaledFont, glyphs: PGlyph,
|
|
||||||
num_glyphs: int32, extents: PTextExtents){.
|
|
||||||
cdecl, importc: "cairo_scaled_font_glyph_extents", libcairo.}
|
|
||||||
proc get_font_face*(scaled_font: PScaledFont): PFontFace{.cdecl,
|
|
||||||
importc: "cairo_scaled_font_get_font_face", libcairo.}
|
|
||||||
proc get_font_matrix*(scaled_font: PScaledFont, font_matrix: PMatrix){.
|
|
||||||
cdecl, importc: "cairo_scaled_font_get_font_matrix", libcairo.}
|
|
||||||
proc get_ctm*(scaled_font: PScaledFont, ctm: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_scaled_font_get_ctm", libcairo.}
|
|
||||||
proc get_font_options*(scaled_font: PScaledFont,
|
|
||||||
options: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_scaled_font_get_font_options", libcairo.}
|
|
||||||
#* Query functions
|
|
||||||
proc get_operator*(cr: PContext): TOperator{.cdecl, importc: "cairo_get_operator",
|
|
||||||
libcairo.}
|
|
||||||
proc get_source*(cr: PContext): PPattern{.cdecl, importc: "cairo_get_source",
|
|
||||||
libcairo.}
|
|
||||||
proc get_tolerance*(cr: PContext): float64{.cdecl, importc: "cairo_get_tolerance",
|
|
||||||
libcairo.}
|
|
||||||
proc get_antialias*(cr: PContext): TAntialias{.cdecl, importc: "cairo_get_antialias",
|
|
||||||
libcairo.}
|
|
||||||
proc get_current_point*(cr: PContext, x, y: var float64){.cdecl,
|
|
||||||
importc: "cairo_get_current_point", libcairo.}
|
|
||||||
proc get_fill_rule*(cr: PContext): TFillRule{.cdecl, importc: "cairo_get_fill_rule",
|
|
||||||
libcairo.}
|
|
||||||
proc get_line_width*(cr: PContext): float64{.cdecl, importc: "cairo_get_line_width",
|
|
||||||
libcairo.}
|
|
||||||
proc get_line_cap*(cr: PContext): TLineCap{.cdecl, importc: "cairo_get_line_cap",
|
|
||||||
libcairo.}
|
|
||||||
proc get_line_join*(cr: PContext): TLineJoin{.cdecl, importc: "cairo_get_line_join",
|
|
||||||
libcairo.}
|
|
||||||
proc get_miter_limit*(cr: PContext): float64{.cdecl, importc: "cairo_get_miter_limit",
|
|
||||||
libcairo.}
|
|
||||||
proc get_dash_count*(cr: PContext): int32{.cdecl, importc: "cairo_get_dash_count",
|
|
||||||
libcairo.}
|
|
||||||
proc get_dash*(cr: PContext, dashes, offset: var float64){.cdecl,
|
|
||||||
importc: "cairo_get_dash", libcairo.}
|
|
||||||
proc get_matrix*(cr: PContext, matrix: PMatrix){.cdecl, importc: "cairo_get_matrix",
|
|
||||||
libcairo.}
|
|
||||||
proc get_target*(cr: PContext): PSurface{.cdecl, importc: "cairo_get_target",
|
|
||||||
libcairo.}
|
|
||||||
proc get_group_target*(cr: PContext): PSurface{.cdecl,
|
|
||||||
importc: "cairo_get_group_target", libcairo.}
|
|
||||||
proc copy_path*(cr: PContext): PPath{.cdecl, importc: "cairo_copy_path",
|
|
||||||
libcairo.}
|
|
||||||
proc copy_path_flat*(cr: PContext): PPath{.cdecl, importc: "cairo_copy_path_flat",
|
|
||||||
libcairo.}
|
|
||||||
proc append_path*(cr: PContext, path: PPath){.cdecl, importc: "cairo_append_path",
|
|
||||||
libcairo.}
|
|
||||||
proc destroy*(path: PPath){.cdecl, importc: "cairo_path_destroy",
|
|
||||||
libcairo.}
|
|
||||||
#* Error status queries
|
|
||||||
proc status*(cr: PContext): TStatus{.cdecl, importc: "cairo_status", libcairo.}
|
|
||||||
proc status_to_string*(status: TStatus): cstring{.cdecl,
|
|
||||||
importc: "cairo_status_to_string", libcairo.}
|
|
||||||
#* Surface manipulation
|
|
||||||
proc surface_create_similar*(other: PSurface, content: TContent,
|
|
||||||
width, height: int32): PSurface{.cdecl,
|
|
||||||
importc: "cairo_surface_create_similar", libcairo.}
|
|
||||||
proc reference*(surface: PSurface): PSurface{.cdecl,
|
|
||||||
importc: "cairo_surface_reference", libcairo.}
|
|
||||||
proc finish*(surface: PSurface){.cdecl, importc: "cairo_surface_finish",
|
|
||||||
libcairo.}
|
|
||||||
proc destroy*(surface: PSurface){.cdecl,
|
|
||||||
importc: "cairo_surface_destroy", libcairo.}
|
|
||||||
proc get_reference_count*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_surface_get_reference_count", libcairo.}
|
|
||||||
proc status*(surface: PSurface): TStatus{.cdecl,
|
|
||||||
importc: "cairo_surface_status", libcairo.}
|
|
||||||
proc get_type*(surface: PSurface): TSurfaceType{.cdecl,
|
|
||||||
importc: "cairo_surface_get_type", libcairo.}
|
|
||||||
proc get_content*(surface: PSurface): TContent{.cdecl,
|
|
||||||
importc: "cairo_surface_get_content", libcairo.}
|
|
||||||
proc write_to_png*(surface: PSurface, filename: cstring): TStatus{.
|
|
||||||
cdecl, importc: "cairo_surface_write_to_png", libcairo.}
|
|
||||||
proc write_to_png*(surface: PSurface, write_func: TWriteFunc,
|
|
||||||
closure: pointer): TStatus{.cdecl,
|
|
||||||
importc: "cairo_surface_write_to_png_stream", libcairo.}
|
|
||||||
proc get_user_data*(surface: PSurface, key: PUserDataKey): pointer{.
|
|
||||||
cdecl, importc: "cairo_surface_get_user_data", libcairo.}
|
|
||||||
proc set_user_data*(surface: PSurface, key: PUserDataKey,
|
|
||||||
user_data: pointer, destroy: TDestroyFunc): TStatus{.
|
|
||||||
cdecl, importc: "cairo_surface_set_user_data", libcairo.}
|
|
||||||
proc get_font_options*(surface: PSurface, options: PFontOptions){.cdecl,
|
|
||||||
importc: "cairo_surface_get_font_options", libcairo.}
|
|
||||||
proc flush*(surface: PSurface){.cdecl, importc: "cairo_surface_flush",
|
|
||||||
libcairo.}
|
|
||||||
proc mark_dirty*(surface: PSurface){.cdecl,
|
|
||||||
importc: "cairo_surface_mark_dirty", libcairo.}
|
|
||||||
proc mark_dirty_rectangle*(surface: PSurface, x, y, width, height: int32){.
|
|
||||||
cdecl, importc: "cairo_surface_mark_dirty_rectangle", libcairo.}
|
|
||||||
proc set_device_offset*(surface: PSurface, x_offset, y_offset: float64){.
|
|
||||||
cdecl, importc: "cairo_surface_set_device_offset", libcairo.}
|
|
||||||
proc get_device_offset*(surface: PSurface,
|
|
||||||
x_offset, y_offset: var float64){.cdecl,
|
|
||||||
importc: "cairo_surface_get_device_offset", libcairo.}
|
|
||||||
proc set_fallback_resolution*(surface: PSurface, x_pixels_per_inch,
|
|
||||||
y_pixels_per_inch: float64){.cdecl, importc: "cairo_surface_set_fallback_resolution",
|
|
||||||
libcairo.}
|
|
||||||
#* Image-surface functions
|
|
||||||
proc image_surface_create*(format: TFormat, width, height: int32): PSurface{.
|
|
||||||
cdecl, importc: "cairo_image_surface_create", libcairo.}
|
|
||||||
proc image_surface_create*(data: Pbyte, format: TFormat,
|
|
||||||
width, height, stride: int32): PSurface{.
|
|
||||||
cdecl, importc: "cairo_image_surface_create_for_data", libcairo.}
|
|
||||||
proc get_data*(surface: PSurface): cstring{.cdecl,
|
|
||||||
importc: "cairo_image_surface_get_data", libcairo.}
|
|
||||||
proc get_format*(surface: PSurface): TFormat{.cdecl,
|
|
||||||
importc: "cairo_image_surface_get_format", libcairo.}
|
|
||||||
proc get_width*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_image_surface_get_width", libcairo.}
|
|
||||||
proc get_height*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_image_surface_get_height", libcairo.}
|
|
||||||
proc get_stride*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_image_surface_get_stride", libcairo.}
|
|
||||||
proc image_surface_create_from_png*(filename: cstring): PSurface{.cdecl,
|
|
||||||
importc: "cairo_image_surface_create_from_png", libcairo.}
|
|
||||||
proc image_surface_create_from_png*(read_func: TReadFunc,
|
|
||||||
closure: pointer): PSurface{.cdecl, importc: "cairo_image_surface_create_from_png_stream",
|
|
||||||
libcairo.}
|
|
||||||
#* Pattern creation functions
|
|
||||||
proc pattern_create_rgb*(red, green, blue: float64): PPattern{.cdecl,
|
|
||||||
importc: "cairo_pattern_create_rgb", libcairo.}
|
|
||||||
proc pattern_create_rgba*(red, green, blue, alpha: float64): PPattern{.cdecl,
|
|
||||||
importc: "cairo_pattern_create_rgba", libcairo.}
|
|
||||||
proc pattern_create_for_surface*(surface: PSurface): PPattern{.cdecl,
|
|
||||||
importc: "cairo_pattern_create_for_surface", libcairo.}
|
|
||||||
proc pattern_create_linear*(x0, y0, x1, y1: float64): PPattern{.cdecl,
|
|
||||||
importc: "cairo_pattern_create_linear", libcairo.}
|
|
||||||
proc pattern_create_radial*(cx0, cy0, radius0, cx1, cy1, radius1: float64): PPattern{.
|
|
||||||
cdecl, importc: "cairo_pattern_create_radial", libcairo.}
|
|
||||||
proc reference*(pattern: PPattern): PPattern{.cdecl,
|
|
||||||
importc: "cairo_pattern_reference", libcairo.}
|
|
||||||
proc destroy*(pattern: PPattern){.cdecl,
|
|
||||||
importc: "cairo_pattern_destroy", libcairo.}
|
|
||||||
proc get_reference_count*(pattern: PPattern): int32{.cdecl,
|
|
||||||
importc: "cairo_pattern_get_reference_count", libcairo.}
|
|
||||||
proc status*(pattern: PPattern): TStatus{.cdecl,
|
|
||||||
importc: "cairo_pattern_status", libcairo.}
|
|
||||||
proc get_user_data*(pattern: PPattern, key: PUserDataKey): Pointer{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_user_data", libcairo.}
|
|
||||||
proc set_user_data*(pattern: PPattern, key: PUserDataKey,
|
|
||||||
user_data: Pointer, destroy: TDestroyFunc): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_set_user_data", libcairo.}
|
|
||||||
proc get_type*(pattern: PPattern): TPatternType{.cdecl,
|
|
||||||
importc: "cairo_pattern_get_type", libcairo.}
|
|
||||||
proc add_color_stop_rgb*(pattern: PPattern,
|
|
||||||
offset, red, green, blue: float64){.cdecl,
|
|
||||||
importc: "cairo_pattern_add_color_stop_rgb", libcairo.}
|
|
||||||
proc add_color_stop_rgba*(pattern: PPattern,
|
|
||||||
offset, red, green, blue, alpha: float64){.
|
|
||||||
cdecl, importc: "cairo_pattern_add_color_stop_rgba", libcairo.}
|
|
||||||
proc set_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_pattern_set_matrix", libcairo.}
|
|
||||||
proc get_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_pattern_get_matrix", libcairo.}
|
|
||||||
proc set_extend*(pattern: PPattern, extend: TExtend){.cdecl,
|
|
||||||
importc: "cairo_pattern_set_extend", libcairo.}
|
|
||||||
proc get_extend*(pattern: PPattern): TExtend{.cdecl,
|
|
||||||
importc: "cairo_pattern_get_extend", libcairo.}
|
|
||||||
proc set_filter*(pattern: PPattern, filter: TFilter){.cdecl,
|
|
||||||
importc: "cairo_pattern_set_filter", libcairo.}
|
|
||||||
proc get_filter*(pattern: PPattern): TFilter{.cdecl,
|
|
||||||
importc: "cairo_pattern_get_filter", libcairo.}
|
|
||||||
proc get_rgba*(pattern: PPattern,
|
|
||||||
red, green, blue, alpha: var float64): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_rgba", libcairo.}
|
|
||||||
proc get_surface*(pattern: PPattern, surface: PPSurface): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_surface", libcairo.}
|
|
||||||
proc get_color_stop_rgba*(pattern: PPattern, index: int32,
|
|
||||||
offset, red, green, blue, alpha: var float64): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_color_stop_rgba", libcairo.}
|
|
||||||
proc get_color_stop_count*(pattern: PPattern, count: var int32): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_color_stop_count", libcairo.}
|
|
||||||
proc get_linear_points*(pattern: PPattern,
|
|
||||||
x0, y0, x1, y1: var float64): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_linear_points", libcairo.}
|
|
||||||
proc get_radial_circles*(pattern: PPattern,
|
|
||||||
x0, y0, r0, x1, y1, r1: var float64): TStatus{.
|
|
||||||
cdecl, importc: "cairo_pattern_get_radial_circles", libcairo.}
|
|
||||||
#* Matrix functions
|
|
||||||
proc init*(matrix: PMatrix, xx, yx, xy, yy, x0, y0: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_init", libcairo.}
|
|
||||||
proc init_identity*(matrix: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_matrix_init_identity", libcairo.}
|
|
||||||
proc init_translate*(matrix: PMatrix, tx, ty: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_init_translate", libcairo.}
|
|
||||||
proc init_scale*(matrix: PMatrix, sx, sy: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_init_scale", libcairo.}
|
|
||||||
proc init_rotate*(matrix: PMatrix, radians: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_init_rotate", libcairo.}
|
|
||||||
proc translate*(matrix: PMatrix, tx, ty: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_translate", libcairo.}
|
|
||||||
proc scale*(matrix: PMatrix, sx, sy: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_scale", libcairo.}
|
|
||||||
proc rotate*(matrix: PMatrix, radians: float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_rotate", libcairo.}
|
|
||||||
proc invert*(matrix: PMatrix): TStatus{.cdecl,
|
|
||||||
importc: "cairo_matrix_invert", libcairo.}
|
|
||||||
proc multiply*(result, a, b: PMatrix){.cdecl,
|
|
||||||
importc: "cairo_matrix_multiply", libcairo.}
|
|
||||||
proc transform_distance*(matrix: PMatrix, dx, dy: var float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_transform_distance", libcairo.}
|
|
||||||
proc transform_point*(matrix: PMatrix, x, y: var float64){.cdecl,
|
|
||||||
importc: "cairo_matrix_transform_point", libcairo.}
|
|
||||||
#* PDF functions
|
|
||||||
proc pdf_surface_create*(filename: cstring,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_pdf_surface_create", libcairo.}
|
|
||||||
proc pdf_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_pdf_surface_create_for_stream", libcairo.}
|
|
||||||
proc pdf_surface_set_size*(surface: PSurface,
|
|
||||||
width_in_points, height_in_points: float64){.cdecl,
|
|
||||||
importc: "cairo_pdf_surface_set_size", libcairo.}
|
|
||||||
#* PS functions
|
|
||||||
proc ps_surface_create*(filename: cstring,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_ps_surface_create", libcairo.}
|
|
||||||
proc ps_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_ps_surface_create_for_stream", libcairo.}
|
|
||||||
proc ps_surface_set_size*(surface: PSurface,
|
|
||||||
width_in_points, height_in_points: float64){.cdecl,
|
|
||||||
importc: "cairo_ps_surface_set_size", libcairo.}
|
|
||||||
proc ps_surface_dsc_comment*(surface: PSurface, comment: cstring){.cdecl,
|
|
||||||
importc: "cairo_ps_surface_dsc_comment", libcairo.}
|
|
||||||
proc ps_surface_dsc_begin_setup*(surface: PSurface){.cdecl,
|
|
||||||
importc: "cairo_ps_surface_dsc_begin_setup", libcairo.}
|
|
||||||
proc ps_surface_dsc_begin_page_setup*(surface: PSurface){.cdecl,
|
|
||||||
importc: "cairo_ps_surface_dsc_begin_page_setup", libcairo.}
|
|
||||||
#* SVG functions
|
|
||||||
proc svg_surface_create*(filename: cstring,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_svg_surface_create", libcairo.}
|
|
||||||
proc svg_surface_create_for_stream*(write_func: TWriteFunc, closure: Pointer,
|
|
||||||
width_in_points, height_in_points: float64): PSurface{.
|
|
||||||
cdecl, importc: "cairo_svg_surface_create_for_stream", libcairo.}
|
|
||||||
proc svg_surface_restrict_to_version*(surface: PSurface, version: TSvgVersion){.
|
|
||||||
cdecl, importc: "cairo_svg_surface_restrict_to_version", libcairo.}
|
|
||||||
#todo: see how translate this
|
|
||||||
#procedure cairo_svg_get_versions(TCairoSvgVersion const **versions,
|
|
||||||
# int *num_versions);
|
|
||||||
proc svg_version_to_string*(version: TSvgVersion): cstring{.cdecl,
|
|
||||||
importc: "cairo_svg_version_to_string", libcairo.}
|
|
||||||
#* Functions to be used while debugging (not intended for use in production code)
|
|
||||||
proc debug_reset_static_data*(){.cdecl,
|
|
||||||
importc: "cairo_debug_reset_static_data",
|
|
||||||
libcairo.}
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc version(major, minor, micro: var int32) =
|
|
||||||
var version: int32
|
|
||||||
version = version()
|
|
||||||
major = version div 10000'i32
|
|
||||||
minor = (version mod (major * 10000'i32)) div 100'i32
|
|
||||||
micro = (version mod ((major * 10000'i32) + (minor * 100'i32)))
|
|
||||||
|
|
||||||
proc checkStatus*(s: cairo.TStatus) {.noinline.} =
|
|
||||||
## if ``s != StatusSuccess`` the error is turned into an appropirate Nimrod
|
|
||||||
## exception and raised.
|
|
||||||
case s
|
|
||||||
of StatusSuccess: nil
|
|
||||||
of StatusNoMemory:
|
|
||||||
raise newException(EOutOfMemory, $statusToString(s))
|
|
||||||
of STATUS_READ_ERROR, STATUS_WRITE_ERROR, STATUS_FILE_NOT_FOUND,
|
|
||||||
STATUS_TEMP_FILE_ERROR:
|
|
||||||
raise newException(EIO, $statusToString(s))
|
|
||||||
else:
|
|
||||||
raise newException(EAssertionFailed, $statusToString(s))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
# included by cairo bindings
|
|
||||||
|
|
||||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
|
||||||
{.pragma: libcairo, cdecl.}
|
|
||||||
when defined(use_pkg_config_static):
|
|
||||||
{.passl: gorge("pkg-config cairo --libs --static").}
|
|
||||||
else:
|
|
||||||
{.passl: gorge("pkg-config cairo --libs").}
|
|
||||||
else:
|
|
||||||
when defined(windows):
|
|
||||||
const LIB_CAIRO* = "libcairo-2.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const LIB_CAIRO* = "libcairo.dylib"
|
|
||||||
else:
|
|
||||||
const LIB_CAIRO* = "libcairo.so(|.2)"
|
|
||||||
{.pragma: libcairo, cdecl, dynlib: LIB_CAIRO.}
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#
|
|
||||||
# Translation of cairo-ft.h
|
|
||||||
# by Jeffrey Pohlmeyer
|
|
||||||
# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
cairo, freetypeh
|
|
||||||
|
|
||||||
include "cairo_pragma.nim"
|
|
||||||
#todo: properly define FcPattern:
|
|
||||||
#It will require translate FontConfig header
|
|
||||||
|
|
||||||
#*
|
|
||||||
#typedef struct _XftPattern {
|
|
||||||
# int num;
|
|
||||||
# int size;
|
|
||||||
# XftPatternElt *elts;
|
|
||||||
# } XftPattern;
|
|
||||||
# typedef FcPattern XftPattern;
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
FcPattern* = Pointer
|
|
||||||
PFcPattern* = ptr FcPattern
|
|
||||||
|
|
||||||
proc ft_font_face_create_for_pattern*(pattern: PFcPattern): PFontFace{.libcairo,
|
|
||||||
importc: "cairo_ft_font_face_create_for_pattern".}
|
|
||||||
proc ft_font_options_substitute*(options: PFontOptions, pattern: PFcPattern){.
|
|
||||||
libcairo, importc: "cairo_ft_font_options_substitute".}
|
|
||||||
proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontFace{.libcairo,
|
|
||||||
importc: "cairo_ft_font_face_create_for_ft_face".}
|
|
||||||
proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.libcairo,
|
|
||||||
importc: "cairo_ft_scaled_font_lock_face".}
|
|
||||||
proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.libcairo,
|
|
||||||
importc: "cairo_ft_scaled_font_unlock_face".}
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
#
|
|
||||||
# Translation of cairo-win32.h version 1.4
|
|
||||||
# by Luiz Américo Pereira Câmara 2007
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
cairo, windows
|
|
||||||
|
|
||||||
proc win32_surface_create*(hdc: HDC): PSurface{.cdecl,
|
|
||||||
importc: "cairo_win32_surface_create", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_surface_create_with_ddb*(hdc: HDC, format: TFormat,
|
|
||||||
width, height: int32): PSurface{.cdecl,
|
|
||||||
importc: "cairo_win32_surface_create_with_ddb", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_surface_create_with_dib*(format: TFormat, width, height: int32): PSurface{.
|
|
||||||
cdecl, importc: "cairo_win32_surface_create_with_dib", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_surface_get_dc*(surface: PSurface): HDC{.cdecl,
|
|
||||||
importc: "cairo_win32_surface_get_dc", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_surface_get_image*(surface: PSurface): PSurface{.cdecl,
|
|
||||||
importc: "cairo_win32_surface_get_image", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_font_face_create_for_logfontw*(logfont: pLOGFONTW): PFontFace{.cdecl,
|
|
||||||
importc: "cairo_win32_font_face_create_for_logfontw", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_font_face_create_for_hfont*(font: HFONT): PFontFace{.cdecl,
|
|
||||||
importc: "cairo_win32_font_face_create_for_hfont", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_scaled_font_select_font*(scaled_font: PScaledFont, hdc: HDC): TStatus{.
|
|
||||||
cdecl, importc: "cairo_win32_scaled_font_select_font", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_scaled_font_done_font*(scaled_font: PScaledFont){.cdecl,
|
|
||||||
importc: "cairo_win32_scaled_font_done_font", dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_scaled_font_get_metrics_factor*(scaled_font: PScaledFont): float64{.
|
|
||||||
cdecl, importc: "cairo_win32_scaled_font_get_metrics_factor",
|
|
||||||
dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_scaled_font_get_logical_to_device*(scaled_font: PScaledFont,
|
|
||||||
logical_to_device: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_logical_to_device",
|
|
||||||
dynlib: LIB_CAIRO.}
|
|
||||||
proc win32_scaled_font_get_device_to_logical*(scaled_font: PScaledFont,
|
|
||||||
device_to_logical: PMatrix){.cdecl, importc: "cairo_win32_scaled_font_get_device_to_logical",
|
|
||||||
dynlib: LIB_CAIRO.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
#
|
|
||||||
# Translation of cairo-xlib.h version 1.4
|
|
||||||
# by Jeffrey Pohlmeyer
|
|
||||||
# updated to version 1.4 by Luiz Américo Pereira Câmara 2007
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
cairo, x, xlib, xrender
|
|
||||||
|
|
||||||
include "cairo_pragma.nim"
|
|
||||||
|
|
||||||
proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual,
|
|
||||||
width, height: int32): PSurface{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_create", libcairo.}
|
|
||||||
proc xlib_surface_create_for_bitmap*(dpy: PDisplay, bitmap: TPixmap,
|
|
||||||
screen: PScreen, width, height: int32): PSurface{.
|
|
||||||
cdecl, importc: "cairo_xlib_surface_create_for_bitmap", libcairo.}
|
|
||||||
proc xlib_surface_create_with_xrender_format*(dpy: PDisplay,
|
|
||||||
drawable: TDrawable, screen: PScreen, format: PXRenderPictFormat,
|
|
||||||
width, height: int32): PSurface{.cdecl, importc: "cairo_xlib_surface_create_with_xrender_format",
|
|
||||||
libcairo.}
|
|
||||||
proc xlib_surface_get_depth*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_depth", libcairo.}
|
|
||||||
proc xlib_surface_get_display*(surface: PSurface): PDisplay{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_display", libcairo.}
|
|
||||||
proc xlib_surface_get_drawable*(surface: PSurface): TDrawable{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_drawable", libcairo.}
|
|
||||||
proc xlib_surface_get_height*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_height", libcairo.}
|
|
||||||
proc xlib_surface_get_screen*(surface: PSurface): PScreen{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_screen", libcairo.}
|
|
||||||
proc xlib_surface_get_visual*(surface: PSurface): PVisual{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_visual", libcairo.}
|
|
||||||
proc xlib_surface_get_width*(surface: PSurface): int32{.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_get_width", libcairo.}
|
|
||||||
proc xlib_surface_set_size*(surface: PSurface, width, height: int32){.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_set_size", libcairo.}
|
|
||||||
proc xlib_surface_set_drawable*(surface: PSurface, drawable: TDrawable,
|
|
||||||
width, height: int32){.cdecl,
|
|
||||||
importc: "cairo_xlib_surface_set_drawable", libcairo.}
|
|
||||||
# implementation
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,271 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
glib2
|
|
||||||
|
|
||||||
when defined(win32):
|
|
||||||
const
|
|
||||||
pixbuflib = "libgdk_pixbuf-2.0-0.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
pixbuflib = "libgdk_pixbuf-2.0.0.dylib"
|
|
||||||
# linklib gtk-x11-2.0
|
|
||||||
# linklib gdk-x11-2.0
|
|
||||||
# linklib pango-1.0.0
|
|
||||||
# linklib glib-2.0.0
|
|
||||||
# linklib gobject-2.0.0
|
|
||||||
# linklib gdk_pixbuf-2.0.0
|
|
||||||
# linklib atk-1.0.0
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
pixbuflib = "libgdk_pixbuf-2.0.so"
|
|
||||||
type
|
|
||||||
PPixbuf* = pointer
|
|
||||||
PPixbufAnimation* = pointer
|
|
||||||
PPixbufAnimationIter* = pointer
|
|
||||||
PPixbufAlphaMode* = ptr TPixbufAlphaMode
|
|
||||||
TPixbufAlphaMode* = enum
|
|
||||||
PIXBUF_ALPHA_BILEVEL, PIXBUF_ALPHA_FULL
|
|
||||||
PColorspace* = ptr TColorspace
|
|
||||||
TColorspace* = enum
|
|
||||||
COLORSPACE_RGB
|
|
||||||
TPixbufDestroyNotify* = proc (pixels: Pguchar, data: gpointer){.cdecl.}
|
|
||||||
PPixbufError* = ptr TPixbufError
|
|
||||||
TPixbufError* = enum
|
|
||||||
PIXBUF_ERROR_CORRUPT_IMAGE, PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
|
||||||
PIXBUF_ERROR_BAD_OPTION, PIXBUF_ERROR_UNKNOWN_TYPE,
|
|
||||||
PIXBUF_ERROR_UNSUPPORTED_OPERATION, PIXBUF_ERROR_FAILED
|
|
||||||
PInterpType* = ptr TInterpType
|
|
||||||
TInterpType* = enum
|
|
||||||
INTERP_NEAREST, INTERP_TILES, INTERP_BILINEAR, INTERP_HYPER
|
|
||||||
|
|
||||||
proc TYPE_PIXBUF*(): GType
|
|
||||||
proc PIXBUF*(anObject: pointer): PPixbuf
|
|
||||||
proc IS_PIXBUF*(anObject: pointer): bool
|
|
||||||
proc TYPE_PIXBUF_ANIMATION*(): GType
|
|
||||||
proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation
|
|
||||||
proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool
|
|
||||||
proc TYPE_PIXBUF_ANIMATION_ITER*(): GType
|
|
||||||
proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter
|
|
||||||
proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool
|
|
||||||
proc PIXBUF_ERROR*(): TGQuark
|
|
||||||
proc pixbuf_error_quark*(): TGQuark{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_error_quark".}
|
|
||||||
proc pixbuf_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_type".}
|
|
||||||
when not defined(PIXBUF_DISABLE_DEPRECATED):
|
|
||||||
proc pixbuf_ref*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_ref".}
|
|
||||||
proc pixbuf_unref*(pixbuf: PPixbuf){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_unref".}
|
|
||||||
proc get_colorspace*(pixbuf: PPixbuf): TColorspace{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_colorspace".}
|
|
||||||
proc get_n_channels*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_n_channels".}
|
|
||||||
proc get_has_alpha*(pixbuf: PPixbuf): gboolean{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_has_alpha".}
|
|
||||||
proc get_bits_per_sample*(pixbuf: PPixbuf): int32{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_bits_per_sample".}
|
|
||||||
proc get_pixels*(pixbuf: PPixbuf): Pguchar{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_pixels".}
|
|
||||||
proc get_width*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_width".}
|
|
||||||
proc get_height*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_height".}
|
|
||||||
proc get_rowstride*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_get_rowstride".}
|
|
||||||
proc pixbuf_new*(colorspace: TColorspace, has_alpha: gboolean,
|
|
||||||
bits_per_sample: int32, width: int32, height: int32): PPixbuf{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new".}
|
|
||||||
proc copy*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_copy".}
|
|
||||||
proc new_subpixbuf*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32,
|
|
||||||
width: int32, height: int32): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_subpixbuf".}
|
|
||||||
proc pixbuf_new_from_file*(filename: cstring, error: pointer): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file".}
|
|
||||||
proc pixbuf_new_from_data*(data: Pguchar, colorspace: TColorspace,
|
|
||||||
has_alpha: gboolean, bits_per_sample: int32,
|
|
||||||
width: int32, height: int32, rowstride: int32,
|
|
||||||
destroy_fn: TPixbufDestroyNotify,
|
|
||||||
destroy_fn_data: gpointer): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_data".}
|
|
||||||
proc pixbuf_new_from_xpm_data*(data: PPchar): PPixbuf{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_new_from_xpm_data".}
|
|
||||||
proc pixbuf_new_from_inline*(data_length: gint, a: var guint8,
|
|
||||||
copy_pixels: gboolean, error: pointer): PPixbuf{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_inline".}
|
|
||||||
proc pixbuf_new_from_file_at_size*(filename: cstring, width, height: gint,
|
|
||||||
error: pointer): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_size".}
|
|
||||||
proc pixbuf_new_from_file_at_scale*(filename: cstring, width, height: gint,
|
|
||||||
preserve_aspect_ratio: gboolean,
|
|
||||||
error: pointer): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_new_from_file_at_scale".}
|
|
||||||
proc fill*(pixbuf: PPixbuf, pixel: guint32){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_fill".}
|
|
||||||
proc save*(pixbuf: PPixbuf, filename: cstring, `type`: cstring,
|
|
||||||
error: pointer): gboolean{.cdecl, varargs, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_save".}
|
|
||||||
proc savev*(pixbuf: PPixbuf, filename: cstring, `type`: cstring,
|
|
||||||
option_keys: PPchar, option_values: PPchar, error: pointer): gboolean{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_savev".}
|
|
||||||
proc add_alpha*(pixbuf: PPixbuf, substitute_color: gboolean, r: guchar,
|
|
||||||
g: guchar, b: guchar): PPixbuf{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_add_alpha".}
|
|
||||||
proc copy_area*(src_pixbuf: PPixbuf, src_x: int32, src_y: int32,
|
|
||||||
width: int32, height: int32, dest_pixbuf: PPixbuf,
|
|
||||||
dest_x: int32, dest_y: int32){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_copy_area".}
|
|
||||||
proc saturate_and_pixelate*(src: PPixbuf, dest: PPixbuf,
|
|
||||||
saturation: gfloat, pixelate: gboolean){.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_saturate_and_pixelate".}
|
|
||||||
proc scale*(src: PPixbuf, dest: PPixbuf, dest_x: int32, dest_y: int32,
|
|
||||||
dest_width: int32, dest_height: int32, offset_x: float64,
|
|
||||||
offset_y: float64, scale_x: float64, scale_y: float64,
|
|
||||||
interp_type: TInterpType){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_scale".}
|
|
||||||
proc composite*(src: PPixbuf, dest: PPixbuf, dest_x: int32,
|
|
||||||
dest_y: int32, dest_width: int32, dest_height: int32,
|
|
||||||
offset_x: float64, offset_y: float64, scale_x: float64,
|
|
||||||
scale_y: float64, interp_type: TInterpType,
|
|
||||||
overall_alpha: int32){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_composite".}
|
|
||||||
proc composite_color*(src: PPixbuf, dest: PPixbuf, dest_x: int32,
|
|
||||||
dest_y: int32, dest_width: int32,
|
|
||||||
dest_height: int32, offset_x: float64,
|
|
||||||
offset_y: float64, scale_x: float64,
|
|
||||||
scale_y: float64, interp_type: TInterpType,
|
|
||||||
overall_alpha: int32, check_x: int32,
|
|
||||||
check_y: int32, check_size: int32, color1: guint32,
|
|
||||||
color2: guint32){.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_composite_color".}
|
|
||||||
proc scale_simple*(src: PPixbuf, dest_width: int32, dest_height: int32,
|
|
||||||
interp_type: TInterpType): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_scale_simple".}
|
|
||||||
proc composite_color_simple*(src: PPixbuf, dest_width: int32,
|
|
||||||
dest_height: int32,
|
|
||||||
interp_type: TInterpType,
|
|
||||||
overall_alpha: int32, check_size: int32,
|
|
||||||
color1: guint32, color2: guint32): PPixbuf{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_composite_color_simple".}
|
|
||||||
proc pixbuf_animation_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_animation_get_type".}
|
|
||||||
proc pixbuf_animation_new_from_file*(filename: cstring, error: pointer): PPixbufAnimation{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_new_from_file".}
|
|
||||||
when not defined(PIXBUF_DISABLE_DEPRECATED):
|
|
||||||
proc pixbuf_animation_ref*(animation: PPixbufAnimation): PPixbufAnimation{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_ref".}
|
|
||||||
proc pixbuf_animation_unref*(animation: PPixbufAnimation){.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_unref".}
|
|
||||||
proc get_width*(animation: PPixbufAnimation): int32{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_width".}
|
|
||||||
proc get_height*(animation: PPixbufAnimation): int32{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_height".}
|
|
||||||
proc is_static_image*(animation: PPixbufAnimation): gboolean{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_is_static_image".}
|
|
||||||
proc get_static_image*(animation: PPixbufAnimation): PPixbuf{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_static_image".}
|
|
||||||
proc get_iter*(animation: PPixbufAnimation, e: var TGTimeVal): PPixbufAnimationIter{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_iter".}
|
|
||||||
proc pixbuf_animation_iter_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_animation_iter_get_type".}
|
|
||||||
proc iter_get_delay_time*(iter: PPixbufAnimationIter): int32{.
|
|
||||||
cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_animation_iter_get_delay_time".}
|
|
||||||
proc iter_get_pixbuf*(iter: PPixbufAnimationIter): PPixbuf{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_get_pixbuf".}
|
|
||||||
proc pixbuf_animation_iter_on_currently_loading_frame*(
|
|
||||||
iter: PPixbufAnimationIter): gboolean{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_animation_iter_on_currently_loading_frame".}
|
|
||||||
proc iter_advance*(iter: PPixbufAnimationIter, e: var TGTimeVal): gboolean{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_advance".}
|
|
||||||
proc get_option*(pixbuf: PPixbuf, key: cstring): cstring{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_get_option".}
|
|
||||||
type
|
|
||||||
PPixbufLoader* = ptr TPixbufLoader
|
|
||||||
TPixbufLoader*{.final, pure.} = object
|
|
||||||
parent_instance*: TGObject
|
|
||||||
priv*: gpointer
|
|
||||||
|
|
||||||
PPixbufLoaderClass* = ptr TPixbufLoaderClass
|
|
||||||
TPixbufLoaderClass*{.final, pure.} = object
|
|
||||||
parent_class*: TGObjectClass
|
|
||||||
area_prepared*: proc (loader: PPixbufLoader){.cdecl.}
|
|
||||||
area_updated*: proc (loader: PPixbufLoader, x: int32, y: int32,
|
|
||||||
width: int32, height: int32){.cdecl.}
|
|
||||||
closed*: proc (loader: PPixbufLoader){.cdecl.}
|
|
||||||
|
|
||||||
|
|
||||||
proc TYPE_PIXBUF_LOADER*(): GType
|
|
||||||
proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader
|
|
||||||
proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass
|
|
||||||
proc IS_PIXBUF_LOADER*(obj: pointer): bool
|
|
||||||
proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool
|
|
||||||
proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass
|
|
||||||
proc pixbuf_loader_get_type*(): GType{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_loader_get_type".}
|
|
||||||
proc pixbuf_loader_new*(): PPixbufLoader{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_loader_new".}
|
|
||||||
proc pixbuf_loader_new*(image_type: cstring, error: pointer): PPixbufLoader{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_new_with_type".}
|
|
||||||
proc write*(loader: PPixbufLoader, buf: Pguchar, count: gsize,
|
|
||||||
error: pointer): gboolean{.cdecl, dynlib: pixbuflib,
|
|
||||||
importc: "gdk_pixbuf_loader_write".}
|
|
||||||
proc get_pixbuf*(loader: PPixbufLoader): PPixbuf{.cdecl,
|
|
||||||
dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_pixbuf".}
|
|
||||||
proc get_animation*(loader: PPixbufLoader): PPixbufAnimation{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_animation".}
|
|
||||||
proc close*(loader: PPixbufLoader, error: pointer): gboolean{.
|
|
||||||
cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_close".}
|
|
||||||
proc TYPE_PIXBUF_LOADER*(): GType =
|
|
||||||
result = pixbuf_loader_get_type()
|
|
||||||
|
|
||||||
proc PIXBUF_LOADER*(obj: pointer): PPixbufLoader =
|
|
||||||
result = cast[PPixbufLoader](G_TYPE_CHECK_INSTANCE_CAST(obj,
|
|
||||||
TYPE_PIXBUF_LOADER()))
|
|
||||||
|
|
||||||
proc PIXBUF_LOADER_CLASS*(klass: pointer): PPixbufLoaderClass =
|
|
||||||
result = cast[PPixbufLoaderClass](G_TYPE_CHECK_CLASS_CAST(klass,
|
|
||||||
TYPE_PIXBUF_LOADER()))
|
|
||||||
|
|
||||||
proc IS_PIXBUF_LOADER*(obj: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_PIXBUF_LOADER())
|
|
||||||
|
|
||||||
proc IS_PIXBUF_LOADER_CLASS*(klass: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_PIXBUF_LOADER())
|
|
||||||
|
|
||||||
proc PIXBUF_LOADER_GET_CLASS*(obj: pointer): PPixbufLoaderClass =
|
|
||||||
result = cast[PPixbufLoaderClass](G_TYPE_INSTANCE_GET_CLASS(obj,
|
|
||||||
TYPE_PIXBUF_LOADER()))
|
|
||||||
|
|
||||||
proc TYPE_PIXBUF*(): GType =
|
|
||||||
result = pixbuf_get_type()
|
|
||||||
|
|
||||||
proc PIXBUF*(anObject: pointer): PPixbuf =
|
|
||||||
result = cast[PPixbuf](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_PIXBUF()))
|
|
||||||
|
|
||||||
proc IS_PIXBUF*(anObject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF())
|
|
||||||
|
|
||||||
proc TYPE_PIXBUF_ANIMATION*(): GType =
|
|
||||||
result = pixbuf_animation_get_type()
|
|
||||||
|
|
||||||
proc PIXBUF_ANIMATION*(anObject: pointer): PPixbufAnimation =
|
|
||||||
result = cast[PPixbufAnimation](G_TYPE_CHECK_INSTANCE_CAST(anObject,
|
|
||||||
TYPE_PIXBUF_ANIMATION()))
|
|
||||||
|
|
||||||
proc IS_PIXBUF_ANIMATION*(anObject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION())
|
|
||||||
|
|
||||||
proc TYPE_PIXBUF_ANIMATION_ITER*(): GType =
|
|
||||||
result = pixbuf_animation_iter_get_type()
|
|
||||||
|
|
||||||
proc PIXBUF_ANIMATION_ITER*(anObject: pointer): PPixbufAnimationIter =
|
|
||||||
result = cast[PPixbufAnimationIter](G_TYPE_CHECK_INSTANCE_CAST(anObject,
|
|
||||||
TYPE_PIXBUF_ANIMATION_ITER()))
|
|
||||||
|
|
||||||
proc IS_PIXBUF_ANIMATION_ITER*(anObject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXBUF_ANIMATION_ITER())
|
|
||||||
|
|
||||||
proc PIXBUF_ERROR*(): TGQuark =
|
|
||||||
result = pixbuf_error_quark()
|
|
||||||
|
|
@ -1,554 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
Glib2, gdk2
|
|
||||||
|
|
||||||
when defined(WIN32):
|
|
||||||
const
|
|
||||||
GLExtLib = "libgdkglext-win32-1.0-0.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
GLExtLib = "libgdkglext-x11-1.0.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
GLExtLib = "libgdkglext-x11-1.0.so"
|
|
||||||
type
|
|
||||||
TGLConfigAttrib* = int32
|
|
||||||
TGLConfigCaveat* = int32
|
|
||||||
TGLVisualType* = int32
|
|
||||||
TGLTransparentType* = int32
|
|
||||||
TGLDrawableTypeMask* = int32
|
|
||||||
TGLRenderTypeMask* = int32
|
|
||||||
TGLBufferMask* = int32
|
|
||||||
TGLConfigError* = int32
|
|
||||||
TGLRenderType* = int32
|
|
||||||
TGLDrawableAttrib* = int32
|
|
||||||
TGLPbufferAttrib* = int32
|
|
||||||
TGLEventMask* = int32
|
|
||||||
TGLEventType* = int32
|
|
||||||
TGLDrawableType* = int32
|
|
||||||
TGLProc* = Pointer
|
|
||||||
PGLConfig* = ptr TGLConfig
|
|
||||||
PGLContext* = ptr TGLContext
|
|
||||||
PGLDrawable* = ptr TGLDrawable
|
|
||||||
PGLPixmap* = ptr TGLPixmap
|
|
||||||
PGLWindow* = ptr TGLWindow
|
|
||||||
TGLConfig* = object of TGObject
|
|
||||||
layer_plane*: gint
|
|
||||||
n_aux_buffers*: gint
|
|
||||||
n_sample_buffers*: gint
|
|
||||||
flag0*: int16
|
|
||||||
|
|
||||||
PGLConfigClass* = ptr TGLConfigClass
|
|
||||||
TGLConfigClass* = object of TGObjectClass
|
|
||||||
TGLContext* = object of TGObject
|
|
||||||
PGLContextClass* = ptr TGLContextClass
|
|
||||||
TGLContextClass* = object of TGObjectClass
|
|
||||||
TGLDrawable* = object of TGObject
|
|
||||||
PGLDrawableClass* = ptr TGLDrawableClass
|
|
||||||
TGLDrawableClass* = object of TGTypeInterface
|
|
||||||
create_new_context*: proc (gldrawable: PGLDrawable, share_list: PGLContext,
|
|
||||||
direct: gboolean, render_type: int32): PGLContext{.
|
|
||||||
cdecl.}
|
|
||||||
make_context_current*: proc (draw: PGLDrawable, a_read: PGLDrawable,
|
|
||||||
glcontext: PGLContext): gboolean{.cdecl.}
|
|
||||||
is_double_buffered*: proc (gldrawable: PGLDrawable): gboolean{.cdecl.}
|
|
||||||
swap_buffers*: proc (gldrawable: PGLDrawable){.cdecl.}
|
|
||||||
wait_gl*: proc (gldrawable: PGLDrawable){.cdecl.}
|
|
||||||
wait_gdk*: proc (gldrawable: PGLDrawable){.cdecl.}
|
|
||||||
gl_begin*: proc (draw: PGLDrawable, a_read: PGLDrawable,
|
|
||||||
glcontext: PGLContext): gboolean{.cdecl.}
|
|
||||||
gl_end*: proc (gldrawable: PGLDrawable){.cdecl.}
|
|
||||||
get_gl_config*: proc (gldrawable: PGLDrawable): PGLConfig{.cdecl.}
|
|
||||||
get_size*: proc (gldrawable: PGLDrawable, width, height: PGInt){.cdecl.}
|
|
||||||
|
|
||||||
TGLPixmap* = object of TGObject
|
|
||||||
drawable*: PDrawable
|
|
||||||
|
|
||||||
PGLPixmapClass* = ptr TGLPixmapClass
|
|
||||||
TGLPixmapClass* = object of TGObjectClass
|
|
||||||
TGLWindow* = object of TGObject
|
|
||||||
drawable*: PDrawable
|
|
||||||
|
|
||||||
PGLWindowClass* = ptr TGLWindowClass
|
|
||||||
TGLWindowClass* = object of TGObjectClass
|
|
||||||
|
|
||||||
const
|
|
||||||
HEADER_GDKGLEXT_MAJOR_VERSION* = 1
|
|
||||||
HEADER_GDKGLEXT_MINOR_VERSION* = 0
|
|
||||||
HEADER_GDKGLEXT_MICRO_VERSION* = 6
|
|
||||||
HEADER_GDKGLEXT_INTERFACE_AGE* = 4
|
|
||||||
HEADER_GDKGLEXT_BINARY_AGE* = 6
|
|
||||||
|
|
||||||
proc HEADER_GDKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool
|
|
||||||
var
|
|
||||||
glext_major_version*{.importc, dynlib: GLExtLib.}: guint
|
|
||||||
glext_minor_version*{.importc, dynlib: GLExtLib.}: guint
|
|
||||||
glext_micro_version*{.importc, dynlib: GLExtLib.}: guint
|
|
||||||
glext_interface_age*{.importc, dynlib: GLExtLib.}: guint
|
|
||||||
glext_binary_age*{.importc, dynlib: GLExtLib.}: guint
|
|
||||||
|
|
||||||
const
|
|
||||||
GL_SUCCESS* = 0
|
|
||||||
GL_ATTRIB_LIST_NONE* = 0
|
|
||||||
GL_USE_GL* = 1
|
|
||||||
GL_BUFFER_SIZE* = 2
|
|
||||||
GL_LEVEL* = 3
|
|
||||||
GL_RGBA* = 4
|
|
||||||
GL_DOUBLEBUFFER* = 5
|
|
||||||
GL_STEREO* = 6
|
|
||||||
GL_AUX_BUFFERS* = 7
|
|
||||||
GL_RED_SIZE* = 8
|
|
||||||
GL_GREEN_SIZE* = 9
|
|
||||||
GL_BLUE_SIZE* = 10
|
|
||||||
GL_ALPHA_SIZE* = 11
|
|
||||||
GL_DEPTH_SIZE* = 12
|
|
||||||
GL_STENCIL_SIZE* = 13
|
|
||||||
GL_ACCUM_RED_SIZE* = 14
|
|
||||||
GL_ACCUM_GREEN_SIZE* = 15
|
|
||||||
GL_ACCUM_BLUE_SIZE* = 16
|
|
||||||
GL_ACCUM_ALPHA_SIZE* = 17
|
|
||||||
GL_CONFIG_CAVEAT* = 0x00000020
|
|
||||||
GL_X_VISUAL_TYPE* = 0x00000022
|
|
||||||
GL_TRANSPARENT_TYPE* = 0x00000023
|
|
||||||
GL_TRANSPARENT_INDEX_VALUE* = 0x00000024
|
|
||||||
GL_TRANSPARENT_RED_VALUE* = 0x00000025
|
|
||||||
GL_TRANSPARENT_GREEN_VALUE* = 0x00000026
|
|
||||||
GL_TRANSPARENT_BLUE_VALUE* = 0x00000027
|
|
||||||
GL_TRANSPARENT_ALPHA_VALUE* = 0x00000028
|
|
||||||
GL_DRAWABLE_TYPE* = 0x00008010
|
|
||||||
GL_RENDER_TYPE* = 0x00008011
|
|
||||||
GL_X_RENDERABLE* = 0x00008012
|
|
||||||
GL_FBCONFIG_ID* = 0x00008013
|
|
||||||
GL_MAX_PBUFFER_WIDTH* = 0x00008016
|
|
||||||
GL_MAX_PBUFFER_HEIGHT* = 0x00008017
|
|
||||||
GL_MAX_PBUFFER_PIXELS* = 0x00008018
|
|
||||||
GL_VISUAL_ID* = 0x0000800B
|
|
||||||
GL_SCREEN* = 0x0000800C
|
|
||||||
GL_SAMPLE_BUFFERS* = 100000
|
|
||||||
GL_SAMPLES* = 100001
|
|
||||||
GL_DONT_CARE* = 0xFFFFFFFF
|
|
||||||
GL_NONE* = 0x00008000
|
|
||||||
GL_CONFIG_CAVEAT_DONT_CARE* = 0xFFFFFFFF
|
|
||||||
GL_CONFIG_CAVEAT_NONE* = 0x00008000
|
|
||||||
GL_SLOW_CONFIG* = 0x00008001
|
|
||||||
GL_NON_CONFORMANT_CONFIG* = 0x0000800D
|
|
||||||
GL_VISUAL_TYPE_DONT_CARE* = 0xFFFFFFFF
|
|
||||||
GL_TRUE_COLOR* = 0x00008002
|
|
||||||
GL_DIRECT_COLOR* = 0x00008003
|
|
||||||
GL_PSEUDO_COLOR* = 0x00008004
|
|
||||||
GL_STATIC_COLOR* = 0x00008005
|
|
||||||
GL_GRAY_SCALE* = 0x00008006
|
|
||||||
GL_STATIC_GRAY* = 0x00008007
|
|
||||||
GL_TRANSPARENT_NONE* = 0x00008000
|
|
||||||
GL_TRANSPARENT_RGB* = 0x00008008
|
|
||||||
GL_TRANSPARENT_INDEX* = 0x00008009
|
|
||||||
GL_WINDOW_BIT* = 1 shl 0
|
|
||||||
GL_PIXMAP_BIT* = 1 shl 1
|
|
||||||
GL_PBUFFER_BIT* = 1 shl 2
|
|
||||||
GL_RGBA_BIT* = 1 shl 0
|
|
||||||
GL_COLOR_INDEX_BIT* = 1 shl 1
|
|
||||||
GL_FRONT_LEFT_BUFFER_BIT* = 1 shl 0
|
|
||||||
GL_FRONT_RIGHT_BUFFER_BIT* = 1 shl 1
|
|
||||||
GL_BACK_LEFT_BUFFER_BIT* = 1 shl 2
|
|
||||||
GL_BACK_RIGHT_BUFFER_BIT* = 1 shl 3
|
|
||||||
GL_AUX_BUFFERS_BIT* = 1 shl 4
|
|
||||||
GL_DEPTH_BUFFER_BIT* = 1 shl 5
|
|
||||||
GL_STENCIL_BUFFER_BIT* = 1 shl 6
|
|
||||||
GL_ACCUM_BUFFER_BIT* = 1 shl 7
|
|
||||||
GL_BAD_SCREEN* = 1
|
|
||||||
GL_BAD_ATTRIBUTE* = 2
|
|
||||||
GL_NO_EXTENSION* = 3
|
|
||||||
GL_BAD_VISUAL* = 4
|
|
||||||
GL_BAD_CONTEXT* = 5
|
|
||||||
GL_BAD_VALUE* = 6
|
|
||||||
GL_BAD_ENUM* = 7
|
|
||||||
GL_RGBA_TYPE* = 0x00008014
|
|
||||||
GL_COLOR_INDEX_TYPE* = 0x00008015
|
|
||||||
GL_PRESERVED_CONTENTS* = 0x0000801B
|
|
||||||
GL_LARGEST_PBUFFER* = 0x0000801C
|
|
||||||
GL_WIDTH* = 0x0000801D
|
|
||||||
GL_HEIGHT* = 0x0000801E
|
|
||||||
GL_EVENT_MASK* = 0x0000801F
|
|
||||||
GL_PBUFFER_PRESERVED_CONTENTS* = 0x0000801B
|
|
||||||
GL_PBUFFER_LARGEST_PBUFFER* = 0x0000801C
|
|
||||||
GL_PBUFFER_HEIGHT* = 0x00008040
|
|
||||||
GL_PBUFFER_WIDTH* = 0x00008041
|
|
||||||
GL_PBUFFER_CLOBBER_MASK* = 1 shl 27
|
|
||||||
GL_DAMAGED* = 0x00008020
|
|
||||||
GL_SAVED* = 0x00008021
|
|
||||||
GL_WINDOW_VALUE* = 0x00008022
|
|
||||||
GL_PBUFFER* = 0x00008023
|
|
||||||
|
|
||||||
proc gl_config_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_attrib_get_type".}
|
|
||||||
proc TYPE_GL_CONFIG_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_attrib_get_type".}
|
|
||||||
proc gl_config_caveat_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_caveat_get_type".}
|
|
||||||
proc TYPE_GL_CONFIG_CAVEAT*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_caveat_get_type".}
|
|
||||||
proc gl_visual_type_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_visual_type_get_type".}
|
|
||||||
proc TYPE_GL_VISUAL_TYPE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_visual_type_get_type".}
|
|
||||||
proc gl_transparent_type_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_transparent_type_get_type".}
|
|
||||||
proc TYPE_GL_TRANSPARENT_TYPE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_transparent_type_get_type".}
|
|
||||||
proc gl_drawable_type_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_type_mask_get_type".}
|
|
||||||
proc TYPE_GL_DRAWABLE_TYPE_MASK*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_type_mask_get_type".}
|
|
||||||
proc gl_render_type_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_render_type_mask_get_type".}
|
|
||||||
proc TYPE_GL_RENDER_TYPE_MASK*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_render_type_mask_get_type".}
|
|
||||||
proc gl_buffer_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_buffer_mask_get_type".}
|
|
||||||
proc TYPE_GL_BUFFER_MASK*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_buffer_mask_get_type".}
|
|
||||||
proc gl_config_error_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_error_get_type".}
|
|
||||||
proc TYPE_GL_CONFIG_ERROR*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_error_get_type".}
|
|
||||||
proc gl_render_type_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_render_type_get_type".}
|
|
||||||
proc TYPE_GL_RENDER_TYPE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_render_type_get_type".}
|
|
||||||
proc gl_drawable_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_attrib_get_type".}
|
|
||||||
proc TYPE_GL_DRAWABLE_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_attrib_get_type".}
|
|
||||||
proc gl_pbuffer_attrib_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_pbuffer_attrib_get_type".}
|
|
||||||
proc TYPE_GL_PBUFFER_ATTRIB*(): GType{.cdecl, dynlib: GLExtLib, importc: "gdk_gl_pbuffer_attrib_get_type".}
|
|
||||||
proc gl_event_mask_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_event_mask_get_type".}
|
|
||||||
proc TYPE_GL_EVENT_MASK*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_event_mask_get_type".}
|
|
||||||
proc gl_event_type_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_event_type_get_type".}
|
|
||||||
proc TYPE_GL_EVENT_TYPE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_event_type_get_type".}
|
|
||||||
proc gl_drawable_type_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_type_get_type".}
|
|
||||||
proc TYPE_GL_DRAWABLE_TYPE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_type_get_type".}
|
|
||||||
proc gl_config_mode_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_mode_get_type".}
|
|
||||||
proc TYPE_GL_CONFIG_MODE*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_mode_get_type".}
|
|
||||||
proc gl_parse_args*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_parse_args".}
|
|
||||||
proc gl_init_check*(argc: var int32, argv: ptr cstringArray): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_init_check".}
|
|
||||||
proc gl_init*(argc: var int32, argv: ptr cstringArray){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_init".}
|
|
||||||
proc gl_query_gl_extension*(extension: cstring): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_query_gl_extension".}
|
|
||||||
proc gl_get_proc_address*(proc_name: cstring): TGLProc{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_get_proc_address".}
|
|
||||||
const
|
|
||||||
bm_TGdkGLConfig_is_rgba* = 1 shl 0
|
|
||||||
bp_TGdkGLConfig_is_rgba* = 0
|
|
||||||
bm_TGdkGLConfig_is_double_buffered* = 1 shl 1
|
|
||||||
bp_TGdkGLConfig_is_double_buffered* = 1
|
|
||||||
bm_TGdkGLConfig_as_single_mode* = 1 shl 2
|
|
||||||
bp_TGdkGLConfig_as_single_mode* = 2
|
|
||||||
bm_TGdkGLConfig_is_stereo* = 1 shl 3
|
|
||||||
bp_TGdkGLConfig_is_stereo* = 3
|
|
||||||
bm_TGdkGLConfig_has_alpha* = 1 shl 4
|
|
||||||
bp_TGdkGLConfig_has_alpha* = 4
|
|
||||||
bm_TGdkGLConfig_has_depth_buffer* = 1 shl 5
|
|
||||||
bp_TGdkGLConfig_has_depth_buffer* = 5
|
|
||||||
bm_TGdkGLConfig_has_stencil_buffer* = 1 shl 6
|
|
||||||
bp_TGdkGLConfig_has_stencil_buffer* = 6
|
|
||||||
bm_TGdkGLConfig_has_accum_buffer* = 1 shl 7
|
|
||||||
bp_TGdkGLConfig_has_accum_buffer* = 7
|
|
||||||
|
|
||||||
const
|
|
||||||
GL_MODE_RGB* = 0
|
|
||||||
GL_MODE_RGBA* = 0
|
|
||||||
GL_MODE_INDEX* = 1 shl 0
|
|
||||||
GL_MODE_SINGLE* = 0
|
|
||||||
GL_MODE_DOUBLE* = 1 shl 1
|
|
||||||
GL_MODE_STEREO* = 1 shl 2
|
|
||||||
GL_MODE_ALPHA* = 1 shl 3
|
|
||||||
GL_MODE_DEPTH* = 1 shl 4
|
|
||||||
GL_MODE_STENCIL* = 1 shl 5
|
|
||||||
GL_MODE_ACCUM* = 1 shl 6
|
|
||||||
GL_MODE_MULTISAMPLE* = 1 shl 7
|
|
||||||
|
|
||||||
type
|
|
||||||
TGLConfigMode* = int32
|
|
||||||
PGLConfigMode* = ptr TGLConfigMode
|
|
||||||
|
|
||||||
proc TYPE_GL_CONFIG*(): GType
|
|
||||||
proc GL_CONFIG*(anObject: Pointer): PGLConfig
|
|
||||||
proc GL_CONFIG_CLASS*(klass: Pointer): PGLConfigClass
|
|
||||||
proc IS_GL_CONFIG*(anObject: Pointer): bool
|
|
||||||
proc IS_GL_CONFIG_CLASS*(klass: Pointer): bool
|
|
||||||
proc GL_CONFIG_GET_CLASS*(obj: Pointer): PGLConfigClass
|
|
||||||
proc gl_config_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_get_type".}
|
|
||||||
proc get_screen*(glconfig: PGLConfig): PScreen{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_screen".}
|
|
||||||
proc get_attrib*(glconfig: PGLConfig, attribute: int, value: var cint): gboolean{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_config_get_attrib".}
|
|
||||||
proc get_colormap*(glconfig: PGLConfig): PColormap{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_colormap".}
|
|
||||||
proc get_visual*(glconfig: PGLConfig): PVisual{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_visual".}
|
|
||||||
proc get_depth*(glconfig: PGLConfig): gint{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_get_depth".}
|
|
||||||
proc get_layer_plane*(glconfig: PGLConfig): gint{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_layer_plane".}
|
|
||||||
proc get_n_aux_buffers*(glconfig: PGLConfig): gint{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_n_aux_buffers".}
|
|
||||||
proc get_n_sample_buffers*(glconfig: PGLConfig): gint{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_get_n_sample_buffers".}
|
|
||||||
proc is_rgba*(glconfig: PGLConfig): gboolean{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_config_is_rgba".}
|
|
||||||
proc is_double_buffered*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_is_double_buffered".}
|
|
||||||
proc is_stereo*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_is_stereo".}
|
|
||||||
proc has_alpha*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_has_alpha".}
|
|
||||||
proc has_depth_buffer*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_has_depth_buffer".}
|
|
||||||
proc has_stencil_buffer*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_has_stencil_buffer".}
|
|
||||||
proc has_accum_buffer*(glconfig: PGLConfig): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_config_has_accum_buffer".}
|
|
||||||
proc TYPE_GL_CONTEXT*(): GType
|
|
||||||
proc GL_CONTEXT*(anObject: Pointer): PGLContext
|
|
||||||
proc GL_CONTEXT_CLASS*(klass: Pointer): PGLContextClass
|
|
||||||
proc IS_GL_CONTEXT*(anObject: Pointer): bool
|
|
||||||
proc IS_GL_CONTEXT_CLASS*(klass: Pointer): bool
|
|
||||||
proc GL_CONTEXT_GET_CLASS*(obj: Pointer): PGLContextClass
|
|
||||||
proc gl_context_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_context_get_type".}
|
|
||||||
proc context_new*(gldrawable: PGLDrawable, share_list: PGLContext,
|
|
||||||
direct: gboolean, render_type: int32): PGLContext{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_new".}
|
|
||||||
proc destroy*(glcontext: PGLContext){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_context_destroy".}
|
|
||||||
proc copy*(glcontext: PGLContext, src: PGLContext, mask: int32): gboolean{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_context_copy".}
|
|
||||||
proc get_gl_drawable*(glcontext: PGLContext): PGLDrawable{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_drawable".}
|
|
||||||
proc get_gl_config*(glcontext: PGLContext): PGLConfig{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_config".}
|
|
||||||
proc get_share_list*(glcontext: PGLContext): PGLContext{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_get_share_list".}
|
|
||||||
proc is_direct*(glcontext: PGLContext): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_is_direct".}
|
|
||||||
proc get_render_type*(glcontext: PGLContext): int32{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_context_get_render_type".}
|
|
||||||
proc gl_context_get_current*(): PGLContext{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_context_get_current".}
|
|
||||||
proc TYPE_GL_DRAWABLE*(): GType
|
|
||||||
proc GL_DRAWABLE*(inst: Pointer): PGLDrawable
|
|
||||||
proc GL_DRAWABLE_CLASS*(vtable: Pointer): PGLDrawableClass
|
|
||||||
proc IS_GL_DRAWABLE*(inst: Pointer): bool
|
|
||||||
proc IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool
|
|
||||||
proc GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGLDrawableClass
|
|
||||||
proc gl_drawable_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_get_type".}
|
|
||||||
proc make_current*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_make_current".}
|
|
||||||
proc is_double_buffered*(gldrawable: PGLDrawable): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_drawable_is_double_buffered".}
|
|
||||||
proc swap_buffers*(gldrawable: PGLDrawable){.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_drawable_swap_buffers".}
|
|
||||||
proc wait_gl*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_wait_gl".}
|
|
||||||
proc wait_gdk*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_wait_gdk".}
|
|
||||||
proc gl_begin*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_gl_begin".}
|
|
||||||
proc gl_end*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_gl_end".}
|
|
||||||
proc get_gl_config*(gldrawable: PGLDrawable): PGLConfig{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_drawable_get_gl_config".}
|
|
||||||
proc get_size*(gldrawable: PGLDrawable, width, height: PGInt){.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_get_size".}
|
|
||||||
proc gl_drawable_get_current*(): PGLDrawable{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_drawable_get_current".}
|
|
||||||
proc TYPE_GL_PIXMAP*(): GType
|
|
||||||
proc GL_PIXMAP*(anObject: Pointer): PGLPixmap
|
|
||||||
proc GL_PIXMAP_CLASS*(klass: Pointer): PGLPixmapClass
|
|
||||||
proc IS_GL_PIXMAP*(anObject: Pointer): bool
|
|
||||||
proc IS_GL_PIXMAP_CLASS*(klass: Pointer): bool
|
|
||||||
proc GL_PIXMAP_GET_CLASS*(obj: Pointer): PGLPixmapClass
|
|
||||||
proc gl_pixmap_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_pixmap_get_type".}
|
|
||||||
proc pixmap_new*(glconfig: PGLConfig, pixmap: PPixmap, attrib_list: ptr int32): PGLPixmap{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_pixmap_new".}
|
|
||||||
proc destroy*(glpixmap: PGLPixmap){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_pixmap_destroy".}
|
|
||||||
proc get_pixmap*(glpixmap: PGLPixmap): PPixmap{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_pixmap_get_pixmap".}
|
|
||||||
proc set_gl_capability*(pixmap: PPixmap, glconfig: PGLConfig,
|
|
||||||
attrib_list: ptr int32): PGLPixmap{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_pixmap_set_gl_capability".}
|
|
||||||
proc unset_gl_capability*(pixmap: PPixmap){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_pixmap_unset_gl_capability".}
|
|
||||||
proc is_gl_capable*(pixmap: PPixmap): gboolean{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_pixmap_is_gl_capable".}
|
|
||||||
proc get_gl_pixmap*(pixmap: PPixmap): PGLPixmap{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_pixmap_get_gl_pixmap".}
|
|
||||||
proc get_gl_drawable*(pixmap: PPixmap): PGLDrawable
|
|
||||||
proc TYPE_GL_WINDOW*(): GType
|
|
||||||
proc GL_WINDOW*(anObject: Pointer): PGLWindow
|
|
||||||
proc GL_WINDOW_CLASS*(klass: Pointer): PGLWindowClass
|
|
||||||
proc IS_GL_WINDOW*(anObject: Pointer): bool
|
|
||||||
proc IS_GL_WINDOW_CLASS*(klass: Pointer): bool
|
|
||||||
proc GL_WINDOW_GET_CLASS*(obj: Pointer): PGLWindowClass
|
|
||||||
proc gl_window_get_type*(): GType{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_window_get_type".}
|
|
||||||
proc window_new*(glconfig: PGLConfig, window: PWindow, attrib_list: ptr int32): PGLWindow{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gdk_gl_window_new".}
|
|
||||||
proc destroy*(glwindow: PGLWindow){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_window_destroy".}
|
|
||||||
proc get_window*(glwindow: PGLWindow): PWindow{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_window_get_window".}
|
|
||||||
proc set_gl_capability*(window: PWindow, glconfig: PGLConfig,
|
|
||||||
attrib_list: ptr int32): PGLWindow{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_window_set_gl_capability".}
|
|
||||||
proc unset_gl_capability*(window: PWindow){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_window_unset_gl_capability".}
|
|
||||||
proc is_gl_capable*(window: PWindow): gboolean{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_window_is_gl_capable".}
|
|
||||||
proc get_gl_window*(window: PWindow): PGLWindow{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_window_get_gl_window".}
|
|
||||||
proc get_gl_drawable*(window: PWindow): PGLDrawable
|
|
||||||
proc gl_draw_cube*(solid: gboolean, size: float64){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_cube".}
|
|
||||||
proc gl_draw_sphere*(solid: gboolean, radius: float64, slices: int32,
|
|
||||||
stacks: int32){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_sphere".}
|
|
||||||
proc gl_draw_cone*(solid: gboolean, base: float64, height: float64,
|
|
||||||
slices: int32, stacks: int32){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_cone".}
|
|
||||||
proc gl_draw_torus*(solid: gboolean, inner_radius: float64,
|
|
||||||
outer_radius: float64, nsides: int32, rings: int32){.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gdk_gl_draw_torus".}
|
|
||||||
proc gl_draw_tetrahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_tetrahedron".}
|
|
||||||
proc gl_draw_octahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_octahedron".}
|
|
||||||
proc gl_draw_dodecahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_dodecahedron".}
|
|
||||||
proc gl_draw_icosahedron*(solid: gboolean){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_icosahedron".}
|
|
||||||
proc gl_draw_teapot*(solid: gboolean, scale: float64){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gdk_gl_draw_teapot".}
|
|
||||||
proc HEADER_GDKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool =
|
|
||||||
result = (HEADER_GDKGLEXT_MAJOR_VERSION > major) or
|
|
||||||
((HEADER_GDKGLEXT_MAJOR_VERSION == major) and
|
|
||||||
(HEADER_GDKGLEXT_MINOR_VERSION > minor)) or
|
|
||||||
((HEADER_GDKGLEXT_MAJOR_VERSION == major) and
|
|
||||||
(HEADER_GDKGLEXT_MINOR_VERSION == minor) and
|
|
||||||
(HEADER_GDKGLEXT_MICRO_VERSION >= micro))
|
|
||||||
|
|
||||||
proc TYPE_GL_CONFIG*(): GType =
|
|
||||||
result = gl_config_get_type()
|
|
||||||
|
|
||||||
proc GL_CONFIG*(anObject: Pointer): PGLConfig =
|
|
||||||
result = cast[PGLConfig](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_CONFIG()))
|
|
||||||
|
|
||||||
proc GL_CONFIG_CLASS*(klass: Pointer): PGLConfigClass =
|
|
||||||
result = cast[PGLConfigClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_CONFIG()))
|
|
||||||
|
|
||||||
proc IS_GL_CONFIG*(anObject: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_CONFIG())
|
|
||||||
|
|
||||||
proc IS_GL_CONFIG_CLASS*(klass: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_CONFIG())
|
|
||||||
|
|
||||||
proc GL_CONFIG_GET_CLASS*(obj: Pointer): PGLConfigClass =
|
|
||||||
result = cast[PGLConfigClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_CONFIG()))
|
|
||||||
|
|
||||||
proc TYPE_GL_CONTEXT*(): GType =
|
|
||||||
result = gl_context_get_type()
|
|
||||||
|
|
||||||
proc GL_CONTEXT*(anObject: Pointer): PGLContext =
|
|
||||||
result = cast[PGLContext](G_TYPE_CHECK_INSTANCE_CAST(anObject,
|
|
||||||
TYPE_GL_CONTEXT()))
|
|
||||||
|
|
||||||
proc GL_CONTEXT_CLASS*(klass: Pointer): PGLContextClass =
|
|
||||||
result = cast[PGLContextClass](G_TYPE_CHECK_CLASS_CAST(klass,
|
|
||||||
TYPE_GL_CONTEXT()))
|
|
||||||
|
|
||||||
proc IS_GL_CONTEXT*(anObject: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_CONTEXT())
|
|
||||||
|
|
||||||
proc IS_GL_CONTEXT_CLASS*(klass: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_CONTEXT())
|
|
||||||
|
|
||||||
proc GL_CONTEXT_GET_CLASS*(obj: Pointer): PGLContextClass =
|
|
||||||
result = cast[PGLContextClass](G_TYPE_INSTANCE_GET_CLASS(obj,
|
|
||||||
TYPE_GL_CONTEXT()))
|
|
||||||
|
|
||||||
proc TYPE_GL_DRAWABLE*(): GType =
|
|
||||||
result = gl_drawable_get_type()
|
|
||||||
|
|
||||||
proc GL_DRAWABLE*(inst: Pointer): PGLDrawable =
|
|
||||||
result = cast[PGLDrawable](G_TYPE_CHECK_INSTANCE_CAST(inst, TYPE_GL_DRAWABLE()))
|
|
||||||
|
|
||||||
proc GL_DRAWABLE_CLASS*(vtable: Pointer): PGLDrawableClass =
|
|
||||||
result = cast[PGLDrawableClass](G_TYPE_CHECK_CLASS_CAST(vtable,
|
|
||||||
TYPE_GL_DRAWABLE()))
|
|
||||||
|
|
||||||
proc IS_GL_DRAWABLE*(inst: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(inst, TYPE_GL_DRAWABLE())
|
|
||||||
|
|
||||||
proc IS_GL_DRAWABLE_CLASS*(vtable: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(vtable, TYPE_GL_DRAWABLE())
|
|
||||||
|
|
||||||
proc GL_DRAWABLE_GET_CLASS*(inst: Pointer): PGLDrawableClass =
|
|
||||||
result = cast[PGLDrawableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst,
|
|
||||||
TYPE_GL_DRAWABLE()))
|
|
||||||
|
|
||||||
proc TYPE_GL_PIXMAP*(): GType =
|
|
||||||
result = gl_pixmap_get_type()
|
|
||||||
|
|
||||||
proc GL_PIXMAP*(anObject: Pointer): PGLPixmap =
|
|
||||||
result = cast[PGLPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_PIXMAP()))
|
|
||||||
|
|
||||||
proc GL_PIXMAP_CLASS*(klass: Pointer): PGLPixmapClass =
|
|
||||||
result = cast[PGLPixmapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_PIXMAP()))
|
|
||||||
|
|
||||||
proc IS_GL_PIXMAP*(anObject: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_PIXMAP())
|
|
||||||
|
|
||||||
proc IS_GL_PIXMAP_CLASS*(klass: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_PIXMAP())
|
|
||||||
|
|
||||||
proc GL_PIXMAP_GET_CLASS*(obj: Pointer): PGLPixmapClass =
|
|
||||||
result = cast[PGLPixmapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_PIXMAP()))
|
|
||||||
|
|
||||||
proc get_gl_drawable*(pixmap: PPixmap): PGLDrawable =
|
|
||||||
result = GL_DRAWABLE(get_gl_pixmap(pixmap))
|
|
||||||
|
|
||||||
proc TYPE_GL_WINDOW*(): GType =
|
|
||||||
result = gl_window_get_type()
|
|
||||||
|
|
||||||
proc GL_WINDOW*(anObject: Pointer): PGLWindow =
|
|
||||||
result = cast[PGLWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GL_WINDOW()))
|
|
||||||
|
|
||||||
proc GL_WINDOW_CLASS*(klass: Pointer): PGLWindowClass =
|
|
||||||
result = cast[PGLWindowClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GL_WINDOW()))
|
|
||||||
|
|
||||||
proc IS_GL_WINDOW*(anObject: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GL_WINDOW())
|
|
||||||
|
|
||||||
proc IS_GL_WINDOW_CLASS*(klass: Pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GL_WINDOW())
|
|
||||||
|
|
||||||
proc GL_WINDOW_GET_CLASS*(obj: Pointer): PGLWindowClass =
|
|
||||||
result = cast[PGLWindowClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GL_WINDOW()))
|
|
||||||
|
|
||||||
proc get_gl_drawable*(window: PWindow): PGLDrawable =
|
|
||||||
result = GL_DRAWABLE(get_gl_window(window))
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,53 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
Glib2, Gdk2, gtk2, GdkGLExt
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
const
|
|
||||||
GLExtLib* = "libgtkglext-win32-1.0-0.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
GLExtLib* = "libgtkglext-x11-1.0.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
GLExtLib* = "libgtkglext-x11-1.0.so"
|
|
||||||
|
|
||||||
const
|
|
||||||
HEADER_GTKGLEXT_MAJOR_VERSION* = 1
|
|
||||||
HEADER_GTKGLEXT_MINOR_VERSION* = 0
|
|
||||||
HEADER_GTKGLEXT_MICRO_VERSION* = 6
|
|
||||||
HEADER_GTKGLEXT_INTERFACE_AGE* = 4
|
|
||||||
HEADER_GTKGLEXT_BINARY_AGE* = 6
|
|
||||||
|
|
||||||
proc gl_parse_args*(argc: ptr int32, argv: PPPChar): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_gl_parse_args".}
|
|
||||||
proc gl_init_check*(argc: ptr int32, argv: PPPChar): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_gl_init_check".}
|
|
||||||
proc gl_init*(argc: ptr int32, argv: PPPChar){.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gtk_gl_init".}
|
|
||||||
proc set_gl_capability*(widget: PWidget, glconfig: PGLConfig,
|
|
||||||
share_list: PGLContext, direct: gboolean,
|
|
||||||
render_type: int): gboolean{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_widget_set_gl_capability".}
|
|
||||||
proc is_gl_capable*(widget: PWidget): gboolean{.cdecl, dynlib: GLExtLib,
|
|
||||||
importc: "gtk_widget_is_gl_capable".}
|
|
||||||
proc get_gl_config*(widget: PWidget): PGLConfig{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_widget_get_gl_config".}
|
|
||||||
proc create_gl_context*(widget: PWidget, share_list: PGLContext,
|
|
||||||
direct: gboolean, render_type: int): PGLContext{.
|
|
||||||
cdecl, dynlib: GLExtLib, importc: "gtk_widget_create_gl_context".}
|
|
||||||
proc get_gl_context*(widget: PWidget): PGLContext{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_widget_get_gl_context".}
|
|
||||||
proc get_gl_window*(widget: PWidget): PGLWindow{.cdecl,
|
|
||||||
dynlib: GLExtLib, importc: "gtk_widget_get_gl_window".}
|
|
||||||
|
|
||||||
proc HEADER_GTKGLEXT_CHECK_VERSION*(major, minor, micro: guint): bool =
|
|
||||||
result = (HEADER_GTKGLEXT_MAJOR_VERSION > major) or
|
|
||||||
((HEADER_GTKGLEXT_MAJOR_VERSION == major) and
|
|
||||||
(HEADER_GTKGLEXT_MINOR_VERSION > minor)) or
|
|
||||||
((HEADER_GTKGLEXT_MAJOR_VERSION == major) and
|
|
||||||
(HEADER_GTKGLEXT_MINOR_VERSION == minor) and
|
|
||||||
(HEADER_GTKGLEXT_MICRO_VERSION >= micro))
|
|
||||||
|
|
||||||
proc get_gl_drawable*(widget: PWidget): PGLDrawable =
|
|
||||||
result = GL_DRAWABLE(get_gl_window(widget))
|
|
||||||
|
|
@ -1,523 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
gtk2, glib2, atk, pango, gdk2pixbuf, gdk2
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
const
|
|
||||||
htmllib = "libgtkhtml-win32-2.0-0.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
htmllib = "libgtkhtml-2.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
htmllib = "libgtkhtml-2.so"
|
|
||||||
const
|
|
||||||
DOM_UNSPECIFIED_EVENT_TYPE_ERR* = 0
|
|
||||||
DOM_INDEX_SIZE_ERR* = 1
|
|
||||||
DOM_DOMSTRING_SIZE_ERR* = 2
|
|
||||||
DOM_HIERARCHY_REQUEST_ERR* = 3
|
|
||||||
DOM_WRONG_DOCUMENT_ERR* = 4
|
|
||||||
DOM_INVALID_CHARACTER_ERR* = 5
|
|
||||||
DOM_NO_DATA_ALLOWED_ERR* = 6
|
|
||||||
DOM_NO_MODIFICATION_ALLOWED_ERR* = 7
|
|
||||||
DOM_NOT_FOUND_ERR* = 8
|
|
||||||
DOM_NOT_SUPPORTED_ERR* = 9
|
|
||||||
DOM_INUSE_ATTRIBUTE_ERR* = 10
|
|
||||||
DOM_INVALID_STATE_ERR* = 11
|
|
||||||
DOM_SYNTAX_ERR* = 12
|
|
||||||
DOM_INVALID_MODIFICATION_ERR* = 13
|
|
||||||
DOM_NAMESPACE_ERR* = 14
|
|
||||||
DOM_INVALID_ACCESS_ERR* = 15
|
|
||||||
DOM_NO_EXCEPTION* = 255
|
|
||||||
DOM_ELEMENT_NODE* = 1
|
|
||||||
DOM_ATTRIBUTE_NODE* = 2
|
|
||||||
DOM_TEXT_NODE* = 3
|
|
||||||
DOM_CDATA_SECTION_NODE* = 4
|
|
||||||
DOM_ENTITY_REFERENCE_NODE* = 5
|
|
||||||
DOM_ENTITY_NODE* = 6
|
|
||||||
DOM_PROCESSING_INSTRUCTION_NODE* = 7
|
|
||||||
DOM_COMMENT_NODE* = 8
|
|
||||||
DOM_DOCUMENT_NODE* = 9
|
|
||||||
DOM_DOCUMENT_TYPE_NODE* = 10
|
|
||||||
DOM_DOCUMENT_FRAGMENT_NODE* = 11
|
|
||||||
DOM_NOTATION_NODE* = 12
|
|
||||||
bm_HtmlFontSpecification_weight* = 0x0000000F
|
|
||||||
bp_HtmlFontSpecification_weight* = 0
|
|
||||||
bm_HtmlFontSpecification_style* = 0x00000030
|
|
||||||
bp_HtmlFontSpecification_style* = 4
|
|
||||||
bm_HtmlFontSpecification_variant* = 0x000000C0
|
|
||||||
bp_HtmlFontSpecification_variant* = 6
|
|
||||||
bm_HtmlFontSpecification_stretch* = 0x00000F00
|
|
||||||
bp_HtmlFontSpecification_stretch* = 8
|
|
||||||
bm_HtmlFontSpecification_decoration* = 0x00007000
|
|
||||||
bp_HtmlFontSpecification_decoration* = 12
|
|
||||||
|
|
||||||
type
|
|
||||||
TDomString* = gchar
|
|
||||||
PDomString* = cstring
|
|
||||||
TDomBoolean* = gboolean
|
|
||||||
TDomException* = gushort
|
|
||||||
TDomTimeStamp* = guint64
|
|
||||||
PDomNode* = ptr TDomNode
|
|
||||||
TDomNode* = object of TGObject
|
|
||||||
xmlnode*: pointer
|
|
||||||
style*: pointer
|
|
||||||
|
|
||||||
PDomException* = ptr TDomException
|
|
||||||
|
|
||||||
PDomNodeClass* = ptr TDomNodeClass
|
|
||||||
TDomNodeClass* = object of TGObjectClass
|
|
||||||
`get_nodeName`*: proc (node: PDomNode): PDomString{.cdecl.}
|
|
||||||
`get_nodeValue`*: proc (node: PDomNode, exc: PDomException): PDomString{.
|
|
||||||
cdecl.}
|
|
||||||
`set_nodeValue`*: proc (node: PDomNode, value: PDomString,
|
|
||||||
exc: PDomException): PDomString{.cdecl.}
|
|
||||||
|
|
||||||
PDomDocument* = ptr TDomDocument
|
|
||||||
TDomDocument*{.final, pure.} = object
|
|
||||||
parent*: PDomNode
|
|
||||||
iterators*: PGSList
|
|
||||||
|
|
||||||
PDomDocumentClass* = ptr TDomDocumentClass
|
|
||||||
TDomDocumentClass*{.final, pure.} = object
|
|
||||||
parent_class*: PDomNodeClass
|
|
||||||
|
|
||||||
PHtmlFocusIterator* = ptr THtmlFocusIterator
|
|
||||||
THtmlFocusIterator* = object of TGObject
|
|
||||||
document*: PDomDocument
|
|
||||||
current_node*: PDomNode
|
|
||||||
|
|
||||||
PHtmlFocusIteratorClass* = ptr THtmlFocusIteratorClass
|
|
||||||
THtmlFocusIteratorClass* = object of TGObjectClass
|
|
||||||
THtmlParserType* = enum
|
|
||||||
HTML_PARSER_TYPE_HTML, HTML_PARSER_TYPE_XML
|
|
||||||
PHtmlParser* = ptr THtmlParser
|
|
||||||
THtmlParser* = object of TGObject
|
|
||||||
parser_type*: THtmlParserType
|
|
||||||
document*: PHtmlDocument
|
|
||||||
stream*: PHtmlStream
|
|
||||||
xmlctxt*: pointer
|
|
||||||
res*: int32
|
|
||||||
chars*: array[0..9, char]
|
|
||||||
blocking*: gboolean
|
|
||||||
blocking_node*: PDomNode
|
|
||||||
|
|
||||||
PHtmlParserClass* = ptr THtmlParserClass
|
|
||||||
THtmlParserClass* = object of gtk2.TObjectClass
|
|
||||||
done_parsing*: proc (parser: PHtmlParser){.cdecl.}
|
|
||||||
new_node*: proc (parser: PHtmlParser, node: PDomNode)
|
|
||||||
parsed_document_node*: proc (parser: PHtmlParser, document: PDomDocument)
|
|
||||||
|
|
||||||
PHtmlStream* = ptr THtmlStream
|
|
||||||
THtmlStreamCloseFunc* = proc (stream: PHtmlStream, user_data: gpointer){.cdecl.}
|
|
||||||
THtmlStreamWriteFunc* = proc (stream: PHtmlStream, buffer: cstring,
|
|
||||||
size: guint, user_data: gpointer){.cdecl.}
|
|
||||||
THtmlStreamCancelFunc* = proc (stream: PHtmlStream, user_data: gpointer,
|
|
||||||
cancel_data: gpointer){.cdecl.}
|
|
||||||
THtmlStream* = object of TGObject
|
|
||||||
write_func*: THtmlStreamWriteFunc
|
|
||||||
close_func*: THtmlStreamCloseFunc
|
|
||||||
cancel_func*: THtmlStreamCancelFunc
|
|
||||||
user_data*: gpointer
|
|
||||||
cancel_data*: gpointer
|
|
||||||
written*: gint
|
|
||||||
mime_type*: cstring
|
|
||||||
|
|
||||||
PHtmlStreamClass* = ptr THtmlStreamClass
|
|
||||||
THtmlStreamClass* = object of TGObjectClass
|
|
||||||
THtmlStreamBufferCloseFunc* = proc (str: cstring, len: gint,
|
|
||||||
user_data: gpointer){.cdecl.}
|
|
||||||
PHtmlContext* = ptr THtmlContext
|
|
||||||
THtmlContext* = object of TGObject
|
|
||||||
documents*: PGSList
|
|
||||||
standard_font*: PHtmlFontSpecification
|
|
||||||
fixed_font*: PHtmlFontSpecification
|
|
||||||
debug_painting*: gboolean
|
|
||||||
|
|
||||||
PHtmlFontSpecification* = ptr THtmlFontSpecification
|
|
||||||
THtmlFontSpecification {.final, pure.} = object
|
|
||||||
|
|
||||||
PHtmlContextClass* = ptr THtmlContextClass
|
|
||||||
THtmlContextClass* = object of TGObjectClass
|
|
||||||
THtmlDocumentState* = enum
|
|
||||||
HTML_DOCUMENT_STATE_DONE, HTML_DOCUMENT_STATE_PARSING
|
|
||||||
PHtmlDocument* = ptr THtmlDocument
|
|
||||||
THtmlDocument* = object of TGObject
|
|
||||||
stylesheets*: PGSList
|
|
||||||
current_stream*: PHtmlStream
|
|
||||||
state*: THtmlDocumentState
|
|
||||||
|
|
||||||
PHtmlDocumentClass* = ptr THtmlDocumentClass
|
|
||||||
THtmlDocumentClass* = object of TGObjectClass
|
|
||||||
request_url*: proc (document: PHtmlDocument, url: cstring,
|
|
||||||
stream: PHtmlStream){.cdecl.}
|
|
||||||
link_clicked*: proc (document: PHtmlDocument, url: cstring){.cdecl.}
|
|
||||||
set_base*: proc (document: PHtmlDocument, url: cstring){.cdecl.}
|
|
||||||
title_changed*: proc (document: PHtmlDocument, new_title: cstring){.cdecl.}
|
|
||||||
submit*: proc (document: PHtmlDocument, `method`: cstring, url: cstring,
|
|
||||||
encoding: cstring){.cdecl.}
|
|
||||||
|
|
||||||
PHtmlView* = ptr THtmlView
|
|
||||||
THtmlView* = object of gtk2.TLayout
|
|
||||||
document*: PHtmlDocument
|
|
||||||
node_table*: PGHashTable
|
|
||||||
relayout_idle_id*: guint
|
|
||||||
relayout_timeout_id*: guint
|
|
||||||
mouse_down_x*: gint
|
|
||||||
mouse_down_y*: gint
|
|
||||||
mouse_detail*: gint
|
|
||||||
sel_start_ypos*: gint
|
|
||||||
sel_start_index*: gint
|
|
||||||
sel_end_ypos*: gint
|
|
||||||
sel_end_index*: gint
|
|
||||||
sel_flag*: gboolean
|
|
||||||
sel_backwards*: gboolean
|
|
||||||
sel_start_found*: gboolean
|
|
||||||
sel_list*: PGSList
|
|
||||||
jump_to_anchor*: cstring
|
|
||||||
magnification*: gdouble
|
|
||||||
magnification_modified*: gboolean
|
|
||||||
on_url*: gboolean
|
|
||||||
|
|
||||||
PHtmlViewClass* = ptr THtmlViewClass
|
|
||||||
THtmlViewClass* = object of gtk2.TLayoutClass
|
|
||||||
move_cursor*: proc (html_view: PHtmlView, step: TMovementStep, count: gint,
|
|
||||||
extend_selection: gboolean){.cdecl.}
|
|
||||||
on_url*: proc (html_view: PHtmlView, url: cstring)
|
|
||||||
activate*: proc (html_view: PHtmlView)
|
|
||||||
move_focus_out*: proc (html_view: PHtmlView, direction: TDirectionType)
|
|
||||||
|
|
||||||
PDomNodeList* = ptr TDomNodeList
|
|
||||||
TDomNodeList {.pure, final.} = object
|
|
||||||
|
|
||||||
PDomNamedNodeMap* = ptr TDomNamedNodeMap
|
|
||||||
TDomNamedNodeMap {.pure, final.} = object
|
|
||||||
|
|
||||||
PDomDocumentType* = ptr TDomDocumentType
|
|
||||||
TDomDocumentType {.pure, final.} = object
|
|
||||||
|
|
||||||
PDomElement* = ptr TDomElement
|
|
||||||
TDomElement = object of TDomNode
|
|
||||||
|
|
||||||
PDomText* = ptr TDomText
|
|
||||||
TDomText = object of TDomNode
|
|
||||||
|
|
||||||
PDomComment* = ptr TDomComment
|
|
||||||
TDomComment = object of TDomNode
|
|
||||||
|
|
||||||
THtmlBox {.pure, final.} = object
|
|
||||||
PHtmlBox* = ptr THtmlBox
|
|
||||||
|
|
||||||
|
|
||||||
proc DOM_TYPE_NODE*(): GType
|
|
||||||
proc DOM_NODE*(theobject: pointer): PDomNode
|
|
||||||
proc DOM_NODE_CLASS*(klass: pointer): PDomNodeClass
|
|
||||||
proc DOM_IS_NODE*(theobject: pointer): bool
|
|
||||||
proc DOM_IS_NODE_CLASS*(klass: pointer): bool
|
|
||||||
proc DOM_NODE_GET_CLASS*(obj: pointer): int32
|
|
||||||
proc dom_node_get_type*(): GType{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_node_get_type".}
|
|
||||||
proc dom_Node_mkref*(node: pointer): PDomNode{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_Node_mkref".}
|
|
||||||
proc get_childNodes*(node: PDomNode): PDomNodeList{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_childNodes".}
|
|
||||||
proc removeChild*(node: PDomNode, oldChild: PDomNode,
|
|
||||||
exc: PDomException): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node_removeChild".}
|
|
||||||
proc get_nodeValue*(node: PDomNode, exc: PDomException): PDomString{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "dom_Node__get_nodeValue".}
|
|
||||||
proc get_firstChild*(node: PDomNode): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_firstChild".}
|
|
||||||
proc get_nodeName*(node: PDomNode): PDomString{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_nodeName".}
|
|
||||||
proc get_attributes*(node: PDomNode): PDomNamedNodeMap{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_attributes".}
|
|
||||||
proc get_doctype*(doc: PDomDocument): PDomDocumentType{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Document__get_doctype".}
|
|
||||||
proc hasChildNodes*(node: PDomNode): bool{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node_hasChildNodes".}
|
|
||||||
proc get_parentNode*(node: PDomNode): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_parentNode".}
|
|
||||||
proc get_nextSibling*(node: PDomNode): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_nextSibling".}
|
|
||||||
proc get_nodeType*(node: PDomNode): gushort{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_Node__get_nodeType".}
|
|
||||||
|
|
||||||
proc cloneNode*(node: PDomNode, deep: bool): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node_cloneNode".}
|
|
||||||
proc appendChild*(node: PDomNode, newChild: PDomNode,
|
|
||||||
exc: PDomException): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node_appendChild".}
|
|
||||||
proc get_localName*(node: PDomNode): PDomString{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_localName".}
|
|
||||||
proc get_namespaceURI*(node: PDomNode): PDomString{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_namespaceURI".}
|
|
||||||
proc get_previousSibling*(node: PDomNode): PDomNode{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_previousSibling".}
|
|
||||||
proc get_lastChild*(node: PDomNode): PDomNode{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_Node__get_lastChild".}
|
|
||||||
proc set_nodeValue*(node: PDomNode, value: PDomString,
|
|
||||||
exc: PDomException){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_Node__set_nodeValue".}
|
|
||||||
proc get_ownerDocument*(node: PDomNode): PDomDocument{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "dom_Node__get_ownerDocument".}
|
|
||||||
proc hasAttributes*(node: PDomNode): gboolean{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "dom_Node_hasAttributes".}
|
|
||||||
proc DOM_TYPE_DOCUMENT*(): GType
|
|
||||||
proc DOM_DOCUMENT*(theobject: pointer): PDomDocument
|
|
||||||
proc DOM_DOCUMENT_CLASS*(klass: pointer): PDomDocumentClass
|
|
||||||
proc DOM_IS_DOCUMENT*(theobject: pointer): bool
|
|
||||||
proc DOM_IS_DOCUMENT_CLASS*(klass: pointer): bool
|
|
||||||
proc DOM_DOCUMENT_GET_CLASS*(obj: pointer): PDomDocumentClass
|
|
||||||
proc dom_document_get_type*(): GType
|
|
||||||
proc get_documentElement*(doc: PDomDocument): PDomElement
|
|
||||||
proc createElement*(doc: PDomDocument, tagName: PDomString): PDomElement
|
|
||||||
proc createTextNode*(doc: PDomDocument, data: PDomString): PDomText
|
|
||||||
proc createComment*(doc: PDomDocument, data: PDomString): PDomComment
|
|
||||||
proc importNode*(doc: PDomDocument, importedNode: PDomNode,
|
|
||||||
deep: bool, exc: PDomException): PDomNode
|
|
||||||
proc HTML_TYPE_FOCUS_ITERATOR*(): GType
|
|
||||||
proc HTML_FOCUS_ITERATOR*(theobject: pointer): PHtmlFocusIterator
|
|
||||||
proc HTML_FOCUS_ITERATOR_CLASS*(klass: pointer): PHtmlFocusIteratorClass
|
|
||||||
proc HTML_IS_FOCUS_ITERATOR*(theobject: pointer): bool
|
|
||||||
proc HTML_IS_FOCUS_ITERATOR_CLASS*(klass: pointer): bool
|
|
||||||
proc HTML_FOCUS_ITERATOR_GET_CLASS*(obj: pointer): PHtmlFocusIteratorClass
|
|
||||||
proc html_focus_iterator_next_element*(document: PDomDocument,
|
|
||||||
element: PDomElement): PDomElement{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_focus_iterator_next_element".}
|
|
||||||
proc html_focus_iterator_prev_element*(document: PDomDocument,
|
|
||||||
element: PDomElement): PDomElement{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_focus_iterator_prev_element".}
|
|
||||||
proc HTML_PARSER_TYPE*(): GType
|
|
||||||
proc HTML_PARSER*(obj: pointer): PHtmlParser
|
|
||||||
proc HTML_PARSER_CLASS*(klass: pointer): PHtmlParserClass
|
|
||||||
proc HTML_IS_PARSER*(obj: pointer): bool
|
|
||||||
proc html_parser_get_type*(): GType
|
|
||||||
proc parser_new*(document: PHtmlDocument, parser_type: THtmlParserType): PHtmlParser
|
|
||||||
proc HTML_TYPE_STREAM*(): GType
|
|
||||||
proc HTML_STREAM*(obj: pointer): PHtmlStream
|
|
||||||
proc HTML_STREAM_CLASS*(klass: pointer): PHtmlStreamClass
|
|
||||||
proc HTML_IS_STREAM*(obj: pointer): bool
|
|
||||||
proc HTML_IS_STREAM_CLASS*(klass: pointer): bool
|
|
||||||
proc HTML_STREAM_GET_CLASS*(obj: pointer): PHtmlStreamClass
|
|
||||||
proc html_stream_get_type*(): GType{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_stream_get_type".}
|
|
||||||
proc html_stream_new*(write_func: THtmlStreamWriteFunc,
|
|
||||||
close_func: THtmlStreamCloseFunc, user_data: gpointer): PHtmlStream{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_stream_new".}
|
|
||||||
proc write*(stream: PHtmlStream, buffer: cstring, size: guint){.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_stream_write".}
|
|
||||||
proc close*(stream: PHtmlStream){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_stream_close".}
|
|
||||||
proc destroy*(stream: PHtmlStream){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_stream_destroy".}
|
|
||||||
proc get_written*(stream: PHtmlStream): gint{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_stream_get_written".}
|
|
||||||
proc cancel*(stream: PHtmlStream){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_stream_cancel".}
|
|
||||||
proc set_cancel_func*(stream: PHtmlStream,
|
|
||||||
abort_func: THtmlStreamCancelFunc,
|
|
||||||
cancel_data: gpointer){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_stream_set_cancel_func".}
|
|
||||||
proc get_mime_type*(stream: PHtmlStream): cstring{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_stream_get_mime_type".}
|
|
||||||
proc set_mime_type*(stream: PHtmlStream, mime_type: cstring){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_stream_set_mime_type".}
|
|
||||||
proc html_stream_buffer_new*(close_func: THtmlStreamBufferCloseFunc,
|
|
||||||
user_data: gpointer): PHtmlStream{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_stream_buffer_new".}
|
|
||||||
proc event_mouse_move*(view: PHtmlView, event: Gdk2.PEventMotion){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_event_mouse_move".}
|
|
||||||
proc event_button_press*(view: PHtmlView, button: Gdk2.PEventButton){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_event_button_press".}
|
|
||||||
proc event_button_release*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_event_button_release".}
|
|
||||||
proc event_activate*(view: PHtmlView){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_event_activate".}
|
|
||||||
proc event_key_press*(view: PHtmlView, event: Gdk2.PEventKey): gboolean{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_event_key_press".}
|
|
||||||
proc event_find_root_box*(self: PHtmlBox, x: gint, y: gint): PHtmlBox{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_event_find_root_box".}
|
|
||||||
proc selection_start*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_selection_start".}
|
|
||||||
proc selection_end*(view: PHtmlView, event: Gdk2.PEventButton){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_selection_end".}
|
|
||||||
proc selection_update*(view: PHtmlView, event: Gdk2.PEventMotion){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_selection_update".}
|
|
||||||
proc selection_clear*(view: PHtmlView){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_selection_clear".}
|
|
||||||
proc selection_set*(view: PHtmlView, start: PDomNode, offset: int32,
|
|
||||||
len: int32){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_selection_set".}
|
|
||||||
proc HTML_CONTEXT_TYPE*(): GType
|
|
||||||
proc HTML_CONTEXT*(obj: pointer): PHtmlContext
|
|
||||||
proc HTML_CONTEXT_CLASS*(klass: pointer): PHtmlContextClass
|
|
||||||
proc HTML_IS_CONTEXT*(obj: pointer): bool
|
|
||||||
proc HTML_IS_CONTEXT_CLASS*(klass: pointer): bool
|
|
||||||
proc html_context_get_type*(): GType
|
|
||||||
proc html_context_get*(): PHtmlContext
|
|
||||||
proc HTML_TYPE_DOCUMENT*(): GType
|
|
||||||
proc HTML_DOCUMENT*(obj: pointer): PHtmlDocument
|
|
||||||
proc HTML_DOCUMENT_CLASS*(klass: pointer): PHtmlDocumentClass
|
|
||||||
proc HTML_IS_DOCUMENT*(obj: pointer): bool
|
|
||||||
proc html_document_get_type*(): GType{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_document_get_type".}
|
|
||||||
proc html_document_new*(): PHtmlDocument{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_document_new".}
|
|
||||||
proc open_stream*(document: PHtmlDocument, mime_type: cstring): gboolean{.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_document_open_stream".}
|
|
||||||
proc write_stream*(document: PHtmlDocument, buffer: cstring,
|
|
||||||
len: gint){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_document_write_stream".}
|
|
||||||
proc close_stream*(document: PHtmlDocument){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_document_close_stream".}
|
|
||||||
proc clear*(document: PHtmlDocument){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_document_clear".}
|
|
||||||
proc HTML_TYPE_VIEW*(): GType
|
|
||||||
proc HTML_VIEW*(obj: pointer): PHtmlView
|
|
||||||
proc HTML_VIEW_CLASS*(klass: pointer): PHtmlViewClass
|
|
||||||
proc HTML_IS_VIEW*(obj: pointer): bool
|
|
||||||
proc html_view_get_type*(): GType{.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_view_get_type".}
|
|
||||||
proc html_view_new*(): PWidget{.cdecl, dynlib: htmllib, importc: "html_view_new".}
|
|
||||||
proc set_document*(view: PHtmlView, document: PHtmlDocument){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_view_set_document".}
|
|
||||||
proc jump_to_anchor*(view: PHtmlView, anchor: cstring){.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_view_jump_to_anchor".}
|
|
||||||
proc get_magnification*(view: PHtmlView): gdouble{.cdecl,
|
|
||||||
dynlib: htmllib, importc: "html_view_get_magnification".}
|
|
||||||
proc set_magnification*(view: PHtmlView, magnification: gdouble){.
|
|
||||||
cdecl, dynlib: htmllib, importc: "html_view_set_magnification".}
|
|
||||||
proc zoom_in*(view: PHtmlView){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_view_zoom_in".}
|
|
||||||
proc zoom_out*(view: PHtmlView){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_view_zoom_out".}
|
|
||||||
proc zoom_reset*(view: PHtmlView){.cdecl, dynlib: htmllib,
|
|
||||||
importc: "html_view_zoom_reset".}
|
|
||||||
|
|
||||||
proc DOM_TYPE_NODE*(): GType =
|
|
||||||
result = dom_node_get_type()
|
|
||||||
|
|
||||||
proc DOM_NODE*(theobject: pointer): PDomNode =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_CAST(theobject, DOM_TYPE_NODE())
|
|
||||||
|
|
||||||
proc DOM_NODE_CLASS*(klass: pointer): PDomNodeClass =
|
|
||||||
result = G_TYPE_CHECK_CLASS_CAST(klass, DOM_TYPE_NODE(), TDomNodeClass)
|
|
||||||
|
|
||||||
proc DOM_IS_NODE*(theobject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, DOM_TYPE_NODE())
|
|
||||||
|
|
||||||
proc DOM_IS_NODE_CLASS*(klass: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, DOM_TYPE_NODE())
|
|
||||||
|
|
||||||
proc DOM_NODE_GET_CLASS*(obj: pointer): PDomNodeClass =
|
|
||||||
result = G_TYPE_INSTANCE_GET_CLASS(obj, DOM_TYPE_NODE(), TDomNodeClass)
|
|
||||||
|
|
||||||
proc DOM_TYPE_DOCUMENT*(): GType =
|
|
||||||
result = dom_document_get_type()
|
|
||||||
|
|
||||||
proc DOM_DOCUMENT*(theobject: pointer): PDomDocument =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_CAST(theobject, DOM_TYPE_DOCUMENT(),
|
|
||||||
TDomDocument)
|
|
||||||
|
|
||||||
proc DOM_DOCUMENT_CLASS*(klass: pointer): PDomDocumentClass =
|
|
||||||
result = G_TYPE_CHECK_CLASS_CAST(klass, DOM_TYPE_DOCUMENT(), TDomDocumentClass)
|
|
||||||
|
|
||||||
proc DOM_IS_DOCUMENT*(theobject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, DOM_TYPE_DOCUMENT())
|
|
||||||
|
|
||||||
proc DOM_IS_DOCUMENT_CLASS*(klass: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, DOM_TYPE_DOCUMENT())
|
|
||||||
|
|
||||||
proc DOM_DOCUMENT_GET_CLASS*(obj: pointer): PDomDocumentClass =
|
|
||||||
result = G_TYPE_INSTANCE_GET_CLASS(obj, DOM_TYPE_DOCUMENT(), TDomDocumentClass)
|
|
||||||
|
|
||||||
proc HTML_TYPE_FOCUS_ITERATOR*(): GType =
|
|
||||||
result = html_focus_iterator_get_type()
|
|
||||||
|
|
||||||
proc HTML_FOCUS_ITERATOR*(theobject: pointer): PHtmlFocusIterator =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_CAST(theobject, HTML_TYPE_FOCUS_ITERATOR(),
|
|
||||||
HtmlFocusIterator)
|
|
||||||
|
|
||||||
proc HTML_FOCUS_ITERATOR_CLASS*(klass: pointer): PHtmlFocusIteratorClass =
|
|
||||||
result = G_TYPE_CHECK_CLASS_CAST(klass, HTML_TYPE_FOCUS_ITERATOR(),
|
|
||||||
HtmlFocusIteratorClass)
|
|
||||||
|
|
||||||
proc HTML_IS_FOCUS_ITERATOR*(theobject: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(theobject, HTML_TYPE_FOCUS_ITERATOR())
|
|
||||||
|
|
||||||
proc HTML_IS_FOCUS_ITERATOR_CLASS*(klass: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, HTML_TYPE_FOCUS_ITERATOR())
|
|
||||||
|
|
||||||
proc HTML_FOCUS_ITERATOR_GET_CLASS*(obj: pointer): PHtmlFocusIteratorClass =
|
|
||||||
result = G_TYPE_INSTANCE_GET_CLASS(obj, HTML_TYPE_FOCUS_ITERATOR(),
|
|
||||||
HtmlFocusIteratorClass)
|
|
||||||
|
|
||||||
proc HTML_PARSER_TYPE*(): GType =
|
|
||||||
result = html_parser_get_type()
|
|
||||||
|
|
||||||
proc HTML_PARSER*(obj: pointer): PHtmlParser =
|
|
||||||
result = CHECK_CAST(obj, HTML_PARSER_TYPE(), THtmlParser)
|
|
||||||
|
|
||||||
proc HTML_PARSER_CLASS*(klass: pointer): PHtmlParserClass =
|
|
||||||
result = CHECK_CLASS_CAST(klass, HTML_PARSER_TYPE(), THtmlParserClass)
|
|
||||||
|
|
||||||
proc HTML_IS_PARSER*(obj: pointer): bool =
|
|
||||||
result = CHECK_TYPE(obj, HTML_PARSER_TYPE())
|
|
||||||
|
|
||||||
proc HTML_TYPE_STREAM*(): GType =
|
|
||||||
result = html_stream_get_type()
|
|
||||||
|
|
||||||
proc HTML_STREAM*(obj: pointer): PHtmlStream =
|
|
||||||
result = PHtmlStream(G_TYPE_CHECK_INSTANCE_CAST(obj, HTML_TYPE_STREAM()))
|
|
||||||
|
|
||||||
proc HTML_STREAM_CLASS*(klass: pointer): PHtmlStreamClass =
|
|
||||||
result = G_TYPE_CHECK_CLASS_CAST(klass, HTML_TYPE_STREAM())
|
|
||||||
|
|
||||||
proc HTML_IS_STREAM*(obj: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(obj, HTML_TYPE_STREAM())
|
|
||||||
|
|
||||||
proc HTML_IS_STREAM_CLASS*(klass: pointer): bool =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, HTML_TYPE_STREAM())
|
|
||||||
|
|
||||||
proc HTML_STREAM_GET_CLASS*(obj: pointer): PHtmlStreamClass =
|
|
||||||
result = PHtmlStreamClass(G_TYPE_INSTANCE_GET_CLASS(obj, HTML_TYPE_STREAM()))
|
|
||||||
|
|
||||||
proc HTML_CONTEXT_TYPE*(): GType =
|
|
||||||
result = html_context_get_type()
|
|
||||||
|
|
||||||
proc HTML_CONTEXT*(obj: pointer): PHtmlContext =
|
|
||||||
result = CHECK_CAST(obj, HTML_CONTEXT_TYPE(), THtmlContext)
|
|
||||||
|
|
||||||
proc HTML_CONTEXT_CLASS*(klass: pointer): PHtmlContextClass =
|
|
||||||
result = CHECK_CLASS_CAST(klass, HTML_CONTEXT_TYPE(), THtmlContextClass)
|
|
||||||
|
|
||||||
proc HTML_IS_CONTEXT*(obj: pointer): bool =
|
|
||||||
result = CHECK_TYPE(obj, HTML_CONTEXT_TYPE())
|
|
||||||
|
|
||||||
proc HTML_IS_CONTEXT_CLASS*(klass: pointer): bool =
|
|
||||||
result = CHECK_CLASS_TYPE(klass, HTML_CONTEXT_TYPE())
|
|
||||||
|
|
||||||
proc HTML_TYPE_DOCUMENT*(): GType =
|
|
||||||
result = html_document_get_type()
|
|
||||||
|
|
||||||
proc HTML_DOCUMENT*(obj: pointer): PHtmlDocument =
|
|
||||||
result = PHtmlDocument(CHECK_CAST(obj, HTML_TYPE_DOCUMENT()))
|
|
||||||
|
|
||||||
proc HTML_DOCUMENT_CLASS*(klass: pointer): PHtmlDocumentClass =
|
|
||||||
result = CHECK_CLASS_CAST(klass, HTML_TYPE_DOCUMENT())
|
|
||||||
|
|
||||||
proc HTML_IS_DOCUMENT*(obj: pointer): bool =
|
|
||||||
result = CHECK_TYPE(obj, HTML_TYPE_DOCUMENT())
|
|
||||||
|
|
||||||
proc HTML_TYPE_VIEW*(): GType =
|
|
||||||
result = html_view_get_type()
|
|
||||||
|
|
||||||
proc HTML_VIEW*(obj: pointer): PHtmlView =
|
|
||||||
result = PHtmlView(CHECK_CAST(obj, HTML_TYPE_VIEW()))
|
|
||||||
|
|
||||||
proc HTML_VIEW_CLASS*(klass: pointer): PHtmlViewClass =
|
|
||||||
result = PHtmlViewClass(CHECK_CLASS_CAST(klass, HTML_TYPE_VIEW()))
|
|
||||||
|
|
||||||
proc HTML_IS_VIEW*(obj: pointer): bool =
|
|
||||||
result = CHECK_TYPE(obj, HTML_TYPE_VIEW())
|
|
||||||
|
|
@ -1,111 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
glib2, gtk2
|
|
||||||
|
|
||||||
when defined(win32):
|
|
||||||
const
|
|
||||||
LibGladeLib = "libglade-2.0-0.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
LibGladeLib = "libglade-2.0.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
LibGladeLib = "libglade-2.0.so"
|
|
||||||
type
|
|
||||||
PLongint* = ptr int32
|
|
||||||
PSmallInt* = ptr int16
|
|
||||||
PByte* = ptr int8
|
|
||||||
PWord* = ptr int16
|
|
||||||
PDWord* = ptr int32
|
|
||||||
PDouble* = ptr float64
|
|
||||||
|
|
||||||
proc init*(){.cdecl, dynlib: LibGladeLib, importc: "glade_init".}
|
|
||||||
proc require*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_require".}
|
|
||||||
proc provide*(TheLibrary: cstring){.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_provide".}
|
|
||||||
type
|
|
||||||
PXMLPrivate* = pointer
|
|
||||||
PXML* = ptr TXML
|
|
||||||
TXML* = object of TGObject
|
|
||||||
filename*: cstring
|
|
||||||
priv*: PXMLPrivate
|
|
||||||
|
|
||||||
PXMLClass* = ptr TXMLClass
|
|
||||||
TXMLClass* = object of TGObjectClass
|
|
||||||
TXMLConnectFunc* = proc (handler_name: cstring, anObject: PGObject,
|
|
||||||
signal_name: cstring, signal_data: cstring,
|
|
||||||
connect_object: PGObject, after: gboolean,
|
|
||||||
user_data: gpointer){.cdecl.}
|
|
||||||
|
|
||||||
proc TYPE_XML*(): GType
|
|
||||||
proc XML*(obj: pointer): PXML
|
|
||||||
proc XML_CLASS*(klass: pointer): PXMLClass
|
|
||||||
proc IS_XML*(obj: pointer): gboolean
|
|
||||||
proc IS_XML_CLASS*(klass: pointer): gboolean
|
|
||||||
proc XML_GET_CLASS*(obj: pointer): PXMLClass
|
|
||||||
proc xml_get_type*(): GType{.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_xml_get_type".}
|
|
||||||
proc xml_new*(fname: cstring, root: cstring, domain: cstring): PXML{.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_new".}
|
|
||||||
proc xml_new_from_buffer*(buffer: cstring, size: int32, root: cstring,
|
|
||||||
domain: cstring): PXML{.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_xml_new_from_buffer".}
|
|
||||||
proc construct*(self: PXML, fname: cstring, root: cstring, domain: cstring): gboolean{.
|
|
||||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_construct".}
|
|
||||||
proc signal_connect*(self: PXML, handlername: cstring, func: TGCallback){.
|
|
||||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect".}
|
|
||||||
proc signal_connect_data*(self: PXML, handlername: cstring,
|
|
||||||
func: TGCallback, user_data: gpointer){.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_signal_connect_data".}
|
|
||||||
proc signal_autoconnect*(self: PXML){.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_xml_signal_autoconnect".}
|
|
||||||
proc signal_connect_full*(self: PXML, handler_name: cstring,
|
|
||||||
func: TXMLConnectFunc, user_data: gpointer){.
|
|
||||||
cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect_full".}
|
|
||||||
proc signal_autoconnect_full*(self: PXML, func: TXMLConnectFunc,
|
|
||||||
user_data: gpointer){.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_signal_autoconnect_full".}
|
|
||||||
proc get_widget*(self: PXML, name: cstring): gtk2.PWidget{.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_get_widget".}
|
|
||||||
proc get_widget_prefix*(self: PXML, name: cstring): PGList{.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_get_widget_prefix".}
|
|
||||||
proc relative_file*(self: PXML, filename: cstring): cstring{.cdecl,
|
|
||||||
dynlib: LibGladeLib, importc: "glade_xml_relative_file".}
|
|
||||||
proc get_widget_name*(widget: gtk2.PWidget): cstring{.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_get_widget_name".}
|
|
||||||
proc get_widget_tree*(widget: gtk2.PWidget): PXML{.cdecl, dynlib: LibGladeLib,
|
|
||||||
importc: "glade_get_widget_tree".}
|
|
||||||
type
|
|
||||||
PXMLCustomWidgetHandler* = ptr TXMLCustomWidgetHandler
|
|
||||||
TXMLCustomWidgetHandler* = gtk2.TWidget
|
|
||||||
|
|
||||||
proc set_custom_handler*(handler: TXMLCustomWidgetHandler, user_data: gpointer){.
|
|
||||||
cdecl, dynlib: LibGladeLib, importc: "glade_set_custom_handler".}
|
|
||||||
proc gnome_init*() =
|
|
||||||
init()
|
|
||||||
|
|
||||||
proc bonobo_init*() =
|
|
||||||
init()
|
|
||||||
|
|
||||||
proc xml_new_from_memory*(buffer: cstring, size: int32, root: cstring,
|
|
||||||
domain: cstring): PXML =
|
|
||||||
result = xml_new_from_buffer(buffer, size, root, domain)
|
|
||||||
|
|
||||||
proc TYPE_XML*(): GType =
|
|
||||||
result = xml_get_type()
|
|
||||||
|
|
||||||
proc XML*(obj: pointer): PXML =
|
|
||||||
result = cast[PXML](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_XML()))
|
|
||||||
|
|
||||||
proc XML_CLASS*(klass: pointer): PXMLClass =
|
|
||||||
result = cast[PXMLClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_XML()))
|
|
||||||
|
|
||||||
proc IS_XML*(obj: pointer): gboolean =
|
|
||||||
result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_XML())
|
|
||||||
|
|
||||||
proc IS_XML_CLASS*(klass: pointer): gboolean =
|
|
||||||
result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_XML())
|
|
||||||
|
|
||||||
proc XML_GET_CLASS*(obj: pointer): PXMLClass =
|
|
||||||
result = cast[PXMLClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_XML()))
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,42 +0,0 @@
|
||||||
{.deadCodeElim: on.}
|
|
||||||
import
|
|
||||||
glib2, pango
|
|
||||||
|
|
||||||
proc split_file_list*(str: cstring): PPchar{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_split_file_list".}
|
|
||||||
proc trim_string*(str: cstring): cstring{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_trim_string".}
|
|
||||||
proc read_line*(stream: TFile, str: PGString): gint{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_read_line".}
|
|
||||||
proc skip_space*(pos: PPchar): gboolean{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_skip_space".}
|
|
||||||
proc scan_word*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_scan_word".}
|
|
||||||
proc scan_string*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_scan_string".}
|
|
||||||
proc scan_int*(pos: PPchar, OutInt: ptr int32): gboolean{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_scan_int".}
|
|
||||||
proc config_key_get*(key: cstring): cstring{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_config_key_get".}
|
|
||||||
proc lookup_aliases*(fontname: cstring, families: PPPchar, n_families: ptr int32){.
|
|
||||||
cdecl, dynlib: lib, importc: "pango_lookup_aliases".}
|
|
||||||
proc parse_style*(str: cstring, style: PStyle, warn: gboolean): gboolean{.cdecl,
|
|
||||||
dynlib: lib, importc: "pango_parse_style".}
|
|
||||||
proc parse_variant*(str: cstring, variant: PVariant, warn: gboolean): gboolean{.
|
|
||||||
cdecl, dynlib: lib, importc: "pango_parse_variant".}
|
|
||||||
proc parse_weight*(str: cstring, weight: PWeight, warn: gboolean): gboolean{.
|
|
||||||
cdecl, dynlib: lib, importc: "pango_parse_weight".}
|
|
||||||
proc parse_stretch*(str: cstring, stretch: PStretch, warn: gboolean): gboolean{.
|
|
||||||
cdecl, dynlib: lib, importc: "pango_parse_stretch".}
|
|
||||||
proc get_sysconf_subdirectory*(): cstring{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_get_sysconf_subdirectory".}
|
|
||||||
proc get_lib_subdirectory*(): cstring{.cdecl, dynlib: lib,
|
|
||||||
importc: "pango_get_lib_subdirectory".}
|
|
||||||
proc log2vis_get_embedding_levels*(str: Pgunichar, len: int32,
|
|
||||||
pbase_dir: PDirection,
|
|
||||||
embedding_level_list: Pguint8): gboolean{.
|
|
||||||
cdecl, dynlib: lib, importc: "pango_log2vis_get_embedding_levels".}
|
|
||||||
proc get_mirror_char*(ch: gunichar, mirrored_ch: Pgunichar): gboolean{.cdecl,
|
|
||||||
dynlib: lib, importc: "pango_get_mirror_char".}
|
|
||||||
proc get_sample_string*(language: PLanguage): cstring{.cdecl,
|
|
||||||
dynlib: lib, importc: "pango_language_get_sample_string".}
|
|
||||||
|
|
@ -1,208 +0,0 @@
|
||||||
#*****************************************************************************
|
|
||||||
# * *
|
|
||||||
# * File: lauxlib.pas *
|
|
||||||
# * Authors: TeCGraf (C headers + actual Lua libraries) *
|
|
||||||
# * Lavergne Thomas (original translation to Pascal) *
|
|
||||||
# * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) *
|
|
||||||
# * Description: Lua auxiliary library *
|
|
||||||
# * *
|
|
||||||
# *****************************************************************************
|
|
||||||
#
|
|
||||||
#** $Id: lauxlib.h,v 1.59 2003/03/18 12:25:32 roberto Exp $
|
|
||||||
#** Auxiliary functions for building Lua libraries
|
|
||||||
#** See Copyright Notice in lua.h
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#** Translated to pascal by Lavergne Thomas
|
|
||||||
#** Notes :
|
|
||||||
#** - Pointers type was prefixed with 'P'
|
|
||||||
#** Bug reports :
|
|
||||||
#** - thomas.lavergne@laposte.net
|
|
||||||
#** In french or in english
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
lua
|
|
||||||
|
|
||||||
proc pushstring*(L: PState, s: string)
|
|
||||||
# compatibilty macros
|
|
||||||
proc getn*(L: PState, n: cint): cint
|
|
||||||
# calls lua_objlen
|
|
||||||
proc setn*(L: PState, t, n: cint)
|
|
||||||
# does nothing!
|
|
||||||
type
|
|
||||||
Treg*{.final.} = object
|
|
||||||
name*: cstring
|
|
||||||
func*: CFunction
|
|
||||||
|
|
||||||
Preg* = ptr Treg
|
|
||||||
|
|
||||||
|
|
||||||
{.push callConv: cdecl, dynlib: lua.LIB_NAME.}
|
|
||||||
{.push importc: "luaL_$1".}
|
|
||||||
|
|
||||||
proc openlib*(L: PState, libname: cstring, lr: Preg, nup: cint)
|
|
||||||
proc register*(L: PState, libname: cstring, lr: Preg)
|
|
||||||
|
|
||||||
proc getmetafield*(L: PState, obj: cint, e: cstring): cint
|
|
||||||
proc callmeta*(L: PState, obj: cint, e: cstring): cint
|
|
||||||
proc typerror*(L: PState, narg: cint, tname: cstring): cint
|
|
||||||
proc argerror*(L: PState, numarg: cint, extramsg: cstring): cint
|
|
||||||
proc checklstring*(L: PState, numArg: cint, len: ptr int): cstring
|
|
||||||
proc optlstring*(L: PState, numArg: cint, def: cstring, len: ptr cint): cstring
|
|
||||||
proc checknumber*(L: PState, numArg: cint): Number
|
|
||||||
proc optnumber*(L: PState, nArg: cint, def: Number): Number
|
|
||||||
proc checkinteger*(L: PState, numArg: cint): Integer
|
|
||||||
proc optinteger*(L: PState, nArg: cint, def: Integer): Integer
|
|
||||||
proc checkstack*(L: PState, sz: cint, msg: cstring)
|
|
||||||
proc checktype*(L: PState, narg, t: cint)
|
|
||||||
|
|
||||||
proc checkany*(L: PState, narg: cint)
|
|
||||||
proc newmetatable*(L: PState, tname: cstring): cint
|
|
||||||
|
|
||||||
proc checkudata*(L: PState, ud: cint, tname: cstring): Pointer
|
|
||||||
proc where*(L: PState, lvl: cint)
|
|
||||||
proc error*(L: PState, fmt: cstring): cint{.varargs.}
|
|
||||||
proc checkoption*(L: PState, narg: cint, def: cstring, lst: cstringArray): cint
|
|
||||||
|
|
||||||
proc unref*(L: PState, t, theref: cint)
|
|
||||||
proc loadfile*(L: PState, filename: cstring): cint
|
|
||||||
proc loadbuffer*(L: PState, buff: cstring, size: cint, name: cstring): cint
|
|
||||||
proc loadstring*(L: PState, s: cstring): cint
|
|
||||||
proc newstate*(): PState
|
|
||||||
|
|
||||||
{.pop.}
|
|
||||||
proc reference*(L: PState, t: cint): cint{.importc: "luaL_ref".}
|
|
||||||
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
proc open*(): PState
|
|
||||||
# compatibility; moved from unit lua to lauxlib because it needs luaL_newstate
|
|
||||||
#
|
|
||||||
#** ===============================================================
|
|
||||||
#** some useful macros
|
|
||||||
#** ===============================================================
|
|
||||||
#
|
|
||||||
proc argcheck*(L: PState, cond: bool, numarg: cint, extramsg: cstring)
|
|
||||||
proc checkstring*(L: PState, n: cint): cstring
|
|
||||||
proc optstring*(L: PState, n: cint, d: cstring): cstring
|
|
||||||
proc checkint*(L: PState, n: cint): cint
|
|
||||||
proc checklong*(L: PState, n: cint): clong
|
|
||||||
proc optint*(L: PState, n: cint, d: float64): cint
|
|
||||||
proc optlong*(L: PState, n: cint, d: float64): clong
|
|
||||||
proc dofile*(L: PState, filename: cstring): cint
|
|
||||||
proc dostring*(L: PState, str: cstring): cint
|
|
||||||
proc getmetatable*(L: PState, tname: cstring)
|
|
||||||
# not translated:
|
|
||||||
# #define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
|
|
||||||
#
|
|
||||||
#** =======================================================
|
|
||||||
#** Generic Buffer manipulation
|
|
||||||
#** =======================================================
|
|
||||||
#
|
|
||||||
const # note: this is just arbitrary, as it related to the BUFSIZ defined in stdio.h ...
|
|
||||||
BUFFERSIZE* = 4096
|
|
||||||
|
|
||||||
type
|
|
||||||
Buffer*{.final.} = object
|
|
||||||
p*: cstring # current position in buffer
|
|
||||||
lvl*: cint # number of strings in the stack (level)
|
|
||||||
L*: PState
|
|
||||||
buffer*: array[0..BUFFERSIZE - 1, Char] # warning: see note above about LUAL_BUFFERSIZE
|
|
||||||
|
|
||||||
PBuffer* = ptr Buffer
|
|
||||||
|
|
||||||
proc addchar*(B: PBuffer, c: Char)
|
|
||||||
# warning: see note above about LUAL_BUFFERSIZE
|
|
||||||
# compatibility only (alias for luaL_addchar)
|
|
||||||
proc putchar*(B: PBuffer, c: Char)
|
|
||||||
# warning: see note above about LUAL_BUFFERSIZE
|
|
||||||
proc addsize*(B: PBuffer, n: cint)
|
|
||||||
|
|
||||||
{.push callConv: cdecl, dynlib: lua.LIB_NAME, importc: "luaL_$1".}
|
|
||||||
proc buffinit*(L: PState, B: PBuffer)
|
|
||||||
proc prepbuffer*(B: PBuffer): cstring
|
|
||||||
proc addlstring*(B: PBuffer, s: cstring, L: cint)
|
|
||||||
proc addstring*(B: PBuffer, s: cstring)
|
|
||||||
proc addvalue*(B: PBuffer)
|
|
||||||
proc pushresult*(B: PBuffer)
|
|
||||||
proc gsub*(L: PState, s, p, r: cstring): cstring
|
|
||||||
proc findtable*(L: PState, idx: cint, fname: cstring, szhint: cint): cstring
|
|
||||||
# compatibility with ref system
|
|
||||||
# pre-defined references
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
const
|
|
||||||
NOREF* = - 2
|
|
||||||
REFNIL* = - 1
|
|
||||||
|
|
||||||
proc unref*(L: PState, theref: cint)
|
|
||||||
proc getref*(L: PState, theref: cint)
|
|
||||||
#
|
|
||||||
#** Compatibility macros and functions
|
|
||||||
#
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc pushstring(L: PState, s: string) =
|
|
||||||
pushlstring(L, cstring(s), s.len.cint)
|
|
||||||
|
|
||||||
proc getn(L: PState, n: cint): cint =
|
|
||||||
Result = objlen(L, n)
|
|
||||||
|
|
||||||
proc setn(L: PState, t, n: cint) =
|
|
||||||
# does nothing as this operation is deprecated
|
|
||||||
nil
|
|
||||||
|
|
||||||
proc open(): PState =
|
|
||||||
Result = newstate()
|
|
||||||
|
|
||||||
proc dofile(L: PState, filename: cstring): cint =
|
|
||||||
Result = loadfile(L, filename)
|
|
||||||
if Result == 0: Result = pcall(L, 0, MULTRET, 0)
|
|
||||||
|
|
||||||
proc dostring(L: PState, str: cstring): cint =
|
|
||||||
Result = loadstring(L, str)
|
|
||||||
if Result == 0: Result = pcall(L, 0, MULTRET, 0)
|
|
||||||
|
|
||||||
proc getmetatable(L: PState, tname: cstring) =
|
|
||||||
getfield(L, REGISTRYINDEX, tname)
|
|
||||||
|
|
||||||
proc argcheck(L: PState, cond: bool, numarg: cint, extramsg: cstring) =
|
|
||||||
if not cond:
|
|
||||||
discard argerror(L, numarg, extramsg)
|
|
||||||
|
|
||||||
proc checkstring(L: PState, n: cint): cstring =
|
|
||||||
Result = checklstring(L, n, nil)
|
|
||||||
|
|
||||||
proc optstring(L: PState, n: cint, d: cstring): cstring =
|
|
||||||
Result = optlstring(L, n, d, nil)
|
|
||||||
|
|
||||||
proc checkint(L: PState, n: cint): cint =
|
|
||||||
Result = cint(checknumber(L, n))
|
|
||||||
|
|
||||||
proc checklong(L: PState, n: cint): clong =
|
|
||||||
Result = int32(ToInt(checknumber(L, n)))
|
|
||||||
|
|
||||||
proc optint(L: PState, n: cint, d: float64): cint =
|
|
||||||
Result = optnumber(L, n, d).cint
|
|
||||||
|
|
||||||
proc optlong(L: PState, n: cint, d: float64): clong =
|
|
||||||
Result = int32(ToInt(optnumber(L, n, d)))
|
|
||||||
|
|
||||||
proc addchar(B: PBuffer, c: Char) =
|
|
||||||
if cast[int](addr((B.p))) < (cast[int](addr((B.buffer[0]))) + BUFFERSIZE):
|
|
||||||
discard prepbuffer(B)
|
|
||||||
B.p[1] = c
|
|
||||||
B.p = cast[cstring](cast[int](B.p) + 1)
|
|
||||||
|
|
||||||
proc putchar(B: PBuffer, c: Char) =
|
|
||||||
addchar(B, c)
|
|
||||||
|
|
||||||
proc addsize(B: PBuffer, n: cint) =
|
|
||||||
B.p = cast[cstring](cast[int](B.p) + n)
|
|
||||||
|
|
||||||
proc unref(L: PState, theref: cint) =
|
|
||||||
unref(L, REGISTRYINDEX, theref)
|
|
||||||
|
|
||||||
proc getref(L: PState, theref: cint) =
|
|
||||||
rawgeti(L, REGISTRYINDEX, theref)
|
|
||||||
|
|
@ -1,364 +0,0 @@
|
||||||
#*****************************************************************************
|
|
||||||
# * *
|
|
||||||
# * File: lua.pas *
|
|
||||||
# * Authors: TeCGraf (C headers + actual Lua libraries) *
|
|
||||||
# * Lavergne Thomas (original translation to Pascal) *
|
|
||||||
# * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) *
|
|
||||||
# * Description: Basic Lua library *
|
|
||||||
# * *
|
|
||||||
# *****************************************************************************
|
|
||||||
#
|
|
||||||
#** $Id: lua.h,v 1.175 2003/03/18 12:31:39 roberto Exp $
|
|
||||||
#** Lua - An Extensible Extension Language
|
|
||||||
#** TeCGraf: Computer Graphics Technology Group, PUC-Rio, Brazil
|
|
||||||
#** http://www.lua.org mailto:info@lua.org
|
|
||||||
#** See Copyright Notice at the end of this file
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#** Updated to Lua 5.1.1 by Bram Kuijvenhoven (bram at kuijvenhoven dot net),
|
|
||||||
#** Hexis BV (http://www.hexis.nl), the Netherlands
|
|
||||||
#** Notes:
|
|
||||||
#** - Only tested with FPC (FreePascal Compiler)
|
|
||||||
#** - Using LuaBinaries styled DLL/SO names, which include version names
|
|
||||||
#** - LUA_YIELD was suffixed by '_' for avoiding name collision
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#** Translated to pascal by Lavergne Thomas
|
|
||||||
#** Notes :
|
|
||||||
#** - Pointers type was prefixed with 'P'
|
|
||||||
#** - lua_upvalueindex constant was transformed to function
|
|
||||||
#** - Some compatibility function was isolated because with it you must have
|
|
||||||
#** lualib.
|
|
||||||
#** - LUA_VERSION was suffixed by '_' for avoiding name collision.
|
|
||||||
#** Bug reports :
|
|
||||||
#** - thomas.lavergne@laposte.net
|
|
||||||
#** In french or in english
|
|
||||||
#
|
|
||||||
|
|
||||||
when defined(useLuajit):
|
|
||||||
when defined(MACOSX):
|
|
||||||
const
|
|
||||||
NAME* = "libluajit.dylib"
|
|
||||||
LIB_NAME* = "libluajit.dylib"
|
|
||||||
elif defined(UNIX):
|
|
||||||
const
|
|
||||||
NAME* = "libluajit.so(|.0)"
|
|
||||||
LIB_NAME* = "libluajit.so(|.0)"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
NAME* = "luajit.dll"
|
|
||||||
LIB_NAME* = "luajit.dll"
|
|
||||||
else:
|
|
||||||
when defined(MACOSX):
|
|
||||||
const
|
|
||||||
NAME* = "liblua(|5.1|5.0).dylib"
|
|
||||||
LIB_NAME* = "liblua(|5.1|5.0).dylib"
|
|
||||||
elif defined(UNIX):
|
|
||||||
const
|
|
||||||
NAME* = "liblua(|5.1|5.0).so(|.0)"
|
|
||||||
LIB_NAME* = "liblua(|5.1|5.0).so(|.0)"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
NAME* = "lua(|5.1|5.0).dll"
|
|
||||||
LIB_NAME* = "lua(|5.1|5.0).dll"
|
|
||||||
|
|
||||||
const
|
|
||||||
VERSION* = "Lua 5.1"
|
|
||||||
RELEASE* = "Lua 5.1.1"
|
|
||||||
VERSION_NUM* = 501
|
|
||||||
COPYRIGHT* = "Copyright (C) 1994-2006 Lua.org, PUC-Rio"
|
|
||||||
AUTHORS* = "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
|
|
||||||
# option for multiple returns in `lua_pcall' and `lua_call'
|
|
||||||
MULTRET* = - 1 #
|
|
||||||
#** pseudo-indices
|
|
||||||
#
|
|
||||||
REGISTRYINDEX* = - 10000
|
|
||||||
ENVIRONINDEX* = - 10001
|
|
||||||
GLOBALSINDEX* = - 10002
|
|
||||||
|
|
||||||
proc upvalueindex*(I: cint): cint
|
|
||||||
const # thread status; 0 is OK
|
|
||||||
constYIELD* = 1
|
|
||||||
ERRRUN* = 2
|
|
||||||
ERRSYNTAX* = 3
|
|
||||||
ERRMEM* = 4
|
|
||||||
ERRERR* = 5
|
|
||||||
|
|
||||||
type
|
|
||||||
PState* = Pointer
|
|
||||||
CFunction* = proc (L: PState): cint{.cdecl.}
|
|
||||||
|
|
||||||
#
|
|
||||||
#** functions that read/write blocks when loading/dumping Lua chunks
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
Reader* = proc (L: PState, ud: Pointer, sz: ptr cint): cstring{.cdecl.}
|
|
||||||
Writer* = proc (L: PState, p: Pointer, sz: cint, ud: Pointer): cint{.cdecl.}
|
|
||||||
Alloc* = proc (ud, theptr: Pointer, osize, nsize: cint){.cdecl.}
|
|
||||||
|
|
||||||
const
|
|
||||||
TNONE* = - 1
|
|
||||||
TNIL* = 0
|
|
||||||
TBOOLEAN* = 1
|
|
||||||
TLIGHTUSERDATA* = 2
|
|
||||||
TNUMBER* = 3
|
|
||||||
TSTRING* = 4
|
|
||||||
TTABLE* = 5
|
|
||||||
TFUNCTION* = 6
|
|
||||||
TUSERDATA* = 7
|
|
||||||
TTHREAD* = 8 # minimum Lua stack available to a C function
|
|
||||||
MINSTACK* = 20
|
|
||||||
|
|
||||||
type # Type of Numbers in Lua
|
|
||||||
Number* = float
|
|
||||||
Integer* = cint
|
|
||||||
|
|
||||||
{.pragma: ilua, importc: "lua_$1".}
|
|
||||||
|
|
||||||
{.push callConv: cdecl, dynlib: LibName.}
|
|
||||||
#{.push importc: "lua_$1".}
|
|
||||||
|
|
||||||
proc newstate*(f: Alloc, ud: Pointer): PState {.ilua.}
|
|
||||||
|
|
||||||
proc close*(L: PState){.ilua.}
|
|
||||||
proc newthread*(L: PState): PState{.ilua.}
|
|
||||||
proc atpanic*(L: PState, panicf: CFunction): CFunction{.ilua.}
|
|
||||||
|
|
||||||
proc gettop*(L: PState): cint{.ilua.}
|
|
||||||
proc settop*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc pushvalue*(L: PState, Idx: cint){.ilua.}
|
|
||||||
proc remove*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc insert*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc replace*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc checkstack*(L: PState, sz: cint): cint{.ilua.}
|
|
||||||
proc xmove*(`from`, `to`: PState, n: cint){.ilua.}
|
|
||||||
proc isnumber*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc isstring*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc iscfunction*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc isuserdata*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc luatype*(L: PState, idx: cint): cint{.importc: "lua_type".}
|
|
||||||
proc typename*(L: PState, tp: cint): cstring{.ilua.}
|
|
||||||
proc equal*(L: PState, idx1, idx2: cint): cint{.ilua.}
|
|
||||||
proc rawequal*(L: PState, idx1, idx2: cint): cint{.ilua.}
|
|
||||||
proc lessthan*(L: PState, idx1, idx2: cint): cint{.ilua.}
|
|
||||||
proc tonumber*(L: PState, idx: cint): Number{.ilua.}
|
|
||||||
proc tointeger*(L: PState, idx: cint): Integer{.ilua.}
|
|
||||||
proc toboolean*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc tolstring*(L: PState, idx: cint, length: ptr cint): cstring{.ilua.}
|
|
||||||
proc objlen*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc tocfunction*(L: PState, idx: cint): CFunction{.ilua.}
|
|
||||||
proc touserdata*(L: PState, idx: cint): Pointer{.ilua.}
|
|
||||||
proc tothread*(L: PState, idx: cint): PState{.ilua.}
|
|
||||||
proc topointer*(L: PState, idx: cint): Pointer{.ilua.}
|
|
||||||
proc pushnil*(L: PState){.ilua.}
|
|
||||||
proc pushnumber*(L: PState, n: Number){.ilua.}
|
|
||||||
proc pushinteger*(L: PState, n: Integer){.ilua.}
|
|
||||||
proc pushlstring*(L: PState, s: cstring, len: cint){.ilua.}
|
|
||||||
proc pushstring*(L: PState, s: cstring){.ilua.}
|
|
||||||
proc pushvfstring*(L: PState, fmt: cstring, argp: Pointer): cstring{.ilua.}
|
|
||||||
proc pushfstring*(L: PState, fmt: cstring): cstring{.varargs,ilua.}
|
|
||||||
proc pushcclosure*(L: PState, fn: CFunction, n: cint){.ilua.}
|
|
||||||
proc pushboolean*(L: PState, b: cint){.ilua.}
|
|
||||||
proc pushlightuserdata*(L: PState, p: Pointer){.ilua.}
|
|
||||||
proc pushthread*(L: PState){.ilua.}
|
|
||||||
proc gettable*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc getfield*(L: Pstate, idx: cint, k: cstring){.ilua.}
|
|
||||||
proc rawget*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc rawgeti*(L: PState, idx, n: cint){.ilua.}
|
|
||||||
proc createtable*(L: PState, narr, nrec: cint){.ilua.}
|
|
||||||
proc newuserdata*(L: PState, sz: cint): Pointer{.ilua.}
|
|
||||||
proc getmetatable*(L: PState, objindex: cint): cint{.ilua.}
|
|
||||||
proc getfenv*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc settable*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc setfield*(L: PState, idx: cint, k: cstring){.ilua.}
|
|
||||||
proc rawset*(L: PState, idx: cint){.ilua.}
|
|
||||||
proc rawseti*(L: PState, idx, n: cint){.ilua.}
|
|
||||||
proc setmetatable*(L: PState, objindex: cint): cint{.ilua.}
|
|
||||||
proc setfenv*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc call*(L: PState, nargs, nresults: cint){.ilua.}
|
|
||||||
proc pcall*(L: PState, nargs, nresults, errf: cint): cint{.ilua.}
|
|
||||||
proc cpcall*(L: PState, func: CFunction, ud: Pointer): cint{.ilua.}
|
|
||||||
proc load*(L: PState, reader: Reader, dt: Pointer, chunkname: cstring): cint{.ilua.}
|
|
||||||
proc dump*(L: PState, writer: Writer, data: Pointer): cint{.ilua.}
|
|
||||||
proc luayield*(L: PState, nresults: cint): cint{.importc: "lua_yield".}
|
|
||||||
proc resume*(L: PState, narg: cint): cint{.ilua.}
|
|
||||||
proc status*(L: PState): cint{.ilua.}
|
|
||||||
proc gc*(L: PState, what, data: cint): cint{.ilua.}
|
|
||||||
proc error*(L: PState): cint{.ilua.}
|
|
||||||
proc next*(L: PState, idx: cint): cint{.ilua.}
|
|
||||||
proc concat*(L: PState, n: cint){.ilua.}
|
|
||||||
proc getallocf*(L: PState, ud: ptr Pointer): Alloc{.ilua.}
|
|
||||||
proc setallocf*(L: PState, f: Alloc, ud: Pointer){.ilua.}
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
#
|
|
||||||
#** Garbage-collection functions and options
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
GCSTOP* = 0
|
|
||||||
GCRESTART* = 1
|
|
||||||
GCCOLLECT* = 2
|
|
||||||
GCCOUNT* = 3
|
|
||||||
GCCOUNTB* = 4
|
|
||||||
GCSTEP* = 5
|
|
||||||
GCSETPAUSE* = 6
|
|
||||||
GCSETSTEPMUL* = 7
|
|
||||||
|
|
||||||
#
|
|
||||||
#** ===============================================================
|
|
||||||
#** some useful macros
|
|
||||||
#** ===============================================================
|
|
||||||
#
|
|
||||||
|
|
||||||
proc pop*(L: PState, n: cint)
|
|
||||||
proc newtable*(L: Pstate)
|
|
||||||
proc register*(L: PState, n: cstring, f: CFunction)
|
|
||||||
proc pushcfunction*(L: PState, f: CFunction)
|
|
||||||
proc strlen*(L: Pstate, i: cint): cint
|
|
||||||
proc isfunction*(L: PState, n: cint): bool
|
|
||||||
proc istable*(L: PState, n: cint): bool
|
|
||||||
proc islightuserdata*(L: PState, n: cint): bool
|
|
||||||
proc isnil*(L: PState, n: cint): bool
|
|
||||||
proc isboolean*(L: PState, n: cint): bool
|
|
||||||
proc isthread*(L: PState, n: cint): bool
|
|
||||||
proc isnone*(L: PState, n: cint): bool
|
|
||||||
proc isnoneornil*(L: PState, n: cint): bool
|
|
||||||
proc pushliteral*(L: PState, s: cstring)
|
|
||||||
proc setglobal*(L: PState, s: cstring)
|
|
||||||
proc getglobal*(L: PState, s: cstring)
|
|
||||||
proc tostring*(L: PState, i: cint): cstring
|
|
||||||
#
|
|
||||||
#** compatibility macros and functions
|
|
||||||
#
|
|
||||||
|
|
||||||
proc getregistry*(L: PState)
|
|
||||||
proc getgccount*(L: PState): cint
|
|
||||||
type
|
|
||||||
Chunkreader* = Reader
|
|
||||||
Chunkwriter* = Writer
|
|
||||||
|
|
||||||
#
|
|
||||||
#** ======================================================================
|
|
||||||
#** Debug API
|
|
||||||
#** ======================================================================
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
HOOKCALL* = 0
|
|
||||||
HOOKRET* = 1
|
|
||||||
HOOKLINE* = 2
|
|
||||||
HOOKCOUNT* = 3
|
|
||||||
HOOKTAILRET* = 4
|
|
||||||
|
|
||||||
const
|
|
||||||
MASKCALL* = 1 shl Ord(HOOKCALL)
|
|
||||||
MASKRET* = 1 shl Ord(HOOKRET)
|
|
||||||
MASKLINE* = 1 shl Ord(HOOKLINE)
|
|
||||||
MASKCOUNT* = 1 shl Ord(HOOKCOUNT)
|
|
||||||
|
|
||||||
const
|
|
||||||
IDSIZE* = 60
|
|
||||||
|
|
||||||
type
|
|
||||||
TDebug*{.final.} = object # activation record
|
|
||||||
event*: cint
|
|
||||||
name*: cstring # (n)
|
|
||||||
namewhat*: cstring # (n) `global', `local', `field', `method'
|
|
||||||
what*: cstring # (S) `Lua', `C', `main', `tail'
|
|
||||||
source*: cstring # (S)
|
|
||||||
currentline*: cint # (l)
|
|
||||||
nups*: cint # (u) number of upvalues
|
|
||||||
linedefined*: cint # (S)
|
|
||||||
lastlinedefined*: cint # (S)
|
|
||||||
short_src*: array[0.. <IDSIZE, Char] # (S) \
|
|
||||||
# private part
|
|
||||||
i_ci*: cint # active function
|
|
||||||
|
|
||||||
PDebug* = ptr TDebug
|
|
||||||
Hook* = proc (L: PState, ar: PDebug){.cdecl.}
|
|
||||||
|
|
||||||
#
|
|
||||||
#** ======================================================================
|
|
||||||
#** Debug API
|
|
||||||
#** ======================================================================
|
|
||||||
#
|
|
||||||
|
|
||||||
{.push callConv: cdecl, dynlib: lua.LIB_NAME.}
|
|
||||||
|
|
||||||
proc getstack*(L: PState, level: cint, ar: PDebug): cint{.ilua.}
|
|
||||||
proc getinfo*(L: PState, what: cstring, ar: PDebug): cint{.ilua.}
|
|
||||||
proc getlocal*(L: PState, ar: PDebug, n: cint): cstring{.ilua.}
|
|
||||||
proc setlocal*(L: PState, ar: PDebug, n: cint): cstring{.ilua.}
|
|
||||||
proc getupvalue*(L: PState, funcindex: cint, n: cint): cstring{.ilua.}
|
|
||||||
proc setupvalue*(L: PState, funcindex: cint, n: cint): cstring{.ilua.}
|
|
||||||
proc sethook*(L: PState, func: Hook, mask: cint, count: cint): cint{.ilua.}
|
|
||||||
proc gethook*(L: PState): Hook{.ilua.}
|
|
||||||
proc gethookmask*(L: PState): cint{.ilua.}
|
|
||||||
proc gethookcount*(L: PState): cint{.ilua.}
|
|
||||||
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc upvalueindex(I: cint): cint =
|
|
||||||
Result = GLOBALSINDEX - i
|
|
||||||
|
|
||||||
proc pop(L: PState, n: cint) =
|
|
||||||
settop(L, - n - 1)
|
|
||||||
|
|
||||||
proc newtable(L: PState) =
|
|
||||||
createtable(L, 0, 0)
|
|
||||||
|
|
||||||
proc register(L: PState, n: cstring, f: CFunction) =
|
|
||||||
pushcfunction(L, f)
|
|
||||||
setglobal(L, n)
|
|
||||||
|
|
||||||
proc pushcfunction(L: PState, f: CFunction) =
|
|
||||||
pushcclosure(L, f, 0)
|
|
||||||
|
|
||||||
proc strlen(L: PState, i: cint): cint =
|
|
||||||
Result = objlen(L, i)
|
|
||||||
|
|
||||||
proc isfunction(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TFUNCTION
|
|
||||||
|
|
||||||
proc istable(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TTABLE
|
|
||||||
|
|
||||||
proc islightuserdata(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TLIGHTUSERDATA
|
|
||||||
|
|
||||||
proc isnil(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TNIL
|
|
||||||
|
|
||||||
proc isboolean(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TBOOLEAN
|
|
||||||
|
|
||||||
proc isthread(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TTHREAD
|
|
||||||
|
|
||||||
proc isnone(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) == TNONE
|
|
||||||
|
|
||||||
proc isnoneornil(L: PState, n: cint): bool =
|
|
||||||
Result = luatype(L, n) <= 0
|
|
||||||
|
|
||||||
proc pushliteral(L: PState, s: cstring) =
|
|
||||||
pushlstring(L, s, s.len.cint)
|
|
||||||
|
|
||||||
proc setglobal(L: PState, s: cstring) =
|
|
||||||
setfield(L, GLOBALSINDEX, s)
|
|
||||||
|
|
||||||
proc getglobal(L: PState, s: cstring) =
|
|
||||||
getfield(L, GLOBALSINDEX, s)
|
|
||||||
|
|
||||||
proc tostring(L: PState, i: cint): cstring =
|
|
||||||
Result = tolstring(L, i, nil)
|
|
||||||
|
|
||||||
proc getregistry(L: PState) =
|
|
||||||
pushvalue(L, REGISTRYINDEX)
|
|
||||||
|
|
||||||
proc getgccount(L: PState): cint =
|
|
||||||
Result = gc(L, GCCOUNT, 0)
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
#*****************************************************************************
|
|
||||||
# * *
|
|
||||||
# * File: lualib.pas *
|
|
||||||
# * Authors: TeCGraf (C headers + actual Lua libraries) *
|
|
||||||
# * Lavergne Thomas (original translation to Pascal) *
|
|
||||||
# * Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal) *
|
|
||||||
# * Description: Standard Lua libraries *
|
|
||||||
# * *
|
|
||||||
# *****************************************************************************
|
|
||||||
#
|
|
||||||
#** $Id: lualib.h,v 1.28 2003/03/18 12:24:26 roberto Exp $
|
|
||||||
#** Lua standard libraries
|
|
||||||
#** See Copyright Notice in lua.h
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#** Translated to pascal by Lavergne Thomas
|
|
||||||
#** Bug reports :
|
|
||||||
#** - thomas.lavergne@laposte.net
|
|
||||||
#** In french or in english
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
lua
|
|
||||||
|
|
||||||
const
|
|
||||||
COLIBNAME* = "coroutine"
|
|
||||||
TABLIBNAME* = "table"
|
|
||||||
IOLIBNAME* = "io"
|
|
||||||
OSLIBNAME* = "os"
|
|
||||||
STRLINAME* = "string"
|
|
||||||
MATHLIBNAME* = "math"
|
|
||||||
DBLIBNAME* = "debug"
|
|
||||||
LOADLIBNAME* = "package"
|
|
||||||
|
|
||||||
{.pragma: ilua, importc: "lua$1".}
|
|
||||||
|
|
||||||
{.push callConv: cdecl, dynlib: lua.LIB_NAME.}
|
|
||||||
proc open_base*(L: PState): cint{.ilua.}
|
|
||||||
proc open_table*(L: PState): cint{.ilua.}
|
|
||||||
proc open_io*(L: PState): cint{.ilua.}
|
|
||||||
proc open_string*(L: PState): cint{.ilua.}
|
|
||||||
proc open_math*(L: PState): cint{.ilua.}
|
|
||||||
proc open_debug*(L: PState): cint{.ilua.}
|
|
||||||
proc open_package*(L: PState): cint{.ilua.}
|
|
||||||
proc openlibs*(L: PState){.importc: "luaL_openlibs".}
|
|
||||||
{.pop.}
|
|
||||||
|
|
||||||
proc baselibopen*(L: PState): Bool =
|
|
||||||
open_base(L) != 0'i32
|
|
||||||
|
|
||||||
proc tablibopen*(L: PState): Bool =
|
|
||||||
open_table(L) != 0'i32
|
|
||||||
|
|
||||||
proc iolibopen*(L: PState): Bool =
|
|
||||||
open_io(L) != 0'i32
|
|
||||||
|
|
||||||
proc strlibopen*(L: PState): Bool =
|
|
||||||
open_string(L) != 0'i32
|
|
||||||
|
|
||||||
proc mathlibopen*(L: PState): Bool =
|
|
||||||
open_math(L) != 0'i32
|
|
||||||
|
|
||||||
proc dblibopen*(L: PState): Bool =
|
|
||||||
open_debug(L) != 0'i32
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,335 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Adaption of the delphi3d.net OpenGL units to FreePascal
|
|
||||||
# Sebastian Guenther (sg@freepascal.org) in 2002
|
|
||||||
# These units are free to use
|
|
||||||
#******************************************************************************
|
|
||||||
# Converted to Delphi by Tom Nuydens (tom@delphi3d.net)
|
|
||||||
# For the latest updates, visit Delphi3D: http://www.delphi3d.net
|
|
||||||
#******************************************************************************
|
|
||||||
|
|
||||||
import
|
|
||||||
GL
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
{.push, callconv: stdcall.}
|
|
||||||
else:
|
|
||||||
{.push, callconv: cdecl.}
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
const
|
|
||||||
dllname = "glu32.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
dllname = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
dllname = "libGLU.so.1"
|
|
||||||
type
|
|
||||||
TViewPortArray* = array[0..3, TGLint]
|
|
||||||
T16dArray* = array[0..15, TGLdouble]
|
|
||||||
TCallBack* = proc ()
|
|
||||||
T3dArray* = array[0..2, TGLdouble]
|
|
||||||
T4pArray* = array[0..3, Pointer]
|
|
||||||
T4fArray* = array[0..3, TGLfloat]
|
|
||||||
PPointer* = ptr Pointer
|
|
||||||
|
|
||||||
type
|
|
||||||
GLUnurbs*{.final.} = object
|
|
||||||
PGLUnurbs* = ptr GLUnurbs
|
|
||||||
GLUquadric*{.final.} = object
|
|
||||||
PGLUquadric* = ptr GLUquadric
|
|
||||||
GLUtesselator*{.final.} = object
|
|
||||||
PGLUtesselator* = ptr GLUtesselator # backwards compatibility:
|
|
||||||
GLUnurbsObj* = GLUnurbs
|
|
||||||
PGLUnurbsObj* = PGLUnurbs
|
|
||||||
GLUquadricObj* = GLUquadric
|
|
||||||
PGLUquadricObj* = PGLUquadric
|
|
||||||
GLUtesselatorObj* = GLUtesselator
|
|
||||||
PGLUtesselatorObj* = PGLUtesselator
|
|
||||||
GLUtriangulatorObj* = GLUtesselator
|
|
||||||
PGLUtriangulatorObj* = PGLUtesselator
|
|
||||||
TGLUnurbs* = GLUnurbs
|
|
||||||
TGLUquadric* = GLUquadric
|
|
||||||
TGLUtesselator* = GLUtesselator
|
|
||||||
TGLUnurbsObj* = GLUnurbsObj
|
|
||||||
TGLUquadricObj* = GLUquadricObj
|
|
||||||
TGLUtesselatorObj* = GLUtesselatorObj
|
|
||||||
TGLUtriangulatorObj* = GLUtriangulatorObj
|
|
||||||
|
|
||||||
proc gluErrorString*(errCode: TGLenum): cstring{.dynlib: dllname,
|
|
||||||
importc: "gluErrorString".}
|
|
||||||
proc gluErrorUnicodeStringEXT*(errCode: TGLenum): ptr int16{.dynlib: dllname,
|
|
||||||
importc: "gluErrorUnicodeStringEXT".}
|
|
||||||
proc gluGetString*(name: TGLenum): cstring{.dynlib: dllname,
|
|
||||||
importc: "gluGetString".}
|
|
||||||
proc gluOrtho2D*(left, right, bottom, top: TGLdouble){.dynlib: dllname,
|
|
||||||
importc: "gluOrtho2D".}
|
|
||||||
proc gluPerspective*(fovy, aspect, zNear, zFar: TGLdouble){.dynlib: dllname,
|
|
||||||
importc: "gluPerspective".}
|
|
||||||
proc gluPickMatrix*(x, y, width, height: TGLdouble, viewport: var TViewPortArray){.
|
|
||||||
dynlib: dllname, importc: "gluPickMatrix".}
|
|
||||||
proc gluLookAt*(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: TGLdouble){.
|
|
||||||
dynlib: dllname, importc: "gluLookAt".}
|
|
||||||
proc gluProject*(objx, objy, objz: TGLdouble,
|
|
||||||
modelMatrix, projMatrix: var T16dArray,
|
|
||||||
viewport: var TViewPortArray, winx, winy, winz: PGLdouble): int{.
|
|
||||||
dynlib: dllname, importc: "gluProject".}
|
|
||||||
proc gluUnProject*(winx, winy, winz: TGLdouble,
|
|
||||||
modelMatrix, projMatrix: var T16dArray,
|
|
||||||
viewport: var TViewPortArray, objx, objy, objz: PGLdouble): int{.
|
|
||||||
dynlib: dllname, importc: "gluUnProject".}
|
|
||||||
proc gluScaleImage*(format: TGLenum, widthin, heightin: TGLint, typein: TGLenum,
|
|
||||||
datain: Pointer, widthout, heightout: TGLint,
|
|
||||||
typeout: TGLenum, dataout: Pointer): int{.dynlib: dllname,
|
|
||||||
importc: "gluScaleImage".}
|
|
||||||
proc gluBuild1DMipmaps*(target: TGLenum, components, width: TGLint,
|
|
||||||
format, atype: TGLenum, data: Pointer): int{.
|
|
||||||
dynlib: dllname, importc: "gluBuild1DMipmaps".}
|
|
||||||
proc gluBuild2DMipmaps*(target: TGLenum, components, width, height: TGLint,
|
|
||||||
format, atype: TGLenum, data: Pointer): int{.
|
|
||||||
dynlib: dllname, importc: "gluBuild2DMipmaps".}
|
|
||||||
proc gluNewQuadric*(): PGLUquadric{.dynlib: dllname, importc: "gluNewQuadric".}
|
|
||||||
proc gluDeleteQuadric*(state: PGLUquadric){.dynlib: dllname,
|
|
||||||
importc: "gluDeleteQuadric".}
|
|
||||||
proc gluQuadricNormals*(quadObject: PGLUquadric, normals: TGLenum){.
|
|
||||||
dynlib: dllname, importc: "gluQuadricNormals".}
|
|
||||||
proc gluQuadricTexture*(quadObject: PGLUquadric, textureCoords: TGLboolean){.
|
|
||||||
dynlib: dllname, importc: "gluQuadricTexture".}
|
|
||||||
proc gluQuadricOrientation*(quadObject: PGLUquadric, orientation: TGLenum){.
|
|
||||||
dynlib: dllname, importc: "gluQuadricOrientation".}
|
|
||||||
proc gluQuadricDrawStyle*(quadObject: PGLUquadric, drawStyle: TGLenum){.
|
|
||||||
dynlib: dllname, importc: "gluQuadricDrawStyle".}
|
|
||||||
proc gluCylinder*(qobj: PGLUquadric, baseRadius, topRadius, height: TGLdouble,
|
|
||||||
slices, stacks: TGLint){.dynlib: dllname,
|
|
||||||
importc: "gluCylinder".}
|
|
||||||
proc gluDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble,
|
|
||||||
slices, loops: TGLint){.dynlib: dllname, importc: "gluDisk".}
|
|
||||||
proc gluPartialDisk*(qobj: PGLUquadric, innerRadius, outerRadius: TGLdouble,
|
|
||||||
slices, loops: TGLint, startAngle, sweepAngle: TGLdouble){.
|
|
||||||
dynlib: dllname, importc: "gluPartialDisk".}
|
|
||||||
proc gluSphere*(qobj: PGLuquadric, radius: TGLdouble, slices, stacks: TGLint){.
|
|
||||||
dynlib: dllname, importc: "gluSphere".}
|
|
||||||
proc gluQuadricCallback*(qobj: PGLUquadric, which: TGLenum, fn: TCallBack){.
|
|
||||||
dynlib: dllname, importc: "gluQuadricCallback".}
|
|
||||||
proc gluNewTess*(): PGLUtesselator{.dynlib: dllname, importc: "gluNewTess".}
|
|
||||||
proc gluDeleteTess*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluDeleteTess".}
|
|
||||||
proc gluTessBeginPolygon*(tess: PGLUtesselator, polygon_data: Pointer){.
|
|
||||||
dynlib: dllname, importc: "gluTessBeginPolygon".}
|
|
||||||
proc gluTessBeginContour*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluTessBeginContour".}
|
|
||||||
proc gluTessVertex*(tess: PGLUtesselator, coords: var T3dArray, data: Pointer){.
|
|
||||||
dynlib: dllname, importc: "gluTessVertex".}
|
|
||||||
proc gluTessEndContour*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluTessEndContour".}
|
|
||||||
proc gluTessEndPolygon*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluTessEndPolygon".}
|
|
||||||
proc gluTessProperty*(tess: PGLUtesselator, which: TGLenum, value: TGLdouble){.
|
|
||||||
dynlib: dllname, importc: "gluTessProperty".}
|
|
||||||
proc gluTessNormal*(tess: PGLUtesselator, x, y, z: TGLdouble){.dynlib: dllname,
|
|
||||||
importc: "gluTessNormal".}
|
|
||||||
proc gluTessCallback*(tess: PGLUtesselator, which: TGLenum, fn: TCallBack){.
|
|
||||||
dynlib: dllname, importc: "gluTessCallback".}
|
|
||||||
proc gluGetTessProperty*(tess: PGLUtesselator, which: TGLenum, value: PGLdouble){.
|
|
||||||
dynlib: dllname, importc: "gluGetTessProperty".}
|
|
||||||
proc gluNewNurbsRenderer*(): PGLUnurbs{.dynlib: dllname,
|
|
||||||
importc: "gluNewNurbsRenderer".}
|
|
||||||
proc gluDeleteNurbsRenderer*(nobj: PGLUnurbs){.dynlib: dllname,
|
|
||||||
importc: "gluDeleteNurbsRenderer".}
|
|
||||||
proc gluBeginSurface*(nobj: PGLUnurbs){.dynlib: dllname,
|
|
||||||
importc: "gluBeginSurface".}
|
|
||||||
proc gluBeginCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluBeginCurve".}
|
|
||||||
proc gluEndCurve*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndCurve".}
|
|
||||||
proc gluEndSurface*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndSurface".}
|
|
||||||
proc gluBeginTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluBeginTrim".}
|
|
||||||
proc gluEndTrim*(nobj: PGLUnurbs){.dynlib: dllname, importc: "gluEndTrim".}
|
|
||||||
proc gluPwlCurve*(nobj: PGLUnurbs, count: TGLint, aarray: PGLfloat,
|
|
||||||
stride: TGLint, atype: TGLenum){.dynlib: dllname,
|
|
||||||
importc: "gluPwlCurve".}
|
|
||||||
proc gluNurbsCurve*(nobj: PGLUnurbs, nknots: TGLint, knot: PGLfloat,
|
|
||||||
stride: TGLint, ctlarray: PGLfloat, order: TGLint,
|
|
||||||
atype: TGLenum){.dynlib: dllname, importc: "gluNurbsCurve".}
|
|
||||||
proc gluNurbsSurface*(nobj: PGLUnurbs, sknot_count: TGLint, sknot: PGLfloat,
|
|
||||||
tknot_count: TGLint, tknot: PGLfloat,
|
|
||||||
s_stride, t_stride: TGLint, ctlarray: PGLfloat,
|
|
||||||
sorder, torder: TGLint, atype: TGLenum){.dynlib: dllname,
|
|
||||||
importc: "gluNurbsSurface".}
|
|
||||||
proc gluLoadSamplingMatrices*(nobj: PGLUnurbs,
|
|
||||||
modelMatrix, projMatrix: var T16dArray,
|
|
||||||
viewport: var TViewPortArray){.dynlib: dllname,
|
|
||||||
importc: "gluLoadSamplingMatrices".}
|
|
||||||
proc gluNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: TGLfloat){.
|
|
||||||
dynlib: dllname, importc: "gluNurbsProperty".}
|
|
||||||
proc gluGetNurbsProperty*(nobj: PGLUnurbs, aproperty: TGLenum, value: PGLfloat){.
|
|
||||||
dynlib: dllname, importc: "gluGetNurbsProperty".}
|
|
||||||
proc gluNurbsCallback*(nobj: PGLUnurbs, which: TGLenum, fn: TCallBack){.
|
|
||||||
dynlib: dllname, importc: "gluNurbsCallback".}
|
|
||||||
#*** Callback function prototypes ***
|
|
||||||
type # gluQuadricCallback
|
|
||||||
GLUquadricErrorProc* = proc (p: TGLenum) # gluTessCallback
|
|
||||||
GLUtessBeginProc* = proc (p: TGLenum)
|
|
||||||
GLUtessEdgeFlagProc* = proc (p: TGLboolean)
|
|
||||||
GLUtessVertexProc* = proc (p: Pointer)
|
|
||||||
GLUtessEndProc* = proc ()
|
|
||||||
GLUtessErrorProc* = proc (p: TGLenum)
|
|
||||||
GLUtessCombineProc* = proc (p1: var T3dArray, p2: T4pArray, p3: T4fArray,
|
|
||||||
p4: PPointer)
|
|
||||||
GLUtessBeginDataProc* = proc (p1: TGLenum, p2: Pointer)
|
|
||||||
GLUtessEdgeFlagDataProc* = proc (p1: TGLboolean, p2: Pointer)
|
|
||||||
GLUtessVertexDataProc* = proc (p1, p2: Pointer)
|
|
||||||
GLUtessEndDataProc* = proc (p: Pointer)
|
|
||||||
GLUtessErrorDataProc* = proc (p1: TGLenum, p2: Pointer)
|
|
||||||
GLUtessCombineDataProc* = proc (p1: var T3dArray, p2: var T4pArray,
|
|
||||||
p3: var T4fArray, p4: PPointer, p5: Pointer) #
|
|
||||||
#
|
|
||||||
# gluNurbsCallback
|
|
||||||
GLUnurbsErrorProc* = proc (p: TGLenum) #*** Generic constants ****/
|
|
||||||
|
|
||||||
const # Version
|
|
||||||
GLU_VERSION_1_1* = 1
|
|
||||||
GLU_VERSION_1_2* = 1 # Errors: (return value 0 = no error)
|
|
||||||
GLU_INVALID_ENUM* = 100900
|
|
||||||
GLU_INVALID_VALUE* = 100901
|
|
||||||
GLU_OUT_OF_MEMORY* = 100902
|
|
||||||
GLU_INCOMPATIBLE_GL_VERSION* = 100903 # StringName
|
|
||||||
GLU_VERSION* = 100800
|
|
||||||
GLU_EXTENSIONS* = 100801 # Boolean
|
|
||||||
GLU_TRUE* = GL_TRUE
|
|
||||||
GLU_FALSE* = GL_FALSE #*** Quadric constants ****/
|
|
||||||
# QuadricNormal
|
|
||||||
GLU_SMOOTH* = 100000
|
|
||||||
GLU_FLAT* = 100001
|
|
||||||
GLU_NONE* = 100002 # QuadricDrawStyle
|
|
||||||
GLU_POINT* = 100010
|
|
||||||
GLU_LINE* = 100011
|
|
||||||
GLU_FILL* = 100012
|
|
||||||
GLU_SILHOUETTE* = 100013 # QuadricOrientation
|
|
||||||
GLU_OUTSIDE* = 100020
|
|
||||||
GLU_INSIDE* = 100021 # Callback types:
|
|
||||||
# GLU_ERROR = 100103;
|
|
||||||
#*** Tesselation constants ****/
|
|
||||||
GLU_TESS_MAX_COORD* = 1.00000e+150 # TessProperty
|
|
||||||
GLU_TESS_WINDING_RULE* = 100140
|
|
||||||
GLU_TESS_BOUNDARY_ONLY* = 100141
|
|
||||||
GLU_TESS_TOLERANCE* = 100142 # TessWinding
|
|
||||||
GLU_TESS_WINDING_ODD* = 100130
|
|
||||||
GLU_TESS_WINDING_NONZERO* = 100131
|
|
||||||
GLU_TESS_WINDING_POSITIVE* = 100132
|
|
||||||
GLU_TESS_WINDING_NEGATIVE* = 100133
|
|
||||||
GLU_TESS_WINDING_ABS_GEQ_TWO* = 100134 # TessCallback
|
|
||||||
GLU_TESS_BEGIN* = 100100 # void (CALLBACK*)(TGLenum type)
|
|
||||||
constGLU_TESS_VERTEX* = 100101 # void (CALLBACK*)(void *data)
|
|
||||||
GLU_TESS_END* = 100102 # void (CALLBACK*)(void)
|
|
||||||
GLU_TESS_ERROR* = 100103 # void (CALLBACK*)(TGLenum errno)
|
|
||||||
GLU_TESS_EDGE_FLAG* = 100104 # void (CALLBACK*)(TGLboolean boundaryEdge)
|
|
||||||
GLU_TESS_COMBINE* = 100105 # void (CALLBACK*)(TGLdouble coords[3],
|
|
||||||
# void *data[4],
|
|
||||||
# TGLfloat weight[4],
|
|
||||||
# void **dataOut)
|
|
||||||
GLU_TESS_BEGIN_DATA* = 100106 # void (CALLBACK*)(TGLenum type,
|
|
||||||
# void *polygon_data)
|
|
||||||
GLU_TESS_VERTEX_DATA* = 100107 # void (CALLBACK*)(void *data,
|
|
||||||
# void *polygon_data)
|
|
||||||
GLU_TESS_END_DATA* = 100108 # void (CALLBACK*)(void *polygon_data)
|
|
||||||
GLU_TESS_ERROR_DATA* = 100109 # void (CALLBACK*)(TGLenum errno,
|
|
||||||
# void *polygon_data)
|
|
||||||
GLU_TESS_EDGE_FLAG_DATA* = 100110 # void (CALLBACK*)(TGLboolean boundaryEdge,
|
|
||||||
# void *polygon_data)
|
|
||||||
GLU_TESS_COMBINE_DATA* = 100111 # void (CALLBACK*)(TGLdouble coords[3],
|
|
||||||
# void *data[4],
|
|
||||||
# TGLfloat weight[4],
|
|
||||||
# void **dataOut,
|
|
||||||
# void *polygon_data)
|
|
||||||
# TessError
|
|
||||||
GLU_TESS_ERROR1* = 100151
|
|
||||||
GLU_TESS_ERROR2* = 100152
|
|
||||||
GLU_TESS_ERROR3* = 100153
|
|
||||||
GLU_TESS_ERROR4* = 100154
|
|
||||||
GLU_TESS_ERROR5* = 100155
|
|
||||||
GLU_TESS_ERROR6* = 100156
|
|
||||||
GLU_TESS_ERROR7* = 100157
|
|
||||||
GLU_TESS_ERROR8* = 100158
|
|
||||||
GLU_TESS_MISSING_BEGIN_POLYGON* = GLU_TESS_ERROR1
|
|
||||||
GLU_TESS_MISSING_BEGIN_CONTOUR* = GLU_TESS_ERROR2
|
|
||||||
GLU_TESS_MISSING_END_POLYGON* = GLU_TESS_ERROR3
|
|
||||||
GLU_TESS_MISSING_END_CONTOUR* = GLU_TESS_ERROR4
|
|
||||||
GLU_TESS_COORD_TOO_LARGE* = GLU_TESS_ERROR5
|
|
||||||
GLU_TESS_NEED_COMBINE_CALLBACK* = GLU_TESS_ERROR6 #*** NURBS constants ****/
|
|
||||||
# NurbsProperty
|
|
||||||
GLU_AUTO_LOAD_MATRIX* = 100200
|
|
||||||
GLU_CULLING* = 100201
|
|
||||||
GLU_SAMPLING_TOLERANCE* = 100203
|
|
||||||
GLU_DISPLAY_MODE* = 100204
|
|
||||||
GLU_PARAMETRIC_TOLERANCE* = 100202
|
|
||||||
GLU_SAMPLING_METHOD* = 100205
|
|
||||||
GLU_U_STEP* = 100206
|
|
||||||
GLU_V_STEP* = 100207 # NurbsSampling
|
|
||||||
GLU_PATH_LENGTH* = 100215
|
|
||||||
GLU_PARAMETRIC_ERROR* = 100216
|
|
||||||
GLU_DOMAIN_DISTANCE* = 100217 # NurbsTrim
|
|
||||||
GLU_MAP1_TRIM_2* = 100210
|
|
||||||
GLU_MAP1_TRIM_3* = 100211 # NurbsDisplay
|
|
||||||
# GLU_FILL = 100012;
|
|
||||||
GLU_OUTLINE_POLYGON* = 100240
|
|
||||||
GLU_OUTLINE_PATCH* = 100241 # NurbsCallback
|
|
||||||
# GLU_ERROR = 100103;
|
|
||||||
# NurbsErrors
|
|
||||||
GLU_NURBS_ERROR1* = 100251
|
|
||||||
GLU_NURBS_ERROR2* = 100252
|
|
||||||
GLU_NURBS_ERROR3* = 100253
|
|
||||||
GLU_NURBS_ERROR4* = 100254
|
|
||||||
GLU_NURBS_ERROR5* = 100255
|
|
||||||
GLU_NURBS_ERROR6* = 100256
|
|
||||||
GLU_NURBS_ERROR7* = 100257
|
|
||||||
GLU_NURBS_ERROR8* = 100258
|
|
||||||
GLU_NURBS_ERROR9* = 100259
|
|
||||||
GLU_NURBS_ERROR10* = 100260
|
|
||||||
GLU_NURBS_ERROR11* = 100261
|
|
||||||
GLU_NURBS_ERROR12* = 100262
|
|
||||||
GLU_NURBS_ERROR13* = 100263
|
|
||||||
GLU_NURBS_ERROR14* = 100264
|
|
||||||
GLU_NURBS_ERROR15* = 100265
|
|
||||||
GLU_NURBS_ERROR16* = 100266
|
|
||||||
GLU_NURBS_ERROR17* = 100267
|
|
||||||
GLU_NURBS_ERROR18* = 100268
|
|
||||||
GLU_NURBS_ERROR19* = 100269
|
|
||||||
GLU_NURBS_ERROR20* = 100270
|
|
||||||
GLU_NURBS_ERROR21* = 100271
|
|
||||||
GLU_NURBS_ERROR22* = 100272
|
|
||||||
GLU_NURBS_ERROR23* = 100273
|
|
||||||
GLU_NURBS_ERROR24* = 100274
|
|
||||||
GLU_NURBS_ERROR25* = 100275
|
|
||||||
GLU_NURBS_ERROR26* = 100276
|
|
||||||
GLU_NURBS_ERROR27* = 100277
|
|
||||||
GLU_NURBS_ERROR28* = 100278
|
|
||||||
GLU_NURBS_ERROR29* = 100279
|
|
||||||
GLU_NURBS_ERROR30* = 100280
|
|
||||||
GLU_NURBS_ERROR31* = 100281
|
|
||||||
GLU_NURBS_ERROR32* = 100282
|
|
||||||
GLU_NURBS_ERROR33* = 100283
|
|
||||||
GLU_NURBS_ERROR34* = 100284
|
|
||||||
GLU_NURBS_ERROR35* = 100285
|
|
||||||
GLU_NURBS_ERROR36* = 100286
|
|
||||||
GLU_NURBS_ERROR37* = 100287 #*** Backwards compatibility for old tesselator ****/
|
|
||||||
|
|
||||||
proc gluBeginPolygon*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluBeginPolygon".}
|
|
||||||
proc gluNextContour*(tess: PGLUtesselator, atype: TGLenum){.dynlib: dllname,
|
|
||||||
importc: "gluNextContour".}
|
|
||||||
proc gluEndPolygon*(tess: PGLUtesselator){.dynlib: dllname,
|
|
||||||
importc: "gluEndPolygon".}
|
|
||||||
const # Contours types -- obsolete!
|
|
||||||
GLU_CW* = 100120
|
|
||||||
GLU_CCW* = 100121
|
|
||||||
GLU_INTERIOR* = 100122
|
|
||||||
GLU_EXTERIOR* = 100123
|
|
||||||
GLU_UNKNOWN* = 100124 # Names without "TESS_" prefix
|
|
||||||
GLU_BEGIN* = GLU_TESS_BEGIN
|
|
||||||
GLU_VERTEX* = constGLU_TESS_VERTEX
|
|
||||||
GLU_END* = GLU_TESS_END
|
|
||||||
GLU_ERROR* = GLU_TESS_ERROR
|
|
||||||
GLU_EDGE_FLAG* = GLU_TESS_EDGE_FLAG
|
|
||||||
|
|
||||||
{.pop.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,438 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Adaption of the delphi3d.net OpenGL units to FreePascal
|
|
||||||
# Sebastian Guenther (sg@freepascal.org) in 2002
|
|
||||||
# These units are free to use
|
|
||||||
#
|
|
||||||
|
|
||||||
# Copyright (c) Mark J. Kilgard, 1994, 1995, 1996.
|
|
||||||
# This program is freely distributable without licensing fees and is
|
|
||||||
# provided without guarantee or warrantee expressed or implied. This
|
|
||||||
# program is -not- in the public domain.
|
|
||||||
#******************************************************************************
|
|
||||||
# Converted to Delphi by Tom Nuydens (tom@delphi3d.net)
|
|
||||||
# Contributions by Igor Karpov (glygrik@hotbox.ru)
|
|
||||||
# For the latest updates, visit Delphi3D: http://www.delphi3d.net
|
|
||||||
#******************************************************************************
|
|
||||||
|
|
||||||
import
|
|
||||||
GL
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
const
|
|
||||||
dllname = "glut32.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
dllname = "/System/Library/Frameworks/GLUT.framework/GLUT"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
dllname = "libglut.so.3"
|
|
||||||
type
|
|
||||||
TGlutVoidCallback* = proc (){.cdecl.}
|
|
||||||
TGlut1IntCallback* = proc (value: cint){.cdecl.}
|
|
||||||
TGlut2IntCallback* = proc (v1, v2: cint){.cdecl.}
|
|
||||||
TGlut3IntCallback* = proc (v1, v2, v3: cint){.cdecl.}
|
|
||||||
TGlut4IntCallback* = proc (v1, v2, v3, v4: cint){.cdecl.}
|
|
||||||
TGlut1Char2IntCallback* = proc (c: int8, v1, v2: cint){.cdecl.}
|
|
||||||
TGlut1UInt3IntCallback* = proc (u, v1, v2, v3: cint){.cdecl.}
|
|
||||||
|
|
||||||
const
|
|
||||||
GLUT_API_VERSION* = 3
|
|
||||||
GLUT_XLIB_IMPLEMENTATION* = 12 # Display mode bit masks.
|
|
||||||
GLUT_RGB* = 0
|
|
||||||
GLUT_RGBA* = GLUT_RGB
|
|
||||||
GLUT_INDEX* = 1
|
|
||||||
GLUT_SINGLE* = 0
|
|
||||||
GLUT_DOUBLE* = 2
|
|
||||||
GLUT_ACCUM* = 4
|
|
||||||
GLUT_ALPHA* = 8
|
|
||||||
GLUT_DEPTH* = 16
|
|
||||||
GLUT_STENCIL* = 32
|
|
||||||
GLUT_MULTISAMPLE* = 128
|
|
||||||
GLUT_STEREO* = 256
|
|
||||||
GLUT_LUMINANCE* = 512 # Mouse buttons.
|
|
||||||
GLUT_LEFT_BUTTON* = 0
|
|
||||||
GLUT_MIDDLE_BUTTON* = 1
|
|
||||||
GLUT_RIGHT_BUTTON* = 2 # Mouse button state.
|
|
||||||
GLUT_DOWN* = 0
|
|
||||||
GLUT_UP* = 1 # function keys
|
|
||||||
GLUT_KEY_F1* = 1
|
|
||||||
GLUT_KEY_F2* = 2
|
|
||||||
GLUT_KEY_F3* = 3
|
|
||||||
GLUT_KEY_F4* = 4
|
|
||||||
GLUT_KEY_F5* = 5
|
|
||||||
GLUT_KEY_F6* = 6
|
|
||||||
GLUT_KEY_F7* = 7
|
|
||||||
GLUT_KEY_F8* = 8
|
|
||||||
GLUT_KEY_F9* = 9
|
|
||||||
GLUT_KEY_F10* = 10
|
|
||||||
GLUT_KEY_F11* = 11
|
|
||||||
GLUT_KEY_F12* = 12 # directional keys
|
|
||||||
GLUT_KEY_LEFT* = 100
|
|
||||||
GLUT_KEY_UP* = 101
|
|
||||||
GLUT_KEY_RIGHT* = 102
|
|
||||||
GLUT_KEY_DOWN* = 103
|
|
||||||
GLUT_KEY_PAGE_UP* = 104
|
|
||||||
GLUT_KEY_PAGE_DOWN* = 105
|
|
||||||
GLUT_KEY_HOME* = 106
|
|
||||||
GLUT_KEY_END* = 107
|
|
||||||
GLUT_KEY_INSERT* = 108 # Entry/exit state.
|
|
||||||
GLUT_LEFT* = 0
|
|
||||||
GLUT_ENTERED* = 1 # Menu usage state.
|
|
||||||
GLUT_MENU_NOT_IN_USE* = 0
|
|
||||||
GLUT_MENU_IN_USE* = 1 # Visibility state.
|
|
||||||
GLUT_NOT_VISIBLE* = 0
|
|
||||||
GLUT_VISIBLE* = 1 # Window status state.
|
|
||||||
GLUT_HIDDEN* = 0
|
|
||||||
GLUT_FULLY_RETAINED* = 1
|
|
||||||
GLUT_PARTIALLY_RETAINED* = 2
|
|
||||||
GLUT_FULLY_COVERED* = 3 # Color index component selection values.
|
|
||||||
GLUT_RED* = 0
|
|
||||||
GLUT_GREEN* = 1
|
|
||||||
GLUT_BLUE* = 2 # Layers for use.
|
|
||||||
GLUT_NORMAL* = 0
|
|
||||||
GLUT_OVERLAY* = 1
|
|
||||||
|
|
||||||
when defined(Windows):
|
|
||||||
const # Stroke font constants (use these in GLUT program).
|
|
||||||
GLUT_STROKE_ROMAN* = cast[Pointer](0)
|
|
||||||
GLUT_STROKE_MONO_ROMAN* = cast[Pointer](1) # Bitmap font constants (use these in GLUT program).
|
|
||||||
GLUT_BITMAP_9_BY_15* = cast[Pointer](2)
|
|
||||||
GLUT_BITMAP_8_BY_13* = cast[Pointer](3)
|
|
||||||
GLUT_BITMAP_TIMES_ROMAN_10* = cast[Pointer](4)
|
|
||||||
GLUT_BITMAP_TIMES_ROMAN_24* = cast[Pointer](5)
|
|
||||||
GLUT_BITMAP_HELVETICA_10* = cast[Pointer](6)
|
|
||||||
GLUT_BITMAP_HELVETICA_12* = cast[Pointer](7)
|
|
||||||
GLUT_BITMAP_HELVETICA_18* = cast[Pointer](8)
|
|
||||||
else:
|
|
||||||
var # Stroke font constants (use these in GLUT program).
|
|
||||||
GLUT_STROKE_ROMAN*: Pointer
|
|
||||||
GLUT_STROKE_MONO_ROMAN*: Pointer # Bitmap font constants (use these in GLUT program).
|
|
||||||
GLUT_BITMAP_9_BY_15*: Pointer
|
|
||||||
GLUT_BITMAP_8_BY_13*: Pointer
|
|
||||||
GLUT_BITMAP_TIMES_ROMAN_10*: Pointer
|
|
||||||
GLUT_BITMAP_TIMES_ROMAN_24*: Pointer
|
|
||||||
GLUT_BITMAP_HELVETICA_10*: Pointer
|
|
||||||
GLUT_BITMAP_HELVETICA_12*: Pointer
|
|
||||||
GLUT_BITMAP_HELVETICA_18*: Pointer
|
|
||||||
const # glutGet parameters.
|
|
||||||
GLUT_WINDOW_X* = 100
|
|
||||||
GLUT_WINDOW_Y* = 101
|
|
||||||
GLUT_WINDOW_WIDTH* = 102
|
|
||||||
GLUT_WINDOW_HEIGHT* = 103
|
|
||||||
GLUT_WINDOW_BUFFER_SIZE* = 104
|
|
||||||
GLUT_WINDOW_STENCIL_SIZE* = 105
|
|
||||||
GLUT_WINDOW_DEPTH_SIZE* = 106
|
|
||||||
GLUT_WINDOW_RED_SIZE* = 107
|
|
||||||
GLUT_WINDOW_GREEN_SIZE* = 108
|
|
||||||
GLUT_WINDOW_BLUE_SIZE* = 109
|
|
||||||
GLUT_WINDOW_ALPHA_SIZE* = 110
|
|
||||||
GLUT_WINDOW_ACCUM_RED_SIZE* = 111
|
|
||||||
GLUT_WINDOW_ACCUM_GREEN_SIZE* = 112
|
|
||||||
GLUT_WINDOW_ACCUM_BLUE_SIZE* = 113
|
|
||||||
GLUT_WINDOW_ACCUM_ALPHA_SIZE* = 114
|
|
||||||
GLUT_WINDOW_DOUBLEBUFFER* = 115
|
|
||||||
GLUT_WINDOW_RGBA* = 116
|
|
||||||
GLUT_WINDOW_PARENT* = 117
|
|
||||||
GLUT_WINDOW_NUM_CHILDREN* = 118
|
|
||||||
GLUT_WINDOW_COLORMAP_SIZE* = 119
|
|
||||||
GLUT_WINDOW_NUM_SAMPLES* = 120
|
|
||||||
GLUT_WINDOW_STEREO* = 121
|
|
||||||
GLUT_WINDOW_CURSOR* = 122
|
|
||||||
GLUT_SCREEN_WIDTH* = 200
|
|
||||||
GLUT_SCREEN_HEIGHT* = 201
|
|
||||||
GLUT_SCREEN_WIDTH_MM* = 202
|
|
||||||
GLUT_SCREEN_HEIGHT_MM* = 203
|
|
||||||
GLUT_MENU_NUM_ITEMS* = 300
|
|
||||||
GLUT_DISPLAY_MODE_POSSIBLE* = 400
|
|
||||||
GLUT_INIT_WINDOW_X* = 500
|
|
||||||
GLUT_INIT_WINDOW_Y* = 501
|
|
||||||
GLUT_INIT_WINDOW_WIDTH* = 502
|
|
||||||
GLUT_INIT_WINDOW_HEIGHT* = 503
|
|
||||||
constGLUT_INIT_DISPLAY_MODE* = 504
|
|
||||||
GLUT_ELAPSED_TIME* = 700
|
|
||||||
GLUT_WINDOW_FORMAT_ID* = 123 # glutDeviceGet parameters.
|
|
||||||
GLUT_HAS_KEYBOARD* = 600
|
|
||||||
GLUT_HAS_MOUSE* = 601
|
|
||||||
GLUT_HAS_SPACEBALL* = 602
|
|
||||||
GLUT_HAS_DIAL_AND_BUTTON_BOX* = 603
|
|
||||||
GLUT_HAS_TABLET* = 604
|
|
||||||
GLUT_NUM_MOUSE_BUTTONS* = 605
|
|
||||||
GLUT_NUM_SPACEBALL_BUTTONS* = 606
|
|
||||||
GLUT_NUM_BUTTON_BOX_BUTTONS* = 607
|
|
||||||
GLUT_NUM_DIALS* = 608
|
|
||||||
GLUT_NUM_TABLET_BUTTONS* = 609
|
|
||||||
GLUT_DEVICE_IGNORE_KEY_REPEAT* = 610
|
|
||||||
GLUT_DEVICE_KEY_REPEAT* = 611
|
|
||||||
GLUT_HAS_JOYSTICK* = 612
|
|
||||||
GLUT_OWNS_JOYSTICK* = 613
|
|
||||||
GLUT_JOYSTICK_BUTTONS* = 614
|
|
||||||
GLUT_JOYSTICK_AXES* = 615
|
|
||||||
GLUT_JOYSTICK_POLL_RATE* = 616 # glutLayerGet parameters.
|
|
||||||
GLUT_OVERLAY_POSSIBLE* = 800
|
|
||||||
GLUT_LAYER_IN_USE* = 801
|
|
||||||
GLUT_HAS_OVERLAY* = 802
|
|
||||||
GLUT_TRANSPARENT_INDEX* = 803
|
|
||||||
GLUT_NORMAL_DAMAGED* = 804
|
|
||||||
GLUT_OVERLAY_DAMAGED* = 805 # glutVideoResizeGet parameters.
|
|
||||||
GLUT_VIDEO_RESIZE_POSSIBLE* = 900
|
|
||||||
GLUT_VIDEO_RESIZE_IN_USE* = 901
|
|
||||||
GLUT_VIDEO_RESIZE_X_DELTA* = 902
|
|
||||||
GLUT_VIDEO_RESIZE_Y_DELTA* = 903
|
|
||||||
GLUT_VIDEO_RESIZE_WIDTH_DELTA* = 904
|
|
||||||
GLUT_VIDEO_RESIZE_HEIGHT_DELTA* = 905
|
|
||||||
GLUT_VIDEO_RESIZE_X* = 906
|
|
||||||
GLUT_VIDEO_RESIZE_Y* = 907
|
|
||||||
GLUT_VIDEO_RESIZE_WIDTH* = 908
|
|
||||||
GLUT_VIDEO_RESIZE_HEIGHT* = 909 # glutGetModifiers return mask.
|
|
||||||
GLUT_ACTIVE_SHIFT* = 1
|
|
||||||
GLUT_ACTIVE_CTRL* = 2
|
|
||||||
GLUT_ACTIVE_ALT* = 4 # glutSetCursor parameters.
|
|
||||||
# Basic arrows.
|
|
||||||
GLUT_CURSOR_RIGHT_ARROW* = 0
|
|
||||||
GLUT_CURSOR_LEFT_ARROW* = 1 # Symbolic cursor shapes.
|
|
||||||
GLUT_CURSOR_INFO* = 2
|
|
||||||
GLUT_CURSOR_DESTROY* = 3
|
|
||||||
GLUT_CURSOR_HELP* = 4
|
|
||||||
GLUT_CURSOR_CYCLE* = 5
|
|
||||||
GLUT_CURSOR_SPRAY* = 6
|
|
||||||
GLUT_CURSOR_WAIT* = 7
|
|
||||||
GLUT_CURSOR_TEXT* = 8
|
|
||||||
GLUT_CURSOR_CROSSHAIR* = 9 # Directional cursors.
|
|
||||||
GLUT_CURSOR_UP_DOWN* = 10
|
|
||||||
GLUT_CURSOR_LEFT_RIGHT* = 11 # Sizing cursors.
|
|
||||||
GLUT_CURSOR_TOP_SIDE* = 12
|
|
||||||
GLUT_CURSOR_BOTTOM_SIDE* = 13
|
|
||||||
GLUT_CURSOR_LEFT_SIDE* = 14
|
|
||||||
GLUT_CURSOR_RIGHT_SIDE* = 15
|
|
||||||
GLUT_CURSOR_TOP_LEFT_CORNER* = 16
|
|
||||||
GLUT_CURSOR_TOP_RIGHT_CORNER* = 17
|
|
||||||
GLUT_CURSOR_BOTTOM_RIGHT_CORNER* = 18
|
|
||||||
GLUT_CURSOR_BOTTOM_LEFT_CORNER* = 19 # Inherit from parent window.
|
|
||||||
GLUT_CURSOR_INHERIT* = 100 # Blank cursor.
|
|
||||||
GLUT_CURSOR_NONE* = 101 # Fullscreen crosshair (if available).
|
|
||||||
GLUT_CURSOR_FULL_CROSSHAIR* = 102 # GLUT device control sub-API.
|
|
||||||
# glutSetKeyRepeat modes.
|
|
||||||
GLUT_KEY_REPEAT_OFF* = 0
|
|
||||||
GLUT_KEY_REPEAT_ON* = 1
|
|
||||||
GLUT_KEY_REPEAT_DEFAULT* = 2 # Joystick button masks.
|
|
||||||
GLUT_JOYSTICK_BUTTON_A* = 1
|
|
||||||
GLUT_JOYSTICK_BUTTON_B* = 2
|
|
||||||
GLUT_JOYSTICK_BUTTON_C* = 4
|
|
||||||
GLUT_JOYSTICK_BUTTON_D* = 8 # GLUT game mode sub-API.
|
|
||||||
# glutGameModeGet.
|
|
||||||
GLUT_GAME_MODE_ACTIVE* = 0
|
|
||||||
GLUT_GAME_MODE_POSSIBLE* = 1
|
|
||||||
GLUT_GAME_MODE_WIDTH* = 2
|
|
||||||
GLUT_GAME_MODE_HEIGHT* = 3
|
|
||||||
GLUT_GAME_MODE_PIXEL_DEPTH* = 4
|
|
||||||
GLUT_GAME_MODE_REFRESH_RATE* = 5
|
|
||||||
GLUT_GAME_MODE_DISPLAY_CHANGED* = 6 # GLUT initialization sub-API.
|
|
||||||
|
|
||||||
proc glutInit*(argcp: ptr cint, argv: pointer){.dynlib: dllname,
|
|
||||||
importc: "glutInit".}
|
|
||||||
|
|
||||||
proc glutInit*() =
|
|
||||||
## version that passes `argc` and `argc` implicitely.
|
|
||||||
var
|
|
||||||
cmdLine {.importc: "cmdLine".}: array[0..255, cstring]
|
|
||||||
cmdCount {.importc: "cmdCount".}: cint
|
|
||||||
glutInit(addr(cmdCount), addr(cmdLine))
|
|
||||||
|
|
||||||
proc glutInitDisplayMode*(mode: int16){.dynlib: dllname,
|
|
||||||
importc: "glutInitDisplayMode".}
|
|
||||||
proc glutInitDisplayString*(str: cstring){.dynlib: dllname,
|
|
||||||
importc: "glutInitDisplayString".}
|
|
||||||
proc glutInitWindowPosition*(x, y: int){.dynlib: dllname,
|
|
||||||
importc: "glutInitWindowPosition".}
|
|
||||||
proc glutInitWindowSize*(width, height: int){.dynlib: dllname,
|
|
||||||
importc: "glutInitWindowSize".}
|
|
||||||
proc glutMainLoop*(){.dynlib: dllname, importc: "glutMainLoop".}
|
|
||||||
# GLUT window sub-API.
|
|
||||||
proc glutCreateWindow*(title: cstring): int{.dynlib: dllname,
|
|
||||||
importc: "glutCreateWindow".}
|
|
||||||
proc glutCreateSubWindow*(win, x, y, width, height: int): int{.dynlib: dllname,
|
|
||||||
importc: "glutCreateSubWindow".}
|
|
||||||
proc glutDestroyWindow*(win: int){.dynlib: dllname, importc: "glutDestroyWindow".}
|
|
||||||
proc glutPostRedisplay*(){.dynlib: dllname, importc: "glutPostRedisplay".}
|
|
||||||
proc glutPostWindowRedisplay*(win: int){.dynlib: dllname,
|
|
||||||
importc: "glutPostWindowRedisplay".}
|
|
||||||
proc glutSwapBuffers*(){.dynlib: dllname, importc: "glutSwapBuffers".}
|
|
||||||
proc glutGetWindow*(): int{.dynlib: dllname, importc: "glutGetWindow".}
|
|
||||||
proc glutSetWindow*(win: int){.dynlib: dllname, importc: "glutSetWindow".}
|
|
||||||
proc glutSetWindowTitle*(title: cstring){.dynlib: dllname,
|
|
||||||
importc: "glutSetWindowTitle".}
|
|
||||||
proc glutSetIconTitle*(title: cstring){.dynlib: dllname,
|
|
||||||
importc: "glutSetIconTitle".}
|
|
||||||
proc glutPositionWindow*(x, y: int){.dynlib: dllname,
|
|
||||||
importc: "glutPositionWindow".}
|
|
||||||
proc glutReshapeWindow*(width, height: int){.dynlib: dllname,
|
|
||||||
importc: "glutReshapeWindow".}
|
|
||||||
proc glutPopWindow*(){.dynlib: dllname, importc: "glutPopWindow".}
|
|
||||||
proc glutPushWindow*(){.dynlib: dllname, importc: "glutPushWindow".}
|
|
||||||
proc glutIconifyWindow*(){.dynlib: dllname, importc: "glutIconifyWindow".}
|
|
||||||
proc glutShowWindow*(){.dynlib: dllname, importc: "glutShowWindow".}
|
|
||||||
proc glutHideWindow*(){.dynlib: dllname, importc: "glutHideWindow".}
|
|
||||||
proc glutFullScreen*(){.dynlib: dllname, importc: "glutFullScreen".}
|
|
||||||
proc glutSetCursor*(cursor: int){.dynlib: dllname, importc: "glutSetCursor".}
|
|
||||||
proc glutWarpPointer*(x, y: int){.dynlib: dllname, importc: "glutWarpPointer".}
|
|
||||||
# GLUT overlay sub-API.
|
|
||||||
proc glutEstablishOverlay*(){.dynlib: dllname, importc: "glutEstablishOverlay".}
|
|
||||||
proc glutRemoveOverlay*(){.dynlib: dllname, importc: "glutRemoveOverlay".}
|
|
||||||
proc glutUseLayer*(layer: TGLenum){.dynlib: dllname, importc: "glutUseLayer".}
|
|
||||||
proc glutPostOverlayRedisplay*(){.dynlib: dllname,
|
|
||||||
importc: "glutPostOverlayRedisplay".}
|
|
||||||
proc glutPostWindowOverlayRedisplay*(win: int){.dynlib: dllname,
|
|
||||||
importc: "glutPostWindowOverlayRedisplay".}
|
|
||||||
proc glutShowOverlay*(){.dynlib: dllname, importc: "glutShowOverlay".}
|
|
||||||
proc glutHideOverlay*(){.dynlib: dllname, importc: "glutHideOverlay".}
|
|
||||||
# GLUT menu sub-API.
|
|
||||||
proc glutCreateMenu*(callback: TGlut1IntCallback): int{.dynlib: dllname,
|
|
||||||
importc: "glutCreateMenu".}
|
|
||||||
proc glutDestroyMenu*(menu: int){.dynlib: dllname, importc: "glutDestroyMenu".}
|
|
||||||
proc glutGetMenu*(): int{.dynlib: dllname, importc: "glutGetMenu".}
|
|
||||||
proc glutSetMenu*(menu: int){.dynlib: dllname, importc: "glutSetMenu".}
|
|
||||||
proc glutAddMenuEntry*(caption: cstring, value: int){.dynlib: dllname,
|
|
||||||
importc: "glutAddMenuEntry".}
|
|
||||||
proc glutAddSubMenu*(caption: cstring, submenu: int){.dynlib: dllname,
|
|
||||||
importc: "glutAddSubMenu".}
|
|
||||||
proc glutChangeToMenuEntry*(item: int, caption: cstring, value: int){.
|
|
||||||
dynlib: dllname, importc: "glutChangeToMenuEntry".}
|
|
||||||
proc glutChangeToSubMenu*(item: int, caption: cstring, submenu: int){.
|
|
||||||
dynlib: dllname, importc: "glutChangeToSubMenu".}
|
|
||||||
proc glutRemoveMenuItem*(item: int){.dynlib: dllname,
|
|
||||||
importc: "glutRemoveMenuItem".}
|
|
||||||
proc glutAttachMenu*(button: int){.dynlib: dllname, importc: "glutAttachMenu".}
|
|
||||||
proc glutDetachMenu*(button: int){.dynlib: dllname, importc: "glutDetachMenu".}
|
|
||||||
# GLUT window callback sub-API.
|
|
||||||
proc glutDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname,
|
|
||||||
importc: "glutDisplayFunc".}
|
|
||||||
proc glutReshapeFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutReshapeFunc".}
|
|
||||||
proc glutKeyboardFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutKeyboardFunc".}
|
|
||||||
proc glutMouseFunc*(f: TGlut4IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutMouseFunc".}
|
|
||||||
proc glutMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutMotionFunc".}
|
|
||||||
proc glutPassiveMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutPassiveMotionFunc".}
|
|
||||||
proc glutEntryFunc*(f: TGlut1IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutEntryFunc".}
|
|
||||||
proc glutVisibilityFunc*(f: TGlut1IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutVisibilityFunc".}
|
|
||||||
proc glutIdleFunc*(f: TGlutVoidCallback){.dynlib: dllname,
|
|
||||||
importc: "glutIdleFunc".}
|
|
||||||
proc glutTimerFunc*(millis: int16, f: TGlut1IntCallback, value: int){.
|
|
||||||
dynlib: dllname, importc: "glutTimerFunc".}
|
|
||||||
proc glutMenuStateFunc*(f: TGlut1IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutMenuStateFunc".}
|
|
||||||
proc glutSpecialFunc*(f: TGlut3IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutSpecialFunc".}
|
|
||||||
proc glutSpaceballMotionFunc*(f: TGlut3IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutSpaceballMotionFunc".}
|
|
||||||
proc glutSpaceballRotateFunc*(f: TGlut3IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutSpaceballRotateFunc".}
|
|
||||||
proc glutSpaceballButtonFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutSpaceballButtonFunc".}
|
|
||||||
proc glutButtonBoxFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutButtonBoxFunc".}
|
|
||||||
proc glutDialsFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutDialsFunc".}
|
|
||||||
proc glutTabletMotionFunc*(f: TGlut2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutTabletMotionFunc".}
|
|
||||||
proc glutTabletButtonFunc*(f: TGlut4IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutTabletButtonFunc".}
|
|
||||||
proc glutMenuStatusFunc*(f: TGlut3IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutMenuStatusFunc".}
|
|
||||||
proc glutOverlayDisplayFunc*(f: TGlutVoidCallback){.dynlib: dllname,
|
|
||||||
importc: "glutOverlayDisplayFunc".}
|
|
||||||
proc glutWindowStatusFunc*(f: TGlut1IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutWindowStatusFunc".}
|
|
||||||
proc glutKeyboardUpFunc*(f: TGlut1Char2IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutKeyboardUpFunc".}
|
|
||||||
proc glutSpecialUpFunc*(f: TGlut3IntCallback){.dynlib: dllname,
|
|
||||||
importc: "glutSpecialUpFunc".}
|
|
||||||
proc glutJoystickFunc*(f: TGlut1UInt3IntCallback, pollInterval: int){.
|
|
||||||
dynlib: dllname, importc: "glutJoystickFunc".}
|
|
||||||
# GLUT color index sub-API.
|
|
||||||
proc glutSetColor*(cell: int, red, green, blue: TGLfloat){.dynlib: dllname,
|
|
||||||
importc: "glutSetColor".}
|
|
||||||
proc glutGetColor*(ndx, component: int): TGLfloat{.dynlib: dllname,
|
|
||||||
importc: "glutGetColor".}
|
|
||||||
proc glutCopyColormap*(win: int){.dynlib: dllname, importc: "glutCopyColormap".}
|
|
||||||
# GLUT state retrieval sub-API.
|
|
||||||
proc glutGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutGet".}
|
|
||||||
proc glutDeviceGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutDeviceGet".}
|
|
||||||
# GLUT extension support sub-API
|
|
||||||
proc glutExtensionSupported*(name: cstring): int{.dynlib: dllname,
|
|
||||||
importc: "glutExtensionSupported".}
|
|
||||||
proc glutGetModifiers*(): int{.dynlib: dllname, importc: "glutGetModifiers".}
|
|
||||||
proc glutLayerGet*(t: TGLenum): int{.dynlib: dllname, importc: "glutLayerGet".}
|
|
||||||
# GLUT font sub-API
|
|
||||||
proc glutBitmapCharacter*(font: pointer, character: int){.dynlib: dllname,
|
|
||||||
importc: "glutBitmapCharacter".}
|
|
||||||
proc glutBitmapWidth*(font: pointer, character: int): int{.dynlib: dllname,
|
|
||||||
importc: "glutBitmapWidth".}
|
|
||||||
proc glutStrokeCharacter*(font: pointer, character: int){.dynlib: dllname,
|
|
||||||
importc: "glutStrokeCharacter".}
|
|
||||||
proc glutStrokeWidth*(font: pointer, character: int): int{.dynlib: dllname,
|
|
||||||
importc: "glutStrokeWidth".}
|
|
||||||
proc glutBitmapLength*(font: pointer, str: cstring): int{.dynlib: dllname,
|
|
||||||
importc: "glutBitmapLength".}
|
|
||||||
proc glutStrokeLength*(font: pointer, str: cstring): int{.dynlib: dllname,
|
|
||||||
importc: "glutStrokeLength".}
|
|
||||||
# GLUT pre-built models sub-API
|
|
||||||
proc glutWireSphere*(radius: TGLdouble, slices, stacks: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutWireSphere".}
|
|
||||||
proc glutSolidSphere*(radius: TGLdouble, slices, stacks: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutSolidSphere".}
|
|
||||||
proc glutWireCone*(base, height: TGLdouble, slices, stacks: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutWireCone".}
|
|
||||||
proc glutSolidCone*(base, height: TGLdouble, slices, stacks: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutSolidCone".}
|
|
||||||
proc glutWireCube*(size: TGLdouble){.dynlib: dllname, importc: "glutWireCube".}
|
|
||||||
proc glutSolidCube*(size: TGLdouble){.dynlib: dllname, importc: "glutSolidCube".}
|
|
||||||
proc glutWireTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutWireTorus".}
|
|
||||||
proc glutSolidTorus*(innerRadius, outerRadius: TGLdouble, sides, rings: TGLint){.
|
|
||||||
dynlib: dllname, importc: "glutSolidTorus".}
|
|
||||||
proc glutWireDodecahedron*(){.dynlib: dllname, importc: "glutWireDodecahedron".}
|
|
||||||
proc glutSolidDodecahedron*(){.dynlib: dllname, importc: "glutSolidDodecahedron".}
|
|
||||||
proc glutWireTeapot*(size: TGLdouble){.dynlib: dllname,
|
|
||||||
importc: "glutWireTeapot".}
|
|
||||||
proc glutSolidTeapot*(size: TGLdouble){.dynlib: dllname,
|
|
||||||
importc: "glutSolidTeapot".}
|
|
||||||
proc glutWireOctahedron*(){.dynlib: dllname, importc: "glutWireOctahedron".}
|
|
||||||
proc glutSolidOctahedron*(){.dynlib: dllname, importc: "glutSolidOctahedron".}
|
|
||||||
proc glutWireTetrahedron*(){.dynlib: dllname, importc: "glutWireTetrahedron".}
|
|
||||||
proc glutSolidTetrahedron*(){.dynlib: dllname, importc: "glutSolidTetrahedron".}
|
|
||||||
proc glutWireIcosahedron*(){.dynlib: dllname, importc: "glutWireIcosahedron".}
|
|
||||||
proc glutSolidIcosahedron*(){.dynlib: dllname, importc: "glutSolidIcosahedron".}
|
|
||||||
# GLUT video resize sub-API.
|
|
||||||
proc glutVideoResizeGet*(param: TGLenum): int{.dynlib: dllname,
|
|
||||||
importc: "glutVideoResizeGet".}
|
|
||||||
proc glutSetupVideoResizing*(){.dynlib: dllname,
|
|
||||||
importc: "glutSetupVideoResizing".}
|
|
||||||
proc glutStopVideoResizing*(){.dynlib: dllname, importc: "glutStopVideoResizing".}
|
|
||||||
proc glutVideoResize*(x, y, width, height: int){.dynlib: dllname,
|
|
||||||
importc: "glutVideoResize".}
|
|
||||||
proc glutVideoPan*(x, y, width, height: int){.dynlib: dllname,
|
|
||||||
importc: "glutVideoPan".}
|
|
||||||
# GLUT debugging sub-API.
|
|
||||||
proc glutReportErrors*(){.dynlib: dllname, importc: "glutReportErrors".}
|
|
||||||
# GLUT device control sub-API.
|
|
||||||
proc glutIgnoreKeyRepeat*(ignore: int){.dynlib: dllname,
|
|
||||||
importc: "glutIgnoreKeyRepeat".}
|
|
||||||
proc glutSetKeyRepeat*(repeatMode: int){.dynlib: dllname,
|
|
||||||
importc: "glutSetKeyRepeat".}
|
|
||||||
proc glutForceJoystickFunc*(){.dynlib: dllname, importc: "glutForceJoystickFunc".}
|
|
||||||
# GLUT game mode sub-API.
|
|
||||||
#example glutGameModeString('1280x1024:32@75');
|
|
||||||
proc glutGameModeString*(AString: cstring){.dynlib: dllname,
|
|
||||||
importc: "glutGameModeString".}
|
|
||||||
proc glutEnterGameMode*(): int{.dynlib: dllname, importc: "glutEnterGameMode".}
|
|
||||||
proc glutLeaveGameMode*(){.dynlib: dllname, importc: "glutLeaveGameMode".}
|
|
||||||
proc glutGameModeGet*(mode: TGLenum): int{.dynlib: dllname,
|
|
||||||
importc: "glutGameModeGet".}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Translation of the Mesa GLX headers for FreePascal
|
|
||||||
# Copyright (C) 1999 Sebastian Guenther
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Mesa 3-D graphics library
|
|
||||||
# Version: 3.0
|
|
||||||
# Copyright (C) 1995-1998 Brian Paul
|
|
||||||
#
|
|
||||||
# This library is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU Library General Public
|
|
||||||
# License as published by the Free Software Foundation; either
|
|
||||||
# version 2 of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This library is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Library General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Library General Public
|
|
||||||
# License along with this library; if not, write to the Free
|
|
||||||
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
X, XLib, XUtil, gl
|
|
||||||
|
|
||||||
when defined(windows):
|
|
||||||
const
|
|
||||||
dllname = "GL.dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
dllname = "/usr/X11R6/lib/libGL.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
dllname = "libGL.so"
|
|
||||||
const
|
|
||||||
GLX_USE_GL* = 1'i32
|
|
||||||
GLX_BUFFER_SIZE* = 2'i32
|
|
||||||
GLX_LEVEL* = 3'i32
|
|
||||||
GLX_RGBA* = 4'i32
|
|
||||||
GLX_DOUBLEBUFFER* = 5'i32
|
|
||||||
GLX_STEREO* = 6'i32
|
|
||||||
GLX_AUX_BUFFERS* = 7'i32
|
|
||||||
GLX_RED_SIZE* = 8'i32
|
|
||||||
GLX_GREEN_SIZE* = 9'i32
|
|
||||||
GLX_BLUE_SIZE* = 10'i32
|
|
||||||
GLX_ALPHA_SIZE* = 11'i32
|
|
||||||
GLX_DEPTH_SIZE* = 12'i32
|
|
||||||
GLX_STENCIL_SIZE* = 13'i32
|
|
||||||
GLX_ACCUM_RED_SIZE* = 14'i32
|
|
||||||
GLX_ACCUM_GREEN_SIZE* = 15'i32
|
|
||||||
GLX_ACCUM_BLUE_SIZE* = 16'i32
|
|
||||||
GLX_ACCUM_ALPHA_SIZE* = 17'i32 # GLX_EXT_visual_info extension
|
|
||||||
GLX_X_VISUAL_TYPE_EXT* = 0x00000022
|
|
||||||
GLX_TRANSPARENT_TYPE_EXT* = 0x00000023
|
|
||||||
GLX_TRANSPARENT_INDEX_VALUE_EXT* = 0x00000024
|
|
||||||
GLX_TRANSPARENT_RED_VALUE_EXT* = 0x00000025
|
|
||||||
GLX_TRANSPARENT_GREEN_VALUE_EXT* = 0x00000026
|
|
||||||
GLX_TRANSPARENT_BLUE_VALUE_EXT* = 0x00000027
|
|
||||||
GLX_TRANSPARENT_ALPHA_VALUE_EXT* = 0x00000028 # Error codes returned by glXGetConfig:
|
|
||||||
GLX_BAD_SCREEN* = 1
|
|
||||||
GLX_BAD_ATTRIBUTE* = 2
|
|
||||||
GLX_NO_EXTENSION* = 3
|
|
||||||
GLX_BAD_VISUAL* = 4
|
|
||||||
GLX_BAD_CONTEXT* = 5
|
|
||||||
GLX_BAD_VALUE* = 6
|
|
||||||
GLX_BAD_ENUM* = 7 # GLX 1.1 and later:
|
|
||||||
GLX_VENDOR* = 1
|
|
||||||
GLX_VERSION* = 2
|
|
||||||
GLX_EXTENSIONS* = 3 # GLX_visual_info extension
|
|
||||||
GLX_TRUE_COLOR_EXT* = 0x00008002
|
|
||||||
GLX_DIRECT_COLOR_EXT* = 0x00008003
|
|
||||||
GLX_PSEUDO_COLOR_EXT* = 0x00008004
|
|
||||||
GLX_STATIC_COLOR_EXT* = 0x00008005
|
|
||||||
GLX_GRAY_SCALE_EXT* = 0x00008006
|
|
||||||
GLX_STATIC_GRAY_EXT* = 0x00008007
|
|
||||||
GLX_NONE_EXT* = 0x00008000
|
|
||||||
GLX_TRANSPARENT_RGB_EXT* = 0x00008008
|
|
||||||
GLX_TRANSPARENT_INDEX_EXT* = 0x00008009
|
|
||||||
|
|
||||||
type # From XLib:
|
|
||||||
XPixmap* = TXID
|
|
||||||
XFont* = TXID
|
|
||||||
XColormap* = TXID
|
|
||||||
GLXContext* = Pointer
|
|
||||||
GLXPixmap* = TXID
|
|
||||||
GLXDrawable* = TXID
|
|
||||||
GLXContextID* = TXID
|
|
||||||
TXPixmap* = XPixmap
|
|
||||||
TXFont* = XFont
|
|
||||||
TXColormap* = XColormap
|
|
||||||
TGLXContext* = GLXContext
|
|
||||||
TGLXPixmap* = GLXPixmap
|
|
||||||
TGLXDrawable* = GLXDrawable
|
|
||||||
TGLXContextID* = GLXContextID
|
|
||||||
|
|
||||||
proc glXChooseVisual*(dpy: PDisplay, screen: int, attribList: ptr int32): PXVisualInfo{.
|
|
||||||
cdecl, dynlib: dllname, importc: "glXChooseVisual".}
|
|
||||||
proc glXCreateContext*(dpy: PDisplay, vis: PXVisualInfo, shareList: GLXContext,
|
|
||||||
direct: bool): GLXContext{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXCreateContext".}
|
|
||||||
proc glXDestroyContext*(dpy: PDisplay, ctx: GLXContext){.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXDestroyContext".}
|
|
||||||
proc glXMakeCurrent*(dpy: PDisplay, drawable: GLXDrawable, ctx: GLXContext): bool{.
|
|
||||||
cdecl, dynlib: dllname, importc: "glXMakeCurrent".}
|
|
||||||
proc glXCopyContext*(dpy: PDisplay, src, dst: GLXContext, mask: int32){.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXCopyContext".}
|
|
||||||
proc glXSwapBuffers*(dpy: PDisplay, drawable: GLXDrawable){.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXSwapBuffers".}
|
|
||||||
proc glXCreateGLXPixmap*(dpy: PDisplay, visual: PXVisualInfo, pixmap: XPixmap): GLXPixmap{.
|
|
||||||
cdecl, dynlib: dllname, importc: "glXCreateGLXPixmap".}
|
|
||||||
proc glXDestroyGLXPixmap*(dpy: PDisplay, pixmap: GLXPixmap){.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXDestroyGLXPixmap".}
|
|
||||||
proc glXQueryExtension*(dpy: PDisplay, errorb, event: var int): bool{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXQueryExtension".}
|
|
||||||
proc glXQueryVersion*(dpy: PDisplay, maj, min: var int): bool{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXQueryVersion".}
|
|
||||||
proc glXIsDirect*(dpy: PDisplay, ctx: GLXContext): bool{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXIsDirect".}
|
|
||||||
proc glXGetConfig*(dpy: PDisplay, visual: PXVisualInfo, attrib: int,
|
|
||||||
value: var int): int{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXGetConfig".}
|
|
||||||
proc glXGetCurrentContext*(): GLXContext{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXGetCurrentContext".}
|
|
||||||
proc glXGetCurrentDrawable*(): GLXDrawable{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXGetCurrentDrawable".}
|
|
||||||
proc glXWaitGL*(){.cdecl, dynlib: dllname, importc: "glXWaitGL".}
|
|
||||||
proc glXWaitX*(){.cdecl, dynlib: dllname, importc: "glXWaitX".}
|
|
||||||
proc glXUseXFont*(font: XFont, first, count, list: int){.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXUseXFont".}
|
|
||||||
# GLX 1.1 and later
|
|
||||||
proc glXQueryExtensionsString*(dpy: PDisplay, screen: int): cstring{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXQueryExtensionsString".}
|
|
||||||
proc glXQueryServerString*(dpy: PDisplay, screen, name: int): cstring{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXQueryServerString".}
|
|
||||||
proc glXGetClientString*(dpy: PDisplay, name: int): cstring{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXGetClientString".}
|
|
||||||
# Mesa GLX Extensions
|
|
||||||
proc glXCreateGLXPixmapMESA*(dpy: PDisplay, visual: PXVisualInfo,
|
|
||||||
pixmap: XPixmap, cmap: XColormap): GLXPixmap{.
|
|
||||||
cdecl, dynlib: dllname, importc: "glXCreateGLXPixmapMESA".}
|
|
||||||
proc glXReleaseBufferMESA*(dpy: PDisplay, d: GLXDrawable): bool{.cdecl,
|
|
||||||
dynlib: dllname, importc: "glXReleaseBufferMESA".}
|
|
||||||
proc glXCopySubBufferMESA*(dpy: PDisplay, drawbale: GLXDrawable,
|
|
||||||
x, y, width, height: int){.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXCopySubBufferMESA".}
|
|
||||||
proc glXGetVideoSyncSGI*(counter: var int32): int{.cdecl, dynlib: dllname,
|
|
||||||
importc: "glXGetVideoSyncSGI".}
|
|
||||||
proc glXWaitVideoSyncSGI*(divisor, remainder: int, count: var int32): int{.
|
|
||||||
cdecl, dynlib: dllname, importc: "glXWaitVideoSyncSGI".}
|
|
||||||
# implementation
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,368 +0,0 @@
|
||||||
import
|
|
||||||
gl, windows
|
|
||||||
|
|
||||||
proc wglGetExtensionsStringARB*(hdc: HDC): cstring{.dynlib: dllname,
|
|
||||||
importc: "wglGetExtensionsStringARB".}
|
|
||||||
const
|
|
||||||
WGL_FRONT_COLOR_BUFFER_BIT_ARB* = 0x00000001
|
|
||||||
WGL_BACK_COLOR_BUFFER_BIT_ARB* = 0x00000002
|
|
||||||
WGL_DEPTH_BUFFER_BIT_ARB* = 0x00000004
|
|
||||||
WGL_STENCIL_BUFFER_BIT_ARB* = 0x00000008
|
|
||||||
|
|
||||||
proc WinChoosePixelFormat*(DC: HDC, p2: PPixelFormatDescriptor): int{.
|
|
||||||
dynlib: "gdi32", importc: "ChoosePixelFormat".}
|
|
||||||
proc wglCreateBufferRegionARB*(hDC: HDC, iLayerPlane: TGLint, uType: TGLuint): THandle{.
|
|
||||||
dynlib: dllname, importc: "wglCreateBufferRegionARB".}
|
|
||||||
proc wglDeleteBufferRegionARB*(hRegion: THandle){.dynlib: dllname,
|
|
||||||
importc: "wglDeleteBufferRegionARB".}
|
|
||||||
proc wglSaveBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint,
|
|
||||||
width: TGLint, height: TGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglSaveBufferRegionARB".}
|
|
||||||
proc wglRestoreBufferRegionARB*(hRegion: THandle, x: TGLint, y: TGLint,
|
|
||||||
width: TGLint, height: TGLint, xSrc: TGLint,
|
|
||||||
ySrc: TGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglRestoreBufferRegionARB".}
|
|
||||||
proc wglAllocateMemoryNV*(size: TGLsizei, readFrequency: TGLfloat,
|
|
||||||
writeFrequency: TGLfloat, priority: TGLfloat): PGLvoid{.
|
|
||||||
dynlib: dllname, importc: "wglAllocateMemoryNV".}
|
|
||||||
proc wglFreeMemoryNV*(pointer: PGLvoid){.dynlib: dllname,
|
|
||||||
importc: "wglFreeMemoryNV".}
|
|
||||||
const
|
|
||||||
WGL_IMAGE_BUFFER_MIN_ACCESS_I3D* = 0x00000001
|
|
||||||
WGL_IMAGE_BUFFER_LOCK_I3D* = 0x00000002
|
|
||||||
|
|
||||||
proc wglCreateImageBufferI3D*(hDC: HDC, dwSize: DWORD, uFlags: UINT): PGLvoid{.
|
|
||||||
dynlib: dllname, importc: "wglCreateImageBufferI3D".}
|
|
||||||
proc wglDestroyImageBufferI3D*(hDC: HDC, pAddress: PGLvoid): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglDestroyImageBufferI3D".}
|
|
||||||
proc wglAssociateImageBufferEventsI3D*(hdc: HDC, pEvent: PHandle,
|
|
||||||
pAddress: PGLvoid, pSize: PDWORD,
|
|
||||||
count: UINT): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglAssociateImageBufferEventsI3D".}
|
|
||||||
proc wglReleaseImageBufferEventsI3D*(hdc: HDC, pAddress: PGLvoid, count: UINT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglReleaseImageBufferEventsI3D".}
|
|
||||||
proc wglEnableFrameLockI3D*(): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglEnableFrameLockI3D".}
|
|
||||||
proc wglDisableFrameLockI3D*(): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglDisableFrameLockI3D".}
|
|
||||||
proc wglIsEnabledFrameLockI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglIsEnabledFrameLockI3D".}
|
|
||||||
proc wglQueryFrameLockMasterI3D*(pFlag: PBOOL): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglQueryFrameLockMasterI3D".}
|
|
||||||
proc wglGetFrameUsageI3D*(pUsage: PGLfloat): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGetFrameUsageI3D".}
|
|
||||||
proc wglBeginFrameTrackingI3D*(): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglBeginFrameTrackingI3D".}
|
|
||||||
proc wglEndFrameTrackingI3D*(): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglEndFrameTrackingI3D".}
|
|
||||||
proc wglQueryFrameTrackingI3D*(pFrameCount: PDWORD, pMissedFrames: PDWORD,
|
|
||||||
pLastMissedUsage: PGLfloat): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglQueryFrameTrackingI3D".}
|
|
||||||
const
|
|
||||||
WGL_NUMBER_PIXEL_FORMATS_ARB* = 0x00002000
|
|
||||||
WGL_DRAW_TO_WINDOW_ARB* = 0x00002001
|
|
||||||
WGL_DRAW_TO_BITMAP_ARB* = 0x00002002
|
|
||||||
WGL_ACCELERATION_ARB* = 0x00002003
|
|
||||||
WGL_NEED_PALETTE_ARB* = 0x00002004
|
|
||||||
WGL_NEED_SYSTEM_PALETTE_ARB* = 0x00002005
|
|
||||||
WGL_SWAP_LAYER_BUFFERS_ARB* = 0x00002006
|
|
||||||
WGL_SWAP_METHOD_ARB* = 0x00002007
|
|
||||||
WGL_NUMBER_OVERLAYS_ARB* = 0x00002008
|
|
||||||
WGL_NUMBER_UNDERLAYS_ARB* = 0x00002009
|
|
||||||
WGL_TRANSPARENT_ARB* = 0x0000200A
|
|
||||||
WGL_TRANSPARENT_RED_VALUE_ARB* = 0x00002037
|
|
||||||
WGL_TRANSPARENT_GREEN_VALUE_ARB* = 0x00002038
|
|
||||||
WGL_TRANSPARENT_BLUE_VALUE_ARB* = 0x00002039
|
|
||||||
WGL_TRANSPARENT_ALPHA_VALUE_ARB* = 0x0000203A
|
|
||||||
WGL_TRANSPARENT_INDEX_VALUE_ARB* = 0x0000203B
|
|
||||||
WGL_SHARE_DEPTH_ARB* = 0x0000200C
|
|
||||||
WGL_SHARE_STENCIL_ARB* = 0x0000200D
|
|
||||||
WGL_SHARE_ACCUM_ARB* = 0x0000200E
|
|
||||||
WGL_SUPPORT_GDI_ARB* = 0x0000200F
|
|
||||||
WGL_SUPPORT_OPENGL_ARB* = 0x00002010
|
|
||||||
WGL_DOUBLE_BUFFER_ARB* = 0x00002011
|
|
||||||
WGL_STEREO_ARB* = 0x00002012
|
|
||||||
WGL_PIXEL_TYPE_ARB* = 0x00002013
|
|
||||||
WGL_COLOR_BITS_ARB* = 0x00002014
|
|
||||||
WGL_RED_BITS_ARB* = 0x00002015
|
|
||||||
WGL_RED_SHIFT_ARB* = 0x00002016
|
|
||||||
WGL_GREEN_BITS_ARB* = 0x00002017
|
|
||||||
WGL_GREEN_SHIFT_ARB* = 0x00002018
|
|
||||||
WGL_BLUE_BITS_ARB* = 0x00002019
|
|
||||||
WGL_BLUE_SHIFT_ARB* = 0x0000201A
|
|
||||||
WGL_ALPHA_BITS_ARB* = 0x0000201B
|
|
||||||
WGL_ALPHA_SHIFT_ARB* = 0x0000201C
|
|
||||||
WGL_ACCUM_BITS_ARB* = 0x0000201D
|
|
||||||
WGL_ACCUM_RED_BITS_ARB* = 0x0000201E
|
|
||||||
WGL_ACCUM_GREEN_BITS_ARB* = 0x0000201F
|
|
||||||
WGL_ACCUM_BLUE_BITS_ARB* = 0x00002020
|
|
||||||
WGL_ACCUM_ALPHA_BITS_ARB* = 0x00002021
|
|
||||||
WGL_DEPTH_BITS_ARB* = 0x00002022
|
|
||||||
WGL_STENCIL_BITS_ARB* = 0x00002023
|
|
||||||
WGL_AUX_BUFFERS_ARB* = 0x00002024
|
|
||||||
WGL_NO_ACCELERATION_ARB* = 0x00002025
|
|
||||||
WGL_GENERIC_ACCELERATION_ARB* = 0x00002026
|
|
||||||
WGL_FULL_ACCELERATION_ARB* = 0x00002027
|
|
||||||
WGL_SWAP_EXCHANGE_ARB* = 0x00002028
|
|
||||||
WGL_SWAP_COPY_ARB* = 0x00002029
|
|
||||||
WGL_SWAP_UNDEFINED_ARB* = 0x0000202A
|
|
||||||
WGL_TYPE_RGBA_ARB* = 0x0000202B
|
|
||||||
WGL_TYPE_COLORINDEX_ARB* = 0x0000202C
|
|
||||||
|
|
||||||
proc wglGetPixelFormatAttribivARB*(hdc: HDC, iPixelFormat: TGLint,
|
|
||||||
iLayerPlane: TGLint, nAttributes: TGLuint,
|
|
||||||
piAttributes: PGLint, piValues: PGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetPixelFormatAttribivARB".}
|
|
||||||
proc wglGetPixelFormatAttribfvARB*(hdc: HDC, iPixelFormat: TGLint,
|
|
||||||
iLayerPlane: TGLint, nAttributes: TGLuint,
|
|
||||||
piAttributes: PGLint, pfValues: PGLfloat): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetPixelFormatAttribfvARB".}
|
|
||||||
proc wglChoosePixelFormatARB*(hdc: HDC, piAttribIList: PGLint,
|
|
||||||
pfAttribFList: PGLfloat, nMaxFormats: TGLuint,
|
|
||||||
piFormats: PGLint, nNumFormats: PGLuint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglChoosePixelFormatARB".}
|
|
||||||
const
|
|
||||||
WGL_ERROR_INVALID_PIXEL_TYPE_ARB* = 0x00002043
|
|
||||||
WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB* = 0x00002054
|
|
||||||
|
|
||||||
proc wglMakeContextCurrentARB*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglMakeContextCurrentARB".}
|
|
||||||
proc wglGetCurrentReadDCARB*(): HDC{.dynlib: dllname,
|
|
||||||
importc: "wglGetCurrentReadDCARB".}
|
|
||||||
const
|
|
||||||
WGL_DRAW_TO_PBUFFER_ARB* = 0x0000202D # WGL_DRAW_TO_PBUFFER_ARB { already defined }
|
|
||||||
WGL_MAX_PBUFFER_PIXELS_ARB* = 0x0000202E
|
|
||||||
WGL_MAX_PBUFFER_WIDTH_ARB* = 0x0000202F
|
|
||||||
WGL_MAX_PBUFFER_HEIGHT_ARB* = 0x00002030
|
|
||||||
WGL_PBUFFER_LARGEST_ARB* = 0x00002033
|
|
||||||
WGL_PBUFFER_WIDTH_ARB* = 0x00002034
|
|
||||||
WGL_PBUFFER_HEIGHT_ARB* = 0x00002035
|
|
||||||
WGL_PBUFFER_LOST_ARB* = 0x00002036
|
|
||||||
|
|
||||||
proc wglCreatePbufferARB*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint,
|
|
||||||
iHeight: TGLint, piAttribList: PGLint): THandle{.
|
|
||||||
dynlib: dllname, importc: "wglCreatePbufferARB".}
|
|
||||||
proc wglGetPbufferDCARB*(hPbuffer: THandle): HDC{.dynlib: dllname,
|
|
||||||
importc: "wglGetPbufferDCARB".}
|
|
||||||
proc wglReleasePbufferDCARB*(hPbuffer: THandle, hDC: HDC): TGLint{.
|
|
||||||
dynlib: dllname, importc: "wglReleasePbufferDCARB".}
|
|
||||||
proc wglDestroyPbufferARB*(hPbuffer: THandle): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglDestroyPbufferARB".}
|
|
||||||
proc wglQueryPbufferARB*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglQueryPbufferARB".}
|
|
||||||
proc wglSwapIntervalEXT*(interval: TGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglSwapIntervalEXT".}
|
|
||||||
proc wglGetSwapIntervalEXT*(): TGLint{.dynlib: dllname,
|
|
||||||
importc: "wglGetSwapIntervalEXT".}
|
|
||||||
const
|
|
||||||
WGL_BIND_TO_TEXTURE_RGB_ARB* = 0x00002070
|
|
||||||
WGL_BIND_TO_TEXTURE_RGBA_ARB* = 0x00002071
|
|
||||||
WGL_TEXTURE_FORMAT_ARB* = 0x00002072
|
|
||||||
WGL_TEXTURE_TARGET_ARB* = 0x00002073
|
|
||||||
WGL_MIPMAP_TEXTURE_ARB* = 0x00002074
|
|
||||||
WGL_TEXTURE_RGB_ARB* = 0x00002075
|
|
||||||
WGL_TEXTURE_RGBA_ARB* = 0x00002076
|
|
||||||
WGL_NO_TEXTURE_ARB* = 0x00002077
|
|
||||||
WGL_TEXTURE_CUBE_MAP_ARB* = 0x00002078
|
|
||||||
WGL_TEXTURE_1D_ARB* = 0x00002079
|
|
||||||
WGL_TEXTURE_2D_ARB* = 0x0000207A # WGL_NO_TEXTURE_ARB { already defined }
|
|
||||||
WGL_MIPMAP_LEVEL_ARB* = 0x0000207B
|
|
||||||
WGL_CUBE_MAP_FACE_ARB* = 0x0000207C
|
|
||||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x0000207D
|
|
||||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x0000207E
|
|
||||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x0000207F
|
|
||||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00002080
|
|
||||||
WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00002081
|
|
||||||
WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x00002082
|
|
||||||
WGL_FRONT_LEFT_ARB* = 0x00002083
|
|
||||||
WGL_FRONT_RIGHT_ARB* = 0x00002084
|
|
||||||
WGL_BACK_LEFT_ARB* = 0x00002085
|
|
||||||
WGL_BACK_RIGHT_ARB* = 0x00002086
|
|
||||||
WGL_AUX0_ARB* = 0x00002087
|
|
||||||
WGL_AUX1_ARB* = 0x00002088
|
|
||||||
WGL_AUX2_ARB* = 0x00002089
|
|
||||||
WGL_AUX3_ARB* = 0x0000208A
|
|
||||||
WGL_AUX4_ARB* = 0x0000208B
|
|
||||||
WGL_AUX5_ARB* = 0x0000208C
|
|
||||||
WGL_AUX6_ARB* = 0x0000208D
|
|
||||||
WGL_AUX7_ARB* = 0x0000208E
|
|
||||||
WGL_AUX8_ARB* = 0x0000208F
|
|
||||||
WGL_AUX9_ARB* = 0x00002090
|
|
||||||
|
|
||||||
proc wglBindTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglBindTexImageARB".}
|
|
||||||
proc wglReleaseTexImageARB*(hPbuffer: THandle, iBuffer: TGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglReleaseTexImageARB".}
|
|
||||||
proc wglSetPbufferAttribARB*(hPbuffer: THandle, piAttribList: PGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglSetPbufferAttribARB".}
|
|
||||||
proc wglGetExtensionsStringEXT*(): cstring{.dynlib: dllname,
|
|
||||||
importc: "wglGetExtensionsStringEXT".}
|
|
||||||
proc wglMakeContextCurrentEXT*(hDrawDC: HDC, hReadDC: HDC, hglrc: HGLRC): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglMakeContextCurrentEXT".}
|
|
||||||
proc wglGetCurrentReadDCEXT*(): HDC{.dynlib: dllname,
|
|
||||||
importc: "wglGetCurrentReadDCEXT".}
|
|
||||||
const
|
|
||||||
WGL_DRAW_TO_PBUFFER_EXT* = 0x0000202D
|
|
||||||
WGL_MAX_PBUFFER_PIXELS_EXT* = 0x0000202E
|
|
||||||
WGL_MAX_PBUFFER_WIDTH_EXT* = 0x0000202F
|
|
||||||
WGL_MAX_PBUFFER_HEIGHT_EXT* = 0x00002030
|
|
||||||
WGL_OPTIMAL_PBUFFER_WIDTH_EXT* = 0x00002031
|
|
||||||
WGL_OPTIMAL_PBUFFER_HEIGHT_EXT* = 0x00002032
|
|
||||||
WGL_PBUFFER_LARGEST_EXT* = 0x00002033
|
|
||||||
WGL_PBUFFER_WIDTH_EXT* = 0x00002034
|
|
||||||
WGL_PBUFFER_HEIGHT_EXT* = 0x00002035
|
|
||||||
|
|
||||||
proc wglCreatePbufferEXT*(hDC: HDC, iPixelFormat: TGLint, iWidth: TGLint,
|
|
||||||
iHeight: TGLint, piAttribList: PGLint): THandle{.
|
|
||||||
dynlib: dllname, importc: "wglCreatePbufferEXT".}
|
|
||||||
proc wglGetPbufferDCEXT*(hPbuffer: THandle): HDC{.dynlib: dllname,
|
|
||||||
importc: "wglGetPbufferDCEXT".}
|
|
||||||
proc wglReleasePbufferDCEXT*(hPbuffer: THandle, hDC: HDC): TGLint{.
|
|
||||||
dynlib: dllname, importc: "wglReleasePbufferDCEXT".}
|
|
||||||
proc wglDestroyPbufferEXT*(hPbuffer: THandle): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglDestroyPbufferEXT".}
|
|
||||||
proc wglQueryPbufferEXT*(hPbuffer: THandle, iAttribute: TGLint, piValue: PGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglQueryPbufferEXT".}
|
|
||||||
const
|
|
||||||
WGL_NUMBER_PIXEL_FORMATS_EXT* = 0x00002000
|
|
||||||
WGL_DRAW_TO_WINDOW_EXT* = 0x00002001
|
|
||||||
WGL_DRAW_TO_BITMAP_EXT* = 0x00002002
|
|
||||||
WGL_ACCELERATION_EXT* = 0x00002003
|
|
||||||
WGL_NEED_PALETTE_EXT* = 0x00002004
|
|
||||||
WGL_NEED_SYSTEM_PALETTE_EXT* = 0x00002005
|
|
||||||
WGL_SWAP_LAYER_BUFFERS_EXT* = 0x00002006
|
|
||||||
WGL_SWAP_METHOD_EXT* = 0x00002007
|
|
||||||
WGL_NUMBER_OVERLAYS_EXT* = 0x00002008
|
|
||||||
WGL_NUMBER_UNDERLAYS_EXT* = 0x00002009
|
|
||||||
WGL_TRANSPARENT_EXT* = 0x0000200A
|
|
||||||
WGL_TRANSPARENT_VALUE_EXT* = 0x0000200B
|
|
||||||
WGL_SHARE_DEPTH_EXT* = 0x0000200C
|
|
||||||
WGL_SHARE_STENCIL_EXT* = 0x0000200D
|
|
||||||
WGL_SHARE_ACCUM_EXT* = 0x0000200E
|
|
||||||
WGL_SUPPORT_GDI_EXT* = 0x0000200F
|
|
||||||
WGL_SUPPORT_OPENGL_EXT* = 0x00002010
|
|
||||||
WGL_DOUBLE_BUFFER_EXT* = 0x00002011
|
|
||||||
WGL_STEREO_EXT* = 0x00002012
|
|
||||||
WGL_PIXEL_TYPE_EXT* = 0x00002013
|
|
||||||
WGL_COLOR_BITS_EXT* = 0x00002014
|
|
||||||
WGL_RED_BITS_EXT* = 0x00002015
|
|
||||||
WGL_RED_SHIFT_EXT* = 0x00002016
|
|
||||||
WGL_GREEN_BITS_EXT* = 0x00002017
|
|
||||||
WGL_GREEN_SHIFT_EXT* = 0x00002018
|
|
||||||
WGL_BLUE_BITS_EXT* = 0x00002019
|
|
||||||
WGL_BLUE_SHIFT_EXT* = 0x0000201A
|
|
||||||
WGL_ALPHA_BITS_EXT* = 0x0000201B
|
|
||||||
WGL_ALPHA_SHIFT_EXT* = 0x0000201C
|
|
||||||
WGL_ACCUM_BITS_EXT* = 0x0000201D
|
|
||||||
WGL_ACCUM_RED_BITS_EXT* = 0x0000201E
|
|
||||||
WGL_ACCUM_GREEN_BITS_EXT* = 0x0000201F
|
|
||||||
WGL_ACCUM_BLUE_BITS_EXT* = 0x00002020
|
|
||||||
WGL_ACCUM_ALPHA_BITS_EXT* = 0x00002021
|
|
||||||
WGL_DEPTH_BITS_EXT* = 0x00002022
|
|
||||||
WGL_STENCIL_BITS_EXT* = 0x00002023
|
|
||||||
WGL_AUX_BUFFERS_EXT* = 0x00002024
|
|
||||||
WGL_NO_ACCELERATION_EXT* = 0x00002025
|
|
||||||
WGL_GENERIC_ACCELERATION_EXT* = 0x00002026
|
|
||||||
WGL_FULL_ACCELERATION_EXT* = 0x00002027
|
|
||||||
WGL_SWAP_EXCHANGE_EXT* = 0x00002028
|
|
||||||
WGL_SWAP_COPY_EXT* = 0x00002029
|
|
||||||
WGL_SWAP_UNDEFINED_EXT* = 0x0000202A
|
|
||||||
WGL_TYPE_RGBA_EXT* = 0x0000202B
|
|
||||||
WGL_TYPE_COLORINDEX_EXT* = 0x0000202C
|
|
||||||
|
|
||||||
proc wglGetPixelFormatAttribivEXT*(hdc: HDC, iPixelFormat: TGLint,
|
|
||||||
iLayerPlane: TGLint, nAttributes: TGLuint,
|
|
||||||
piAttributes: PGLint, piValues: PGLint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetPixelFormatAttribivEXT".}
|
|
||||||
proc wglGetPixelFormatAttribfvEXT*(hdc: HDC, iPixelFormat: TGLint,
|
|
||||||
iLayerPlane: TGLint, nAttributes: TGLuint,
|
|
||||||
piAttributes: PGLint, pfValues: PGLfloat): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetPixelFormatAttribfvEXT".}
|
|
||||||
proc wglChoosePixelFormatEXT*(hdc: HDC, piAttribIList: PGLint,
|
|
||||||
pfAttribFList: PGLfloat, nMaxFormats: TGLuint,
|
|
||||||
piFormats: PGLint, nNumFormats: PGLuint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglChoosePixelFormatEXT".}
|
|
||||||
const
|
|
||||||
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D* = 0x00002050
|
|
||||||
WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D* = 0x00002051
|
|
||||||
WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D* = 0x00002052
|
|
||||||
WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D* = 0x00002053
|
|
||||||
|
|
||||||
proc wglGetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint,
|
|
||||||
piValue: PGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGetDigitalVideoParametersI3D".}
|
|
||||||
proc wglSetDigitalVideoParametersI3D*(hDC: HDC, iAttribute: TGLint,
|
|
||||||
piValue: PGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglSetDigitalVideoParametersI3D".}
|
|
||||||
const
|
|
||||||
WGL_GAMMA_TABLE_SIZE_I3D* = 0x0000204E
|
|
||||||
WGL_GAMMA_EXCLUDE_DESKTOP_I3D* = 0x0000204F
|
|
||||||
|
|
||||||
proc wglGetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint,
|
|
||||||
piValue: PGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGetGammaTableParametersI3D".}
|
|
||||||
proc wglSetGammaTableParametersI3D*(hDC: HDC, iAttribute: TGLint,
|
|
||||||
piValue: PGLint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglSetGammaTableParametersI3D".}
|
|
||||||
proc wglGetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT,
|
|
||||||
puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetGammaTableI3D".}
|
|
||||||
proc wglSetGammaTableI3D*(hDC: HDC, iEntries: TGLint, puRed: PGLUSHORT,
|
|
||||||
puGreen: PGLUSHORT, puBlue: PGLUSHORT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglSetGammaTableI3D".}
|
|
||||||
const
|
|
||||||
WGL_GENLOCK_SOURCE_MULTIVIEW_I3D* = 0x00002044
|
|
||||||
WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D* = 0x00002045
|
|
||||||
WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D* = 0x00002046
|
|
||||||
WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D* = 0x00002047
|
|
||||||
WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D* = 0x00002048
|
|
||||||
WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D* = 0x00002049
|
|
||||||
WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D* = 0x0000204A
|
|
||||||
WGL_GENLOCK_SOURCE_EDGE_RISING_I3D* = 0x0000204B
|
|
||||||
WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D* = 0x0000204C
|
|
||||||
WGL_FLOAT_COMPONENTS_NV* = 0x000020B0
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV* = 0x000020B1
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV* = 0x000020B2
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV* = 0x000020B3
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV* = 0x000020B4
|
|
||||||
WGL_TEXTURE_FLOAT_R_NV* = 0x000020B5
|
|
||||||
WGL_TEXTURE_FLOAT_RG_NV* = 0x000020B6
|
|
||||||
WGL_TEXTURE_FLOAT_RGB_NV* = 0x000020B7
|
|
||||||
WGL_TEXTURE_FLOAT_RGBA_NV* = 0x000020B8
|
|
||||||
|
|
||||||
proc wglEnableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglEnableGenlockI3D".}
|
|
||||||
proc wglDisableGenlockI3D*(hDC: HDC): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglDisableGenlockI3D".}
|
|
||||||
proc wglIsEnabledGenlockI3D*(hDC: HDC, pFlag: PBOOL): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglIsEnabledGenlockI3D".}
|
|
||||||
proc wglGenlockSourceI3D*(hDC: HDC, uSource: TGLuint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGenlockSourceI3D".}
|
|
||||||
proc wglGetGenlockSourceI3D*(hDC: HDC, uSource: PGLUINT): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGetGenlockSourceI3D".}
|
|
||||||
proc wglGenlockSourceEdgeI3D*(hDC: HDC, uEdge: TGLuint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGenlockSourceEdgeI3D".}
|
|
||||||
proc wglGetGenlockSourceEdgeI3D*(hDC: HDC, uEdge: PGLUINT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetGenlockSourceEdgeI3D".}
|
|
||||||
proc wglGenlockSampleRateI3D*(hDC: HDC, uRate: TGLuint): BOOL{.dynlib: dllname,
|
|
||||||
importc: "wglGenlockSampleRateI3D".}
|
|
||||||
proc wglGetGenlockSampleRateI3D*(hDC: HDC, uRate: PGLUINT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetGenlockSampleRateI3D".}
|
|
||||||
proc wglGenlockSourceDelayI3D*(hDC: HDC, uDelay: TGLuint): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGenlockSourceDelayI3D".}
|
|
||||||
proc wglGetGenlockSourceDelayI3D*(hDC: HDC, uDelay: PGLUINT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglGetGenlockSourceDelayI3D".}
|
|
||||||
proc wglQueryGenlockMaxSourceDelayI3D*(hDC: HDC, uMaxLineDelay: PGLUINT,
|
|
||||||
uMaxPixelDelay: PGLUINT): BOOL{.
|
|
||||||
dynlib: dllname, importc: "wglQueryGenlockMaxSourceDelayI3D".}
|
|
||||||
const
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV* = 0x000020A0
|
|
||||||
WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV* = 0x000020A1
|
|
||||||
WGL_TEXTURE_RECTANGLE_NV* = 0x000020A2
|
|
||||||
|
|
||||||
const
|
|
||||||
WGL_RGBA_FLOAT_MODE_ATI* = 0x00008820
|
|
||||||
WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI* = 0x00008835
|
|
||||||
WGL_TYPE_RGBA_FLOAT_ATI* = 0x000021A0
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,865 +0,0 @@
|
||||||
#
|
|
||||||
#
|
|
||||||
# Nimrod's Runtime Library
|
|
||||||
# (c) Copyright 2010 Andreas Rumpf
|
|
||||||
#
|
|
||||||
# See the file "copying.txt", included in this
|
|
||||||
# distribution, for details about the copyright.
|
|
||||||
#
|
|
||||||
|
|
||||||
## This module is a wrapper for the TCL programming language.
|
|
||||||
|
|
||||||
#
|
|
||||||
# tcl.h --
|
|
||||||
#
|
|
||||||
# This header file describes the externally-visible facilities of the Tcl
|
|
||||||
# interpreter.
|
|
||||||
#
|
|
||||||
# Translated to Pascal Copyright (c) 2002 by Max Artemev
|
|
||||||
# aka Bert Raccoon (bert@furry.ru, bert_raccoon@freemail.ru)
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Copyright (c) 1998-2000 by Scriptics Corporation.
|
|
||||||
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
|
||||||
# Copyright (c) 1993-1996 Lucent Technologies.
|
|
||||||
# Copyright (c) 1987-1994 John Ousterhout, The Regents of the
|
|
||||||
# University of California, Berkeley.
|
|
||||||
#
|
|
||||||
# ***********************************************************************
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# ***********************************************************************
|
|
||||||
#
|
|
||||||
|
|
||||||
{.deadCodeElim: on.}
|
|
||||||
|
|
||||||
when defined(WIN32):
|
|
||||||
const
|
|
||||||
dllName = "tcl(85|84|83|82|81|80).dll"
|
|
||||||
elif defined(macosx):
|
|
||||||
const
|
|
||||||
dllName = "libtcl(8.5|8.4|8.3|8.2|8.1).dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
dllName = "libtcl(8.5|8.4|8.3|8.2|8.1).so(|.1|.0)"
|
|
||||||
const
|
|
||||||
TCL_DESTROYED* = 0xDEADDEAD
|
|
||||||
TCL_OK* = 0
|
|
||||||
TCL_ERROR* = 1
|
|
||||||
TCL_RETURN* = 2
|
|
||||||
TCL_BREAK* = 3
|
|
||||||
TCL_CONTINUE* = 4
|
|
||||||
RESULT_SIZE* = 200
|
|
||||||
MAX_ARGV* = 0x00007FFF
|
|
||||||
VERSION_MAJOR* = 0
|
|
||||||
VERSION_MINOR* = 0
|
|
||||||
NO_EVAL* = 0x00010000
|
|
||||||
EVAL_GLOBAL* = 0x00020000 # Flag values passed to variable-related proc
|
|
||||||
GLOBAL_ONLY* = 1
|
|
||||||
NAMESPACE_ONLY* = 2
|
|
||||||
APPEND_VALUE* = 4
|
|
||||||
LIST_ELEMENT* = 8
|
|
||||||
TRACE_READS* = 0x00000010
|
|
||||||
TRACE_WRITES* = 0x00000020
|
|
||||||
TRACE_UNSETS* = 0x00000040
|
|
||||||
TRACE_DESTROYED* = 0x00000080
|
|
||||||
INTERP_DESTROYED* = 0x00000100
|
|
||||||
LEAVE_ERR_MSG* = 0x00000200
|
|
||||||
PARSE_PART1* = 0x00000400 # Types for linked variables: *
|
|
||||||
LINK_INT* = 1
|
|
||||||
LINK_DOUBLE* = 2
|
|
||||||
LINK_BOOLEAN* = 3
|
|
||||||
LINK_STRING* = 4
|
|
||||||
LINK_READ_ONLY* = 0x00000080
|
|
||||||
SMALL_HASH_TABLE* = 4 # Hash Table *
|
|
||||||
STRING_KEYS* = 0
|
|
||||||
ONE_WORD_KEYS* = 1 # Const/enums Tcl_QueuePosition *
|
|
||||||
|
|
||||||
QUEUE_TAIL* = 0
|
|
||||||
QUEUE_HEAD* = 1
|
|
||||||
QUEUE_MARK* = 2 # Tcl_QueuePosition;
|
|
||||||
# Event Flags
|
|
||||||
DONT_WAIT* = 1 shl 1
|
|
||||||
WINDOW_EVENTS* = 1 shl 2
|
|
||||||
FILE_EVENTS* = 1 shl 3
|
|
||||||
TIMER_EVENTS* = 1 shl 4
|
|
||||||
IDLE_EVENTS* = 1 shl 5 # WAS 0x10 ???? *
|
|
||||||
ALL_EVENTS* = not DONT_WAIT
|
|
||||||
VOLATILE* = 1
|
|
||||||
TCL_STATIC* = 0
|
|
||||||
DYNAMIC* = 3 # Channel
|
|
||||||
TCL_STDIN* = 1 shl 1
|
|
||||||
TCL_STDOUT* = 1 shl 2
|
|
||||||
TCL_STDERR* = 1 shl 3
|
|
||||||
ENFORCE_MODE* = 1 shl 4
|
|
||||||
READABLE* = 1 shl 1
|
|
||||||
WRITABLE* = 1 shl 2
|
|
||||||
EXCEPTION* = 1 shl 3 # POSIX *
|
|
||||||
EPERM* = 1 # Operation not permitted; only the owner of the file (or other
|
|
||||||
# resource) or processes with special privileges can perform the
|
|
||||||
# operation.
|
|
||||||
#
|
|
||||||
ENOENT* = 2 # No such file or directory. This is a "file doesn't exist" error
|
|
||||||
# for ordinary files that are referenced in contexts where they are
|
|
||||||
# expected to already exist.
|
|
||||||
#
|
|
||||||
ESRCH* = 3 # No process matches the specified process ID. *
|
|
||||||
EINTR* = 4 # Interrupted function call; an asynchronous signal occurred and
|
|
||||||
# prevented completion of the call. When this happens, you should
|
|
||||||
# try the call again.
|
|
||||||
#
|
|
||||||
EIO* = 5 # Input/output error; usually used for physical read or write errors. *
|
|
||||||
ENXIO* = 6 # No such device or address. The system tried to use the device
|
|
||||||
# represented by a file you specified, and it couldn't find the
|
|
||||||
# device. This can mean that the device file was installed
|
|
||||||
# incorrectly, or that the physical device is missing or not
|
|
||||||
# correctly attached to the computer.
|
|
||||||
#
|
|
||||||
E2BIG* = 7 # Argument list too long; used when the arguments passed to a new
|
|
||||||
# program being executed with one of the `exec' functions (*note
|
|
||||||
# Executing a File::.) occupy too much memory space. This condition
|
|
||||||
# never arises in the GNU system.
|
|
||||||
#
|
|
||||||
ENOEXEC* = 8 # Invalid executable file format. This condition is detected by the
|
|
||||||
# `exec' functions; see *Note Executing a File::.
|
|
||||||
#
|
|
||||||
EBADF* = 9 # Bad file descriptor; for example, I/O on a descriptor that has been
|
|
||||||
# closed or reading from a descriptor open only for writing (or vice
|
|
||||||
# versa).
|
|
||||||
#
|
|
||||||
ECHILD* = 10 # There are no child processes. This error happens on operations
|
|
||||||
# that are supposed to manipulate child processes, when there aren't
|
|
||||||
# any processes to manipulate.
|
|
||||||
#
|
|
||||||
EDEADLK* = 11 # Deadlock avoided; allocating a system resource would have resulted
|
|
||||||
# in a deadlock situation. The system does not guarantee that it
|
|
||||||
# will notice all such situations. This error means you got lucky
|
|
||||||
# and the system noticed; it might just hang. *Note File Locks::,
|
|
||||||
# for an example.
|
|
||||||
#
|
|
||||||
ENOMEM* = 12 # No memory available. The system cannot allocate more virtual
|
|
||||||
# memory because its capacity is full.
|
|
||||||
#
|
|
||||||
EACCES* = 13 # Permission denied; the file permissions do not allow the attempted
|
|
||||||
# operation.
|
|
||||||
#
|
|
||||||
EFAULT* = 14 # Bad address; an invalid pointer was detected. In the GNU system,
|
|
||||||
# this error never happens; you get a signal instead.
|
|
||||||
#
|
|
||||||
ENOTBLK* = 15 # A file that isn't a block special file was given in a situation
|
|
||||||
# that requires one. For example, trying to mount an ordinary file
|
|
||||||
# as a file system in Unix gives this error.
|
|
||||||
#
|
|
||||||
EBUSY* = 16 # Resource busy; a system resource that can't be shared is already
|
|
||||||
# in use. For example, if you try to delete a file that is the root
|
|
||||||
# of a currently mounted filesystem, you get this error.
|
|
||||||
#
|
|
||||||
EEXIST* = 17 # File exists; an existing file was specified in a context where it
|
|
||||||
# only makes sense to specify a new file.
|
|
||||||
#
|
|
||||||
EXDEV* = 18 # An attempt to make an improper link across file systems was
|
|
||||||
# detected. This happens not only when you use `link' (*note Hard
|
|
||||||
# Links::.) but also when you rename a file with `rename' (*note
|
|
||||||
# Renaming Files::.).
|
|
||||||
#
|
|
||||||
ENODEV* = 19 # The wrong type of device was given to a function that expects a
|
|
||||||
# particular sort of device.
|
|
||||||
#
|
|
||||||
ENOTDIR* = 20 # A file that isn't a directory was specified when a directory is
|
|
||||||
# required.
|
|
||||||
#
|
|
||||||
EISDIR* = 21 # File is a directory; you cannot open a directory for writing, or
|
|
||||||
# create or remove hard links to it.
|
|
||||||
#
|
|
||||||
EINVAL* = 22 # Invalid argument. This is used to indicate various kinds of
|
|
||||||
# problems with passing the wrong argument to a library function.
|
|
||||||
#
|
|
||||||
EMFILE* = 24 # The current process has too many files open and can't open any
|
|
||||||
# more. Duplicate descriptors do count toward this limit.
|
|
||||||
#
|
|
||||||
# In BSD and GNU, the number of open files is controlled by a
|
|
||||||
# resource limit that can usually be increased. If you get this
|
|
||||||
# error, you might want to increase the `RLIMIT_NOFILE' limit or
|
|
||||||
# make it unlimited; *note Limits on Resources::..
|
|
||||||
#
|
|
||||||
ENFILE* = 23 # There are too many distinct file openings in the entire system.
|
|
||||||
# Note that any number of linked channels count as just one file
|
|
||||||
# opening; see *Note Linked Channels::. This error never occurs in
|
|
||||||
# the GNU system.
|
|
||||||
#
|
|
||||||
ENOTTY* = 25 # Inappropriate I/O control operation, such as trying to set terminal
|
|
||||||
# modes on an ordinary file.
|
|
||||||
#
|
|
||||||
ETXTBSY* = 26 # An attempt to execute a file that is currently open for writing, or
|
|
||||||
# write to a file that is currently being executed. Often using a
|
|
||||||
# debugger to run a program is considered having it open for writing
|
|
||||||
# and will cause this error. (The name stands for "text file
|
|
||||||
# busy".) This is not an error in the GNU system; the text is
|
|
||||||
# copied as necessary.
|
|
||||||
#
|
|
||||||
EFBIG* = 27 # File too big; the size of a file would be larger than allowed by
|
|
||||||
# the system.
|
|
||||||
#
|
|
||||||
ENOSPC* = 28 # No space left on device; write operation on a file failed because
|
|
||||||
# the disk is full.
|
|
||||||
#
|
|
||||||
ESPIPE* = 29 # Invalid seek operation (such as on a pipe). *
|
|
||||||
EROFS* = 30 # An attempt was made to modify something on a read-only file system. *
|
|
||||||
EMLINK* = 31 # Too many links; the link count of a single file would become too
|
|
||||||
# large. `rename' can cause this error if the file being renamed
|
|
||||||
# already has as many links as it can take (*note Renaming Files::.).
|
|
||||||
#
|
|
||||||
EPIPE* = 32 # Broken pipe; there is no process reading from the other end of a
|
|
||||||
# pipe. Every library function that returns this error code also
|
|
||||||
# generates a `SIGPIPE' signal; this signal terminates the program
|
|
||||||
# if not handled or blocked. Thus, your program will never actually
|
|
||||||
# see `EPIPE' unless it has handled or blocked `SIGPIPE'.
|
|
||||||
#
|
|
||||||
EDOM* = 33 # Domain error; used by mathematical functions when an argument
|
|
||||||
# value does not fall into the domain over which the function is
|
|
||||||
# defined.
|
|
||||||
#
|
|
||||||
ERANGE* = 34 # Range error; used by mathematical functions when the result value
|
|
||||||
# is not representable because of overflow or underflow.
|
|
||||||
#
|
|
||||||
EAGAIN* = 35 # Resource temporarily unavailable; the call might work if you try
|
|
||||||
# again later. The macro `EWOULDBLOCK' is another name for `EAGAIN';
|
|
||||||
# they are always the same in the GNU C library.
|
|
||||||
#
|
|
||||||
EWOULDBLOCK* = EAGAIN # In the GNU C library, this is another name for `EAGAIN' (above).
|
|
||||||
# The values are always the same, on every operating system.
|
|
||||||
# C libraries in many older Unix systems have `EWOULDBLOCK' as a
|
|
||||||
# separate error code.
|
|
||||||
#
|
|
||||||
EINPROGRESS* = 36 # An operation that cannot complete immediately was initiated on an
|
|
||||||
# object that has non-blocking mode selected. Some functions that
|
|
||||||
# must always block (such as `connect'; *note Connecting::.) never
|
|
||||||
# return `EAGAIN'. Instead, they return `EINPROGRESS' to indicate
|
|
||||||
# that the operation has begun and will take some time. Attempts to
|
|
||||||
# manipulate the object before the call completes return `EALREADY'.
|
|
||||||
# You can use the `select' function to find out when the pending
|
|
||||||
# operation has completed; *note Waiting for I/O::..
|
|
||||||
#
|
|
||||||
EALREADY* = 37 # An operation is already in progress on an object that has
|
|
||||||
# non-blocking mode selected.
|
|
||||||
#
|
|
||||||
ENOTSOCK* = 38 # A file that isn't a socket was specified when a socket is required. *
|
|
||||||
EDESTADDRREQ* = 39 # No default destination address was set for the socket. You get
|
|
||||||
# this error when you try to transmit data over a connectionless
|
|
||||||
# socket, without first specifying a destination for the data with
|
|
||||||
# `connect'.
|
|
||||||
#
|
|
||||||
EMSGSIZE* = 40 # The size of a message sent on a socket was larger than the
|
|
||||||
# supported maximum size.
|
|
||||||
#
|
|
||||||
EPROTOTYPE* = 41 # The socket type does not support the requested communications
|
|
||||||
# protocol.
|
|
||||||
#
|
|
||||||
ENOPROTOOPT* = 42 # You specified a socket option that doesn't make sense for the
|
|
||||||
# particular protocol being used by the socket. *Note Socket
|
|
||||||
# Options::.
|
|
||||||
#
|
|
||||||
EPROTONOSUPPORT* = 43 # The socket domain does not support the requested communications
|
|
||||||
# protocol (perhaps because the requested protocol is completely
|
|
||||||
# invalid.) *Note Creating a Socket::.
|
|
||||||
#
|
|
||||||
ESOCKTNOSUPPORT* = 44 # The socket type is not supported. *
|
|
||||||
EOPNOTSUPP* = 45 # The operation you requested is not supported. Some socket
|
|
||||||
# functions don't make sense for all types of sockets, and others
|
|
||||||
# may not be implemented for all communications protocols. In the
|
|
||||||
# GNU system, this error can happen for many calls when the object
|
|
||||||
# does not support the particular operation; it is a generic
|
|
||||||
# indication that the server knows nothing to do for that call.
|
|
||||||
#
|
|
||||||
EPFNOSUPPORT* = 46 # The socket communications protocol family you requested is not
|
|
||||||
# supported.
|
|
||||||
#
|
|
||||||
EAFNOSUPPORT* = 47 # The address family specified for a socket is not supported; it is
|
|
||||||
# inconsistent with the protocol being used on the socket. *Note
|
|
||||||
# Sockets::.
|
|
||||||
#
|
|
||||||
EADDRINUSE* = 48 # The requested socket address is already in use. *Note Socket
|
|
||||||
# Addresses::.
|
|
||||||
#
|
|
||||||
EADDRNOTAVAIL* = 49 # The requested socket address is not available; for example, you
|
|
||||||
# tried to give a socket a name that doesn't match the local host
|
|
||||||
# name. *Note Socket Addresses::.
|
|
||||||
#
|
|
||||||
ENETDOWN* = 50 # A socket operation failed because the network was down. *
|
|
||||||
ENETUNREACH* = 51 # A socket operation failed because the subnet containing the remote
|
|
||||||
# host was unreachable.
|
|
||||||
#
|
|
||||||
ENETRESET* = 52 # A network connection was reset because the remote host crashed. *
|
|
||||||
ECONNABORTED* = 53 # A network connection was aborted locally. *
|
|
||||||
ECONNRESET* = 54 # A network connection was closed for reasons outside the control of
|
|
||||||
# the local host, such as by the remote machine rebooting or an
|
|
||||||
# unrecoverable protocol violation.
|
|
||||||
#
|
|
||||||
ENOBUFS* = 55 # The kernel's buffers for I/O operations are all in use. In GNU,
|
|
||||||
# this error is always synonymous with `ENOMEM'; you may get one or
|
|
||||||
# the other from network operations.
|
|
||||||
#
|
|
||||||
EISCONN* = 56 # You tried to connect a socket that is already connected. *Note
|
|
||||||
# Connecting::.
|
|
||||||
#
|
|
||||||
ENOTCONN* = 57 # The socket is not connected to anything. You get this error when
|
|
||||||
# you try to transmit data over a socket, without first specifying a
|
|
||||||
# destination for the data. For a connectionless socket (for
|
|
||||||
# datagram protocols, such as UDP), you get `EDESTADDRREQ' instead.
|
|
||||||
#
|
|
||||||
ESHUTDOWN* = 58 # The socket has already been shut down. *
|
|
||||||
ETOOMANYREFS* = 59 # ??? *
|
|
||||||
ETIMEDOUT* = 60 # A socket operation with a specified timeout received no response
|
|
||||||
# during the timeout period.
|
|
||||||
#
|
|
||||||
ECONNREFUSED* = 61 # A remote host refused to allow the network connection (typically
|
|
||||||
# because it is not running the requested service).
|
|
||||||
#
|
|
||||||
ELOOP* = 62 # Too many levels of symbolic links were encountered in looking up a
|
|
||||||
# file name. This often indicates a cycle of symbolic links.
|
|
||||||
#
|
|
||||||
ENAMETOOLONG* = 63 # Filename too long (longer than `PATH_MAX'; *note Limits for
|
|
||||||
# Files::.) or host name too long (in `gethostname' or
|
|
||||||
# `sethostname'; *note Host Identification::.).
|
|
||||||
#
|
|
||||||
EHOSTDOWN* = 64 # The remote host for a requested network connection is down. *
|
|
||||||
EHOSTUNREACH* = 65 # The remote host for a requested network connection is not
|
|
||||||
# reachable.
|
|
||||||
#
|
|
||||||
ENOTEMPTY* = 66 # Directory not empty, where an empty directory was expected.
|
|
||||||
# Typically, this error occurs when you are trying to delete a
|
|
||||||
# directory.
|
|
||||||
#
|
|
||||||
EPROCLIM* = 67 # This means that the per-user limit on new process would be
|
|
||||||
# exceeded by an attempted `fork'. *Note Limits on Resources::, for
|
|
||||||
# details on the `RLIMIT_NPROC' limit.
|
|
||||||
#
|
|
||||||
EUSERS* = 68 # The file quota system is confused because there are too many users. *
|
|
||||||
EDQUOT* = 69 # The user's disk quota was exceeded. *
|
|
||||||
ESTALE* = 70 # Stale NFS file handle. This indicates an internal confusion in
|
|
||||||
# the NFS system which is due to file system rearrangements on the
|
|
||||||
# server host. Repairing this condition usually requires unmounting
|
|
||||||
# and remounting the NFS file system on the local host.
|
|
||||||
#
|
|
||||||
EREMOTE* = 71 # An attempt was made to NFS-mount a remote file system with a file
|
|
||||||
# name that already specifies an NFS-mounted file. (This is an
|
|
||||||
# error on some operating systems, but we expect it to work properly
|
|
||||||
# on the GNU system, making this error code impossible.)
|
|
||||||
#
|
|
||||||
EBADRPC* = 72 # ??? *
|
|
||||||
ERPCMISMATCH* = 73 # ??? *
|
|
||||||
EPROGUNAVAIL* = 74 # ??? *
|
|
||||||
EPROGMISMATCH* = 75 # ??? *
|
|
||||||
EPROCUNAVAIL* = 76 # ??? *
|
|
||||||
ENOLCK* = 77 # No locks available. This is used by the file locking facilities;
|
|
||||||
# see *Note File Locks::. This error is never generated by the GNU
|
|
||||||
# system, but it can result from an operation to an NFS server
|
|
||||||
# running another operating system.
|
|
||||||
#
|
|
||||||
ENOSYS* = 78 # Function not implemented. Some functions have commands or options
|
|
||||||
# defined that might not be supported in all implementations, and
|
|
||||||
# this is the kind of error you get if you request them and they are
|
|
||||||
# not supported.
|
|
||||||
#
|
|
||||||
EFTYPE* = 79 # Inappropriate file type or format. The file was the wrong type
|
|
||||||
# for the operation, or a data file had the wrong format.
|
|
||||||
# On some systems `chmod' returns this error if you try to set the
|
|
||||||
# sticky bit on a non-directory file; *note Setting Permissions::..
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
TArgv* = cstringArray
|
|
||||||
TClientData* = pointer
|
|
||||||
TFreeProc* = proc (theBlock: pointer){.cdecl.}
|
|
||||||
PInterp* = ptr TInterp
|
|
||||||
TInterp*{.final.} = object # Event Definitions
|
|
||||||
result*: cstring # Do not access this directly. Use
|
|
||||||
# Tcl_GetStringResult since result
|
|
||||||
# may be pointing to an object
|
|
||||||
freeProc*: TFreeProc
|
|
||||||
errorLine*: int
|
|
||||||
|
|
||||||
TEventSetupProc* = proc (clientData: TClientData, flags: int){.cdecl.}
|
|
||||||
TEventCheckProc* = TEventSetupProc
|
|
||||||
PEvent* = ptr TEvent
|
|
||||||
TEventProc* = proc (evPtr: PEvent, flags: int): int{.cdecl.}
|
|
||||||
TEvent*{.final.} = object
|
|
||||||
prc*: TEventProc
|
|
||||||
nextPtr*: PEvent
|
|
||||||
ClientData*: TObject # ClientData is just pointer.*
|
|
||||||
|
|
||||||
PTime* = ptr TTime
|
|
||||||
TTime*{.final.} = object
|
|
||||||
sec*: int32 # Seconds. *
|
|
||||||
usec*: int32 # Microseconds. *
|
|
||||||
|
|
||||||
TTimerToken* = pointer
|
|
||||||
PInteger* = ptr int
|
|
||||||
PHashTable* = ptr THashTable
|
|
||||||
PHashEntry* = ptr THashEntry
|
|
||||||
PPHashEntry* = ptr PHashEntry
|
|
||||||
THashEntry*{.final.} = object
|
|
||||||
nextPtr*: PHashEntry
|
|
||||||
tablePtr*: PHashTable
|
|
||||||
bucketPtr*: PPHashEntry
|
|
||||||
clientData*: TClientData
|
|
||||||
key*: cstring
|
|
||||||
|
|
||||||
THashFindProc* = proc (tablePtr: PHashTable, key: cstring): PHashEntry{.
|
|
||||||
cdecl.}
|
|
||||||
THashCreateProc* = proc (tablePtr: PHashTable, key: cstring,
|
|
||||||
newPtr: PInteger): PHashEntry{.cdecl.}
|
|
||||||
THashTable*{.final.} = object
|
|
||||||
buckets*: ppHashEntry
|
|
||||||
staticBuckets*: array[0..SMALL_HASH_TABLE - 1, PHashEntry]
|
|
||||||
numBuckets*: int
|
|
||||||
numEntries*: int
|
|
||||||
rebuildSize*: int
|
|
||||||
downShift*: int
|
|
||||||
mask*: int
|
|
||||||
keyType*: int
|
|
||||||
findProc*: THashFindProc
|
|
||||||
createProc*: THashCreateProc
|
|
||||||
|
|
||||||
PHashSearch* = ptr THashSearch
|
|
||||||
THashSearch*{.final.} = object
|
|
||||||
tablePtr*: PHashTable
|
|
||||||
nextIndex*: int
|
|
||||||
nextEntryPtr*: PHashEntry
|
|
||||||
|
|
||||||
TAppInitProc* = proc (interp: pInterp): int{.cdecl.}
|
|
||||||
TPackageInitProc* = proc (interp: pInterp): int{.cdecl.}
|
|
||||||
TCmdProc* = proc (clientData: TClientData, interp: pInterp, argc: int,
|
|
||||||
argv: TArgv): int{.cdecl.}
|
|
||||||
TVarTraceProc* = proc (clientData: TClientData, interp: pInterp,
|
|
||||||
varName: cstring, elemName: cstring, flags: int): cstring{.
|
|
||||||
cdecl.}
|
|
||||||
TInterpDeleteProc* = proc (clientData: TClientData, interp: pInterp){.cdecl.}
|
|
||||||
TCmdDeleteProc* = proc (clientData: TClientData){.cdecl.}
|
|
||||||
TNamespaceDeleteProc* = proc (clientData: TClientData){.cdecl.}
|
|
||||||
|
|
||||||
const
|
|
||||||
DSTRING_STATIC_SIZE* = 200
|
|
||||||
|
|
||||||
type
|
|
||||||
PDString* = ptr TDString
|
|
||||||
TDString*{.final.} = object
|
|
||||||
str*: cstring
|
|
||||||
len*: int
|
|
||||||
spaceAvl*: int
|
|
||||||
staticSpace*: array[0..DSTRING_STATIC_SIZE - 1, char]
|
|
||||||
|
|
||||||
PChannel* = ptr TChannel
|
|
||||||
TChannel*{.final.} = object
|
|
||||||
TDriverBlockModeProc* = proc (instanceData: TClientData, mode: int): int{.
|
|
||||||
cdecl.}
|
|
||||||
TDriverCloseProc* = proc (instanceData: TClientData, interp: PInterp): int{.
|
|
||||||
cdecl.}
|
|
||||||
TDriverInputProc* = proc (instanceData: TClientData, buf: cstring,
|
|
||||||
toRead: int, errorCodePtr: PInteger): int{.cdecl.}
|
|
||||||
TDriverOutputProc* = proc (instanceData: TClientData, buf: cstring,
|
|
||||||
toWrite: int, errorCodePtr: PInteger): int{.cdecl.}
|
|
||||||
TDriverSeekProc* = proc (instanceData: TClientData, offset: int32,
|
|
||||||
mode: int, errorCodePtr: PInteger): int{.cdecl.}
|
|
||||||
TDriverSetOptionProc* = proc (instanceData: TClientData, interp: PInterp,
|
|
||||||
optionName: cstring, value: cstring): int{.cdecl.}
|
|
||||||
TDriverGetOptionProc* = proc (instanceData: TClientData, interp: pInterp,
|
|
||||||
optionName: cstring, dsPtr: PDString): int{.
|
|
||||||
cdecl.}
|
|
||||||
TDriverWatchProc* = proc (instanceData: TClientData, mask: int){.cdecl.}
|
|
||||||
TDriverGetHandleProc* = proc (instanceData: TClientData, direction: int,
|
|
||||||
handlePtr: var TClientData): int{.cdecl.}
|
|
||||||
PChannelType* = ptr TChannelType
|
|
||||||
TChannelType*{.final.} = object
|
|
||||||
typeName*: cstring
|
|
||||||
blockModeProc*: TDriverBlockModeProc
|
|
||||||
closeProc*: TDriverCloseProc
|
|
||||||
inputProc*: TDriverInputProc
|
|
||||||
ouputProc*: TDriverOutputProc
|
|
||||||
seekProc*: TDriverSeekProc
|
|
||||||
setOptionProc*: TDriverSetOptionProc
|
|
||||||
getOptionProc*: TDriverGetOptionProc
|
|
||||||
watchProc*: TDriverWatchProc
|
|
||||||
getHandleProc*: TDriverGetHandleProc
|
|
||||||
|
|
||||||
TChannelProc* = proc (clientData: TClientData, mask: int){.cdecl.}
|
|
||||||
PObj* = ptr TObj
|
|
||||||
PPObj* = ptr PObj
|
|
||||||
TObj*{.final.} = object
|
|
||||||
refCount*: int # ...
|
|
||||||
|
|
||||||
TObjCmdProc* = proc (clientData: TClientData, interp: PInterp, objc: int,
|
|
||||||
PPObj: PPObj): int{.cdecl.}
|
|
||||||
PNamespace* = ptr TNamespace
|
|
||||||
TNamespace*{.final.} = object
|
|
||||||
name*: cstring
|
|
||||||
fullName*: cstring
|
|
||||||
clientData*: TClientData
|
|
||||||
deleteProc*: TNamespaceDeleteProc
|
|
||||||
parentPtr*: PNamespace
|
|
||||||
|
|
||||||
PCallFrame* = ptr TCallFrame
|
|
||||||
TCallFrame*{.final.} = object
|
|
||||||
nsPtr*: PNamespace
|
|
||||||
dummy1*: int
|
|
||||||
dummy2*: int
|
|
||||||
dummy3*: cstring
|
|
||||||
dummy4*: cstring
|
|
||||||
dummy5*: cstring
|
|
||||||
dummy6*: int
|
|
||||||
dummy7*: cstring
|
|
||||||
dummy8*: cstring
|
|
||||||
dummy9*: int
|
|
||||||
dummy10*: cstring
|
|
||||||
|
|
||||||
PCmdInfo* = ptr TCmdInfo
|
|
||||||
TCmdInfo*{.final.} = object
|
|
||||||
isNativeObjectProc*: int
|
|
||||||
objProc*: TObjCmdProc
|
|
||||||
objClientData*: TClientData
|
|
||||||
prc*: TCmdProc
|
|
||||||
clientData*: TClientData
|
|
||||||
deleteProc*: TCmdDeleteProc
|
|
||||||
deleteData*: TClientData
|
|
||||||
namespacePtr*: pNamespace
|
|
||||||
|
|
||||||
pCommand* = ptr TCommand
|
|
||||||
TCommand*{.final.} = object # hPtr : pTcl_HashEntry;
|
|
||||||
# nsPtr : pTcl_Namespace;
|
|
||||||
# refCount : integer;
|
|
||||||
# isCmdEpoch : integer;
|
|
||||||
# compileProc : pointer;
|
|
||||||
# objProc : pointer;
|
|
||||||
# objClientData : Tcl_ClientData;
|
|
||||||
# proc : pointer;
|
|
||||||
# clientData : Tcl_ClientData;
|
|
||||||
# deleteProc : TTclCmdDeleteProc;
|
|
||||||
# deleteData : Tcl_ClientData;
|
|
||||||
# deleted : integer;
|
|
||||||
# importRefPtr : pointer;
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
TPanicProc* = proc (fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8: cstring){.
|
|
||||||
cdecl.} # 1/15/97 orig. Tcl style
|
|
||||||
TClientDataProc* = proc (clientData: TClientData){.cdecl.}
|
|
||||||
TIdleProc* = proc (clientData: TClientData){.cdecl.}
|
|
||||||
TTimerProc* = TIdleProc
|
|
||||||
TCreateCloseHandler* = proc (channel: pChannel, prc: TClientDataProc,
|
|
||||||
clientData: TClientData){.cdecl.}
|
|
||||||
TDeleteCloseHandler* = TCreateCloseHandler
|
|
||||||
TEventDeleteProc* = proc (evPtr: pEvent, clientData: TClientData): int{.
|
|
||||||
cdecl.}
|
|
||||||
|
|
||||||
proc Alloc*(size: int): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Alloc".}
|
|
||||||
proc CreateInterp*(): pInterp{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_CreateInterp".}
|
|
||||||
proc DeleteInterp*(interp: pInterp){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DeleteInterp".}
|
|
||||||
proc ResetResult*(interp: pInterp){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_ResetResult".}
|
|
||||||
proc Eval*(interp: pInterp, script: cstring): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Eval".}
|
|
||||||
proc EvalFile*(interp: pInterp, filename: cstring): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_EvalFile".}
|
|
||||||
proc AddErrorInfo*(interp: pInterp, message: cstring){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_AddErrorInfo".}
|
|
||||||
proc BackgroundError*(interp: pInterp){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_BackgroundError".}
|
|
||||||
proc CreateCommand*(interp: pInterp, name: cstring, cmdProc: TCmdProc,
|
|
||||||
clientData: TClientData, deleteProc: TCmdDeleteProc): pCommand{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_CreateCommand".}
|
|
||||||
proc DeleteCommand*(interp: pInterp, name: cstring): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DeleteCommand".}
|
|
||||||
proc CallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc,
|
|
||||||
clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_CallWhenDeleted".}
|
|
||||||
proc DontCallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc,
|
|
||||||
clientData: TClientData){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DontCallWhenDeleted".}
|
|
||||||
proc CommandComplete*(cmd: cstring): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_CommandComplete".}
|
|
||||||
proc LinkVar*(interp: pInterp, varName: cstring, varAddr: pointer, typ: int): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_LinkVar".}
|
|
||||||
proc UnlinkVar*(interp: pInterp, varName: cstring){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_UnlinkVar".}
|
|
||||||
proc TraceVar*(interp: pInterp, varName: cstring, flags: int,
|
|
||||||
prc: TVarTraceProc, clientData: TClientData): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_TraceVar".}
|
|
||||||
proc TraceVar2*(interp: pInterp, varName: cstring, elemName: cstring,
|
|
||||||
flags: int, prc: TVarTraceProc, clientData: TClientData): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_TraceVar2".}
|
|
||||||
proc UntraceVar*(interp: pInterp, varName: cstring, flags: int,
|
|
||||||
prc: TVarTraceProc, clientData: TClientData){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_UntraceVar".}
|
|
||||||
proc UntraceVar2*(interp: pInterp, varName: cstring, elemName: cstring,
|
|
||||||
flags: int, prc: TVarTraceProc, clientData: TClientData){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_UntraceVar2".}
|
|
||||||
proc GetVar*(interp: pInterp, varName: cstring, flags: int): cstring{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GetVar".}
|
|
||||||
proc GetVar2*(interp: pInterp, varName: cstring, elemName: cstring,
|
|
||||||
flags: int): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetVar2".}
|
|
||||||
proc SetVar*(interp: pInterp, varName: cstring, newValue: cstring,
|
|
||||||
flags: int): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetVar".}
|
|
||||||
proc SetVar2*(interp: pInterp, varName: cstring, elemName: cstring,
|
|
||||||
newValue: cstring, flags: int): cstring{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_SetVar2".}
|
|
||||||
proc UnsetVar*(interp: pInterp, varName: cstring, flags: int): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_UnsetVar".}
|
|
||||||
proc UnsetVar2*(interp: pInterp, varName: cstring, elemName: cstring,
|
|
||||||
flags: int): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_UnsetVar2".}
|
|
||||||
proc SetResult*(interp: pInterp, newValue: cstring, freeProc: TFreeProc){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_SetResult".}
|
|
||||||
proc FirstHashEntry*(hashTbl: pHashTable, searchInfo: var THashSearch): pHashEntry{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_FirstHashEntry".}
|
|
||||||
proc NextHashEntry*(searchInfo: var THashSearch): pHashEntry{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_NextHashEntry".}
|
|
||||||
proc InitHashTable*(hashTbl: pHashTable, keyType: int){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_InitHashTable".}
|
|
||||||
proc StringMatch*(str: cstring, pattern: cstring): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_StringMatch".}
|
|
||||||
proc GetErrno*(): int{.cdecl, dynlib: dllName, importc: "Tcl_GetErrno".}
|
|
||||||
proc SetErrno*(val: int){.cdecl, dynlib: dllName, importc: "Tcl_SetErrno".}
|
|
||||||
proc SetPanicProc*(prc: TPanicProc){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetPanicProc".}
|
|
||||||
proc PkgProvide*(interp: pInterp, name: cstring, version: cstring): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_PkgProvide".}
|
|
||||||
proc StaticPackage*(interp: pInterp, pkgName: cstring,
|
|
||||||
initProc: TPackageInitProc,
|
|
||||||
safeInitProc: TPackageInitProc){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_StaticPackage".}
|
|
||||||
proc CreateEventSource*(setupProc: TEventSetupProc,
|
|
||||||
checkProc: TEventCheckProc,
|
|
||||||
clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_CreateEventSource".}
|
|
||||||
proc DeleteEventSource*(setupProc: TEventSetupProc,
|
|
||||||
checkProc: TEventCheckProc,
|
|
||||||
clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DeleteEventSource".}
|
|
||||||
proc QueueEvent*(evPtr: pEvent, pos: int){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_QueueEvent".}
|
|
||||||
proc SetMaxBlockTime*(timePtr: pTime){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetMaxBlockTime".}
|
|
||||||
proc DeleteEvents*(prc: TEventDeleteProc, clientData: TClientData){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_DeleteEvents".}
|
|
||||||
proc DoOneEvent*(flags: int): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DoOneEvent".}
|
|
||||||
proc DoWhenIdle*(prc: TIdleProc, clientData: TClientData){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DoWhenIdle".}
|
|
||||||
proc CancelIdleCall*(prc: TIdleProc, clientData: TClientData){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_CancelIdleCall".}
|
|
||||||
proc CreateTimerHandler*(milliseconds: int, prc: TTimerProc,
|
|
||||||
clientData: TClientData): TTimerToken{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_CreateTimerHandler".}
|
|
||||||
proc DeleteTimerHandler*(token: TTimerToken){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DeleteTimerHandler".}
|
|
||||||
# procedure Tcl_CreateModalTimeout(milliseconds: integer; prc: TTclTimerProc; clientData: Tcl_ClientData); cdecl; external dllName;
|
|
||||||
# procedure Tcl_DeleteModalTimeout(prc: TTclTimerProc; clientData: Tcl_ClientData); cdecl; external dllName;
|
|
||||||
proc SplitList*(interp: pInterp, list: cstring, argcPtr: var int,
|
|
||||||
argvPtr: var TArgv): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SplitList".}
|
|
||||||
proc Merge*(argc: int, argv: TArgv): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Merge".}
|
|
||||||
proc Free*(p: cstring){.cdecl, dynlib: dllName, importc: "Tcl_Free".}
|
|
||||||
proc Init*(interp: pInterp): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Init".}
|
|
||||||
# procedure Tcl_InterpDeleteProc(clientData: Tcl_ClientData; interp: pTcl_Interp); cdecl; external dllName;
|
|
||||||
proc GetAssocData*(interp: pInterp, key: cstring, prc: var TInterpDeleteProc): TClientData{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_GetAssocData".}
|
|
||||||
proc DeleteAssocData*(interp: pInterp, key: cstring){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DeleteAssocData".}
|
|
||||||
proc SetAssocData*(interp: pInterp, key: cstring, prc: TInterpDeleteProc,
|
|
||||||
clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetAssocData".}
|
|
||||||
proc IsSafe*(interp: pInterp): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_IsSafe".}
|
|
||||||
proc MakeSafe*(interp: pInterp): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_MakeSafe".}
|
|
||||||
proc CreateSlave*(interp: pInterp, slaveName: cstring, isSafe: int): pInterp{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_CreateSlave".}
|
|
||||||
proc GetSlave*(interp: pInterp, slaveName: cstring): pInterp{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GetSlave".}
|
|
||||||
proc GetMaster*(interp: pInterp): pInterp{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetMaster".}
|
|
||||||
proc GetInterpPath*(askingInterp: pInterp, slaveInterp: pInterp): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_GetInterpPath".}
|
|
||||||
proc CreateAlias*(slaveInterp: pInterp, srcCmd: cstring,
|
|
||||||
targetInterp: pInterp, targetCmd: cstring, argc: int,
|
|
||||||
argv: TArgv): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_CreateAlias".}
|
|
||||||
proc GetAlias*(interp: pInterp, srcCmd: cstring, targetInterp: var pInterp,
|
|
||||||
targetCmd: var cstring, argc: var int, argv: var TArgv): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_GetAlias".}
|
|
||||||
proc ExposeCommand*(interp: pInterp, hiddenCmdName: cstring,
|
|
||||||
cmdName: cstring): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_ExposeCommand".}
|
|
||||||
proc HideCommand*(interp: pInterp, cmdName: cstring, hiddenCmdName: cstring): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_HideCommand".}
|
|
||||||
proc EventuallyFree*(clientData: TClientData, freeProc: TFreeProc){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_EventuallyFree".}
|
|
||||||
proc Preserve*(clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Preserve".}
|
|
||||||
proc Release*(clientData: TClientData){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Release".}
|
|
||||||
proc InterpDeleted*(interp: pInterp): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_InterpDeleted".}
|
|
||||||
proc GetCommandInfo*(interp: pInterp, cmdName: cstring,
|
|
||||||
info: var TCmdInfo): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetCommandInfo".}
|
|
||||||
proc SetCommandInfo*(interp: pInterp, cmdName: cstring,
|
|
||||||
info: var TCmdInfo): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetCommandInfo".}
|
|
||||||
proc FindExecutable*(path: cstring){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_FindExecutable".}
|
|
||||||
proc GetStringResult*(interp: pInterp): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetStringResult".}
|
|
||||||
#v1.0
|
|
||||||
proc FindCommand*(interp: pInterp, cmdName: cstring,
|
|
||||||
contextNsPtr: pNamespace, flags: int): TCommand{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_FindCommand".}
|
|
||||||
#v1.0
|
|
||||||
proc DeleteCommandFromToken*(interp: pInterp, cmd: pCommand): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DeleteCommandFromToken".}
|
|
||||||
proc CreateNamespace*(interp: pInterp, name: cstring,
|
|
||||||
clientData: TClientData,
|
|
||||||
deleteProc: TNamespaceDeleteProc): pNamespace{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_CreateNamespace".}
|
|
||||||
#v1.0
|
|
||||||
proc DeleteNamespace*(namespacePtr: pNamespace){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DeleteNamespace".}
|
|
||||||
proc FindNamespace*(interp: pInterp, name: cstring,
|
|
||||||
contextNsPtr: pNamespace, flags: int): pNamespace{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_FindNamespace".}
|
|
||||||
proc Tcl_Export*(interp: pInterp, namespacePtr: pNamespace, pattern: cstring,
|
|
||||||
resetListFirst: int): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Export".}
|
|
||||||
proc Tcl_Import*(interp: pInterp, namespacePtr: pNamespace, pattern: cstring,
|
|
||||||
allowOverwrite: int): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Import".}
|
|
||||||
proc GetCurrentNamespace*(interp: pInterp): pNamespace{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GetCurrentNamespace".}
|
|
||||||
proc GetGlobalNamespace*(interp: pInterp): pNamespace{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GetGlobalNamespace".}
|
|
||||||
proc PushCallFrame*(interp: pInterp, callFramePtr: var TCallFrame,
|
|
||||||
namespacePtr: pNamespace, isProcCallFrame: int): int{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_PushCallFrame".}
|
|
||||||
proc PopCallFrame*(interp: pInterp){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_PopCallFrame".}
|
|
||||||
proc VarEval*(interp: pInterp): int{.cdecl, varargs, dynlib: dllName,
|
|
||||||
importc: "Tcl_VarEval".}
|
|
||||||
# For TkConsole.c *
|
|
||||||
proc RecordAndEval*(interp: pInterp, cmd: cstring, flags: int): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_RecordAndEval".}
|
|
||||||
proc GlobalEval*(interp: pInterp, command: cstring): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GlobalEval".}
|
|
||||||
proc DStringFree*(dsPtr: pDString){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DStringFree".}
|
|
||||||
proc DStringAppend*(dsPtr: pDString, str: cstring, length: int): cstring{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_DStringAppend".}
|
|
||||||
proc DStringAppendElement*(dsPtr: pDString, str: cstring): cstring{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_DStringAppendElement".}
|
|
||||||
proc DStringInit*(dsPtr: pDString){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_DStringInit".}
|
|
||||||
proc AppendResult*(interp: pInterp){.cdecl, varargs, dynlib: dllName,
|
|
||||||
importc: "Tcl_AppendResult".}
|
|
||||||
# actually a "C" var array
|
|
||||||
proc SetStdChannel*(channel: pChannel, typ: int){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetStdChannel".}
|
|
||||||
proc SetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring,
|
|
||||||
newValue: cstring): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_SetChannelOption".}
|
|
||||||
proc GetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring,
|
|
||||||
dsPtr: pDString): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetChannelOption".}
|
|
||||||
proc CreateChannel*(typePtr: pChannelType, chanName: cstring,
|
|
||||||
instanceData: TClientData, mask: int): pChannel{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_CreateChannel".}
|
|
||||||
proc RegisterChannel*(interp: pInterp, channel: pChannel){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_RegisterChannel".}
|
|
||||||
proc UnregisterChannel*(interp: pInterp, channel: pChannel): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_UnregisterChannel".}
|
|
||||||
proc CreateChannelHandler*(chan: pChannel, mask: int, prc: TChannelProc,
|
|
||||||
clientData: TClientData){.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_CreateChannelHandler".}
|
|
||||||
proc GetChannel*(interp: pInterp, chanName: cstring, modePtr: pInteger): pChannel{.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_GetChannel".}
|
|
||||||
proc GetStdChannel*(typ: int): pChannel{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_GetStdChannel".}
|
|
||||||
proc Gets*(chan: pChannel, dsPtr: pDString): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Gets".}
|
|
||||||
proc Write*(chan: pChannel, s: cstring, slen: int): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_Write".}
|
|
||||||
proc Flush*(chan: pChannel): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_Flush".}
|
|
||||||
# TclWinLoadLibrary = function(name: PChar): HMODULE; cdecl; external dllName;
|
|
||||||
proc CreateExitHandler*(prc: TClientDataProc, clientData: TClientData){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_CreateExitHandler".}
|
|
||||||
proc DeleteExitHandler*(prc: TClientDataProc, clientData: TClientData){.
|
|
||||||
cdecl, dynlib: dllName, importc: "Tcl_DeleteExitHandler".}
|
|
||||||
proc GetStringFromObj*(pObj: pObj, pLen: pInteger): cstring{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GetStringFromObj".}
|
|
||||||
proc CreateObjCommand*(interp: pInterp, name: cstring, cmdProc: TObjCmdProc,
|
|
||||||
clientData: TClientData,
|
|
||||||
deleteProc: TCmdDeleteProc): pCommand{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_CreateObjCommand".}
|
|
||||||
proc NewStringObj*(bytes: cstring, length: int): pObj{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_NewStringObj".}
|
|
||||||
# procedure TclFreeObj(pObj: pTcl_Obj); cdecl; external dllName;
|
|
||||||
proc EvalObj*(interp: pInterp, pObj: pObj): int{.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_EvalObj".}
|
|
||||||
proc GlobalEvalObj*(interp: pInterp, pObj: pObj): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "Tcl_GlobalEvalObj".}
|
|
||||||
proc RegComp*(exp: cstring): pointer{.cdecl, dynlib: dllName,
|
|
||||||
importc: "TclRegComp".}
|
|
||||||
|
|
||||||
proc RegExec*(prog: pointer, str: cstring, start: cstring): int{.cdecl,
|
|
||||||
dynlib: dllName, importc: "TclRegExec".}
|
|
||||||
|
|
||||||
proc RegError*(msg: cstring){.cdecl, dynlib: dllName, importc: "TclRegError".}
|
|
||||||
|
|
||||||
proc GetRegError*(): cstring{.cdecl, dynlib: dllName,
|
|
||||||
importc: "TclGetRegError".}
|
|
||||||
|
|
||||||
proc RegExpRange*(prog: pointer, index: int, head: var cstring,
|
|
||||||
tail: var cstring){.cdecl, dynlib: dllName,
|
|
||||||
importc: "Tcl_RegExpRange".}
|
|
||||||
|
|
||||||
proc GetCommandTable*(interp: pInterp): pHashTable =
|
|
||||||
if interp != nil:
|
|
||||||
result = cast[pHashTable](cast[int](interp) + sizeof(Interp) +
|
|
||||||
sizeof(pointer))
|
|
||||||
|
|
||||||
proc CreateHashEntry*(tablePtr: pHashTable, key: cstring,
|
|
||||||
newPtr: pInteger): pHashEntry =
|
|
||||||
result = cast[pHashTable](tablePtr).createProc(tablePtr, key, newPtr)
|
|
||||||
|
|
||||||
proc FindHashEntry*(tablePtr: pHashTable, key: cstring): pHashEntry =
|
|
||||||
result = cast[pHashTable](tablePtr).findProc(tablePtr, key)
|
|
||||||
|
|
||||||
proc SetHashValue*(h: pHashEntry, clientData: TClientData) =
|
|
||||||
h.clientData = clientData
|
|
||||||
|
|
||||||
proc GetHashValue*(h: pHashEntry): TClientData =
|
|
||||||
result = h.clientData
|
|
||||||
|
|
||||||
proc IncrRefCount*(pObj: pObj) =
|
|
||||||
inc(pObj.refCount)
|
|
||||||
|
|
||||||
proc DecrRefCount*(pObj: pObj) =
|
|
||||||
dec(pObj.refCount)
|
|
||||||
if pObj.refCount <= 0:
|
|
||||||
dealloc(pObj)
|
|
||||||
|
|
||||||
proc IsShared*(pObj: pObj): bool =
|
|
||||||
return pObj.refCount > 1
|
|
||||||
|
|
||||||
proc GetHashKey*(hashTbl: pHashTable, hashEntry: pHashEntry): cstring =
|
|
||||||
if hashTbl == nil or hashEntry == nil:
|
|
||||||
result = nil
|
|
||||||
else:
|
|
||||||
result = hashEntry.key
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
# $Xorg: cursorfont.h,v 1.4 2001/02/09 02:03:39 xorgcvs Exp $
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#Copyright 1987, 1998 The Open Group
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
#documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
#the above copyright notice appear in all copies and that both that
|
|
||||||
#copyright notice and this permission notice appear in supporting
|
|
||||||
#documentation.
|
|
||||||
#
|
|
||||||
#The above copyright notice and this permission notice shall be included
|
|
||||||
#in all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
#OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
#IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
#OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
#ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
#OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
#Except as contained in this notice, the name of The Open Group shall
|
|
||||||
#not be used in advertising or otherwise to promote the sale, use or
|
|
||||||
#other dealings in this Software without prior written authorization
|
|
||||||
#from The Open Group.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
XC_num_glyphs* = 154
|
|
||||||
XC_X_cursor* = 0
|
|
||||||
XC_arrow* = 2
|
|
||||||
XC_based_arrow_down* = 4
|
|
||||||
XC_based_arrow_up* = 6
|
|
||||||
XC_boat* = 8
|
|
||||||
XC_bogosity* = 10
|
|
||||||
XC_bottom_left_corner* = 12
|
|
||||||
XC_bottom_right_corner* = 14
|
|
||||||
XC_bottom_side* = 16
|
|
||||||
XC_bottom_tee* = 18
|
|
||||||
XC_box_spiral* = 20
|
|
||||||
XC_center_ptr* = 22
|
|
||||||
XC_circle* = 24
|
|
||||||
XC_clock* = 26
|
|
||||||
XC_coffee_mug* = 28
|
|
||||||
XC_cross* = 30
|
|
||||||
XC_cross_reverse* = 32
|
|
||||||
XC_crosshair* = 34
|
|
||||||
XC_diamond_cross* = 36
|
|
||||||
XC_dot* = 38
|
|
||||||
XC_dotbox* = 40
|
|
||||||
XC_double_arrow* = 42
|
|
||||||
XC_draft_large* = 44
|
|
||||||
XC_draft_small* = 46
|
|
||||||
XC_draped_box* = 48
|
|
||||||
XC_exchange* = 50
|
|
||||||
XC_fleur* = 52
|
|
||||||
XC_gobbler* = 54
|
|
||||||
XC_gumby* = 56
|
|
||||||
XC_hand1* = 58
|
|
||||||
XC_hand2* = 60
|
|
||||||
XC_heart* = 62
|
|
||||||
XC_icon* = 64
|
|
||||||
XC_iron_cross* = 66
|
|
||||||
XC_left_ptr* = 68
|
|
||||||
XC_left_side* = 70
|
|
||||||
XC_left_tee* = 72
|
|
||||||
XC_leftbutton* = 74
|
|
||||||
XC_ll_angle* = 76
|
|
||||||
XC_lr_angle* = 78
|
|
||||||
XC_man* = 80
|
|
||||||
XC_middlebutton* = 82
|
|
||||||
XC_mouse* = 84
|
|
||||||
XC_pencil* = 86
|
|
||||||
XC_pirate* = 88
|
|
||||||
XC_plus* = 90
|
|
||||||
XC_question_arrow* = 92
|
|
||||||
XC_right_ptr* = 94
|
|
||||||
XC_right_side* = 96
|
|
||||||
XC_right_tee* = 98
|
|
||||||
XC_rightbutton* = 100
|
|
||||||
XC_rtl_logo* = 102
|
|
||||||
XC_sailboat* = 104
|
|
||||||
XC_sb_down_arrow* = 106
|
|
||||||
XC_sb_h_double_arrow* = 108
|
|
||||||
XC_sb_left_arrow* = 110
|
|
||||||
XC_sb_right_arrow* = 112
|
|
||||||
XC_sb_up_arrow* = 114
|
|
||||||
XC_sb_v_double_arrow* = 116
|
|
||||||
XC_shuttle* = 118
|
|
||||||
XC_sizing* = 120
|
|
||||||
XC_spider* = 122
|
|
||||||
XC_spraycan* = 124
|
|
||||||
XC_star* = 126
|
|
||||||
XC_target* = 128
|
|
||||||
XC_tcross* = 130
|
|
||||||
XC_top_left_arrow* = 132
|
|
||||||
XC_top_left_corner* = 134
|
|
||||||
XC_top_right_corner* = 136
|
|
||||||
XC_top_side* = 138
|
|
||||||
XC_top_tee* = 140
|
|
||||||
XC_trek* = 142
|
|
||||||
XC_ul_angle* = 144
|
|
||||||
XC_umbrella* = 146
|
|
||||||
XC_ur_angle* = 148
|
|
||||||
XC_watch* = 150
|
|
||||||
XC_xterm* = 152
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,401 +0,0 @@
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from x.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# x.h
|
|
||||||
#
|
|
||||||
# Pointers to basic pascal types, inserted by h2pas conversion program.
|
|
||||||
import unsigned
|
|
||||||
|
|
||||||
const
|
|
||||||
X_PROTOCOL* = 11
|
|
||||||
X_PROTOCOL_REVISION* = 0
|
|
||||||
|
|
||||||
type
|
|
||||||
PXID* = ptr TXID
|
|
||||||
TXID* = culong
|
|
||||||
PMask* = ptr TMask
|
|
||||||
TMask* = culong
|
|
||||||
PPAtom* = ptr PAtom
|
|
||||||
PAtom* = ptr TAtom
|
|
||||||
TAtom* = culong
|
|
||||||
PVisualID* = ptr TVisualID
|
|
||||||
TVisualID* = culong
|
|
||||||
PTime* = ptr TTime
|
|
||||||
TTime* = culong
|
|
||||||
PPWindow* = ptr PWindow
|
|
||||||
PWindow* = ptr TWindow
|
|
||||||
TWindow* = TXID
|
|
||||||
PDrawable* = ptr TDrawable
|
|
||||||
TDrawable* = TXID
|
|
||||||
PFont* = ptr TFont
|
|
||||||
TFont* = TXID
|
|
||||||
PPixmap* = ptr TPixmap
|
|
||||||
TPixmap* = TXID
|
|
||||||
PCursor* = ptr TCursor
|
|
||||||
TCursor* = TXID
|
|
||||||
PColormap* = ptr TColormap
|
|
||||||
TColormap* = TXID
|
|
||||||
PGContext* = ptr TGContext
|
|
||||||
TGContext* = TXID
|
|
||||||
PKeySym* = ptr TKeySym
|
|
||||||
TKeySym* = TXID
|
|
||||||
PKeyCode* = ptr TKeyCode
|
|
||||||
TKeyCode* = cuchar
|
|
||||||
|
|
||||||
proc `==`*(a, b: TAtom): bool =
|
|
||||||
return unsigned.`==`(a,b)
|
|
||||||
|
|
||||||
const
|
|
||||||
None* = 0
|
|
||||||
ParentRelative* = 1
|
|
||||||
CopyFromParent* = 0
|
|
||||||
PointerWindow* = 0
|
|
||||||
InputFocus* = 1
|
|
||||||
PointerRoot* = 1
|
|
||||||
AnyPropertyType* = 0
|
|
||||||
AnyKey* = 0
|
|
||||||
AnyButton* = 0
|
|
||||||
AllTemporary* = 0
|
|
||||||
CurrentTime* = 0
|
|
||||||
NoSymbol* = 0
|
|
||||||
NoEventMask* = 0
|
|
||||||
KeyPressMask* = 1 shl 0
|
|
||||||
KeyReleaseMask* = 1 shl 1
|
|
||||||
ButtonPressMask* = 1 shl 2
|
|
||||||
ButtonReleaseMask* = 1 shl 3
|
|
||||||
EnterWindowMask* = 1 shl 4
|
|
||||||
LeaveWindowMask* = 1 shl 5
|
|
||||||
PointerMotionMask* = 1 shl 6
|
|
||||||
PointerMotionHintMask* = 1 shl 7
|
|
||||||
Button1MotionMask* = 1 shl 8
|
|
||||||
Button2MotionMask* = 1 shl 9
|
|
||||||
Button3MotionMask* = 1 shl 10
|
|
||||||
Button4MotionMask* = 1 shl 11
|
|
||||||
Button5MotionMask* = 1 shl 12
|
|
||||||
ButtonMotionMask* = 1 shl 13
|
|
||||||
KeymapStateMask* = 1 shl 14
|
|
||||||
ExposureMask* = 1 shl 15
|
|
||||||
VisibilityChangeMask* = 1 shl 16
|
|
||||||
StructureNotifyMask* = 1 shl 17
|
|
||||||
ResizeRedirectMask* = 1 shl 18
|
|
||||||
SubstructureNotifyMask* = 1 shl 19
|
|
||||||
SubstructureRedirectMask* = 1 shl 20
|
|
||||||
FocusChangeMask* = 1 shl 21
|
|
||||||
PropertyChangeMask* = 1 shl 22
|
|
||||||
ColormapChangeMask* = 1 shl 23
|
|
||||||
OwnerGrabButtonMask* = 1 shl 24
|
|
||||||
KeyPress* = 2
|
|
||||||
KeyRelease* = 3
|
|
||||||
ButtonPress* = 4
|
|
||||||
ButtonRelease* = 5
|
|
||||||
MotionNotify* = 6
|
|
||||||
EnterNotify* = 7
|
|
||||||
LeaveNotify* = 8
|
|
||||||
FocusIn* = 9
|
|
||||||
FocusOut* = 10
|
|
||||||
KeymapNotify* = 11
|
|
||||||
Expose* = 12
|
|
||||||
GraphicsExpose* = 13
|
|
||||||
NoExpose* = 14
|
|
||||||
VisibilityNotify* = 15
|
|
||||||
CreateNotify* = 16
|
|
||||||
DestroyNotify* = 17
|
|
||||||
UnmapNotify* = 18
|
|
||||||
MapNotify* = 19
|
|
||||||
MapRequest* = 20
|
|
||||||
ReparentNotify* = 21
|
|
||||||
ConfigureNotify* = 22
|
|
||||||
ConfigureRequest* = 23
|
|
||||||
GravityNotify* = 24
|
|
||||||
ResizeRequest* = 25
|
|
||||||
CirculateNotify* = 26
|
|
||||||
CirculateRequest* = 27
|
|
||||||
PropertyNotify* = 28
|
|
||||||
SelectionClear* = 29
|
|
||||||
SelectionRequest* = 30
|
|
||||||
SelectionNotify* = 31
|
|
||||||
ColormapNotify* = 32
|
|
||||||
ClientMessage* = 33
|
|
||||||
MappingNotify* = 34
|
|
||||||
LASTEvent* = 35
|
|
||||||
ShiftMask* = 1 shl 0
|
|
||||||
LockMask* = 1 shl 1
|
|
||||||
ControlMask* = 1 shl 2
|
|
||||||
Mod1Mask* = 1 shl 3
|
|
||||||
Mod2Mask* = 1 shl 4
|
|
||||||
Mod3Mask* = 1 shl 5
|
|
||||||
Mod4Mask* = 1 shl 6
|
|
||||||
Mod5Mask* = 1 shl 7
|
|
||||||
ShiftMapIndex* = 0
|
|
||||||
LockMapIndex* = 1
|
|
||||||
ControlMapIndex* = 2
|
|
||||||
Mod1MapIndex* = 3
|
|
||||||
Mod2MapIndex* = 4
|
|
||||||
Mod3MapIndex* = 5
|
|
||||||
Mod4MapIndex* = 6
|
|
||||||
Mod5MapIndex* = 7
|
|
||||||
Button1Mask* = 1 shl 8
|
|
||||||
Button2Mask* = 1 shl 9
|
|
||||||
Button3Mask* = 1 shl 10
|
|
||||||
Button4Mask* = 1 shl 11
|
|
||||||
Button5Mask* = 1 shl 12
|
|
||||||
AnyModifier* = 1 shl 15
|
|
||||||
Button1* = 1
|
|
||||||
Button2* = 2
|
|
||||||
Button3* = 3
|
|
||||||
Button4* = 4
|
|
||||||
Button5* = 5
|
|
||||||
NotifyNormal* = 0
|
|
||||||
NotifyGrab* = 1
|
|
||||||
NotifyUngrab* = 2
|
|
||||||
NotifyWhileGrabbed* = 3
|
|
||||||
NotifyHint* = 1
|
|
||||||
NotifyAncestor* = 0
|
|
||||||
NotifyVirtual* = 1
|
|
||||||
NotifyInferior* = 2
|
|
||||||
NotifyNonlinear* = 3
|
|
||||||
NotifyNonlinearVirtual* = 4
|
|
||||||
NotifyPointer* = 5
|
|
||||||
NotifyPointerRoot* = 6
|
|
||||||
NotifyDetailNone* = 7
|
|
||||||
VisibilityUnobscured* = 0
|
|
||||||
VisibilityPartiallyObscured* = 1
|
|
||||||
VisibilityFullyObscured* = 2
|
|
||||||
PlaceOnTop* = 0
|
|
||||||
PlaceOnBottom* = 1
|
|
||||||
FamilyInternet* = 0
|
|
||||||
FamilyDECnet* = 1
|
|
||||||
FamilyChaos* = 2
|
|
||||||
FamilyInternet6* = 6
|
|
||||||
FamilyServerInterpreted* = 5
|
|
||||||
PropertyNewValue* = 0
|
|
||||||
PropertyDelete* = 1
|
|
||||||
ColormapUninstalled* = 0
|
|
||||||
ColormapInstalled* = 1
|
|
||||||
GrabModeSync* = 0
|
|
||||||
GrabModeAsync* = 1
|
|
||||||
GrabSuccess* = 0
|
|
||||||
AlreadyGrabbed* = 1
|
|
||||||
GrabInvalidTime* = 2
|
|
||||||
GrabNotViewable* = 3
|
|
||||||
GrabFrozen* = 4
|
|
||||||
AsyncPointer* = 0
|
|
||||||
SyncPointer* = 1
|
|
||||||
ReplayPointer* = 2
|
|
||||||
AsyncKeyboard* = 3
|
|
||||||
SyncKeyboard* = 4
|
|
||||||
ReplayKeyboard* = 5
|
|
||||||
AsyncBoth* = 6
|
|
||||||
SyncBoth* = 7
|
|
||||||
RevertToNone* = None
|
|
||||||
RevertToPointerRoot* = PointerRoot
|
|
||||||
RevertToParent* = 2
|
|
||||||
Success* = 0
|
|
||||||
BadRequest* = 1
|
|
||||||
BadValue* = 2
|
|
||||||
BadWindow* = 3
|
|
||||||
BadPixmap* = 4
|
|
||||||
BadAtom* = 5
|
|
||||||
BadCursor* = 6
|
|
||||||
BadFont* = 7
|
|
||||||
BadMatch* = 8
|
|
||||||
BadDrawable* = 9
|
|
||||||
BadAccess* = 10
|
|
||||||
BadAlloc* = 11
|
|
||||||
BadColor* = 12
|
|
||||||
BadGC* = 13
|
|
||||||
BadIDChoice* = 14
|
|
||||||
BadName* = 15
|
|
||||||
BadLength* = 16
|
|
||||||
BadImplementation* = 17
|
|
||||||
FirstExtensionError* = 128
|
|
||||||
LastExtensionError* = 255
|
|
||||||
InputOutput* = 1
|
|
||||||
InputOnly* = 2
|
|
||||||
CWBackPixmap* = 1 shl 0
|
|
||||||
CWBackPixel* = 1 shl 1
|
|
||||||
CWBorderPixmap* = 1 shl 2
|
|
||||||
CWBorderPixel* = 1 shl 3
|
|
||||||
CWBitGravity* = 1 shl 4
|
|
||||||
CWWinGravity* = 1 shl 5
|
|
||||||
CWBackingStore* = 1 shl 6
|
|
||||||
CWBackingPlanes* = 1 shl 7
|
|
||||||
CWBackingPixel* = 1 shl 8
|
|
||||||
CWOverrideRedirect* = 1 shl 9
|
|
||||||
CWSaveUnder* = 1 shl 10
|
|
||||||
CWEventMask* = 1 shl 11
|
|
||||||
CWDontPropagate* = 1 shl 12
|
|
||||||
CWColormap* = 1 shl 13
|
|
||||||
CWCursor* = 1 shl 14
|
|
||||||
CWX* = 1 shl 0
|
|
||||||
CWY* = 1 shl 1
|
|
||||||
CWWidth* = 1 shl 2
|
|
||||||
CWHeight* = 1 shl 3
|
|
||||||
CWBorderWidth* = 1 shl 4
|
|
||||||
CWSibling* = 1 shl 5
|
|
||||||
CWStackMode* = 1 shl 6
|
|
||||||
ForgetGravity* = 0
|
|
||||||
NorthWestGravity* = 1
|
|
||||||
NorthGravity* = 2
|
|
||||||
NorthEastGravity* = 3
|
|
||||||
WestGravity* = 4
|
|
||||||
CenterGravity* = 5
|
|
||||||
EastGravity* = 6
|
|
||||||
SouthWestGravity* = 7
|
|
||||||
SouthGravity* = 8
|
|
||||||
SouthEastGravity* = 9
|
|
||||||
StaticGravity* = 10
|
|
||||||
UnmapGravity* = 0
|
|
||||||
NotUseful* = 0
|
|
||||||
WhenMapped* = 1
|
|
||||||
Always* = 2
|
|
||||||
IsUnmapped* = 0
|
|
||||||
IsUnviewable* = 1
|
|
||||||
IsViewable* = 2
|
|
||||||
SetModeInsert* = 0
|
|
||||||
SetModeDelete* = 1
|
|
||||||
DestroyAll* = 0
|
|
||||||
RetainPermanent* = 1
|
|
||||||
RetainTemporary* = 2
|
|
||||||
Above* = 0
|
|
||||||
Below* = 1
|
|
||||||
TopIf* = 2
|
|
||||||
BottomIf* = 3
|
|
||||||
Opposite* = 4
|
|
||||||
RaiseLowest* = 0
|
|
||||||
LowerHighest* = 1
|
|
||||||
PropModeReplace* = 0
|
|
||||||
PropModePrepend* = 1
|
|
||||||
PropModeAppend* = 2
|
|
||||||
GXclear* = 0x00000000
|
|
||||||
GXand* = 0x00000001
|
|
||||||
GXandReverse* = 0x00000002
|
|
||||||
GXcopy* = 0x00000003
|
|
||||||
GXandInverted* = 0x00000004
|
|
||||||
GXnoop* = 0x00000005
|
|
||||||
GXxor* = 0x00000006
|
|
||||||
GXor* = 0x00000007
|
|
||||||
GXnor* = 0x00000008
|
|
||||||
GXequiv* = 0x00000009
|
|
||||||
GXinvert* = 0x0000000A
|
|
||||||
GXorReverse* = 0x0000000B
|
|
||||||
GXcopyInverted* = 0x0000000C
|
|
||||||
GXorInverted* = 0x0000000D
|
|
||||||
GXnand* = 0x0000000E
|
|
||||||
GXset* = 0x0000000F
|
|
||||||
LineSolid* = 0
|
|
||||||
LineOnOffDash* = 1
|
|
||||||
LineDoubleDash* = 2
|
|
||||||
CapNotLast* = 0
|
|
||||||
CapButt* = 1
|
|
||||||
CapRound* = 2
|
|
||||||
CapProjecting* = 3
|
|
||||||
JoinMiter* = 0
|
|
||||||
JoinRound* = 1
|
|
||||||
JoinBevel* = 2
|
|
||||||
FillSolid* = 0
|
|
||||||
FillTiled* = 1
|
|
||||||
FillStippled* = 2
|
|
||||||
FillOpaqueStippled* = 3
|
|
||||||
EvenOddRule* = 0
|
|
||||||
WindingRule* = 1
|
|
||||||
ClipByChildren* = 0
|
|
||||||
IncludeInferiors* = 1
|
|
||||||
Unsorted* = 0
|
|
||||||
YSorted* = 1
|
|
||||||
YXSorted* = 2
|
|
||||||
YXBanded* = 3
|
|
||||||
CoordModeOrigin* = 0
|
|
||||||
CoordModePrevious* = 1
|
|
||||||
Complex* = 0
|
|
||||||
Nonconvex* = 1
|
|
||||||
Convex* = 2
|
|
||||||
ArcChord* = 0
|
|
||||||
ArcPieSlice* = 1
|
|
||||||
GCFunction* = 1 shl 0
|
|
||||||
GCPlaneMask* = 1 shl 1
|
|
||||||
GCForeground* = 1 shl 2
|
|
||||||
GCBackground* = 1 shl 3
|
|
||||||
GCLineWidth* = 1 shl 4
|
|
||||||
GCLineStyle* = 1 shl 5
|
|
||||||
GCCapStyle* = 1 shl 6
|
|
||||||
GCJoinStyle* = 1 shl 7
|
|
||||||
GCFillStyle* = 1 shl 8
|
|
||||||
GCFillRule* = 1 shl 9
|
|
||||||
GCTile* = 1 shl 10
|
|
||||||
GCStipple* = 1 shl 11
|
|
||||||
GCTileStipXOrigin* = 1 shl 12
|
|
||||||
GCTileStipYOrigin* = 1 shl 13
|
|
||||||
GCFont* = 1 shl 14
|
|
||||||
GCSubwindowMode* = 1 shl 15
|
|
||||||
GCGraphicsExposures* = 1 shl 16
|
|
||||||
GCClipXOrigin* = 1 shl 17
|
|
||||||
GCClipYOrigin* = 1 shl 18
|
|
||||||
GCClipMask* = 1 shl 19
|
|
||||||
GCDashOffset* = 1 shl 20
|
|
||||||
GCDashList* = 1 shl 21
|
|
||||||
GCArcMode* = 1 shl 22
|
|
||||||
GCLastBit* = 22
|
|
||||||
FontLeftToRight* = 0
|
|
||||||
FontRightToLeft* = 1
|
|
||||||
FontChange* = 255
|
|
||||||
XYBitmap* = 0
|
|
||||||
XYPixmap* = 1
|
|
||||||
ZPixmap* = 2
|
|
||||||
AllocNone* = 0
|
|
||||||
AllocAll* = 1
|
|
||||||
DoRed* = 1 shl 0
|
|
||||||
DoGreen* = 1 shl 1
|
|
||||||
DoBlue* = 1 shl 2
|
|
||||||
CursorShape* = 0
|
|
||||||
TileShape* = 1
|
|
||||||
StippleShape* = 2
|
|
||||||
AutoRepeatModeOff* = 0
|
|
||||||
AutoRepeatModeOn* = 1
|
|
||||||
AutoRepeatModeDefault* = 2
|
|
||||||
LedModeOff* = 0
|
|
||||||
LedModeOn* = 1
|
|
||||||
KBKeyClickPercent* = 1 shl 0
|
|
||||||
KBBellPercent* = 1 shl 1
|
|
||||||
KBBellPitch* = 1 shl 2
|
|
||||||
KBBellDuration* = 1 shl 3
|
|
||||||
KBLed* = 1 shl 4
|
|
||||||
KBLedMode* = 1 shl 5
|
|
||||||
KBKey* = 1 shl 6
|
|
||||||
KBAutoRepeatMode* = 1 shl 7
|
|
||||||
MappingSuccess* = 0
|
|
||||||
MappingBusy* = 1
|
|
||||||
MappingFailed* = 2
|
|
||||||
MappingModifier* = 0
|
|
||||||
MappingKeyboard* = 1
|
|
||||||
MappingPointer* = 2
|
|
||||||
DontPreferBlanking* = 0
|
|
||||||
PreferBlanking* = 1
|
|
||||||
DefaultBlanking* = 2
|
|
||||||
DisableScreenSaver* = 0
|
|
||||||
DisableScreenInterval* = 0
|
|
||||||
DontAllowExposures* = 0
|
|
||||||
AllowExposures* = 1
|
|
||||||
DefaultExposures* = 2
|
|
||||||
ScreenSaverReset* = 0
|
|
||||||
ScreenSaverActive* = 1
|
|
||||||
HostInsert* = 0
|
|
||||||
HostDelete* = 1
|
|
||||||
EnableAccess* = 1
|
|
||||||
DisableAccess* = 0
|
|
||||||
StaticGray* = 0
|
|
||||||
GrayScale* = 1
|
|
||||||
StaticColor* = 2
|
|
||||||
PseudoColor* = 3
|
|
||||||
TrueColor* = 4
|
|
||||||
DirectColor* = 5
|
|
||||||
LSBFirst* = 0
|
|
||||||
MSBFirst* = 1
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
# included from xlib bindings
|
|
||||||
|
|
||||||
|
|
||||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
|
||||||
{.pragma: libx11, cdecl, importc.}
|
|
||||||
{.pragma: libx11c, cdecl.}
|
|
||||||
when defined(use_pkg_config_static):
|
|
||||||
{.passl: gorge("pkg-config x11 --static --libs").}
|
|
||||||
else:
|
|
||||||
{.passl: gorge("pkg-config x11 --libs").}
|
|
||||||
else:
|
|
||||||
when defined(macosx):
|
|
||||||
const
|
|
||||||
libX11* = "libX11.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
libX11* = "libX11.so"
|
|
||||||
|
|
||||||
{.pragma: libx11, cdecl, dynlib: libX11, importc.}
|
|
||||||
{.pragma: libx11c, cdecl, dynlib: libX11.}
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
#
|
|
||||||
# THIS IS A GENERATED FILE
|
|
||||||
#
|
|
||||||
# Do not change! Changing this file implies a protocol change!
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
X
|
|
||||||
|
|
||||||
const
|
|
||||||
XA_PRIMARY* = TAtom(1)
|
|
||||||
XA_SECONDARY* = TAtom(2)
|
|
||||||
XA_ARC* = TAtom(3)
|
|
||||||
XA_ATOM* = TAtom(4)
|
|
||||||
XA_BITMAP* = TAtom(5)
|
|
||||||
XA_CARDINAL* = TAtom(6)
|
|
||||||
XA_COLORMAP* = TAtom(7)
|
|
||||||
XA_CURSOR* = TAtom(8)
|
|
||||||
XA_CUT_BUFFER0* = TAtom(9)
|
|
||||||
XA_CUT_BUFFER1* = TAtom(10)
|
|
||||||
XA_CUT_BUFFER2* = TAtom(11)
|
|
||||||
XA_CUT_BUFFER3* = TAtom(12)
|
|
||||||
XA_CUT_BUFFER4* = TAtom(13)
|
|
||||||
XA_CUT_BUFFER5* = TAtom(14)
|
|
||||||
XA_CUT_BUFFER6* = TAtom(15)
|
|
||||||
XA_CUT_BUFFER7* = TAtom(16)
|
|
||||||
XA_DRAWABLE* = TAtom(17)
|
|
||||||
XA_FONT* = TAtom(18)
|
|
||||||
XA_INTEGER* = TAtom(19)
|
|
||||||
XA_PIXMAP* = TAtom(20)
|
|
||||||
XA_POINT* = TAtom(21)
|
|
||||||
XA_RECTANGLE* = TAtom(22)
|
|
||||||
XA_RESOURCE_MANAGER* = TAtom(23)
|
|
||||||
XA_RGB_COLOR_MAP* = TAtom(24)
|
|
||||||
XA_RGB_BEST_MAP* = TAtom(25)
|
|
||||||
XA_RGB_BLUE_MAP* = TAtom(26)
|
|
||||||
XA_RGB_DEFAULT_MAP* = TAtom(27)
|
|
||||||
XA_RGB_GRAY_MAP* = TAtom(28)
|
|
||||||
XA_RGB_GREEN_MAP* = TAtom(29)
|
|
||||||
XA_RGB_RED_MAP* = TAtom(30)
|
|
||||||
XA_STRING* = TAtom(31)
|
|
||||||
XA_VISUALID* = TAtom(32)
|
|
||||||
XA_WINDOW* = TAtom(33)
|
|
||||||
XA_WM_COMMAND* = TAtom(34)
|
|
||||||
XA_WM_HINTS* = TAtom(35)
|
|
||||||
XA_WM_CLIENT_MACHINE* = TAtom(36)
|
|
||||||
XA_WM_ICON_NAME* = TAtom(37)
|
|
||||||
XA_WM_ICON_SIZE* = TAtom(38)
|
|
||||||
XA_WM_NAME* = TAtom(39)
|
|
||||||
XA_WM_NORMAL_HINTS* = TAtom(40)
|
|
||||||
XA_WM_SIZE_HINTS* = TAtom(41)
|
|
||||||
XA_WM_ZOOM_HINTS* = TAtom(42)
|
|
||||||
XA_MIN_SPACE* = TAtom(43)
|
|
||||||
XA_NORM_SPACE* = TAtom(44)
|
|
||||||
XA_MAX_SPACE* = TAtom(45)
|
|
||||||
XA_END_SPACE* = TAtom(46)
|
|
||||||
XA_SUPERSCRIPT_X* = TAtom(47)
|
|
||||||
XA_SUPERSCRIPT_Y* = TAtom(48)
|
|
||||||
XA_SUBSCRIPT_X* = TAtom(49)
|
|
||||||
XA_SUBSCRIPT_Y* = TAtom(50)
|
|
||||||
XA_UNDERLINE_POSITION* = TAtom(51)
|
|
||||||
XA_UNDERLINE_THICKNESS* = TAtom(52)
|
|
||||||
XA_STRIKEOUT_ASCENT* = TAtom(53)
|
|
||||||
XA_STRIKEOUT_DESCENT* = TAtom(54)
|
|
||||||
XA_ITALIC_ANGLE* = TAtom(55)
|
|
||||||
XA_X_HEIGHT* = TAtom(56)
|
|
||||||
XA_QUAD_WIDTH* = TAtom(57)
|
|
||||||
XA_WEIGHT* = TAtom(58)
|
|
||||||
XA_POINT_SIZE* = TAtom(59)
|
|
||||||
XA_RESOLUTION* = TAtom(60)
|
|
||||||
XA_COPYRIGHT* = TAtom(61)
|
|
||||||
XA_NOTICE* = TAtom(62)
|
|
||||||
XA_FONT_NAME* = TAtom(63)
|
|
||||||
XA_FAMILY_NAME* = TAtom(64)
|
|
||||||
XA_FULL_NAME* = TAtom(65)
|
|
||||||
XA_CAP_HEIGHT* = TAtom(66)
|
|
||||||
XA_WM_CLASS* = TAtom(67)
|
|
||||||
XA_WM_TRANSIENT_FOR* = TAtom(68)
|
|
||||||
XA_LAST_PREDEFINED* = TAtom(68)
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,396 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
#const
|
|
||||||
# libX11* = "X11"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from xcms.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# xcms.h
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
XcmsFailure* = 0
|
|
||||||
XcmsSuccess* = 1
|
|
||||||
XcmsSuccessWithCompression* = 2
|
|
||||||
|
|
||||||
type
|
|
||||||
PXcmsColorFormat* = ptr TXcmsColorFormat
|
|
||||||
TXcmsColorFormat* = int32
|
|
||||||
|
|
||||||
proc XcmsUndefinedFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsCIEXYZFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsCIEuvYFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsCIExyYFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsCIELabFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsCIELuvFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsTekHVCFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsRGBFormat*(): TXcmsColorFormat
|
|
||||||
proc XcmsRGBiFormat*(): TXcmsColorFormat
|
|
||||||
const
|
|
||||||
XcmsInitNone* = 0x00000000
|
|
||||||
XcmsInitSuccess* = 0x00000001
|
|
||||||
XcmsInitFailure* = 0x000000FF
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc DisplayOfCCC*(ccc: int32): int32
|
|
||||||
proc ScreenNumberOfCCC*(ccc: int32): int32
|
|
||||||
proc VisualOfCCC*(ccc: int32): int32
|
|
||||||
proc ClientWhitePointOfCCC*(ccc: int32): int32
|
|
||||||
proc ScreenWhitePointOfCCC*(ccc: int32): int32
|
|
||||||
proc FunctionSetOfCCC*(ccc: int32): int32
|
|
||||||
type
|
|
||||||
PXcmsFloat* = ptr TXcmsFloat
|
|
||||||
TXcmsFloat* = float64
|
|
||||||
PXcmsRGB* = ptr TXcmsRGB
|
|
||||||
TXcmsRGB*{.final.} = object
|
|
||||||
red*: int16
|
|
||||||
green*: int16
|
|
||||||
blue*: int16
|
|
||||||
|
|
||||||
PXcmsRGBi* = ptr TXcmsRGBi
|
|
||||||
TXcmsRGBi*{.final.} = object
|
|
||||||
red*: TXcmsFloat
|
|
||||||
green*: TXcmsFloat
|
|
||||||
blue*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsCIEXYZ* = ptr TXcmsCIEXYZ
|
|
||||||
TXcmsCIEXYZ*{.final.} = object
|
|
||||||
X*: TXcmsFloat
|
|
||||||
Y*: TXcmsFloat
|
|
||||||
Z*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsCIEuvY* = ptr TXcmsCIEuvY
|
|
||||||
TXcmsCIEuvY*{.final.} = object
|
|
||||||
u_prime*: TXcmsFloat
|
|
||||||
v_prime*: TXcmsFloat
|
|
||||||
Y*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsCIExyY* = ptr TXcmsCIExyY
|
|
||||||
TXcmsCIExyY*{.final.} = object
|
|
||||||
x*: TXcmsFloat
|
|
||||||
y*: TXcmsFloat
|
|
||||||
theY*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsCIELab* = ptr TXcmsCIELab
|
|
||||||
TXcmsCIELab*{.final.} = object
|
|
||||||
L_star*: TXcmsFloat
|
|
||||||
a_star*: TXcmsFloat
|
|
||||||
b_star*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsCIELuv* = ptr TXcmsCIELuv
|
|
||||||
TXcmsCIELuv*{.final.} = object
|
|
||||||
L_star*: TXcmsFloat
|
|
||||||
u_star*: TXcmsFloat
|
|
||||||
v_star*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsTekHVC* = ptr TXcmsTekHVC
|
|
||||||
TXcmsTekHVC*{.final.} = object
|
|
||||||
H*: TXcmsFloat
|
|
||||||
V*: TXcmsFloat
|
|
||||||
C*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsPad* = ptr TXcmsPad
|
|
||||||
TXcmsPad*{.final.} = object
|
|
||||||
pad0*: TXcmsFloat
|
|
||||||
pad1*: TXcmsFloat
|
|
||||||
pad2*: TXcmsFloat
|
|
||||||
pad3*: TXcmsFloat
|
|
||||||
|
|
||||||
PXcmsColor* = ptr TXcmsColor
|
|
||||||
TXcmsColor*{.final.} = object # spec : record
|
|
||||||
# case longint of
|
|
||||||
# 0 : ( RGB : TXcmsRGB );
|
|
||||||
# 1 : ( RGBi : TXcmsRGBi );
|
|
||||||
# 2 : ( CIEXYZ : TXcmsCIEXYZ );
|
|
||||||
# 3 : ( CIEuvY : TXcmsCIEuvY );
|
|
||||||
# 4 : ( CIExyY : TXcmsCIExyY );
|
|
||||||
# 5 : ( CIELab : TXcmsCIELab );
|
|
||||||
# 6 : ( CIELuv : TXcmsCIELuv );
|
|
||||||
# 7 : ( TekHVC : TXcmsTekHVC );
|
|
||||||
# 8 : ( Pad : TXcmsPad );
|
|
||||||
# end;
|
|
||||||
pad*: TXcmsPad
|
|
||||||
pixel*: int32
|
|
||||||
format*: TXcmsColorFormat
|
|
||||||
|
|
||||||
PXcmsPerScrnInfo* = ptr TXcmsPerScrnInfo
|
|
||||||
TXcmsPerScrnInfo*{.final.} = object
|
|
||||||
screenWhitePt*: TXcmsColor
|
|
||||||
functionSet*: TXPointer
|
|
||||||
screenData*: TXPointer
|
|
||||||
state*: int8
|
|
||||||
pad*: array[0..2, char]
|
|
||||||
|
|
||||||
PXcmsCCC* = ptr TXcmsCCC
|
|
||||||
TXcmsCompressionProc* = proc (para1: PXcmsCCC, para2: PXcmsColor,
|
|
||||||
para3: int32, para4: int32, para5: PBool): TStatus{.
|
|
||||||
cdecl.}
|
|
||||||
TXcmsWhiteAdjustProc* = proc (para1: PXcmsCCC, para2: PXcmsColor,
|
|
||||||
para3: PXcmsColor, para4: TXcmsColorFormat,
|
|
||||||
para5: PXcmsColor, para6: int32, para7: PBool): TStatus{.
|
|
||||||
cdecl.}
|
|
||||||
TXcmsCCC*{.final.} = object
|
|
||||||
dpy*: PDisplay
|
|
||||||
screenNumber*: int32
|
|
||||||
visual*: PVisual
|
|
||||||
clientWhitePt*: TXcmsColor
|
|
||||||
gamutCompProc*: TXcmsCompressionProc
|
|
||||||
gamutCompClientData*: TXPointer
|
|
||||||
whitePtAdjProc*: TXcmsWhiteAdjustProc
|
|
||||||
whitePtAdjClientData*: TXPointer
|
|
||||||
pPerScrnInfo*: PXcmsPerScrnInfo
|
|
||||||
|
|
||||||
TXcmsCCCRec* = TXcmsCCC
|
|
||||||
PXcmsCCCRec* = ptr TXcmsCCCRec
|
|
||||||
TXcmsScreenInitProc* = proc (para1: PDisplay, para2: int32,
|
|
||||||
para3: PXcmsPerScrnInfo): TStatus{.cdecl.}
|
|
||||||
TXcmsScreenFreeProc* = proc (para1: TXPointer){.cdecl.}
|
|
||||||
TXcmsConversionProc* = proc (){.cdecl.}
|
|
||||||
PXcmsFuncListPtr* = ptr TXcmsFuncListPtr
|
|
||||||
TXcmsFuncListPtr* = TXcmsConversionProc
|
|
||||||
TXcmsParseStringProc* = proc (para1: cstring, para2: PXcmsColor): int32{.cdecl.}
|
|
||||||
PXcmsColorSpace* = ptr TXcmsColorSpace
|
|
||||||
TXcmsColorSpace*{.final.} = object
|
|
||||||
prefix*: cstring
|
|
||||||
id*: TXcmsColorFormat
|
|
||||||
parseString*: TXcmsParseStringProc
|
|
||||||
to_CIEXYZ*: TXcmsFuncListPtr
|
|
||||||
from_CIEXYZ*: TXcmsFuncListPtr
|
|
||||||
inverse_flag*: int32
|
|
||||||
|
|
||||||
PXcmsFunctionSet* = ptr TXcmsFunctionSet
|
|
||||||
TXcmsFunctionSet*{.final.} = object # error
|
|
||||||
#extern Status XcmsAddColorSpace (
|
|
||||||
#in declaration at line 323
|
|
||||||
DDColorSpaces*: ptr PXcmsColorSpace
|
|
||||||
screenInitProc*: TXcmsScreenInitProc
|
|
||||||
screenFreeProc*: TXcmsScreenFreeProc
|
|
||||||
|
|
||||||
|
|
||||||
proc XcmsAddFunctionSet*(para1: PXcmsFunctionSet): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsAllocColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor,
|
|
||||||
para4: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsAllocNamedColor*(para1: PDisplay, para2: TColormap, para3: cstring,
|
|
||||||
para4: PXcmsColor, para5: PXcmsColor,
|
|
||||||
para6: TXcmsColorFormat): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCCCOfColormap*(para1: PDisplay, para2: TColormap): TXcmsCCC{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabClipab*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabClipL*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabClipLab*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELabQueryMaxL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELabQueryMaxLC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabQueryMinL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELabToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELabWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor,
|
|
||||||
para3: PXcmsColor, para4: TXcmsColorFormat,
|
|
||||||
para5: PXcmsColor, para6: int32, para7: PBool): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvClipL*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvClipLuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvClipuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELuvQueryMaxL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELuvQueryMaxLC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvQueryMinL*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsCIELuvToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIELuvWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor,
|
|
||||||
para3: PXcmsColor, para4: TXcmsColorFormat,
|
|
||||||
para5: PXcmsColor, para6: int32, para7: PBool): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEXYZToCIELab*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEXYZToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEXYZToCIExyY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEXYZToRGBi*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEuvYToCIELuv*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEuvYToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIEuvYToTekHVC*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsCIExyYToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsClientWhitePointOfCCC*(para1: TXcmsCCC): PXcmsColor{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsConvertColors*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: TXcmsColorFormat, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsCreateCCC*(para1: PDisplay, para2: int32, para3: PVisual,
|
|
||||||
para4: PXcmsColor, para5: TXcmsCompressionProc,
|
|
||||||
para6: TXPointer, para7: TXcmsWhiteAdjustProc,
|
|
||||||
para8: TXPointer): TXcmsCCC{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsDefaultCCC*(para1: PDisplay, para2: int32): TXcmsCCC{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsDisplayOfCCC*(para1: TXcmsCCC): PDisplay{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsFormatOfPrefix*(para1: cstring): TXcmsColorFormat{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsFreeCCC*(para1: TXcmsCCC){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsLookupColor*(para1: PDisplay, para2: TColormap, para3: cstring,
|
|
||||||
para4: PXcmsColor, para5: PXcmsColor,
|
|
||||||
para6: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsPrefixOfFormat*(para1: TXcmsColorFormat): cstring{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryBlack*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryBlue*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor,
|
|
||||||
para4: TXcmsColorFormat): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsQueryColors*(para1: PDisplay, para2: TColormap, para3: PXcmsColor,
|
|
||||||
para4: int32, para5: TXcmsColorFormat): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryGreen*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryRed*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsQueryWhite*(para1: TXcmsCCC, para2: TXcmsColorFormat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsRGBiToCIEXYZ*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsRGBiToRGB*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsRGBToRGBi*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: PBool): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsScreenNumberOfCCC*(para1: TXcmsCCC): int32{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsScreenWhitePointOfCCC*(para1: TXcmsCCC): PXcmsColor{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsSetCCCOfColormap*(para1: PDisplay, para2: TColormap, para3: TXcmsCCC): TXcmsCCC{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsSetCompressionProc*(para1: TXcmsCCC, para2: TXcmsCompressionProc,
|
|
||||||
para3: TXPointer): TXcmsCompressionProc{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsSetWhiteAdjustProc*(para1: TXcmsCCC, para2: TXcmsWhiteAdjustProc,
|
|
||||||
para3: TXPointer): TXcmsWhiteAdjustProc{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsSetWhitePoint*(para1: TXcmsCCC, para2: PXcmsColor): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsStoreColor*(para1: PDisplay, para2: TColormap, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsStoreColors*(para1: PDisplay, para2: TColormap, para3: PXcmsColor,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCClipC*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCClipV*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCClipVC*(para1: TXcmsCCC, para2: PXcmsColor, para3: int32,
|
|
||||||
para4: int32, para5: PBool): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCQueryMaxC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsTekHVCQueryMaxV*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsTekHVCQueryMaxVC*(para1: TXcmsCCC, para2: TXcmsFloat, para3: PXcmsColor): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCQueryMaxVSamples*(para1: TXcmsCCC, para2: TXcmsFloat,
|
|
||||||
para3: PXcmsColor, para4: int32): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCQueryMinV*(para1: TXcmsCCC, para2: TXcmsFloat, para3: TXcmsFloat,
|
|
||||||
para4: PXcmsColor): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XcmsTekHVCToCIEuvY*(para1: TXcmsCCC, para2: PXcmsColor, para3: PXcmsColor,
|
|
||||||
para4: int32): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsTekHVCWhiteShiftColors*(para1: TXcmsCCC, para2: PXcmsColor,
|
|
||||||
para3: PXcmsColor, para4: TXcmsColorFormat,
|
|
||||||
para5: PXcmsColor, para6: int32, para7: PBool): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XcmsVisualOfCCC*(para1: TXcmsCCC): PVisual{.cdecl, dynlib: libX11, importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc XcmsUndefinedFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000000'i32
|
|
||||||
|
|
||||||
proc XcmsCIEXYZFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000001'i32
|
|
||||||
|
|
||||||
proc XcmsCIEuvYFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000002'i32
|
|
||||||
|
|
||||||
proc XcmsCIExyYFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000003'i32
|
|
||||||
|
|
||||||
proc XcmsCIELabFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000004'i32
|
|
||||||
|
|
||||||
proc XcmsCIELuvFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000005'i32
|
|
||||||
|
|
||||||
proc XcmsTekHVCFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x00000006'i32
|
|
||||||
|
|
||||||
proc XcmsRGBFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x80000000'i32
|
|
||||||
|
|
||||||
proc XcmsRGBiFormat(): TXcmsColorFormat =
|
|
||||||
result = 0x80000001'i32
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc DisplayOfCCC(ccc: int32): int32 =
|
|
||||||
result = ccc.dpy
|
|
||||||
|
|
||||||
proc ScreenNumberOfCCC(ccc: int32): int32 =
|
|
||||||
result = ccc.screenNumber
|
|
||||||
|
|
||||||
proc VisualOfCCC(ccc: int32): int32 =
|
|
||||||
result = ccc.visual
|
|
||||||
|
|
||||||
proc ClientWhitePointOfCCC(ccc: int32): int32 =
|
|
||||||
result = addr(ccc.clientWhitePt)
|
|
||||||
|
|
||||||
proc ScreenWhitePointOfCCC(ccc: int32): int32 =
|
|
||||||
result = addr(ccc.pPerScrnInfo.screenWhitePt)
|
|
||||||
|
|
||||||
proc FunctionSetOfCCC(ccc: int32): int32 =
|
|
||||||
result = ccc.pPerScrnInfo.functionSet
|
|
||||||
|
|
@ -1,235 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright (c) 1999 XFree86 Inc
|
|
||||||
#
|
|
||||||
# $XFree86: xc/include/extensions/xf86dga.h,v 3.20 1999/10/13 04:20:48 dawes Exp $
|
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
const
|
|
||||||
libXxf86dga* = "libXxf86dga.so"
|
|
||||||
|
|
||||||
#type
|
|
||||||
# cfloat* = float32
|
|
||||||
|
|
||||||
# $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#Copyright (c) 1995 Jon Tombs
|
|
||||||
#Copyright (c) 1995 XFree86 Inc
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#************************************************************************
|
|
||||||
#
|
|
||||||
# THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE
|
|
||||||
#
|
|
||||||
#************************************************************************
|
|
||||||
|
|
||||||
type
|
|
||||||
PPcchar* = ptr ptr cstring
|
|
||||||
|
|
||||||
const
|
|
||||||
X_XF86DGAQueryVersion* = 0
|
|
||||||
X_XF86DGAGetVideoLL* = 1
|
|
||||||
X_XF86DGADirectVideo* = 2
|
|
||||||
X_XF86DGAGetViewPortSize* = 3
|
|
||||||
X_XF86DGASetViewPort* = 4
|
|
||||||
X_XF86DGAGetVidPage* = 5
|
|
||||||
X_XF86DGASetVidPage* = 6
|
|
||||||
X_XF86DGAInstallColormap* = 7
|
|
||||||
X_XF86DGAQueryDirectVideo* = 8
|
|
||||||
X_XF86DGAViewPortChanged* = 9
|
|
||||||
XF86DGADirectPresent* = 0x00000001
|
|
||||||
XF86DGADirectGraphics* = 0x00000002
|
|
||||||
XF86DGADirectMouse* = 0x00000004
|
|
||||||
XF86DGADirectKeyb* = 0x00000008
|
|
||||||
XF86DGAHasColormap* = 0x00000100
|
|
||||||
XF86DGADirectColormap* = 0x00000200
|
|
||||||
|
|
||||||
proc XF86DGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint,
|
|
||||||
minorVersion: Pcint): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAQueryExtension*(dpy: PDisplay, event_base: Pcint, error_base: Pcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAGetVideoLL*(dpy: PDisplay, screen: cint, base_addr: Pcint,
|
|
||||||
width: Pcint, bank_size: Pcint, ram_size: Pcint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAGetVideo*(dpy: PDisplay, screen: cint, base_addr: PPcchar,
|
|
||||||
width: Pcint, bank_size: Pcint, ram_size: Pcint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGADirectVideo*(dpy: PDisplay, screen: cint, enable: cint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGADirectVideoLL*(dpy: PDisplay, screen: cint, enable: cint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAGetViewPortSize*(dpy: PDisplay, screen: cint, width: Pcint,
|
|
||||||
height: Pcint): TStatus{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGASetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAGetVidPage*(dpy: PDisplay, screen: cint, vid_page: Pcint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGASetVidPage*(dpy: PDisplay, screen: cint, vid_page: cint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAInstallColormap*(dpy: PDisplay, screen: cint, Colormap: TColormap): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAForkApp*(screen: cint): cint{.CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAQueryDirectVideo*(dpy: PDisplay, screen: cint, flags: Pcint): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XF86DGAViewPortChanged*(dpy: PDisplay, screen: cint, n: cint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
const
|
|
||||||
X_XDGAQueryVersion* = 0 # 1 through 9 are in xf86dga1.pp
|
|
||||||
# 10 and 11 are reserved to avoid conflicts with rogue DGA extensions
|
|
||||||
X_XDGAQueryModes* = 12
|
|
||||||
X_XDGASetMode* = 13
|
|
||||||
X_XDGASetViewport* = 14
|
|
||||||
X_XDGAInstallColormap* = 15
|
|
||||||
X_XDGASelectInput* = 16
|
|
||||||
X_XDGAFillRectangle* = 17
|
|
||||||
X_XDGACopyArea* = 18
|
|
||||||
X_XDGACopyTransparentArea* = 19
|
|
||||||
X_XDGAGetViewportStatus* = 20
|
|
||||||
X_XDGASync* = 21
|
|
||||||
X_XDGAOpenFramebuffer* = 22
|
|
||||||
X_XDGACloseFramebuffer* = 23
|
|
||||||
X_XDGASetClientVersion* = 24
|
|
||||||
X_XDGAChangePixmapMode* = 25
|
|
||||||
X_XDGACreateColormap* = 26
|
|
||||||
XDGAConcurrentAccess* = 0x00000001
|
|
||||||
XDGASolidFillRect* = 0x00000002
|
|
||||||
XDGABlitRect* = 0x00000004
|
|
||||||
XDGABlitTransRect* = 0x00000008
|
|
||||||
XDGAPixmap* = 0x00000010
|
|
||||||
XDGAInterlaced* = 0x00010000
|
|
||||||
XDGADoublescan* = 0x00020000
|
|
||||||
XDGAFlipImmediate* = 0x00000001
|
|
||||||
XDGAFlipRetrace* = 0x00000002
|
|
||||||
XDGANeedRoot* = 0x00000001
|
|
||||||
XF86DGANumberEvents* = 7
|
|
||||||
XDGAPixmapModeLarge* = 0
|
|
||||||
XDGAPixmapModeSmall* = 1
|
|
||||||
XF86DGAClientNotLocal* = 0
|
|
||||||
XF86DGANoDirectVideoMode* = 1
|
|
||||||
XF86DGAScreenNotActive* = 2
|
|
||||||
XF86DGADirectNotActivated* = 3
|
|
||||||
XF86DGAOperationNotSupported* = 4
|
|
||||||
XF86DGANumberErrors* = (XF86DGAOperationNotSupported + 1)
|
|
||||||
|
|
||||||
type
|
|
||||||
PXDGAMode* = ptr TXDGAMode
|
|
||||||
TXDGAMode*{.final.} = object
|
|
||||||
num*: cint # A unique identifier for the mode (num > 0)
|
|
||||||
name*: cstring # name of mode given in the XF86Config
|
|
||||||
verticalRefresh*: cfloat
|
|
||||||
flags*: cint # DGA_CONCURRENT_ACCESS, etc...
|
|
||||||
imageWidth*: cint # linear accessible portion (pixels)
|
|
||||||
imageHeight*: cint
|
|
||||||
pixmapWidth*: cint # Xlib accessible portion (pixels)
|
|
||||||
pixmapHeight*: cint # both fields ignored if no concurrent access
|
|
||||||
bytesPerScanline*: cint
|
|
||||||
byteOrder*: cint # MSBFirst, LSBFirst
|
|
||||||
depth*: cint
|
|
||||||
bitsPerPixel*: cint
|
|
||||||
redMask*: culong
|
|
||||||
greenMask*: culong
|
|
||||||
blueMask*: culong
|
|
||||||
visualClass*: cshort
|
|
||||||
viewportWidth*: cint
|
|
||||||
viewportHeight*: cint
|
|
||||||
xViewportStep*: cint # viewport position granularity
|
|
||||||
yViewportStep*: cint
|
|
||||||
maxViewportX*: cint # max viewport origin
|
|
||||||
maxViewportY*: cint
|
|
||||||
viewportFlags*: cint # types of page flipping possible
|
|
||||||
reserved1*: cint
|
|
||||||
reserved2*: cint
|
|
||||||
|
|
||||||
PXDGADevice* = ptr TXDGADevice
|
|
||||||
TXDGADevice*{.final.} = object
|
|
||||||
mode*: TXDGAMode
|
|
||||||
data*: Pcuchar
|
|
||||||
pixmap*: TPixmap
|
|
||||||
|
|
||||||
PXDGAButtonEvent* = ptr TXDGAButtonEvent
|
|
||||||
TXDGAButtonEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong
|
|
||||||
display*: PDisplay
|
|
||||||
screen*: cint
|
|
||||||
time*: TTime
|
|
||||||
state*: cuint
|
|
||||||
button*: cuint
|
|
||||||
|
|
||||||
PXDGAKeyEvent* = ptr TXDGAKeyEvent
|
|
||||||
TXDGAKeyEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong
|
|
||||||
display*: PDisplay
|
|
||||||
screen*: cint
|
|
||||||
time*: TTime
|
|
||||||
state*: cuint
|
|
||||||
keycode*: cuint
|
|
||||||
|
|
||||||
PXDGAMotionEvent* = ptr TXDGAMotionEvent
|
|
||||||
TXDGAMotionEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong
|
|
||||||
display*: PDisplay
|
|
||||||
screen*: cint
|
|
||||||
time*: TTime
|
|
||||||
state*: cuint
|
|
||||||
dx*: cint
|
|
||||||
dy*: cint
|
|
||||||
|
|
||||||
PXDGAEvent* = ptr TXDGAEvent
|
|
||||||
TXDGAEvent*{.final.} = object
|
|
||||||
pad*: array[0..23, clong] # sorry you have to cast if you want access
|
|
||||||
#Case LongInt Of
|
|
||||||
# 0 : (_type : cint);
|
|
||||||
# 1 : (xbutton : TXDGAButtonEvent);
|
|
||||||
# 2 : (xkey : TXDGAKeyEvent);
|
|
||||||
# 3 : (xmotion : TXDGAMotionEvent);
|
|
||||||
# 4 : (pad : Array[0..23] Of clong);
|
|
||||||
|
|
||||||
|
|
||||||
proc XDGAQueryExtension*(dpy: PDisplay, eventBase: Pcint, erroBase: Pcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAQueryVersion*(dpy: PDisplay, majorVersion: Pcint, minorVersion: Pcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAQueryModes*(dpy: PDisplay, screen: cint, num: Pcint): PXDGAMode{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGASetMode*(dpy: PDisplay, screen: cint, mode: cint): PXDGADevice{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAOpenFramebuffer*(dpy: PDisplay, screen: cint): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGACloseFramebuffer*(dpy: PDisplay, screen: cint){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGASetViewport*(dpy: PDisplay, screen: cint, x: cint, y: cint, flags: cint){.
|
|
||||||
CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAInstallColormap*(dpy: PDisplay, screen: cint, cmap: TColormap){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGACreateColormap*(dpy: PDisplay, screen: cint, device: PXDGADevice,
|
|
||||||
alloc: cint): TColormap{.CDecl, dynlib: libXxf86dga,
|
|
||||||
importc.}
|
|
||||||
proc XDGASelectInput*(dpy: PDisplay, screen: cint, event_mask: clong){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAFillRectangle*(dpy: PDisplay, screen: cint, x: cint, y: cint,
|
|
||||||
width: cuint, height: cuint, color: culong){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGACopyArea*(dpy: PDisplay, screen: cint, srcx: cint, srcy: cint,
|
|
||||||
width: cuint, height: cuint, dstx: cint, dsty: cint){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGACopyTransparentArea*(dpy: PDisplay, screen: cint, srcx: cint,
|
|
||||||
srcy: cint, width: cuint, height: cuint,
|
|
||||||
dstx: cint, dsty: cint, key: culong){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAGetViewportStatus*(dpy: PDisplay, screen: cint): cint{.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGASync*(dpy: PDisplay, screen: cint){.CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGASetClientVersion*(dpy: PDisplay): TBool{.CDecl, dynlib: libXxf86dga,
|
|
||||||
importc.}
|
|
||||||
proc XDGAChangePixmapMode*(dpy: PDisplay, screen: cint, x: Pcint, y: Pcint,
|
|
||||||
mode: cint){.CDecl, dynlib: libXxf86dga, importc.}
|
|
||||||
proc XDGAKeyEventToXKeyEvent*(dk: PXDGAKeyEvent, xk: PXKeyEvent){.CDecl,
|
|
||||||
dynlib: libXxf86dga, importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,229 +0,0 @@
|
||||||
# $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#Copyright 1995 Kaleb S. KEITHLEY
|
|
||||||
#
|
|
||||||
#Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
#a copy of this software and associated documentation files (the
|
|
||||||
#"Software"), to deal in the Software without restriction, including
|
|
||||||
#without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
#distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
#permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
#the following conditions:
|
|
||||||
#
|
|
||||||
#The above copyright notice and this permission notice shall be
|
|
||||||
#included in all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
#IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
||||||
#OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
#ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
#OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
#Except as contained in this notice, the name of Kaleb S. KEITHLEY
|
|
||||||
#shall not be used in advertising or otherwise to promote the sale, use
|
|
||||||
#or other dealings in this Software without prior written authorization
|
|
||||||
#from Kaleb S. KEITHLEY
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $
|
|
||||||
# THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION
|
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
const
|
|
||||||
libXxf86vm* = "libXxf86vm.so"
|
|
||||||
|
|
||||||
type
|
|
||||||
PINT32* = ptr int32
|
|
||||||
|
|
||||||
const
|
|
||||||
X_XF86VidModeQueryVersion* = 0
|
|
||||||
X_XF86VidModeGetModeLine* = 1
|
|
||||||
X_XF86VidModeModModeLine* = 2
|
|
||||||
X_XF86VidModeSwitchMode* = 3
|
|
||||||
X_XF86VidModeGetMonitor* = 4
|
|
||||||
X_XF86VidModeLockModeSwitch* = 5
|
|
||||||
X_XF86VidModeGetAllModeLines* = 6
|
|
||||||
X_XF86VidModeAddModeLine* = 7
|
|
||||||
X_XF86VidModeDeleteModeLine* = 8
|
|
||||||
X_XF86VidModeValidateModeLine* = 9
|
|
||||||
X_XF86VidModeSwitchToMode* = 10
|
|
||||||
X_XF86VidModeGetViewPort* = 11
|
|
||||||
X_XF86VidModeSetViewPort* = 12 # new for version 2.x of this extension
|
|
||||||
X_XF86VidModeGetDotClocks* = 13
|
|
||||||
X_XF86VidModeSetClientVersion* = 14
|
|
||||||
X_XF86VidModeSetGamma* = 15
|
|
||||||
X_XF86VidModeGetGamma* = 16
|
|
||||||
X_XF86VidModeGetGammaRamp* = 17
|
|
||||||
X_XF86VidModeSetGammaRamp* = 18
|
|
||||||
X_XF86VidModeGetGammaRampSize* = 19
|
|
||||||
X_XF86VidModeGetPermissions* = 20
|
|
||||||
CLKFLAG_PROGRAMABLE* = 1
|
|
||||||
|
|
||||||
when defined(XF86VIDMODE_EVENTS):
|
|
||||||
const
|
|
||||||
XF86VidModeNotify* = 0
|
|
||||||
XF86VidModeNumberEvents* = (XF86VidModeNotify + 1)
|
|
||||||
XF86VidModeNotifyMask* = 0x00000001
|
|
||||||
XF86VidModeNonEvent* = 0
|
|
||||||
XF86VidModeModeChange* = 1
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
XF86VidModeNumberEvents* = 0
|
|
||||||
const
|
|
||||||
XF86VidModeBadClock* = 0
|
|
||||||
XF86VidModeBadHTimings* = 1
|
|
||||||
XF86VidModeBadVTimings* = 2
|
|
||||||
XF86VidModeModeUnsuitable* = 3
|
|
||||||
XF86VidModeExtensionDisabled* = 4
|
|
||||||
XF86VidModeClientNotLocal* = 5
|
|
||||||
XF86VidModeZoomLocked* = 6
|
|
||||||
XF86VidModeNumberErrors* = (XF86VidModeZoomLocked + 1)
|
|
||||||
XF86VM_READ_PERMISSION* = 1
|
|
||||||
XF86VM_WRITE_PERMISSION* = 2
|
|
||||||
|
|
||||||
type
|
|
||||||
PXF86VidModeModeLine* = ptr TXF86VidModeModeLine
|
|
||||||
TXF86VidModeModeLine*{.final.} = object
|
|
||||||
hdisplay*: cushort
|
|
||||||
hsyncstart*: cushort
|
|
||||||
hsyncend*: cushort
|
|
||||||
htotal*: cushort
|
|
||||||
hskew*: cushort
|
|
||||||
vdisplay*: cushort
|
|
||||||
vsyncstart*: cushort
|
|
||||||
vsyncend*: cushort
|
|
||||||
vtotal*: cushort
|
|
||||||
flags*: cuint
|
|
||||||
privsize*: cint
|
|
||||||
c_private*: PINT32
|
|
||||||
|
|
||||||
PPPXF86VidModeModeInfo* = ptr PPXF86VidModeModeInfo
|
|
||||||
PPXF86VidModeModeInfo* = ptr PXF86VidModeModeInfo
|
|
||||||
PXF86VidModeModeInfo* = ptr TXF86VidModeModeInfo
|
|
||||||
TXF86VidModeModeInfo*{.final.} = object
|
|
||||||
dotclock*: cuint
|
|
||||||
hdisplay*: cushort
|
|
||||||
hsyncstart*: cushort
|
|
||||||
hsyncend*: cushort
|
|
||||||
htotal*: cushort
|
|
||||||
hskew*: cushort
|
|
||||||
vdisplay*: cushort
|
|
||||||
vsyncstart*: cushort
|
|
||||||
vsyncend*: cushort
|
|
||||||
vtotal*: cushort
|
|
||||||
flags*: cuint
|
|
||||||
privsize*: cint
|
|
||||||
c_private*: PINT32
|
|
||||||
|
|
||||||
PXF86VidModeSyncRange* = ptr TXF86VidModeSyncRange
|
|
||||||
TXF86VidModeSyncRange*{.final.} = object
|
|
||||||
hi*: cfloat
|
|
||||||
lo*: cfloat
|
|
||||||
|
|
||||||
PXF86VidModeMonitor* = ptr TXF86VidModeMonitor
|
|
||||||
TXF86VidModeMonitor*{.final.} = object
|
|
||||||
vendor*: cstring
|
|
||||||
model*: cstring
|
|
||||||
EMPTY*: cfloat
|
|
||||||
nhsync*: cuchar
|
|
||||||
hsync*: PXF86VidModeSyncRange
|
|
||||||
nvsync*: cuchar
|
|
||||||
vsync*: PXF86VidModeSyncRange
|
|
||||||
|
|
||||||
PXF86VidModeNotifyEvent* = ptr TXF86VidModeNotifyEvent
|
|
||||||
TXF86VidModeNotifyEvent*{.final.} = object
|
|
||||||
theType*: cint # of event
|
|
||||||
serial*: culong # # of last request processed by server
|
|
||||||
send_event*: TBool # true if this came from a SendEvent req
|
|
||||||
display*: PDisplay # Display the event was read from
|
|
||||||
root*: TWindow # root window of event screen
|
|
||||||
state*: cint # What happened
|
|
||||||
kind*: cint # What happened
|
|
||||||
forced*: TBool # extents of new region
|
|
||||||
time*: TTime # event timestamp
|
|
||||||
|
|
||||||
PXF86VidModeGamma* = ptr TXF86VidModeGamma
|
|
||||||
TXF86VidModeGamma*{.final.} = object
|
|
||||||
red*: cfloat # Red Gamma value
|
|
||||||
green*: cfloat # Green Gamma value
|
|
||||||
blue*: cfloat # Blue Gamma value
|
|
||||||
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XF86VidModeSelectNextMode*(disp: PDisplay, scr: cint): TBool
|
|
||||||
proc XF86VidModeSelectPrevMode*(disp: PDisplay, scr: cint): TBool
|
|
||||||
proc XF86VidModeQueryVersion*(dpy: PDisplay, majorVersion: Pcint,
|
|
||||||
minorVersion: Pcint): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeQueryExtension*(dpy: PDisplay, event_base: Pcint,
|
|
||||||
error_base: Pcint): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeSetClientVersion*(dpy: PDisplay): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetModeLine*(dpy: PDisplay, screen: cint, dotclock: Pcint,
|
|
||||||
modeline: PXF86VidModeModeLine): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetAllModeLines*(dpy: PDisplay, screen: cint, modecount: Pcint,
|
|
||||||
modelinesPtr: PPPXF86VidModeModeInfo): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeAddModeLine*(dpy: PDisplay, screen: cint,
|
|
||||||
new_modeline: PXF86VidModeModeInfo,
|
|
||||||
after_modeline: PXF86VidModeModeInfo): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeDeleteModeLine*(dpy: PDisplay, screen: cint,
|
|
||||||
modeline: PXF86VidModeModeInfo): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeModModeLine*(dpy: PDisplay, screen: cint,
|
|
||||||
modeline: PXF86VidModeModeLine): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeValidateModeLine*(dpy: PDisplay, screen: cint,
|
|
||||||
modeline: PXF86VidModeModeInfo): TStatus{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeSwitchMode*(dpy: PDisplay, screen: cint, zoom: cint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeSwitchToMode*(dpy: PDisplay, screen: cint,
|
|
||||||
modeline: PXF86VidModeModeInfo): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeLockModeSwitch*(dpy: PDisplay, screen: cint, lock: cint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetMonitor*(dpy: PDisplay, screen: cint,
|
|
||||||
monitor: PXF86VidModeMonitor): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetViewPort*(dpy: PDisplay, screen: cint, x_return: Pcint,
|
|
||||||
y_return: Pcint): TBool{.CDecl, dynlib: libXxf86vm,
|
|
||||||
importc.}
|
|
||||||
proc XF86VidModeSetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetDotClocks*(dpy: PDisplay, screen: cint, flags_return: Pcint,
|
|
||||||
number_of_clocks_return: Pcint,
|
|
||||||
max_dot_clock_return: Pcint, clocks_return: PPcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeSetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeSetGammaRamp*(dpy: PDisplay, screen: cint, size: cint,
|
|
||||||
red_array: Pcushort, green_array: Pcushort,
|
|
||||||
blue_array: Pcushort): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetGammaRamp*(dpy: PDisplay, screen: cint, size: cint,
|
|
||||||
red_array: Pcushort, green_array: Pcushort,
|
|
||||||
blue_array: Pcushort): TBool{.CDecl,
|
|
||||||
dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetGammaRampSize*(dpy: PDisplay, screen: cint, size: Pcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
proc XF86VidModeGetPermissions*(dpy: PDisplay, screen: cint, permissions: Pcint): TBool{.
|
|
||||||
CDecl, dynlib: libXxf86vm, importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XF86VidModeSelectNextMode(disp: PDisplay, scr: cint): TBool =
|
|
||||||
XF86VidModeSelectNextMode = XF86VidModeSwitchMode(disp, scr, 1)
|
|
||||||
|
|
||||||
proc XF86VidModeSelectPrevMode(disp: PDisplay, scr: cint): TBool =
|
|
||||||
XF86VidModeSelectPrevMode = XF86VidModeSwitchMode(disp, scr, - 1)
|
|
||||||
|
|
@ -1,307 +0,0 @@
|
||||||
#
|
|
||||||
# $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
|
|
||||||
#
|
|
||||||
#************************************************************
|
|
||||||
#
|
|
||||||
#Copyright 1989, 1998 The Open Group
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
#documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
#the above copyright notice appear in all copies and that both that
|
|
||||||
#copyright notice and this permission notice appear in supporting
|
|
||||||
#documentation.
|
|
||||||
#
|
|
||||||
#The above copyright notice and this permission notice shall be included in
|
|
||||||
#all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
#OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
#AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
#CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
#Except as contained in this notice, the name of The Open Group shall not be
|
|
||||||
#used in advertising or otherwise to promote the sale, use or other dealings
|
|
||||||
#in this Software without prior written authorization from The Open Group.
|
|
||||||
#
|
|
||||||
#Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
|
|
||||||
#
|
|
||||||
# All Rights Reserved
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, and distribute this software and its
|
|
||||||
#documentation for any purpose and without fee is hereby granted,
|
|
||||||
#provided that the above copyright notice appear in all copies and that
|
|
||||||
#both that copyright notice and this permission notice appear in
|
|
||||||
#supporting documentation, and that the name of Hewlett-Packard not be
|
|
||||||
#used in advertising or publicity pertaining to distribution of the
|
|
||||||
#software without specific, written prior permission.
|
|
||||||
#
|
|
||||||
#HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
||||||
#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
||||||
#HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
||||||
#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
||||||
#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
||||||
#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
#SOFTWARE.
|
|
||||||
#
|
|
||||||
#********************************************************/
|
|
||||||
# $XFree86: xc/include/extensions/XI.h,v 1.5 2001/12/14 19:53:28 dawes Exp $
|
|
||||||
#
|
|
||||||
# Definitions used by the server, library and client
|
|
||||||
#
|
|
||||||
# Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il
|
|
||||||
#
|
|
||||||
#Histroy:
|
|
||||||
# 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and chnaged it to
|
|
||||||
# "reocrd" only.
|
|
||||||
# 2004/10/07 - Removed the "uses X;" line. The unit does not need it.
|
|
||||||
# 2004/10/03 - Conversion from C header to Pascal unit.
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
sz_xGetExtensionVersionReq* = 8
|
|
||||||
sz_xGetExtensionVersionReply* = 32
|
|
||||||
sz_xListInputDevicesReq* = 4
|
|
||||||
sz_xListInputDevicesReply* = 32
|
|
||||||
sz_xOpenDeviceReq* = 8
|
|
||||||
sz_xOpenDeviceReply* = 32
|
|
||||||
sz_xCloseDeviceReq* = 8
|
|
||||||
sz_xSetDeviceModeReq* = 8
|
|
||||||
sz_xSetDeviceModeReply* = 32
|
|
||||||
sz_xSelectExtensionEventReq* = 12
|
|
||||||
sz_xGetSelectedExtensionEventsReq* = 8
|
|
||||||
sz_xGetSelectedExtensionEventsReply* = 32
|
|
||||||
sz_xChangeDeviceDontPropagateListReq* = 12
|
|
||||||
sz_xGetDeviceDontPropagateListReq* = 8
|
|
||||||
sz_xGetDeviceDontPropagateListReply* = 32
|
|
||||||
sz_xGetDeviceMotionEventsReq* = 16
|
|
||||||
sz_xGetDeviceMotionEventsReply* = 32
|
|
||||||
sz_xChangeKeyboardDeviceReq* = 8
|
|
||||||
sz_xChangeKeyboardDeviceReply* = 32
|
|
||||||
sz_xChangePointerDeviceReq* = 8
|
|
||||||
sz_xChangePointerDeviceReply* = 32
|
|
||||||
sz_xGrabDeviceReq* = 20
|
|
||||||
sz_xGrabDeviceReply* = 32
|
|
||||||
sz_xUngrabDeviceReq* = 12
|
|
||||||
sz_xGrabDeviceKeyReq* = 20
|
|
||||||
sz_xGrabDeviceKeyReply* = 32
|
|
||||||
sz_xUngrabDeviceKeyReq* = 16
|
|
||||||
sz_xGrabDeviceButtonReq* = 20
|
|
||||||
sz_xGrabDeviceButtonReply* = 32
|
|
||||||
sz_xUngrabDeviceButtonReq* = 16
|
|
||||||
sz_xAllowDeviceEventsReq* = 12
|
|
||||||
sz_xGetDeviceFocusReq* = 8
|
|
||||||
sz_xGetDeviceFocusReply* = 32
|
|
||||||
sz_xSetDeviceFocusReq* = 16
|
|
||||||
sz_xGetFeedbackControlReq* = 8
|
|
||||||
sz_xGetFeedbackControlReply* = 32
|
|
||||||
sz_xChangeFeedbackControlReq* = 12
|
|
||||||
sz_xGetDeviceKeyMappingReq* = 8
|
|
||||||
sz_xGetDeviceKeyMappingReply* = 32
|
|
||||||
sz_xChangeDeviceKeyMappingReq* = 8
|
|
||||||
sz_xGetDeviceModifierMappingReq* = 8
|
|
||||||
sz_xSetDeviceModifierMappingReq* = 8
|
|
||||||
sz_xSetDeviceModifierMappingReply* = 32
|
|
||||||
sz_xGetDeviceButtonMappingReq* = 8
|
|
||||||
sz_xGetDeviceButtonMappingReply* = 32
|
|
||||||
sz_xSetDeviceButtonMappingReq* = 8
|
|
||||||
sz_xSetDeviceButtonMappingReply* = 32
|
|
||||||
sz_xQueryDeviceStateReq* = 8
|
|
||||||
sz_xQueryDeviceStateReply* = 32
|
|
||||||
sz_xSendExtensionEventReq* = 16
|
|
||||||
sz_xDeviceBellReq* = 8
|
|
||||||
sz_xSetDeviceValuatorsReq* = 8
|
|
||||||
sz_xSetDeviceValuatorsReply* = 32
|
|
||||||
sz_xGetDeviceControlReq* = 8
|
|
||||||
sz_xGetDeviceControlReply* = 32
|
|
||||||
sz_xChangeDeviceControlReq* = 8
|
|
||||||
sz_xChangeDeviceControlReply* = 32
|
|
||||||
|
|
||||||
const
|
|
||||||
INAME* = "XInputExtension"
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_KEYBOARD* = "KEYBOARD"
|
|
||||||
XI_MOUSE* = "MOUSE"
|
|
||||||
XI_TABLET* = "TABLET"
|
|
||||||
XI_TOUCHSCREEN* = "TOUCHSCREEN"
|
|
||||||
XI_TOUCHPAD* = "TOUCHPAD"
|
|
||||||
XI_BARCODE* = "BARCODE"
|
|
||||||
XI_BUTTONBOX* = "BUTTONBOX"
|
|
||||||
XI_KNOB_BOX* = "KNOB_BOX"
|
|
||||||
XI_ONE_KNOB* = "ONE_KNOB"
|
|
||||||
XI_NINE_KNOB* = "NINE_KNOB"
|
|
||||||
XI_TRACKBALL* = "TRACKBALL"
|
|
||||||
XI_QUADRATURE* = "QUADRATURE"
|
|
||||||
XI_ID_MODULE* = "ID_MODULE"
|
|
||||||
XI_SPACEBALL* = "SPACEBALL"
|
|
||||||
XI_DATAGLOVE* = "DATAGLOVE"
|
|
||||||
XI_EYETRACKER* = "EYETRACKER"
|
|
||||||
XI_CURSORKEYS* = "CURSORKEYS"
|
|
||||||
XI_FOOTMOUSE* = "FOOTMOUSE"
|
|
||||||
|
|
||||||
const
|
|
||||||
Dont_Check* = 0
|
|
||||||
XInput_Initial_Release* = 1
|
|
||||||
XInput_Add_XDeviceBell* = 2
|
|
||||||
XInput_Add_XSetDeviceValuators* = 3
|
|
||||||
XInput_Add_XChangeDeviceControl* = 4
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_Absent* = 0
|
|
||||||
XI_Present* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_Initial_Release_Major* = 1
|
|
||||||
XI_Initial_Release_Minor* = 0
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_Add_XDeviceBell_Major* = 1
|
|
||||||
XI_Add_XDeviceBell_Minor* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_Add_XSetDeviceValuators_Major* = 1
|
|
||||||
XI_Add_XSetDeviceValuators_Minor* = 2
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_Add_XChangeDeviceControl_Major* = 1
|
|
||||||
XI_Add_XChangeDeviceControl_Minor* = 3
|
|
||||||
|
|
||||||
const
|
|
||||||
DEVICE_RESOLUTION* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
NoSuchExtension* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
COUNT* = 0
|
|
||||||
CREATE* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
NewPointer* = 0
|
|
||||||
NewKeyboard* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
XPOINTER* = 0
|
|
||||||
XKEYBOARD* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
UseXKeyboard* = 0x000000FF
|
|
||||||
|
|
||||||
const
|
|
||||||
IsXPointer* = 0
|
|
||||||
IsXKeyboard* = 1
|
|
||||||
IsXExtensionDevice* = 2
|
|
||||||
|
|
||||||
const
|
|
||||||
AsyncThisDevice* = 0
|
|
||||||
SyncThisDevice* = 1
|
|
||||||
ReplayThisDevice* = 2
|
|
||||||
AsyncOtherDevices* = 3
|
|
||||||
AsyncAll* = 4
|
|
||||||
SyncAll* = 5
|
|
||||||
|
|
||||||
const
|
|
||||||
FollowKeyboard* = 3
|
|
||||||
RevertToFollowKeyboard* = 3
|
|
||||||
|
|
||||||
const
|
|
||||||
DvAccelNum* = int(1) shl 0
|
|
||||||
DvAccelDenom* = int(1) shl 1
|
|
||||||
DvThreshold* = int(1) shl 2
|
|
||||||
|
|
||||||
const
|
|
||||||
DvKeyClickPercent* = int(1) shl 0
|
|
||||||
DvPercent* = int(1) shl 1
|
|
||||||
DvPitch* = int(1) shl 2
|
|
||||||
DvDuration* = int(1) shl 3
|
|
||||||
DvLed* = int(1) shl 4
|
|
||||||
DvLedMode* = int(1) shl 5
|
|
||||||
DvKey* = int(1) shl 6
|
|
||||||
DvAutoRepeatMode* = 1 shl 7
|
|
||||||
|
|
||||||
const
|
|
||||||
DvString* = int(1) shl 0
|
|
||||||
|
|
||||||
const
|
|
||||||
DvInteger* = int(1) shl 0
|
|
||||||
|
|
||||||
const
|
|
||||||
DeviceMode* = int(1) shl 0
|
|
||||||
Relative* = 0
|
|
||||||
Absolute* = 1 # Merged from Metrolink tree for XINPUT stuff
|
|
||||||
TS_Raw* = 57
|
|
||||||
TS_Scaled* = 58
|
|
||||||
SendCoreEvents* = 59
|
|
||||||
DontSendCoreEvents* = 60 # End of merged section
|
|
||||||
|
|
||||||
const
|
|
||||||
ProximityState* = int(1) shl 1
|
|
||||||
InProximity* = int(0) shl 1
|
|
||||||
OutOfProximity* = int(1) shl 1
|
|
||||||
|
|
||||||
const
|
|
||||||
AddToList* = 0
|
|
||||||
DeleteFromList* = 1
|
|
||||||
|
|
||||||
const
|
|
||||||
KeyClass* = 0
|
|
||||||
ButtonClass* = 1
|
|
||||||
ValuatorClass* = 2
|
|
||||||
FeedbackClass* = 3
|
|
||||||
ProximityClass* = 4
|
|
||||||
FocusClass* = 5
|
|
||||||
OtherClass* = 6
|
|
||||||
|
|
||||||
const
|
|
||||||
KbdFeedbackClass* = 0
|
|
||||||
PtrFeedbackClass* = 1
|
|
||||||
StringFeedbackClass* = 2
|
|
||||||
IntegerFeedbackClass* = 3
|
|
||||||
LedFeedbackClass* = 4
|
|
||||||
BellFeedbackClass* = 5
|
|
||||||
|
|
||||||
const
|
|
||||||
devicePointerMotionHint* = 0
|
|
||||||
deviceButton1Motion* = 1
|
|
||||||
deviceButton2Motion* = 2
|
|
||||||
deviceButton3Motion* = 3
|
|
||||||
deviceButton4Motion* = 4
|
|
||||||
deviceButton5Motion* = 5
|
|
||||||
deviceButtonMotion* = 6
|
|
||||||
deviceButtonGrab* = 7
|
|
||||||
deviceOwnerGrabButton* = 8
|
|
||||||
noExtensionEvent* = 9
|
|
||||||
|
|
||||||
const
|
|
||||||
XI_BadDevice* = 0
|
|
||||||
XI_BadEvent* = 1
|
|
||||||
XI_BadMode* = 2
|
|
||||||
XI_DeviceBusy* = 3
|
|
||||||
XI_BadClass* = 4 # Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
|
|
||||||
# definition of XEventClass since that would be a library interface change.
|
|
||||||
# See the top of X.h for more _XSERVER64 magic.
|
|
||||||
#
|
|
||||||
|
|
||||||
when defined(XSERVER64):
|
|
||||||
type
|
|
||||||
XEventClass* = CARD32
|
|
||||||
else:
|
|
||||||
type
|
|
||||||
XEventClass* = int32
|
|
||||||
#******************************************************************
|
|
||||||
# *
|
|
||||||
# * Extension version structure.
|
|
||||||
# *
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
PXExtensionVersion* = ptr TXExtensionVersion
|
|
||||||
TXExtensionVersion*{.final.} = object
|
|
||||||
present*: int16
|
|
||||||
major_version*: int16
|
|
||||||
minor_version*: int16
|
|
||||||
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
# Converted from X11/Xinerama.h
|
|
||||||
import
|
|
||||||
xlib
|
|
||||||
|
|
||||||
const
|
|
||||||
xineramaLib = "libXinerama.so"
|
|
||||||
|
|
||||||
type
|
|
||||||
PXineramaScreenInfo* = ptr TXineramaScreenInfo
|
|
||||||
TXineramaScreenInfo*{.final.} = object
|
|
||||||
screen_number*: cint
|
|
||||||
x_org*: int16
|
|
||||||
y_org*: int16
|
|
||||||
width*: int16
|
|
||||||
height*: int16
|
|
||||||
|
|
||||||
|
|
||||||
proc XineramaQueryExtension*(dpy: PDisplay, event_base: Pcint, error_base: Pcint): TBool{.
|
|
||||||
cdecl, dynlib: xineramaLib, importc.}
|
|
||||||
proc XineramaQueryVersion*(dpy: PDisplay, major: Pcint, minor: Pcint): TStatus{.
|
|
||||||
cdecl, dynlib: xineramaLib, importc.}
|
|
||||||
proc XineramaIsActive*(dpy: PDisplay): TBool{.cdecl, dynlib: xineramaLib, importc.}
|
|
||||||
proc XineramaQueryScreens*(dpy: PDisplay, number: Pcint): PXineramaScreenInfo{.
|
|
||||||
cdecl, dynlib: xineramaLib, importc.}
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,661 +0,0 @@
|
||||||
# $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $
|
|
||||||
#************************************************************
|
|
||||||
#Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, and distribute this
|
|
||||||
#software and its documentation for any purpose and without
|
|
||||||
#fee is hereby granted, provided that the above copyright
|
|
||||||
#notice appear in all copies and that both that copyright
|
|
||||||
#notice and this permission notice appear in supporting
|
|
||||||
#documentation, and that the name of Silicon Graphics not be
|
|
||||||
#used in advertising or publicity pertaining to distribution
|
|
||||||
#of the software without specific prior written permission.
|
|
||||||
#Silicon Graphics makes no representation about the suitability
|
|
||||||
#of this software for any purpose. It is provided "as is"
|
|
||||||
#without any express or implied warranty.
|
|
||||||
#
|
|
||||||
#SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
||||||
#SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
||||||
#AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
|
||||||
#GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
||||||
#DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING `from` LOSS OF USE,
|
|
||||||
#DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
||||||
#OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
||||||
#THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
#
|
|
||||||
#********************************************************/
|
|
||||||
# $XFree86: xc/lib/X11/XKBlib.h,v 3.3 2001/08/01 00:44:38 tsi Exp $
|
|
||||||
#
|
|
||||||
# Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il
|
|
||||||
#
|
|
||||||
#Thanks:
|
|
||||||
# I want to thanks to oliebol for putting up with all of the problems that was found
|
|
||||||
# while translating this code. ;)
|
|
||||||
#
|
|
||||||
# I want to thanks #fpc channel in freenode irc, for helping me, and to put up with my
|
|
||||||
# wierd questions ;)
|
|
||||||
#
|
|
||||||
# Thanks for mmc in #xlib on freenode irc And so for the channel itself for the helping me to
|
|
||||||
# understanding some of the problems I had converting this headers and pointing me to resources
|
|
||||||
# that helped translating this headers.
|
|
||||||
#
|
|
||||||
# Ido
|
|
||||||
#
|
|
||||||
#History:
|
|
||||||
# 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and
|
|
||||||
# chnaged it to "reocrd" only.
|
|
||||||
# 2004/10/10 - Added to TXkbGetAtomNameFunc and TXkbInternAtomFunc the cdecl call.
|
|
||||||
# 2004/10/06 - 09 - Convertion `from` the c header of XKBlib.h
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
X, Xlib, XKB
|
|
||||||
|
|
||||||
|
|
||||||
include "x11pragma.nim"
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbAnyEvent* = ptr TXkbAnyEvent
|
|
||||||
TXkbAnyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds;
|
|
||||||
xkb_type*: int16 # XKB event minor code
|
|
||||||
device*: int16 # device ID
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbNewKeyboardNotifyEvent* = ptr TXkbNewKeyboardNotifyEvent
|
|
||||||
TXkbNewKeyboardNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbNewKeyboardNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
old_device*: int16 # device ID of previous keyboard
|
|
||||||
min_key_code*: int16 # minimum key code
|
|
||||||
max_key_code*: int16 # maximum key code
|
|
||||||
old_min_key_code*: int16 # min key code of previous kbd
|
|
||||||
old_max_key_code*: int16 # max key code of previous kbd
|
|
||||||
changed*: int16 # changed aspects of the keyboard
|
|
||||||
req_major*: int8 # major and minor opcode of req
|
|
||||||
req_minor*: int8 # that caused change, if applicable
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbMapNotifyEvent* = ptr TXkbMapNotifyEvent
|
|
||||||
TXkbMapNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbMapNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
changed*: int16 # fields which have been changed
|
|
||||||
flags*: int16 # reserved
|
|
||||||
first_type*: int16 # first changed key type
|
|
||||||
num_types*: int16 # number of changed key types
|
|
||||||
min_key_code*: TKeyCode
|
|
||||||
max_key_code*: TKeyCode
|
|
||||||
first_key_sym*: TKeyCode
|
|
||||||
first_key_act*: TKeyCode
|
|
||||||
first_key_behavior*: TKeyCode
|
|
||||||
first_key_explicit*: TKeyCode
|
|
||||||
first_modmap_key*: TKeyCode
|
|
||||||
first_vmodmap_key*: TKeyCode
|
|
||||||
num_key_syms*: int16
|
|
||||||
num_key_acts*: int16
|
|
||||||
num_key_behaviors*: int16
|
|
||||||
num_key_explicit*: int16
|
|
||||||
num_modmap_keys*: int16
|
|
||||||
num_vmodmap_keys*: int16
|
|
||||||
vmods*: int16 # mask of changed virtual mods
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbStateNotifyEvent* = ptr TXkbStateNotifyEvent
|
|
||||||
TXkbStateNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbStateNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
changed*: int16 # mask of changed state components
|
|
||||||
group*: int16 # keyboard group
|
|
||||||
base_group*: int16 # base keyboard group
|
|
||||||
latched_group*: int16 # latched keyboard group
|
|
||||||
locked_group*: int16 # locked keyboard group
|
|
||||||
mods*: int16 # modifier state
|
|
||||||
base_mods*: int16 # base modifier state
|
|
||||||
latched_mods*: int16 # latched modifiers
|
|
||||||
locked_mods*: int16 # locked modifiers
|
|
||||||
compat_state*: int16 # compatibility state
|
|
||||||
grab_mods*: int8 # mods used for grabs
|
|
||||||
compat_grab_mods*: int8 # grab mods for non-XKB clients
|
|
||||||
lookup_mods*: int8 # mods sent to clients
|
|
||||||
compat_lookup_mods*: int8 # mods sent to non-XKB clients
|
|
||||||
ptr_buttons*: int16 # pointer button state
|
|
||||||
keycode*: TKeyCode # keycode that caused the change
|
|
||||||
event_type*: int8 # KeyPress or KeyRelease
|
|
||||||
req_major*: int8 # Major opcode of request
|
|
||||||
req_minor*: int8 # Minor opcode of request
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbControlsNotifyEvent* = ptr TXkbControlsNotifyEvent
|
|
||||||
TXkbControlsNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbControlsNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
changed_ctrls*: int16 # controls with changed sub-values
|
|
||||||
enabled_ctrls*: int16 # controls currently enabled
|
|
||||||
enabled_ctrl_changes*: int16 # controls just {en,dis}abled
|
|
||||||
num_groups*: int16 # total groups on keyboard
|
|
||||||
keycode*: TKeyCode # key that caused change or 0
|
|
||||||
event_type*: int8 # type of event that caused change
|
|
||||||
req_major*: int8 # if keycode==0, major and minor
|
|
||||||
req_minor*: int8 # opcode of req that caused change
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbIndicatorNotifyEvent* = ptr TXkbIndicatorNotifyEvent
|
|
||||||
TXkbIndicatorNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbIndicatorNotify
|
|
||||||
device*: int16 # device
|
|
||||||
changed*: int16 # indicators with new state or map
|
|
||||||
state*: int16 # current state of all indicators
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbNamesNotifyEvent* = ptr TXkbNamesNotifyEvent
|
|
||||||
TXkbNamesNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbNamesNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
changed*: int32 # names that have changed
|
|
||||||
first_type*: int16 # first key type with new name
|
|
||||||
num_types*: int16 # number of key types with new names
|
|
||||||
first_lvl*: int16 # first key type new new level names
|
|
||||||
num_lvls*: int16 # # of key types w/new level names
|
|
||||||
num_aliases*: int16 # total number of key aliases
|
|
||||||
num_radio_groups*: int16 # total number of radio groups
|
|
||||||
changed_vmods*: int16 # virtual modifiers with new names
|
|
||||||
changed_groups*: int16 # groups with new names
|
|
||||||
changed_indicators*: int16 # indicators with new names
|
|
||||||
first_key*: int16 # first key with new name
|
|
||||||
num_keys*: int16 # number of keys with new names
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbCompatMapNotifyEvent* = ptr TXkbCompatMapNotifyEvent
|
|
||||||
TXkbCompatMapNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbCompatMapNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
changed_groups*: int16 # groups with new compat maps
|
|
||||||
first_si*: int16 # first new symbol interp
|
|
||||||
num_si*: int16 # number of new symbol interps
|
|
||||||
num_total_si*: int16 # total # of symbol interps
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbBellNotifyEvent* = ptr TXkbBellNotifyEvent
|
|
||||||
TXkbBellNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbBellNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
percent*: int16 # requested volume as a % of maximum
|
|
||||||
pitch*: int16 # requested pitch in Hz
|
|
||||||
duration*: int16 # requested duration in useconds
|
|
||||||
bell_class*: int16 # (input extension) feedback class
|
|
||||||
bell_id*: int16 # (input extension) ID of feedback
|
|
||||||
name*: TAtom # "name" of requested bell
|
|
||||||
window*: TWindow # window associated with event
|
|
||||||
event_only*: bool # "event only" requested
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbActionMessageEvent* = ptr TXkbActionMessageEvent
|
|
||||||
TXkbActionMessageEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbActionMessage
|
|
||||||
device*: int16 # device ID
|
|
||||||
keycode*: TKeyCode # key that generated the event
|
|
||||||
press*: bool # true if act caused by key press
|
|
||||||
key_event_follows*: bool # true if key event also generated
|
|
||||||
group*: int16 # effective group
|
|
||||||
mods*: int16 # effective mods
|
|
||||||
message*: array[0..XkbActionMessageLength, Char] # message -- leave space for NUL
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbAccessXNotifyEvent* = ptr TXkbAccessXNotifyEvent
|
|
||||||
TXkbAccessXNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbAccessXNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
detail*: int16 # XkbAXN_*
|
|
||||||
keycode*: int16 # key of event
|
|
||||||
sk_delay*: int16 # current slow keys delay
|
|
||||||
debounce_delay*: int16 # current debounce delay
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbExtensionDeviceNotifyEvent* = ptr TXkbExtensionDeviceNotifyEvent
|
|
||||||
TXkbExtensionDeviceNotifyEvent*{.final.} = object
|
|
||||||
theType*: int16 # XkbAnyEvent
|
|
||||||
serial*: int32 # of last req processed by server
|
|
||||||
send_event*: bool # is this `from` a SendEvent request?
|
|
||||||
display*: PDisplay # Display the event was read `from`
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
xkb_type*: int16 # XkbExtensionDeviceNotify
|
|
||||||
device*: int16 # device ID
|
|
||||||
reason*: int16 # reason for the event
|
|
||||||
supported*: int16 # mask of supported features
|
|
||||||
unsupported*: int16 # mask of unsupported features
|
|
||||||
# that some app tried to use
|
|
||||||
first_btn*: int16 # first button that changed
|
|
||||||
num_btns*: int16 # range of buttons changed
|
|
||||||
leds_defined*: int16 # indicators with names or maps
|
|
||||||
led_state*: int16 # current state of the indicators
|
|
||||||
led_class*: int16 # feedback class for led changes
|
|
||||||
led_id*: int16 # feedback id for led changes
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbEvent* = ptr TXkbEvent
|
|
||||||
TXkbEvent*{.final.} = object
|
|
||||||
theType*: int16
|
|
||||||
any*: TXkbAnyEvent
|
|
||||||
new_kbd*: TXkbNewKeyboardNotifyEvent
|
|
||||||
map*: TXkbMapNotifyEvent
|
|
||||||
state*: TXkbStateNotifyEvent
|
|
||||||
ctrls*: TXkbControlsNotifyEvent
|
|
||||||
indicators*: TXkbIndicatorNotifyEvent
|
|
||||||
names*: TXkbNamesNotifyEvent
|
|
||||||
compat*: TXkbCompatMapNotifyEvent
|
|
||||||
bell*: TXkbBellNotifyEvent
|
|
||||||
message*: TXkbActionMessageEvent
|
|
||||||
accessx*: TXkbAccessXNotifyEvent
|
|
||||||
device*: TXkbExtensionDeviceNotifyEvent
|
|
||||||
core*: TXEvent
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXkbKbdDpyStatePtr* = ptr TXkbKbdDpyStateRec
|
|
||||||
TXkbKbdDpyStateRec*{.final.} = object # XkbOpenDisplay error codes
|
|
||||||
|
|
||||||
const
|
|
||||||
XkbOD_Success* = 0
|
|
||||||
XkbOD_BadLibraryVersion* = 1
|
|
||||||
XkbOD_ConnectionRefused* = 2
|
|
||||||
XkbOD_NonXkbServer* = 3
|
|
||||||
XkbOD_BadServerVersion* = 4 # Values for XlibFlags
|
|
||||||
|
|
||||||
const
|
|
||||||
XkbLC_ForceLatin1Lookup* = 1 shl 0
|
|
||||||
XkbLC_ConsumeLookupMods* = 1 shl 1
|
|
||||||
XkbLC_AlwaysConsumeShiftAndLock* = 1 shl 2
|
|
||||||
XkbLC_IgnoreNewKeyboards* = 1 shl 3
|
|
||||||
XkbLC_ControlFallback* = 1 shl 4
|
|
||||||
XkbLC_ConsumeKeysOnComposeFail* = 1 shl 29
|
|
||||||
XkbLC_ComposeLED* = 1 shl 30
|
|
||||||
XkbLC_BeepOnComposeFail* = 1 shl 31
|
|
||||||
XkbLC_AllComposeControls* = 0xC0000000
|
|
||||||
XkbLC_AllControls* = 0xC000001F
|
|
||||||
|
|
||||||
proc XkbIgnoreExtension*(ignore: bool): bool{.libx11c,
|
|
||||||
importc: "XkbIgnoreExtension".}
|
|
||||||
proc XkbOpenDisplay*(name: cstring, ev_rtrn, err_rtrn, major_rtrn, minor_rtrn,
|
|
||||||
reason: ptr int16): PDisplay{.libx11c, importc: "XkbOpenDisplay".}
|
|
||||||
proc XkbQueryExtension*(dpy: PDisplay, opcodeReturn, eventBaseReturn,
|
|
||||||
errorBaseReturn, majorRtrn, minorRtrn: ptr int16): bool{.
|
|
||||||
libx11c, importc: "XkbQueryExtension".}
|
|
||||||
proc XkbUseExtension*(dpy: PDisplay, major_rtrn, minor_rtrn: ptr int16): bool{.
|
|
||||||
libx11c, importc: "XkbUseExtension".}
|
|
||||||
proc XkbLibraryVersion*(libMajorRtrn, libMinorRtrn: ptr int16): bool{.libx11c, importc: "XkbLibraryVersion".}
|
|
||||||
proc XkbSetXlibControls*(dpy: PDisplay, affect, values: int16): int16{.libx11c, importc: "XkbSetXlibControls".}
|
|
||||||
proc XkbGetXlibControls*(dpy: PDisplay): int16{.libx11c,
|
|
||||||
importc: "XkbGetXlibControls".}
|
|
||||||
type
|
|
||||||
TXkbInternAtomFunc* = proc (dpy: PDisplay, name: cstring, only_if_exists: bool): TAtom{.
|
|
||||||
cdecl.}
|
|
||||||
|
|
||||||
type
|
|
||||||
TXkbGetAtomNameFunc* = proc (dpy: PDisplay, atom: TAtom): cstring{.cdecl.}
|
|
||||||
|
|
||||||
proc XkbSetAtomFuncs*(getAtom: TXkbInternAtomFunc, getName: TXkbGetAtomNameFunc){.
|
|
||||||
libx11c, importc: "XkbSetAtomFuncs".}
|
|
||||||
proc XkbKeycodeToKeysym*(dpy: PDisplay, kc: TKeyCode, group, level: int16): TKeySym{.
|
|
||||||
libx11c, importc: "XkbKeycodeToKeysym".}
|
|
||||||
proc XkbKeysymToModifiers*(dpy: PDisplay, ks: TKeySym): int16{.libx11c, importc: "XkbKeysymToModifiers".}
|
|
||||||
proc XkbLookupKeySym*(dpy: PDisplay, keycode: TKeyCode,
|
|
||||||
modifiers, modifiers_return: int16, keysym_return: PKeySym): bool{.
|
|
||||||
libx11c, importc: "XkbLookupKeySym".}
|
|
||||||
proc XkbLookupKeyBinding*(dpy: PDisplay, sym_rtrn: TKeySym, mods: int16,
|
|
||||||
buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{.
|
|
||||||
libx11c, importc: "XkbLookupKeyBinding".}
|
|
||||||
proc XkbTranslateKeyCode*(xkb: PXkbDescPtr, keycode: TKeyCode,
|
|
||||||
modifiers, modifiers_return: int16,
|
|
||||||
keysym_return: PKeySym): bool{.libx11c,
|
|
||||||
importc: "XkbTranslateKeyCode".}
|
|
||||||
proc XkbTranslateKeySym*(dpy: PDisplay, sym_return: TKeySym, modifiers: int16,
|
|
||||||
buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{.
|
|
||||||
libx11c, importc: "XkbTranslateKeySym".}
|
|
||||||
proc XkbSetAutoRepeatRate*(dpy: PDisplay, deviceSpec, delay, interval: int16): bool{.
|
|
||||||
libx11c, importc: "XkbSetAutoRepeatRate".}
|
|
||||||
proc XkbGetAutoRepeatRate*(dpy: PDisplay, deviceSpec: int16,
|
|
||||||
delayRtrn, intervalRtrn: PWord): bool{.libx11c, importc: "XkbGetAutoRepeatRate".}
|
|
||||||
proc XkbChangeEnabledControls*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{.
|
|
||||||
libx11c, importc: "XkbChangeEnabledControls".}
|
|
||||||
proc XkbDeviceBell*(dpy: PDisplay, win: TWindow,
|
|
||||||
deviceSpec, bellClass, bellID, percent: int16, name: TAtom): bool{.
|
|
||||||
libx11c, importc: "XkbDeviceBell".}
|
|
||||||
proc XkbForceDeviceBell*(dpy: PDisplay,
|
|
||||||
deviceSpec, bellClass, bellID, percent: int16): bool{.
|
|
||||||
libx11c, importc: "XkbForceDeviceBell".}
|
|
||||||
proc XkbDeviceBellEvent*(dpy: PDisplay, win: TWindow,
|
|
||||||
deviceSpec, bellClass, bellID, percent: int16,
|
|
||||||
name: TAtom): bool{.libx11c,
|
|
||||||
importc: "XkbDeviceBellEvent".}
|
|
||||||
proc XkbBell*(dpy: PDisplay, win: TWindow, percent: int16, name: TAtom): bool{.
|
|
||||||
libx11c, importc: "XkbBell".}
|
|
||||||
proc XkbForceBell*(dpy: PDisplay, percent: int16): bool{.libx11c,
|
|
||||||
importc: "XkbForceBell".}
|
|
||||||
proc XkbBellEvent*(dpy: PDisplay, win: TWindow, percent: int16, name: TAtom): bool{.
|
|
||||||
libx11c, importc: "XkbBellEvent".}
|
|
||||||
proc XkbSelectEvents*(dpy: PDisplay, deviceID, affect, values: int16): bool{.
|
|
||||||
libx11c, importc: "XkbSelectEvents".}
|
|
||||||
proc XkbSelectEventDetails*(dpy: PDisplay, deviceID, eventType: int16,
|
|
||||||
affect, details: int32): bool{.libx11c, importc: "XkbSelectEventDetails".}
|
|
||||||
proc XkbNoteMapChanges*(old: PXkbMapChangesPtr, new: PXkbMapNotifyEvent,
|
|
||||||
wanted: int16){.libx11c,
|
|
||||||
importc: "XkbNoteMapChanges".}
|
|
||||||
proc XkbNoteNameChanges*(old: PXkbNameChangesPtr, new: PXkbNamesNotifyEvent,
|
|
||||||
wanted: int16){.libx11c,
|
|
||||||
importc: "XkbNoteNameChanges".}
|
|
||||||
proc XkbGetIndicatorState*(dpy: PDisplay, deviceSpec: int16, pStateRtrn: PWord): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetIndicatorState".}
|
|
||||||
proc XkbGetDeviceIndicatorState*(dpy: PDisplay,
|
|
||||||
deviceSpec, ledClass, ledID: int16,
|
|
||||||
pStateRtrn: PWord): TStatus{.libx11c, importc: "XkbGetDeviceIndicatorState".}
|
|
||||||
proc XkbGetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetIndicatorMap".}
|
|
||||||
proc XkbSetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{.
|
|
||||||
libx11c, importc: "XkbSetIndicatorMap".}
|
|
||||||
proc XkbNoteIndicatorMapChanges*(o, n: PXkbIndicatorChangesPtr, w: int16)
|
|
||||||
proc XkbNoteIndicatorStateChanges*(o, n: PXkbIndicatorChangesPtr, w: int16)
|
|
||||||
proc XkbGetIndicatorMapChanges*(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbIndicatorChangesPtr): TStatus
|
|
||||||
proc XkbChangeIndicatorMaps*(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbIndicatorChangesPtr): bool
|
|
||||||
proc XkbGetNamedIndicator*(dpy: PDisplay, name: TAtom, pNdxRtrn: ptr int16,
|
|
||||||
pStateRtrn: ptr bool, pMapRtrn: PXkbIndicatorMapPtr,
|
|
||||||
pRealRtrn: ptr bool): bool{.libx11c,
|
|
||||||
importc: "XkbGetNamedIndicator".}
|
|
||||||
proc XkbGetNamedDeviceIndicator*(dpy: PDisplay,
|
|
||||||
deviceSpec, ledClass, ledID: int16,
|
|
||||||
name: TAtom, pNdxRtrn: ptr int16,
|
|
||||||
pStateRtrn: ptr bool,
|
|
||||||
pMapRtrn: PXkbIndicatorMapPtr,
|
|
||||||
pRealRtrn: ptr bool): bool{.libx11c, importc: "XkbGetNamedDeviceIndicator".}
|
|
||||||
proc XkbSetNamedIndicator*(dpy: PDisplay, name: TAtom,
|
|
||||||
changeState, state, createNewMap: bool,
|
|
||||||
pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedIndicator".}
|
|
||||||
proc XkbSetNamedDeviceIndicator*(dpy: PDisplay,
|
|
||||||
deviceSpec, ledClass, ledID: int16,
|
|
||||||
name: TAtom,
|
|
||||||
changeState, state, createNewMap: bool,
|
|
||||||
pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedDeviceIndicator".}
|
|
||||||
proc XkbLockModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{.
|
|
||||||
libx11c, importc: "XkbLockModifiers".}
|
|
||||||
proc XkbLatchModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{.
|
|
||||||
libx11c, importc: "XkbLatchModifiers".}
|
|
||||||
proc XkbLockGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLockGroup".}
|
|
||||||
proc XkbLatchGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLatchGroup".}
|
|
||||||
proc XkbSetServerInternalMods*(dpy: PDisplay, deviceSpec, affectReal,
|
|
||||||
realValues, affectVirtual, virtualValues: int16): bool{.libx11c, importc: "XkbSetServerInternalMods".}
|
|
||||||
proc XkbSetIgnoreLockMods*(dpy: PDisplay, deviceSpec, affectReal, realValues,
|
|
||||||
affectVirtual, virtualValues: int16): bool{.libx11c,
|
|
||||||
importc: "XkbSetIgnoreLockMods".}
|
|
||||||
proc XkbVirtualModsToReal*(dpy: PDisplay, virtual_mask: int16, mask_rtrn: PWord): bool{.
|
|
||||||
libx11c, importc: "XkbVirtualModsToReal".}
|
|
||||||
proc XkbComputeEffectiveMap*(xkb: PXkbDescPtr, theType: PXkbKeyTypePtr,
|
|
||||||
map_rtrn: PByte): bool{.libx11c,
|
|
||||||
importc: "XkbComputeEffectiveMap".}
|
|
||||||
proc XkbInitCanonicalKeyTypes*(xkb: PXkbDescPtr, which: int16, keypadVMod: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbInitCanonicalKeyTypes".}
|
|
||||||
proc XkbAllocKeyboard*(): PXkbDescPtr{.libx11c,
|
|
||||||
importc: "XkbAllocKeyboard".}
|
|
||||||
proc XkbFreeKeyboard*(xkb: PXkbDescPtr, which: int16, freeDesc: bool){.libx11c, importc: "XkbFreeKeyboard".}
|
|
||||||
proc XkbAllocClientMap*(xkb: PXkbDescPtr, which, nTypes: int16): TStatus{.libx11c, importc: "XkbAllocClientMap".}
|
|
||||||
proc XkbAllocServerMap*(xkb: PXkbDescPtr, which, nActions: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbAllocServerMap".}
|
|
||||||
proc XkbFreeClientMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeClientMap".}
|
|
||||||
proc XkbFreeServerMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeServerMap".}
|
|
||||||
proc XkbAddKeyType*(xkb: PXkbDescPtr, name: TAtom, map_count: int16,
|
|
||||||
want_preserve: bool, num_lvls: int16): PXkbKeyTypePtr{.
|
|
||||||
libx11c, importc: "XkbAddKeyType".}
|
|
||||||
proc XkbAllocIndicatorMaps*(xkb: PXkbDescPtr): TStatus{.libx11c,
|
|
||||||
importc: "XkbAllocIndicatorMaps".}
|
|
||||||
proc XkbFreeIndicatorMaps*(xkb: PXkbDescPtr){.libx11c,
|
|
||||||
importc: "XkbFreeIndicatorMaps".}
|
|
||||||
proc XkbGetMap*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{.libx11c, importc: "XkbGetMap".}
|
|
||||||
proc XkbGetUpdatedMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetUpdatedMap".}
|
|
||||||
proc XkbGetMapChanges*(dpy: PDisplay, xkb: PXkbDescPtr,
|
|
||||||
changes: PXkbMapChangesPtr): TStatus{.libx11c, importc: "XkbGetMapChanges".}
|
|
||||||
proc XkbRefreshKeyboardMapping*(event: PXkbMapNotifyEvent): TStatus{.libx11c, importc: "XkbRefreshKeyboardMapping".}
|
|
||||||
proc XkbGetKeyTypes*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetKeyTypes".}
|
|
||||||
proc XkbGetKeySyms*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetKeySyms".}
|
|
||||||
proc XkbGetKeyActions*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetKeyActions".}
|
|
||||||
proc XkbGetKeyBehaviors*(dpy: PDisplay, firstKey, nKeys: int16,
|
|
||||||
desc: PXkbDescPtr): TStatus{.libx11c,
|
|
||||||
importc: "XkbGetKeyBehaviors".}
|
|
||||||
proc XkbGetVirtualMods*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetVirtualMods".}
|
|
||||||
proc XkbGetKeyExplicitComponents*(dpy: PDisplay, firstKey, nKeys: int16,
|
|
||||||
desc: PXkbDescPtr): TStatus{.libx11c, importc: "XkbGetKeyExplicitComponents".}
|
|
||||||
proc XkbGetKeyModifierMap*(dpy: PDisplay, firstKey, nKeys: int16,
|
|
||||||
desc: PXkbDescPtr): TStatus{.libx11c,
|
|
||||||
importc: "XkbGetKeyModifierMap".}
|
|
||||||
proc XkbAllocControls*(xkb: PXkbDescPtr, which: int16): TStatus{.libx11c, importc: "XkbAllocControls".}
|
|
||||||
proc XkbFreeControls*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeControls".}
|
|
||||||
proc XkbGetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetControls".}
|
|
||||||
proc XkbSetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{.
|
|
||||||
libx11c, importc: "XkbSetControls".}
|
|
||||||
proc XkbNoteControlsChanges*(old: PXkbControlsChangesPtr,
|
|
||||||
new: PXkbControlsNotifyEvent, wanted: int16){.
|
|
||||||
libx11c, importc: "XkbNoteControlsChanges".}
|
|
||||||
proc XkbGetControlsChanges*(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbControlsChangesPtr): TStatus
|
|
||||||
proc XkbChangeControls*(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool
|
|
||||||
proc XkbAllocCompatMap*(xkb: PXkbDescPtr, which, nInterpret: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbAllocCompatMap".}
|
|
||||||
proc XkbFreeCompatMap*(xkib: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeCompatMap".}
|
|
||||||
proc XkbGetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetCompatMap".}
|
|
||||||
proc XkbSetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr,
|
|
||||||
updateActions: bool): bool{.libx11c,
|
|
||||||
importc: "XkbSetCompatMap".}
|
|
||||||
proc XkbAddSymInterpret*(xkb: PXkbDescPtr, si: PXkbSymInterpretPtr,
|
|
||||||
updateMap: bool, changes: PXkbChangesPtr): PXkbSymInterpretPtr{.
|
|
||||||
libx11c, importc: "XkbAddSymInterpret".}
|
|
||||||
proc XkbAllocNames*(xkb: PXkbDescPtr, which: int16,
|
|
||||||
nTotalRG, nTotalAliases: int16): TStatus{.libx11c, importc: "XkbAllocNames".}
|
|
||||||
proc XkbGetNames*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetNames".}
|
|
||||||
proc XkbSetNames*(dpy: PDisplay, which, firstType, nTypes: int16,
|
|
||||||
desc: PXkbDescPtr): bool{.libx11c,
|
|
||||||
importc: "XkbSetNames".}
|
|
||||||
proc XkbChangeNames*(dpy: PDisplay, xkb: PXkbDescPtr,
|
|
||||||
changes: PXkbNameChangesPtr): bool{.libx11c,
|
|
||||||
importc: "XkbChangeNames".}
|
|
||||||
proc XkbFreeNames*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeNames".}
|
|
||||||
proc XkbGetState*(dpy: PDisplay, deviceSpec: int16, rtrnState: PXkbStatePtr): TStatus{.
|
|
||||||
libx11c, importc: "XkbGetState".}
|
|
||||||
proc XkbSetMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): bool{.libx11c, importc: "XkbSetMap".}
|
|
||||||
proc XkbChangeMap*(dpy: PDisplay, desc: PXkbDescPtr, changes: PXkbMapChangesPtr): bool{.
|
|
||||||
libx11c, importc: "XkbChangeMap".}
|
|
||||||
proc XkbSetDetectableAutoRepeat*(dpy: PDisplay, detectable: bool,
|
|
||||||
supported: ptr bool): bool{.libx11c, importc: "XkbSetDetectableAutoRepeat".}
|
|
||||||
proc XkbGetDetectableAutoRepeat*(dpy: PDisplay, supported: ptr bool): bool{.
|
|
||||||
libx11c, importc: "XkbGetDetectableAutoRepeat".}
|
|
||||||
proc XkbSetAutoResetControls*(dpy: PDisplay, changes: int16,
|
|
||||||
auto_ctrls, auto_values: PWord): bool{.libx11c, importc: "XkbSetAutoResetControls".}
|
|
||||||
proc XkbGetAutoResetControls*(dpy: PDisplay, auto_ctrls, auto_ctrl_values: PWord): bool{.
|
|
||||||
libx11c, importc: "XkbGetAutoResetControls".}
|
|
||||||
proc XkbSetPerClientControls*(dpy: PDisplay, change: int16, values: PWord): bool{.
|
|
||||||
libx11c, importc: "XkbSetPerClientControls".}
|
|
||||||
proc XkbGetPerClientControls*(dpy: PDisplay, ctrls: PWord): bool{.libx11c, importc: "XkbGetPerClientControls".}
|
|
||||||
proc XkbCopyKeyType*(`from`, into: PXkbKeyTypePtr): TStatus{.libx11c, importc: "XkbCopyKeyType".}
|
|
||||||
proc XkbCopyKeyTypes*(`from`, into: PXkbKeyTypePtr, num_types: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbCopyKeyTypes".}
|
|
||||||
proc XkbResizeKeyType*(xkb: PXkbDescPtr, type_ndx, map_count: int16,
|
|
||||||
want_preserve: bool, new_num_lvls: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbResizeKeyType".}
|
|
||||||
proc XkbResizeKeySyms*(desc: PXkbDescPtr, forKey, symsNeeded: int16): PKeySym{.
|
|
||||||
libx11c, importc: "XkbResizeKeySyms".}
|
|
||||||
proc XkbResizeKeyActions*(desc: PXkbDescPtr, forKey, actsNeeded: int16): PXkbAction{.
|
|
||||||
libx11c, importc: "XkbResizeKeyActions".}
|
|
||||||
proc XkbChangeTypesOfKey*(xkb: PXkbDescPtr, key, num_groups: int16,
|
|
||||||
groups: int16, newTypes: ptr int16,
|
|
||||||
pChanges: PXkbMapChangesPtr): TStatus{.libx11c, importc: "XkbChangeTypesOfKey".}
|
|
||||||
|
|
||||||
proc XkbListComponents*(dpy: PDisplay, deviceSpec: int16,
|
|
||||||
ptrns: PXkbComponentNamesPtr, max_inout: ptr int16): PXkbComponentListPtr{.
|
|
||||||
libx11c, importc: "XkbListComponents".}
|
|
||||||
proc XkbFreeComponentList*(list: PXkbComponentListPtr){.libx11c,
|
|
||||||
importc: "XkbFreeComponentList".}
|
|
||||||
proc XkbGetKeyboard*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{.
|
|
||||||
libx11c, importc: "XkbGetKeyboard".}
|
|
||||||
proc XkbGetKeyboardByName*(dpy: PDisplay, deviceSpec: int16,
|
|
||||||
names: PXkbComponentNamesPtr, want, need: int16,
|
|
||||||
load: bool): PXkbDescPtr{.libx11c,
|
|
||||||
importc: "XkbGetKeyboardByName".}
|
|
||||||
|
|
||||||
proc XkbKeyTypesForCoreSymbols*(xkb: PXkbDescPtr,
|
|
||||||
map_width: int16, # keyboard device
|
|
||||||
core_syms: PKeySym, # always mapWidth symbols
|
|
||||||
protected: int16, # explicit key types
|
|
||||||
types_inout: ptr int16, # always four type indices
|
|
||||||
xkb_syms_rtrn: PKeySym): int16{.libx11c, importc: "XkbKeyTypesForCoreSymbols".}
|
|
||||||
# must have enough space
|
|
||||||
proc XkbApplyCompatMapToKey*(xkb: PXkbDescPtr,
|
|
||||||
key: TKeyCode, # key to be updated
|
|
||||||
changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyCompatMapToKey".}
|
|
||||||
# resulting changes to map
|
|
||||||
proc XkbUpdateMapFromCore*(xkb: PXkbDescPtr,
|
|
||||||
first_key: TKeyCode, # first changed key
|
|
||||||
num_keys,
|
|
||||||
map_width: int16,
|
|
||||||
core_keysyms: PKeySym, # symbols `from` core keymap
|
|
||||||
changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbUpdateMapFromCore".}
|
|
||||||
|
|
||||||
proc XkbAddDeviceLedInfo*(devi: PXkbDeviceInfoPtr, ledClass, ledId: int16): PXkbDeviceLedInfoPtr{.
|
|
||||||
libx11c, importc: "XkbAddDeviceLedInfo".}
|
|
||||||
proc XkbResizeDeviceButtonActions*(devi: PXkbDeviceInfoPtr, newTotal: int16): TStatus{.
|
|
||||||
libx11c, importc: "XkbResizeDeviceButtonActions".}
|
|
||||||
proc XkbAllocDeviceInfo*(deviceSpec, nButtons, szLeds: int16): PXkbDeviceInfoPtr{.
|
|
||||||
libx11c, importc: "XkbAllocDeviceInfo".}
|
|
||||||
proc XkbFreeDeviceInfo*(devi: PXkbDeviceInfoPtr, which: int16, freeDevI: bool){.
|
|
||||||
libx11c, importc: "XkbFreeDeviceInfo".}
|
|
||||||
proc XkbNoteDeviceChanges*(old: PXkbDeviceChangesPtr,
|
|
||||||
new: PXkbExtensionDeviceNotifyEvent, wanted: int16){.
|
|
||||||
libx11c, importc: "XkbNoteDeviceChanges".}
|
|
||||||
proc XkbGetDeviceInfo*(dpy: PDisplay, which, deviceSpec, ledClass, ledID: int16): PXkbDeviceInfoPtr{.
|
|
||||||
libx11c, importc: "XkbGetDeviceInfo".}
|
|
||||||
proc XkbGetDeviceInfoChanges*(dpy: PDisplay, devi: PXkbDeviceInfoPtr,
|
|
||||||
changes: PXkbDeviceChangesPtr): TStatus{.libx11c, importc: "XkbGetDeviceInfoChanges".}
|
|
||||||
proc XkbGetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr,
|
|
||||||
all: bool, first, nBtns: int16): TStatus{.libx11c, importc: "XkbGetDeviceButtonActions".}
|
|
||||||
proc XkbGetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr,
|
|
||||||
ledClass, ledId, which: int16): TStatus{.libx11c, importc: "XkbGetDeviceLedInfo".}
|
|
||||||
proc XkbSetDeviceInfo*(dpy: PDisplay, which: int16, devi: PXkbDeviceInfoPtr): bool{.
|
|
||||||
libx11c, importc: "XkbSetDeviceInfo".}
|
|
||||||
proc XkbChangeDeviceInfo*(dpy: PDisplay, desc: PXkbDeviceInfoPtr,
|
|
||||||
changes: PXkbDeviceChangesPtr): bool{.libx11c, importc: "XkbChangeDeviceInfo".}
|
|
||||||
proc XkbSetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr,
|
|
||||||
ledClass, ledID, which: int16): bool{.libx11c, importc: "XkbSetDeviceLedInfo".}
|
|
||||||
proc XkbSetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr,
|
|
||||||
first, nBtns: int16): bool{.libx11c, importc: "XkbSetDeviceButtonActions".}
|
|
||||||
|
|
||||||
proc XkbToControl*(c: int8): int8{.libx11c,
|
|
||||||
importc: "XkbToControl".}
|
|
||||||
|
|
||||||
proc XkbSetDebuggingFlags*(dpy: PDisplay, mask, flags: int16, msg: cstring,
|
|
||||||
ctrls_mask, ctrls, rtrn_flags, rtrn_ctrls: int16): bool{.
|
|
||||||
libx11c, importc: "XkbSetDebuggingFlags".}
|
|
||||||
proc XkbApplyVirtualModChanges*(xkb: PXkbDescPtr, changed: int16,
|
|
||||||
changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyVirtualModChanges".}
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc XkbNoteIndicatorMapChanges(o, n: PXkbIndicatorChangesPtr, w: int16) =
|
|
||||||
##define XkbNoteIndicatorMapChanges(o,n,w) ((o)->map_changes|=((n)->map_changes&(w)))
|
|
||||||
o.map_changes = o.map_changes or (n.map_changes and w)
|
|
||||||
|
|
||||||
proc XkbNoteIndicatorStateChanges(o, n: PXkbIndicatorChangesPtr, w: int16) =
|
|
||||||
##define XkbNoteIndicatorStateChanges(o,n,w) ((o)->state_changes|=((n)->state_changes&(w)))
|
|
||||||
o.state_changes = o.state_changes or (n.state_changes and (w))
|
|
||||||
|
|
||||||
proc XkbGetIndicatorMapChanges(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbIndicatorChangesPtr): TStatus =
|
|
||||||
##define XkbGetIndicatorMapChanges(d,x,c) (XkbGetIndicatorMap((d),(c)->map_changes,x)
|
|
||||||
Result = XkbGetIndicatorMap(d, c.map_changes, x)
|
|
||||||
|
|
||||||
proc XkbChangeIndicatorMaps(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbIndicatorChangesPtr): bool =
|
|
||||||
##define XkbChangeIndicatorMaps(d,x,c) (XkbSetIndicatorMap((d),(c)->map_changes,x))
|
|
||||||
Result = XkbSetIndicatorMap(d, c.map_changes, x)
|
|
||||||
|
|
||||||
proc XkbGetControlsChanges(d: PDisplay, x: PXkbDescPtr,
|
|
||||||
c: PXkbControlsChangesPtr): TStatus =
|
|
||||||
##define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x)
|
|
||||||
Result = XkbGetControls(d, c.changed_ctrls, x)
|
|
||||||
|
|
||||||
proc XkbChangeControls(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool =
|
|
||||||
##define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x)
|
|
||||||
Result = XkbSetControls(d, c.changed_ctrls, x)
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,194 +0,0 @@
|
||||||
#
|
|
||||||
# $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
|
|
||||||
#
|
|
||||||
# Copyright (C) 2000 Compaq Computer Corporation, Inc.
|
|
||||||
# Copyright (C) 2002 Hewlett-Packard Company, Inc.
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
# documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
# the above copyright notice appear in all copies and that both that
|
|
||||||
# copyright notice and this permission notice appear in supporting
|
|
||||||
# documentation, and that the name of Compaq not be used in advertising or
|
|
||||||
# publicity pertaining to distribution of the software without specific,
|
|
||||||
# written prior permission. HP makes no representations about the
|
|
||||||
# suitability of this software for any purpose. It is provided "as is"
|
|
||||||
# without express or implied warranty.
|
|
||||||
#
|
|
||||||
# HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
|
|
||||||
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
||||||
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
||||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
#
|
|
||||||
# Author: Jim Gettys, HP Labs, HP.
|
|
||||||
#
|
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
const
|
|
||||||
libXrandr* = "libXrandr.so"
|
|
||||||
|
|
||||||
# * $XFree86: xc/include/extensions/randr.h,v 1.4 2001/11/24 07:24:58 keithp Exp $
|
|
||||||
# *
|
|
||||||
# * Copyright (C) 2000, Compaq Computer Corporation,
|
|
||||||
# * Copyright (C) 2002, Hewlett Packard, Inc.
|
|
||||||
# *
|
|
||||||
# * Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
# * documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
# * the above copyright notice appear in all copies and that both that
|
|
||||||
# * copyright notice and this permission notice appear in supporting
|
|
||||||
# * documentation, and that the name of Compaq or HP not be used in advertising
|
|
||||||
# * or publicity pertaining to distribution of the software without specific,
|
|
||||||
# * written prior permission. HP makes no representations about the
|
|
||||||
# * suitability of this software for any purpose. It is provided "as is"
|
|
||||||
# * without express or implied warranty.
|
|
||||||
# *
|
|
||||||
# * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
||||||
# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
|
|
||||||
# * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
# * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
||||||
# * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
||||||
# * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
# *
|
|
||||||
# * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
|
|
||||||
# *
|
|
||||||
|
|
||||||
type
|
|
||||||
PRotation* = ptr TRotation
|
|
||||||
TRotation* = cushort
|
|
||||||
PSizeID* = ptr TSizeID
|
|
||||||
TSizeID* = cushort
|
|
||||||
PSubpixelOrder* = ptr TSubpixelOrder
|
|
||||||
TSubpixelOrder* = cushort
|
|
||||||
|
|
||||||
const
|
|
||||||
RANDR_NAME* = "RANDR"
|
|
||||||
RANDR_MAJOR* = 1
|
|
||||||
RANDR_MINOR* = 1
|
|
||||||
RRNumberErrors* = 0
|
|
||||||
RRNumberEvents* = 1
|
|
||||||
constX_RRQueryVersion* = 0 # we skip 1 to make old clients fail pretty immediately
|
|
||||||
X_RROldGetScreenInfo* = 1
|
|
||||||
X_RR1_0SetScreenConfig* = 2 # V1.0 apps share the same set screen config request id
|
|
||||||
constX_RRSetScreenConfig* = 2
|
|
||||||
X_RROldScreenChangeSelectInput* = 3 # 3 used to be ScreenChangeSelectInput; deprecated
|
|
||||||
constX_RRSelectInput* = 4
|
|
||||||
constX_RRGetScreenInfo* = 5 # used in XRRSelectInput
|
|
||||||
RRScreenChangeNotifyMask* = 1 shl 0
|
|
||||||
RRScreenChangeNotify* = 0 # used in the rotation field; rotation and reflection in 0.1 proto.
|
|
||||||
RR_Rotate_0* = 1
|
|
||||||
RR_Rotate_90* = 2
|
|
||||||
RR_Rotate_180* = 4
|
|
||||||
RR_Rotate_270* = 8 # new in 1.0 protocol, to allow reflection of screen
|
|
||||||
RR_Reflect_X* = 16
|
|
||||||
RR_Reflect_Y* = 32
|
|
||||||
RRSetConfigSuccess* = 0
|
|
||||||
RRSetConfigInvalidConfigTime* = 1
|
|
||||||
RRSetConfigInvalidTime* = 2
|
|
||||||
RRSetConfigFailed* = 3
|
|
||||||
|
|
||||||
type
|
|
||||||
PXRRScreenSize* = ptr TXRRScreenSize
|
|
||||||
TXRRScreenSize*{.final.} = object #
|
|
||||||
# Events.
|
|
||||||
#
|
|
||||||
width*, height*: cint
|
|
||||||
mwidth*, mheight*: cint
|
|
||||||
|
|
||||||
TXRRScreenChangeNotifyEvent*{.final.} = object # internal representation is private to the library
|
|
||||||
typ*: cint # event base
|
|
||||||
serial*: culong # # of last request processed by server
|
|
||||||
send_event*: TBool # true if this came from a SendEvent request
|
|
||||||
display*: PDisplay # Display the event was read from
|
|
||||||
window*: TWindow # window which selected for this event
|
|
||||||
root*: TWindow # Root window for changed screen
|
|
||||||
timestamp*: TTime # when the screen change occurred
|
|
||||||
config_timestamp*: TTime # when the last configuration change
|
|
||||||
size_index*: TSizeID
|
|
||||||
subpixel_order*: TSubpixelOrder
|
|
||||||
rotation*: TRotation
|
|
||||||
width*: cint
|
|
||||||
height*: cint
|
|
||||||
mwidth*: cint
|
|
||||||
mheight*: cint
|
|
||||||
|
|
||||||
PXRRScreenConfiguration* = ptr TXRRScreenConfiguration
|
|
||||||
TXRRScreenConfiguration*{.final.} = object
|
|
||||||
|
|
||||||
proc XRRQueryExtension*(dpy: PDisplay, event_basep, error_basep: Pcint): TBool{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRQueryVersion*(dpy: PDisplay, major_versionp: Pcint,
|
|
||||||
minor_versionp: Pcint): TStatus{.cdecl, dynlib: libXrandr,
|
|
||||||
importc.}
|
|
||||||
proc XRRGetScreenInfo*(dpy: PDisplay, draw: TDrawable): PXRRScreenConfiguration{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRFreeScreenConfigInfo*(config: PXRRScreenConfiguration){.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
#
|
|
||||||
# Note that screen configuration changes are only permitted if the client can
|
|
||||||
# prove it has up to date configuration information. We are trying to
|
|
||||||
# insist that it become possible for screens to change dynamically, so
|
|
||||||
# we want to ensure the client knows what it is talking about when requesting
|
|
||||||
# changes.
|
|
||||||
#
|
|
||||||
proc XRRSetScreenConfig*(dpy: PDisplay, config: PXRRScreenConfiguration,
|
|
||||||
draw: TDrawable, size_index: cint, rotation: TRotation,
|
|
||||||
timestamp: TTime): TStatus{.cdecl, dynlib: libXrandr,
|
|
||||||
importc.}
|
|
||||||
# added in v1.1, sorry for the lame name
|
|
||||||
proc XRRSetScreenConfigAndRate*(dpy: PDisplay, config: PXRRScreenConfiguration,
|
|
||||||
draw: TDrawable, size_index: cint,
|
|
||||||
rotation: TRotation, rate: cshort,
|
|
||||||
timestamp: TTime): TStatus{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigRotations*(config: PXRRScreenConfiguration,
|
|
||||||
current_rotation: PRotation): TRotation{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigTimes*(config: PXRRScreenConfiguration, config_timestamp: PTime): TTime{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigSizes*(config: PXRRScreenConfiguration, nsizes: Pcint): PXRRScreenSize{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigRates*(config: PXRRScreenConfiguration, sizeID: cint,
|
|
||||||
nrates: Pcint): ptr int16{.cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigCurrentConfiguration*(config: PXRRScreenConfiguration,
|
|
||||||
rotation: PRotation): TSizeID{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfigCurrentRate*(config: PXRRScreenConfiguration): cshort{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
proc XRRRootToScreen*(dpy: PDisplay, root: TWindow): cint{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
#
|
|
||||||
# returns the screen configuration for the specified screen; does a lazy
|
|
||||||
# evalution to delay getting the information, and caches the result.
|
|
||||||
# These routines should be used in preference to XRRGetScreenInfo
|
|
||||||
# to avoid unneeded round trips to the X server. These are new
|
|
||||||
# in protocol version 0.1.
|
|
||||||
#
|
|
||||||
proc XRRScreenConfig*(dpy: PDisplay, screen: cint): PXRRScreenConfiguration{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRConfig*(screen: PScreen): PXRRScreenConfiguration{.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
proc XRRSelectInput*(dpy: PDisplay, window: TWindow, mask: cint){.cdecl,
|
|
||||||
dynlib: libXrandr, importc.}
|
|
||||||
#
|
|
||||||
# the following are always safe to call, even if RandR is not implemented
|
|
||||||
# on a screen
|
|
||||||
#
|
|
||||||
proc XRRRotations*(dpy: PDisplay, screen: cint, current_rotation: PRotation): TRotation{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRSizes*(dpy: PDisplay, screen: cint, nsizes: Pcint): PXRRScreenSize{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRRates*(dpy: PDisplay, screen: cint, sizeID: cint, nrates: Pcint): ptr int16{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
proc XRRTimes*(dpy: PDisplay, screen: cint, config_timestamp: PTime): TTime{.
|
|
||||||
cdecl, dynlib: libXrandr, importc.}
|
|
||||||
#
|
|
||||||
# intended to take RRScreenChangeNotify, or
|
|
||||||
# ConfigureNotify (on the root window)
|
|
||||||
# returns 1 if it is an event type it understands, 0 if not
|
|
||||||
#
|
|
||||||
proc XRRUpdateConfiguration*(event: PXEvent): cint{.cdecl, dynlib: libXrandr,
|
|
||||||
importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,241 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
when defined(use_pkg_config) or defined(use_pkg_config_static):
|
|
||||||
{.pragma: libxrender, cdecl, importc.}
|
|
||||||
when defined(use_pkg_config):
|
|
||||||
{.passl: gorge("pkg-config xrender --libs").}
|
|
||||||
else:
|
|
||||||
{.passl: gorge("pkg-config xrender --static --libs").}
|
|
||||||
else:
|
|
||||||
when defined(macosx):
|
|
||||||
const
|
|
||||||
libXrender* = "libXrender.dylib"
|
|
||||||
else:
|
|
||||||
const
|
|
||||||
libXrender* = "libXrender.so"
|
|
||||||
|
|
||||||
|
|
||||||
{.pragma: libxrender, dynlib: libXrender, cdecl, importc.}
|
|
||||||
#const
|
|
||||||
# libXrender* = "libXrender.so"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from xrender.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# xrender.h
|
|
||||||
#
|
|
||||||
|
|
||||||
type
|
|
||||||
PGlyph* = ptr TGlyph
|
|
||||||
TGlyph* = int32
|
|
||||||
PGlyphSet* = ptr TGlyphSet
|
|
||||||
TGlyphSet* = int32
|
|
||||||
PPicture* = ptr TPicture
|
|
||||||
TPicture* = int32
|
|
||||||
PPictFormat* = ptr TPictFormat
|
|
||||||
TPictFormat* = int32
|
|
||||||
|
|
||||||
const
|
|
||||||
RENDER_NAME* = "RENDER"
|
|
||||||
RENDER_MAJOR* = 0
|
|
||||||
RENDER_MINOR* = 0
|
|
||||||
constX_RenderQueryVersion* = 0
|
|
||||||
X_RenderQueryPictFormats* = 1
|
|
||||||
X_RenderQueryPictIndexValues* = 2
|
|
||||||
X_RenderQueryDithers* = 3
|
|
||||||
constX_RenderCreatePicture* = 4
|
|
||||||
constX_RenderChangePicture* = 5
|
|
||||||
X_RenderSetPictureClipRectangles* = 6
|
|
||||||
constX_RenderFreePicture* = 7
|
|
||||||
constX_RenderComposite* = 8
|
|
||||||
X_RenderScale* = 9
|
|
||||||
X_RenderTrapezoids* = 10
|
|
||||||
X_RenderTriangles* = 11
|
|
||||||
X_RenderTriStrip* = 12
|
|
||||||
X_RenderTriFan* = 13
|
|
||||||
X_RenderColorTrapezoids* = 14
|
|
||||||
X_RenderColorTriangles* = 15
|
|
||||||
X_RenderTransform* = 16
|
|
||||||
constX_RenderCreateGlyphSet* = 17
|
|
||||||
constX_RenderReferenceGlyphSet* = 18
|
|
||||||
constX_RenderFreeGlyphSet* = 19
|
|
||||||
constX_RenderAddGlyphs* = 20
|
|
||||||
constX_RenderAddGlyphsFromPicture* = 21
|
|
||||||
constX_RenderFreeGlyphs* = 22
|
|
||||||
constX_RenderCompositeGlyphs8* = 23
|
|
||||||
constX_RenderCompositeGlyphs16* = 24
|
|
||||||
constX_RenderCompositeGlyphs32* = 25
|
|
||||||
BadPictFormat* = 0
|
|
||||||
BadPicture* = 1
|
|
||||||
BadPictOp* = 2
|
|
||||||
BadGlyphSet* = 3
|
|
||||||
BadGlyph* = 4
|
|
||||||
RenderNumberErrors* = BadGlyph + 1
|
|
||||||
PictTypeIndexed* = 0
|
|
||||||
PictTypeDirect* = 1
|
|
||||||
PictOpClear* = 0
|
|
||||||
PictOpSrc* = 1
|
|
||||||
PictOpDst* = 2
|
|
||||||
PictOpOver* = 3
|
|
||||||
PictOpOverReverse* = 4
|
|
||||||
PictOpIn* = 5
|
|
||||||
PictOpInReverse* = 6
|
|
||||||
PictOpOut* = 7
|
|
||||||
PictOpOutReverse* = 8
|
|
||||||
PictOpAtop* = 9
|
|
||||||
PictOpAtopReverse* = 10
|
|
||||||
PictOpXor* = 11
|
|
||||||
PictOpAdd* = 12
|
|
||||||
PictOpSaturate* = 13
|
|
||||||
PictOpMaximum* = 13
|
|
||||||
PolyEdgeSharp* = 0
|
|
||||||
PolyEdgeSmooth* = 1
|
|
||||||
PolyModePrecise* = 0
|
|
||||||
PolyModeImprecise* = 1
|
|
||||||
CPRepeat* = 1 shl 0
|
|
||||||
CPAlphaMap* = 1 shl 1
|
|
||||||
CPAlphaXOrigin* = 1 shl 2
|
|
||||||
CPAlphaYOrigin* = 1 shl 3
|
|
||||||
CPClipXOrigin* = 1 shl 4
|
|
||||||
CPClipYOrigin* = 1 shl 5
|
|
||||||
CPClipMask* = 1 shl 6
|
|
||||||
CPGraphicsExposure* = 1 shl 7
|
|
||||||
CPSubwindowMode* = 1 shl 8
|
|
||||||
CPPolyEdge* = 1 shl 9
|
|
||||||
CPPolyMode* = 1 shl 10
|
|
||||||
CPDither* = 1 shl 11
|
|
||||||
CPLastBit* = 11
|
|
||||||
|
|
||||||
type
|
|
||||||
PXRenderDirectFormat* = ptr TXRenderDirectFormat
|
|
||||||
TXRenderDirectFormat*{.final.} = object
|
|
||||||
red*: int16
|
|
||||||
redMask*: int16
|
|
||||||
green*: int16
|
|
||||||
greenMask*: int16
|
|
||||||
blue*: int16
|
|
||||||
blueMask*: int16
|
|
||||||
alpha*: int16
|
|
||||||
alphaMask*: int16
|
|
||||||
|
|
||||||
PXRenderPictFormat* = ptr TXRenderPictFormat
|
|
||||||
TXRenderPictFormat*{.final.} = object
|
|
||||||
id*: TPictFormat
|
|
||||||
thetype*: int32
|
|
||||||
depth*: int32
|
|
||||||
direct*: TXRenderDirectFormat
|
|
||||||
colormap*: TColormap
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
PictFormatID* = 1 shl 0
|
|
||||||
PictFormatType* = 1 shl 1
|
|
||||||
PictFormatDepth* = 1 shl 2
|
|
||||||
PictFormatRed* = 1 shl 3
|
|
||||||
PictFormatRedMask* = 1 shl 4
|
|
||||||
PictFormatGreen* = 1 shl 5
|
|
||||||
PictFormatGreenMask* = 1 shl 6
|
|
||||||
PictFormatBlue* = 1 shl 7
|
|
||||||
PictFormatBlueMask* = 1 shl 8
|
|
||||||
PictFormatAlpha* = 1 shl 9
|
|
||||||
PictFormatAlphaMask* = 1 shl 10
|
|
||||||
PictFormatColormap* = 1 shl 11
|
|
||||||
|
|
||||||
type
|
|
||||||
PXRenderVisual* = ptr TXRenderVisual
|
|
||||||
TXRenderVisual*{.final.} = object
|
|
||||||
visual*: PVisual
|
|
||||||
format*: PXRenderPictFormat
|
|
||||||
|
|
||||||
PXRenderDepth* = ptr TXRenderDepth
|
|
||||||
TXRenderDepth*{.final.} = object
|
|
||||||
depth*: int32
|
|
||||||
nvisuals*: int32
|
|
||||||
visuals*: PXRenderVisual
|
|
||||||
|
|
||||||
PXRenderScreen* = ptr TXRenderScreen
|
|
||||||
TXRenderScreen*{.final.} = object
|
|
||||||
depths*: PXRenderDepth
|
|
||||||
ndepths*: int32
|
|
||||||
fallback*: PXRenderPictFormat
|
|
||||||
|
|
||||||
PXRenderInfo* = ptr TXRenderInfo
|
|
||||||
TXRenderInfo*{.final.} = object
|
|
||||||
format*: PXRenderPictFormat
|
|
||||||
nformat*: int32
|
|
||||||
screen*: PXRenderScreen
|
|
||||||
nscreen*: int32
|
|
||||||
depth*: PXRenderDepth
|
|
||||||
ndepth*: int32
|
|
||||||
visual*: PXRenderVisual
|
|
||||||
nvisual*: int32
|
|
||||||
|
|
||||||
PXRenderPictureAttributes* = ptr TXRenderPictureAttributes
|
|
||||||
TXRenderPictureAttributes*{.final.} = object
|
|
||||||
repeat*: TBool
|
|
||||||
alpha_map*: TPicture
|
|
||||||
alpha_x_origin*: int32
|
|
||||||
alpha_y_origin*: int32
|
|
||||||
clip_x_origin*: int32
|
|
||||||
clip_y_origin*: int32
|
|
||||||
clip_mask*: TPixmap
|
|
||||||
graphics_exposures*: TBool
|
|
||||||
subwindow_mode*: int32
|
|
||||||
poly_edge*: int32
|
|
||||||
poly_mode*: int32
|
|
||||||
dither*: TAtom
|
|
||||||
|
|
||||||
PXGlyphInfo* = ptr TXGlyphInfo
|
|
||||||
TXGlyphInfo*{.final.} = object
|
|
||||||
width*: int16
|
|
||||||
height*: int16
|
|
||||||
x*: int16
|
|
||||||
y*: int16
|
|
||||||
xOff*: int16
|
|
||||||
yOff*: int16
|
|
||||||
|
|
||||||
|
|
||||||
proc XRenderQueryExtension*(dpy: PDisplay, event_basep: ptr int32,
|
|
||||||
error_basep: ptr int32): TBool{.libxrender.}
|
|
||||||
proc XRenderQueryVersion*(dpy: PDisplay, major_versionp: ptr int32,
|
|
||||||
minor_versionp: ptr int32): TStatus{.libxrender.}
|
|
||||||
proc XRenderQueryFormats*(dpy: PDisplay): TStatus{.libxrender.}
|
|
||||||
proc XRenderFindVisualFormat*(dpy: PDisplay, visual: PVisual): PXRenderPictFormat{.
|
|
||||||
libxrender.}
|
|
||||||
proc XRenderFindFormat*(dpy: PDisplay, mask: int32,
|
|
||||||
`template`: PXRenderPictFormat, count: int32): PXRenderPictFormat{.
|
|
||||||
libxrender.}
|
|
||||||
proc XRenderCreatePicture*(dpy: PDisplay, drawable: TDrawable,
|
|
||||||
format: PXRenderPictFormat, valuemask: int32,
|
|
||||||
attributes: PXRenderPictureAttributes): TPicture{.
|
|
||||||
libxrender.}
|
|
||||||
proc XRenderChangePicture*(dpy: PDisplay, picture: TPicture, valuemask: int32,
|
|
||||||
attributes: PXRenderPictureAttributes){.libxrender.}
|
|
||||||
proc XRenderFreePicture*(dpy: PDisplay, picture: TPicture){.libxrender.}
|
|
||||||
proc XRenderComposite*(dpy: PDisplay, op: int32, src: TPicture, mask: TPicture,
|
|
||||||
dst: TPicture, src_x: int32, src_y: int32, mask_x: int32,
|
|
||||||
mask_y: int32, dst_x: int32, dst_y: int32, width: int32,
|
|
||||||
height: int32){.libxrender.}
|
|
||||||
proc XRenderCreateGlyphSet*(dpy: PDisplay, format: PXRenderPictFormat): TGlyphSet{.
|
|
||||||
libxrender.}
|
|
||||||
proc XRenderReferenceGlyphSet*(dpy: PDisplay, existing: TGlyphSet): TGlyphSet{.
|
|
||||||
libxrender.}
|
|
||||||
proc XRenderFreeGlyphSet*(dpy: PDisplay, glyphset: TGlyphSet){.libxrender.}
|
|
||||||
proc XRenderAddGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
|
|
||||||
glyphs: PXGlyphInfo, nglyphs: int32, images: cstring,
|
|
||||||
nbyte_images: int32){.libxrender.}
|
|
||||||
proc XRenderFreeGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
|
|
||||||
nglyphs: int32){.libxrender.}
|
|
||||||
proc XRenderCompositeString8*(dpy: PDisplay, op: int32, src: TPicture,
|
|
||||||
dst: TPicture, maskFormat: PXRenderPictFormat,
|
|
||||||
glyphset: TGlyphSet, xSrc: int32, ySrc: int32,
|
|
||||||
xDst: int32, yDst: int32, str: cstring,
|
|
||||||
nchar: int32){.libxrender.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,200 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
#const
|
|
||||||
# libX11* = "libX11.so"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from xresource.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# xresource.h
|
|
||||||
#
|
|
||||||
|
|
||||||
proc Xpermalloc*(para1: int32): cstring{.cdecl, dynlib: libX11, importc.}
|
|
||||||
type
|
|
||||||
PXrmQuark* = ptr TXrmQuark
|
|
||||||
TXrmQuark* = int32
|
|
||||||
TXrmQuarkList* = PXrmQuark
|
|
||||||
PXrmQuarkList* = ptr TXrmQuarkList
|
|
||||||
|
|
||||||
proc NULLQUARK*(): TXrmQuark
|
|
||||||
type
|
|
||||||
PXrmString* = ptr TXrmString
|
|
||||||
TXrmString* = ptr char
|
|
||||||
|
|
||||||
proc NULLSTRING*(): TXrmString
|
|
||||||
proc XrmStringToQuark*(para1: cstring): TXrmQuark{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmPermStringToQuark*(para1: cstring): TXrmQuark{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmQuarkToString*(para1: TXrmQuark): TXrmString{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmUniqueQuark*(): TXrmQuark{.cdecl, dynlib: libX11, importc.}
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XrmStringsEqual*(a1, a2: cstring): bool
|
|
||||||
type
|
|
||||||
PXrmBinding* = ptr TXrmBinding
|
|
||||||
TXrmBinding* = enum
|
|
||||||
XrmBindTightly, XrmBindLoosely
|
|
||||||
TXrmBindingList* = PXrmBinding
|
|
||||||
PXrmBindingList* = ptr TXrmBindingList
|
|
||||||
|
|
||||||
proc XrmStringToQuarkList*(para1: cstring, para2: TXrmQuarkList){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmStringToBindingQuarkList*(para1: cstring, para2: TXrmBindingList,
|
|
||||||
para3: TXrmQuarkList){.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
type
|
|
||||||
PXrmName* = ptr TXrmName
|
|
||||||
TXrmName* = TXrmQuark
|
|
||||||
PXrmNameList* = ptr TXrmNameList
|
|
||||||
TXrmNameList* = TXrmQuarkList
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XrmNameToString*(name: int32): TXrmString
|
|
||||||
proc XrmStringToName*(str: cstring): int32
|
|
||||||
proc XrmStringToNameList*(str: cstring, name: PXrmQuark)
|
|
||||||
type
|
|
||||||
PXrmClass* = ptr TXrmClass
|
|
||||||
TXrmClass* = TXrmQuark
|
|
||||||
PXrmClassList* = ptr TXrmClassList
|
|
||||||
TXrmClassList* = TXrmQuarkList
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XrmClassToString*(c_class: int32): TXrmString
|
|
||||||
proc XrmStringToClass*(c_class: cstring): int32
|
|
||||||
proc XrmStringToClassList*(str: cstring, c_class: PXrmQuark)
|
|
||||||
type
|
|
||||||
PXrmRepresentation* = ptr TXrmRepresentation
|
|
||||||
TXrmRepresentation* = TXrmQuark
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XrmStringToRepresentation*(str: cstring): int32
|
|
||||||
proc XrmRepresentationToString*(thetype: int32): TXrmString
|
|
||||||
type
|
|
||||||
PXrmValue* = ptr TXrmValue
|
|
||||||
TXrmValue*{.final.} = object
|
|
||||||
size*: int32
|
|
||||||
address*: TXPointer
|
|
||||||
|
|
||||||
TXrmValuePtr* = PXrmValue
|
|
||||||
PXrmValuePtr* = ptr TXrmValuePtr
|
|
||||||
PXrmHashBucketRec* = ptr TXrmHashBucketRec
|
|
||||||
TXrmHashBucketRec*{.final.} = object
|
|
||||||
TXrmHashBucket* = PXrmHashBucketRec
|
|
||||||
PXrmHashBucket* = ptr TXrmHashBucket
|
|
||||||
PXrmHashTable* = ptr TXrmHashTable
|
|
||||||
TXrmHashTable* = ptr TXrmHashBucket
|
|
||||||
TXrmDatabase* = PXrmHashBucketRec
|
|
||||||
PXrmDatabase* = ptr TXrmDatabase
|
|
||||||
|
|
||||||
proc XrmDestroyDatabase*(para1: TXrmDatabase){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmQPutResource*(para1: PXrmDatabase, para2: TXrmBindingList,
|
|
||||||
para3: TXrmQuarkList, para4: TXrmRepresentation,
|
|
||||||
para5: PXrmValue){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmPutResource*(para1: PXrmDatabase, para2: cstring, para3: cstring,
|
|
||||||
para4: PXrmValue){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmQPutStringResource*(para1: PXrmDatabase, para2: TXrmBindingList,
|
|
||||||
para3: TXrmQuarkList, para4: cstring){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmPutStringResource*(para1: PXrmDatabase, para2: cstring, para3: cstring){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmPutLineResource*(para1: PXrmDatabase, para2: cstring){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmQGetResource*(para1: TXrmDatabase, para2: TXrmNameList,
|
|
||||||
para3: TXrmClassList, para4: PXrmRepresentation,
|
|
||||||
para5: PXrmValue): TBool{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmGetResource*(para1: TXrmDatabase, para2: cstring, para3: cstring,
|
|
||||||
para4: PPchar, para5: PXrmValue): TBool{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
# There is no definition of TXrmSearchList
|
|
||||||
#function XrmQGetSearchList(para1:TXrmDatabase; para2:TXrmNameList; para3:TXrmClassList; para4:TXrmSearchList; para5:longint):TBool;cdecl;external libX11;
|
|
||||||
#function XrmQGetSearchResource(para1:TXrmSearchList; para2:TXrmName; para3:TXrmClass; para4:PXrmRepresentation; para5:PXrmValue):TBool;cdecl;external libX11;
|
|
||||||
proc XrmSetDatabase*(para1: PDisplay, para2: TXrmDatabase){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmGetDatabase*(para1: PDisplay): TXrmDatabase{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmGetFileDatabase*(para1: cstring): TXrmDatabase{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmCombineFileDatabase*(para1: cstring, para2: PXrmDatabase, para3: TBool): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XrmGetStringDatabase*(para1: cstring): TXrmDatabase{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmPutFileDatabase*(para1: TXrmDatabase, para2: cstring){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmMergeDatabases*(para1: TXrmDatabase, para2: PXrmDatabase){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XrmCombineDatabase*(para1: TXrmDatabase, para2: PXrmDatabase, para3: TBool){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
const
|
|
||||||
XrmEnumAllLevels* = 0
|
|
||||||
XrmEnumOneLevel* = 1
|
|
||||||
|
|
||||||
type
|
|
||||||
funcbool* = proc (): TBool {.cdecl.}
|
|
||||||
|
|
||||||
proc XrmEnumerateDatabase*(para1: TXrmDatabase, para2: TXrmNameList,
|
|
||||||
para3: TXrmClassList, para4: int32, para5: funcbool,
|
|
||||||
para6: TXPointer): TBool{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XrmLocaleOfDatabase*(para1: TXrmDatabase): cstring{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
type
|
|
||||||
PXrmOptionKind* = ptr TXrmOptionKind
|
|
||||||
TXrmOptionKind* = enum
|
|
||||||
XrmoptionNoArg, XrmoptionIsArg, XrmoptionStickyArg, XrmoptionSepArg,
|
|
||||||
XrmoptionResArg, XrmoptionSkipArg, XrmoptionSkipLine, XrmoptionSkipNArgs
|
|
||||||
PXrmOptionDescRec* = ptr TXrmOptionDescRec
|
|
||||||
TXrmOptionDescRec*{.final.} = object
|
|
||||||
option*: cstring
|
|
||||||
specifier*: cstring
|
|
||||||
argKind*: TXrmOptionKind
|
|
||||||
value*: TXPointer
|
|
||||||
|
|
||||||
TXrmOptionDescList* = PXrmOptionDescRec
|
|
||||||
PXrmOptionDescList* = ptr TXrmOptionDescList
|
|
||||||
|
|
||||||
proc XrmParseCommand*(para1: PXrmDatabase, para2: TXrmOptionDescList,
|
|
||||||
para3: int32, para4: cstring, para5: ptr int32,
|
|
||||||
para6: PPchar){.cdecl, dynlib: libX11, importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
proc NULLQUARK(): TXrmQuark =
|
|
||||||
result = TXrmQuark(0)
|
|
||||||
|
|
||||||
proc NULLSTRING(): TXrmString =
|
|
||||||
result = nil
|
|
||||||
|
|
||||||
when defined(MACROS):
|
|
||||||
proc XrmStringsEqual(a1, a2: cstring): bool =
|
|
||||||
result = (strcomp(a1, a2)) == 0
|
|
||||||
|
|
||||||
proc XrmNameToString(name: int32): TXrmString =
|
|
||||||
result = XrmQuarkToString(name)
|
|
||||||
|
|
||||||
proc XrmStringToName(str: cstring): int32 =
|
|
||||||
result = XrmStringToQuark(str)
|
|
||||||
|
|
||||||
proc XrmStringToNameList(str: cstring, name: PXrmQuark) =
|
|
||||||
XrmStringToQuarkList(str, name)
|
|
||||||
|
|
||||||
proc XrmClassToString(c_class: int32): TXrmString =
|
|
||||||
result = XrmQuarkToString(c_class)
|
|
||||||
|
|
||||||
proc XrmStringToClass(c_class: cstring): int32 =
|
|
||||||
result = XrmStringToQuark(c_class)
|
|
||||||
|
|
||||||
proc XrmStringToClassList(str: cstring, c_class: PXrmQuark) =
|
|
||||||
XrmStringToQuarkList(str, c_class)
|
|
||||||
|
|
||||||
proc XrmStringToRepresentation(str: cstring): int32 =
|
|
||||||
result = XrmStringToQuark(str)
|
|
||||||
|
|
||||||
proc XrmRepresentationToString(thetype: int32): TXrmString =
|
|
||||||
result = XrmQuarkToString(thetype)
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib
|
|
||||||
|
|
||||||
#const
|
|
||||||
# libX11* = "libX11.so"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from xshm.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# xshm.h
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
constX_ShmQueryVersion* = 0
|
|
||||||
constX_ShmAttach* = 1
|
|
||||||
constX_ShmDetach* = 2
|
|
||||||
constX_ShmPutImage* = 3
|
|
||||||
constX_ShmGetImage* = 4
|
|
||||||
constX_ShmCreatePixmap* = 5
|
|
||||||
ShmCompletion* = 0
|
|
||||||
ShmNumberEvents* = ShmCompletion + 1
|
|
||||||
BadShmSeg* = 0
|
|
||||||
ShmNumberErrors* = BadShmSeg + 1
|
|
||||||
|
|
||||||
type
|
|
||||||
PShmSeg* = ptr TShmSeg
|
|
||||||
TShmSeg* = culong
|
|
||||||
PXShmCompletionEvent* = ptr TXShmCompletionEvent
|
|
||||||
TXShmCompletionEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong
|
|
||||||
send_event*: TBool
|
|
||||||
display*: PDisplay
|
|
||||||
drawable*: TDrawable
|
|
||||||
major_code*: cint
|
|
||||||
minor_code*: cint
|
|
||||||
shmseg*: TShmSeg
|
|
||||||
offset*: culong
|
|
||||||
|
|
||||||
PXShmSegmentInfo* = ptr TXShmSegmentInfo
|
|
||||||
TXShmSegmentInfo*{.final.} = object
|
|
||||||
shmseg*: TShmSeg
|
|
||||||
shmid*: cint
|
|
||||||
shmaddr*: cstring
|
|
||||||
readOnly*: TBool
|
|
||||||
|
|
||||||
|
|
||||||
proc XShmQueryExtension*(para1: PDisplay): TBool{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShmGetEventBase*(para1: PDisplay): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShmQueryVersion*(para1: PDisplay, para2: Pcint, para3: Pcint, para4: PBool): TBool{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShmPixmapFormat*(para1: PDisplay): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShmAttach*(para1: PDisplay, para2: PXShmSegmentInfo): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XShmDetach*(para1: PDisplay, para2: PXShmSegmentInfo): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XShmPutImage*(para1: PDisplay, para2: TDrawable, para3: TGC,
|
|
||||||
para4: PXImage, para5: cint, para6: cint, para7: cint,
|
|
||||||
para8: cint, para9: cuint, para10: cuint, para11: TBool): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShmGetImage*(para1: PDisplay, para2: TDrawable, para3: PXImage,
|
|
||||||
para4: cint, para5: cint, para6: culong): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XShmCreateImage*(para1: PDisplay, para2: PVisual, para3: cuint,
|
|
||||||
para4: cint, para5: cstring, para6: PXShmSegmentInfo,
|
|
||||||
para7: cuint, para8: cuint): PXImage{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XShmCreatePixmap*(para1: PDisplay, para2: TDrawable, para3: cstring,
|
|
||||||
para4: PXShmSegmentInfo, para5: cuint, para6: cuint,
|
|
||||||
para7: cuint): TPixmap{.cdecl, dynlib: libX11, importc.}
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,412 +0,0 @@
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib, keysym, unsigned
|
|
||||||
|
|
||||||
#const
|
|
||||||
# libX11* = "libX11.so"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Automatically converted by H2Pas 0.99.15 from xutil.h
|
|
||||||
# The following command line parameters were used:
|
|
||||||
# -p
|
|
||||||
# -T
|
|
||||||
# -S
|
|
||||||
# -d
|
|
||||||
# -c
|
|
||||||
# xutil.h
|
|
||||||
#
|
|
||||||
|
|
||||||
const
|
|
||||||
NoValue* = 0x00000000
|
|
||||||
XValue* = 0x00000001
|
|
||||||
YValue* = 0x00000002
|
|
||||||
WidthValue* = 0x00000004
|
|
||||||
HeightValue* = 0x00000008
|
|
||||||
AllValues* = 0x0000000F
|
|
||||||
XNegative* = 0x00000010
|
|
||||||
YNegative* = 0x00000020
|
|
||||||
|
|
||||||
type
|
|
||||||
TCPoint*{.final.} = object
|
|
||||||
x*: cint
|
|
||||||
y*: cint
|
|
||||||
|
|
||||||
PXSizeHints* = ptr TXSizeHints
|
|
||||||
TXSizeHints*{.final.} = object
|
|
||||||
flags*: clong
|
|
||||||
x*, y*: cint
|
|
||||||
width*, height*: cint
|
|
||||||
min_width*, min_height*: cint
|
|
||||||
max_width*, max_height*: cint
|
|
||||||
width_inc*, height_inc*: cint
|
|
||||||
min_aspect*, max_aspect*: TCPoint
|
|
||||||
base_width*, base_height*: cint
|
|
||||||
win_gravity*: cint
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
USPosition* = 1 shl 0
|
|
||||||
USSize* = 1 shl 1
|
|
||||||
PPosition* = 1 shl 2
|
|
||||||
PSize* = 1 shl 3
|
|
||||||
PMinSize* = 1 shl 4
|
|
||||||
PMaxSize* = 1 shl 5
|
|
||||||
PResizeInc* = 1 shl 6
|
|
||||||
PAspect* = 1 shl 7
|
|
||||||
PBaseSize* = 1 shl 8
|
|
||||||
PWinGravity* = 1 shl 9
|
|
||||||
PAllHints* = PPosition or PSize or PMinSize or PMaxSize or PResizeInc or
|
|
||||||
PAspect
|
|
||||||
|
|
||||||
type
|
|
||||||
PXWMHints* = ptr TXWMHints
|
|
||||||
TXWMHints*{.final.} = object
|
|
||||||
flags*: clong
|
|
||||||
input*: TBool
|
|
||||||
initial_state*: cint
|
|
||||||
icon_pixmap*: TPixmap
|
|
||||||
icon_window*: TWindow
|
|
||||||
icon_x*, icon_y*: cint
|
|
||||||
icon_mask*: TPixmap
|
|
||||||
window_group*: TXID
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
InputHint* = 1 shl 0
|
|
||||||
StateHint* = 1 shl 1
|
|
||||||
IconPixmapHint* = 1 shl 2
|
|
||||||
IconWindowHint* = 1 shl 3
|
|
||||||
IconPositionHint* = 1 shl 4
|
|
||||||
IconMaskHint* = 1 shl 5
|
|
||||||
WindowGroupHint* = 1 shl 6
|
|
||||||
AllHints* = InputHint or StateHint or IconPixmapHint or IconWindowHint or
|
|
||||||
IconPositionHint or IconMaskHint or WindowGroupHint
|
|
||||||
XUrgencyHint* = 1 shl 8
|
|
||||||
WithdrawnState* = 0
|
|
||||||
NormalState* = 1
|
|
||||||
IconicState* = 3
|
|
||||||
DontCareState* = 0
|
|
||||||
ZoomState* = 2
|
|
||||||
InactiveState* = 4
|
|
||||||
|
|
||||||
type
|
|
||||||
PXTextProperty* = ptr TXTextProperty
|
|
||||||
TXTextProperty*{.final.} = object
|
|
||||||
value*: pcuchar
|
|
||||||
encoding*: TAtom
|
|
||||||
format*: cint
|
|
||||||
nitems*: culong
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
XNoMemory* = - 1
|
|
||||||
XLocaleNotSupported* = - 2
|
|
||||||
XConverterNotFound* = - 3
|
|
||||||
|
|
||||||
type
|
|
||||||
PXICCEncodingStyle* = ptr TXICCEncodingStyle
|
|
||||||
TXICCEncodingStyle* = enum
|
|
||||||
XStringStyle, XCompoundTextStyle, XTextStyle, XStdICCTextStyle,
|
|
||||||
XUTF8StringStyle
|
|
||||||
PPXIconSize* = ptr PXIconSize
|
|
||||||
PXIconSize* = ptr TXIconSize
|
|
||||||
TXIconSize*{.final.} = object
|
|
||||||
min_width*, min_height*: cint
|
|
||||||
max_width*, max_height*: cint
|
|
||||||
width_inc*, height_inc*: cint
|
|
||||||
|
|
||||||
PXClassHint* = ptr TXClassHint
|
|
||||||
TXClassHint*{.final.} = object
|
|
||||||
res_name*: cstring
|
|
||||||
res_class*: cstring
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXComposeStatus* = ptr TXComposeStatus
|
|
||||||
TXComposeStatus*{.final.} = object
|
|
||||||
compose_ptr*: TXPointer
|
|
||||||
chars_matched*: cint
|
|
||||||
|
|
||||||
|
|
||||||
type
|
|
||||||
PXRegion* = ptr TXRegion
|
|
||||||
TXRegion*{.final.} = object
|
|
||||||
TRegion* = PXRegion
|
|
||||||
PRegion* = ptr TRegion
|
|
||||||
|
|
||||||
const
|
|
||||||
RectangleOut* = 0
|
|
||||||
RectangleIn* = 1
|
|
||||||
RectanglePart* = 2
|
|
||||||
|
|
||||||
type
|
|
||||||
PXVisualInfo* = ptr TXVisualInfo
|
|
||||||
TXVisualInfo*{.final.} = object
|
|
||||||
visual*: PVisual
|
|
||||||
visualid*: TVisualID
|
|
||||||
screen*: cint
|
|
||||||
depth*: cint
|
|
||||||
class*: cint
|
|
||||||
red_mask*: culong
|
|
||||||
green_mask*: culong
|
|
||||||
blue_mask*: culong
|
|
||||||
colormap_size*: cint
|
|
||||||
bits_per_rgb*: cint
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
VisualNoMask* = 0x00000000
|
|
||||||
VisualIDMask* = 0x00000001
|
|
||||||
VisualScreenMask* = 0x00000002
|
|
||||||
VisualDepthMask* = 0x00000004
|
|
||||||
VisualClassMask* = 0x00000008
|
|
||||||
VisualRedMaskMask* = 0x00000010
|
|
||||||
VisualGreenMaskMask* = 0x00000020
|
|
||||||
VisualBlueMaskMask* = 0x00000040
|
|
||||||
VisualColormapSizeMask* = 0x00000080
|
|
||||||
VisualBitsPerRGBMask* = 0x00000100
|
|
||||||
VisualAllMask* = 0x000001FF
|
|
||||||
|
|
||||||
type
|
|
||||||
PPXStandardColormap* = ptr PXStandardColormap
|
|
||||||
PXStandardColormap* = ptr TXStandardColormap
|
|
||||||
TXStandardColormap*{.final.} = object
|
|
||||||
colormap*: TColormap
|
|
||||||
red_max*: culong
|
|
||||||
red_mult*: culong
|
|
||||||
green_max*: culong
|
|
||||||
green_mult*: culong
|
|
||||||
blue_max*: culong
|
|
||||||
blue_mult*: culong
|
|
||||||
base_pixel*: culong
|
|
||||||
visualid*: TVisualID
|
|
||||||
killid*: TXID
|
|
||||||
|
|
||||||
|
|
||||||
const
|
|
||||||
BitmapSuccess* = 0
|
|
||||||
BitmapOpenFailed* = 1
|
|
||||||
BitmapFileInvalid* = 2
|
|
||||||
BitmapNoMemory* = 3
|
|
||||||
XCSUCCESS* = 0
|
|
||||||
XCNOMEM* = 1
|
|
||||||
XCNOENT* = 2
|
|
||||||
ReleaseByFreeingColormap*: TXID = TXID(1)
|
|
||||||
|
|
||||||
type
|
|
||||||
PXContext* = ptr TXContext
|
|
||||||
TXContext* = cint
|
|
||||||
|
|
||||||
proc XAllocClassHint*(): PXClassHint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XAllocIconSize*(): PXIconSize{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XAllocSizeHints*(): PXSizeHints{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XAllocStandardColormap*(): PXStandardColormap{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XAllocWMHints*(): PXWMHints{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XClipBox*(para1: TRegion, para2: PXRectangle): cint{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XCreateRegion*(): TRegion{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XDefaultString*(): cstring{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XDeleteContext*(para1: PDisplay, para2: TXID, para3: TXContext): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XDestroyRegion*(para1: TRegion): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XEmptyRegion*(para1: TRegion): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XEqualRegion*(para1: TRegion, para2: TRegion): cint{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XFindContext*(para1: PDisplay, para2: TXID, para3: TXContext,
|
|
||||||
para4: PXPointer): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetClassHint*(para1: PDisplay, para2: TWindow, para3: PXClassHint): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetIconSizes*(para1: PDisplay, para2: TWindow, para3: PPXIconSize,
|
|
||||||
para4: Pcint): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetRGBColormaps*(para1: PDisplay, para2: TWindow,
|
|
||||||
para3: PPXStandardColormap, para4: Pcint, para5: TAtom): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints,
|
|
||||||
para4: TAtom): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetStandardColormap*(para1: PDisplay, para2: TWindow,
|
|
||||||
para3: PXStandardColormap, para4: TAtom): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetTextProperty*(para1: PDisplay, para2: TWindow, para3: PXTextProperty,
|
|
||||||
para4: TAtom): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetVisualInfo*(para1: PDisplay, para2: clong, para3: PXVisualInfo,
|
|
||||||
para4: Pcint): PXVisualInfo{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetWMClientMachine*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetWMHints*(para1: PDisplay, para2: TWindow): PXWMHints{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XGetWMIconName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetWMName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetWMNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints,
|
|
||||||
para4: ptr int): TStatus{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XGetWMSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints,
|
|
||||||
para4: ptr int, para5: TAtom): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XGetZoomHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): TStatus{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XIntersectRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XConvertCase*(para1: TKeySym, para2: PKeySym, para3: PKeySym){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XLookupString*(para1: PXKeyEvent, para2: cstring, para3: cint,
|
|
||||||
para4: PKeySym, para5: PXComposeStatus): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XMatchVisualInfo*(para1: PDisplay, para2: cint, para3: cint, para4: cint,
|
|
||||||
para5: PXVisualInfo): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XOffsetRegion*(para1: TRegion, para2: cint, para3: cint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XPointInRegion*(para1: TRegion, para2: cint, para3: cint): TBool{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XPolygonRegion*(para1: PXPoint, para2: cint, para3: cint): TRegion{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XRectInRegion*(para1: TRegion, para2: cint, para3: cint, para4: cuint,
|
|
||||||
para5: cuint): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSaveContext*(para1: PDisplay, para2: TXID, para3: TXContext,
|
|
||||||
para4: cstring): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetClassHint*(para1: PDisplay, para2: TWindow, para3: PXClassHint): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetIconSizes*(para1: PDisplay, para2: TWindow, para3: PXIconSize,
|
|
||||||
para4: cint): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetRGBColormaps*(para1: PDisplay, para2: TWindow,
|
|
||||||
para3: PXStandardColormap, para4: cint, para5: TAtom){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints,
|
|
||||||
para4: TAtom): cint{.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetStandardProperties*(para1: PDisplay, para2: TWindow, para3: cstring,
|
|
||||||
para4: cstring, para5: TPixmap, para6: PPchar,
|
|
||||||
para7: cint, para8: PXSizeHints): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XSetTextProperty*(para1: PDisplay, para2: TWindow, para3: PXTextProperty,
|
|
||||||
para4: TAtom){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMClientMachine*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMHints*(para1: PDisplay, para2: TWindow, para3: PXWMHints): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMIconName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMName*(para1: PDisplay, para2: TWindow, para3: PXTextProperty){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XSetWMNormalHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMProperties*(para1: PDisplay, para2: TWindow, para3: PXTextProperty,
|
|
||||||
para4: PXTextProperty, para5: PPchar, para6: cint,
|
|
||||||
para7: PXSizeHints, para8: PXWMHints, para9: PXClassHint){.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XmbSetWMProperties*(para1: PDisplay, para2: TWindow, para3: cstring,
|
|
||||||
para4: cstring, para5: PPchar, para6: cint,
|
|
||||||
para7: PXSizeHints, para8: PXWMHints,
|
|
||||||
para9: PXClassHint){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc Xutf8SetWMProperties*(para1: PDisplay, para2: TWindow, para3: cstring,
|
|
||||||
para4: cstring, para5: PPchar, para6: cint,
|
|
||||||
para7: PXSizeHints, para8: PXWMHints,
|
|
||||||
para9: PXClassHint){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetWMSizeHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints,
|
|
||||||
para4: TAtom){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XSetRegion*(para1: PDisplay, para2: TGC, para3: TRegion): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XSetStandardColormap*(para1: PDisplay, para2: TWindow,
|
|
||||||
para3: PXStandardColormap, para4: TAtom){.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XSetZoomHints*(para1: PDisplay, para2: TWindow, para3: PXSizeHints): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XShrinkRegion*(para1: TRegion, para2: cint, para3: cint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XStringListToTextProperty*(para1: PPchar, para2: cint,
|
|
||||||
para3: PXTextProperty): TStatus{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XSubtractRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XmbTextListToTextProperty*(para1: PDisplay, para2: PPchar, para3: cint,
|
|
||||||
para4: TXICCEncodingStyle, para5: PXTextProperty): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XwcTextListToTextProperty*(para1: PDisplay, para2: ptr ptr int16, para3: cint,
|
|
||||||
para4: TXICCEncodingStyle, para5: PXTextProperty): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc Xutf8TextListToTextProperty*(para1: PDisplay, para2: PPchar, para3: cint,
|
|
||||||
para4: TXICCEncodingStyle,
|
|
||||||
para5: PXTextProperty): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XwcFreeStringList*(para1: ptr ptr int16){.cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XTextPropertyToStringList*(para1: PXTextProperty, para2: PPPchar,
|
|
||||||
para3: Pcint): TStatus{.cdecl, dynlib: libX11,
|
|
||||||
importc.}
|
|
||||||
proc XmbTextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty,
|
|
||||||
para3: PPPchar, para4: Pcint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XwcTextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty,
|
|
||||||
para3: ptr ptr ptr int16, para4: Pcint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc Xutf8TextPropertyToTextList*(para1: PDisplay, para2: PXTextProperty,
|
|
||||||
para3: PPPchar, para4: Pcint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XUnionRectWithRegion*(para1: PXRectangle, para2: TRegion, para3: TRegion): cint{.
|
|
||||||
cdecl, dynlib: libX11, importc.}
|
|
||||||
proc XUnionRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XWMGeometry*(para1: PDisplay, para2: cint, para3: cstring, para4: cstring,
|
|
||||||
para5: cuint, para6: PXSizeHints, para7: Pcint, para8: Pcint,
|
|
||||||
para9: Pcint, para10: Pcint, para11: Pcint): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
proc XXorRegion*(para1: TRegion, para2: TRegion, para3: TRegion): cint{.cdecl,
|
|
||||||
dynlib: libX11, importc.}
|
|
||||||
#when defined(MACROS):
|
|
||||||
proc XDestroyImage*(ximage: PXImage): cint
|
|
||||||
proc XGetPixel*(ximage: PXImage, x, y: cint): culong
|
|
||||||
proc XPutPixel*(ximage: PXImage, x, y: cint, pixel: culong): cint
|
|
||||||
proc XSubImage*(ximage: PXImage, x, y: cint, width, height: cuint): PXImage
|
|
||||||
proc XAddPixel*(ximage: PXImage, value: clong): cint
|
|
||||||
proc IsKeypadKey*(keysym: TKeySym): bool
|
|
||||||
proc IsPrivateKeypadKey*(keysym: TKeySym): bool
|
|
||||||
proc IsCursorKey*(keysym: TKeySym): bool
|
|
||||||
proc IsPFKey*(keysym: TKeySym): bool
|
|
||||||
proc IsFunctionKey*(keysym: TKeySym): bool
|
|
||||||
proc IsMiscFunctionKey*(keysym: TKeySym): bool
|
|
||||||
proc IsModifierKey*(keysym: TKeySym): bool
|
|
||||||
#function XUniqueContext : TXContext;
|
|
||||||
#function XStringToContext(_string : Pchar) : TXContext;
|
|
||||||
# implementation
|
|
||||||
|
|
||||||
#when defined(MACROS):
|
|
||||||
proc XDestroyImage(ximage: PXImage): cint =
|
|
||||||
ximage.f.destroy_image(ximage)
|
|
||||||
|
|
||||||
proc XGetPixel(ximage: PXImage, x, y: cint): culong =
|
|
||||||
ximage.f.get_pixel(ximage, x, y)
|
|
||||||
|
|
||||||
proc XPutPixel(ximage: PXImage, x, y: cint, pixel: culong): cint =
|
|
||||||
ximage.f.put_pixel(ximage, x, y, pixel)
|
|
||||||
|
|
||||||
proc XSubImage(ximage: PXImage, x, y: cint, width, height: cuint): PXImage =
|
|
||||||
ximage.f.sub_image(ximage, x, y, width, height)
|
|
||||||
|
|
||||||
proc XAddPixel(ximage: PXImage, value: clong): cint =
|
|
||||||
ximage.f.add_pixel(ximage, value)
|
|
||||||
|
|
||||||
proc IsKeypadKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= XK_KP_Space) and (keysym <= XK_KP_Equal)
|
|
||||||
|
|
||||||
proc IsPrivateKeypadKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= 0x11000000.TKeySym) and (keysym <= 0x1100FFFF.TKeySym)
|
|
||||||
|
|
||||||
proc IsCursorKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= XK_Home) and (keysym < XK_Select)
|
|
||||||
|
|
||||||
proc IsPFKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= XK_KP_F1) and (keysym <= XK_KP_F4)
|
|
||||||
|
|
||||||
proc IsFunctionKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= XK_F1) and (keysym <= XK_F35)
|
|
||||||
|
|
||||||
proc IsMiscFunctionKey(keysym: TKeySym): bool =
|
|
||||||
(keysym >= XK_Select) and (keysym <= XK_Break)
|
|
||||||
|
|
||||||
proc IsModifierKey(keysym: TKeySym): bool =
|
|
||||||
((keysym >= XK_Shift_L) And (keysym <= XK_Hyper_R)) Or
|
|
||||||
(keysym == XK_Mode_switch) Or (keysym == XK_Num_Lock)
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
#***********************************************************
|
|
||||||
#Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
|
|
||||||
#and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
|
||||||
#
|
|
||||||
# All Rights Reserved
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, and distribute this software and its
|
|
||||||
#documentation for any purpose and without fee is hereby granted,
|
|
||||||
#provided that the above copyright notice appear in all copies and that
|
|
||||||
#both that copyright notice and this permission notice appear in
|
|
||||||
#supporting documentation, and that the names of Digital or MIT not be
|
|
||||||
#used in advertising or publicity pertaining to distribution of the
|
|
||||||
#software without specific, written prior permission.
|
|
||||||
#
|
|
||||||
#DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
||||||
#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
||||||
#DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
||||||
#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
||||||
#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
||||||
#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
#SOFTWARE.
|
|
||||||
#
|
|
||||||
#******************************************************************
|
|
||||||
# $XFree86: xc/include/extensions/Xv.h,v 1.3 1999/05/23 06:33:22 dawes Exp $
|
|
||||||
|
|
||||||
import
|
|
||||||
x
|
|
||||||
|
|
||||||
const
|
|
||||||
XvName* = "libXVideo.so"
|
|
||||||
XvVersion* = 2
|
|
||||||
XvRevision* = 2 # Symbols
|
|
||||||
|
|
||||||
type
|
|
||||||
TXvPortID* = TXID
|
|
||||||
TXvEncodingID* = TXID
|
|
||||||
|
|
||||||
const
|
|
||||||
XvNone* = 0
|
|
||||||
XvInput* = 0
|
|
||||||
XvOutput* = 1
|
|
||||||
XvInputMask* = 1 shl XvInput
|
|
||||||
XvOutputMask* = 1 shl XvOutput
|
|
||||||
XvVideoMask* = 0x00000004
|
|
||||||
XvStillMask* = 0x00000008
|
|
||||||
XvImageMask* = 0x00000010 # These two are not client viewable
|
|
||||||
XvPixmapMask* = 0x00010000
|
|
||||||
XvWindowMask* = 0x00020000
|
|
||||||
XvGettable* = 0x00000001
|
|
||||||
XvSettable* = 0x00000002
|
|
||||||
XvRGB* = 0
|
|
||||||
XvYUV* = 1
|
|
||||||
XvPacked* = 0
|
|
||||||
XvPlanar* = 1
|
|
||||||
XvTopToBottom* = 0
|
|
||||||
XvBottomToTop* = 1 # Events
|
|
||||||
XvVideoNotify* = 0
|
|
||||||
XvPortNotify* = 1
|
|
||||||
XvNumEvents* = 2 # Video Notify Reasons
|
|
||||||
XvStarted* = 0
|
|
||||||
XvStopped* = 1
|
|
||||||
XvBusy* = 2
|
|
||||||
XvPreempted* = 3
|
|
||||||
XvHardError* = 4
|
|
||||||
XvLastReason* = 4
|
|
||||||
XvNumReasons* = XvLastReason + 1
|
|
||||||
XvStartedMask* = 1 shl XvStarted
|
|
||||||
XvStoppedMask* = 1 shl XvStopped
|
|
||||||
XvBusyMask* = 1 shl XvBusy
|
|
||||||
XvPreemptedMask* = 1 shl XvPreempted
|
|
||||||
XvHardErrorMask* = 1 shl XvHardError
|
|
||||||
XvAnyReasonMask* = (1 shl XvNumReasons) - 1
|
|
||||||
XvNoReasonMask* = 0 # Errors
|
|
||||||
XvBadPort* = 0
|
|
||||||
XvBadEncoding* = 1
|
|
||||||
XvBadControl* = 2
|
|
||||||
XvNumErrors* = 3 # Status
|
|
||||||
XvBadExtension* = 1
|
|
||||||
XvAlreadyGrabbed* = 2
|
|
||||||
XvInvalidTime* = 3
|
|
||||||
XvBadReply* = 4
|
|
||||||
XvBadAlloc* = 5
|
|
||||||
|
|
||||||
# implementation
|
|
||||||
|
|
@ -1,234 +0,0 @@
|
||||||
#***********************************************************
|
|
||||||
#Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
|
|
||||||
#and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
|
||||||
#
|
|
||||||
# All Rights Reserved
|
|
||||||
#
|
|
||||||
#Permission to use, copy, modify, and distribute this software and its
|
|
||||||
#documentation for any purpose and without fee is hereby granted,
|
|
||||||
#provided that the above copyright notice appear in all copies and that
|
|
||||||
#both that copyright notice and this permission notice appear in
|
|
||||||
#supporting documentation, and that the names of Digital or MIT not be
|
|
||||||
#used in advertising or publicity pertaining to distribution of the
|
|
||||||
#software without specific, written prior permission.
|
|
||||||
#
|
|
||||||
#DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
||||||
#ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
||||||
#DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
||||||
#ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
||||||
#WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
||||||
#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
#SOFTWARE.
|
|
||||||
#
|
|
||||||
#******************************************************************
|
|
||||||
# $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $
|
|
||||||
#*
|
|
||||||
#** File:
|
|
||||||
#**
|
|
||||||
#** Xvlib.h --- Xv library public header file
|
|
||||||
#**
|
|
||||||
#** Author:
|
|
||||||
#**
|
|
||||||
#** David Carver (Digital Workstation Engineering/Project Athena)
|
|
||||||
#**
|
|
||||||
#** Revisions:
|
|
||||||
#**
|
|
||||||
#** 26.06.91 Carver
|
|
||||||
#** - changed XvFreeAdaptors to XvFreeAdaptorInfo
|
|
||||||
#** - changed XvFreeEncodings to XvFreeEncodingInfo
|
|
||||||
#**
|
|
||||||
#** 11.06.91 Carver
|
|
||||||
#** - changed SetPortControl to SetPortAttribute
|
|
||||||
#** - changed GetPortControl to GetPortAttribute
|
|
||||||
#** - changed QueryBestSize
|
|
||||||
#**
|
|
||||||
#** 05.15.91 Carver
|
|
||||||
#** - version 2.0 upgrade
|
|
||||||
#**
|
|
||||||
#** 01.24.91 Carver
|
|
||||||
#** - version 1.4 upgrade
|
|
||||||
#**
|
|
||||||
#*
|
|
||||||
|
|
||||||
import
|
|
||||||
x, xlib, xshm, xv
|
|
||||||
|
|
||||||
const
|
|
||||||
libXv* = "libXv.so"
|
|
||||||
|
|
||||||
type
|
|
||||||
PXvRational* = ptr TXvRational
|
|
||||||
TXvRational*{.final.} = object
|
|
||||||
numerator*: cint
|
|
||||||
denominator*: cint
|
|
||||||
|
|
||||||
PXvAttribute* = ptr TXvAttribute
|
|
||||||
TXvAttribute*{.final.} = object
|
|
||||||
flags*: cint # XvGettable, XvSettable
|
|
||||||
min_value*: cint
|
|
||||||
max_value*: cint
|
|
||||||
name*: cstring
|
|
||||||
|
|
||||||
PPXvEncodingInfo* = ptr PXvEncodingInfo
|
|
||||||
PXvEncodingInfo* = ptr TXvEncodingInfo
|
|
||||||
TXvEncodingInfo*{.final.} = object
|
|
||||||
encoding_id*: TXvEncodingID
|
|
||||||
name*: cstring
|
|
||||||
width*: culong
|
|
||||||
height*: culong
|
|
||||||
rate*: TXvRational
|
|
||||||
num_encodings*: culong
|
|
||||||
|
|
||||||
PXvFormat* = ptr TXvFormat
|
|
||||||
TXvFormat*{.final.} = object
|
|
||||||
depth*: cchar
|
|
||||||
visual_id*: culong
|
|
||||||
|
|
||||||
PPXvAdaptorInfo* = ptr PXvAdaptorInfo
|
|
||||||
PXvAdaptorInfo* = ptr TXvAdaptorInfo
|
|
||||||
TXvAdaptorInfo*{.final.} = object
|
|
||||||
base_id*: TXvPortID
|
|
||||||
num_ports*: culong
|
|
||||||
thetype*: cchar
|
|
||||||
name*: cstring
|
|
||||||
num_formats*: culong
|
|
||||||
formats*: PXvFormat
|
|
||||||
num_adaptors*: culong
|
|
||||||
|
|
||||||
PXvVideoNotifyEvent* = ptr TXvVideoNotifyEvent
|
|
||||||
TXvVideoNotifyEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong # # of last request processed by server
|
|
||||||
send_event*: TBool # true if this came from a SendEvent request
|
|
||||||
display*: PDisplay # Display the event was read from
|
|
||||||
drawable*: TDrawable # drawable
|
|
||||||
reason*: culong # what generated this event
|
|
||||||
port_id*: TXvPortID # what port
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
|
|
||||||
PXvPortNotifyEvent* = ptr TXvPortNotifyEvent
|
|
||||||
TXvPortNotifyEvent*{.final.} = object
|
|
||||||
theType*: cint
|
|
||||||
serial*: culong # # of last request processed by server
|
|
||||||
send_event*: TBool # true if this came from a SendEvent request
|
|
||||||
display*: PDisplay # Display the event was read from
|
|
||||||
port_id*: TXvPortID # what port
|
|
||||||
time*: TTime # milliseconds
|
|
||||||
attribute*: TAtom # atom that identifies attribute
|
|
||||||
value*: clong # value of attribute
|
|
||||||
|
|
||||||
PXvEvent* = ptr TXvEvent
|
|
||||||
TXvEvent*{.final.} = object
|
|
||||||
pad*: array[0..23, clong] #case longint of
|
|
||||||
# 0 : (
|
|
||||||
# theType : cint;
|
|
||||||
# );
|
|
||||||
# 1 : (
|
|
||||||
# xvvideo : TXvVideoNotifyEvent;
|
|
||||||
# );
|
|
||||||
# 2 : (
|
|
||||||
# xvport : TXvPortNotifyEvent;
|
|
||||||
# );
|
|
||||||
# 3 : (
|
|
||||||
#
|
|
||||||
# );
|
|
||||||
|
|
||||||
PXvImageFormatValues* = ptr TXvImageFormatValues
|
|
||||||
TXvImageFormatValues*{.final.} = object
|
|
||||||
id*: cint # Unique descriptor for the format
|
|
||||||
theType*: cint # XvRGB, XvYUV
|
|
||||||
byte_order*: cint # LSBFirst, MSBFirst
|
|
||||||
guid*: array[0..15, cchar] # Globally Unique IDentifier
|
|
||||||
bits_per_pixel*: cint
|
|
||||||
format*: cint # XvPacked, XvPlanar
|
|
||||||
num_planes*: cint # for RGB formats only
|
|
||||||
depth*: cint
|
|
||||||
red_mask*: cuint
|
|
||||||
green_mask*: cuint
|
|
||||||
blue_mask*: cuint # for YUV formats only
|
|
||||||
y_sample_bits*: cuint
|
|
||||||
u_sample_bits*: cuint
|
|
||||||
v_sample_bits*: cuint
|
|
||||||
horz_y_period*: cuint
|
|
||||||
horz_u_period*: cuint
|
|
||||||
horz_v_period*: cuint
|
|
||||||
vert_y_period*: cuint
|
|
||||||
vert_u_period*: cuint
|
|
||||||
vert_v_period*: cuint
|
|
||||||
component_order*: array[0..31, char] # eg. UYVY
|
|
||||||
scanline_order*: cint # XvTopToBottom, XvBottomToTop
|
|
||||||
|
|
||||||
PXvImage* = ptr TXvImage
|
|
||||||
TXvImage*{.final.} = object
|
|
||||||
id*: cint
|
|
||||||
width*, height*: cint
|
|
||||||
data_size*: cint # bytes
|
|
||||||
num_planes*: cint
|
|
||||||
pitches*: pcint # bytes
|
|
||||||
offsets*: pcint # bytes
|
|
||||||
data*: pointer
|
|
||||||
obdata*: TXPointer
|
|
||||||
|
|
||||||
|
|
||||||
proc XvQueryExtension*(display: PDisplay, p_version, p_revision, p_requestBase,
|
|
||||||
p_eventBase, p_errorBase: pcuint): cint{.cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvQueryAdaptors*(display: PDisplay, window: TWindow, p_nAdaptors: pcuint,
|
|
||||||
p_pAdaptors: PPXvAdaptorInfo): cint{.cdecl, dynlib: libXv,
|
|
||||||
importc.}
|
|
||||||
proc XvQueryEncodings*(display: PDisplay, port: TXvPortID, p_nEncoding: pcuint,
|
|
||||||
p_pEncoding: PPXvEncodingInfo): cint{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
proc XvPutVideo*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvPutStill*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvGetVideo*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvGetStill*(display: PDisplay, port: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvStopVideo*(display: PDisplay, port: TXvPortID, drawable: TDrawable): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvGrabPort*(display: PDisplay, port: TXvPortID, time: TTime): cint{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
proc XvUngrabPort*(display: PDisplay, port: TXvPortID, time: TTime): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvSelectVideoNotify*(display: PDisplay, drawable: TDrawable, onoff: TBool): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvSelectPortNotify*(display: PDisplay, port: TXvPortID, onoff: TBool): cint{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvSetPortAttribute*(display: PDisplay, port: TXvPortID, attribute: TAtom,
|
|
||||||
value: cint): cint{.cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvGetPortAttribute*(display: PDisplay, port: TXvPortID, attribute: TAtom,
|
|
||||||
p_value: pcint): cint{.cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvQueryBestSize*(display: PDisplay, port: TXvPortID, motion: TBool,
|
|
||||||
vid_w, vid_h, drw_w, drw_h: cuint,
|
|
||||||
p_actual_width, p_actual_height: pcuint): cint{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
proc XvQueryPortAttributes*(display: PDisplay, port: TXvPortID, number: pcint): PXvAttribute{.
|
|
||||||
cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvFreeAdaptorInfo*(adaptors: PXvAdaptorInfo){.cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvFreeEncodingInfo*(encodings: PXvEncodingInfo){.cdecl, dynlib: libXv,
|
|
||||||
importc.}
|
|
||||||
proc XvListImageFormats*(display: PDisplay, port_id: TXvPortID,
|
|
||||||
count_return: pcint): PXvImageFormatValues{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
proc XvCreateImage*(display: PDisplay, port: TXvPortID, id: cint, data: pointer,
|
|
||||||
width, height: cint): PXvImage{.cdecl, dynlib: libXv,
|
|
||||||
importc.}
|
|
||||||
proc XvPutImage*(display: PDisplay, id: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint,
|
|
||||||
dest_x, dest_y: cint, dest_w, dest_h: cuint): cint{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
proc XvShmPutImage*(display: PDisplay, id: TXvPortID, d: TDrawable, gc: TGC,
|
|
||||||
image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint,
|
|
||||||
dest_x, dest_y: cint, dest_w, dest_h: cuint,
|
|
||||||
send_event: TBool): cint{.cdecl, dynlib: libXv, importc.}
|
|
||||||
proc XvShmCreateImage*(display: PDisplay, port: TXvPortID, id: cint,
|
|
||||||
data: pointer, width, height: cint,
|
|
||||||
shminfo: PXShmSegmentInfo): PXvImage{.cdecl,
|
|
||||||
dynlib: libXv, importc.}
|
|
||||||
# implementation
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue