diff options
author | rumpf_a@web.de <> | 2010-01-03 12:31:21 +0100 |
---|---|---|
committer | rumpf_a@web.de <> | 2010-01-03 12:31:21 +0100 |
commit | a58a2f3823c33104992dc0e4129fa53e66a18f44 (patch) | |
tree | af97f1c6634d7ef2d4468c70607c20731e6c1512 | |
parent | 2169fd63bdf9caf539ca7ca5b661ee703206500c (diff) | |
download | Nim-a58a2f3823c33104992dc0e4129fa53e66a18f44.tar.gz |
better subscript overloading
85 files changed, 55931 insertions, 2314 deletions
diff --git a/copying.txt b/copying.txt index dc61ba805..992a5f9b9 100755 --- a/copying.txt +++ b/copying.txt @@ -1,6 +1,6 @@ ======================================================= The Nimrod Compiler - Copyright (C) 2004-2009 Andreas Rumpf + Copyright (C) 2004-2010 Andreas Rumpf ======================================================= This program is free software; you can redistribute it and/or diff --git a/doc/apis.txt b/doc/apis.txt index b926e4988..93484b8b7 100755 --- a/doc/apis.txt +++ b/doc/apis.txt @@ -32,6 +32,7 @@ get get, ``[]`` consider overloading ``[]`` for get; prefix: ``len`` instead of ``getLen`` length len also used for *number of elements* size size, len size should refer to a byte size +memory mem implies a low-level operation items items default iterator over a collection pairs pairs iterator over (key, value) pairs delete delete, del del is supposed to be faster than diff --git a/doc/grammar.txt b/doc/grammar.txt index 3ce919b44..a648913a0 100755 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -24,7 +24,8 @@ indexExpr ::= '..' [expr] | expr ['=' expr | '..' expr] castExpr ::= 'cast' '[' optInd typeDesc optPar ']' '(' optInd expr optPar ')' addrExpr ::= 'addr' '(' optInd expr optPar ')' symbol ::= '`' (KEYWORD | IDENT | operator | '(' ')' - | '[' ']' | '=' | literal)+ '`' + | '[' (',' | ['$'] '..' ['$'])* ']' + | '=' | literal)+ '`' | IDENT primaryPrefix ::= (prefixOperator | 'bind') optInd diff --git a/doc/manual.txt b/doc/manual.txt index 0db2ae22a..8a1d9110c 100755 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -693,15 +693,16 @@ Example: var x: TIntArray y: TIntSeq - x = [1, 2, 3, 4, 5, 6] # [] this is the array constructor + x = [1, 2, 3, 4, 5, 6] # [] is the array constructor y = @[1, 2, 3, 4, 5, 6] # the @ turns the array into a sequence The lower bound of an array or sequence may be received by the built-in proc ``low()``, the higher bound by ``high()``. The length may be received by ``len()``. ``low()`` for a sequence or an open array always returns 0, as this is the first valid index. -One can append elements to a sequence with the ``add()`` proc or the ``&`` operator, -and remove (and get) the last element of a sequence with the ``pop()`` proc. +One can append elements to a sequence with the ``add()`` proc or the ``&`` +operator, and remove (and get) the last element of a sequence with the +``pop()`` proc. The notation ``x[i]`` can be used to access the i-th element of ``x``. @@ -935,8 +936,8 @@ Example: forEach(printItem) # this will NOT work because calling conventions differ A subtle issue with procedural types is that the calling convention of the -procedure influences the type compatibility: procedural types are only compatible -if they have the same calling convention. +procedure influences the type compatibility: procedural types are only +compatible if they have the same calling convention. Nimrod supports these `calling conventions`:idx:, which are all incompatible to each other: @@ -1304,7 +1305,7 @@ variables of the same type: a: int = 0 x, y, z: int -If an initializer is given the type can be omitted: the variable is of the +If an initializer is given the type can be omitted: the variable is then of the same type as the initializing expression. Variables are always initialized with a default value if there is no initializing expression. The default value depends on the type and is always a zero in binary. @@ -1776,8 +1777,8 @@ Calling a procedure can be done in many different ways: callme 0, 1, "abc", '\t' -A procedure cannot modify its parameters (unless the parameters have the -type `var`). +A procedure cannot modify its parameters (unless the parameters have the type +`var`). `Operators`:idx: are procedures with a special operator symbol as identifier: @@ -1809,7 +1810,8 @@ Var parameters The type of a parameter may be prefixed with the ``var`` keyword: .. code-block:: nimrod - proc divmod(a, b: int, res, remainder: var int) = + proc divmod(a, b: int, + res, remainder: var int) = res = a div b remainder = a mod b @@ -1827,7 +1829,8 @@ an l-value. Var parameters are implemented as hidden pointers. The above example is equivalent to: .. code-block:: nimrod - proc divmod(a, b: int, res, remainder: ptr int) = + proc divmod(a, b: int, + res, remainder: ptr int) = res^ = a div b remainder^ = a mod b @@ -1856,6 +1859,15 @@ One can use `tuple unpacking`:idx: to access the tuple's fields: assert y == 3 +Overloading of the subscript operator +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``[]`` subscript operator for arrays/openarrays/sequences can be overloaded. +Overloading support is only possible if the first parameter has no type that +already supports the built-in ``[]`` notation. Currently the compiler currently +does not check this. XXX Multiple indexes + + Multi-methods ~~~~~~~~~~~~~ @@ -2313,11 +2325,12 @@ regular expressions: Modules ------- Nimrod supports splitting a program into pieces by a `module`:idx: concept. -Each module needs to be in its own file. Modules enable -`information hiding`:idx: and `separate compilation`:idx:. A module may gain -access to symbols of another module by the `import`:idx: statement. -`Recursive module dependencies`:idx: are allowed, but slightly subtle. Only -top-level symbols that are marked with an asterisk (``*``) are exported. +Each module needs to be in its own file and has its own `namespace`:idx:. +Modules enable `information hiding`:idx: and `separate compilation`:idx:. +A module may gain access to symbols of another module by the `import`:idx: +statement. `Recursive module dependencies`:idx: are allowed, but slightly +subtle. Only top-level symbols that are marked with an asterisk (``*``) are +exported. The algorithm for compiling modules is: @@ -2413,6 +2426,7 @@ The Nimrod compiler emits different kinds of messages: `hint`:idx:, `warning`:idx:, and `error`:idx: messages. An *error* message is emitted if the compiler encounters any static error. + Pragmas ======= @@ -2426,7 +2440,9 @@ Syntax:: Pragmas are Nimrod's method to give the compiler additional information/ commands without introducing a massive number of new keywords. Pragmas are processed on the fly during semantic checking. Pragmas are enclosed in the -special ``{.`` and ``.}`` curly brackets. +special ``{.`` and ``.}`` curly brackets. Pragmas are also often used as a +first implementation to play with a language feature before a nicer syntax +to access the feature becomes available. noSideEffect pragma @@ -2439,6 +2455,12 @@ or ``ref T`` or ``ptr T`` this means no locations are modified. It is a static error to mark a proc/iterator to have no side effect if the compiler cannot verify this. +**Possible future**: ``func`` may become a keyword and syntactic sugar for a +proc with no side effects: + +.. code-block:: nimrod + func `+` (x, y: int): int + procvar pragma -------------- @@ -2458,6 +2480,53 @@ noReturn pragma The `noreturn`:idx: pragma is used to mark a proc that it never returns. +Acyclic pragma +-------------- +The `acyclic`:idx: pragma can be used for object types to mark them as acyclic +even though they seem to be cyclic. This is an **optimization** for the garbage +collector to not consider objects of this type as part of a cycle: + +.. code-block:: nimrod + type + PNode = ref TNode + TNode {.acyclic, final.} = object + left, right: PNode + data: string + +In the example a tree structure is declared with the ``TNode`` type. Note that +the type definition is recursive and the GC has to assume that objects of +this type may form a cyclic graph. The ``acyclic`` pragma passes the +information that this cannot happen to the GC. If the programmer uses the +``acyclic`` pragma for data types that are in reality cyclic, the GC may leak +memory, but nothing worse happens. + +**Possible future**: The ``acyclic`` pragma may become a property of a +``ref`` type: + +.. code-block:: nimrod + type + PNode = acyclic ref TNode + TNode = object + left, right: PNode + data: string + + +Final pragma +------------ +The `final`:idx: pragma can be used for an object type to specify that it +cannot be inherited from. + + +Pure pragma +----------- +The `pure`:idx: pragma serves two completely different purposes: +1) To mark a procedure that Nimrod should not generate any exit statements like + ``return result;`` in the generated code. This is useful for procs that only + consist of an assembler statement. +2) To mark an object type that Nimrod should omit its type field. This is + necessary for compatibility with other compiled languages. + + error pragma ------------ The `error`:idx: pragma is used to make the compiler output an error message @@ -2487,8 +2556,8 @@ compilation option pragmas The listed pragmas here can be used to override the code generation options for a section of code. -The implementation currently provides the following possible options (later -various others may be added). +The implementation currently provides the following possible options (various +others may be added later). =============== =============== ============================================ pragma allowed values description @@ -2532,3 +2601,142 @@ but are used to override the settings temporarily. Example: # speed critical # ... some code ... {.pop.} # restore old settings + + +Register pragma +--------------- +The `register`:idx: pragma is for variables only. It declares the variable as +``register``, giving the compiler a hint that the variable should be placed +in a hardware register for faster access. C compilers usually ignore this +though and for good reasons: Often they do a better job without it anyway. + +In highly specific cases (a dispatch loop of an bytecode interpreter for +example) it may provide benefits, though. + + +DeadCodeElim pragma +------------------- +The `deadCodeElim`:idx: pragma only applies to whole modules: It tells the +compiler to activate (or deactivate) dead code elimination for the module the +pragma appers in. + +The ``--deadCodeElim:on`` command line switch has the same effect as marking +every module with ``{.deadCodeElim:on}``. However, for some modules such as +the GTK wrapper it makes sense to *always* turn on dead code elimination - +no matter if it is globally active or not. + +Example: + +.. code-block:: nimrod + {.deadCodeElim: on.} + + +Disabling certain messages +-------------------------- +Nimrod generates some warnings and hints ("line too long") that may annoy the +user. A mechanism for disabling certain messages is provided: Each hint +and warning message contains a symbol in brackets. This is the message's +identifier that can be used to enable or disable it: + +.. code-block:: Nimrod + {.warning[LineTooLong]: off.} # turn off warning about too long lines + +This is often better than disabling all warnings at once. + + +Foreign function interface +========================== + +Nimrod's `FFI`:idx: (foreign function interface) is extensive and only the +parts that scale to other future backends (like the LLVM/EcmaScript backends) +are documented here. + + +Importc pragma +-------------- +The `importc`:idx: pragma provides a means to import a proc or a variable +from C. The optional argument is a string containing the C identifier. If +the argument is missing, the C name is the Nimrod identifier *exactly as +spelled*: + +.. code-block:: + proc printf(formatstr: cstring) {.importc: "printf", varargs.} + +Note that this pragma is somewhat of a misnomer: Other backends will provide +the same feature under the same name. + + +Exportc pragma +-------------- +The `exportc`:idx: pragma provides a means to export a type, a variable, or a +procedure to C. The optional argument is a string containing the C identifier. +If the argument is missing, the C name is the Nimrod +identifier *exactly as spelled*: + +.. code-block:: Nimrod + proc callme(formatstr: cstring) {.exportc: "callMe", varargs.} + +Note that this pragma is somewhat of a misnomer: Other backends will provide +the same feature under the same name. + + +Varargs pragma +-------------- +The `varargs`:idx: pragma can be applied to procedures only (and procedure +types). It tells Nimrod that the proc can take a variable number of parameters +after the last specified parameter. Nimrod string values will be converted to C +strings automatically: + +.. code-block:: Nimrod + proc printf(formatstr: cstring) {.nodecl, varargs.} + + printf("hallo %s", "world") # "world" will be passed as C string + + +Dynlib pragma +------------- +With the `dynlib`:idx: pragma a procedure can be imported from +a dynamic library (``.dll`` files for Windows, ``lib*.so`` files for UNIX). The +non-optional argument has to be the name of the dynamic library: + +.. code-block:: Nimrod + proc gtk_image_new(): PGtkWidget {.cdecl, dynlib: "libgtk-x11-2.0.so", importc.} + +In general, importing a dynamic library does not require any special linker +options or linking with import libraries. This also implies that no *devel* +packages need to be installed. + +The ``dynlib`` import mechanism supports a versioning scheme: + +.. code-block:: nimrod + proc Tcl_Eval(interp: pTcl_Interp, script: cstring): int {.cdecl, + importc, dynlib: "libtcl(|8.5|8.4|8.3).so.(1|0)".} + +At runtime the dynamic library is searched for (in this order):: + + libtcl.so.1 + libtcl.so.0 + libtcl8.5.so.1 + libtcl8.5.so.0 + libtcl8.4.so.1 + libtcl8.4.so.0 + libtcl8.3.so.1 + libtcl8.3.so.0 + +The ``dynlib`` pragma supports not only constant strings as argument but also +string expressions in general: + +.. code-block:: nimrod + import os + + proc getDllName: string = + result = "mylib.dll" + if ExistsFile(result): return + result = "mylib2.dll" + if ExistsFile(result): return + quit("could not load dynamic library") + + proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().} + +**Note**: Patterns like ``libtcl(|8.5|8.4).so`` are only supported in constant +strings, because they are precompiled. diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index 3c83cf76c..d35ea68c8 100755 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -71,87 +71,12 @@ Additional Features =================== This section describes Nimrod's additional features that are not listed in the -Nimrod manual. +Nimrod manual. Some of the features here only make sense for the C code +generator and are subject to change. -New Pragmas and Options ------------------------ -Because Nimrod generates C code it needs some "red tape" to work properly. -Lots of options and pragmas for tweaking the generated C code are available. - -Importc Pragma -~~~~~~~~~~~~~~ -The `importc`:idx: pragma provides a means to import a type, a variable, or a -procedure from C. The optional argument is a string containing the C -identifier. If the argument is missing, the C name is the Nimrod -identifier *exactly as spelled*: - -.. code-block:: - proc printf(formatstr: cstring) {.importc: "printf", varargs.} - - -Exportc Pragma -~~~~~~~~~~~~~~ -The `exportc`:idx: pragma provides a means to export a type, a variable, or a -procedure to C. The optional argument is a string containing the C -identifier. If the argument is missing, the C name is the Nimrod -identifier *exactly as spelled*: - -.. code-block:: Nimrod - proc callme(formatstr: cstring) {.exportc: "callMe", varargs.} - - -Dynlib Pragma -~~~~~~~~~~~~~ -With the `dynlib`:idx: pragma a procedure or a variable can be imported from -a dynamic library (``.dll`` files for Windows, ``lib*.so`` files for UNIX). The -non-optional argument has to be the name of the dynamic library: - -.. code-block:: Nimrod - proc gtk_image_new(): PGtkWidget {.cdecl, dynlib: "libgtk-x11-2.0.so", importc.} - -In general, importing a dynamic library does not require any special linker -options or linking with import libraries. This also implies that no *devel* -packages need to be installed. - -The ``dynlib`` import mechanism supports a versioning scheme: - -.. code-block:: nimrod - proc Tcl_Eval(interp: pTcl_Interp, script: cstring): int {.cdecl, - importc, dynlib: "libtcl(|8.5|8.4|8.3).so.(1|0)".} - -At runtime the dynamic library is searched for (in this order):: - - libtcl.so.1 - libtcl.so.0 - libtcl8.5.so.1 - libtcl8.5.so.0 - libtcl8.4.so.1 - libtcl8.4.so.0 - libtcl8.3.so.1 - libtcl8.3.so.0 - -The ``dynlib`` pragma supports not only constant strings as argument but also -string expressions in general: - -.. code-block:: nimrod - import os - - proc getDllName: string = - result = "mylib.dll" - if ExistsFile(result): return - result = "mylib2.dll" - if ExistsFile(result): return - quit("could not load dynamic library") - - proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().} - -**Note**: Patterns like ``libtcl(|8.5|8.4).so`` are only supported in constant -strings, because they are precompiled. - - -NoDecl Pragma -~~~~~~~~~~~~~ +NoDecl pragma +------------- The `noDecl`:idx: pragma can be applied to almost any symbol (variable, proc, type, etc.) and is sometimes useful for interoperability with C: It tells Nimrod that it should not generate a declaration for the symbol in @@ -164,9 +89,11 @@ the C code. For example: However, the ``header`` pragma is often the better alternative. +**Note**: This will not work for the LLVM backend. -Header Pragma -~~~~~~~~~~~~~ + +Header pragma +------------- The `header`:idx: pragma is very similar to the ``noDecl`` pragma: It can be applied to almost any symbol and specifies that it should not be declared and instead the generated code should contain an ``#include``: @@ -181,118 +108,48 @@ contains the header file: As usual for C, a system header file is enclosed in angle brackets: ``<>``. If no angle brackets are given, Nimrod encloses the header file in ``""`` in the generated C code. +**Note**: This will not work for the LLVM backend. -Varargs Pragma -~~~~~~~~~~~~~~ -The `varargs`:idx: pragma can be applied to procedures only (and procedure -types). It tells Nimrod that the proc can take a variable number of parameters -after the last specified parameter. Nimrod string values will be converted to C -strings automatically: -.. code-block:: Nimrod - proc printf(formatstr: cstring) {.nodecl, varargs.} - - printf("hallo %s", "world") # "world" will be passed as C string - - -LineDir Option -~~~~~~~~~~~~~~ +LineDir option +-------------- The `lineDir`:idx: option can be turned on or off. If turned on the generated C code contains ``#line`` directives. This may be helpful for debugging with GDB. -StackTrace Option -~~~~~~~~~~~~~~~~~ +StackTrace option +----------------- If the `stackTrace`:idx: option is turned on, the generated C contains code to ensure that proper stack traces are given if the program crashes or an uncaught exception is raised. -LineTrace Option -~~~~~~~~~~~~~~~~ +LineTrace option +---------------- The `lineTrace`:idx: option implies the ``stackTrace`` option. If turned on, the generated C contains code to ensure that proper stack traces with line number information are given if the program crashes or an uncaught exception is raised. -Debugger Option -~~~~~~~~~~~~~~~ +Debugger option +--------------- The `debugger`:idx: option enables or disables the *Embedded Nimrod Debugger*. See the documentation of endb_ for further information. -Breakpoint Pragma -~~~~~~~~~~~~~~~~~ +Breakpoint pragma +----------------- The *breakpoint* pragma was specially added for the sake of debugging with ENDB. See the documentation of `endb <endb.html>`_ for further information. -Volatile Pragma -~~~~~~~~~~~~~~~ +Volatile pragma +--------------- The `volatile`:idx: pragma is for variables only. It declares the variable as ``volatile``, whatever that means in C/C++. -Register Pragma -~~~~~~~~~~~~~~~ -The `register`:idx: pragma is for variables only. It declares the variable as -``register``, giving the compiler a hint that the variable should be placed -in a hardware register for faster access. C compilers usually ignore this -though and for good reasons: Often they do a better job without it anyway. - -In highly specific cases (a dispatch loop of an bytecode interpreter for -example) it may provide benefits, though. - - -Acyclic Pragma -~~~~~~~~~~~~~~ -The `acyclic`:idx: pragma can be used for object types to mark them as acyclic -even though they seem to be cyclic. This is an **optimization** for the garbage -collector to not consider objects of this type as part of a cycle: - -.. code-block:: nimrod - type - PNode = ref TNode - TNode {.acyclic, final.} = object - left, right: PNode - data: string - -In the example a tree structure is declared with the ``TNode`` type. Note that -the type definition is recursive and the GC has to assume that objects of -this type may form a cyclic graph. The ``acyclic`` pragma passes the -information that this cannot happen to the GC. If the programmer uses the -``acyclic`` pragma for data types that are in reality cyclic, the GC may leak -memory, but nothing worse happens. - - -DeadCodeElim Pragma -~~~~~~~~~~~~~~~~~~~ -The `deadCodeElim`:idx: pragma only applies to whole modules: It tells the -compiler to activate (or deactivate) dead code elimination for the module the -pragma appers in. - -The ``--deadCodeElim:on`` command line switch has the same effect as marking -every module with ``{.deadCodeElim:on}``. However, for some modules such as -the GTK wrapper it makes sense to *always* turn on dead code elimination - -no matter if it is globally active or not. - -Example: - -.. code-block:: nimrod - {.deadCodeElim: on.} - - -Disabling certain messages --------------------------- -Nimrod generates some warnings and hints ("line too long") that may annoy the -user. A mechanism for disabling certain messages is provided: Each hint -and warning message contains a symbol in brackets. This is the message's -identifier that can be used to enable or disable it: - -.. code-block:: Nimrod - {.warning[LineTooLong]: off.} # turn off warning about too long lines - -This is often better than disabling all warnings at once. +**Note**: This pragma will not exist for the LLVM backend. Debugging with Nimrod diff --git a/install.txt b/install.txt index 11938a3ca..048cf8f98 100755 --- a/install.txt +++ b/install.txt @@ -46,8 +46,8 @@ Installation on Windows Install Nimrod by downloading and running the ``nimrod_$version.exe`` file. As default, the ``GCC`` compiler is used that is bundled with this installer. -**You can change the configuration file** ``config/nimrod.cfg`` **to use -another C compiler or change the path to GCC.** +You can change the configuration file ``config/nimrod.cfg`` to use +another C compiler or change the path to GCC. Currently, the following C compilers are supported under Windows: diff --git a/koch.nim b/koch.nim index e79ab9a36..e5d963b1e 100755 --- a/koch.nim +++ b/koch.nim @@ -1,7 +1,7 @@ # # # Maintenance program for Nimrod -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -15,7 +15,7 @@ const +-----------------------------------------------------------------+ | Maintenance program for Nimrod | | Version $1| -| (c) 2009 Andreas Rumpf | +| (c) 2010 Andreas Rumpf | +-----------------------------------------------------------------+ Build time: $2, $3 @@ -113,7 +113,9 @@ proc bootIteration(args: string): bool = # Nimrod does not produce an executable again if nothing changed. That's ok: result = sameFileContent("rod" / "nimrod".exe, nimrod1) safeRemove("bin" / "nimrod".exe) - copyFile("bin" / "nimrod".exe, "rod" / "nimrod".exe) + var dest = "bin" / "nimrod".exe + copyFile(dest, "rod" / "nimrod".exe) + inclFilePermissions(dest, {fpUserExec}) safeRemove(nimrod1) if result: echo "executables are equal: SUCCESS!" diff --git a/lib/copying.txt b/lib/copying.txt index be182d65c..6fcdca1df 100755 --- a/lib/copying.txt +++ b/lib/copying.txt @@ -1,6 +1,6 @@ ======================================================= The Nimrod Runtime Library - Copyright (C) 2004-2009 Andreas Rumpf + Copyright (C) 2004-2010 Andreas Rumpf ======================================================= This is the file copying.txt, it applies to the Nimrod Run-Time Library diff --git a/lib/devel/httpserver.nim b/lib/devel/httpserver.nim new file mode 100644 index 000000000..ca1e315f0 --- /dev/null +++ b/lib/devel/httpserver.nim @@ -0,0 +1,196 @@ +# +# +# 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 implements a simple HTTP-Server. + +import strutils, os, osproc, strtabs, streams, sockets + +const + wwwNL = "\r\L" + ServerSig = "Server: httpserver.nim/1.0.0" & wwwNL + +# --------------- output messages -------------------------------------------- + +proc sendTextContentType(client: TSocket) = + send(client, "Content-type: text/html" & wwwNL) + send(client, wwwNL) + +proc badRequest(client: TSocket) = + # Inform the client that a request it has made has a problem. + send(client, "HTTP/1.0 400 BAD REQUEST" & wwwNL) + sendTextContentType(client) + send(client, "<p>Your browser sent a bad request, " & + "such as a POST without a Content-Length." & wwwNL) + +proc cannotExec(client: TSocket) = + send(client, "HTTP/1.0 500 Internal Server Error" & wwwNL) + sendTextContentType(client) + send(client, "<P>Error prohibited CGI execution." & wwwNL) + +proc headers(client: TSocket, filename: string) = + # XXX could use filename to determine file type + send(client, "HTTP/1.0 200 OK" & wwwNL) + send(client, ServerSig) + sendTextContentType(client) + +proc notFound(client: TSocket) = + send(client, "HTTP/1.0 404 NOT FOUND" & wwwNL) + send(client, ServerSig) + sendTextContentType(client) + send(client, "<html><title>Not Found</title>" & wwwNL) + send(client, "<body><p>The server could not fulfill" & wwwNL) + send(client, "your request because the resource specified" & wwwNL) + send(client, "is unavailable or nonexistent." & wwwNL) + send(client, "</body></html>" & wwwNL) + +proc unimplemented(client: TSocket) = + send(client, "HTTP/1.0 501 Method Not Implemented" & wwwNL) + send(client, ServerSig) + sendTextContentType(client) + send(client, "<html><head><title>Method Not Implemented" & + "</title></head>" & + "<body><p>HTTP request method not supported." & + "</body></HTML>" & wwwNL) + +# ----------------- file serving --------------------------------------------- + +proc discardHeaders(client: TSocket) = skip(client) + +proc serveFile(client: TSocket, filename: string) = + discardHeaders(client) + + var f: TFile + if open(f, filename): + headers(client, filename) + const bufSize = 8000 # != 8K might be good for memory manager + var buf = alloc(bufsize) + while True: + var bytesread = readBuffer(f, buf, bufsize) + if bytesread > 0: + var byteswritten = send(client, buf, bytesread) + if bytesread != bytesWritten: + dealloc(buf) + close(f) + OSError() + if bytesread != bufSize: break + dealloc(buf) + close(f) + else: + notFound(client) + +# ------------------ CGI execution ------------------------------------------- + +type + TRequestMethod = enum reqGet, reqPost + +proc executeCgi(client: TSocket, path, query: string, meth: TRequestMethod) = + var env = newStringTable(modeCaseInsensitive) + var contentLength = -1 + case meth + of reqGet: + discardHeaders(client) + + env["REQUEST_METHOD"] = "GET" + env["QUERY_STRING"] = query + of reqPost: + var buf = "" + var dataAvail = false + while dataAvail: + dataAvail = recvLine(client, buf) + var L = toLower(buf) + if L.startsWith("content-length:"): + var i = len("content-length:") + while L[i] in Whitespace: inc(i) + contentLength = parseInt(copy(L, i)) + + if contentLength < 0: + badRequest(client) + return + + env["REQUEST_METHOD"] = "POST" + env["CONTENT_LENGTH"] = $contentLength + + send(client, "HTTP/1.0 200 OK" & wwwNL) + + var process = startProcess(command=path, env=env) + if meth == reqPost: + # get from client and post to CGI program: + var buf = alloc(contentLength) + if recv(client, buf, contentLength) != contentLength: OSError() + var inp = process.inputStream + inp.writeData(inp, buf, contentLength) + + var outp = process.outputStream + while running(process) or not outp.atEnd(outp): + var line = outp.readLine() + send(client, line) + send(client, wwwNL) + +# --------------- Server Setup ----------------------------------------------- + +proc startup(): tuple[socket: TSocket, port: TPort] = + var s = socket(AF_INET) + if s == InvalidSocket: OSError() + bindAddr(s) + listen(s) + result.socket = s + result.port = getSockName(s) + +proc acceptRequest(client: TSocket) = + var cgi = false + var query = "" + var buf = "" + discard recvLine(client, buf) + var data = buf.split() + var meth = reqGet + if cmpIgnoreCase(data[0], "GET") == 0: + var q = find(data[1], '?') + if q >= 0: + cgi = true + query = data[1].copy(q+1) + elif cmpIgnoreCase(data[0], "POST") == 0: + cgi = true + meth = reqPost + else: + unimplemented(client) + + var path = data[1] + if path[path.len-1] == '/' or existsDir(path): + path = path / "index.html" + + if not ExistsFile(path): + discardHeaders(client) + notFound(client) + else: + when defined(Windows): + var ext = splitFile(path).ext.toLower + if ext == ".exe" or ext == ".cgi": + # XXX: extract interpreter information here? + cgi = true + else: + if {fpUserExec, fpGroupExec, fpOthersExec} * path.getFilePermissions != {}: + cgi = true + if not cgi: + serveFile(client, path) + else: + executeCgi(client, path, query, meth) + +proc main = + var (server, port) = startup() + echo("httpserver running on port ", int16(port)) + + while true: + var client = accept(server) + if client == InvalidSocket: OSError() + acceptRequest(client) + close(client) + close(server) + +when isMainModule: + main() diff --git a/lib/newwrap/cairo/cairo.nim b/lib/newwrap/cairo/cairo.nim new file mode 100644 index 000000000..d391b4622 --- /dev/null +++ b/lib/newwrap/cairo/cairo.nim @@ -0,0 +1,693 @@ +#* 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 +# + +when defined(windows): + const + LIB_CAIRO* = "cairo.dll" +else: + const + LIB_CAIRO* = "libcairo.so" +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 + 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 + PPCairoSurface* = ptr PSurface + P* = ptr T + 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.} + T*{.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", dynlib: LIB_CAIRO.} +proc version_string*(): cstring{.cdecl, importc: "cairo_version_string", + dynlib: LIB_CAIRO.} + #Helper function to retrieve decoded version +proc version*(major, minor, micro: var int32) + #* Functions for manipulating state objects +proc create*(target: PSurface): P{.cdecl, importc: "cairo_create", + dynlib: LIB_CAIRO.} +proc reference*(cr: P): P{.cdecl, importc: "cairo_reference", dynlib: LIB_CAIRO.} +proc destroy*(cr: P){.cdecl, importc: "cairo_destroy", dynlib: LIB_CAIRO.} +proc get_reference_count*(cr: P): int32{.cdecl, + importc: "cairo_get_reference_count", dynlib: LIB_CAIRO.} +proc get_user_data*(cr: P, key: PUserDataKey): pointer{.cdecl, + importc: "cairo_get_user_data", dynlib: LIB_CAIRO.} +proc set_user_data*(cr: P, key: PUserDataKey, user_data: Pointer, + destroy: TDestroyFunc): TStatus{.cdecl, + importc: "cairo_set_user_data", dynlib: LIB_CAIRO.} +proc save*(cr: P){.cdecl, importc: "cairo_save", dynlib: LIB_CAIRO.} +proc restore*(cr: P){.cdecl, importc: "cairo_restore", dynlib: LIB_CAIRO.} +proc push_group*(cr: P){.cdecl, importc: "cairo_push_group", dynlib: LIB_CAIRO.} +proc push_group_with_content*(cr: P, content: TContent){.cdecl, + importc: "cairo_push_group_with_content", dynlib: LIB_CAIRO.} +proc pop_group*(cr: P): PPattern{.cdecl, importc: "cairo_pop_group", + dynlib: LIB_CAIRO.} +proc pop_group_to_source*(cr: P){.cdecl, importc: "cairo_pop_group_to_source", + dynlib: LIB_CAIRO.} + #* Modify state +proc set_operator*(cr: P, op: TOperator){.cdecl, importc: "cairo_set_operator", + dynlib: LIB_CAIRO.} +proc set_source*(cr: P, source: PPattern){.cdecl, importc: "cairo_set_source", + dynlib: LIB_CAIRO.} +proc set_source_rgb*(cr: P, red, green, blue: float64){.cdecl, + importc: "cairo_set_source_rgb", dynlib: LIB_CAIRO.} +proc set_source_rgba*(cr: P, red, green, blue, alpha: float64){.cdecl, + importc: "cairo_set_source_rgba", dynlib: LIB_CAIRO.} +proc set_source_surface*(cr: P, surface: PSurface, x, y: float64){.cdecl, + importc: "cairo_set_source_surface", dynlib: LIB_CAIRO.} +proc set_tolerance*(cr: P, tolerance: float64){.cdecl, + importc: "cairo_set_tolerance", dynlib: LIB_CAIRO.} +proc set_antialias*(cr: P, antialias: TAntialias){.cdecl, + importc: "cairo_set_antialias", dynlib: LIB_CAIRO.} +proc set_fill_rule*(cr: P, fill_rule: TFillRule){.cdecl, + importc: "cairo_set_fill_rule", dynlib: LIB_CAIRO.} +proc set_line_width*(cr: P, width: float64){.cdecl, + importc: "cairo_set_line_width", dynlib: LIB_CAIRO.} +proc set_line_cap*(cr: P, line_cap: TLineCap){.cdecl, + importc: "cairo_set_line_cap", dynlib: LIB_CAIRO.} +proc set_line_join*(cr: P, line_join: TLineJoin){.cdecl, + importc: "cairo_set_line_join", dynlib: LIB_CAIRO.} +proc set_dash*(cr: P, dashes: openarray[float64], offset: float64){.cdecl, + importc: "cairo_set_dash", dynlib: LIB_CAIRO.} +proc set_miter_limit*(cr: P, limit: float64){.cdecl, + importc: "cairo_set_miter_limit", dynlib: LIB_CAIRO.} +proc translate*(cr: P, tx, ty: float64){.cdecl, importc: "cairo_translate", + dynlib: LIB_CAIRO.} +proc scale*(cr: P, sx, sy: float64){.cdecl, importc: "cairo_scale", + dynlib: LIB_CAIRO.} +proc rotate*(cr: P, angle: float64){.cdecl, importc: "cairo_rotate", + dynlib: LIB_CAIRO.} +proc transform*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_transform", + dynlib: LIB_CAIRO.} +proc set_matrix*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_set_matrix", + dynlib: LIB_CAIRO.} +proc identity_matrix*(cr: P){.cdecl, importc: "cairo_identity_matrix", + dynlib: LIB_CAIRO.} +proc user_to_device*(cr: P, x, y: var float64){.cdecl, + importc: "cairo_user_to_device", dynlib: LIB_CAIRO.} +proc user_to_device_distance*(cr: P, dx, dy: var float64){.cdecl, + importc: "cairo_user_to_device_distance", dynlib: LIB_CAIRO.} +proc device_to_user*(cr: P, x, y: var float64){.cdecl, + importc: "cairo_device_to_user", dynlib: LIB_CAIRO.} +proc device_to_user_distance*(cr: P, dx, dy: var float64){.cdecl, + importc: "cairo_device_to_user_distance", dynlib: LIB_CAIRO.} + #* Path creation functions +proc new_path*(cr: P){.cdecl, importc: "cairo_new_path", dynlib: LIB_CAIRO.} +proc move_to*(cr: P, x, y: float64){.cdecl, importc: "cairo_move_to", + dynlib: LIB_CAIRO.} +proc new_sub_path*(cr: P){.cdecl, importc: "cairo_new_sub_path", + dynlib: LIB_CAIRO.} +proc line_to*(cr: P, x, y: float64){.cdecl, importc: "cairo_line_to", + dynlib: LIB_CAIRO.} +proc curve_to*(cr: P, x1, y1, x2, y2, x3, y3: float64){.cdecl, + importc: "cairo_curve_to", dynlib: LIB_CAIRO.} +proc arc*(cr: P, xc, yc, radius, angle1, angle2: float64){.cdecl, + importc: "cairo_arc", dynlib: LIB_CAIRO.} +proc arc_negative*(cr: P, xc, yc, radius, angle1, angle2: float64){.cdecl, + importc: "cairo_arc_negative", dynlib: LIB_CAIRO.} +proc rel_move_to*(cr: P, dx, dy: float64){.cdecl, importc: "cairo_rel_move_to", + dynlib: LIB_CAIRO.} +proc rel_line_to*(cr: P, dx, dy: float64){.cdecl, importc: "cairo_rel_line_to", + dynlib: LIB_CAIRO.} +proc rel_curve_to*(cr: P, dx1, dy1, dx2, dy2, dx3, dy3: float64){.cdecl, + importc: "cairo_rel_curve_to", dynlib: LIB_CAIRO.} +proc rectangle*(cr: P, x, y, width, height: float64){.cdecl, + importc: "cairo_rectangle", dynlib: LIB_CAIRO.} +proc close_path*(cr: P){.cdecl, importc: "cairo_close_path", dynlib: LIB_CAIRO.} + #* Painting functions +proc paint*(cr: P){.cdecl, importc: "cairo_paint", dynlib: LIB_CAIRO.} +proc paint_with_alpha*(cr: P, alpha: float64){.cdecl, + importc: "cairo_paint_with_alpha", dynlib: LIB_CAIRO.} +proc mask*(cr: P, pattern: PPattern){.cdecl, importc: "cairo_mask", + dynlib: LIB_CAIRO.} +proc mask_surface*(cr: P, surface: PSurface, surface_x, surface_y: float64){. + cdecl, importc: "cairo_mask_surface", dynlib: LIB_CAIRO.} +proc stroke*(cr: P){.cdecl, importc: "cairo_stroke", dynlib: LIB_CAIRO.} +proc stroke_preserve*(cr: P){.cdecl, importc: "cairo_stroke_preserve", + dynlib: LIB_CAIRO.} +proc fill*(cr: P){.cdecl, importc: "cairo_fill", dynlib: LIB_CAIRO.} +proc fill_preserve*(cr: P){.cdecl, importc: "cairo_fill_preserve", + dynlib: LIB_CAIRO.} +proc copy_page*(cr: P){.cdecl, importc: "cairo_copy_page", dynlib: LIB_CAIRO.} +proc show_page*(cr: P){.cdecl, importc: "cairo_show_page", dynlib: LIB_CAIRO.} + #* Insideness testing +proc in_stroke*(cr: P, x, y: float64): TBool{.cdecl, importc: "cairo_in_stroke", + dynlib: LIB_CAIRO.} +proc in_fill*(cr: P, x, y: float64): TBool{.cdecl, importc: "cairo_in_fill", + dynlib: LIB_CAIRO.} + #* Rectangular extents +proc stroke_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, + importc: "cairo_stroke_extents", dynlib: LIB_CAIRO.} +proc fill_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, + importc: "cairo_fill_extents", dynlib: LIB_CAIRO.} + #* Clipping +proc reset_clip*(cr: P){.cdecl, importc: "cairo_reset_clip", dynlib: LIB_CAIRO.} +proc clip*(cr: P){.cdecl, importc: "cairo_clip", dynlib: LIB_CAIRO.} +proc clip_preserve*(cr: P){.cdecl, importc: "cairo_clip_preserve", + dynlib: LIB_CAIRO.} +proc clip_extents*(cr: P, x1, y1, x2, y2: var float64){.cdecl, + importc: "cairo_clip_extents", dynlib: LIB_CAIRO.} +proc copy_clip_rectangle_list*(cr: P): PRectangleList{.cdecl, + importc: "cairo_copy_clip_rectangle_list", dynlib: LIB_CAIRO.} +proc rectangle_list_destroy*(rectangle_list: PRectangleList){.cdecl, + importc: "cairo_rectangle_list_destroy", dynlib: LIB_CAIRO.} + #* Font/Text functions +proc font_options_create*(): PFontOptions{.cdecl, + importc: "cairo_font_options_create", dynlib: LIB_CAIRO.} +proc font_options_copy*(original: PFontOptions): PFontOptions{.cdecl, + importc: "cairo_font_options_copy", dynlib: LIB_CAIRO.} +proc font_options_destroy*(options: PFontOptions){.cdecl, + importc: "cairo_font_options_destroy", dynlib: LIB_CAIRO.} +proc font_options_status*(options: PFontOptions): TStatus{.cdecl, + importc: "cairo_font_options_status", dynlib: LIB_CAIRO.} +proc font_options_merge*(options, other: PFontOptions){.cdecl, + importc: "cairo_font_options_merge", dynlib: LIB_CAIRO.} +proc font_options_equal*(options, other: PFontOptions): TBool{.cdecl, + importc: "cairo_font_options_equal", dynlib: LIB_CAIRO.} +proc font_options_hash*(options: PFontOptions): int32{.cdecl, + importc: "cairo_font_options_hash", dynlib: LIB_CAIRO.} +proc font_options_set_antialias*(options: PFontOptions, antialias: TAntialias){. + cdecl, importc: "cairo_font_options_set_antialias", dynlib: LIB_CAIRO.} +proc font_options_get_antialias*(options: PFontOptions): TAntialias{.cdecl, + importc: "cairo_font_options_get_antialias", dynlib: LIB_CAIRO.} +proc font_options_set_subpixel_order*(options: PFontOptions, + subpixel_order: TSubpixelOrder){.cdecl, + importc: "cairo_font_options_set_subpixel_order", dynlib: LIB_CAIRO.} +proc font_options_get_subpixel_order*(options: PFontOptions): TSubpixelOrder{. + cdecl, importc: "cairo_font_options_get_subpixel_order", dynlib: LIB_CAIRO.} +proc font_options_set_hint_style*(options: PFontOptions, hint_style: THintStyle){. + cdecl, importc: "cairo_font_options_set_hint_style", dynlib: LIB_CAIRO.} +proc font_options_get_hint_style*(options: PFontOptions): THintStyle{.cdecl, + importc: "cairo_font_options_get_hint_style", dynlib: LIB_CAIRO.} +proc font_options_set_hint_metrics*(options: PFontOptions, + hint_metrics: THintMetrics){.cdecl, + importc: "cairo_font_options_set_hint_metrics", dynlib: LIB_CAIRO.} +proc font_options_get_hint_metrics*(options: PFontOptions): THintMetrics{.cdecl, + importc: "cairo_font_options_get_hint_metrics", dynlib: LIB_CAIRO.} + #* This interface is for dealing with text as text, not caring about the + # font object inside the the TCairo. +proc select_font_face*(cr: P, family: cstring, slant: TFontSlant, + weight: TFontWeight){.cdecl, + importc: "cairo_select_font_face", dynlib: LIB_CAIRO.} +proc set_font_size*(cr: P, size: float64){.cdecl, + importc: "cairo_set_font_size", dynlib: LIB_CAIRO.} +proc set_font_matrix*(cr: P, matrix: PMatrix){.cdecl, + importc: "cairo_set_font_matrix", dynlib: LIB_CAIRO.} +proc get_font_matrix*(cr: P, matrix: PMatrix){.cdecl, + importc: "cairo_get_font_matrix", dynlib: LIB_CAIRO.} +proc set_font_options*(cr: P, options: PFontOptions){.cdecl, + importc: "cairo_set_font_options", dynlib: LIB_CAIRO.} +proc get_font_options*(cr: P, options: PFontOptions){.cdecl, + importc: "cairo_get_font_options", dynlib: LIB_CAIRO.} +proc set_font_face*(cr: P, font_face: PFontFace){.cdecl, + importc: "cairo_set_font_face", dynlib: LIB_CAIRO.} +proc get_font_face*(cr: P): PFontFace{.cdecl, importc: "cairo_get_font_face", + dynlib: LIB_CAIRO.} +proc set_scaled_font*(cr: P, scaled_font: PScaledFont){.cdecl, + importc: "cairo_set_scaled_font", dynlib: LIB_CAIRO.} +proc get_scaled_font*(cr: P): PScaledFont{.cdecl, + importc: "cairo_get_scaled_font", dynlib: LIB_CAIRO.} +proc show_text*(cr: P, utf8: cstring){.cdecl, importc: "cairo_show_text", + dynlib: LIB_CAIRO.} +proc show_glyphs*(cr: P, glyphs: PGlyph, num_glyphs: int32){.cdecl, + importc: "cairo_show_glyphs", dynlib: LIB_CAIRO.} +proc text_path*(cr: P, utf8: cstring){.cdecl, importc: "cairo_text_path", + dynlib: LIB_CAIRO.} +proc glyph_path*(cr: P, glyphs: PGlyph, num_glyphs: int32){.cdecl, + importc: "cairo_glyph_path", dynlib: LIB_CAIRO.} +proc text_extents*(cr: P, utf8: cstring, extents: PTextExtents){.cdecl, + importc: "cairo_text_extents", dynlib: LIB_CAIRO.} +proc glyph_extents*(cr: P, glyphs: PGlyph, num_glyphs: int32, + extents: PTextExtents){.cdecl, + importc: "cairo_glyph_extents", dynlib: LIB_CAIRO.} +proc font_extents*(cr: P, extents: PFontExtents){.cdecl, + importc: "cairo_font_extents", dynlib: LIB_CAIRO.} + #* Generic identifier for a font style +proc font_face_reference*(font_face: PFontFace): PFontFace{.cdecl, + importc: "cairo_font_face_reference", dynlib: LIB_CAIRO.} +proc font_face_destroy*(font_face: PFontFace){.cdecl, + importc: "cairo_font_face_destroy", dynlib: LIB_CAIRO.} +proc font_face_get_reference_count*(font_face: PFontFace): int32{.cdecl, + importc: "cairo_font_face_get_reference_count", dynlib: LIB_CAIRO.} +proc font_face_status*(font_face: PFontFace): TStatus{.cdecl, + importc: "cairo_font_face_status", dynlib: LIB_CAIRO.} +proc font_face_get_type*(font_face: PFontFace): TFontType{.cdecl, + importc: "cairo_font_face_get_type", dynlib: LIB_CAIRO.} +proc font_face_get_user_data*(font_face: PFontFace, key: PUserDataKey): pointer{. + cdecl, importc: "cairo_font_face_get_user_data", dynlib: LIB_CAIRO.} +proc font_face_set_user_data*(font_face: PFontFace, key: PUserDataKey, + user_data: pointer, destroy: TDestroyFunc): TStatus{. + cdecl, importc: "cairo_font_face_set_user_data", dynlib: LIB_CAIRO.} + #* 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", dynlib: LIB_CAIRO.} +proc scaled_font_reference*(scaled_font: PScaledFont): PScaledFont{.cdecl, + importc: "cairo_scaled_font_reference", dynlib: LIB_CAIRO.} +proc scaled_font_destroy*(scaled_font: PScaledFont){.cdecl, + importc: "cairo_scaled_font_destroy", dynlib: LIB_CAIRO.} +proc scaled_font_get_reference_count*(scaled_font: PScaledFont): int32{.cdecl, + importc: "cairo_scaled_font_get_reference_count", dynlib: LIB_CAIRO.} +proc scaled_font_status*(scaled_font: PScaledFont): TStatus{.cdecl, + importc: "cairo_scaled_font_status", dynlib: LIB_CAIRO.} +proc scaled_font_get_type*(scaled_font: PScaledFont): TFontType{.cdecl, + importc: "cairo_scaled_font_get_type", dynlib: LIB_CAIRO.} +proc scaled_font_get_user_data*(scaled_font: PScaledFont, key: PUserDataKey): Pointer{. + cdecl, importc: "cairo_scaled_font_get_user_data", dynlib: LIB_CAIRO.} +proc scaled_font_set_user_data*(scaled_font: PScaledFont, key: PUserDataKey, + user_data: Pointer, destroy: TDestroyFunc): TStatus{. + cdecl, importc: "cairo_scaled_font_set_user_data", dynlib: LIB_CAIRO.} +proc scaled_font_extents*(scaled_font: PScaledFont, extents: PFontExtents){. + cdecl, importc: "cairo_scaled_font_extents", dynlib: LIB_CAIRO.} +proc scaled_font_text_extents*(scaled_font: PScaledFont, utf8: cstring, + extents: PTextExtents){.cdecl, + importc: "cairo_scaled_font_text_extents", dynlib: LIB_CAIRO.} +proc scaled_font_glyph_extents*(scaled_font: PScaledFont, glyphs: PGlyph, + num_glyphs: int32, extents: PTextExtents){. + cdecl, importc: "cairo_scaled_font_glyph_extents", dynlib: LIB_CAIRO.} +proc scaled_font_get_font_face*(scaled_font: PScaledFont): PFontFace{.cdecl, + importc: "cairo_scaled_font_get_font_face", dynlib: LIB_CAIRO.} +proc scaled_font_get_font_matrix*(scaled_font: PScaledFont, font_matrix: PMatrix){. + cdecl, importc: "cairo_scaled_font_get_font_matrix", dynlib: LIB_CAIRO.} +proc scaled_font_get_ctm*(scaled_font: PScaledFont, ctm: PMatrix){.cdecl, + importc: "cairo_scaled_font_get_ctm", dynlib: LIB_CAIRO.} +proc scaled_font_get_font_options*(scaled_font: PScaledFont, + options: PFontOptions){.cdecl, + importc: "cairo_scaled_font_get_font_options", dynlib: LIB_CAIRO.} + #* Query functions +proc get_operator*(cr: P): TOperator{.cdecl, importc: "cairo_get_operator", + dynlib: LIB_CAIRO.} +proc get_source*(cr: P): PPattern{.cdecl, importc: "cairo_get_source", + dynlib: LIB_CAIRO.} +proc get_tolerance*(cr: P): float64{.cdecl, importc: "cairo_get_tolerance", + dynlib: LIB_CAIRO.} +proc get_antialias*(cr: P): TAntialias{.cdecl, importc: "cairo_get_antialias", + dynlib: LIB_CAIRO.} +proc get_current_point*(cr: P, x, y: var float64){.cdecl, + importc: "cairo_get_current_point", dynlib: LIB_CAIRO.} +proc get_fill_rule*(cr: P): TFillRule{.cdecl, importc: "cairo_get_fill_rule", + dynlib: LIB_CAIRO.} +proc get_line_width*(cr: P): float64{.cdecl, importc: "cairo_get_line_width", + dynlib: LIB_CAIRO.} +proc get_line_cap*(cr: P): TLineCap{.cdecl, importc: "cairo_get_line_cap", + dynlib: LIB_CAIRO.} +proc get_line_join*(cr: P): TLineJoin{.cdecl, importc: "cairo_get_line_join", + dynlib: LIB_CAIRO.} +proc get_miter_limit*(cr: P): float64{.cdecl, importc: "cairo_get_miter_limit", + dynlib: LIB_CAIRO.} +proc get_dash_count*(cr: P): int32{.cdecl, importc: "cairo_get_dash_count", + dynlib: LIB_CAIRO.} +proc get_dash*(cr: P, dashes, offset: var float64){.cdecl, + importc: "cairo_get_dash", dynlib: LIB_CAIRO.} +proc get_matrix*(cr: P, matrix: PMatrix){.cdecl, importc: "cairo_get_matrix", + dynlib: LIB_CAIRO.} +proc get_target*(cr: P): PSurface{.cdecl, importc: "cairo_get_target", + dynlib: LIB_CAIRO.} +proc get_group_target*(cr: P): PSurface{.cdecl, + importc: "cairo_get_group_target", dynlib: LIB_CAIRO.} +proc copy_path*(cr: P): PPath{.cdecl, importc: "cairo_copy_path", + dynlib: LIB_CAIRO.} +proc copy_path_flat*(cr: P): PPath{.cdecl, importc: "cairo_copy_path_flat", + dynlib: LIB_CAIRO.} +proc append_path*(cr: P, path: PPath){.cdecl, importc: "cairo_append_path", + dynlib: LIB_CAIRO.} +proc path_destroy*(path: PPath){.cdecl, importc: "cairo_path_destroy", + dynlib: LIB_CAIRO.} + #* Error status queries +proc status*(cr: P): TStatus{.cdecl, importc: "cairo_status", dynlib: LIB_CAIRO.} +proc status_to_string*(status: TStatus): cstring{.cdecl, + importc: "cairo_status_to_string", dynlib: LIB_CAIRO.} + #* Surface manipulation +proc surface_create_similar*(other: PSurface, content: TContent, + width, height: int32): PSurface{.cdecl, + importc: "cairo_surface_create_similar", dynlib: LIB_CAIRO.} +proc surface_reference*(surface: PSurface): PSurface{.cdecl, + importc: "cairo_surface_reference", dynlib: LIB_CAIRO.} +proc surface_finish*(surface: PSurface){.cdecl, importc: "cairo_surface_finish", + dynlib: LIB_CAIRO.} +proc surface_destroy*(surface: PSurface){.cdecl, + importc: "cairo_surface_destroy", dynlib: LIB_CAIRO.} +proc surface_get_reference_count*(surface: PSurface): int32{.cdecl, + importc: "cairo_surface_get_reference_count", dynlib: LIB_CAIRO.} +proc surface_status*(surface: PSurface): TStatus{.cdecl, + importc: "cairo_surface_status", dynlib: LIB_CAIRO.} +proc surface_get_type*(surface: PSurface): TSurfaceType{.cdecl, + importc: "cairo_surface_get_type", dynlib: LIB_CAIRO.} +proc surface_get_content*(surface: PSurface): TContent{.cdecl, + importc: "cairo_surface_get_content", dynlib: LIB_CAIRO.} +proc surface_write_to_png*(surface: PSurface, filename: cstring): TStatus{. + cdecl, importc: "cairo_surface_write_to_png", dynlib: LIB_CAIRO.} +proc surface_write_to_png_stream*(surface: PSurface, write_func: TWriteFunc, + closure: pointer): TStatus{.cdecl, + importc: "cairo_surface_write_to_png_stream", dynlib: LIB_CAIRO.} +proc surface_get_user_data*(surface: PSurface, key: PUserDataKey): pointer{. + cdecl, importc: "cairo_surface_get_user_data", dynlib: LIB_CAIRO.} +proc surface_set_user_data*(surface: PSurface, key: PUserDataKey, + user_data: pointer, destroy: TDestroyFunc): TStatus{. + cdecl, importc: "cairo_surface_set_user_data", dynlib: LIB_CAIRO.} +proc surface_get_font_options*(surface: PSurface, options: PFontOptions){.cdecl, + importc: "cairo_surface_get_font_options", dynlib: LIB_CAIRO.} +proc surface_flush*(surface: PSurface){.cdecl, importc: "cairo_surface_flush", + dynlib: LIB_CAIRO.} +proc surface_mark_dirty*(surface: PSurface){.cdecl, + importc: "cairo_surface_mark_dirty", dynlib: LIB_CAIRO.} +proc surface_mark_dirty_rectangle*(surface: PSurface, x, y, width, height: int32){. + cdecl, importc: "cairo_surface_mark_dirty_rectangle", dynlib: LIB_CAIRO.} +proc surface_set_device_offset*(surface: PSurface, x_offset, y_offset: float64){. + cdecl, importc: "cairo_surface_set_device_offset", dynlib: LIB_CAIRO.} +proc surface_get_device_offset*(surface: PSurface, + x_offset, y_offset: var float64){.cdecl, + importc: "cairo_surface_get_device_offset", dynlib: LIB_CAIRO.} +proc surface_set_fallback_resolution*(surface: PSurface, x_pixels_per_inch, + y_pixels_per_inch: float64){.cdecl, importc: "cairo_surface_set_fallback_resolution", + dynlib: LIB_CAIRO.} + #* Image-surface functions +proc image_surface_create*(format: TFormat, width, height: int32): PSurface{. + cdecl, importc: "cairo_image_surface_create", dynlib: LIB_CAIRO.} +proc image_surface_create_for_data*(data: Pbyte, format: TFormat, + width, height, stride: int32): PSurface{. + cdecl, importc: "cairo_image_surface_create_for_data", dynlib: LIB_CAIRO.} +proc image_surface_get_data*(surface: PSurface): cstring{.cdecl, + importc: "cairo_image_surface_get_data", dynlib: LIB_CAIRO.} +proc image_surface_get_format*(surface: PSurface): TFormat{.cdecl, + importc: "cairo_image_surface_get_format", dynlib: LIB_CAIRO.} +proc image_surface_get_width*(surface: PSurface): int32{.cdecl, + importc: "cairo_image_surface_get_width", dynlib: LIB_CAIRO.} +proc image_surface_get_height*(surface: PSurface): int32{.cdecl, + importc: "cairo_image_surface_get_height", dynlib: LIB_CAIRO.} +proc image_surface_get_stride*(surface: PSurface): int32{.cdecl, + importc: "cairo_image_surface_get_stride", dynlib: LIB_CAIRO.} +proc image_surface_create_from_png*(filename: cstring): PSurface{.cdecl, + importc: "cairo_image_surface_create_from_png", dynlib: LIB_CAIRO.} +proc image_surface_create_from_png_stream*(read_func: TReadFunc, + closure: pointer): PSurface{.cdecl, importc: "cairo_image_surface_create_from_png_stream", + dynlib: LIB_CAIRO.} + #* Pattern creation functions +proc pattern_create_rgb*(red, green, blue: float64): PPattern{.cdecl, + importc: "cairo_pattern_create_rgb", dynlib: LIB_CAIRO.} +proc pattern_create_rgba*(red, green, blue, alpha: float64): PPattern{.cdecl, + importc: "cairo_pattern_create_rgba", dynlib: LIB_CAIRO.} +proc pattern_create_for_surface*(surface: PSurface): PPattern{.cdecl, + importc: "cairo_pattern_create_for_surface", dynlib: LIB_CAIRO.} +proc pattern_create_linear*(x0, y0, x1, y1: float64): PPattern{.cdecl, + importc: "cairo_pattern_create_linear", dynlib: LIB_CAIRO.} +proc pattern_create_radial*(cx0, cy0, radius0, cx1, cy1, radius1: float64): PPattern{. + cdecl, importc: "cairo_pattern_create_radial", dynlib: LIB_CAIRO.} +proc pattern_reference*(pattern: PPattern): PPattern{.cdecl, + importc: "cairo_pattern_reference", dynlib: LIB_CAIRO.} +proc pattern_destroy*(pattern: PPattern){.cdecl, + importc: "cairo_pattern_destroy", dynlib: LIB_CAIRO.} +proc pattern_get_reference_count*(pattern: PPattern): int32{.cdecl, + importc: "cairo_pattern_get_reference_count", dynlib: LIB_CAIRO.} +proc pattern_status*(pattern: PPattern): TStatus{.cdecl, + importc: "cairo_pattern_status", dynlib: LIB_CAIRO.} +proc pattern_get_user_data*(pattern: PPattern, key: PUserDataKey): Pointer{. + cdecl, importc: "cairo_pattern_get_user_data", dynlib: LIB_CAIRO.} +proc pattern_set_user_data*(pattern: PPattern, key: PUserDataKey, + user_data: Pointer, destroy: TDestroyFunc): TStatus{. + cdecl, importc: "cairo_pattern_set_user_data", dynlib: LIB_CAIRO.} +proc pattern_get_type*(pattern: PPattern): TPatternType{.cdecl, + importc: "cairo_pattern_get_type", dynlib: LIB_CAIRO.} +proc pattern_add_color_stop_rgb*(pattern: PPattern, + offset, red, green, blue: float64){.cdecl, + importc: "cairo_pattern_add_color_stop_rgb", dynlib: LIB_CAIRO.} +proc pattern_add_color_stop_rgba*(pattern: PPattern, + offset, red, green, blue, alpha: float64){. + cdecl, importc: "cairo_pattern_add_color_stop_rgba", dynlib: LIB_CAIRO.} +proc pattern_set_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl, + importc: "cairo_pattern_set_matrix", dynlib: LIB_CAIRO.} +proc pattern_get_matrix*(pattern: PPattern, matrix: PMatrix){.cdecl, + importc: "cairo_pattern_get_matrix", dynlib: LIB_CAIRO.} +proc pattern_set_extend*(pattern: PPattern, extend: TExtend){.cdecl, + importc: "cairo_pattern_set_extend", dynlib: LIB_CAIRO.} +proc pattern_get_extend*(pattern: PPattern): TExtend{.cdecl, + importc: "cairo_pattern_get_extend", dynlib: LIB_CAIRO.} +proc pattern_set_filter*(pattern: PPattern, filter: TFilter){.cdecl, + importc: "cairo_pattern_set_filter", dynlib: LIB_CAIRO.} +proc pattern_get_filter*(pattern: PPattern): TFilter{.cdecl, + importc: "cairo_pattern_get_filter", dynlib: LIB_CAIRO.} +proc pattern_get_rgba*(pattern: PPattern, red, green, blue, alpha: var float64): TStatus{. + cdecl, importc: "cairo_pattern_get_rgba", dynlib: LIB_CAIRO.} +proc pattern_get_surface*(pattern: PPattern, surface: PPCairoSurface): TStatus{. + cdecl, importc: "cairo_pattern_get_surface", dynlib: LIB_CAIRO.} +proc pattern_get_color_stop_rgba*(pattern: PPattern, index: int32, + offset, red, green, blue, alpha: var float64): TStatus{. + cdecl, importc: "cairo_pattern_get_color_stop_rgba", dynlib: LIB_CAIRO.} +proc pattern_get_color_stop_count*(pattern: PPattern, count: var int32): TStatus{. + cdecl, importc: "cairo_pattern_get_color_stop_count", dynlib: LIB_CAIRO.} +proc pattern_get_linear_points*(pattern: PPattern, x0, y0, x1, y1: var float64): TStatus{. + cdecl, importc: "cairo_pattern_get_linear_points", dynlib: LIB_CAIRO.} +proc pattern_get_radial_circles*(pattern: PPattern, + x0, y0, r0, x1, y1, r1: var float64): TStatus{. + cdecl, importc: "cairo_pattern_get_radial_circles", dynlib: LIB_CAIRO.} + #* Matrix functions +proc matrix_init*(matrix: PMatrix, xx, yx, xy, yy, x0, y0: float64){.cdecl, + importc: "cairo_matrix_init", dynlib: LIB_CAIRO.} +proc matrix_init_identity*(matrix: PMatrix){.cdecl, + importc: "cairo_matrix_init_identity", dynlib: LIB_CAIRO.} +proc matrix_init_translate*(matrix: PMatrix, tx, ty: float64){.cdecl, + importc: "cairo_matrix_init_translate", dynlib: LIB_CAIRO.} +proc matrix_init_scale*(matrix: PMatrix, sx, sy: float64){.cdecl, + importc: "cairo_matrix_init_scale", dynlib: LIB_CAIRO.} +proc matrix_init_rotate*(matrix: PMatrix, radians: float64){.cdecl, + importc: "cairo_matrix_init_rotate", dynlib: LIB_CAIRO.} +proc matrix_translate*(matrix: PMatrix, tx, ty: float64){.cdecl, + importc: "cairo_matrix_translate", dynlib: LIB_CAIRO.} +proc matrix_scale*(matrix: PMatrix, sx, sy: float64){.cdecl, + importc: "cairo_matrix_scale", dynlib: LIB_CAIRO.} +proc matrix_rotate*(matrix: PMatrix, radians: float64){.cdecl, + importc: "cairo_matrix_rotate", dynlib: LIB_CAIRO.} +proc matrix_invert*(matrix: PMatrix): TStatus{.cdecl, + importc: "cairo_matrix_invert", dynlib: LIB_CAIRO.} +proc matrix_multiply*(result, a, b: PMatrix){.cdecl, + importc: "cairo_matrix_multiply", dynlib: LIB_CAIRO.} +proc matrix_transform_distance*(matrix: PMatrix, dx, dy: var float64){.cdecl, + importc: "cairo_matrix_transform_distance", dynlib: LIB_CAIRO.} +proc matrix_transform_point*(matrix: PMatrix, x, y: var float64){.cdecl, + importc: "cairo_matrix_transform_point", dynlib: LIB_CAIRO.} + #* PDF functions +proc pdf_surface_create*(filename: cstring, + width_in_points, height_in_points: float64): PSurface{. + cdecl, importc: "cairo_pdf_surface_create", dynlib: LIB_CAIRO.} +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", dynlib: LIB_CAIRO.} +proc pdf_surface_set_size*(surface: PSurface, + width_in_points, height_in_points: float64){.cdecl, + importc: "cairo_pdf_surface_set_size", dynlib: LIB_CAIRO.} + #* PS functions +proc ps_surface_create*(filename: cstring, + width_in_points, height_in_points: float64): PSurface{. + cdecl, importc: "cairo_ps_surface_create", dynlib: LIB_CAIRO.} +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", dynlib: LIB_CAIRO.} +proc ps_surface_set_size*(surface: PSurface, + width_in_points, height_in_points: float64){.cdecl, + importc: "cairo_ps_surface_set_size", dynlib: LIB_CAIRO.} +proc ps_surface_dsc_comment*(surface: PSurface, comment: cstring){.cdecl, + importc: "cairo_ps_surface_dsc_comment", dynlib: LIB_CAIRO.} +proc ps_surface_dsc_begin_setup*(surface: PSurface){.cdecl, + importc: "cairo_ps_surface_dsc_begin_setup", dynlib: LIB_CAIRO.} +proc ps_surface_dsc_begin_page_setup*(surface: PSurface){.cdecl, + importc: "cairo_ps_surface_dsc_begin_page_setup", dynlib: LIB_CAIRO.} + #* SVG functions +proc svg_surface_create*(filename: cstring, + width_in_points, height_in_points: float64): PSurface{. + cdecl, importc: "cairo_svg_surface_create", dynlib: LIB_CAIRO.} +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", dynlib: LIB_CAIRO.} +proc svg_surface_restrict_to_version*(surface: PSurface, version: TSvgVersion){. + cdecl, importc: "cairo_svg_surface_restrict_to_version", dynlib: LIB_CAIRO.} + #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", dynlib: LIB_CAIRO.} + #* 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", + dynlib: LIB_CAIRO.} +# 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))) diff --git a/lib/newwrap/cairo/cairoft.nim b/lib/newwrap/cairo/cairoft.nim new file mode 100644 index 000000000..e80b9f82c --- /dev/null +++ b/lib/newwrap/cairo/cairoft.nim @@ -0,0 +1,35 @@ +# +# Translation of cairo-ft.h +# by Jeffrey Pohlmeyer +# updated to version 1.4 by Luiz Américo Pereira Câmara 2007 +# + +import + , freetypeh + +#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{.cdecl, + importc: "cairo_ft_font_face_create_for_pattern", dynlib: LIB_CAIRO.} +proc ft_font_options_substitute*(options: PFontOptions, pattern: PFcPattern){. + cdecl, importc: "cairo_ft_font_options_substitute", dynlib: LIB_CAIRO.} +proc ft_font_face_create_for_ft_face*(face: TFT_Face, load_flags: int32): PFontFace{. + cdecl, importc: "cairo_ft_font_face_create_for_ft_face", dynlib: LIB_CAIRO.} +proc ft_scaled_font_lock_face*(scaled_font: PScaledFont): TFT_Face{.cdecl, + importc: "cairo_ft_scaled_font_lock_face", dynlib: LIB_CAIRO.} +proc ft_scaled_font_unlock_face*(scaled_font: PScaledFont){.cdecl, + importc: "cairo_ft_scaled_font_unlock_face", dynlib: LIB_CAIRO.} \ No newline at end of file diff --git a/lib/newwrap/cairo/cairowin32.nim b/lib/newwrap/cairo/cairowin32.nim new file mode 100644 index 000000000..cee034902 --- /dev/null +++ b/lib/newwrap/cairo/cairowin32.nim @@ -0,0 +1,37 @@ +# +# Translation of cairo-win32.h version 1.4 +# by Luiz Américo Pereira Câmara 2007 +# + +import + , 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 diff --git a/lib/newwrap/cairo/cairoxlib.nim b/lib/newwrap/cairo/cairoxlib.nim new file mode 100644 index 000000000..a889d7a9b --- /dev/null +++ b/lib/newwrap/cairo/cairoxlib.nim @@ -0,0 +1,39 @@ +# +# 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 + , x, xlib, xrender + +proc xlib_surface_create*(dpy: PDisplay, drawable: TDrawable, visual: PVisual, + width, height: int32): PSurface{.cdecl, + importc: "cairo_xlib_surface_create", dynlib: LIB_CAIRO.} +proc xlib_surface_create_for_bitmap*(dpy: PDisplay, bitmap: TPixmap, + screen: PScreen, width, height: int32): PSurface{. + cdecl, importc: "cairo_xlib_surface_create_for_bitmap", dynlib: LIB_CAIRO.} +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", + dynlib: LIB_CAIRO.} +proc xlib_surface_get_depth*(surface: PSurface): int32{.cdecl, + importc: "cairo_xlib_surface_get_depth", dynlib: LIB_CAIRO.} +proc xlib_surface_get_display*(surface: PSurface): PDisplay{.cdecl, + importc: "cairo_xlib_surface_get_display", dynlib: LIB_CAIRO.} +proc xlib_surface_get_drawable*(surface: PSurface): TDrawable{.cdecl, + importc: "cairo_xlib_surface_get_drawable", dynlib: LIB_CAIRO.} +proc xlib_surface_get_height*(surface: PSurface): int32{.cdecl, + importc: "cairo_xlib_surface_get_height", dynlib: LIB_CAIRO.} +proc xlib_surface_get_screen*(surface: PSurface): PScreen{.cdecl, + importc: "cairo_xlib_surface_get_screen", dynlib: LIB_CAIRO.} +proc xlib_surface_get_visual*(surface: PSurface): PVisual{.cdecl, + importc: "cairo_xlib_surface_get_visual", dynlib: LIB_CAIRO.} +proc xlib_surface_get_width*(surface: PSurface): int32{.cdecl, + importc: "cairo_xlib_surface_get_width", dynlib: LIB_CAIRO.} +proc xlib_surface_set_size*(surface: PSurface, width, height: int32){.cdecl, + importc: "cairo_xlib_surface_set_size", dynlib: LIB_CAIRO.} +proc xlib_surface_set_drawable*(surface: PSurface, drawable: TDrawable, + width, height: int32){.cdecl, + importc: "cairo_xlib_surface_set_drawable", dynlib: LIB_CAIRO.} +# implementation diff --git a/lib/newwrap/gtk/atk.nim b/lib/newwrap/gtk/atk.nim new file mode 100644 index 000000000..9c0a1cb86 --- /dev/null +++ b/lib/newwrap/gtk/atk.nim @@ -0,0 +1,1305 @@ +{.deadCodeElim: on.} +import + glib2 + +when defined(windows): + const + lib = "libatk-1.0-0.dll" +else: + const + lib = "libatk-1.0.so" +type + PImplementor* = pointer + PAction* = pointer + PComponent* = pointer + PDocument* = pointer + PEditableText* = pointer + PHypertext* = pointer + PImage* = pointer + PSelection* = pointer + PStreamableContent* = pointer + PTable* = pointer + PText* = pointer + PValue* = pointer + PRelationSet* = ptr TRelationSet + PStateSet* = ptr TStateSet + PAttributeSet* = ptr TAttributeSet + PCoordType* = ptr TCoordType + TCoordType* = enum + XY_SCREEN, XY_WINDOW + PRole* = ptr TRole + TRole* = enum + ROLE_INVALID, ROLE_ACCEL_LABEL, ROLE_ALERT, ROLE_ANIMATION, ROLE_ARROW, + ROLE_CALENDAR, ROLE_CANVAS, ROLE_CHECK_BOX, ROLE_CHECK_MENU_ITEM, + ROLE_COLOR_CHOOSER, ROLE_COLUMN_HEADER, ROLE_COMBO_BOX, ROLE_DATE_EDITOR, + ROLE_DESKTOP_ICON, ROLE_DESKTOP_FRAME, ROLE_DIAL, ROLE_DIALOG, + ROLE_DIRECTORY_PANE, ROLE_DRAWING_AREA, ROLE_FILE_CHOOSER, ROLE_FILLER, + ROLE_FONT_CHOOSER, ROLE_FRAME, ROLE_GLASS_PANE, ROLE_HTML_CONTAINER, + ROLE_ICON, ROLE_IMAGE, ROLE_INTERNAL_FRAME, ROLE_LABEL, ROLE_LAYERED_PANE, + ROLE_LIST, ROLE_LIST_ITEM, ROLE_MENU, ROLE_MENU_BAR, ROLE_MENU_ITEM, + ROLE_OPTION_PANE, ROLE_PAGE_TAB, ROLE_PAGE_TAB_LIST, ROLE_PANEL, + ROLE_PASSWORD_TEXT, ROLE_POPUP_MENU, ROLE_PROGRESS_BAR, ROLE_PUSH_BUTTON, + ROLE_RADIO_BUTTON, ROLE_RADIO_MENU_ITEM, ROLE_ROOT_PANE, ROLE_ROW_HEADER, + ROLE_SCROLL_BAR, ROLE_SCROLL_PANE, ROLE_SEPARATOR, ROLE_SLIDER, + ROLE_SPLIT_PANE, ROLE_SPIN_BUTTON, ROLE_STATUSBAR, ROLE_TABLE, + ROLE_TABLE_CELL, ROLE_TABLE_COLUMN_HEADER, ROLE_TABLE_ROW_HEADER, + ROLE_TEAR_OFF_MENU_ITEM, ROLE_TERMINAL, ROLE_TEXT, ROLE_TOGGLE_BUTTON, + ROLE_TOOL_BAR, ROLE_TOOL_TIP, ROLE_TREE, ROLE_TREE_TABLE, ROLE_UNKNOWN, + ROLE_VIEWPORT, ROLE_WINDOW, ROLE_LAST_DEFINED + PLayer* = ptr TLayer + TLayer* = enum + LAYER_INVALID, LAYER_BACKGROUND, LAYER_CANVAS, LAYER_WIDGET, LAYER_MDI, + LAYER_POPUP, LAYER_OVERLAY + PPropertyValues* = ptr TPropertyValues + TPropertyValues*{.final, pure.} = object + property_name*: cstring + old_value*: TGValue + new_value*: TGValue + + TFunction* = proc (data: gpointer): gboolean{.cdecl.} + PObject* = ptr TObject + PPAtkObject* = ptr PObject + TObject* = object of TGObject + description*: cstring + name*: cstring + accessible_parent*: PObject + role*: TRole + relation_set*: PRelationSet + layer*: TLayer + + TPropertyChangeHandler* = proc (para1: PObject, para2: PPropertyValues){.cdecl.} + PObjectClass* = ptr TObjectClass + TObjectClass* = object of TGObjectClass + get_name*: proc (accessible: PObject): cstring{.cdecl.} + get_description*: proc (accessible: PObject): cstring{.cdecl.} + get_parent*: proc (accessible: PObject): PObject{.cdecl.} + get_n_children*: proc (accessible: PObject): gint{.cdecl.} + ref_child*: proc (accessible: PObject, i: gint): PObject{.cdecl.} + get_index_in_parent*: proc (accessible: PObject): gint{.cdecl.} + ref_relation_set*: proc (accessible: PObject): PRelationSet{.cdecl.} + get_role*: proc (accessible: PObject): TRole{.cdecl.} + get_layer*: proc (accessible: PObject): TLayer{.cdecl.} + get_mdi_zorder*: proc (accessible: PObject): gint{.cdecl.} + ref_state_set*: proc (accessible: PObject): PStateSet{.cdecl.} + set_name*: proc (accessible: PObject, name: cstring){.cdecl.} + set_description*: proc (accessible: PObject, description: cstring){.cdecl.} + set_parent*: proc (accessible: PObject, parent: PObject){.cdecl.} + set_role*: proc (accessible: PObject, role: TRole){.cdecl.} + connect_property_change_handler*: proc (accessible: PObject, + handler: TPropertyChangeHandler): guint{.cdecl.} + remove_property_change_handler*: proc (accessible: PObject, + handler_id: guint){.cdecl.} + initialize*: proc (accessible: PObject, data: gpointer){.cdecl.} + children_changed*: proc (accessible: PObject, change_index: guint, + changed_child: gpointer){.cdecl.} + focus_event*: proc (accessible: PObject, focus_in: gboolean){.cdecl.} + property_change*: proc (accessible: PObject, values: PPropertyValues){.cdecl.} + state_change*: proc (accessible: PObject, name: cstring, state_set: gboolean){. + cdecl.} + visible_data_changed*: proc (accessible: PObject){.cdecl.} + pad1*: TFunction + pad2*: TFunction + pad3*: TFunction + pad4*: TFunction + + PImplementorIface* = ptr TImplementorIface + TImplementorIface* = object of TGTypeInterface + ref_accessible*: proc (implementor: PImplementor): PObject{.cdecl.} + + PActionIface* = ptr TActionIface + TActionIface* = object of TGTypeInterface + do_action*: proc (action: PAction, i: gint): gboolean{.cdecl.} + get_n_actions*: proc (action: PAction): gint{.cdecl.} + get_description*: proc (action: PAction, i: gint): cstring{.cdecl.} + get_name*: proc (action: PAction, i: gint): cstring{.cdecl.} + get_keybinding*: proc (action: PAction, i: gint): cstring{.cdecl.} + set_description*: proc (action: PAction, i: gint, desc: cstring): gboolean{. + cdecl.} + pad1*: TFunction + pad2*: TFunction + + TFocusHandler* = proc (para1: PObject, para2: gboolean){.cdecl.} + PComponentIface* = ptr TComponentIface + TComponentIface* = object of TGTypeInterface + add_focus_handler*: proc (component: PComponent, handler: TFocusHandler): guint{. + cdecl.} + contains*: proc (component: PComponent, x: gint, y: gint, + coord_type: TCoordType): gboolean{.cdecl.} + ref_accessible_at_point*: proc (component: PComponent, x: gint, y: gint, + coord_type: TCoordType): PObject{.cdecl.} + get_extents*: proc (component: PComponent, x: Pgint, y: Pgint, width: Pgint, + height: Pgint, coord_type: TCoordType){.cdecl.} + get_position*: proc (component: PComponent, x: Pgint, y: Pgint, + coord_type: TCoordType){.cdecl.} + get_size*: proc (component: PComponent, width: Pgint, height: Pgint){.cdecl.} + grab_focus*: proc (component: PComponent): gboolean{.cdecl.} + remove_focus_handler*: proc (component: PComponent, handler_id: guint){. + cdecl.} + set_extents*: proc (component: PComponent, x: gint, y: gint, width: gint, + height: gint, coord_type: TCoordType): gboolean{.cdecl.} + set_position*: proc (component: PComponent, x: gint, y: gint, + coord_type: TCoordType): gboolean{.cdecl.} + set_size*: proc (component: PComponent, width: gint, height: gint): gboolean{. + cdecl.} + get_layer*: proc (component: PComponent): TLayer{.cdecl.} + get_mdi_zorder*: proc (component: PComponent): gint{.cdecl.} + pad1*: TFunction + pad2*: TFunction + + PDocumentIface* = ptr TDocumentIface + TDocumentIface* = object of TGTypeInterface + get_document_type*: proc (document: PDocument): cstring{.cdecl.} + get_document*: proc (document: PDocument): gpointer{.cdecl.} + pad1*: TFunction + pad2*: TFunction + pad3*: TFunction + pad4*: TFunction + pad5*: TFunction + pad6*: TFunction + pad7*: TFunction + pad8*: TFunction + + PEditableTextIface* = ptr TEditableTextIface + TEditableTextIface* = object of TGTypeInterface + set_run_attributes*: proc (text: PEditableText, attrib_set: PAttributeSet, + start_offset: gint, end_offset: gint): gboolean{. + cdecl.} + set_text_contents*: proc (text: PEditableText, `string`: cstring){.cdecl.} + insert_text*: proc (text: PEditableText, `string`: cstring, length: gint, + position: Pgint){.cdecl.} + copy_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){. + cdecl.} + cut_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){.cdecl.} + delete_text*: proc (text: PEditableText, start_pos: gint, end_pos: gint){. + cdecl.} + paste_text*: proc (text: PEditableText, position: gint){.cdecl.} + pad1*: TFunction + pad2*: TFunction + + PGObjectAccessible* = ptr TGObjectAccessible + TGObjectAccessible* = object of TObject + PGObjectAccessibleClass* = ptr TGObjectAccessibleClass + TGObjectAccessibleClass* = object of TObjectClass + pad5*: TFunction + pad6*: TFunction + + PHyperlink* = ptr THyperlink + THyperlink* = object of TGObject + PHyperlinkClass* = ptr THyperlinkClass + THyperlinkClass* = object of TGObjectClass + get_uri*: proc (link: PHyperlink, i: gint): cstring{.cdecl.} + get_object*: proc (link: PHyperlink, i: gint): PObject{.cdecl.} + get_end_index*: proc (link: PHyperlink): gint{.cdecl.} + get_start_index*: proc (link: PHyperlink): gint{.cdecl.} + is_valid*: proc (link: PHyperlink): gboolean{.cdecl.} + get_n_anchors*: proc (link: PHyperlink): gint{.cdecl.} + pad7*: TFunction + pad8*: TFunction + pad9*: TFunction + pad10*: TFunction + + PHypertextIface* = ptr THypertextIface + THypertextIface* = object of TGTypeInterface + get_link*: proc (hypertext: PHypertext, link_index: gint): PHyperlink{.cdecl.} + get_n_links*: proc (hypertext: PHypertext): gint{.cdecl.} + get_link_index*: proc (hypertext: PHypertext, char_index: gint): gint{.cdecl.} + pad11*: TFunction + pad12*: TFunction + pad13*: TFunction + pad14*: TFunction + + PImageIface* = ptr TImageIface + TImageIface* = object of TGTypeInterface + get_image_position*: proc (image: PImage, x: Pgint, y: Pgint, + coord_type: TCoordType){.cdecl.} + get_image_description*: proc (image: PImage): cstring{.cdecl.} + get_image_size*: proc (image: PImage, width: Pgint, height: Pgint){.cdecl.} + set_image_description*: proc (image: PImage, description: cstring): gboolean{. + cdecl.} + pad15*: TFunction + pad16*: TFunction + + PObjectFactory* = ptr TObjectFactory + TObjectFactory* = object of TGObject + PObjectFactoryClass* = ptr TObjectFactoryClass + TObjectFactoryClass* = object of TGObjectClass + create_accessible*: proc (obj: PGObject): PObject{.cdecl.} + invalidate*: proc (factory: PObjectFactory){.cdecl.} + get_accessible_type*: proc (): GType{.cdecl.} + pad17*: TFunction + pad18*: TFunction + + PRegistry* = ptr TRegistry + TRegistry* = object of TGObject + factory_type_registry*: PGHashTable + factory_singleton_cache*: PGHashTable + + PRegistryClass* = ptr TRegistryClass + TRegistryClass* = object of TGObjectClass + PRelationType* = ptr TRelationType + TRelationType* = enum + RELATION_NULL, RELATION_CONTROLLED_BY, RELATION_CONTROLLER_FOR, + RELATION_LABEL_FOR, RELATION_LABELLED_BY, RELATION_MEMBER_OF, + RELATION_NODE_CHILD_OF, RELATION_LAST_DEFINED + PRelation* = ptr TRelation + PGPtrArray = pointer + TRelation* = object of TGObject + target*: PGPtrArray + relationship*: TRelationType + + PRelationClass* = ptr TRelationClass + TRelationClass* = object of TGObjectClass + TRelationSet* = object of TGObject + relations*: PGPtrArray + + PRelationSetClass* = ptr TRelationSetClass + TRelationSetClass* = object of TGObjectClass + pad19*: TFunction + pad20*: TFunction + + PSelectionIface* = ptr TSelectionIface + TSelectionIface* = object of TGTypeInterface + add_selection*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} + clear_selection*: proc (selection: PSelection): gboolean{.cdecl.} + ref_selection*: proc (selection: PSelection, i: gint): PObject{.cdecl.} + get_selection_count*: proc (selection: PSelection): gint{.cdecl.} + is_child_selected*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} + remove_selection*: proc (selection: PSelection, i: gint): gboolean{.cdecl.} + select_all_selection*: proc (selection: PSelection): gboolean{.cdecl.} + selection_changed*: proc (selection: PSelection){.cdecl.} + pad1*: TFunction + pad2*: TFunction + + PStateType* = ptr TStateType + TStateType* = enum + STATE_INVALID, STATE_ACTIVE, STATE_ARMED, STATE_BUSY, STATE_CHECKED, + STATE_DEFUNCT, STATE_EDITABLE, STATE_ENABLED, STATE_EXPANDABLE, + STATE_EXPANDED, STATE_FOCUSABLE, STATE_FOCUSED, STATE_HORIZONTAL, + STATE_ICONIFIED, STATE_MODAL, STATE_MULTI_LINE, STATE_MULTISELECTABLE, + STATE_OPAQUE, STATE_PRESSED, STATE_RESIZABLE, STATE_SELECTABLE, + STATE_SELECTED, STATE_SENSITIVE, STATE_SHOWING, STATE_SINGLE_LINE, + STATE_STALE, STATE_TRANSIENT, STATE_VERTICAL, STATE_VISIBLE, + STATE_LAST_DEFINED + PState* = ptr TState + TState* = guint64 + TStateSet* = object of TGObject + PStateSetClass* = ptr TStateSetClass + TStateSetClass* = object of TGObjectClass + PStreamableContentIface* = ptr TStreamableContentIface + TStreamableContentIface* = object of TGTypeInterface + get_n_mime_types*: proc (streamable: PStreamableContent): gint{.cdecl.} + get_mime_type*: proc (streamable: PStreamableContent, i: gint): cstring{. + cdecl.} + get_stream*: proc (streamable: PStreamableContent, mime_type: cstring): PGIOChannel{. + cdecl.} + pad21*: TFunction + pad22*: TFunction + pad23*: TFunction + pad24*: TFunction + + PTableIface* = ptr TTableIface + TTableIface* = object of TGTypeInterface + ref_at*: proc (table: PTable, row: gint, column: gint): PObject{.cdecl.} + get_index_at*: proc (table: PTable, row: gint, column: gint): gint{.cdecl.} + get_column_at_index*: proc (table: PTable, index: gint): gint{.cdecl.} + get_row_at_index*: proc (table: PTable, index: gint): gint{.cdecl.} + get_n_columns*: proc (table: PTable): gint{.cdecl.} + get_n_rows*: proc (table: PTable): gint{.cdecl.} + get_column_extent_at*: proc (table: PTable, row: gint, column: gint): gint{. + cdecl.} + get_row_extent_at*: proc (table: PTable, row: gint, column: gint): gint{. + cdecl.} + get_caption*: proc (table: PTable): PObject{.cdecl.} + get_column_description*: proc (table: PTable, column: gint): cstring{.cdecl.} + get_column_header*: proc (table: PTable, column: gint): PObject{.cdecl.} + get_row_description*: proc (table: PTable, row: gint): cstring{.cdecl.} + get_row_header*: proc (table: PTable, row: gint): PObject{.cdecl.} + get_summary*: proc (table: PTable): PObject{.cdecl.} + set_caption*: proc (table: PTable, caption: PObject){.cdecl.} + set_column_description*: proc (table: PTable, column: gint, + description: cstring){.cdecl.} + set_column_header*: proc (table: PTable, column: gint, header: PObject){. + cdecl.} + set_row_description*: proc (table: PTable, row: gint, description: cstring){. + cdecl.} + set_row_header*: proc (table: PTable, row: gint, header: PObject){.cdecl.} + set_summary*: proc (table: PTable, accessible: PObject){.cdecl.} + get_selected_columns*: proc (table: PTable, selected: PPgint): gint{.cdecl.} + get_selected_rows*: proc (table: PTable, selected: PPgint): gint{.cdecl.} + is_column_selected*: proc (table: PTable, column: gint): gboolean{.cdecl.} + is_row_selected*: proc (table: PTable, row: gint): gboolean{.cdecl.} + is_selected*: proc (table: PTable, row: gint, column: gint): gboolean{.cdecl.} + add_row_selection*: proc (table: PTable, row: gint): gboolean{.cdecl.} + remove_row_selection*: proc (table: PTable, row: gint): gboolean{.cdecl.} + add_column_selection*: proc (table: PTable, column: gint): gboolean{.cdecl.} + remove_column_selection*: proc (table: PTable, column: gint): gboolean{. + cdecl.} + row_inserted*: proc (table: PTable, row: gint, num_inserted: gint){.cdecl.} + column_inserted*: proc (table: PTable, column: gint, num_inserted: gint){. + cdecl.} + row_deleted*: proc (table: PTable, row: gint, num_deleted: gint){.cdecl.} + column_deleted*: proc (table: PTable, column: gint, num_deleted: gint){. + cdecl.} + row_reordered*: proc (table: PTable){.cdecl.} + column_reordered*: proc (table: PTable){.cdecl.} + model_changed*: proc (table: PTable){.cdecl.} + pad25*: TFunction + pad26*: TFunction + pad27*: TFunction + pad28*: TFunction + + TAttributeSet* = TGSList + PAttribute* = ptr TAttribute + TAttribute*{.final, pure.} = object + name*: cstring + value*: cstring + + PTextAttribute* = ptr TTextAttribute + TTextAttribute* = enum + TEXT_ATTR_INVALID, TEXT_ATTR_LEFT_MARGIN, TEXT_ATTR_RIGHT_MARGIN, + TEXT_ATTR_INDENT, TEXT_ATTR_INVISIBLE, TEXT_ATTR_EDITABLE, + TEXT_ATTR_PIXELS_ABOVE_LINES, TEXT_ATTR_PIXELS_BELOW_LINES, + TEXT_ATTR_PIXELS_INSIDE_WRAP, TEXT_ATTR_BG_FULL_HEIGHT, TEXT_ATTR_RISE, + TEXT_ATTR_UNDERLINE, TEXT_ATTR_STRIKETHROUGH, TEXT_ATTR_SIZE, + TEXT_ATTR_SCALE, TEXT_ATTR_WEIGHT, TEXT_ATTR_LANGUAGE, + TEXT_ATTR_FAMILY_NAME, TEXT_ATTR_BG_COLOR, TEXT_ATTR_FG_COLOR, + TEXT_ATTR_BG_STIPPLE, TEXT_ATTR_FG_STIPPLE, TEXT_ATTR_WRAP_MODE, + TEXT_ATTR_DIRECTION, TEXT_ATTR_JUSTIFICATION, TEXT_ATTR_STRETCH, + TEXT_ATTR_VARIANT, TEXT_ATTR_STYLE, TEXT_ATTR_LAST_DEFINED + PTextBoundary* = ptr TTextBoundary + TTextBoundary* = enum + TEXT_BOUNDARY_CHAR, TEXT_BOUNDARY_WORD_START, TEXT_BOUNDARY_WORD_END, + TEXT_BOUNDARY_SENTENCE_START, TEXT_BOUNDARY_SENTENCE_END, + TEXT_BOUNDARY_LINE_START, TEXT_BOUNDARY_LINE_END + PTextIface* = ptr TTextIface + TTextIface* = object of TGTypeInterface + get_text*: proc (text: PText, start_offset: gint, end_offset: gint): cstring{. + cdecl.} + get_text_after_offset*: proc (text: PText, offset: gint, + boundary_type: TTextBoundary, + start_offset: Pgint, end_offset: Pgint): cstring{. + cdecl.} + get_text_at_offset*: proc (text: PText, offset: gint, + boundary_type: TTextBoundary, + start_offset: Pgint, end_offset: Pgint): cstring{. + cdecl.} + get_character_at_offset*: proc (text: PText, offset: gint): gunichar{.cdecl.} + get_text_before_offset*: proc (text: PText, offset: gint, + boundary_type: TTextBoundary, + start_offset: Pgint, end_offset: Pgint): cstring{. + cdecl.} + get_caret_offset*: proc (text: PText): gint{.cdecl.} + get_run_attributes*: proc (text: PText, offset: gint, start_offset: Pgint, + end_offset: Pgint): PAttributeSet{.cdecl.} + get_default_attributes*: proc (text: PText): PAttributeSet{.cdecl.} + get_character_extents*: proc (text: PText, offset: gint, x: Pgint, y: Pgint, + width: Pgint, height: Pgint, + coords: TCoordType){.cdecl.} + get_character_count*: proc (text: PText): gint{.cdecl.} + get_offset_at_point*: proc (text: PText, x: gint, y: gint, + coords: TCoordType): gint{.cdecl.} + get_n_selections*: proc (text: PText): gint{.cdecl.} + get_selection*: proc (text: PText, selection_num: gint, start_offset: Pgint, + end_offset: Pgint): cstring{.cdecl.} + add_selection*: proc (text: PText, start_offset: gint, end_offset: gint): gboolean{. + cdecl.} + remove_selection*: proc (text: PText, selection_num: gint): gboolean{.cdecl.} + set_selection*: proc (text: PText, selection_num: gint, start_offset: gint, + end_offset: gint): gboolean{.cdecl.} + set_caret_offset*: proc (text: PText, offset: gint): gboolean{.cdecl.} + text_changed*: proc (text: PText, position: gint, length: gint){.cdecl.} + text_caret_moved*: proc (text: PText, location: gint){.cdecl.} + text_selection_changed*: proc (text: PText){.cdecl.} + pad29*: TFunction + pad30*: TFunction + pad31*: TFunction + pad32*: TFunction + + TEventListener* = proc (para1: PObject){.cdecl.} + TEventListenerInitProc* = proc () + TEventListenerInit* = proc (para1: TEventListenerInitProc){.cdecl.} + PKeyEventStruct* = ptr TKeyEventStruct + TKeyEventStruct*{.final, pure.} = object + `type`*: gint + state*: guint + keyval*: guint + length*: gint + string*: cstring + keycode*: guint16 + timestamp*: guint32 + + TKeySnoopFunc* = proc (event: PKeyEventStruct, func_data: gpointer): gint{. + cdecl.} + PKeyEventType* = ptr TKeyEventType + TKeyEventType* = enum + KEY_EVENT_PRESS, KEY_EVENT_RELEASE, KEY_EVENT_LAST_DEFINED + PUtil* = ptr TUtil + TUtil* = object of TGObject + PUtilClass* = ptr TUtilClass + TUtilClass* = object of TGObjectClass + add_global_event_listener*: proc (listener: TGSignalEmissionHook, + event_type: cstring): guint{.cdecl.} + remove_global_event_listener*: proc (listener_id: guint){.cdecl.} + add_key_event_listener*: proc (listener: TKeySnoopFunc, data: gpointer): guint{. + cdecl.} + remove_key_event_listener*: proc (listener_id: guint){.cdecl.} + get_root*: proc (): PObject{.cdecl.} + get_toolkit_name*: proc (): cstring{.cdecl.} + get_toolkit_version*: proc (): cstring{.cdecl.} + + PValueIface* = ptr TValueIface + TValueIface* = object of TGTypeInterface + get_current_value*: proc (obj: PValue, value: PGValue){.cdecl.} + get_maximum_value*: proc (obj: PValue, value: PGValue){.cdecl.} + get_minimum_value*: proc (obj: PValue, value: PGValue){.cdecl.} + set_current_value*: proc (obj: PValue, value: PGValue): gboolean{.cdecl.} + pad33*: TFunction + pad34*: TFunction + + +proc role_register*(name: cstring): TRole{.cdecl, dynlib: lib, + importc: "atk_role_register".} +proc object_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_object_get_type".} +proc TYPE_OBJECT*(): GType +proc OBJECT*(obj: pointer): PObject +proc OBJECT_CLASS*(klass: pointer): PObjectClass +proc IS_OBJECT*(obj: pointer): bool +proc IS_OBJECT_CLASS*(klass: pointer): bool +proc OBJECT_GET_CLASS*(obj: pointer): PObjectClass +proc TYPE_IMPLEMENTOR*(): GType +proc IS_IMPLEMENTOR*(obj: pointer): bool +proc IMPLEMENTOR*(obj: pointer): PImplementor +proc IMPLEMENTOR_GET_IFACE*(obj: pointer): PImplementorIface +proc implementor_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_implementor_get_type".} +proc implementor_ref_accessible*(implementor: PImplementor): PObject{.cdecl, + dynlib: lib, importc: "atk_implementor_ref_accessible".} +proc object_get_name*(accessible: PObject): cstring{.cdecl, dynlib: lib, + importc: "atk_object_get_name".} +proc object_get_description*(accessible: PObject): cstring{.cdecl, dynlib: lib, + importc: "atk_object_get_description".} +proc object_get_parent*(accessible: PObject): PObject{.cdecl, dynlib: lib, + importc: "atk_object_get_parent".} +proc object_get_n_accessible_children*(accessible: PObject): gint{.cdecl, + dynlib: lib, importc: "atk_object_get_n_accessible_children".} +proc object_ref_accessible_child*(accessible: PObject, i: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_object_ref_accessible_child".} +proc object_ref_relation_set*(accessible: PObject): PRelationSet{.cdecl, + dynlib: lib, importc: "atk_object_ref_relation_set".} +proc object_get_role*(accessible: PObject): TRole{.cdecl, dynlib: lib, + importc: "atk_object_get_role".} +proc object_get_layer*(accessible: PObject): TLayer{.cdecl, dynlib: lib, + importc: "atk_object_get_layer".} +proc object_get_mdi_zorder*(accessible: PObject): gint{.cdecl, dynlib: lib, + importc: "atk_object_get_mdi_zorder".} +proc object_ref_state_set*(accessible: PObject): PStateSet{.cdecl, dynlib: lib, + importc: "atk_object_ref_state_set".} +proc object_get_index_in_parent*(accessible: PObject): gint{.cdecl, dynlib: lib, + importc: "atk_object_get_index_in_parent".} +proc object_set_name*(accessible: PObject, name: cstring){.cdecl, dynlib: lib, + importc: "atk_object_set_name".} +proc object_set_description*(accessible: PObject, description: cstring){.cdecl, + dynlib: lib, importc: "atk_object_set_description".} +proc object_set_parent*(accessible: PObject, parent: PObject){.cdecl, + dynlib: lib, importc: "atk_object_set_parent".} +proc object_set_role*(accessible: PObject, role: TRole){.cdecl, dynlib: lib, + importc: "atk_object_set_role".} +proc object_connect_property_change_handler*(accessible: PObject, + handler: TPropertyChangeHandler): guint{.cdecl, dynlib: lib, + importc: "atk_object_connect_property_change_handler".} +proc object_remove_property_change_handler*(accessible: PObject, + handler_id: guint){.cdecl, dynlib: lib, + importc: "atk_object_remove_property_change_handler".} +proc object_notify_state_change*(accessible: PObject, state: TState, + value: gboolean){.cdecl, dynlib: lib, + importc: "atk_object_notify_state_change".} +proc object_initialize*(accessible: PObject, data: gpointer){.cdecl, + dynlib: lib, importc: "atk_object_initialize".} +proc role_get_name*(role: TRole): cstring{.cdecl, dynlib: lib, + importc: "atk_role_get_name".} +proc role_for_name*(name: cstring): TRole{.cdecl, dynlib: lib, + importc: "atk_role_for_name".} +proc TYPE_ACTION*(): GType +proc IS_ACTION*(obj: pointer): bool +proc ACTION*(obj: pointer): PAction +proc ACTION_GET_IFACE*(obj: pointer): PActionIface +proc action_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_action_get_type".} +proc action_do_action*(action: PAction, i: gint): gboolean{.cdecl, dynlib: lib, + importc: "atk_action_do_action".} +proc action_get_n_actions*(action: PAction): gint{.cdecl, dynlib: lib, + importc: "atk_action_get_n_actions".} +proc action_get_description*(action: PAction, i: gint): cstring{.cdecl, + dynlib: lib, importc: "atk_action_get_description".} +proc action_get_name*(action: PAction, i: gint): cstring{.cdecl, dynlib: lib, + importc: "atk_action_get_name".} +proc action_get_keybinding*(action: PAction, i: gint): cstring{.cdecl, + dynlib: lib, importc: "atk_action_get_keybinding".} +proc action_set_description*(action: PAction, i: gint, desc: cstring): gboolean{. + cdecl, dynlib: lib, importc: "atk_action_set_description".} +proc TYPE_COMPONENT*(): GType +proc IS_COMPONENT*(obj: pointer): bool +proc COMPONENT*(obj: pointer): PComponent +proc COMPONENT_GET_IFACE*(obj: pointer): PComponentIface +proc component_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_component_get_type".} +proc component_add_focus_handler*(component: PComponent, handler: TFocusHandler): guint{. + cdecl, dynlib: lib, importc: "atk_component_add_focus_handler".} +proc component_contains*(component: PComponent, x, y: gint, + coord_type: TCoordType): gboolean{.cdecl, dynlib: lib, + importc: "atk_component_contains".} +proc component_ref_accessible_at_point*(component: PComponent, x, y: gint, + coord_type: TCoordType): PObject{.cdecl, + dynlib: lib, importc: "atk_component_ref_accessible_at_point".} +proc component_get_extents*(component: PComponent, x, y, width, height: Pgint, + coord_type: TCoordType){.cdecl, dynlib: lib, + importc: "atk_component_get_extents".} +proc component_get_position*(component: PComponent, x: Pgint, y: Pgint, + coord_type: TCoordType){.cdecl, dynlib: lib, + importc: "atk_component_get_position".} +proc component_get_size*(component: PComponent, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "atk_component_get_size".} +proc component_get_layer*(component: PComponent): TLayer{.cdecl, dynlib: lib, + importc: "atk_component_get_layer".} +proc component_get_mdi_zorder*(component: PComponent): gint{.cdecl, dynlib: lib, + importc: "atk_component_get_mdi_zorder".} +proc component_grab_focus*(component: PComponent): gboolean{.cdecl, dynlib: lib, + importc: "atk_component_grab_focus".} +proc component_remove_focus_handler*(component: PComponent, handler_id: guint){. + cdecl, dynlib: lib, importc: "atk_component_remove_focus_handler".} +proc component_set_extents*(component: PComponent, x: gint, y: gint, + width: gint, height: gint, coord_type: TCoordType): gboolean{. + cdecl, dynlib: lib, importc: "atk_component_set_extents".} +proc component_set_position*(component: PComponent, x: gint, y: gint, + coord_type: TCoordType): gboolean{.cdecl, + dynlib: lib, importc: "atk_component_set_position".} +proc component_set_size*(component: PComponent, width: gint, height: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_component_set_size".} +proc TYPE_DOCUMENT*(): GType +proc IS_DOCUMENT*(obj: pointer): bool +proc DOCUMENT*(obj: pointer): PDocument +proc DOCUMENT_GET_IFACE*(obj: pointer): PDocumentIface +proc document_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_document_get_type".} +proc document_get_document_type*(document: PDocument): cstring{.cdecl, + dynlib: lib, importc: "atk_document_get_document_type".} +proc document_get_document*(document: PDocument): gpointer{.cdecl, dynlib: lib, + importc: "atk_document_get_document".} +proc TYPE_EDITABLE_TEXT*(): GType +proc IS_EDITABLE_TEXT*(obj: pointer): bool +proc EDITABLE_TEXT*(obj: pointer): PEditableText +proc EDITABLE_TEXT_GET_IFACE*(obj: pointer): PEditableTextIface +proc editable_text_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_editable_text_get_type".} +proc editable_text_set_run_attributes*(text: PEditableText, + attrib_set: PAttributeSet, + start_offset: gint, end_offset: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_editable_text_set_run_attributes".} +proc editable_text_set_text_contents*(text: PEditableText, string: cstring){. + cdecl, dynlib: lib, importc: "atk_editable_text_set_text_contents".} +proc editable_text_insert_text*(text: PEditableText, `string`: cstring, + length: gint, position: Pgint){.cdecl, + dynlib: lib, importc: "atk_editable_text_insert_text".} +proc editable_text_copy_text*(text: PEditableText, start_pos: gint, + end_pos: gint){.cdecl, dynlib: lib, + importc: "atk_editable_text_copy_text".} +proc editable_text_cut_text*(text: PEditableText, start_pos: gint, end_pos: gint){. + cdecl, dynlib: lib, importc: "atk_editable_text_cut_text".} +proc editable_text_delete_text*(text: PEditableText, start_pos: gint, + end_pos: gint){.cdecl, dynlib: lib, + importc: "atk_editable_text_delete_text".} +proc editable_text_paste_text*(text: PEditableText, position: gint){.cdecl, + dynlib: lib, importc: "atk_editable_text_paste_text".} +proc TYPE_GOBJECT_ACCESSIBLE*(): GType +proc GOBJECT_ACCESSIBLE*(obj: pointer): PGObjectAccessible +proc GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PGObjectAccessibleClass +proc IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool +proc IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool +proc GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PGObjectAccessibleClass +proc gobject_accessible_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_gobject_accessible_get_type".} +proc gobject_accessible_for_object*(obj: PGObject): PObject{.cdecl, dynlib: lib, + importc: "atk_gobject_accessible_for_object".} +proc gobject_accessible_get_object*(obj: PGObjectAccessible): PGObject{.cdecl, + dynlib: lib, importc: "atk_gobject_accessible_get_object".} +proc TYPE_HYPERLINK*(): GType +proc HYPERLINK*(obj: pointer): PHyperlink +proc HYPERLINK_CLASS*(klass: pointer): PHyperlinkClass +proc IS_HYPERLINK*(obj: pointer): bool +proc IS_HYPERLINK_CLASS*(klass: pointer): bool +proc HYPERLINK_GET_CLASS*(obj: pointer): PHyperlinkClass +proc hyperlink_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_hyperlink_get_type".} +proc hyperlink_get_uri*(link: PHyperlink, i: gint): cstring{.cdecl, dynlib: lib, + importc: "atk_hyperlink_get_uri".} +proc hyperlink_get_object*(link: PHyperlink, i: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_hyperlink_get_object".} +proc hyperlink_get_end_index*(link: PHyperlink): gint{.cdecl, dynlib: lib, + importc: "atk_hyperlink_get_end_index".} +proc hyperlink_get_start_index*(link: PHyperlink): gint{.cdecl, dynlib: lib, + importc: "atk_hyperlink_get_start_index".} +proc hyperlink_is_valid*(link: PHyperlink): gboolean{.cdecl, dynlib: lib, + importc: "atk_hyperlink_is_valid".} +proc hyperlink_get_n_anchors*(link: PHyperlink): gint{.cdecl, dynlib: lib, + importc: "atk_hyperlink_get_n_anchors".} +proc TYPE_HYPERTEXT*(): GType +proc IS_HYPERTEXT*(obj: pointer): bool +proc HYPERTEXT*(obj: pointer): PHypertext +proc HYPERTEXT_GET_IFACE*(obj: pointer): PHypertextIface +proc hypertext_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_hypertext_get_type".} +proc hypertext_get_link*(hypertext: PHypertext, link_index: gint): PHyperlink{. + cdecl, dynlib: lib, importc: "atk_hypertext_get_link".} +proc hypertext_get_n_links*(hypertext: PHypertext): gint{.cdecl, dynlib: lib, + importc: "atk_hypertext_get_n_links".} +proc hypertext_get_link_index*(hypertext: PHypertext, char_index: gint): gint{. + cdecl, dynlib: lib, importc: "atk_hypertext_get_link_index".} +proc TYPE_IMAGE*(): GType +proc IS_IMAGE*(obj: pointer): bool +proc IMAGE*(obj: pointer): PImage +proc IMAGE_GET_IFACE*(obj: pointer): PImageIface +proc image_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_image_get_type".} +proc image_get_image_description*(image: PImage): cstring{.cdecl, dynlib: lib, + importc: "atk_image_get_image_description".} +proc image_get_image_size*(image: PImage, width: Pgint, height: Pgint){.cdecl, + dynlib: lib, importc: "atk_image_get_image_size".} +proc image_set_image_description*(image: PImage, description: cstring): gboolean{. + cdecl, dynlib: lib, importc: "atk_image_set_image_description".} +proc image_get_image_position*(image: PImage, x: Pgint, y: Pgint, + coord_type: TCoordType){.cdecl, dynlib: lib, + importc: "atk_image_get_image_position".} +proc TYPE_OBJECT_FACTORY*(): GType +proc OBJECT_FACTORY*(obj: pointer): PObjectFactory +proc OBJECT_FACTORY_CLASS*(klass: pointer): PObjectFactoryClass +proc IS_OBJECT_FACTORY*(obj: pointer): bool +proc IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool +proc OBJECT_FACTORY_GET_CLASS*(obj: pointer): PObjectFactoryClass +proc object_factory_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_object_factory_get_type".} +proc object_factory_create_accessible*(factory: PObjectFactory, obj: PGObject): PObject{. + cdecl, dynlib: lib, importc: "atk_object_factory_create_accessible".} +proc object_factory_invalidate*(factory: PObjectFactory){.cdecl, dynlib: lib, + importc: "atk_object_factory_invalidate".} +proc object_factory_get_accessible_type*(factory: PObjectFactory): GType{.cdecl, + dynlib: lib, importc: "atk_object_factory_get_accessible_type".} +proc TYPE_REGISTRY*(): GType +proc REGISTRY*(obj: pointer): PRegistry +proc REGISTRY_CLASS*(klass: pointer): PRegistryClass +proc IS_REGISTRY*(obj: pointer): bool +proc IS_REGISTRY_CLASS*(klass: pointer): bool +proc REGISTRY_GET_CLASS*(obj: pointer): PRegistryClass +proc registry_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_registry_get_type".} +proc registry_set_factory_type*(registry: PRegistry, `type`: GType, + factory_type: GType){.cdecl, dynlib: lib, + importc: "atk_registry_set_factory_type".} +proc registry_get_factory_type*(registry: PRegistry, `type`: GType): GType{. + cdecl, dynlib: lib, importc: "atk_registry_get_factory_type".} +proc registry_get_factory*(registry: PRegistry, `type`: GType): PObjectFactory{. + cdecl, dynlib: lib, importc: "atk_registry_get_factory".} +proc get_default_registry*(): PRegistry{.cdecl, dynlib: lib, + importc: "atk_get_default_registry".} +proc TYPE_RELATION*(): GType +proc RELATION*(obj: pointer): PRelation +proc RELATION_CLASS*(klass: pointer): PRelationClass +proc IS_RELATION*(obj: pointer): bool +proc IS_RELATION_CLASS*(klass: pointer): bool +proc RELATION_GET_CLASS*(obj: pointer): PRelationClass +proc relation_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_relation_get_type".} +proc relation_type_register*(name: cstring): TRelationType{.cdecl, dynlib: lib, + importc: "atk_relation_type_register".} +proc relation_type_get_name*(`type`: TRelationType): cstring{.cdecl, + dynlib: lib, importc: "atk_relation_type_get_name".} +proc relation_type_for_name*(name: cstring): TRelationType{.cdecl, dynlib: lib, + importc: "atk_relation_type_for_name".} +proc relation_new*(targets: PPAtkObject, n_targets: gint, + relationship: TRelationType): PRelation{.cdecl, dynlib: lib, + importc: "atk_relation_new".} +proc relation_get_relation_type*(relation: PRelation): TRelationType{.cdecl, + dynlib: lib, importc: "atk_relation_get_relation_type".} +proc relation_get_target*(relation: PRelation): PGPtrArray{.cdecl, dynlib: lib, + importc: "atk_relation_get_target".} +proc TYPE_RELATION_SET*(): GType +proc RELATION_SET*(obj: pointer): PRelationSet +proc RELATION_SET_CLASS*(klass: pointer): PRelationSetClass +proc IS_RELATION_SET*(obj: pointer): bool +proc IS_RELATION_SET_CLASS*(klass: pointer): bool +proc RELATION_SET_GET_CLASS*(obj: pointer): PRelationSetClass +proc relation_set_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_relation_set_get_type".} +proc relation_set_new*(): PRelationSet{.cdecl, dynlib: lib, + importc: "atk_relation_set_new".} +proc relation_set_contains*(RelationSet: PRelationSet, + relationship: TRelationType): gboolean{.cdecl, + dynlib: lib, importc: "atk_relation_set_contains".} +proc relation_set_remove*(RelationSet: PRelationSet, relation: PRelation){. + cdecl, dynlib: lib, importc: "atk_relation_set_remove".} +proc relation_set_add*(RelationSet: PRelationSet, relation: PRelation){.cdecl, + dynlib: lib, importc: "atk_relation_set_add".} +proc relation_set_get_n_relations*(RelationSet: PRelationSet): gint{.cdecl, + dynlib: lib, importc: "atk_relation_set_get_n_relations".} +proc relation_set_get_relation*(RelationSet: PRelationSet, i: gint): PRelation{. + cdecl, dynlib: lib, importc: "atk_relation_set_get_relation".} +proc relation_set_get_relation_by_type*(RelationSet: PRelationSet, + relationship: TRelationType): PRelation{. + cdecl, dynlib: lib, importc: "atk_relation_set_get_relation_by_type".} +proc TYPE_SELECTION*(): GType +proc IS_SELECTION*(obj: pointer): bool +proc SELECTION*(obj: pointer): PSelection +proc SELECTION_GET_IFACE*(obj: pointer): PSelectionIface +proc selection_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_selection_get_type".} +proc selection_add_selection*(selection: PSelection, i: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_selection_add_selection".} +proc selection_clear_selection*(selection: PSelection): gboolean{.cdecl, + dynlib: lib, importc: "atk_selection_clear_selection".} +proc selection_ref_selection*(selection: PSelection, i: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_selection_ref_selection".} +proc selection_get_selection_count*(selection: PSelection): gint{.cdecl, + dynlib: lib, importc: "atk_selection_get_selection_count".} +proc selection_is_child_selected*(selection: PSelection, i: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_selection_is_child_selected".} +proc selection_remove_selection*(selection: PSelection, i: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_selection_remove_selection".} +proc selection_select_all_selection*(selection: PSelection): gboolean{.cdecl, + dynlib: lib, importc: "atk_selection_select_all_selection".} +proc state_type_register*(name: cstring): TStateType{.cdecl, dynlib: lib, + importc: "atk_state_type_register".} +proc state_type_get_name*(`type`: TStateType): cstring{.cdecl, dynlib: lib, + importc: "atk_state_type_get_name".} +proc state_type_for_name*(name: cstring): TStateType{.cdecl, dynlib: lib, + importc: "atk_state_type_for_name".} +proc TYPE_STATE_SET*(): GType +proc STATE_SET*(obj: pointer): PStateSet +proc STATE_SET_CLASS*(klass: pointer): PStateSetClass +proc IS_STATE_SET*(obj: pointer): bool +proc IS_STATE_SET_CLASS*(klass: pointer): bool +proc STATE_SET_GET_CLASS*(obj: pointer): PStateSetClass +proc state_set_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_state_set_get_type".} +proc state_set_new*(): PStateSet{.cdecl, dynlib: lib, + importc: "atk_state_set_new".} +proc state_set_is_empty*(StateSet: PStateSet): gboolean{.cdecl, dynlib: lib, + importc: "atk_state_set_is_empty".} +proc state_set_add_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. + cdecl, dynlib: lib, importc: "atk_state_set_add_state".} +proc state_set_add_states*(StateSet: PStateSet, types: PStateType, n_types: gint){. + cdecl, dynlib: lib, importc: "atk_state_set_add_states".} +proc state_set_clear_states*(StateSet: PStateSet){.cdecl, dynlib: lib, + importc: "atk_state_set_clear_states".} +proc state_set_contains_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. + cdecl, dynlib: lib, importc: "atk_state_set_contains_state".} +proc state_set_contains_states*(StateSet: PStateSet, types: PStateType, + n_types: gint): gboolean{.cdecl, dynlib: lib, + importc: "atk_state_set_contains_states".} +proc state_set_remove_state*(StateSet: PStateSet, `type`: TStateType): gboolean{. + cdecl, dynlib: lib, importc: "atk_state_set_remove_state".} +proc state_set_and_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. + cdecl, dynlib: lib, importc: "atk_state_set_and_sets".} +proc state_set_or_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. + cdecl, dynlib: lib, importc: "atk_state_set_or_sets".} +proc state_set_xor_sets*(StateSet: PStateSet, compare_set: PStateSet): PStateSet{. + cdecl, dynlib: lib, importc: "atk_state_set_xor_sets".} +proc TYPE_STREAMABLE_CONTENT*(): GType +proc IS_STREAMABLE_CONTENT*(obj: pointer): bool +proc STREAMABLE_CONTENT*(obj: pointer): PStreamableContent +proc STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PStreamableContentIface +proc streamable_content_get_type*(): GType{.cdecl, dynlib: lib, + importc: "atk_streamable_content_get_type".} +proc streamable_content_get_n_mime_types*(streamable: PStreamableContent): gint{. + cdecl, dynlib: lib, importc: "atk_streamable_content_get_n_mime_types".} +proc streamable_content_get_mime_type*(streamable: PStreamableContent, i: gint): cstring{. + cdecl, dynlib: lib, importc: "atk_streamable_content_get_mime_type".} +proc streamable_content_get_stream*(streamable: PStreamableContent, + mime_type: cstring): PGIOChannel{.cdecl, + dynlib: lib, importc: "atk_streamable_content_get_stream".} +proc TYPE_TABLE*(): GType +proc IS_TABLE*(obj: pointer): bool +proc TABLE*(obj: pointer): PTable +proc TABLE_GET_IFACE*(obj: pointer): PTableIface +proc table_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_table_get_type".} +proc table_ref_at*(table: PTable, row, column: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_table_ref_at".} +proc table_get_index_at*(table: PTable, row, column: gint): gint{.cdecl, + dynlib: lib, importc: "atk_table_get_index_at".} +proc table_get_column_at_index*(table: PTable, index: gint): gint{.cdecl, + dynlib: lib, importc: "atk_table_get_column_at_index".} +proc table_get_row_at_index*(table: PTable, index: gint): gint{.cdecl, + dynlib: lib, importc: "atk_table_get_row_at_index".} +proc table_get_n_columns*(table: PTable): gint{.cdecl, dynlib: lib, + importc: "atk_table_get_n_columns".} +proc table_get_n_rows*(table: PTable): gint{.cdecl, dynlib: lib, + importc: "atk_table_get_n_rows".} +proc table_get_column_extent_at*(table: PTable, row: gint, column: gint): gint{. + cdecl, dynlib: lib, importc: "atk_table_get_column_extent_at".} +proc table_get_row_extent_at*(table: PTable, row: gint, column: gint): gint{. + cdecl, dynlib: lib, importc: "atk_table_get_row_extent_at".} +proc table_get_caption*(table: PTable): PObject{.cdecl, dynlib: lib, + importc: "atk_table_get_caption".} +proc table_get_column_description*(table: PTable, column: gint): cstring{.cdecl, + dynlib: lib, importc: "atk_table_get_column_description".} +proc table_get_column_header*(table: PTable, column: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_table_get_column_header".} +proc table_get_row_description*(table: PTable, row: gint): cstring{.cdecl, + dynlib: lib, importc: "atk_table_get_row_description".} +proc table_get_row_header*(table: PTable, row: gint): PObject{.cdecl, + dynlib: lib, importc: "atk_table_get_row_header".} +proc table_get_summary*(table: PTable): PObject{.cdecl, dynlib: lib, + importc: "atk_table_get_summary".} +proc table_set_caption*(table: PTable, caption: PObject){.cdecl, dynlib: lib, + importc: "atk_table_set_caption".} +proc table_set_column_description*(table: PTable, column: gint, + description: cstring){.cdecl, dynlib: lib, + importc: "atk_table_set_column_description".} +proc table_set_column_header*(table: PTable, column: gint, header: PObject){. + cdecl, dynlib: lib, importc: "atk_table_set_column_header".} +proc table_set_row_description*(table: PTable, row: gint, description: cstring){. + cdecl, dynlib: lib, importc: "atk_table_set_row_description".} +proc table_set_row_header*(table: PTable, row: gint, header: PObject){.cdecl, + dynlib: lib, importc: "atk_table_set_row_header".} +proc table_set_summary*(table: PTable, accessible: PObject){.cdecl, dynlib: lib, + importc: "atk_table_set_summary".} +proc table_get_selected_columns*(table: PTable, selected: PPgint): gint{.cdecl, + dynlib: lib, importc: "atk_table_get_selected_columns".} +proc table_get_selected_rows*(table: PTable, selected: PPgint): gint{.cdecl, + dynlib: lib, importc: "atk_table_get_selected_rows".} +proc table_is_column_selected*(table: PTable, column: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_table_is_column_selected".} +proc table_is_row_selected*(table: PTable, row: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_table_is_row_selected".} +proc table_is_selected*(table: PTable, row: gint, column: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_table_is_selected".} +proc table_add_row_selection*(table: PTable, row: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_table_add_row_selection".} +proc table_remove_row_selection*(table: PTable, row: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_table_remove_row_selection".} +proc table_add_column_selection*(table: PTable, column: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_table_add_column_selection".} +proc table_remove_column_selection*(table: PTable, column: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_table_remove_column_selection".} +proc text_attribute_register*(name: cstring): TTextAttribute{.cdecl, + dynlib: lib, importc: "atk_text_attribute_register".} +proc TYPE_TEXT*(): GType +proc IS_TEXT*(obj: pointer): bool +proc TEXT*(obj: pointer): PText +proc TEXT_GET_IFACE*(obj: pointer): PTextIface +proc text_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_text_get_type".} +proc text_get_text*(text: PText, start_offset: gint, end_offset: gint): cstring{. + cdecl, dynlib: lib, importc: "atk_text_get_text".} +proc text_get_character_at_offset*(text: PText, offset: gint): gunichar{.cdecl, + dynlib: lib, importc: "atk_text_get_character_at_offset".} +proc text_get_text_after_offset*(text: PText, offset: gint, + boundary_type: TTextBoundary, + start_offset: Pgint, end_offset: Pgint): cstring{. + cdecl, dynlib: lib, importc: "atk_text_get_text_after_offset".} +proc text_get_text_at_offset*(text: PText, offset: gint, + boundary_type: TTextBoundary, start_offset: Pgint, + end_offset: Pgint): cstring{.cdecl, dynlib: lib, + importc: "atk_text_get_text_at_offset".} +proc text_get_text_before_offset*(text: PText, offset: gint, + boundary_type: TTextBoundary, + start_offset: Pgint, end_offset: Pgint): cstring{. + cdecl, dynlib: lib, importc: "atk_text_get_text_before_offset".} +proc text_get_caret_offset*(text: PText): gint{.cdecl, dynlib: lib, + importc: "atk_text_get_caret_offset".} +proc text_get_character_extents*(text: PText, offset: gint, x: Pgint, y: Pgint, + width: Pgint, height: Pgint, coords: TCoordType){. + cdecl, dynlib: lib, importc: "atk_text_get_character_extents".} +proc text_get_run_attributes*(text: PText, offset: gint, start_offset: Pgint, + end_offset: Pgint): PAttributeSet{.cdecl, + dynlib: lib, importc: "atk_text_get_run_attributes".} +proc text_get_default_attributes*(text: PText): PAttributeSet{.cdecl, + dynlib: lib, importc: "atk_text_get_default_attributes".} +proc text_get_character_count*(text: PText): gint{.cdecl, dynlib: lib, + importc: "atk_text_get_character_count".} +proc text_get_offset_at_point*(text: PText, x: gint, y: gint, coords: TCoordType): gint{. + cdecl, dynlib: lib, importc: "atk_text_get_offset_at_point".} +proc text_get_n_selections*(text: PText): gint{.cdecl, dynlib: lib, + importc: "atk_text_get_n_selections".} +proc text_get_selection*(text: PText, selection_num: gint, start_offset: Pgint, + end_offset: Pgint): cstring{.cdecl, dynlib: lib, + importc: "atk_text_get_selection".} +proc text_add_selection*(text: PText, start_offset: gint, end_offset: gint): gboolean{. + cdecl, dynlib: lib, importc: "atk_text_add_selection".} +proc text_remove_selection*(text: PText, selection_num: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_text_remove_selection".} +proc text_set_selection*(text: PText, selection_num: gint, start_offset: gint, + end_offset: gint): gboolean{.cdecl, dynlib: lib, + importc: "atk_text_set_selection".} +proc text_set_caret_offset*(text: PText, offset: gint): gboolean{.cdecl, + dynlib: lib, importc: "atk_text_set_caret_offset".} +proc attribute_set_free*(attrib_set: PAttributeSet){.cdecl, dynlib: lib, + importc: "atk_attribute_set_free".} +proc text_attribute_get_name*(attr: TTextAttribute): cstring{.cdecl, + dynlib: lib, importc: "atk_text_attribute_get_name".} +proc text_attribute_for_name*(name: cstring): TTextAttribute{.cdecl, + dynlib: lib, importc: "atk_text_attribute_for_name".} +proc text_attribute_get_value*(attr: TTextAttribute, index: gint): cstring{. + cdecl, dynlib: lib, importc: "atk_text_attribute_get_value".} +proc TYPE_UTIL*(): GType +proc IS_UTIL*(obj: pointer): bool +proc UTIL*(obj: pointer): PUtil +proc UTIL_CLASS*(klass: pointer): PUtilClass +proc IS_UTIL_CLASS*(klass: pointer): bool +proc UTIL_GET_CLASS*(obj: pointer): PUtilClass +proc util_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_util_get_type".} +proc add_focus_tracker*(focus_tracker: TEventListener): guint{.cdecl, + dynlib: lib, importc: "atk_add_focus_tracker".} +proc remove_focus_tracker*(tracker_id: guint){.cdecl, dynlib: lib, + importc: "atk_remove_focus_tracker".} +proc focus_tracker_init*(add_function: TEventListenerInit){.cdecl, dynlib: lib, + importc: "atk_focus_tracker_init".} +proc focus_tracker_notify*(anObject: PObject){.cdecl, dynlib: lib, + importc: "atk_focus_tracker_notify".} +proc add_global_event_listener*(listener: TGSignalEmissionHook, + event_type: cstring): guint{.cdecl, dynlib: lib, + importc: "atk_add_global_event_listener".} +proc remove_global_event_listener*(listener_id: guint){.cdecl, dynlib: lib, + importc: "atk_remove_global_event_listener".} +proc add_key_event_listener*(listener: TKeySnoopFunc, data: gpointer): guint{. + cdecl, dynlib: lib, importc: "atk_add_key_event_listener".} +proc remove_key_event_listener*(listener_id: guint){.cdecl, dynlib: lib, + importc: "atk_remove_key_event_listener".} +proc get_root*(): PObject{.cdecl, dynlib: lib, importc: "atk_get_root".} +proc get_toolkit_name*(): cstring{.cdecl, dynlib: lib, + importc: "atk_get_toolkit_name".} +proc get_toolkit_version*(): cstring{.cdecl, dynlib: lib, + importc: "atk_get_toolkit_version".} +proc TYPE_VALUE*(): GType +proc IS_VALUE*(obj: pointer): bool +proc VALUE*(obj: pointer): PValue +proc VALUE_GET_IFACE*(obj: pointer): PValueIface +proc value_get_type*(): GType{.cdecl, dynlib: lib, importc: "atk_value_get_type".} +proc value_get_current_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, + importc: "atk_value_get_current_value".} +proc value_get_maximum_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, + importc: "atk_value_get_maximum_value".} +proc value_get_minimum_value*(obj: PValue, value: PGValue){.cdecl, dynlib: lib, + importc: "atk_value_get_minimum_value".} +proc value_set_current_value*(obj: PValue, value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "atk_value_set_current_value".} +proc TYPE_OBJECT*(): GType = + result = object_get_type() + +proc OBJECT*(obj: pointer): PObject = + result = cast[PObject](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_OBJECT())) + +proc OBJECT_CLASS*(klass: pointer): PObjectClass = + result = cast[PObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_OBJECT())) + +proc IS_OBJECT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_OBJECT()) + +proc IS_OBJECT_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_OBJECT()) + +proc OBJECT_GET_CLASS*(obj: pointer): PObjectClass = + result = cast[PObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_OBJECT())) + +proc TYPE_IMPLEMENTOR*(): GType = + result = implementor_get_type() + +proc IS_IMPLEMENTOR*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_IMPLEMENTOR()) + +proc IMPLEMENTOR*(obj: pointer): PImplementor = + result = PImplementor(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_IMPLEMENTOR())) + +proc IMPLEMENTOR_GET_IFACE*(obj: pointer): PImplementorIface = + result = cast[PImplementorIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_IMPLEMENTOR())) + +proc TYPE_ACTION*(): GType = + result = action_get_type() + +proc IS_ACTION*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_ACTION()) + +proc ACTION*(obj: pointer): PAction = + result = PAction(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_ACTION())) + +proc ACTION_GET_IFACE*(obj: pointer): PActionIface = + result = cast[PActionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_ACTION())) + +proc TYPE_COMPONENT*(): GType = + result = component_get_type() + +proc IS_COMPONENT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_COMPONENT()) + +proc COMPONENT*(obj: pointer): PComponent = + result = PComponent(G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_COMPONENT())) + +proc COMPONENT_GET_IFACE*(obj: pointer): PComponentIface = + result = cast[PComponentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_COMPONENT())) + +proc TYPE_DOCUMENT*(): GType = + result = document_get_type() + +proc IS_DOCUMENT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_DOCUMENT()) + +proc DOCUMENT*(obj: pointer): PDocument = + result = cast[PDocument](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_DOCUMENT())) + +proc DOCUMENT_GET_IFACE*(obj: pointer): PDocumentIface = + result = cast[PDocumentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_DOCUMENT())) + +proc TYPE_EDITABLE_TEXT*(): GType = + result = editable_text_get_type() + +proc IS_EDITABLE_TEXT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_EDITABLE_TEXT()) + +proc EDITABLE_TEXT*(obj: pointer): PEditableText = + result = cast[PEditableText](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_EDITABLE_TEXT())) + +proc EDITABLE_TEXT_GET_IFACE*(obj: pointer): PEditableTextIface = + result = cast[PEditableTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_EDITABLE_TEXT())) + +proc TYPE_GOBJECT_ACCESSIBLE*(): GType = + result = gobject_accessible_get_type() + +proc GOBJECT_ACCESSIBLE*(obj: pointer): PGObjectAccessible = + result = cast[PGObjectAccessible](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_GOBJECT_ACCESSIBLE())) + +proc GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): PGObjectAccessibleClass = + result = cast[PGObjectAccessibleClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_GOBJECT_ACCESSIBLE())) + +proc IS_GOBJECT_ACCESSIBLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_GOBJECT_ACCESSIBLE()) + +proc IS_GOBJECT_ACCESSIBLE_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GOBJECT_ACCESSIBLE()) + +proc GOBJECT_ACCESSIBLE_GET_CLASS*(obj: pointer): PGObjectAccessibleClass = + result = cast[PGObjectAccessibleClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_GOBJECT_ACCESSIBLE())) + +proc TYPE_HYPERLINK*(): GType = + result = hyperlink_get_type() + +proc HYPERLINK*(obj: pointer): PHyperlink = + result = cast[PHyperlink](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_HYPERLINK())) + +proc HYPERLINK_CLASS*(klass: pointer): PHyperlinkClass = + result = cast[PHyperlinkClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_HYPERLINK())) + +proc IS_HYPERLINK*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_HYPERLINK()) + +proc IS_HYPERLINK_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_HYPERLINK()) + +proc HYPERLINK_GET_CLASS*(obj: pointer): PHyperlinkClass = + result = cast[PHyperlinkClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_HYPERLINK())) + +proc TYPE_HYPERTEXT*(): GType = + result = hypertext_get_type() + +proc IS_HYPERTEXT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_HYPERTEXT()) + +proc HYPERTEXT*(obj: pointer): PHypertext = + result = cast[PHypertext](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_HYPERTEXT())) + +proc HYPERTEXT_GET_IFACE*(obj: pointer): PHypertextIface = + result = cast[PHypertextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_HYPERTEXT())) + +proc TYPE_IMAGE*(): GType = + result = image_get_type() + +proc IS_IMAGE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_IMAGE()) + +proc IMAGE*(obj: pointer): PImage = + result = cast[PImage](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_IMAGE())) + +proc IMAGE_GET_IFACE*(obj: pointer): PImageIface = + result = cast[PImageIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_IMAGE())) + +proc TYPE_OBJECT_FACTORY*(): GType = + result = object_factory_get_type() + +proc OBJECT_FACTORY*(obj: pointer): PObjectFactory = + result = cast[PObjectFactory](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_OBJECT_FACTORY())) + +proc OBJECT_FACTORY_CLASS*(klass: pointer): PObjectFactoryClass = + result = cast[PObjectFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_OBJECT_FACTORY())) + +proc IS_OBJECT_FACTORY*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_OBJECT_FACTORY()) + +proc IS_OBJECT_FACTORY_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_OBJECT_FACTORY()) + +proc OBJECT_FACTORY_GET_CLASS*(obj: pointer): PObjectFactoryClass = + result = cast[PObjectFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_OBJECT_FACTORY())) + +proc TYPE_REGISTRY*(): GType = + result = registry_get_type() + +proc REGISTRY*(obj: pointer): PRegistry = + result = cast[PRegistry](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_REGISTRY())) + +proc REGISTRY_CLASS*(klass: pointer): PRegistryClass = + result = cast[PRegistryClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_REGISTRY())) + +proc IS_REGISTRY*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_REGISTRY()) + +proc IS_REGISTRY_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_REGISTRY()) + +proc REGISTRY_GET_CLASS*(obj: pointer): PRegistryClass = + result = cast[PRegistryClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_REGISTRY())) + +proc TYPE_RELATION*(): GType = + result = relation_get_type() + +proc RELATION*(obj: pointer): PRelation = + result = cast[PRelation](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_RELATION())) + +proc RELATION_CLASS*(klass: pointer): PRelationClass = + result = cast[PRelationClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_RELATION())) + +proc IS_RELATION*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_RELATION()) + +proc IS_RELATION_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RELATION()) + +proc RELATION_GET_CLASS*(obj: pointer): PRelationClass = + result = cast[PRelationClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_RELATION())) + +proc TYPE_RELATION_SET*(): GType = + result = relation_set_get_type() + +proc RELATION_SET*(obj: pointer): PRelationSet = + result = cast[PRelationSet](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_RELATION_SET())) + +proc RELATION_SET_CLASS*(klass: pointer): PRelationSetClass = + result = cast[PRelationSetClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_RELATION_SET())) + +proc IS_RELATION_SET*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_RELATION_SET()) + +proc IS_RELATION_SET_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RELATION_SET()) + +proc RELATION_SET_GET_CLASS*(obj: pointer): PRelationSetClass = + result = cast[PRelationSetClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_RELATION_SET())) + +proc TYPE_SELECTION*(): GType = + result = selection_get_type() + +proc IS_SELECTION*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_SELECTION()) + +proc SELECTION*(obj: pointer): PSelection = + result = cast[PSelection](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_SELECTION())) + +proc SELECTION_GET_IFACE*(obj: pointer): PSelectionIface = + result = cast[PSelectionIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_SELECTION())) + +proc TYPE_STATE_SET*(): GType = + result = state_set_get_type() + +proc STATE_SET*(obj: pointer): PStateSet = + result = cast[PStateSet](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_STATE_SET())) + +proc STATE_SET_CLASS*(klass: pointer): PStateSetClass = + result = cast[PStateSetClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_STATE_SET())) + +proc IS_STATE_SET*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_STATE_SET()) + +proc IS_STATE_SET_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_STATE_SET()) + +proc STATE_SET_GET_CLASS*(obj: pointer): PStateSetClass = + result = cast[PStateSetClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_STATE_SET())) + +proc TYPE_STREAMABLE_CONTENT*(): GType = + result = streamable_content_get_type() + +proc IS_STREAMABLE_CONTENT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_STREAMABLE_CONTENT()) + +proc STREAMABLE_CONTENT*(obj: pointer): PStreamableContent = + result = cast[PStreamableContent](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_STREAMABLE_CONTENT())) + +proc STREAMABLE_CONTENT_GET_IFACE*(obj: pointer): PStreamableContentIface = + result = cast[PStreamableContentIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_STREAMABLE_CONTENT())) + +proc TYPE_TABLE*(): GType = + result = table_get_type() + +proc IS_TABLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TABLE()) + +proc TABLE*(obj: pointer): PTable = + result = cast[PTable](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TABLE())) + +proc TABLE_GET_IFACE*(obj: pointer): PTableIface = + result = cast[PTableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_TABLE())) + +proc TYPE_TEXT*(): GType = + result = text_get_type() + +proc IS_TEXT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT()) + +proc TEXT*(obj: pointer): PText = + result = cast[PText](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT())) + +proc TEXT_GET_IFACE*(obj: pointer): PTextIface = + result = cast[PTextIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_TEXT())) + +proc TYPE_UTIL*(): GType = + result = util_get_type() + +proc IS_UTIL*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_UTIL()) + +proc UTIL*(obj: pointer): PUtil = + result = cast[PUtil](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_UTIL())) + +proc UTIL_CLASS*(klass: pointer): PUtilClass = + result = cast[PUtilClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_UTIL())) + +proc IS_UTIL_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_UTIL()) + +proc UTIL_GET_CLASS*(obj: pointer): PUtilClass = + result = cast[PUtilClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_UTIL())) + +proc TYPE_VALUE*(): GType = + result = value_get_type() + +proc IS_VALUE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_VALUE()) + +proc VALUE*(obj: pointer): PValue = + result = cast[PValue](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_VALUE())) + +proc VALUE_GET_IFACE*(obj: pointer): PValueIface = + result = cast[PValueIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, TYPE_VALUE())) diff --git a/lib/newwrap/gtk/gdk2.nim b/lib/newwrap/gtk/gdk2.nim new file mode 100644 index 000000000..c171068d3 --- /dev/null +++ b/lib/newwrap/gtk/gdk2.nim @@ -0,0 +1,3869 @@ +{.deadCodeElim: on.} +import + glib2, 2pixbuf, pango + +when defined(win32): + const + lib = "libgdk-win32-2.0-0.dll" + HAVE_WCHAR_H = 1 + HAVE_WCTYPE_H = 1 +elif defined(darwin): + # 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 + const + lib = "gdk-x11-2.0" +else: + const + lib = "libgdk-x11-2.0.so" +const + NUMPTSTOBUFFER* = 200 + MAX_TIMECOORD_AXES* = 128 + +type + PDeviceClass* = ptr TDeviceClass + TDeviceClass* = object of TGObjectClass + PVisualClass* = ptr TVisualClass + TVisualClass* = object of TGObjectClass + PColor* = ptr TColor + TColor*{.final, pure.} = object + pixel*: guint32 + red*: guint16 + green*: guint16 + blue*: guint16 + + PColormap* = ptr TColormap + PDrawable* = ptr TDrawable + TDrawable* = object of TGObject + PWindow* = ptr TWindow + TWindow* = TDrawable + PPixmap* = ptr TPixmap + TPixmap* = TDrawable + PBitmap* = ptr TBitmap + TBitmap* = TDrawable + PFontType* = ptr TFontType + TFontType* = enum + FONT_FONT, FONT_FONTSET + PFont* = ptr TFont + TFont*{.final, pure.} = object + `type`*: TFontType + ascent*: gint + descent*: gint + + PFunction* = ptr TFunction + TFunction* = enum + COPY, INVERT, XOR, CLEAR, AND, AND_REVERSE, AND_INVERT, NOOP, OR, EQUIV, + OR_REVERSE, COPY_INVERT, OR_INVERT, NAND, NOR, SET + PCapStyle* = ptr TCapStyle + TCapStyle* = enum + CAP_NOT_LAST, CAP_BUTT, CAP_ROUND, CAP_PROJECTING + PFill* = ptr TFill + TFill* = enum + SOLID, TILED, STIPPLED, OPAQUE_STIPPLED + PJoinStyle* = ptr TJoinStyle + TJoinStyle* = enum + JOIN_MITER, JOIN_ROUND, JOIN_BEVEL + PLineStyle* = ptr TLineStyle + TLineStyle* = enum + LINE_SOLID, LINE_ON_OFF_DASH, LINE_DOUBLE_DASH + PSubwindowMode* = ptr TSubwindowMode + TSubwindowMode* = int + PGCValuesMask* = ptr TGCValuesMask + TGCValuesMask* = int32 + PGCValues* = ptr TGCValues + TGCValues*{.final, pure.} = object + foreground*: TColor + background*: TColor + font*: PFont + `function`*: TFunction + fill*: TFill + tile*: PPixmap + stipple*: PPixmap + clip_mask*: PPixmap + subwindow_mode*: TSubwindowMode + ts_x_origin*: gint + ts_y_origin*: gint + clip_x_origin*: gint + clip_y_origin*: gint + graphics_exposures*: gint + line_width*: gint + line_style*: TLineStyle + cap_style*: TCapStyle + join_style*: TJoinStyle + + PGC* = ptr TGC + TGC* = object of TGObject + clip_x_origin*: gint + clip_y_origin*: gint + ts_x_origin*: gint + ts_y_origin*: gint + colormap*: PColormap + + PImageType* = ptr TImageType + TImageType* = enum + IMAGE_NORMAL, IMAGE_SHARED, IMAGE_FASTEST + PImage* = ptr TImage + PDevice* = ptr TDevice + PTimeCoord* = ptr TTimeCoord + PPGdkTimeCoord* = ptr PTimeCoord + PRgbDither* = ptr TRgbDither + TRgbDither* = enum + RGB_DITHER_NONE, RGB_DITHER_NORMAL, RGB_DITHER_MAX + PDisplay* = ptr TDisplay + PScreen* = ptr TScreen + TScreen* = object of TGObject + PInputCondition* = ptr TInputCondition + TInputCondition* = int32 + PStatus* = ptr TStatus + TStatus* = int32 + TPoint*{.final, pure.} = object + x*: gint + y*: gint + + PPoint* = ptr TPoint + PPGdkPoint* = ptr PPoint + PSpan* = ptr TSpan + PWChar* = ptr TWChar + TWChar* = guint32 + PSegment* = ptr TSegment + TSegment*{.final, pure.} = object + x1*: gint + y1*: gint + x2*: gint + y2*: gint + + PRectangle* = ptr TRectangle + TRectangle*{.final, pure.} = object + x*: gint + y*: gint + width*: gint + height*: gint + + PAtom* = ptr TAtom + TAtom* = gulong + PByteOrder* = ptr TByteOrder + TByteOrder* = enum + LSB_FIRST, MSB_FIRST + PModifierType* = ptr TModifierType + TModifierType* = gint + PVisualType* = ptr TVisualType + TVisualType* = enum + VISUAL_STATIC_GRAY, VISUAL_GRAYSCALE, VISUAL_STATIC_COLOR, + VISUAL_PSEUDO_COLOR, VISUAL_TRUE_COLOR, VISUAL_DIRECT_COLOR + PVisual* = ptr TVisual + TVisual* = object of TGObject + TheType*: TVisualType + depth*: gint + byte_order*: TByteOrder + colormap_size*: gint + bits_per_rgb*: gint + red_mask*: guint32 + red_shift*: gint + red_prec*: gint + green_mask*: guint32 + green_shift*: gint + green_prec*: gint + blue_mask*: guint32 + blue_shift*: gint + blue_prec*: gint + screen*: PScreen + + PColormapClass* = ptr TColormapClass + TColormapClass* = object of TGObjectClass + TColormap* = object of TGObject + size*: gint + colors*: PColor + visual*: PVisual + windowing_data*: gpointer + screen*: PScreen + + PCursorType* = ptr TCursorType + TCursorType* = gint + PCursor* = ptr TCursor + TCursor*{.final, pure.} = object + `type`*: TCursorType + ref_count*: guint + + PDragAction* = ptr TDragAction + TDragAction* = int32 + PDragProtocol* = ptr TDragProtocol + TDragProtocol* = enum + DRAG_PROTO_MOTIF, DRAG_PROTO_XDND, DRAG_PROTO_ROOTWIN, DRAG_PROTO_NONE, + DRAG_PROTO_WIN32_DROPFILES, DRAG_PROTO_OLE2, DRAG_PROTO_LOCAL + PDragContext* = ptr TDragContext + TDragContext* = object of TGObject + protocol*: TDragProtocol + is_source*: gboolean + source_window*: PWindow + dest_window*: PWindow + targets*: PGList + actions*: TDragAction + suggested_action*: TDragAction + action*: TDragAction + start_time*: guint32 + windowing_data*: gpointer + + PDragContextClass* = ptr TDragContextClass + TDragContextClass* = object of TGObjectClass + PRegionBox* = ptr TRegionBox + TRegionBox* = TSegment + PRegion* = ptr TRegion + TRegion*{.final, pure.} = object + size*: int32 + numRects*: int32 + rects*: PRegionBox + extents*: TRegionBox + + PPOINTBLOCK* = ptr TPOINTBLOCK + TPOINTBLOCK*{.final, pure.} = object + pts*: array[0..(NUMPTSTOBUFFER) - 1, TPoint] + next*: PPOINTBLOCK + + PDrawableClass* = ptr TDrawableClass + TDrawableClass* = object of TGObjectClass + create_gc*: proc (drawable: PDrawable, values: PGCValues, + mask: TGCValuesMask): PGC{.cdecl.} + draw_rectangle*: proc (drawable: PDrawable, gc: PGC, filled: gint, x: gint, + y: gint, width: gint, height: gint){.cdecl.} + draw_arc*: proc (drawable: PDrawable, gc: PGC, filled: gint, x: gint, + y: gint, width: gint, height: gint, angle1: gint, + angle2: gint){.cdecl.} + draw_polygon*: proc (drawable: PDrawable, gc: PGC, filled: gint, + points: PPoint, npoints: gint){.cdecl.} + draw_text*: proc (drawable: PDrawable, font: PFont, gc: PGC, x: gint, + y: gint, text: cstring, text_length: gint){.cdecl.} + draw_text_wc*: proc (drawable: PDrawable, font: PFont, gc: PGC, x: gint, + y: gint, text: PWChar, text_length: gint){.cdecl.} + draw_drawable*: proc (drawable: PDrawable, gc: PGC, src: PDrawable, + xsrc: gint, ysrc: gint, xdest: gint, ydest: gint, + width: gint, height: gint){.cdecl.} + draw_points*: proc (drawable: PDrawable, gc: PGC, points: PPoint, + npoints: gint){.cdecl.} + draw_segments*: proc (drawable: PDrawable, gc: PGC, segs: PSegment, + nsegs: gint){.cdecl.} + draw_lines*: proc (drawable: PDrawable, gc: PGC, points: PPoint, + npoints: gint){.cdecl.} + draw_glyphs*: proc (drawable: PDrawable, gc: PGC, font: PPangoFont, x: gint, + y: gint, glyphs: PPangoGlyphString){.cdecl.} + draw_image*: proc (drawable: PDrawable, gc: PGC, image: PImage, xsrc: gint, + ysrc: gint, xdest: gint, ydest: gint, width: gint, + height: gint){.cdecl.} + get_depth*: proc (drawable: PDrawable): gint{.cdecl.} + get_size*: proc (drawable: PDrawable, width: Pgint, height: Pgint){.cdecl.} + set_colormap*: proc (drawable: PDrawable, cmap: PColormap){.cdecl.} + get_colormap*: proc (drawable: PDrawable): PColormap{.cdecl.} + get_visual*: proc (drawable: PDrawable): PVisual{.cdecl.} + get_screen*: proc (drawable: PDrawable): PScreen{.cdecl.} + get_image*: proc (drawable: PDrawable, x: gint, y: gint, width: gint, + height: gint): PImage{.cdecl.} + get_clip_region*: proc (drawable: PDrawable): PRegion{.cdecl.} + get_visible_region*: proc (drawable: PDrawable): PRegion{.cdecl.} + get_composite_drawable*: proc (drawable: PDrawable, x: gint, y: gint, + width: gint, height: gint, + composite_x_offset: Pgint, + composite_y_offset: Pgint): PDrawable{.cdecl.} + `draw_pixbuf`*: proc (drawable: PDrawable, gc: PGC, pixbuf: PPixbuf, + src_x: gint, src_y: gint, dest_x: gint, dest_y: gint, + width: gint, height: gint, dither: TRgbDither, + x_dither: gint, y_dither: gint){.cdecl.} + `copy_to_image`*: proc (drawable: PDrawable, image: PImage, src_x: gint, + src_y: gint, dest_x: gint, dest_y: gint, + width: gint, height: gint): PImage{.cdecl.} + `reserved1`: proc (){.cdecl.} + `reserved2`: proc (){.cdecl.} + `reserved3`: proc (){.cdecl.} + `reserved4`: proc (){.cdecl.} + `reserved5`: proc (){.cdecl.} + `reserved6`: proc (){.cdecl.} + `reserved7`: proc (){.cdecl.} + `reserved9`: proc (){.cdecl.} + `reserved10`: proc (){.cdecl.} + `reserved11`: proc (){.cdecl.} + `reserved12`: proc (){.cdecl.} + `reserved13`: proc (){.cdecl.} + `reserved14`: proc (){.cdecl.} + `reserved15`: proc (){.cdecl.} + `reserved16`: proc (){.cdecl.} + + PEvent* = ptr TEvent + TEventFunc* = proc (event: PEvent, data: gpointer){.cdecl.} + PXEvent* = ptr TXEvent + TXEvent* = proc () + PFilterReturn* = ptr TFilterReturn + TFilterReturn* = enum + FILTER_CONTINUE, FILTER_TRANSLATE, FILTER_REMOVE + TFilterFunc* = proc (xevent: PXEvent, event: PEvent, data: gpointer): TFilterReturn{. + cdecl.} + PEventType* = ptr TEventType + TEventType* = gint + PEventMask* = ptr TEventMask + TEventMask* = gint32 + PVisibilityState* = ptr TVisibilityState + TVisibilityState* = enum + VISIBILITY_UNOBSCURED, VISIBILITY_PARTIAL, VISIBILITY_FULLY_OBSCURED + PScrollDirection* = ptr TScrollDirection + TScrollDirection* = enum + SCROLL_UP, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT + PNotifyType* = ptr TNotifyType + TNotifyType* = int + PCrossingMode* = ptr TCrossingMode + TCrossingMode* = enum + CROSSING_NORMAL, CROSSING_GRAB, CROSSING_UNGRAB + PPropertyState* = ptr TPropertyState + TPropertyState* = enum + PROPERTY_NEW_VALUE, PROPERTY_STATE_DELETE + PWindowState* = ptr TWindowState + TWindowState* = gint + PSettingAction* = ptr TSettingAction + TSettingAction* = enum + SETTING_ACTION_NEW, SETTING_ACTION_CHANGED, SETTING_ACTION_DELETED + PEventAny* = ptr TEventAny + TEventAny*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + + PEventExpose* = ptr TEventExpose + TEventExpose*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + area*: TRectangle + region*: PRegion + count*: gint + + PEventNoExpose* = ptr TEventNoExpose + TEventNoExpose*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + + PEventVisibility* = ptr TEventVisibility + TEventVisibility*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + state*: TVisibilityState + + PEventMotion* = ptr TEventMotion + TEventMotion*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + time*: guint32 + x*: gdouble + y*: gdouble + axes*: Pgdouble + state*: guint + is_hint*: gint16 + device*: PDevice + x_root*: gdouble + y_root*: gdouble + + PEventButton* = ptr TEventButton + TEventButton*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + time*: guint32 + x*: gdouble + y*: gdouble + axes*: Pgdouble + state*: guint + button*: guint + device*: PDevice + x_root*: gdouble + y_root*: gdouble + + PEventScroll* = ptr TEventScroll + TEventScroll*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + time*: guint32 + x*: gdouble + y*: gdouble + state*: guint + direction*: TScrollDirection + device*: PDevice + x_root*: gdouble + y_root*: gdouble + + PEventKey* = ptr TEventKey + TEventKey*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + time*: guint32 + state*: guint + keyval*: guint + length*: gint + `string`*: cstring + hardware_keycode*: guint16 + group*: guint8 + + PEventCrossing* = ptr TEventCrossing + TEventCrossing*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + subwindow*: PWindow + time*: guint32 + x*: gdouble + y*: gdouble + x_root*: gdouble + y_root*: gdouble + mode*: TCrossingMode + detail*: TNotifyType + focus*: gboolean + state*: guint + + PEventFocus* = ptr TEventFocus + TEventFocus*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + `in`*: gint16 + + PEventConfigure* = ptr TEventConfigure + TEventConfigure*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + x*: gint + y*: gint + width*: gint + height*: gint + + PEventProperty* = ptr TEventProperty + TEventProperty*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + atom*: TAtom + time*: guint32 + state*: guint + + TNativeWindow* = pointer + PEventSelection* = ptr TEventSelection + TEventSelection*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + selection*: TAtom + target*: TAtom + `property`*: TAtom + time*: guint32 + requestor*: TNativeWindow + + PEventProximity* = ptr TEventProximity + TEventProximity*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + time*: guint32 + device*: PDevice + + PmatDUMMY* = ptr TmatDUMMY + TmatDUMMY*{.final, pure.} = object + b*: array[0..19, char] + + PEventClient* = ptr TEventClient + TEventClient*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + message_type*: TAtom + data_format*: gushort + b*: array[0..19, char] + + PEventSetting* = ptr TEventSetting + TEventSetting*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + action*: TSettingAction + name*: cstring + + PEventWindowState* = ptr TEventWindowState + TEventWindowState*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + changed_mask*: TWindowState + new_window_state*: TWindowState + + PEventDND* = ptr TEventDND + TEventDND*{.final, pure.} = object + `type`*: TEventType + window*: PWindow + send_event*: gint8 + context*: PDragContext + time*: guint32 + x_root*: gshort + y_root*: gshort + + TEvent*{.final, pure.} = object + data*: array[0..255, char] # union of + # `type`: TGdkEventType + # any: TGdkEventAny + # expose: TGdkEventExpose + # no_expose: TGdkEventNoExpose + # visibility: TGdkEventVisibility + # motion: TGdkEventMotion + # button: TGdkEventButton + # scroll: TGdkEventScroll + # key: TGdkEventKey + # crossing: TGdkEventCrossing + # focus_change: TGdkEventFocus + # configure: TGdkEventConfigure + # `property`: TGdkEventProperty + # selection: TGdkEventSelection + # proximity: TGdkEventProximity + # client: TGdkEventClient + # dnd: TGdkEventDND + # window_state: TGdkEventWindowState + # setting: TGdkEventSetting + + PGCClass* = ptr TGCClass + TGCClass* = object of TGObjectClass + get_values*: proc (gc: PGC, values: PGCValues){.cdecl.} + set_values*: proc (gc: PGC, values: PGCValues, mask: TGCValuesMask){.cdecl.} + set_dashes*: proc (gc: PGC, dash_offset: gint, dash_list: openarray[gint8]){. + cdecl.} + `reserved1`*: proc (){.cdecl.} + `reserved2`*: proc (){.cdecl.} + `reserved3`*: proc (){.cdecl.} + `reserved4`*: proc (){.cdecl.} + + PImageClass* = ptr TImageClass + TImageClass* = object of TGObjectClass + TImage* = object of TGObject + `type`*: TImageType + visual*: PVisual + byte_order*: TByteOrder + width*: gint + height*: gint + depth*: guint16 + bpp*: guint16 + bpl*: guint16 + bits_per_pixel*: guint16 + mem*: gpointer + colormap*: PColormap + windowing_data*: gpointer + + PExtensionMode* = ptr TExtensionMode + TExtensionMode* = enum + EXTENSION_EVENTS_NONE, EXTENSION_EVENTS_ALL, EXTENSION_EVENTS_CURSOR + PInputSource* = ptr TInputSource + TInputSource* = enum + SOURCE_MOUSE, SOURCE_PEN, SOURCE_ERASER, SOURCE_CURSOR + PInputMode* = ptr TInputMode + TInputMode* = enum + MODE_DISABLED, MODE_SCREEN, MODE_WINDOW + PAxisUse* = ptr TAxisUse + TAxisUse* = int32 + PDeviceKey* = ptr TDeviceKey + TDeviceKey*{.final, pure.} = object + keyval*: guint + modifiers*: TModifierType + + PDeviceAxis* = ptr TDeviceAxis + TDeviceAxis*{.final, pure.} = object + use*: TAxisUse + min*: gdouble + max*: gdouble + + TDevice* = object of TGObject + name*: cstring + source*: TInputSource + mode*: TInputMode + has_cursor*: gboolean + num_axes*: gint + axes*: PDeviceAxis + num_keys*: gint + keys*: PDeviceKey + + TTimeCoord*{.final, pure.} = object + time*: guint32 + axes*: array[0..(MAX_TIMECOORD_AXES) - 1, gdouble] + + PKeymapKey* = ptr TKeymapKey + TKeymapKey*{.final, pure.} = object + keycode*: guint + group*: gint + level*: gint + + PKeymap* = ptr TKeymap + TKeymap* = object of TGObject + display*: PDisplay + + PKeymapClass* = ptr TKeymapClass + TKeymapClass* = object of TGObjectClass + direction_changed*: proc (keymap: PKeymap){.cdecl.} + + PPangoAttrStipple* = ptr TPangoAttrStipple + TPangoAttrStipple*{.final, pure.} = object + attr*: TPangoAttribute + stipple*: PBitmap + + PPangoAttrEmbossed* = ptr TPangoAttrEmbossed + TPangoAttrEmbossed*{.final, pure.} = object + attr*: TPangoAttribute + embossed*: gboolean + + PPixmapObject* = ptr TPixmapObject + TPixmapObject* = object of TDrawable + impl*: PDrawable + depth*: gint + + PPixmapObjectClass* = ptr TPixmapObjectClass + TPixmapObjectClass* = object of TDrawableClass + PPropMode* = ptr TPropMode + TPropMode* = enum + PROP_MODE_REPLACE, PROP_MODE_PREPEND, PROP_MODE_APPEND + PFillRule* = ptr TFillRule + TFillRule* = enum + EVEN_ODD_RULE, WINDING_RULE + POverlapType* = ptr TOverlapType + TOverlapType* = enum + OVERLAP_RECTANGLE_IN, OVERLAP_RECTANGLE_OUT, OVERLAP_RECTANGLE_PART + TSpanFunc* = proc (span: PSpan, data: gpointer){.cdecl.} + PRgbCmap* = ptr TRgbCmap + TRgbCmap*{.final, pure.} = object + colors*: array[0..255, guint32] + n_colors*: gint + info_list*: PGSList + + TDisplay* = object of TGObject + queued_events*: PGList + queued_tail*: PGList + button_click_time*: array[0..1, guint32] + button_window*: array[0..1, PWindow] + button_number*: array[0..1, guint] + double_click_time*: guint + + PDisplayClass* = ptr TDisplayClass + TDisplayClass* = object of TGObjectClass + get_display_name*: proc (display: PDisplay): cstring{.cdecl.} + get_n_screens*: proc (display: PDisplay): gint{.cdecl.} + get_screen*: proc (display: PDisplay, screen_num: gint): PScreen{.cdecl.} + get_default_screen*: proc (display: PDisplay): PScreen{.cdecl.} + + PScreenClass* = ptr TScreenClass + TScreenClass* = object of TGObjectClass + get_display*: proc (screen: PScreen): PDisplay{.cdecl.} + get_width*: proc (screen: PScreen): gint{.cdecl.} + get_height*: proc (screen: PScreen): gint{.cdecl.} + get_width_mm*: proc (screen: PScreen): gint{.cdecl.} + get_height_mm*: proc (screen: PScreen): gint{.cdecl.} + get_root_depth*: proc (screen: PScreen): gint{.cdecl.} + get_screen_num*: proc (screen: PScreen): gint{.cdecl.} + get_root_window*: proc (screen: PScreen): PWindow{.cdecl.} + get_default_colormap*: proc (screen: PScreen): PColormap{.cdecl.} + set_default_colormap*: proc (screen: PScreen, colormap: PColormap){.cdecl.} + get_window_at_pointer*: proc (screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. + cdecl.} + get_n_monitors*: proc (screen: PScreen): gint{.cdecl.} + get_monitor_geometry*: proc (screen: PScreen, monitor_num: gint, + dest: PRectangle){.cdecl.} + + PGrabStatus* = ptr TGrabStatus + TGrabStatus* = int + TInputFunction* = proc (data: gpointer, source: gint, + condition: TInputCondition){.cdecl.} + TDestroyNotify* = proc (data: gpointer){.cdecl.} + TSpan*{.final, pure.} = object + x*: gint + y*: gint + width*: gint + + PWindowClass* = ptr TWindowClass + TWindowClass* = enum + INPUT_OUTPUT, INPUT_ONLY + PWindowType* = ptr TWindowType + TWindowType* = enum + WINDOW_ROOT, WINDOW_TOPLEVEL, WINDOW_CHILD, WINDOW_DIALOG, WINDOW_TEMP, + WINDOW_FOREIGN + PWindowAttributesType* = ptr TWindowAttributesType + TWindowAttributesType* = int32 + PWindowHints* = ptr TWindowHints + TWindowHints* = int32 + PWindowTypeHint* = ptr TWindowTypeHint + TWindowTypeHint* = enum + WINDOW_TYPE_HINT_NORMAL, WINDOW_TYPE_HINT_DIALOG, WINDOW_TYPE_HINT_MENU, + WINDOW_TYPE_HINT_TOOLBAR + PWMDecoration* = ptr TWMDecoration + TWMDecoration* = int32 + PWMFunction* = ptr TWMFunction + TWMFunction* = int32 + PGravity* = ptr TGravity + TGravity* = int + PWindowEdge* = ptr TWindowEdge + TWindowEdge* = enum + WINDOW_EDGE_NORTH_WEST, WINDOW_EDGE_NORTH, WINDOW_EDGE_NORTH_EAST, + WINDOW_EDGE_WEST, WINDOW_EDGE_EAST, WINDOW_EDGE_SOUTH_WEST, + WINDOW_EDGE_SOUTH, WINDOW_EDGE_SOUTH_EAST + PWindowAttr* = ptr TWindowAttr + TWindowAttr*{.final, pure.} = object + title*: cstring + event_mask*: gint + x*: gint + y*: gint + width*: gint + height*: gint + wclass*: TWindowClass + visual*: PVisual + colormap*: PColormap + window_type*: TWindowType + cursor*: PCursor + wmclass_name*: cstring + wmclass_class*: cstring + override_redirect*: gboolean + + PGeometry* = ptr TGeometry + TGeometry*{.final, pure.} = object + min_width*: gint + min_height*: gint + max_width*: gint + max_height*: gint + base_width*: gint + base_height*: gint + width_inc*: gint + height_inc*: gint + min_aspect*: gdouble + max_aspect*: gdouble + win_gravity*: TGravity + + PPointerHooks* = ptr TPointerHooks + TPointerHooks*{.final, pure.} = object + get_pointer*: proc (window: PWindow, x: Pgint, y: Pgint, mask: PModifierType): PWindow{. + cdecl.} + window_at_pointer*: proc (screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. + cdecl.} + + PWindowObject* = ptr TWindowObject + TWindowObject* = object of TDrawable + impl*: PDrawable + parent*: PWindowObject + user_data*: gpointer + x*: gint + y*: gint + extension_events*: gint + filters*: PGList + children*: PGList + bg_color*: TColor + bg_pixmap*: PPixmap + paint_stack*: PGSList + update_area*: PRegion + update_freeze_count*: guint + window_type*: guint8 + depth*: guint8 + resize_count*: guint8 + state*: TWindowState + flag0*: guint16 + event_mask*: TEventMask + + PWindowObjectClass* = ptr TWindowObjectClass + TWindowObjectClass* = object of TDrawableClass + window_invalidate_maybe_recurse_child_func* = proc (para1: PWindow, + para2: gpointer): gboolean + +proc TYPE_COLORMAP*(): GType +proc COLORMAP*(anObject: pointer): PColormap +proc COLORMAP_CLASS*(klass: pointer): PColormapClass +proc IS_COLORMAP*(anObject: pointer): bool +proc IS_COLORMAP_CLASS*(klass: pointer): bool +proc COLORMAP_GET_CLASS*(obj: pointer): PColormapClass +proc TYPE_COLOR*(): GType +proc colormap_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_colormap_get_type".} +proc colormap_new*(visual: PVisual, allocate: gboolean): PColormap{.cdecl, + dynlib: lib, importc: "gdk_colormap_new".} +proc colormap_alloc_colors*(colormap: PColormap, colors: PColor, ncolors: gint, + writeable: gboolean, best_match: gboolean, + success: Pgboolean): gint{.cdecl, dynlib: lib, + importc: "gdk_colormap_alloc_colors".} +proc colormap_alloc_color*(colormap: PColormap, color: PColor, + writeable: gboolean, best_match: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gdk_colormap_alloc_color".} +proc colormap_free_colors*(colormap: PColormap, colors: PColor, ncolors: gint){. + cdecl, dynlib: lib, importc: "gdk_colormap_free_colors".} +proc colormap_query_color*(colormap: PColormap, pixel: gulong, result: PColor){. + cdecl, dynlib: lib, importc: "gdk_colormap_query_color".} +proc colormap_get_visual*(colormap: PColormap): PVisual{.cdecl, dynlib: lib, + importc: "gdk_colormap_get_visual".} +proc color_copy*(color: PColor): PColor{.cdecl, dynlib: lib, + importc: "gdk_color_copy".} +proc color_free*(color: PColor){.cdecl, dynlib: lib, importc: "gdk_color_free".} +proc color_parse*(spec: cstring, color: PColor): gint{.cdecl, dynlib: lib, + importc: "gdk_color_parse".} +proc color_hash*(colora: PColor): guint{.cdecl, dynlib: lib, + importc: "gdk_color_hash".} +proc color_equal*(colora: PColor, colorb: PColor): gboolean{.cdecl, dynlib: lib, + importc: "gdk_color_equal".} +proc color_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_color_get_type".} +const + CURSOR_IS_PIXMAP* = - (1) + X_CURSOR* = 0 + ARROW* = 2 + BASED_ARROW_DOWN* = 4 + BASED_ARROW_UP* = 6 + BOAT* = 8 + BOGOSITY* = 10 + BOTTOM_LEFT_CORNER* = 12 + BOTTOM_RIGHT_CORNER* = 14 + BOTTOM_SIDE* = 16 + BOTTOM_TEE* = 18 + BOX_SPIRAL* = 20 + CENTER_PTR* = 22 + CIRCLE* = 24 + CLOCK* = 26 + COFFEE_MUG* = 28 + CROSS* = 30 + CROSS_REVERSE* = 32 + CROSSHAIR* = 34 + DIAMOND_CROSS* = 36 + DOT* = 38 + DOTBOX* = 40 + DOUBLE_ARROW* = 42 + DRAFT_LARGE* = 44 + DRAFT_SMALL* = 46 + DRAPED_BOX* = 48 + EXCHANGE* = 50 + FLEUR* = 52 + GOBBLER* = 54 + GUMBY* = 56 + HAND1* = 58 + HAND2* = 60 + HEART* = 62 + ICON* = 64 + IRON_CROSS* = 66 + LEFT_PTR* = 68 + LEFT_SIDE* = 70 + LEFT_TEE* = 72 + LEFTBUTTON* = 74 + LL_ANGLE* = 76 + LR_ANGLE* = 78 + MAN* = 80 + MIDDLEBUTTON* = 82 + MOUSE* = 84 + PENCIL* = 86 + PIRATE* = 88 + PLUS* = 90 + QUESTION_ARROW* = 92 + RIGHT_PTR* = 94 + RIGHT_SIDE* = 96 + RIGHT_TEE* = 98 + RIGHTBUTTON* = 100 + RTL_LOGO* = 102 + SAILBOAT* = 104 + SB_DOWN_ARROW* = 106 + SB_H_DOUBLE_ARROW* = 108 + SB_LEFT_ARROW* = 110 + SB_RIGHT_ARROW* = 112 + SB_UP_ARROW* = 114 + SB_V_DOUBLE_ARROW* = 116 + SHUTTLE* = 118 + SIZING* = 120 + SPIDER* = 122 + SPRAYCAN* = 124 + STAR* = 126 + TARGET* = 128 + TCROSS* = 130 + TOP_LEFT_ARROW* = 132 + TOP_LEFT_CORNER* = 134 + TOP_RIGHT_CORNER* = 136 + TOP_SIDE* = 138 + TOP_TEE* = 140 + TREK* = 142 + UL_ANGLE* = 144 + UMBRELLA* = 146 + UR_ANGLE* = 148 + WATCH* = 150 + XTERM* = 152 + LAST_CURSOR* = XTERM + 1 + +proc TYPE_CURSOR*(): GType +proc cursor_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_cursor_get_type".} +proc cursor_new_for_screen*(screen: PScreen, cursor_type: TCursorType): PCursor{. + cdecl, dynlib: lib, importc: "gdk_cursor_new_for_screen".} +proc cursor_new_from_pixmap*(source: PPixmap, mask: PPixmap, fg: PColor, + bg: PColor, x: gint, y: gint): PCursor{.cdecl, + dynlib: lib, importc: "gdk_cursor_new_from_pixmap".} +proc cursor_get_screen*(cursor: PCursor): PScreen{.cdecl, dynlib: lib, + importc: "gdk_cursor_get_screen".} +proc cursor_ref*(cursor: PCursor): PCursor{.cdecl, dynlib: lib, + importc: "gdk_cursor_ref".} +proc cursor_unref*(cursor: PCursor){.cdecl, dynlib: lib, + importc: "gdk_cursor_unref".} +const + ACTION_DEFAULT* = 1 shl 0 + ACTION_COPY* = 1 shl 1 + ACTION_MOVE* = 1 shl 2 + ACTION_LINK* = 1 shl 3 + ACTION_PRIVATE* = 1 shl 4 + ACTION_ASK* = 1 shl 5 + +proc TYPE_DRAG_CONTEXT*(): GType +proc DRAG_CONTEXT*(anObject: Pointer): PDragContext +proc DRAG_CONTEXT_CLASS*(klass: Pointer): PDragContextClass +proc IS_DRAG_CONTEXT*(anObject: Pointer): bool +proc IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool +proc DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PDragContextClass +proc drag_context_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_drag_context_get_type".} +proc drag_context_new*(): PDragContext{.cdecl, dynlib: lib, + importc: "gdk_drag_context_new".} +proc drag_status*(context: PDragContext, action: TDragAction, time: guint32){. + cdecl, dynlib: lib, importc: "gdk_drag_status".} +proc drop_reply*(context: PDragContext, ok: gboolean, time: guint32){.cdecl, + dynlib: lib, importc: "gdk_drop_reply".} +proc drop_finish*(context: PDragContext, success: gboolean, time: guint32){. + cdecl, dynlib: lib, importc: "gdk_drop_finish".} +proc drag_get_selection*(context: PDragContext): TAtom{.cdecl, dynlib: lib, + importc: "gdk_drag_get_selection".} +proc drag_begin*(window: PWindow, targets: PGList): PDragContext{.cdecl, + dynlib: lib, importc: "gdk_drag_begin".} +proc drag_get_protocol_for_display*(display: PDisplay, xid: guint32, + protocol: PDragProtocol): guint32{.cdecl, + dynlib: lib, importc: "gdk_drag_get_protocol_for_display".} +proc drag_find_window*(context: PDragContext, drag_window: PWindow, + x_root: gint, y_root: gint, w: var PWindow, + protocol: PDragProtocol){.cdecl, dynlib: lib, + importc: "gdk_drag_find_window".} +proc drag_motion*(context: PDragContext, dest_window: PWindow, + protocol: TDragProtocol, x_root: gint, y_root: gint, + suggested_action: TDragAction, possible_actions: TDragAction, + time: guint32): gboolean{.cdecl, dynlib: lib, + importc: "gdk_drag_motion".} +proc drag_drop*(context: PDragContext, time: guint32){.cdecl, dynlib: lib, + importc: "gdk_drag_drop".} +proc drag_abort*(context: PDragContext, time: guint32){.cdecl, dynlib: lib, + importc: "gdk_drag_abort".} +proc region_EXTENTCHECK*(r1, r2: PRegionBox): bool +proc region_EXTENTS*(r: PRegionBox, idRect: PRegion) +proc region_MEMCHECK*(reg: PRegion, ARect, firstrect: var PRegionBox): bool +proc region_CHECK_PREVIOUS*(Reg: PRegion, R: PRegionBox, + Rx1, Ry1, Rx2, Ry2: gint): bool +proc region_ADDRECT*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) +proc region_ADDRECTNOX*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) +proc region_EMPTY_REGION*(pReg: PRegion): bool +proc region_REGION_NOT_EMPTY*(pReg: PRegion): bool +proc region_INBOX*(r: TRegionBox, x, y: gint): bool +proc TYPE_DRAWABLE*(): GType +proc DRAWABLE*(anObject: Pointer): PDrawable +proc DRAWABLE_CLASS*(klass: Pointer): PDrawableClass +proc IS_DRAWABLE*(anObject: Pointer): bool +proc IS_DRAWABLE_CLASS*(klass: Pointer): bool +proc DRAWABLE_GET_CLASS*(obj: Pointer): PDrawableClass +proc drawable_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_type".} +proc drawable_get_size*(drawable: PDrawable, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "gdk_drawable_get_size".} +proc drawable_set_colormap*(drawable: PDrawable, colormap: PColormap){.cdecl, + dynlib: lib, importc: "gdk_drawable_set_colormap".} +proc drawable_get_colormap*(drawable: PDrawable): PColormap{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_colormap".} +proc drawable_get_visual*(drawable: PDrawable): PVisual{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_visual".} +proc drawable_get_depth*(drawable: PDrawable): gint{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_depth".} +proc drawable_get_screen*(drawable: PDrawable): PScreen{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_screen".} +proc drawable_get_display*(drawable: PDrawable): PDisplay{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_display".} +proc draw_point*(drawable: PDrawable, gc: PGC, x: gint, y: gint){.cdecl, + dynlib: lib, importc: "gdk_draw_point".} +proc draw_line*(drawable: PDrawable, gc: PGC, x1: gint, y1: gint, x2: gint, + y2: gint){.cdecl, dynlib: lib, importc: "gdk_draw_line".} +proc draw_rectangle*(drawable: PDrawable, gc: PGC, filled: gint, x: gint, + y: gint, width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_rectangle".} +proc draw_arc*(drawable: PDrawable, gc: PGC, filled: gint, x: gint, y: gint, + width: gint, height: gint, angle1: gint, angle2: gint){.cdecl, + dynlib: lib, importc: "gdk_draw_arc".} +proc draw_polygon*(drawable: PDrawable, gc: PGC, filled: gint, points: PPoint, + npoints: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_polygon".} +proc draw_drawable*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, + ysrc: gint, xdest: gint, ydest: gint, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_drawable".} +proc draw_image*(drawable: PDrawable, gc: PGC, image: PImage, xsrc: gint, + ysrc: gint, xdest: gint, ydest: gint, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gdk_draw_image".} +proc draw_points*(drawable: PDrawable, gc: PGC, points: PPoint, npoints: gint){. + cdecl, dynlib: lib, importc: "gdk_draw_points".} +proc draw_segments*(drawable: PDrawable, gc: PGC, segs: PSegment, nsegs: gint){. + cdecl, dynlib: lib, importc: "gdk_draw_segments".} +proc draw_lines*(drawable: PDrawable, gc: PGC, points: PPoint, npoints: gint){. + cdecl, dynlib: lib, importc: "gdk_draw_lines".} +proc draw_glyphs*(drawable: PDrawable, gc: PGC, font: PPangoFont, x: gint, + y: gint, glyphs: PPangoGlyphString){.cdecl, dynlib: lib, + importc: "gdk_draw_glyphs".} +proc draw_layout_line*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + line: PPangoLayoutLine){.cdecl, dynlib: lib, + importc: "gdk_draw_layout_line".} +proc draw_layout*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + layout: PPangoLayout){.cdecl, dynlib: lib, + importc: "gdk_draw_layout".} +proc draw_layout_line_with_colors*(drawable: PDrawable, gc: PGC, x: gint, + y: gint, line: PPangoLayoutLine, + foreground: PColor, background: PColor){. + cdecl, dynlib: lib, importc: "gdk_draw_layout_line_with_colors".} +proc draw_layout_with_colors*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + layout: PPangoLayout, foreground: PColor, + background: PColor){.cdecl, dynlib: lib, + importc: "gdk_draw_layout_with_colors".} +proc drawable_get_image*(drawable: PDrawable, x: gint, y: gint, width: gint, + height: gint): PImage{.cdecl, dynlib: lib, + importc: "gdk_drawable_get_image".} +proc drawable_get_clip_region*(drawable: PDrawable): PRegion{.cdecl, + dynlib: lib, importc: "gdk_drawable_get_clip_region".} +proc drawable_get_visible_region*(drawable: PDrawable): PRegion{.cdecl, + dynlib: lib, importc: "gdk_drawable_get_visible_region".} +const + NOTHING* = - (1) + DELETE* = 0 + DESTROY* = 1 + EXPOSE* = 2 + MOTION_NOTIFY* = 3 + BUTTON_PRESS* = 4 + 2BUTTON_PRESS* = 5 + 3BUTTON_PRESS* = 6 + BUTTON_RELEASE* = 7 + KEY_PRESS* = 8 + KEY_RELEASE* = 9 + ENTER_NOTIFY* = 10 + LEAVE_NOTIFY* = 11 + FOCUS_CHANGE* = 12 + CONFIGURE* = 13 + MAP* = 14 + UNMAP* = 15 + PROPERTY_NOTIFY* = 16 + SELECTION_CLEAR* = 17 + SELECTION_REQUEST* = 18 + SELECTION_NOTIFY* = 19 + PROXIMITY_IN* = 20 + PROXIMITY_OUT* = 21 + DRAG_ENTER* = 22 + DRAG_LEAVE* = 23 + DRAG_MOTION_EVENT* = 24 + DRAG_STATUS_EVENT* = 25 + DROP_START* = 26 + DROP_FINISHED* = 27 + CLIENT_EVENT* = 28 + VISIBILITY_NOTIFY* = 29 + NO_EXPOSE* = 30 + SCROLL* = 31 + WINDOW_STATE* = 32 + SETTING* = 33 + NOTIFY_ANCESTOR* = 0 + NOTIFY_VIRTUAL* = 1 + NOTIFY_INFERIOR* = 2 + NOTIFY_NONLINEAR* = 3 + NOTIFY_NONLINEAR_VIRTUAL* = 4 + NOTIFY_UNKNOWN* = 5 + +proc TYPE_EVENT*(): GType +const + G_PRIORITY_DEFAULT* = 0 + PRIORITY_EVENTS* = G_PRIORITY_DEFAULT #GDK_PRIORITY_REDRAW* = G_PRIORITY_HIGH_IDLE + 20 + EXPOSURE_MASK* = 1 shl 1 + POINTER_MOTION_MASK* = 1 shl 2 + POINTER_MOTION_HINT_MASK* = 1 shl 3 + BUTTON_MOTION_MASK* = 1 shl 4 + BUTTON1_MOTION_MASK* = 1 shl 5 + BUTTON2_MOTION_MASK* = 1 shl 6 + BUTTON3_MOTION_MASK* = 1 shl 7 + BUTTON_PRESS_MASK* = 1 shl 8 + BUTTON_RELEASE_MASK* = 1 shl 9 + KEY_PRESS_MASK* = 1 shl 10 + KEY_RELEASE_MASK* = 1 shl 11 + ENTER_NOTIFY_MASK* = 1 shl 12 + LEAVE_NOTIFY_MASK* = 1 shl 13 + FOCUS_CHANGE_MASK* = 1 shl 14 + STRUCTURE_MASK* = 1 shl 15 + PROPERTY_CHANGE_MASK* = 1 shl 16 + VISIBILITY_NOTIFY_MASK* = 1 shl 17 + PROXIMITY_IN_MASK* = 1 shl 18 + PROXIMITY_OUT_MASK* = 1 shl 19 + SUBSTRUCTURE_MASK* = 1 shl 20 + SCROLL_MASK* = 1 shl 21 + ALL_EVENTS_MASK* = 0x003FFFFE + WINDOW_STATE_WITHDRAWN* = 1 shl 0 + WINDOW_STATE_ICONIFIED* = 1 shl 1 + WINDOW_STATE_MAXIMIZED* = 1 shl 2 + WINDOW_STATE_STICKY* = 1 shl 3 + +proc event_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_event_get_type".} +proc events_pending*(): gboolean{.cdecl, dynlib: lib, + importc: "gdk_events_pending".} +proc event_get*(): PEvent{.cdecl, dynlib: lib, importc: "gdk_event_get".} +proc event_peek*(): PEvent{.cdecl, dynlib: lib, importc: "gdk_event_peek".} +proc event_get_graphics_expose*(window: PWindow): PEvent{.cdecl, dynlib: lib, + importc: "gdk_event_get_graphics_expose".} +proc event_put*(event: PEvent){.cdecl, dynlib: lib, importc: "gdk_event_put".} +proc event_copy*(event: PEvent): PEvent{.cdecl, dynlib: lib, + importc: "gdk_event_copy".} +proc event_free*(event: PEvent){.cdecl, dynlib: lib, importc: "gdk_event_free".} +proc event_get_time*(event: PEvent): guint32{.cdecl, dynlib: lib, + importc: "gdk_event_get_time".} +proc event_get_state*(event: PEvent, state: PModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gdk_event_get_state".} +proc event_get_coords*(event: PEvent, x_win: Pgdouble, y_win: Pgdouble): gboolean{. + cdecl, dynlib: lib, importc: "gdk_event_get_coords".} +proc event_get_root_coords*(event: PEvent, x_root: Pgdouble, y_root: Pgdouble): gboolean{. + cdecl, dynlib: lib, importc: "gdk_event_get_root_coords".} +proc event_get_axis*(event: PEvent, axis_use: TAxisUse, value: Pgdouble): gboolean{. + cdecl, dynlib: lib, importc: "gdk_event_get_axis".} +proc event_handler_set*(func: TEventFunc, data: gpointer, + notify: TGDestroyNotify){.cdecl, dynlib: lib, + importc: "gdk_event_handler_set".} +proc set_show_events*(show_events: gboolean){.cdecl, dynlib: lib, + importc: "gdk_set_show_events".} +proc get_show_events*(): gboolean{.cdecl, dynlib: lib, + importc: "gdk_get_show_events".} +proc TYPE_FONT*(): GType +proc font_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_font_get_type".} +proc font_load_for_display*(display: PDisplay, font_name: cstring): PFont{. + cdecl, dynlib: lib, importc: "gdk_font_load_for_display".} +proc fontset_load_for_display*(display: PDisplay, fontset_name: cstring): PFont{. + cdecl, dynlib: lib, importc: "gdk_fontset_load_for_display".} +proc font_from_description_for_display*(display: PDisplay, + font_desc: PPangoFontDescription): PFont{. + cdecl, dynlib: lib, importc: "gdk_font_from_description_for_display".} +proc font_ref*(font: PFont): PFont{.cdecl, dynlib: lib, importc: "gdk_font_ref".} +proc font_unref*(font: PFont){.cdecl, dynlib: lib, importc: "gdk_font_unref".} +proc font_id*(font: PFont): gint{.cdecl, dynlib: lib, importc: "gdk_font_id".} +proc font_equal*(fonta: PFont, fontb: PFont): gboolean{.cdecl, dynlib: lib, + importc: "gdk_font_equal".} +proc string_width*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, + importc: "gdk_string_width".} +proc text_width*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, + dynlib: lib, importc: "gdk_text_width".} +proc text_width_wc*(font: PFont, text: PWChar, text_length: gint): gint{.cdecl, + dynlib: lib, importc: "gdk_text_width_wc".} +proc char_width*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, + importc: "gdk_char_width".} +proc char_width_wc*(font: PFont, character: TWChar): gint{.cdecl, dynlib: lib, + importc: "gdk_char_width_wc".} +proc string_measure*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, + importc: "gdk_string_measure".} +proc text_measure*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, + dynlib: lib, importc: "gdk_text_measure".} +proc char_measure*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, + importc: "gdk_char_measure".} +proc string_height*(font: PFont, `string`: cstring): gint{.cdecl, dynlib: lib, + importc: "gdk_string_height".} +proc text_height*(font: PFont, text: cstring, text_length: gint): gint{.cdecl, + dynlib: lib, importc: "gdk_text_height".} +proc char_height*(font: PFont, character: gchar): gint{.cdecl, dynlib: lib, + importc: "gdk_char_height".} +proc text_extents*(font: PFont, text: cstring, text_length: gint, + lbearing: Pgint, rbearing: Pgint, width: Pgint, + ascent: Pgint, descent: Pgint){.cdecl, dynlib: lib, + importc: "gdk_text_extents".} +proc text_extents_wc*(font: PFont, text: PWChar, text_length: gint, + lbearing: Pgint, rbearing: Pgint, width: Pgint, + ascent: Pgint, descent: Pgint){.cdecl, dynlib: lib, + importc: "gdk_text_extents_wc".} +proc string_extents*(font: PFont, `string`: cstring, lbearing: Pgint, + rbearing: Pgint, width: Pgint, ascent: Pgint, + descent: Pgint){.cdecl, dynlib: lib, + importc: "gdk_string_extents".} +proc font_get_display*(font: PFont): PDisplay{.cdecl, dynlib: lib, + importc: "gdk_font_get_display".} +const + GC_FOREGROUND* = 1 shl 0 + GC_BACKGROUND* = 1 shl 1 + GC_FONT* = 1 shl 2 + GC_FUNCTION* = 1 shl 3 + GC_FILL* = 1 shl 4 + GC_TILE* = 1 shl 5 + GC_STIPPLE* = 1 shl 6 + GC_CLIP_MASK* = 1 shl 7 + GC_SUBWINDOW* = 1 shl 8 + GC_TS_X_ORIGIN* = 1 shl 9 + GC_TS_Y_ORIGIN* = 1 shl 10 + GC_CLIP_X_ORIGIN* = 1 shl 11 + GC_CLIP_Y_ORIGIN* = 1 shl 12 + GC_EXPOSURES* = 1 shl 13 + GC_LINE_WIDTH* = 1 shl 14 + GC_LINE_STYLE* = 1 shl 15 + GC_CAP_STYLE* = 1 shl 16 + GC_JOIN_STYLE* = 1 shl 17 + CLIP_BY_CHILDREN* = 0 + INCLUDE_INFERIORS* = 1 + +proc TYPE_GC*(): GType +proc GC*(anObject: Pointer): PGC +proc GC_CLASS*(klass: Pointer): PGCClass +proc IS_GC*(anObject: Pointer): bool +proc IS_GC_CLASS*(klass: Pointer): bool +proc GC_GET_CLASS*(obj: Pointer): PGCClass +proc gc_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_gc_get_type".} +proc gc_new*(drawable: PDrawable): PGC{.cdecl, dynlib: lib, + importc: "gdk_gc_new".} +proc gc_new_with_values*(drawable: PDrawable, values: PGCValues, + values_mask: TGCValuesMask): PGC{.cdecl, dynlib: lib, + importc: "gdk_gc_new_with_values".} +proc gc_get_values*(gc: PGC, values: PGCValues){.cdecl, dynlib: lib, + importc: "gdk_gc_get_values".} +proc gc_set_values*(gc: PGC, values: PGCValues, values_mask: TGCValuesMask){. + cdecl, dynlib: lib, importc: "gdk_gc_set_values".} +proc gc_set_foreground*(gc: PGC, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_gc_set_foreground".} +proc gc_set_background*(gc: PGC, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_gc_set_background".} +proc gc_set_function*(gc: PGC, `function`: TFunction){.cdecl, dynlib: lib, + importc: "gdk_gc_set_function".} +proc gc_set_fill*(gc: PGC, fill: TFill){.cdecl, dynlib: lib, + importc: "gdk_gc_set_fill".} +proc gc_set_tile*(gc: PGC, tile: PPixmap){.cdecl, dynlib: lib, + importc: "gdk_gc_set_tile".} +proc gc_set_stipple*(gc: PGC, stipple: PPixmap){.cdecl, dynlib: lib, + importc: "gdk_gc_set_stipple".} +proc gc_set_ts_origin*(gc: PGC, x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gdk_gc_set_ts_origin".} +proc gc_set_clip_origin*(gc: PGC, x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gdk_gc_set_clip_origin".} +proc gc_set_clip_mask*(gc: PGC, mask: PBitmap){.cdecl, dynlib: lib, + importc: "gdk_gc_set_clip_mask".} +proc gc_set_clip_rectangle*(gc: PGC, rectangle: PRectangle){.cdecl, dynlib: lib, + importc: "gdk_gc_set_clip_rectangle".} +proc gc_set_clip_region*(gc: PGC, region: PRegion){.cdecl, dynlib: lib, + importc: "gdk_gc_set_clip_region".} +proc gc_set_subwindow*(gc: PGC, mode: TSubwindowMode){.cdecl, dynlib: lib, + importc: "gdk_gc_set_subwindow".} +proc gc_set_exposures*(gc: PGC, exposures: gboolean){.cdecl, dynlib: lib, + importc: "gdk_gc_set_exposures".} +proc gc_set_line_attributes*(gc: PGC, line_width: gint, line_style: TLineStyle, + cap_style: TCapStyle, join_style: TJoinStyle){. + cdecl, dynlib: lib, importc: "gdk_gc_set_line_attributes".} +proc gc_set_dashes*(gc: PGC, dash_offset: gint, dash_list: openarray[gint8]){. + cdecl, dynlib: lib, importc: "gdk_gc_set_dashes".} +proc gc_offset*(gc: PGC, x_offset: gint, y_offset: gint){.cdecl, dynlib: lib, + importc: "gdk_gc_offset".} +proc gc_copy*(dst_gc: PGC, src_gc: PGC){.cdecl, dynlib: lib, + importc: "gdk_gc_copy".} +proc gc_set_colormap*(gc: PGC, colormap: PColormap){.cdecl, dynlib: lib, + importc: "gdk_gc_set_colormap".} +proc gc_get_colormap*(gc: PGC): PColormap{.cdecl, dynlib: lib, + importc: "gdk_gc_get_colormap".} +proc gc_set_rgb_fg_color*(gc: PGC, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_gc_set_rgb_fg_color".} +proc gc_set_rgb_bg_color*(gc: PGC, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_gc_set_rgb_bg_color".} +proc gc_get_screen*(gc: PGC): PScreen{.cdecl, dynlib: lib, + importc: "gdk_gc_get_screen".} +proc TYPE_IMAGE*(): GType +proc IMAGE*(anObject: Pointer): PImage +proc IMAGE_CLASS*(klass: Pointer): PImageClass +proc IS_IMAGE*(anObject: Pointer): bool +proc IS_IMAGE_CLASS*(klass: Pointer): bool +proc IMAGE_GET_CLASS*(obj: Pointer): PImageClass +proc image_get_type*(): GType{.cdecl, dynlib: lib, importc: "gdk_image_get_type".} +proc image_new*(`type`: TImageType, visual: PVisual, width: gint, height: gint): PImage{. + cdecl, dynlib: lib, importc: "gdk_image_new".} +proc image_put_pixel*(image: PImage, x: gint, y: gint, pixel: guint32){.cdecl, + dynlib: lib, importc: "gdk_image_put_pixel".} +proc image_get_pixel*(image: PImage, x: gint, y: gint): guint32{.cdecl, + dynlib: lib, importc: "gdk_image_get_pixel".} +proc image_set_colormap*(image: PImage, colormap: PColormap){.cdecl, + dynlib: lib, importc: "gdk_image_set_colormap".} +proc image_get_colormap*(image: PImage): PColormap{.cdecl, dynlib: lib, + importc: "gdk_image_get_colormap".} +const + AXIS_IGNORE* = 0 + AXIS_X* = 1 + AXIS_Y* = 2 + AXIS_PRESSURE* = 3 + AXIS_XTILT* = 4 + AXIS_YTILT* = 5 + AXIS_WHEEL* = 6 + AXIS_LAST* = 7 + +proc TYPE_DEVICE*(): GType +proc DEVICE*(anObject: Pointer): PDevice +proc DEVICE_CLASS*(klass: Pointer): PDeviceClass +proc IS_DEVICE*(anObject: Pointer): bool +proc IS_DEVICE_CLASS*(klass: Pointer): bool +proc DEVICE_GET_CLASS*(obj: Pointer): PDeviceClass +proc device_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_device_get_type".} +proc device_set_source*(device: PDevice, source: TInputSource){.cdecl, + dynlib: lib, importc: "gdk_device_set_source".} +proc device_set_mode*(device: PDevice, mode: TInputMode): gboolean{.cdecl, + dynlib: lib, importc: "gdk_device_set_mode".} +proc device_set_key*(device: PDevice, index: guint, keyval: guint, + modifiers: TModifierType){.cdecl, dynlib: lib, + importc: "gdk_device_set_key".} +proc device_set_axis_use*(device: PDevice, index: guint, use: TAxisUse){.cdecl, + dynlib: lib, importc: "gdk_device_set_axis_use".} +proc device_get_state*(device: PDevice, window: PWindow, axes: Pgdouble, + mask: PModifierType){.cdecl, dynlib: lib, + importc: "gdk_device_get_state".} +proc device_get_history*(device: PDevice, window: PWindow, start: guint32, + stop: guint32, s: var PPGdkTimeCoord, n_events: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gdk_device_get_history".} +proc device_free_history*(events: PPGdkTimeCoord, n_events: gint){.cdecl, + dynlib: lib, importc: "gdk_device_free_history".} +proc device_get_axis*(device: PDevice, axes: Pgdouble, use: TAxisUse, + value: Pgdouble): gboolean{.cdecl, dynlib: lib, + importc: "gdk_device_get_axis".} +proc input_set_extension_events*(window: PWindow, mask: gint, + mode: TExtensionMode){.cdecl, dynlib: lib, + importc: "gdk_input_set_extension_events".} +proc device_get_core_pointer*(): PDevice{.cdecl, dynlib: lib, + importc: "gdk_device_get_core_pointer".} +proc TYPE_KEYMAP*(): GType +proc KEYMAP*(anObject: Pointer): PKeymap +proc KEYMAP_CLASS*(klass: Pointer): PKeymapClass +proc IS_KEYMAP*(anObject: Pointer): bool +proc IS_KEYMAP_CLASS*(klass: Pointer): bool +proc KEYMAP_GET_CLASS*(obj: Pointer): PKeymapClass +proc keymap_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_keymap_get_type".} +proc keymap_get_for_display*(display: PDisplay): PKeymap{.cdecl, dynlib: lib, + importc: "gdk_keymap_get_for_display".} +proc keymap_lookup_key*(keymap: PKeymap, key: PKeymapKey): guint{.cdecl, + dynlib: lib, importc: "gdk_keymap_lookup_key".} +proc keymap_translate_keyboard_state*(keymap: PKeymap, hardware_keycode: guint, + state: TModifierType, group: gint, + keyval: Pguint, effective_group: Pgint, + level: Pgint, + consumed_modifiers: PModifierType): gboolean{. + cdecl, dynlib: lib, importc: "gdk_keymap_translate_keyboard_state".} +proc keymap_get_entries_for_keyval*(keymap: PKeymap, keyval: guint, + s: var PKeymapKey, n_keys: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gdk_keymap_get_entries_for_keyval".} +proc keymap_get_entries_for_keycode*(keymap: PKeymap, hardware_keycode: guint, + s: var PKeymapKey, sasdf: var Pguint, + n_entries: Pgint): gboolean{.cdecl, + dynlib: lib, importc: "gdk_keymap_get_entries_for_keycode".} +proc keymap_get_direction*(keymap: PKeymap): TPangoDirection{.cdecl, + dynlib: lib, importc: "gdk_keymap_get_direction".} +proc keyval_name*(keyval: guint): cstring{.cdecl, dynlib: lib, + importc: "gdk_keyval_name".} +proc keyval_from_name*(keyval_name: cstring): guint{.cdecl, dynlib: lib, + importc: "gdk_keyval_from_name".} +proc keyval_convert_case*(symbol: guint, lower: Pguint, upper: Pguint){.cdecl, + dynlib: lib, importc: "gdk_keyval_convert_case".} +proc keyval_to_upper*(keyval: guint): guint{.cdecl, dynlib: lib, + importc: "gdk_keyval_to_upper".} +proc keyval_to_lower*(keyval: guint): guint{.cdecl, dynlib: lib, + importc: "gdk_keyval_to_lower".} +proc keyval_is_upper*(keyval: guint): gboolean{.cdecl, dynlib: lib, + importc: "gdk_keyval_is_upper".} +proc keyval_is_lower*(keyval: guint): gboolean{.cdecl, dynlib: lib, + importc: "gdk_keyval_is_lower".} +proc keyval_to_unicode*(keyval: guint): guint32{.cdecl, dynlib: lib, + importc: "gdk_keyval_to_unicode".} +proc unicode_to_keyval*(wc: guint32): guint{.cdecl, dynlib: lib, + importc: "gdk_unicode_to_keyval".} +const + KEY_VoidSymbol* = 0x00FFFFFF + KEY_BackSpace* = 0x0000FF08 + KEY_Tab* = 0x0000FF09 + KEY_Linefeed* = 0x0000FF0A + KEY_Clear* = 0x0000FF0B + KEY_Return* = 0x0000FF0D + KEY_Pause* = 0x0000FF13 + KEY_Scroll_Lock* = 0x0000FF14 + KEY_Sys_Req* = 0x0000FF15 + KEY_Escape* = 0x0000FF1B + KEY_Delete* = 0x0000FFFF + KEY_Multi_key* = 0x0000FF20 + KEY_Codeinput* = 0x0000FF37 + KEY_SingleCandidate* = 0x0000FF3C + KEY_MultipleCandidate* = 0x0000FF3D + KEY_PreviousCandidate* = 0x0000FF3E + KEY_Kanji* = 0x0000FF21 + KEY_Muhenkan* = 0x0000FF22 + KEY_Henkan_Mode* = 0x0000FF23 + KEY_Henkan* = 0x0000FF23 + KEY_Romaji* = 0x0000FF24 + KEY_Hiragana* = 0x0000FF25 + KEY_Katakana* = 0x0000FF26 + KEY_Hiragana_Katakana* = 0x0000FF27 + KEY_Zenkaku* = 0x0000FF28 + KEY_Hankaku* = 0x0000FF29 + KEY_Zenkaku_Hankaku* = 0x0000FF2A + KEY_Touroku* = 0x0000FF2B + KEY_Massyo* = 0x0000FF2C + KEY_Kana_Lock* = 0x0000FF2D + KEY_Kana_Shift* = 0x0000FF2E + KEY_Eisu_Shift* = 0x0000FF2F + KEY_Eisu_toggle* = 0x0000FF30 + KEY_Kanji_Bangou* = 0x0000FF37 + KEY_Zen_Koho* = 0x0000FF3D + KEY_Mae_Koho* = 0x0000FF3E + KEY_Home* = 0x0000FF50 + KEY_Left* = 0x0000FF51 + KEY_Up* = 0x0000FF52 + KEY_Right* = 0x0000FF53 + KEY_Down* = 0x0000FF54 + KEY_Prior* = 0x0000FF55 + KEY_Page_Up* = 0x0000FF55 + KEY_Next* = 0x0000FF56 + KEY_Page_Down* = 0x0000FF56 + KEY_End* = 0x0000FF57 + KEY_Begin* = 0x0000FF58 + KEY_Select* = 0x0000FF60 + KEY_Print* = 0x0000FF61 + KEY_Execute* = 0x0000FF62 + KEY_Insert* = 0x0000FF63 + KEY_Undo* = 0x0000FF65 + KEY_Redo* = 0x0000FF66 + KEY_Menu* = 0x0000FF67 + KEY_Find* = 0x0000FF68 + KEY_Cancel* = 0x0000FF69 + KEY_Help* = 0x0000FF6A + KEY_Break* = 0x0000FF6B + KEY_Mode_switch* = 0x0000FF7E + KEY_script_switch* = 0x0000FF7E + KEY_Num_Lock* = 0x0000FF7F + KEY_KP_Space* = 0x0000FF80 + KEY_KP_Tab* = 0x0000FF89 + KEY_KP_Enter* = 0x0000FF8D + KEY_KP_F1* = 0x0000FF91 + KEY_KP_F2* = 0x0000FF92 + KEY_KP_F3* = 0x0000FF93 + KEY_KP_F4* = 0x0000FF94 + KEY_KP_Home* = 0x0000FF95 + KEY_KP_Left* = 0x0000FF96 + KEY_KP_Up* = 0x0000FF97 + KEY_KP_Right* = 0x0000FF98 + KEY_KP_Down* = 0x0000FF99 + KEY_KP_Prior* = 0x0000FF9A + KEY_KP_Page_Up* = 0x0000FF9A + KEY_KP_Next* = 0x0000FF9B + KEY_KP_Page_Down* = 0x0000FF9B + KEY_KP_End* = 0x0000FF9C + KEY_KP_Begin* = 0x0000FF9D + KEY_KP_Insert* = 0x0000FF9E + KEY_KP_Delete* = 0x0000FF9F + KEY_KP_Equal* = 0x0000FFBD + KEY_KP_Multiply* = 0x0000FFAA + KEY_KP_Add* = 0x0000FFAB + KEY_KP_Separator* = 0x0000FFAC + KEY_KP_Subtract* = 0x0000FFAD + KEY_KP_Decimal* = 0x0000FFAE + KEY_KP_Divide* = 0x0000FFAF + KEY_KP_0* = 0x0000FFB0 + KEY_KP_1* = 0x0000FFB1 + KEY_KP_2* = 0x0000FFB2 + KEY_KP_3* = 0x0000FFB3 + KEY_KP_4* = 0x0000FFB4 + KEY_KP_5* = 0x0000FFB5 + KEY_KP_6* = 0x0000FFB6 + KEY_KP_7* = 0x0000FFB7 + KEY_KP_8* = 0x0000FFB8 + KEY_KP_9* = 0x0000FFB9 + KEY_F1* = 0x0000FFBE + KEY_F2* = 0x0000FFBF + KEY_F3* = 0x0000FFC0 + KEY_F4* = 0x0000FFC1 + KEY_F5* = 0x0000FFC2 + KEY_F6* = 0x0000FFC3 + KEY_F7* = 0x0000FFC4 + KEY_F8* = 0x0000FFC5 + KEY_F9* = 0x0000FFC6 + KEY_F10* = 0x0000FFC7 + KEY_F11* = 0x0000FFC8 + KEY_L1* = 0x0000FFC8 + KEY_F12* = 0x0000FFC9 + KEY_L2* = 0x0000FFC9 + KEY_F13* = 0x0000FFCA + KEY_L3* = 0x0000FFCA + KEY_F14* = 0x0000FFCB + KEY_L4* = 0x0000FFCB + KEY_F15* = 0x0000FFCC + KEY_L5* = 0x0000FFCC + KEY_F16* = 0x0000FFCD + KEY_L6* = 0x0000FFCD + KEY_F17* = 0x0000FFCE + KEY_L7* = 0x0000FFCE + KEY_F18* = 0x0000FFCF + KEY_L8* = 0x0000FFCF + KEY_F19* = 0x0000FFD0 + KEY_L9* = 0x0000FFD0 + KEY_F20* = 0x0000FFD1 + KEY_L10* = 0x0000FFD1 + KEY_F21* = 0x0000FFD2 + KEY_R1* = 0x0000FFD2 + KEY_F22* = 0x0000FFD3 + KEY_R2* = 0x0000FFD3 + KEY_F23* = 0x0000FFD4 + KEY_R3* = 0x0000FFD4 + KEY_F24* = 0x0000FFD5 + KEY_R4* = 0x0000FFD5 + KEY_F25* = 0x0000FFD6 + KEY_R5* = 0x0000FFD6 + KEY_F26* = 0x0000FFD7 + KEY_R6* = 0x0000FFD7 + KEY_F27* = 0x0000FFD8 + KEY_R7* = 0x0000FFD8 + KEY_F28* = 0x0000FFD9 + KEY_R8* = 0x0000FFD9 + KEY_F29* = 0x0000FFDA + KEY_R9* = 0x0000FFDA + KEY_F30* = 0x0000FFDB + KEY_R10* = 0x0000FFDB + KEY_F31* = 0x0000FFDC + KEY_R11* = 0x0000FFDC + KEY_F32* = 0x0000FFDD + KEY_R12* = 0x0000FFDD + KEY_F33* = 0x0000FFDE + KEY_R13* = 0x0000FFDE + KEY_F34* = 0x0000FFDF + KEY_R14* = 0x0000FFDF + KEY_F35* = 0x0000FFE0 + KEY_R15* = 0x0000FFE0 + KEY_Shift_L* = 0x0000FFE1 + KEY_Shift_R* = 0x0000FFE2 + KEY_Control_L* = 0x0000FFE3 + KEY_Control_R* = 0x0000FFE4 + KEY_Caps_Lock* = 0x0000FFE5 + KEY_Shift_Lock* = 0x0000FFE6 + KEY_Meta_L* = 0x0000FFE7 + KEY_Meta_R* = 0x0000FFE8 + KEY_Alt_L* = 0x0000FFE9 + KEY_Alt_R* = 0x0000FFEA + KEY_Super_L* = 0x0000FFEB + KEY_Super_R* = 0x0000FFEC + KEY_Hyper_L* = 0x0000FFED + KEY_Hyper_R* = 0x0000FFEE + KEY_ISO_Lock* = 0x0000FE01 + KEY_ISO_Level2_Latch* = 0x0000FE02 + KEY_ISO_Level3_Shift* = 0x0000FE03 + KEY_ISO_Level3_Latch* = 0x0000FE04 + KEY_ISO_Level3_Lock* = 0x0000FE05 + KEY_ISO_Group_Shift* = 0x0000FF7E + KEY_ISO_Group_Latch* = 0x0000FE06 + KEY_ISO_Group_Lock* = 0x0000FE07 + KEY_ISO_Next_Group* = 0x0000FE08 + KEY_ISO_Next_Group_Lock* = 0x0000FE09 + KEY_ISO_Prev_Group* = 0x0000FE0A + KEY_ISO_Prev_Group_Lock* = 0x0000FE0B + KEY_ISO_First_Group* = 0x0000FE0C + KEY_ISO_First_Group_Lock* = 0x0000FE0D + KEY_ISO_Last_Group* = 0x0000FE0E + KEY_ISO_Last_Group_Lock* = 0x0000FE0F + KEY_ISO_Left_Tab* = 0x0000FE20 + KEY_ISO_Move_Line_Up* = 0x0000FE21 + KEY_ISO_Move_Line_Down* = 0x0000FE22 + KEY_ISO_Partial_Line_Up* = 0x0000FE23 + KEY_ISO_Partial_Line_Down* = 0x0000FE24 + KEY_ISO_Partial_Space_Left* = 0x0000FE25 + KEY_ISO_Partial_Space_Right* = 0x0000FE26 + KEY_ISO_Set_Margin_Left* = 0x0000FE27 + KEY_ISO_Set_Margin_Right* = 0x0000FE28 + KEY_ISO_Release_Margin_Left* = 0x0000FE29 + KEY_ISO_Release_Margin_Right* = 0x0000FE2A + KEY_ISO_Release_Both_Margins* = 0x0000FE2B + KEY_ISO_Fast_Cursor_Left* = 0x0000FE2C + KEY_ISO_Fast_Cursor_Right* = 0x0000FE2D + KEY_ISO_Fast_Cursor_Up* = 0x0000FE2E + KEY_ISO_Fast_Cursor_Down* = 0x0000FE2F + KEY_ISO_Continuous_Underline* = 0x0000FE30 + KEY_ISO_Discontinuous_Underline* = 0x0000FE31 + KEY_ISO_Emphasize* = 0x0000FE32 + KEY_ISO_Center_Object* = 0x0000FE33 + KEY_ISO_Enter* = 0x0000FE34 + KEY_dead_grave* = 0x0000FE50 + KEY_dead_acute* = 0x0000FE51 + KEY_dead_circumflex* = 0x0000FE52 + KEY_dead_tilde* = 0x0000FE53 + KEY_dead_macron* = 0x0000FE54 + KEY_dead_breve* = 0x0000FE55 + KEY_dead_abovedot* = 0x0000FE56 + KEY_dead_diaeresis* = 0x0000FE57 + KEY_dead_abovering* = 0x0000FE58 + KEY_dead_doubleacute* = 0x0000FE59 + KEY_dead_caron* = 0x0000FE5A + KEY_dead_cedilla* = 0x0000FE5B + KEY_dead_ogonek* = 0x0000FE5C + KEY_dead_iota* = 0x0000FE5D + KEY_dead_voiced_sound* = 0x0000FE5E + KEY_dead_semivoiced_sound* = 0x0000FE5F + KEY_dead_belowdot* = 0x0000FE60 + KEY_First_Virtual_Screen* = 0x0000FED0 + KEY_Prev_Virtual_Screen* = 0x0000FED1 + KEY_Next_Virtual_Screen* = 0x0000FED2 + KEY_Last_Virtual_Screen* = 0x0000FED4 + KEY_Terminate_Server* = 0x0000FED5 + KEY_AccessX_Enable* = 0x0000FE70 + KEY_AccessX_Feedback_Enable* = 0x0000FE71 + KEY_RepeatKeys_Enable* = 0x0000FE72 + KEY_SlowKeys_Enable* = 0x0000FE73 + KEY_BounceKeys_Enable* = 0x0000FE74 + KEY_StickyKeys_Enable* = 0x0000FE75 + KEY_MouseKeys_Enable* = 0x0000FE76 + KEY_MouseKeys_Accel_Enable* = 0x0000FE77 + KEY_Overlay1_Enable* = 0x0000FE78 + KEY_Overlay2_Enable* = 0x0000FE79 + KEY_AudibleBell_Enable* = 0x0000FE7A + KEY_Pointer_Left* = 0x0000FEE0 + KEY_Pointer_Right* = 0x0000FEE1 + KEY_Pointer_Up* = 0x0000FEE2 + KEY_Pointer_Down* = 0x0000FEE3 + KEY_Pointer_UpLeft* = 0x0000FEE4 + KEY_Pointer_UpRight* = 0x0000FEE5 + KEY_Pointer_DownLeft* = 0x0000FEE6 + KEY_Pointer_DownRight* = 0x0000FEE7 + KEY_Pointer_Button_Dflt* = 0x0000FEE8 + KEY_Pointer_Button1* = 0x0000FEE9 + KEY_Pointer_Button2* = 0x0000FEEA + KEY_Pointer_Button3* = 0x0000FEEB + KEY_Pointer_Button4* = 0x0000FEEC + KEY_Pointer_Button5* = 0x0000FEED + KEY_Pointer_DblClick_Dflt* = 0x0000FEEE + KEY_Pointer_DblClick1* = 0x0000FEEF + KEY_Pointer_DblClick2* = 0x0000FEF0 + KEY_Pointer_DblClick3* = 0x0000FEF1 + KEY_Pointer_DblClick4* = 0x0000FEF2 + KEY_Pointer_DblClick5* = 0x0000FEF3 + KEY_Pointer_Drag_Dflt* = 0x0000FEF4 + KEY_Pointer_Drag1* = 0x0000FEF5 + KEY_Pointer_Drag2* = 0x0000FEF6 + KEY_Pointer_Drag3* = 0x0000FEF7 + KEY_Pointer_Drag4* = 0x0000FEF8 + KEY_Pointer_Drag5* = 0x0000FEFD + KEY_Pointer_EnableKeys* = 0x0000FEF9 + KEY_Pointer_Accelerate* = 0x0000FEFA + KEY_Pointer_DfltBtnNext* = 0x0000FEFB + KEY_Pointer_DfltBtnPrev* = 0x0000FEFC + KEY_3270_Duplicate* = 0x0000FD01 + KEY_3270_FieldMark* = 0x0000FD02 + KEY_3270_Right2* = 0x0000FD03 + KEY_3270_Left2* = 0x0000FD04 + KEY_3270_BackTab* = 0x0000FD05 + KEY_3270_EraseEOF* = 0x0000FD06 + KEY_3270_EraseInput* = 0x0000FD07 + KEY_3270_Reset* = 0x0000FD08 + KEY_3270_Quit* = 0x0000FD09 + KEY_3270_PA1* = 0x0000FD0A + KEY_3270_PA2* = 0x0000FD0B + KEY_3270_PA3* = 0x0000FD0C + KEY_3270_Test* = 0x0000FD0D + KEY_3270_Attn* = 0x0000FD0E + KEY_3270_CursorBlink* = 0x0000FD0F + KEY_3270_AltCursor* = 0x0000FD10 + KEY_3270_KeyClick* = 0x0000FD11 + KEY_3270_Jump* = 0x0000FD12 + KEY_3270_Ident* = 0x0000FD13 + KEY_3270_Rule* = 0x0000FD14 + KEY_3270_Copy* = 0x0000FD15 + KEY_3270_Play* = 0x0000FD16 + KEY_3270_Setup* = 0x0000FD17 + KEY_3270_Record* = 0x0000FD18 + KEY_3270_ChangeScreen* = 0x0000FD19 + KEY_3270_DeleteWord* = 0x0000FD1A + KEY_3270_ExSelect* = 0x0000FD1B + KEY_3270_CursorSelect* = 0x0000FD1C + KEY_3270_PrintScreen* = 0x0000FD1D + KEY_3270_Enter* = 0x0000FD1E + KEY_space* = 0x00000020 + KEY_exclam* = 0x00000021 + KEY_quotedbl* = 0x00000022 + KEY_numbersign* = 0x00000023 + KEY_dollar* = 0x00000024 + KEY_percent* = 0x00000025 + KEY_ampersand* = 0x00000026 + KEY_apostrophe* = 0x00000027 + KEY_quoteright* = 0x00000027 + KEY_parenleft* = 0x00000028 + KEY_parenright* = 0x00000029 + KEY_asterisk* = 0x0000002A + KEY_plus* = 0x0000002B + KEY_comma* = 0x0000002C + KEY_minus* = 0x0000002D + KEY_period* = 0x0000002E + KEY_slash* = 0x0000002F + KEY_0* = 0x00000030 + KEY_1* = 0x00000031 + KEY_2* = 0x00000032 + KEY_3* = 0x00000033 + KEY_4* = 0x00000034 + KEY_5* = 0x00000035 + KEY_6* = 0x00000036 + KEY_7* = 0x00000037 + KEY_8* = 0x00000038 + KEY_9* = 0x00000039 + KEY_colon* = 0x0000003A + KEY_semicolon* = 0x0000003B + KEY_less* = 0x0000003C + KEY_equal* = 0x0000003D + KEY_greater* = 0x0000003E + KEY_question* = 0x0000003F + KEY_at* = 0x00000040 + KEY_CAPITAL_A* = 0x00000041 + KEY_CAPITAL_B* = 0x00000042 + KEY_CAPITAL_C* = 0x00000043 + KEY_CAPITAL_D* = 0x00000044 + KEY_CAPITAL_E* = 0x00000045 + KEY_CAPITAL_F* = 0x00000046 + KEY_CAPITAL_G* = 0x00000047 + KEY_CAPITAL_H* = 0x00000048 + KEY_CAPITAL_I* = 0x00000049 + KEY_CAPITAL_J* = 0x0000004A + KEY_CAPITAL_K* = 0x0000004B + KEY_CAPITAL_L* = 0x0000004C + KEY_CAPITAL_M* = 0x0000004D + KEY_CAPITAL_N* = 0x0000004E + KEY_CAPITAL_O* = 0x0000004F + KEY_CAPITAL_P* = 0x00000050 + KEY_CAPITAL_Q* = 0x00000051 + KEY_CAPITAL_R* = 0x00000052 + KEY_CAPITAL_S* = 0x00000053 + KEY_CAPITAL_T* = 0x00000054 + KEY_CAPITAL_U* = 0x00000055 + KEY_CAPITAL_V* = 0x00000056 + KEY_CAPITAL_W* = 0x00000057 + KEY_CAPITAL_X* = 0x00000058 + KEY_CAPITAL_Y* = 0x00000059 + KEY_CAPITAL_Z* = 0x0000005A + KEY_bracketleft* = 0x0000005B + KEY_backslash* = 0x0000005C + KEY_bracketright* = 0x0000005D + KEY_asciicircum* = 0x0000005E + KEY_underscore* = 0x0000005F + KEY_grave* = 0x00000060 + KEY_quoteleft* = 0x00000060 + KEY_a* = 0x00000061 + KEY_b* = 0x00000062 + KEY_c* = 0x00000063 + KEY_d* = 0x00000064 + KEY_e* = 0x00000065 + KEY_f* = 0x00000066 + KEY_g* = 0x00000067 + KEY_h* = 0x00000068 + KEY_i* = 0x00000069 + KEY_j* = 0x0000006A + KEY_k* = 0x0000006B + KEY_l* = 0x0000006C + KEY_m* = 0x0000006D + KEY_n* = 0x0000006E + KEY_o* = 0x0000006F + KEY_p* = 0x00000070 + KEY_q* = 0x00000071 + KEY_r* = 0x00000072 + KEY_s* = 0x00000073 + KEY_t* = 0x00000074 + KEY_u* = 0x00000075 + KEY_v* = 0x00000076 + KEY_w* = 0x00000077 + KEY_x* = 0x00000078 + KEY_y* = 0x00000079 + KEY_z* = 0x0000007A + KEY_braceleft* = 0x0000007B + KEY_bar* = 0x0000007C + KEY_braceright* = 0x0000007D + KEY_asciitilde* = 0x0000007E + KEY_nobreakspace* = 0x000000A0 + KEY_exclamdown* = 0x000000A1 + KEY_cent* = 0x000000A2 + KEY_sterling* = 0x000000A3 + KEY_currency* = 0x000000A4 + KEY_yen* = 0x000000A5 + KEY_brokenbar* = 0x000000A6 + KEY_section* = 0x000000A7 + KEY_diaeresis* = 0x000000A8 + KEY_copyright* = 0x000000A9 + KEY_ordfeminine* = 0x000000AA + KEY_guillemotleft* = 0x000000AB + KEY_notsign* = 0x000000AC + KEY_hyphen* = 0x000000AD + KEY_registered* = 0x000000AE + KEY_macron* = 0x000000AF + KEY_degree* = 0x000000B0 + KEY_plusminus* = 0x000000B1 + KEY_twosuperior* = 0x000000B2 + KEY_threesuperior* = 0x000000B3 + KEY_acute* = 0x000000B4 + KEY_mu* = 0x000000B5 + KEY_paragraph* = 0x000000B6 + KEY_periodcentered* = 0x000000B7 + KEY_cedilla* = 0x000000B8 + KEY_onesuperior* = 0x000000B9 + KEY_masculine* = 0x000000BA + KEY_guillemotright* = 0x000000BB + KEY_onequarter* = 0x000000BC + KEY_onehalf* = 0x000000BD + KEY_threequarters* = 0x000000BE + KEY_questiondown* = 0x000000BF + KEY_CAPITAL_Agrave* = 0x000000C0 + KEY_CAPITAL_Aacute* = 0x000000C1 + KEY_CAPITAL_Acircumflex* = 0x000000C2 + KEY_CAPITAL_Atilde* = 0x000000C3 + KEY_CAPITAL_Adiaeresis* = 0x000000C4 + KEY_CAPITAL_Aring* = 0x000000C5 + KEY_CAPITAL_AE* = 0x000000C6 + KEY_CAPITAL_Ccedilla* = 0x000000C7 + KEY_CAPITAL_Egrave* = 0x000000C8 + KEY_CAPITAL_Eacute* = 0x000000C9 + KEY_CAPITAL_Ecircumflex* = 0x000000CA + KEY_CAPITAL_Ediaeresis* = 0x000000CB + KEY_CAPITAL_Igrave* = 0x000000CC + KEY_CAPITAL_Iacute* = 0x000000CD + KEY_CAPITAL_Icircumflex* = 0x000000CE + KEY_CAPITAL_Idiaeresis* = 0x000000CF + KEY_CAPITAL_ETH* = 0x000000D0 + KEY_CAPITAL_Ntilde* = 0x000000D1 + KEY_CAPITAL_Ograve* = 0x000000D2 + KEY_CAPITAL_Oacute* = 0x000000D3 + KEY_CAPITAL_Ocircumflex* = 0x000000D4 + KEY_CAPITAL_Otilde* = 0x000000D5 + KEY_CAPITAL_Odiaeresis* = 0x000000D6 + KEY_multiply* = 0x000000D7 + KEY_Ooblique* = 0x000000D8 + KEY_CAPITAL_Ugrave* = 0x000000D9 + KEY_CAPITAL_Uacute* = 0x000000DA + KEY_CAPITAL_Ucircumflex* = 0x000000DB + KEY_CAPITAL_Udiaeresis* = 0x000000DC + KEY_CAPITAL_Yacute* = 0x000000DD + KEY_CAPITAL_THORN* = 0x000000DE + KEY_ssharp* = 0x000000DF + KEY_agrave* = 0x000000E0 + KEY_aacute* = 0x000000E1 + KEY_acircumflex* = 0x000000E2 + KEY_atilde* = 0x000000E3 + KEY_adiaeresis* = 0x000000E4 + KEY_aring* = 0x000000E5 + KEY_ae* = 0x000000E6 + KEY_ccedilla* = 0x000000E7 + KEY_egrave* = 0x000000E8 + KEY_eacute* = 0x000000E9 + KEY_ecircumflex* = 0x000000EA + KEY_ediaeresis* = 0x000000EB + KEY_igrave* = 0x000000EC + KEY_iacute* = 0x000000ED + KEY_icircumflex* = 0x000000EE + KEY_idiaeresis* = 0x000000EF + KEY_eth* = 0x000000F0 + KEY_ntilde* = 0x000000F1 + KEY_ograve* = 0x000000F2 + KEY_oacute* = 0x000000F3 + KEY_ocircumflex* = 0x000000F4 + KEY_otilde* = 0x000000F5 + KEY_odiaeresis* = 0x000000F6 + KEY_division* = 0x000000F7 + KEY_oslash* = 0x000000F8 + KEY_ugrave* = 0x000000F9 + KEY_uacute* = 0x000000FA + KEY_ucircumflex* = 0x000000FB + KEY_udiaeresis* = 0x000000FC + KEY_yacute* = 0x000000FD + KEY_thorn* = 0x000000FE + KEY_ydiaeresis* = 0x000000FF + KEY_CAPITAL_Aogonek* = 0x000001A1 + KEY_breve* = 0x000001A2 + KEY_CAPITAL_Lstroke* = 0x000001A3 + KEY_CAPITAL_Lcaron* = 0x000001A5 + KEY_CAPITAL_Sacute* = 0x000001A6 + KEY_CAPITAL_Scaron* = 0x000001A9 + KEY_CAPITAL_Scedilla* = 0x000001AA + KEY_CAPITAL_Tcaron* = 0x000001AB + KEY_CAPITAL_Zacute* = 0x000001AC + KEY_CAPITAL_Zcaron* = 0x000001AE + KEY_CAPITAL_Zabovedot* = 0x000001AF + KEY_aogonek* = 0x000001B1 + KEY_ogonek* = 0x000001B2 + KEY_lstroke* = 0x000001B3 + KEY_lcaron* = 0x000001B5 + KEY_sacute* = 0x000001B6 + KEY_caron* = 0x000001B7 + KEY_scaron* = 0x000001B9 + KEY_scedilla* = 0x000001BA + KEY_tcaron* = 0x000001BB + KEY_zacute* = 0x000001BC + KEY_doubleacute* = 0x000001BD + KEY_zcaron* = 0x000001BE + KEY_zabovedot* = 0x000001BF + KEY_CAPITAL_Racute* = 0x000001C0 + KEY_CAPITAL_Abreve* = 0x000001C3 + KEY_CAPITAL_Lacute* = 0x000001C5 + KEY_CAPITAL_Cacute* = 0x000001C6 + KEY_CAPITAL_Ccaron* = 0x000001C8 + KEY_CAPITAL_Eogonek* = 0x000001CA + KEY_CAPITAL_Ecaron* = 0x000001CC + KEY_CAPITAL_Dcaron* = 0x000001CF + KEY_CAPITAL_Dstroke* = 0x000001D0 + KEY_CAPITAL_Nacute* = 0x000001D1 + KEY_CAPITAL_Ncaron* = 0x000001D2 + KEY_CAPITAL_Odoubleacute* = 0x000001D5 + KEY_CAPITAL_Rcaron* = 0x000001D8 + KEY_CAPITAL_Uring* = 0x000001D9 + KEY_CAPITAL_Udoubleacute* = 0x000001DB + KEY_CAPITAL_Tcedilla* = 0x000001DE + KEY_racute* = 0x000001E0 + KEY_abreve* = 0x000001E3 + KEY_lacute* = 0x000001E5 + KEY_cacute* = 0x000001E6 + KEY_ccaron* = 0x000001E8 + KEY_eogonek* = 0x000001EA + KEY_ecaron* = 0x000001EC + KEY_dcaron* = 0x000001EF + KEY_dstroke* = 0x000001F0 + KEY_nacute* = 0x000001F1 + KEY_ncaron* = 0x000001F2 + KEY_odoubleacute* = 0x000001F5 + KEY_udoubleacute* = 0x000001FB + KEY_rcaron* = 0x000001F8 + KEY_uring* = 0x000001F9 + KEY_tcedilla* = 0x000001FE + KEY_abovedot* = 0x000001FF + KEY_CAPITAL_Hstroke* = 0x000002A1 + KEY_CAPITAL_Hcircumflex* = 0x000002A6 + KEY_CAPITAL_Iabovedot* = 0x000002A9 + KEY_CAPITAL_Gbreve* = 0x000002AB + KEY_CAPITAL_Jcircumflex* = 0x000002AC + KEY_hstroke* = 0x000002B1 + KEY_hcircumflex* = 0x000002B6 + KEY_idotless* = 0x000002B9 + KEY_gbreve* = 0x000002BB + KEY_jcircumflex* = 0x000002BC + KEY_CAPITAL_Cabovedot* = 0x000002C5 + KEY_CAPITAL_Ccircumflex* = 0x000002C6 + KEY_CAPITAL_Gabovedot* = 0x000002D5 + KEY_CAPITAL_Gcircumflex* = 0x000002D8 + KEY_CAPITAL_Ubreve* = 0x000002DD + KEY_CAPITAL_Scircumflex* = 0x000002DE + KEY_cabovedot* = 0x000002E5 + KEY_ccircumflex* = 0x000002E6 + KEY_gabovedot* = 0x000002F5 + KEY_gcircumflex* = 0x000002F8 + KEY_ubreve* = 0x000002FD + KEY_scircumflex* = 0x000002FE + KEY_kra* = 0x000003A2 + KEY_kappa* = 0x000003A2 + KEY_CAPITAL_Rcedilla* = 0x000003A3 + KEY_CAPITAL_Itilde* = 0x000003A5 + KEY_CAPITAL_Lcedilla* = 0x000003A6 + KEY_CAPITAL_Emacron* = 0x000003AA + KEY_CAPITAL_Gcedilla* = 0x000003AB + KEY_CAPITAL_Tslash* = 0x000003AC + KEY_rcedilla* = 0x000003B3 + KEY_itilde* = 0x000003B5 + KEY_lcedilla* = 0x000003B6 + KEY_emacron* = 0x000003BA + KEY_gcedilla* = 0x000003BB + KEY_tslash* = 0x000003BC + KEY_CAPITAL_ENG* = 0x000003BD + KEY_eng* = 0x000003BF + KEY_CAPITAL_Amacron* = 0x000003C0 + KEY_CAPITAL_Iogonek* = 0x000003C7 + KEY_CAPITAL_Eabovedot* = 0x000003CC + KEY_CAPITAL_Imacron* = 0x000003CF + KEY_CAPITAL_Ncedilla* = 0x000003D1 + KEY_CAPITAL_Omacron* = 0x000003D2 + KEY_CAPITAL_Kcedilla* = 0x000003D3 + KEY_CAPITAL_Uogonek* = 0x000003D9 + KEY_CAPITAL_Utilde* = 0x000003DD + KEY_CAPITAL_Umacron* = 0x000003DE + KEY_amacron* = 0x000003E0 + KEY_iogonek* = 0x000003E7 + KEY_eabovedot* = 0x000003EC + KEY_imacron* = 0x000003EF + KEY_ncedilla* = 0x000003F1 + KEY_omacron* = 0x000003F2 + KEY_kcedilla* = 0x000003F3 + KEY_uogonek* = 0x000003F9 + KEY_utilde* = 0x000003FD + KEY_umacron* = 0x000003FE + KEY_CAPITAL_OE* = 0x000013BC + KEY_oe* = 0x000013BD + KEY_CAPITAL_Ydiaeresis* = 0x000013BE + KEY_overline* = 0x0000047E + KEY_kana_fullstop* = 0x000004A1 + KEY_kana_openingbracket* = 0x000004A2 + KEY_kana_closingbracket* = 0x000004A3 + KEY_kana_comma* = 0x000004A4 + KEY_kana_conjunctive* = 0x000004A5 + KEY_kana_middledot* = 0x000004A5 + KEY_kana_WO* = 0x000004A6 + KEY_kana_a* = 0x000004A7 + KEY_kana_i* = 0x000004A8 + KEY_kana_u* = 0x000004A9 + KEY_kana_e* = 0x000004AA + KEY_kana_o* = 0x000004AB + KEY_kana_ya* = 0x000004AC + KEY_kana_yu* = 0x000004AD + KEY_kana_yo* = 0x000004AE + KEY_kana_tsu* = 0x000004AF + KEY_kana_tu* = 0x000004AF + KEY_prolongedsound* = 0x000004B0 + KEY_kana_CAPITAL_A* = 0x000004B1 + KEY_kana_CAPITAL_I* = 0x000004B2 + KEY_kana_CAPITAL_U* = 0x000004B3 + KEY_kana_CAPITAL_E* = 0x000004B4 + KEY_kana_CAPITAL_O* = 0x000004B5 + KEY_kana_KA* = 0x000004B6 + KEY_kana_KI* = 0x000004B7 + KEY_kana_KU* = 0x000004B8 + KEY_kana_KE* = 0x000004B9 + KEY_kana_KO* = 0x000004BA + KEY_kana_SA* = 0x000004BB + KEY_kana_SHI* = 0x000004BC + KEY_kana_SU* = 0x000004BD + KEY_kana_SE* = 0x000004BE + KEY_kana_SO* = 0x000004BF + KEY_kana_TA* = 0x000004C0 + KEY_kana_CHI* = 0x000004C1 + KEY_kana_TI* = 0x000004C1 + KEY_kana_CAPITAL_TSU* = 0x000004C2 + KEY_kana_CAPITAL_TU* = 0x000004C2 + KEY_kana_TE* = 0x000004C3 + KEY_kana_TO* = 0x000004C4 + KEY_kana_NA* = 0x000004C5 + KEY_kana_NI* = 0x000004C6 + KEY_kana_NU* = 0x000004C7 + KEY_kana_NE* = 0x000004C8 + KEY_kana_NO* = 0x000004C9 + KEY_kana_HA* = 0x000004CA + KEY_kana_HI* = 0x000004CB + KEY_kana_FU* = 0x000004CC + KEY_kana_HU* = 0x000004CC + KEY_kana_HE* = 0x000004CD + KEY_kana_HO* = 0x000004CE + KEY_kana_MA* = 0x000004CF + KEY_kana_MI* = 0x000004D0 + KEY_kana_MU* = 0x000004D1 + KEY_kana_ME* = 0x000004D2 + KEY_kana_MO* = 0x000004D3 + KEY_kana_CAPITAL_YA* = 0x000004D4 + KEY_kana_CAPITAL_YU* = 0x000004D5 + KEY_kana_CAPITAL_YO* = 0x000004D6 + KEY_kana_RA* = 0x000004D7 + KEY_kana_RI* = 0x000004D8 + KEY_kana_RU* = 0x000004D9 + KEY_kana_RE* = 0x000004DA + KEY_kana_RO* = 0x000004DB + KEY_kana_WA* = 0x000004DC + KEY_kana_N* = 0x000004DD + KEY_voicedsound* = 0x000004DE + KEY_semivoicedsound* = 0x000004DF + KEY_kana_switch* = 0x0000FF7E + KEY_Arabic_comma* = 0x000005AC + KEY_Arabic_semicolon* = 0x000005BB + KEY_Arabic_question_mark* = 0x000005BF + KEY_Arabic_hamza* = 0x000005C1 + KEY_Arabic_maddaonalef* = 0x000005C2 + KEY_Arabic_hamzaonalef* = 0x000005C3 + KEY_Arabic_hamzaonwaw* = 0x000005C4 + KEY_Arabic_hamzaunderalef* = 0x000005C5 + KEY_Arabic_hamzaonyeh* = 0x000005C6 + KEY_Arabic_alef* = 0x000005C7 + KEY_Arabic_beh* = 0x000005C8 + KEY_Arabic_tehmarbuta* = 0x000005C9 + KEY_Arabic_teh* = 0x000005CA + KEY_Arabic_theh* = 0x000005CB + KEY_Arabic_jeem* = 0x000005CC + KEY_Arabic_hah* = 0x000005CD + KEY_Arabic_khah* = 0x000005CE + KEY_Arabic_dal* = 0x000005CF + KEY_Arabic_thal* = 0x000005D0 + KEY_Arabic_ra* = 0x000005D1 + KEY_Arabic_zain* = 0x000005D2 + KEY_Arabic_seen* = 0x000005D3 + KEY_Arabic_sheen* = 0x000005D4 + KEY_Arabic_sad* = 0x000005D5 + KEY_Arabic_dad* = 0x000005D6 + KEY_Arabic_tah* = 0x000005D7 + KEY_Arabic_zah* = 0x000005D8 + KEY_Arabic_ain* = 0x000005D9 + KEY_Arabic_ghain* = 0x000005DA + KEY_Arabic_tatweel* = 0x000005E0 + KEY_Arabic_feh* = 0x000005E1 + KEY_Arabic_qaf* = 0x000005E2 + KEY_Arabic_kaf* = 0x000005E3 + KEY_Arabic_lam* = 0x000005E4 + KEY_Arabic_meem* = 0x000005E5 + KEY_Arabic_noon* = 0x000005E6 + KEY_Arabic_ha* = 0x000005E7 + KEY_Arabic_heh* = 0x000005E7 + KEY_Arabic_waw* = 0x000005E8 + KEY_Arabic_alefmaksura* = 0x000005E9 + KEY_Arabic_yeh* = 0x000005EA + KEY_Arabic_fathatan* = 0x000005EB + KEY_Arabic_dammatan* = 0x000005EC + KEY_Arabic_kasratan* = 0x000005ED + KEY_Arabic_fatha* = 0x000005EE + KEY_Arabic_damma* = 0x000005EF + KEY_Arabic_kasra* = 0x000005F0 + KEY_Arabic_shadda* = 0x000005F1 + KEY_Arabic_sukun* = 0x000005F2 + KEY_Arabic_switch* = 0x0000FF7E + KEY_Serbian_dje* = 0x000006A1 + KEY_Macedonia_gje* = 0x000006A2 + KEY_Cyrillic_io* = 0x000006A3 + KEY_Ukrainian_ie* = 0x000006A4 + KEY_Ukranian_je* = 0x000006A4 + KEY_Macedonia_dse* = 0x000006A5 + KEY_Ukrainian_i* = 0x000006A6 + KEY_Ukranian_i* = 0x000006A6 + KEY_Ukrainian_yi* = 0x000006A7 + KEY_Ukranian_yi* = 0x000006A7 + KEY_Cyrillic_je* = 0x000006A8 + KEY_Serbian_je* = 0x000006A8 + KEY_Cyrillic_lje* = 0x000006A9 + KEY_Serbian_lje* = 0x000006A9 + KEY_Cyrillic_nje* = 0x000006AA + KEY_Serbian_nje* = 0x000006AA + KEY_Serbian_tshe* = 0x000006AB + KEY_Macedonia_kje* = 0x000006AC + KEY_Byelorussian_shortu* = 0x000006AE + KEY_Cyrillic_dzhe* = 0x000006AF + KEY_Serbian_dze* = 0x000006AF + KEY_numerosign* = 0x000006B0 + KEY_Serbian_CAPITAL_DJE* = 0x000006B1 + KEY_Macedonia_CAPITAL_GJE* = 0x000006B2 + KEY_Cyrillic_CAPITAL_IO* = 0x000006B3 + KEY_Ukrainian_CAPITAL_IE* = 0x000006B4 + KEY_Ukranian_CAPITAL_JE* = 0x000006B4 + KEY_Macedonia_CAPITAL_DSE* = 0x000006B5 + KEY_Ukrainian_CAPITAL_I* = 0x000006B6 + KEY_Ukranian_CAPITAL_I* = 0x000006B6 + KEY_Ukrainian_CAPITAL_YI* = 0x000006B7 + KEY_Ukranian_CAPITAL_YI* = 0x000006B7 + KEY_Cyrillic_CAPITAL_JE* = 0x000006B8 + KEY_Serbian_CAPITAL_JE* = 0x000006B8 + KEY_Cyrillic_CAPITAL_LJE* = 0x000006B9 + KEY_Serbian_CAPITAL_LJE* = 0x000006B9 + KEY_Cyrillic_CAPITAL_NJE* = 0x000006BA + KEY_Serbian_CAPITAL_NJE* = 0x000006BA + KEY_Serbian_CAPITAL_TSHE* = 0x000006BB + KEY_Macedonia_CAPITAL_KJE* = 0x000006BC + KEY_Byelorussian_CAPITAL_SHORTU* = 0x000006BE + KEY_Cyrillic_CAPITAL_DZHE* = 0x000006BF + KEY_Serbian_CAPITAL_DZE* = 0x000006BF + KEY_Cyrillic_yu* = 0x000006C0 + KEY_Cyrillic_a* = 0x000006C1 + KEY_Cyrillic_be* = 0x000006C2 + KEY_Cyrillic_tse* = 0x000006C3 + KEY_Cyrillic_de* = 0x000006C4 + KEY_Cyrillic_ie* = 0x000006C5 + KEY_Cyrillic_ef* = 0x000006C6 + KEY_Cyrillic_ghe* = 0x000006C7 + KEY_Cyrillic_ha* = 0x000006C8 + KEY_Cyrillic_i* = 0x000006C9 + KEY_Cyrillic_shorti* = 0x000006CA + KEY_Cyrillic_ka* = 0x000006CB + KEY_Cyrillic_el* = 0x000006CC + KEY_Cyrillic_em* = 0x000006CD + KEY_Cyrillic_en* = 0x000006CE + KEY_Cyrillic_o* = 0x000006CF + KEY_Cyrillic_pe* = 0x000006D0 + KEY_Cyrillic_ya* = 0x000006D1 + KEY_Cyrillic_er* = 0x000006D2 + KEY_Cyrillic_es* = 0x000006D3 + KEY_Cyrillic_te* = 0x000006D4 + KEY_Cyrillic_u* = 0x000006D5 + KEY_Cyrillic_zhe* = 0x000006D6 + KEY_Cyrillic_ve* = 0x000006D7 + KEY_Cyrillic_softsign* = 0x000006D8 + KEY_Cyrillic_yeru* = 0x000006D9 + KEY_Cyrillic_ze* = 0x000006DA + KEY_Cyrillic_sha* = 0x000006DB + KEY_Cyrillic_e* = 0x000006DC + KEY_Cyrillic_shcha* = 0x000006DD + KEY_Cyrillic_che* = 0x000006DE + KEY_Cyrillic_hardsign* = 0x000006DF + KEY_Cyrillic_CAPITAL_YU* = 0x000006E0 + KEY_Cyrillic_CAPITAL_A* = 0x000006E1 + KEY_Cyrillic_CAPITAL_BE* = 0x000006E2 + KEY_Cyrillic_CAPITAL_TSE* = 0x000006E3 + KEY_Cyrillic_CAPITAL_DE* = 0x000006E4 + KEY_Cyrillic_CAPITAL_IE* = 0x000006E5 + KEY_Cyrillic_CAPITAL_EF* = 0x000006E6 + KEY_Cyrillic_CAPITAL_GHE* = 0x000006E7 + KEY_Cyrillic_CAPITAL_HA* = 0x000006E8 + KEY_Cyrillic_CAPITAL_I* = 0x000006E9 + KEY_Cyrillic_CAPITAL_SHORTI* = 0x000006EA + KEY_Cyrillic_CAPITAL_KA* = 0x000006EB + KEY_Cyrillic_CAPITAL_EL* = 0x000006EC + KEY_Cyrillic_CAPITAL_EM* = 0x000006ED + KEY_Cyrillic_CAPITAL_EN* = 0x000006EE + KEY_Cyrillic_CAPITAL_O* = 0x000006EF + KEY_Cyrillic_CAPITAL_PE* = 0x000006F0 + KEY_Cyrillic_CAPITAL_YA* = 0x000006F1 + KEY_Cyrillic_CAPITAL_ER* = 0x000006F2 + KEY_Cyrillic_CAPITAL_ES* = 0x000006F3 + KEY_Cyrillic_CAPITAL_TE* = 0x000006F4 + KEY_Cyrillic_CAPITAL_U* = 0x000006F5 + KEY_Cyrillic_CAPITAL_ZHE* = 0x000006F6 + KEY_Cyrillic_CAPITAL_VE* = 0x000006F7 + KEY_Cyrillic_CAPITAL_SOFTSIGN* = 0x000006F8 + KEY_Cyrillic_CAPITAL_YERU* = 0x000006F9 + KEY_Cyrillic_CAPITAL_ZE* = 0x000006FA + KEY_Cyrillic_CAPITAL_SHA* = 0x000006FB + KEY_Cyrillic_CAPITAL_E* = 0x000006FC + KEY_Cyrillic_CAPITAL_SHCHA* = 0x000006FD + KEY_Cyrillic_CAPITAL_CHE* = 0x000006FE + KEY_Cyrillic_CAPITAL_HARDSIGN* = 0x000006FF + KEY_Greek_CAPITAL_ALPHAaccent* = 0x000007A1 + KEY_Greek_CAPITAL_EPSILONaccent* = 0x000007A2 + KEY_Greek_CAPITAL_ETAaccent* = 0x000007A3 + KEY_Greek_CAPITAL_IOTAaccent* = 0x000007A4 + KEY_Greek_CAPITAL_IOTAdiaeresis* = 0x000007A5 + KEY_Greek_CAPITAL_OMICRONaccent* = 0x000007A7 + KEY_Greek_CAPITAL_UPSILONaccent* = 0x000007A8 + KEY_Greek_CAPITAL_UPSILONdieresis* = 0x000007A9 + KEY_Greek_CAPITAL_OMEGAaccent* = 0x000007AB + KEY_Greek_accentdieresis* = 0x000007AE + KEY_Greek_horizbar* = 0x000007AF + KEY_Greek_alphaaccent* = 0x000007B1 + KEY_Greek_epsilonaccent* = 0x000007B2 + KEY_Greek_etaaccent* = 0x000007B3 + KEY_Greek_iotaaccent* = 0x000007B4 + KEY_Greek_iotadieresis* = 0x000007B5 + KEY_Greek_iotaaccentdieresis* = 0x000007B6 + KEY_Greek_omicronaccent* = 0x000007B7 + KEY_Greek_upsilonaccent* = 0x000007B8 + KEY_Greek_upsilondieresis* = 0x000007B9 + KEY_Greek_upsilonaccentdieresis* = 0x000007BA + KEY_Greek_omegaaccent* = 0x000007BB + KEY_Greek_CAPITAL_ALPHA* = 0x000007C1 + KEY_Greek_CAPITAL_BETA* = 0x000007C2 + KEY_Greek_CAPITAL_GAMMA* = 0x000007C3 + KEY_Greek_CAPITAL_DELTA* = 0x000007C4 + KEY_Greek_CAPITAL_EPSILON* = 0x000007C5 + KEY_Greek_CAPITAL_ZETA* = 0x000007C6 + KEY_Greek_CAPITAL_ETA* = 0x000007C7 + KEY_Greek_CAPITAL_THETA* = 0x000007C8 + KEY_Greek_CAPITAL_IOTA* = 0x000007C9 + KEY_Greek_CAPITAL_KAPPA* = 0x000007CA + KEY_Greek_CAPITAL_LAMDA* = 0x000007CB + KEY_Greek_CAPITAL_LAMBDA* = 0x000007CB + KEY_Greek_CAPITAL_MU* = 0x000007CC + KEY_Greek_CAPITAL_NU* = 0x000007CD + KEY_Greek_CAPITAL_XI* = 0x000007CE + KEY_Greek_CAPITAL_OMICRON* = 0x000007CF + KEY_Greek_CAPITAL_PI* = 0x000007D0 + KEY_Greek_CAPITAL_RHO* = 0x000007D1 + KEY_Greek_CAPITAL_SIGMA* = 0x000007D2 + KEY_Greek_CAPITAL_TAU* = 0x000007D4 + KEY_Greek_CAPITAL_UPSILON* = 0x000007D5 + KEY_Greek_CAPITAL_PHI* = 0x000007D6 + KEY_Greek_CAPITAL_CHI* = 0x000007D7 + KEY_Greek_CAPITAL_PSI* = 0x000007D8 + KEY_Greek_CAPITAL_OMEGA* = 0x000007D9 + KEY_Greek_alpha* = 0x000007E1 + KEY_Greek_beta* = 0x000007E2 + KEY_Greek_gamma* = 0x000007E3 + KEY_Greek_delta* = 0x000007E4 + KEY_Greek_epsilon* = 0x000007E5 + KEY_Greek_zeta* = 0x000007E6 + KEY_Greek_eta* = 0x000007E7 + KEY_Greek_theta* = 0x000007E8 + KEY_Greek_iota* = 0x000007E9 + KEY_Greek_kappa* = 0x000007EA + KEY_Greek_lamda* = 0x000007EB + KEY_Greek_lambda* = 0x000007EB + KEY_Greek_mu* = 0x000007EC + KEY_Greek_nu* = 0x000007ED + KEY_Greek_xi* = 0x000007EE + KEY_Greek_omicron* = 0x000007EF + KEY_Greek_pi* = 0x000007F0 + KEY_Greek_rho* = 0x000007F1 + KEY_Greek_sigma* = 0x000007F2 + KEY_Greek_finalsmallsigma* = 0x000007F3 + KEY_Greek_tau* = 0x000007F4 + KEY_Greek_upsilon* = 0x000007F5 + KEY_Greek_phi* = 0x000007F6 + KEY_Greek_chi* = 0x000007F7 + KEY_Greek_psi* = 0x000007F8 + KEY_Greek_omega* = 0x000007F9 + KEY_Greek_switch* = 0x0000FF7E + KEY_leftradical* = 0x000008A1 + KEY_topleftradical* = 0x000008A2 + KEY_horizconnector* = 0x000008A3 + KEY_topintegral* = 0x000008A4 + KEY_botintegral* = 0x000008A5 + KEY_vertconnector* = 0x000008A6 + KEY_topleftsqbracket* = 0x000008A7 + KEY_botleftsqbracket* = 0x000008A8 + KEY_toprightsqbracket* = 0x000008A9 + KEY_botrightsqbracket* = 0x000008AA + KEY_topleftparens* = 0x000008AB + KEY_botleftparens* = 0x000008AC + KEY_toprightparens* = 0x000008AD + KEY_botrightparens* = 0x000008AE + KEY_leftmiddlecurlybrace* = 0x000008AF + KEY_rightmiddlecurlybrace* = 0x000008B0 + KEY_topleftsummation* = 0x000008B1 + KEY_botleftsummation* = 0x000008B2 + KEY_topvertsummationconnector* = 0x000008B3 + KEY_botvertsummationconnector* = 0x000008B4 + KEY_toprightsummation* = 0x000008B5 + KEY_botrightsummation* = 0x000008B6 + KEY_rightmiddlesummation* = 0x000008B7 + KEY_lessthanequal* = 0x000008BC + KEY_notequal* = 0x000008BD + KEY_greaterthanequal* = 0x000008BE + KEY_integral* = 0x000008BF + KEY_therefore* = 0x000008C0 + KEY_variation* = 0x000008C1 + KEY_infinity* = 0x000008C2 + KEY_nabla* = 0x000008C5 + KEY_approximate* = 0x000008C8 + KEY_similarequal* = 0x000008C9 + KEY_ifonlyif* = 0x000008CD + KEY_implies* = 0x000008CE + KEY_identical* = 0x000008CF + KEY_radical* = 0x000008D6 + KEY_includedin* = 0x000008DA + KEY_includes* = 0x000008DB + KEY_intersection* = 0x000008DC + KEY_union* = 0x000008DD + KEY_logicaland* = 0x000008DE + KEY_logicalor* = 0x000008DF + KEY_partialderivative* = 0x000008EF + KEY_function* = 0x000008F6 + KEY_leftarrow* = 0x000008FB + KEY_uparrow* = 0x000008FC + KEY_rightarrow* = 0x000008FD + KEY_downarrow* = 0x000008FE + KEY_blank* = 0x000009DF + KEY_soliddiamond* = 0x000009E0 + KEY_checkerboard* = 0x000009E1 + KEY_ht* = 0x000009E2 + KEY_ff* = 0x000009E3 + KEY_cr* = 0x000009E4 + KEY_lf* = 0x000009E5 + KEY_nl* = 0x000009E8 + KEY_vt* = 0x000009E9 + KEY_lowrightcorner* = 0x000009EA + KEY_uprightcorner* = 0x000009EB + KEY_upleftcorner* = 0x000009EC + KEY_lowleftcorner* = 0x000009ED + KEY_crossinglines* = 0x000009EE + KEY_horizlinescan1* = 0x000009EF + KEY_horizlinescan3* = 0x000009F0 + KEY_horizlinescan5* = 0x000009F1 + KEY_horizlinescan7* = 0x000009F2 + KEY_horizlinescan9* = 0x000009F3 + KEY_leftt* = 0x000009F4 + KEY_rightt* = 0x000009F5 + KEY_bott* = 0x000009F6 + KEY_topt* = 0x000009F7 + KEY_vertbar* = 0x000009F8 + KEY_emspace* = 0x00000AA1 + KEY_enspace* = 0x00000AA2 + KEY_em3space* = 0x00000AA3 + KEY_em4space* = 0x00000AA4 + KEY_digitspace* = 0x00000AA5 + KEY_punctspace* = 0x00000AA6 + KEY_thinspace* = 0x00000AA7 + KEY_hairspace* = 0x00000AA8 + KEY_emdash* = 0x00000AA9 + KEY_endash* = 0x00000AAA + KEY_signifblank* = 0x00000AAC + KEY_ellipsis* = 0x00000AAE + KEY_doubbaselinedot* = 0x00000AAF + KEY_onethird* = 0x00000AB0 + KEY_twothirds* = 0x00000AB1 + KEY_onefifth* = 0x00000AB2 + KEY_twofifths* = 0x00000AB3 + KEY_threefifths* = 0x00000AB4 + KEY_fourfifths* = 0x00000AB5 + KEY_onesixth* = 0x00000AB6 + KEY_fivesixths* = 0x00000AB7 + KEY_careof* = 0x00000AB8 + KEY_figdash* = 0x00000ABB + KEY_leftanglebracket* = 0x00000ABC + KEY_decimalpoint* = 0x00000ABD + KEY_rightanglebracket* = 0x00000ABE + KEY_marker* = 0x00000ABF + KEY_oneeighth* = 0x00000AC3 + KEY_threeeighths* = 0x00000AC4 + KEY_fiveeighths* = 0x00000AC5 + KEY_seveneighths* = 0x00000AC6 + KEY_trademark* = 0x00000AC9 + KEY_signaturemark* = 0x00000ACA + KEY_trademarkincircle* = 0x00000ACB + KEY_leftopentriangle* = 0x00000ACC + KEY_rightopentriangle* = 0x00000ACD + KEY_emopencircle* = 0x00000ACE + KEY_emopenrectangle* = 0x00000ACF + KEY_leftsinglequotemark* = 0x00000AD0 + KEY_rightsinglequotemark* = 0x00000AD1 + KEY_leftdoublequotemark* = 0x00000AD2 + KEY_rightdoublequotemark* = 0x00000AD3 + KEY_prescription* = 0x00000AD4 + KEY_minutes* = 0x00000AD6 + KEY_seconds* = 0x00000AD7 + KEY_latincross* = 0x00000AD9 + KEY_hexagram* = 0x00000ADA + KEY_filledrectbullet* = 0x00000ADB + KEY_filledlefttribullet* = 0x00000ADC + KEY_filledrighttribullet* = 0x00000ADD + KEY_emfilledcircle* = 0x00000ADE + KEY_emfilledrect* = 0x00000ADF + KEY_enopencircbullet* = 0x00000AE0 + KEY_enopensquarebullet* = 0x00000AE1 + KEY_openrectbullet* = 0x00000AE2 + KEY_opentribulletup* = 0x00000AE3 + KEY_opentribulletdown* = 0x00000AE4 + KEY_openstar* = 0x00000AE5 + KEY_enfilledcircbullet* = 0x00000AE6 + KEY_enfilledsqbullet* = 0x00000AE7 + KEY_filledtribulletup* = 0x00000AE8 + KEY_filledtribulletdown* = 0x00000AE9 + KEY_leftpointer* = 0x00000AEA + KEY_rightpointer* = 0x00000AEB + KEY_club* = 0x00000AEC + KEY_diamond* = 0x00000AED + KEY_heart* = 0x00000AEE + KEY_maltesecross* = 0x00000AF0 + KEY_dagger* = 0x00000AF1 + KEY_doubledagger* = 0x00000AF2 + KEY_checkmark* = 0x00000AF3 + KEY_ballotcross* = 0x00000AF4 + KEY_musicalsharp* = 0x00000AF5 + KEY_musicalflat* = 0x00000AF6 + KEY_malesymbol* = 0x00000AF7 + KEY_femalesymbol* = 0x00000AF8 + KEY_telephone* = 0x00000AF9 + KEY_telephonerecorder* = 0x00000AFA + KEY_phonographcopyright* = 0x00000AFB + KEY_caret* = 0x00000AFC + KEY_singlelowquotemark* = 0x00000AFD + KEY_doublelowquotemark* = 0x00000AFE + KEY_cursor* = 0x00000AFF + KEY_leftcaret* = 0x00000BA3 + KEY_rightcaret* = 0x00000BA6 + KEY_downcaret* = 0x00000BA8 + KEY_upcaret* = 0x00000BA9 + KEY_overbar* = 0x00000BC0 + KEY_downtack* = 0x00000BC2 + KEY_upshoe* = 0x00000BC3 + KEY_downstile* = 0x00000BC4 + KEY_underbar* = 0x00000BC6 + KEY_jot* = 0x00000BCA + KEY_quad* = 0x00000BCC + KEY_uptack* = 0x00000BCE + KEY_circle* = 0x00000BCF + KEY_upstile* = 0x00000BD3 + KEY_downshoe* = 0x00000BD6 + KEY_rightshoe* = 0x00000BD8 + KEY_leftshoe* = 0x00000BDA + KEY_lefttack* = 0x00000BDC + KEY_righttack* = 0x00000BFC + KEY_hebrew_doublelowline* = 0x00000CDF + KEY_hebrew_aleph* = 0x00000CE0 + KEY_hebrew_bet* = 0x00000CE1 + KEY_hebrew_beth* = 0x00000CE1 + KEY_hebrew_gimel* = 0x00000CE2 + KEY_hebrew_gimmel* = 0x00000CE2 + KEY_hebrew_dalet* = 0x00000CE3 + KEY_hebrew_daleth* = 0x00000CE3 + KEY_hebrew_he* = 0x00000CE4 + KEY_hebrew_waw* = 0x00000CE5 + KEY_hebrew_zain* = 0x00000CE6 + KEY_hebrew_zayin* = 0x00000CE6 + KEY_hebrew_chet* = 0x00000CE7 + KEY_hebrew_het* = 0x00000CE7 + KEY_hebrew_tet* = 0x00000CE8 + KEY_hebrew_teth* = 0x00000CE8 + KEY_hebrew_yod* = 0x00000CE9 + KEY_hebrew_finalkaph* = 0x00000CEA + KEY_hebrew_kaph* = 0x00000CEB + KEY_hebrew_lamed* = 0x00000CEC + KEY_hebrew_finalmem* = 0x00000CED + KEY_hebrew_mem* = 0x00000CEE + KEY_hebrew_finalnun* = 0x00000CEF + KEY_hebrew_nun* = 0x00000CF0 + KEY_hebrew_samech* = 0x00000CF1 + KEY_hebrew_samekh* = 0x00000CF1 + KEY_hebrew_ayin* = 0x00000CF2 + KEY_hebrew_finalpe* = 0x00000CF3 + KEY_hebrew_pe* = 0x00000CF4 + KEY_hebrew_finalzade* = 0x00000CF5 + KEY_hebrew_finalzadi* = 0x00000CF5 + KEY_hebrew_zade* = 0x00000CF6 + KEY_hebrew_zadi* = 0x00000CF6 + KEY_hebrew_qoph* = 0x00000CF7 + KEY_hebrew_kuf* = 0x00000CF7 + KEY_hebrew_resh* = 0x00000CF8 + KEY_hebrew_shin* = 0x00000CF9 + KEY_hebrew_taw* = 0x00000CFA + KEY_hebrew_taf* = 0x00000CFA + KEY_Hebrew_switch* = 0x0000FF7E + KEY_Thai_kokai* = 0x00000DA1 + KEY_Thai_khokhai* = 0x00000DA2 + KEY_Thai_khokhuat* = 0x00000DA3 + KEY_Thai_khokhwai* = 0x00000DA4 + KEY_Thai_khokhon* = 0x00000DA5 + KEY_Thai_khorakhang* = 0x00000DA6 + KEY_Thai_ngongu* = 0x00000DA7 + KEY_Thai_chochan* = 0x00000DA8 + KEY_Thai_choching* = 0x00000DA9 + KEY_Thai_chochang* = 0x00000DAA + KEY_Thai_soso* = 0x00000DAB + KEY_Thai_chochoe* = 0x00000DAC + KEY_Thai_yoying* = 0x00000DAD + KEY_Thai_dochada* = 0x00000DAE + KEY_Thai_topatak* = 0x00000DAF + KEY_Thai_thothan* = 0x00000DB0 + KEY_Thai_thonangmontho* = 0x00000DB1 + KEY_Thai_thophuthao* = 0x00000DB2 + KEY_Thai_nonen* = 0x00000DB3 + KEY_Thai_dodek* = 0x00000DB4 + KEY_Thai_totao* = 0x00000DB5 + KEY_Thai_thothung* = 0x00000DB6 + KEY_Thai_thothahan* = 0x00000DB7 + KEY_Thai_thothong* = 0x00000DB8 + KEY_Thai_nonu* = 0x00000DB9 + KEY_Thai_bobaimai* = 0x00000DBA + KEY_Thai_popla* = 0x00000DBB + KEY_Thai_phophung* = 0x00000DBC + KEY_Thai_fofa* = 0x00000DBD + KEY_Thai_phophan* = 0x00000DBE + KEY_Thai_fofan* = 0x00000DBF + KEY_Thai_phosamphao* = 0x00000DC0 + KEY_Thai_moma* = 0x00000DC1 + KEY_Thai_yoyak* = 0x00000DC2 + KEY_Thai_rorua* = 0x00000DC3 + KEY_Thai_ru* = 0x00000DC4 + KEY_Thai_loling* = 0x00000DC5 + KEY_Thai_lu* = 0x00000DC6 + KEY_Thai_wowaen* = 0x00000DC7 + KEY_Thai_sosala* = 0x00000DC8 + KEY_Thai_sorusi* = 0x00000DC9 + KEY_Thai_sosua* = 0x00000DCA + KEY_Thai_hohip* = 0x00000DCB + KEY_Thai_lochula* = 0x00000DCC + KEY_Thai_oang* = 0x00000DCD + KEY_Thai_honokhuk* = 0x00000DCE + KEY_Thai_paiyannoi* = 0x00000DCF + KEY_Thai_saraa* = 0x00000DD0 + KEY_Thai_maihanakat* = 0x00000DD1 + KEY_Thai_saraaa* = 0x00000DD2 + KEY_Thai_saraam* = 0x00000DD3 + KEY_Thai_sarai* = 0x00000DD4 + KEY_Thai_saraii* = 0x00000DD5 + KEY_Thai_saraue* = 0x00000DD6 + KEY_Thai_sarauee* = 0x00000DD7 + KEY_Thai_sarau* = 0x00000DD8 + KEY_Thai_sarauu* = 0x00000DD9 + KEY_Thai_phinthu* = 0x00000DDA + KEY_Thai_maihanakat_maitho* = 0x00000DDE + KEY_Thai_baht* = 0x00000DDF + KEY_Thai_sarae* = 0x00000DE0 + KEY_Thai_saraae* = 0x00000DE1 + KEY_Thai_sarao* = 0x00000DE2 + KEY_Thai_saraaimaimuan* = 0x00000DE3 + KEY_Thai_saraaimaimalai* = 0x00000DE4 + KEY_Thai_lakkhangyao* = 0x00000DE5 + KEY_Thai_maiyamok* = 0x00000DE6 + KEY_Thai_maitaikhu* = 0x00000DE7 + KEY_Thai_maiek* = 0x00000DE8 + KEY_Thai_maitho* = 0x00000DE9 + KEY_Thai_maitri* = 0x00000DEA + KEY_Thai_maichattawa* = 0x00000DEB + KEY_Thai_thanthakhat* = 0x00000DEC + KEY_Thai_nikhahit* = 0x00000DED + KEY_Thai_leksun* = 0x00000DF0 + KEY_Thai_leknung* = 0x00000DF1 + KEY_Thai_leksong* = 0x00000DF2 + KEY_Thai_leksam* = 0x00000DF3 + KEY_Thai_leksi* = 0x00000DF4 + KEY_Thai_lekha* = 0x00000DF5 + KEY_Thai_lekhok* = 0x00000DF6 + KEY_Thai_lekchet* = 0x00000DF7 + KEY_Thai_lekpaet* = 0x00000DF8 + KEY_Thai_lekkao* = 0x00000DF9 + KEY_Hangul* = 0x0000FF31 + KEY_Hangul_Start* = 0x0000FF32 + KEY_Hangul_End* = 0x0000FF33 + KEY_Hangul_Hanja* = 0x0000FF34 + KEY_Hangul_Jamo* = 0x0000FF35 + KEY_Hangul_Romaja* = 0x0000FF36 + KEY_Hangul_Codeinput* = 0x0000FF37 + KEY_Hangul_Jeonja* = 0x0000FF38 + KEY_Hangul_Banja* = 0x0000FF39 + KEY_Hangul_PreHanja* = 0x0000FF3A + KEY_Hangul_PostHanja* = 0x0000FF3B + KEY_Hangul_SingleCandidate* = 0x0000FF3C + KEY_Hangul_MultipleCandidate* = 0x0000FF3D + KEY_Hangul_PreviousCandidate* = 0x0000FF3E + KEY_Hangul_Special* = 0x0000FF3F + KEY_Hangul_switch* = 0x0000FF7E + KEY_Hangul_Kiyeog* = 0x00000EA1 + KEY_Hangul_SsangKiyeog* = 0x00000EA2 + KEY_Hangul_KiyeogSios* = 0x00000EA3 + KEY_Hangul_Nieun* = 0x00000EA4 + KEY_Hangul_NieunJieuj* = 0x00000EA5 + KEY_Hangul_NieunHieuh* = 0x00000EA6 + KEY_Hangul_Dikeud* = 0x00000EA7 + KEY_Hangul_SsangDikeud* = 0x00000EA8 + KEY_Hangul_Rieul* = 0x00000EA9 + KEY_Hangul_RieulKiyeog* = 0x00000EAA + KEY_Hangul_RieulMieum* = 0x00000EAB + KEY_Hangul_RieulPieub* = 0x00000EAC + KEY_Hangul_RieulSios* = 0x00000EAD + KEY_Hangul_RieulTieut* = 0x00000EAE + KEY_Hangul_RieulPhieuf* = 0x00000EAF + KEY_Hangul_RieulHieuh* = 0x00000EB0 + KEY_Hangul_Mieum* = 0x00000EB1 + KEY_Hangul_Pieub* = 0x00000EB2 + KEY_Hangul_SsangPieub* = 0x00000EB3 + KEY_Hangul_PieubSios* = 0x00000EB4 + KEY_Hangul_Sios* = 0x00000EB5 + KEY_Hangul_SsangSios* = 0x00000EB6 + KEY_Hangul_Ieung* = 0x00000EB7 + KEY_Hangul_Jieuj* = 0x00000EB8 + KEY_Hangul_SsangJieuj* = 0x00000EB9 + KEY_Hangul_Cieuc* = 0x00000EBA + KEY_Hangul_Khieuq* = 0x00000EBB + KEY_Hangul_Tieut* = 0x00000EBC + KEY_Hangul_Phieuf* = 0x00000EBD + KEY_Hangul_Hieuh* = 0x00000EBE + KEY_Hangul_A* = 0x00000EBF + KEY_Hangul_AE* = 0x00000EC0 + KEY_Hangul_YA* = 0x00000EC1 + KEY_Hangul_YAE* = 0x00000EC2 + KEY_Hangul_EO* = 0x00000EC3 + KEY_Hangul_E* = 0x00000EC4 + KEY_Hangul_YEO* = 0x00000EC5 + KEY_Hangul_YE* = 0x00000EC6 + KEY_Hangul_O* = 0x00000EC7 + KEY_Hangul_WA* = 0x00000EC8 + KEY_Hangul_WAE* = 0x00000EC9 + KEY_Hangul_OE* = 0x00000ECA + KEY_Hangul_YO* = 0x00000ECB + KEY_Hangul_U* = 0x00000ECC + KEY_Hangul_WEO* = 0x00000ECD + KEY_Hangul_WE* = 0x00000ECE + KEY_Hangul_WI* = 0x00000ECF + KEY_Hangul_YU* = 0x00000ED0 + KEY_Hangul_EU* = 0x00000ED1 + KEY_Hangul_YI* = 0x00000ED2 + KEY_Hangul_I* = 0x00000ED3 + KEY_Hangul_J_Kiyeog* = 0x00000ED4 + KEY_Hangul_J_SsangKiyeog* = 0x00000ED5 + KEY_Hangul_J_KiyeogSios* = 0x00000ED6 + KEY_Hangul_J_Nieun* = 0x00000ED7 + KEY_Hangul_J_NieunJieuj* = 0x00000ED8 + KEY_Hangul_J_NieunHieuh* = 0x00000ED9 + KEY_Hangul_J_Dikeud* = 0x00000EDA + KEY_Hangul_J_Rieul* = 0x00000EDB + KEY_Hangul_J_RieulKiyeog* = 0x00000EDC + KEY_Hangul_J_RieulMieum* = 0x00000EDD + KEY_Hangul_J_RieulPieub* = 0x00000EDE + KEY_Hangul_J_RieulSios* = 0x00000EDF + KEY_Hangul_J_RieulTieut* = 0x00000EE0 + KEY_Hangul_J_RieulPhieuf* = 0x00000EE1 + KEY_Hangul_J_RieulHieuh* = 0x00000EE2 + KEY_Hangul_J_Mieum* = 0x00000EE3 + KEY_Hangul_J_Pieub* = 0x00000EE4 + KEY_Hangul_J_PieubSios* = 0x00000EE5 + KEY_Hangul_J_Sios* = 0x00000EE6 + KEY_Hangul_J_SsangSios* = 0x00000EE7 + KEY_Hangul_J_Ieung* = 0x00000EE8 + KEY_Hangul_J_Jieuj* = 0x00000EE9 + KEY_Hangul_J_Cieuc* = 0x00000EEA + KEY_Hangul_J_Khieuq* = 0x00000EEB + KEY_Hangul_J_Tieut* = 0x00000EEC + KEY_Hangul_J_Phieuf* = 0x00000EED + KEY_Hangul_J_Hieuh* = 0x00000EEE + KEY_Hangul_RieulYeorinHieuh* = 0x00000EEF + KEY_Hangul_SunkyeongeumMieum* = 0x00000EF0 + KEY_Hangul_SunkyeongeumPieub* = 0x00000EF1 + KEY_Hangul_PanSios* = 0x00000EF2 + KEY_Hangul_KkogjiDalrinIeung* = 0x00000EF3 + KEY_Hangul_SunkyeongeumPhieuf* = 0x00000EF4 + KEY_Hangul_YeorinHieuh* = 0x00000EF5 + KEY_Hangul_AraeA* = 0x00000EF6 + KEY_Hangul_AraeAE* = 0x00000EF7 + KEY_Hangul_J_PanSios* = 0x00000EF8 + KEY_Hangul_J_KkogjiDalrinIeung* = 0x00000EF9 + KEY_Hangul_J_YeorinHieuh* = 0x00000EFA + KEY_Korean_Won* = 0x00000EFF + KEY_EcuSign* = 0x000020A0 + KEY_ColonSign* = 0x000020A1 + KEY_CruzeiroSign* = 0x000020A2 + KEY_FFrancSign* = 0x000020A3 + KEY_LiraSign* = 0x000020A4 + KEY_MillSign* = 0x000020A5 + KEY_NairaSign* = 0x000020A6 + KEY_PesetaSign* = 0x000020A7 + KEY_RupeeSign* = 0x000020A8 + KEY_WonSign* = 0x000020A9 + KEY_NewSheqelSign* = 0x000020AA + KEY_DongSign* = 0x000020AB + KEY_EuroSign* = 0x000020AC + +proc pango_context_get_for_screen*(screen: PScreen): PPangoContext{.cdecl, + dynlib: lib, importc: "gdk_pango_context_get_for_screen".} +proc pango_context_set_colormap*(context: PPangoContext, colormap: PColormap){. + cdecl, dynlib: lib, importc: "gdk_pango_context_set_colormap".} +proc pango_layout_line_get_clip_region*(line: PPangoLayoutLine, x_origin: gint, + y_origin: gint, index_ranges: Pgint, + n_ranges: gint): PRegion{.cdecl, + dynlib: lib, importc: "gdk_pango_layout_line_get_clip_region".} +proc pango_layout_get_clip_region*(layout: PPangoLayout, x_origin: gint, + y_origin: gint, index_ranges: Pgint, + n_ranges: gint): PRegion{.cdecl, dynlib: lib, + importc: "gdk_pango_layout_get_clip_region".} +proc pango_attr_stipple_new*(stipple: PBitmap): PPangoAttribute{.cdecl, + dynlib: lib, importc: "gdk_pango_attr_stipple_new".} +proc pango_attr_embossed_new*(embossed: gboolean): PPangoAttribute{.cdecl, + dynlib: lib, importc: "gdk_pango_attr_embossed_new".} +proc pixbuf_render_threshold_alpha*(pixbuf: PPixbuf, bitmap: PBitmap, + src_x: int32, src_y: int32, dest_x: int32, + dest_y: int32, width: int32, height: int32, + alpha_threshold: int32){.cdecl, dynlib: lib, + importc: "gdk_pixbuf_render_threshold_alpha".} +proc pixbuf_render_to_drawable*(pixbuf: PPixbuf, drawable: PDrawable, gc: PGC, + src_x: int32, src_y: int32, dest_x: int32, + dest_y: int32, width: int32, height: int32, + dither: TRgbDither, x_dither: int32, + y_dither: int32){.cdecl, dynlib: lib, + importc: "gdk_pixbuf_render_to_drawable".} +proc pixbuf_render_to_drawable_alpha*(pixbuf: PPixbuf, drawable: PDrawable, + src_x: int32, src_y: int32, dest_x: int32, + dest_y: int32, width: int32, + height: int32, + alpha_mode: TPixbufAlphaMode, + alpha_threshold: int32, + dither: TRgbDither, x_dither: int32, + y_dither: int32){.cdecl, dynlib: lib, + importc: "gdk_pixbuf_render_to_drawable_alpha".} +proc pixbuf_render_pixmap_and_mask_for_colormap*(pixbuf: PPixbuf, + colormap: PColormap, n: var PPixmap, nasdfdsafw4e: var PBitmap, + alpha_threshold: int32){.cdecl, dynlib: lib, importc: "gdk_pixbuf_render_pixmap_and_mask_for_colormap".} +proc pixbuf_get_from_drawable*(dest: PPixbuf, src: PDrawable, cmap: PColormap, + src_x: int32, src_y: int32, dest_x: int32, + dest_y: int32, width: int32, height: int32): PPixbuf{. + cdecl, dynlib: lib, importc: "gdk_pixbuf_get_from_drawable".} +proc pixbuf_get_from_image*(dest: PPixbuf, src: PImage, cmap: PColormap, + src_x: int32, src_y: int32, dest_x: int32, + dest_y: int32, width: int32, height: int32): PPixbuf{. + cdecl, dynlib: lib, importc: "gdk_pixbuf_get_from_image".} +proc TYPE_PIXMAP*(): GType +proc PIXMAP*(anObject: Pointer): PPixmap +proc PIXMAP_CLASS*(klass: Pointer): PPixmapObjectClass +proc IS_PIXMAP*(anObject: Pointer): bool +proc IS_PIXMAP_CLASS*(klass: Pointer): bool +proc PIXMAP_GET_CLASS*(obj: Pointer): PPixmapObjectClass +proc PIXMAP_OBJECT*(anObject: Pointer): PPixmapObject +proc pixmap_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_pixmap_get_type".} +proc pixmap_new*(window: PWindow, width: gint, height: gint, depth: gint): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_new".} +proc bitmap_create_from_data*(window: PWindow, data: cstring, width: gint, + height: gint): PBitmap{.cdecl, dynlib: lib, + importc: "gdk_bitmap_create_from_data".} +proc pixmap_create_from_data*(window: PWindow, data: cstring, width: gint, + height: gint, depth: gint, fg: PColor, bg: PColor): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_data".} +proc pixmap_create_from_xpm*(window: PWindow, k: var PBitmap, + transparent_color: PColor, filename: cstring): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_xpm".} +proc pixmap_colormap_create_from_xpm*(window: PWindow, colormap: PColormap, + k: var PBitmap, transparent_color: PColor, + filename: cstring): PPixmap{.cdecl, + dynlib: lib, importc: "gdk_pixmap_colormap_create_from_xpm".} +proc pixmap_create_from_xpm_d*(window: PWindow, k: var PBitmap, + transparent_color: PColor, data: PPgchar): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_create_from_xpm_d".} +proc pixmap_colormap_create_from_xpm_d*(window: PWindow, colormap: PColormap, + k: var PBitmap, + transparent_color: PColor, data: PPgchar): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_colormap_create_from_xpm_d".} +proc pixmap_foreign_new_for_display*(display: PDisplay, anid: TNativeWindow): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_foreign_new_for_display".} +proc pixmap_lookup_for_display*(display: PDisplay, anid: TNativeWindow): PPixmap{. + cdecl, dynlib: lib, importc: "gdk_pixmap_lookup_for_display".} +proc atom_intern*(atom_name: cstring, only_if_exists: gboolean): TAtom{.cdecl, + dynlib: lib, importc: "gdk_atom_intern".} +proc atom_name*(atom: TAtom): cstring{.cdecl, dynlib: lib, + importc: "gdk_atom_name".} +proc property_get*(window: PWindow, `property`: TAtom, `type`: TAtom, + offset: gulong, length: gulong, pdelete: gint, + actual_property_type: PAtom, actual_format: Pgint, + actual_length: Pgint, data: PPguchar): gboolean{.cdecl, + dynlib: lib, importc: "gdk_property_get".} +proc property_change*(window: PWindow, `property`: TAtom, `type`: TAtom, + format: gint, mode: TPropMode, data: Pguchar, + nelements: gint){.cdecl, dynlib: lib, + importc: "gdk_property_change".} +proc property_delete*(window: PWindow, `property`: TAtom){.cdecl, dynlib: lib, + importc: "gdk_property_delete".} +proc text_property_to_text_list_for_display*(display: PDisplay, encoding: TAtom, + format: gint, text: Pguchar, length: gint, t: var PPgchar): gint{.cdecl, + dynlib: lib, importc: "gdk_text_property_to_text_list_for_display".} +proc text_property_to_utf8_list_for_display*(display: PDisplay, encoding: TAtom, + format: gint, text: Pguchar, length: gint, t: var PPgchar): gint{.cdecl, + dynlib: lib, importc: "gdk_text_property_to_utf8_list_for_display".} +proc utf8_to_string_target*(str: cstring): cstring{.cdecl, dynlib: lib, + importc: "gdk_utf8_to_string_target".} +proc string_to_compound_text_for_display*(display: PDisplay, str: cstring, + encoding: PAtom, format: Pgint, ctext: PPguchar, length: Pgint): gint{. + cdecl, dynlib: lib, importc: "gdk_string_to_compound_text_for_display".} +proc utf8_to_compound_text_for_display*(display: PDisplay, str: cstring, + encoding: PAtom, format: Pgint, + ctext: PPguchar, length: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gdk_utf8_to_compound_text_for_display".} +proc free_text_list*(list: PPgchar){.cdecl, dynlib: lib, + importc: "gdk_free_text_list".} +proc free_compound_text*(ctext: Pguchar){.cdecl, dynlib: lib, + importc: "gdk_free_compound_text".} +proc region_new*(): PRegion{.cdecl, dynlib: lib, importc: "gdk_region_new".} +proc region_polygon*(points: PPoint, npoints: gint, fill_rule: TFillRule): PRegion{. + cdecl, dynlib: lib, importc: "gdk_region_polygon".} +proc region_copy*(region: PRegion): PRegion{.cdecl, dynlib: lib, + importc: "gdk_region_copy".} +proc region_rectangle*(rectangle: PRectangle): PRegion{.cdecl, dynlib: lib, + importc: "gdk_region_rectangle".} +proc region_destroy*(region: PRegion){.cdecl, dynlib: lib, + importc: "gdk_region_destroy".} +proc region_get_clipbox*(region: PRegion, rectangle: PRectangle){.cdecl, + dynlib: lib, importc: "gdk_region_get_clipbox".} +proc region_get_rectangles*(region: PRegion, s: var PRectangle, + n_rectangles: Pgint){.cdecl, dynlib: lib, + importc: "gdk_region_get_rectangles".} +proc region_empty*(region: PRegion): gboolean{.cdecl, dynlib: lib, + importc: "gdk_region_empty".} +proc region_equal*(region1: PRegion, region2: PRegion): gboolean{.cdecl, + dynlib: lib, importc: "gdk_region_equal".} +proc region_point_in*(region: PRegion, x: int32, y: int32): gboolean{.cdecl, + dynlib: lib, importc: "gdk_region_point_in".} +proc region_rect_in*(region: PRegion, rect: PRectangle): TOverlapType{.cdecl, + dynlib: lib, importc: "gdk_region_rect_in".} +proc region_offset*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib, + importc: "gdk_region_offset".} +proc region_shrink*(region: PRegion, dx: gint, dy: gint){.cdecl, dynlib: lib, + importc: "gdk_region_shrink".} +proc region_union_with_rect*(region: PRegion, rect: PRectangle){.cdecl, + dynlib: lib, importc: "gdk_region_union_with_rect".} +proc region_intersect*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, + importc: "gdk_region_intersect".} +proc region_union*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, + importc: "gdk_region_union".} +proc region_subtract*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, + importc: "gdk_region_subtract".} +proc region_xor*(source1: PRegion, source2: PRegion){.cdecl, dynlib: lib, + importc: "gdk_region_xor".} +proc region_spans_intersect_foreach*(region: PRegion, spans: PSpan, + n_spans: int32, sorted: gboolean, + `function`: TSpanFunc, data: gpointer){. + cdecl, dynlib: lib, importc: "gdk_region_spans_intersect_foreach".} +proc rgb_find_color*(colormap: PColormap, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_rgb_find_color".} +proc draw_rgb_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + width: gint, height: gint, dith: TRgbDither, + rgb_buf: Pguchar, rowstride: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_rgb_image".} +proc draw_rgb_image_dithalign*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + width: gint, height: gint, dith: TRgbDither, + rgb_buf: Pguchar, rowstride: gint, xdith: gint, + ydith: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_rgb_image_dithalign".} +proc draw_rgb_32_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + width: gint, height: gint, dith: TRgbDither, + buf: Pguchar, rowstride: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_rgb_32_image".} +proc draw_rgb_32_image_dithalign*(drawable: PDrawable, gc: PGC, x: gint, + y: gint, width: gint, height: gint, + dith: TRgbDither, buf: Pguchar, + rowstride: gint, xdith: gint, ydith: gint){. + cdecl, dynlib: lib, importc: "gdk_draw_rgb_32_image_dithalign".} +proc draw_gray_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + width: gint, height: gint, dith: TRgbDither, buf: Pguchar, + rowstride: gint){.cdecl, dynlib: lib, + importc: "gdk_draw_gray_image".} +proc draw_indexed_image*(drawable: PDrawable, gc: PGC, x: gint, y: gint, + width: gint, height: gint, dith: TRgbDither, + buf: Pguchar, rowstride: gint, cmap: PRgbCmap){.cdecl, + dynlib: lib, importc: "gdk_draw_indexed_image".} +proc rgb_cmap_new*(colors: Pguint32, n_colors: gint): PRgbCmap{.cdecl, + dynlib: lib, importc: "gdk_rgb_cmap_new".} +proc rgb_cmap_free*(cmap: PRgbCmap){.cdecl, dynlib: lib, + importc: "gdk_rgb_cmap_free".} +proc rgb_set_verbose*(verbose: gboolean){.cdecl, dynlib: lib, + importc: "gdk_rgb_set_verbose".} +proc rgb_set_install*(install: gboolean){.cdecl, dynlib: lib, + importc: "gdk_rgb_set_install".} +proc rgb_set_min_colors*(min_colors: gint){.cdecl, dynlib: lib, + importc: "gdk_rgb_set_min_colors".} +proc TYPE_DISPLAY*(): GType +proc DISPLAY_OBJECT*(anObject: pointer): PDisplay +proc DISPLAY_CLASS*(klass: pointer): PDisplayClass +proc IS_DISPLAY*(anObject: pointer): bool +proc IS_DISPLAY_CLASS*(klass: pointer): bool +proc DISPLAY_GET_CLASS*(obj: pointer): PDisplayClass +proc display_open*(display_name: cstring): PDisplay{.cdecl, dynlib: lib, + importc: "gdk_display_open".} +proc display_get_name*(display: PDisplay): cstring{.cdecl, dynlib: lib, + importc: "gdk_display_get_name".} +proc display_get_n_screens*(display: PDisplay): gint{.cdecl, dynlib: lib, + importc: "gdk_display_get_n_screens".} +proc display_get_screen*(display: PDisplay, screen_num: gint): PScreen{.cdecl, + dynlib: lib, importc: "gdk_display_get_screen".} +proc display_get_default_screen*(display: PDisplay): PScreen{.cdecl, + dynlib: lib, importc: "gdk_display_get_default_screen".} +proc display_pointer_ungrab*(display: PDisplay, time: guint32){.cdecl, + dynlib: lib, importc: "gdk_display_pointer_ungrab".} +proc display_keyboard_ungrab*(display: PDisplay, time: guint32){.cdecl, + dynlib: lib, importc: "gdk_display_keyboard_ungrab".} +proc display_pointer_is_grabbed*(display: PDisplay): gboolean{.cdecl, + dynlib: lib, importc: "gdk_display_pointer_is_grabbed".} +proc display_beep*(display: PDisplay){.cdecl, dynlib: lib, + importc: "gdk_display_beep".} +proc display_sync*(display: PDisplay){.cdecl, dynlib: lib, + importc: "gdk_display_sync".} +proc display_close*(display: PDisplay){.cdecl, dynlib: lib, + importc: "gdk_display_close".} +proc display_list_devices*(display: PDisplay): PGList{.cdecl, dynlib: lib, + importc: "gdk_display_list_devices".} +proc display_get_event*(display: PDisplay): PEvent{.cdecl, dynlib: lib, + importc: "gdk_display_get_event".} +proc display_peek_event*(display: PDisplay): PEvent{.cdecl, dynlib: lib, + importc: "gdk_display_peek_event".} +proc display_put_event*(display: PDisplay, event: PEvent){.cdecl, dynlib: lib, + importc: "gdk_display_put_event".} +proc display_add_client_message_filter*(display: PDisplay, message_type: TAtom, + func: TFilterFunc, data: gpointer){. + cdecl, dynlib: lib, importc: "gdk_display_add_client_message_filter".} +proc display_set_double_click_time*(display: PDisplay, msec: guint){.cdecl, + dynlib: lib, importc: "gdk_display_set_double_click_time".} +proc display_set_sm_client_id*(display: PDisplay, sm_client_id: cstring){.cdecl, + dynlib: lib, importc: "gdk_display_set_sm_client_id".} +proc set_default_display*(display: PDisplay){.cdecl, dynlib: lib, + importc: "gdk_set_default_display".} +proc get_default_display*(): PDisplay{.cdecl, dynlib: lib, + importc: "gdk_get_default_display".} +proc TYPE_SCREEN*(): GType +proc SCREEN*(anObject: Pointer): PScreen +proc SCREEN_CLASS*(klass: Pointer): PScreenClass +proc IS_SCREEN*(anObject: Pointer): bool +proc IS_SCREEN_CLASS*(klass: Pointer): bool +proc SCREEN_GET_CLASS*(obj: Pointer): PScreenClass +proc screen_get_default_colormap*(screen: PScreen): PColormap{.cdecl, + dynlib: lib, importc: "gdk_screen_get_default_colormap".} +proc screen_set_default_colormap*(screen: PScreen, colormap: PColormap){.cdecl, + dynlib: lib, importc: "gdk_screen_set_default_colormap".} +proc screen_get_system_colormap*(screen: PScreen): PColormap{.cdecl, + dynlib: lib, importc: "gdk_screen_get_system_colormap".} +proc screen_get_system_visual*(screen: PScreen): PVisual{.cdecl, dynlib: lib, + importc: "gdk_screen_get_system_visual".} +proc screen_get_rgb_colormap*(screen: PScreen): PColormap{.cdecl, dynlib: lib, + importc: "gdk_screen_get_rgb_colormap".} +proc screen_get_rgb_visual*(screen: PScreen): PVisual{.cdecl, dynlib: lib, + importc: "gdk_screen_get_rgb_visual".} +proc screen_get_root_window*(screen: PScreen): PWindow{.cdecl, dynlib: lib, + importc: "gdk_screen_get_root_window".} +proc screen_get_display*(screen: PScreen): PDisplay{.cdecl, dynlib: lib, + importc: "gdk_screen_get_display".} +proc screen_get_number*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_number".} +proc screen_get_window_at_pointer*(screen: PScreen, win_x: Pgint, win_y: Pgint): PWindow{. + cdecl, dynlib: lib, importc: "gdk_screen_get_window_at_pointer".} +proc screen_get_width*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_width".} +proc screen_get_height*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_height".} +proc screen_get_width_mm*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_width_mm".} +proc screen_get_height_mm*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_height_mm".} +proc screen_close*(screen: PScreen){.cdecl, dynlib: lib, + importc: "gdk_screen_close".} +proc screen_list_visuals*(screen: PScreen): PGList{.cdecl, dynlib: lib, + importc: "gdk_screen_list_visuals".} +proc screen_get_toplevel_windows*(screen: PScreen): PGList{.cdecl, dynlib: lib, + importc: "gdk_screen_get_toplevel_windows".} +proc screen_get_n_monitors*(screen: PScreen): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_get_n_monitors".} +proc screen_get_monitor_geometry*(screen: PScreen, monitor_num: gint, + dest: PRectangle){.cdecl, dynlib: lib, + importc: "gdk_screen_get_monitor_geometry".} +proc screen_get_monitor_at_point*(screen: PScreen, x: gint, y: gint): gint{. + cdecl, dynlib: lib, importc: "gdk_screen_get_monitor_at_point".} +proc screen_get_monitor_at_window*(screen: PScreen, window: PWindow): gint{. + cdecl, dynlib: lib, importc: "gdk_screen_get_monitor_at_window".} +proc screen_broadcast_client_message*(screen: PScreen, event: PEvent){.cdecl, + dynlib: lib, importc: "gdk_screen_broadcast_client_message".} +proc get_default_screen*(): PScreen{.cdecl, dynlib: lib, + importc: "gdk_get_default_screen".} +proc screen_get_setting*(screen: PScreen, name: cstring, value: PGValue): gboolean{. + cdecl, dynlib: lib, importc: "gdk_screen_get_setting".} +proc SELECTION_PRIMARY*(): TAtom +proc SELECTION_SECONDARY*(): TAtom +proc SELECTION_CLIPBOARD*(): TAtom +proc TARGET_BITMAP*(): TAtom +proc TARGET_COLORMAP*(): TAtom +proc TARGET_DRAWABLE*(): TAtom +proc TARGET_PIXMAP*(): TAtom +proc TARGET_STRING*(): TAtom +proc SELECTION_TYPE_ATOM*(): TAtom +proc SELECTION_TYPE_BITMAP*(): TAtom +proc SELECTION_TYPE_COLORMAP*(): TAtom +proc SELECTION_TYPE_DRAWABLE*(): TAtom +proc SELECTION_TYPE_INTEGER*(): TAtom +proc SELECTION_TYPE_PIXMAP*(): TAtom +proc SELECTION_TYPE_WINDOW*(): TAtom +proc SELECTION_TYPE_STRING*(): TAtom +proc selection_owner_set_for_display*(display: PDisplay, owner: PWindow, + selection: TAtom, time: guint32, + send_event: gboolean): gboolean{.cdecl, + dynlib: lib, importc: "gdk_selection_owner_set_for_display".} +proc selection_owner_get_for_display*(display: PDisplay, selection: TAtom): PWindow{. + cdecl, dynlib: lib, importc: "gdk_selection_owner_get_for_display".} +proc selection_convert*(requestor: PWindow, selection: TAtom, target: TAtom, + time: guint32){.cdecl, dynlib: lib, + importc: "gdk_selection_convert".} +proc selection_property_get*(requestor: PWindow, data: PPguchar, + prop_type: PAtom, prop_format: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gdk_selection_property_get".} +proc selection_send_notify_for_display*(display: PDisplay, requestor: guint32, + selection: TAtom, target: TAtom, + `property`: TAtom, time: guint32){. + cdecl, dynlib: lib, importc: "gdk_selection_send_notify_for_display".} +const + CURRENT_TIME* = 0 + PARENT_RELATIVE* = 1 + OK* = 0 + ERROR* = - (1) + ERROR_PARAM* = - (2) + ERROR_FILE* = - (3) + ERROR_MEM* = - (4) + SHIFT_MASK* = 1 shl 0 + LOCK_MASK* = 1 shl 1 + CONTROL_MASK* = 1 shl 2 + MOD1_MASK* = 1 shl 3 + MOD2_MASK* = 1 shl 4 + MOD3_MASK* = 1 shl 5 + MOD4_MASK* = 1 shl 6 + MOD5_MASK* = 1 shl 7 + BUTTON1_MASK* = 1 shl 8 + BUTTON2_MASK* = 1 shl 9 + BUTTON3_MASK* = 1 shl 10 + BUTTON4_MASK* = 1 shl 11 + BUTTON5_MASK* = 1 shl 12 + RELEASE_MASK* = 1 shl 30 + MODIFIER_MASK* = ord(RELEASE_MASK) or 0x00001FFF + INPUT_READ* = 1 shl 0 + INPUT_WRITE* = 1 shl 1 + INPUT_EXCEPTION* = 1 shl 2 + GRAB_SUCCESS* = 0 + GRAB_ALREADY_GRABBED* = 1 + GRAB_INVALID_TIME* = 2 + GRAB_NOT_VIEWABLE* = 3 + GRAB_FROZEN* = 4 + +proc ATOM_TO_POINTER*(atom: TAtom): Pointer +proc POINTER_TO_ATOM*(p: Pointer): TAtom +proc `MAKE_ATOM`*(val: guint): TAtom +proc NONE*(): TAtom +proc TYPE_VISUAL*(): GType +proc VISUAL*(anObject: Pointer): PVisual +proc VISUAL_CLASS*(klass: Pointer): PVisualClass +proc IS_VISUAL*(anObject: Pointer): bool +proc IS_VISUAL_CLASS*(klass: Pointer): bool +proc VISUAL_GET_CLASS*(obj: Pointer): PVisualClass +proc visual_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_visual_get_type".} +const + WA_TITLE* = 1 shl 1 + WA_X* = 1 shl 2 + WA_Y* = 1 shl 3 + WA_CURSOR* = 1 shl 4 + WA_COLORMAP* = 1 shl 5 + WA_VISUAL* = 1 shl 6 + WA_WMCLASS* = 1 shl 7 + WA_NOREDIR* = 1 shl 8 + HINT_POS* = 1 shl 0 + HINT_MIN_SIZE* = 1 shl 1 + HINT_MAX_SIZE* = 1 shl 2 + HINT_BASE_SIZE* = 1 shl 3 + HINT_ASPECT* = 1 shl 4 + HINT_RESIZE_INC* = 1 shl 5 + HINT_WIN_GRAVITY* = 1 shl 6 + HINT_USER_POS* = 1 shl 7 + HINT_USER_SIZE* = 1 shl 8 + DECOR_ALL* = 1 shl 0 + DECOR_BORDER* = 1 shl 1 + DECOR_RESIZEH* = 1 shl 2 + DECOR_TITLE* = 1 shl 3 + DECOR_MENU* = 1 shl 4 + DECOR_MINIMIZE* = 1 shl 5 + DECOR_MAXIMIZE* = 1 shl 6 + FUNC_ALL* = 1 shl 0 + FUNC_RESIZE* = 1 shl 1 + FUNC_MOVE* = 1 shl 2 + FUNC_MINIMIZE* = 1 shl 3 + FUNC_MAXIMIZE* = 1 shl 4 + FUNC_CLOSE* = 1 shl 5 + GRAVITY_NORTH_WEST* = 1 + GRAVITY_NORTH* = 2 + GRAVITY_NORTH_EAST* = 3 + GRAVITY_WEST* = 4 + GRAVITY_CENTER* = 5 + GRAVITY_EAST* = 6 + GRAVITY_SOUTH_WEST* = 7 + GRAVITY_SOUTH* = 8 + GRAVITY_SOUTH_EAST* = 9 + GRAVITY_STATIC* = 10 + +proc TYPE_WINDOW*(): GType +proc WINDOW*(anObject: Pointer): PWindow +proc WINDOW_CLASS*(klass: Pointer): PWindowObjectClass +proc IS_WINDOW*(anObject: Pointer): bool +proc IS_WINDOW_CLASS*(klass: Pointer): bool +proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass +proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject +const + bm_TGdkWindowObject_guffaw_gravity* = 0x0001'i16 + bp_TGdkWindowObject_guffaw_gravity* = 0'i16 + bm_TGdkWindowObject_input_only* = 0x0002'i16 + bp_TGdkWindowObject_input_only* = 1'i16 + bm_TGdkWindowObject_modal_hint* = 0x0004'i16 + bp_TGdkWindowObject_modal_hint* = 2'i16 + bm_TGdkWindowObject_destroyed* = 0x0018'i16 + bp_TGdkWindowObject_destroyed* = 3'i16 + +proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint +proc WindowObject_set_guffaw_gravity*(a: var TWindowObject, + `guffaw_gravity`: guint) +proc WindowObject_input_only*(a: var TWindowObject): guint +proc WindowObject_set_input_only*(a: var TWindowObject, `input_only`: guint) +proc WindowObject_modal_hint*(a: var TWindowObject): guint +proc WindowObject_set_modal_hint*(a: var TWindowObject, `modal_hint`: guint) +proc WindowObject_destroyed*(a: var TWindowObject): guint +proc WindowObject_set_destroyed*(a: var TWindowObject, `destroyed`: guint) +proc window_object_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_window_object_get_type".} +proc window_new*(parent: PWindow, attributes: PWindowAttr, attributes_mask: gint): PWindow{. + cdecl, dynlib: lib, importc: "gdk_window_new".} +proc window_destroy*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_destroy".} +proc window_get_window_type*(window: PWindow): TWindowType{.cdecl, dynlib: lib, + importc: "gdk_window_get_window_type".} +proc window_at_pointer*(win_x: Pgint, win_y: Pgint): PWindow{.cdecl, + dynlib: lib, importc: "gdk_window_at_pointer".} +proc window_show*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_show".} +proc window_hide*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_hide".} +proc window_withdraw*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_withdraw".} +proc window_show_unraised*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_show_unraised".} +proc window_move*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gdk_window_move".} +proc window_resize*(window: PWindow, width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gdk_window_resize".} +proc window_move_resize*(window: PWindow, x: gint, y: gint, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gdk_window_move_resize".} +proc window_reparent*(window: PWindow, new_parent: PWindow, x: gint, y: gint){. + cdecl, dynlib: lib, importc: "gdk_window_reparent".} +proc window_clear*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_clear".} +proc window_clear_area*(window: PWindow, x: gint, y: gint, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gdk_window_clear_area".} +proc window_clear_area_e*(window: PWindow, x: gint, y: gint, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gdk_window_clear_area_e".} +proc window_raise*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_raise".} +proc window_lower*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_lower".} +proc window_focus*(window: PWindow, timestamp: guint32){.cdecl, dynlib: lib, + importc: "gdk_window_focus".} +proc window_set_user_data*(window: PWindow, user_data: gpointer){.cdecl, + dynlib: lib, importc: "gdk_window_set_user_data".} +proc window_set_override_redirect*(window: PWindow, override_redirect: gboolean){. + cdecl, dynlib: lib, importc: "gdk_window_set_override_redirect".} +proc window_add_filter*(window: PWindow, `function`: TFilterFunc, data: gpointer){. + cdecl, dynlib: lib, importc: "gdk_window_add_filter".} +proc window_remove_filter*(window: PWindow, `function`: TFilterFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gdk_window_remove_filter".} +proc window_scroll*(window: PWindow, dx: gint, dy: gint){.cdecl, dynlib: lib, + importc: "gdk_window_scroll".} +proc window_shape_combine_mask*(window: PWindow, mask: PBitmap, x: gint, y: gint){. + cdecl, dynlib: lib, importc: "gdk_window_shape_combine_mask".} +proc window_shape_combine_region*(window: PWindow, shape_region: PRegion, + offset_x: gint, offset_y: gint){.cdecl, + dynlib: lib, importc: "gdk_window_shape_combine_region".} +proc window_set_child_shapes*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_set_child_shapes".} +proc window_merge_child_shapes*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_merge_child_shapes".} +proc window_is_visible*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gdk_window_is_visible".} +proc window_is_viewable*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gdk_window_is_viewable".} +proc window_get_state*(window: PWindow): TWindowState{.cdecl, dynlib: lib, + importc: "gdk_window_get_state".} +proc window_set_static_gravities*(window: PWindow, use_static: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gdk_window_set_static_gravities".} +proc window_foreign_new_for_display*(display: PDisplay, anid: TNativeWindow): PWindow{. + cdecl, dynlib: lib, importc: "gdk_window_foreign_new_for_display".} +proc window_lookup_for_display*(display: PDisplay, anid: TNativeWindow): PWindow{. + cdecl, dynlib: lib, importc: "gdk_window_lookup_for_display".} +proc window_set_type_hint*(window: PWindow, hint: TWindowTypeHint){.cdecl, + dynlib: lib, importc: "gdk_window_set_type_hint".} +proc window_set_modal_hint*(window: PWindow, modal: gboolean){.cdecl, + dynlib: lib, importc: "gdk_window_set_modal_hint".} +proc window_set_geometry_hints*(window: PWindow, geometry: PGeometry, + geom_mask: TWindowHints){.cdecl, dynlib: lib, + importc: "gdk_window_set_geometry_hints".} +proc set_sm_client_id*(sm_client_id: cstring){.cdecl, dynlib: lib, + importc: "gdk_set_sm_client_id".} +proc window_begin_paint_rect*(window: PWindow, rectangle: PRectangle){.cdecl, + dynlib: lib, importc: "gdk_window_begin_paint_rect".} +proc window_begin_paint_region*(window: PWindow, region: PRegion){.cdecl, + dynlib: lib, importc: "gdk_window_begin_paint_region".} +proc window_end_paint*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_end_paint".} +proc window_set_title*(window: PWindow, title: cstring){.cdecl, dynlib: lib, + importc: "gdk_window_set_title".} +proc window_set_role*(window: PWindow, role: cstring){.cdecl, dynlib: lib, + importc: "gdk_window_set_role".} +proc window_set_transient_for*(window: PWindow, parent: PWindow){.cdecl, + dynlib: lib, importc: "gdk_window_set_transient_for".} +proc window_set_background*(window: PWindow, color: PColor){.cdecl, dynlib: lib, + importc: "gdk_window_set_background".} +proc window_set_back_pixmap*(window: PWindow, pixmap: PPixmap, + parent_relative: gboolean){.cdecl, dynlib: lib, + importc: "gdk_window_set_back_pixmap".} +proc window_set_cursor*(window: PWindow, cursor: PCursor){.cdecl, dynlib: lib, + importc: "gdk_window_set_cursor".} +proc window_get_user_data*(window: PWindow, data: gpointer){.cdecl, dynlib: lib, + importc: "gdk_window_get_user_data".} +proc window_get_geometry*(window: PWindow, x: Pgint, y: Pgint, width: Pgint, + height: Pgint, depth: Pgint){.cdecl, dynlib: lib, + importc: "gdk_window_get_geometry".} +proc window_get_position*(window: PWindow, x: Pgint, y: Pgint){.cdecl, + dynlib: lib, importc: "gdk_window_get_position".} +proc window_get_origin*(window: PWindow, x: Pgint, y: Pgint): gint{.cdecl, + dynlib: lib, importc: "gdk_window_get_origin".} +proc window_get_root_origin*(window: PWindow, x: Pgint, y: Pgint){.cdecl, + dynlib: lib, importc: "gdk_window_get_root_origin".} +proc window_get_frame_extents*(window: PWindow, rect: PRectangle){.cdecl, + dynlib: lib, importc: "gdk_window_get_frame_extents".} +proc window_get_pointer*(window: PWindow, x: Pgint, y: Pgint, + mask: PModifierType): PWindow{.cdecl, dynlib: lib, + importc: "gdk_window_get_pointer".} +proc window_get_parent*(window: PWindow): PWindow{.cdecl, dynlib: lib, + importc: "gdk_window_get_parent".} +proc window_get_toplevel*(window: PWindow): PWindow{.cdecl, dynlib: lib, + importc: "gdk_window_get_toplevel".} +proc window_get_children*(window: PWindow): PGList{.cdecl, dynlib: lib, + importc: "gdk_window_get_children".} +proc window_peek_children*(window: PWindow): PGList{.cdecl, dynlib: lib, + importc: "gdk_window_peek_children".} +proc window_get_events*(window: PWindow): TEventMask{.cdecl, dynlib: lib, + importc: "gdk_window_get_events".} +proc window_set_events*(window: PWindow, event_mask: TEventMask){.cdecl, + dynlib: lib, importc: "gdk_window_set_events".} +proc window_set_icon_list*(window: PWindow, pixbufs: PGList){.cdecl, + dynlib: lib, importc: "gdk_window_set_icon_list".} +proc window_set_icon*(window: PWindow, icon_window: PWindow, pixmap: PPixmap, + mask: PBitmap){.cdecl, dynlib: lib, + importc: "gdk_window_set_icon".} +proc window_set_icon_name*(window: PWindow, name: cstring){.cdecl, dynlib: lib, + importc: "gdk_window_set_icon_name".} +proc window_set_group*(window: PWindow, leader: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_set_group".} +proc window_set_decorations*(window: PWindow, decorations: TWMDecoration){. + cdecl, dynlib: lib, importc: "gdk_window_set_decorations".} +proc window_get_decorations*(window: PWindow, decorations: PWMDecoration): gboolean{. + cdecl, dynlib: lib, importc: "gdk_window_get_decorations".} +proc window_set_functions*(window: PWindow, functions: TWMFunction){.cdecl, + dynlib: lib, importc: "gdk_window_set_functions".} +proc window_iconify*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_iconify".} +proc window_deiconify*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_deiconify".} +proc window_stick*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_stick".} +proc window_unstick*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_unstick".} +proc window_maximize*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_maximize".} +proc window_unmaximize*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_unmaximize".} +proc window_register_dnd*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_register_dnd".} +proc window_begin_resize_drag*(window: PWindow, edge: TWindowEdge, button: gint, + root_x: gint, root_y: gint, timestamp: guint32){. + cdecl, dynlib: lib, importc: "gdk_window_begin_resize_drag".} +proc window_begin_move_drag*(window: PWindow, button: gint, root_x: gint, + root_y: gint, timestamp: guint32){.cdecl, + dynlib: lib, importc: "gdk_window_begin_move_drag".} +proc window_invalidate_rect*(window: PWindow, rect: PRectangle, + invalidate_children: gboolean){.cdecl, dynlib: lib, + importc: "gdk_window_invalidate_rect".} +proc window_invalidate_region*(window: PWindow, region: PRegion, + invalidate_children: gboolean){.cdecl, + dynlib: lib, importc: "gdk_window_invalidate_region".} +proc window_invalidate_maybe_recurse*(window: PWindow, region: PRegion, + child_func: window_invalidate_maybe_recurse_child_func, user_data: gpointer){. + cdecl, dynlib: lib, importc: "gdk_window_invalidate_maybe_recurse".} +proc window_get_update_area*(window: PWindow): PRegion{.cdecl, dynlib: lib, + importc: "gdk_window_get_update_area".} +proc window_freeze_updates*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_freeze_updates".} +proc window_thaw_updates*(window: PWindow){.cdecl, dynlib: lib, + importc: "gdk_window_thaw_updates".} +proc window_process_all_updates*(){.cdecl, dynlib: lib, + importc: "gdk_window_process_all_updates".} +proc window_process_updates*(window: PWindow, update_children: gboolean){.cdecl, + dynlib: lib, importc: "gdk_window_process_updates".} +proc window_set_debug_updates*(setting: gboolean){.cdecl, dynlib: lib, + importc: "gdk_window_set_debug_updates".} +proc window_constrain_size*(geometry: PGeometry, flags: guint, width: gint, + height: gint, new_width: Pgint, new_height: Pgint){. + cdecl, dynlib: lib, importc: "gdk_window_constrain_size".} +proc window_get_internal_paint_info*(window: PWindow, e: var PDrawable, + x_offset: Pgint, y_offset: Pgint){.cdecl, + dynlib: lib, importc: "gdk_window_get_internal_paint_info".} +proc set_pointer_hooks*(new_hooks: PPointerHooks): PPointerHooks{.cdecl, + dynlib: lib, importc: "gdk_set_pointer_hooks".} +proc get_default_root_window*(): PWindow{.cdecl, dynlib: lib, + importc: "gdk_get_default_root_window".} +proc parse_args*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: lib, + importc: "gdk_parse_args".} +proc init*(argc: Pgint, v: var PPgchar){.cdecl, dynlib: lib, importc: "gdk_init".} +proc init_check*(argc: Pgint, v: var PPgchar): gboolean{.cdecl, dynlib: lib, + importc: "gdk_init_check".} +when not defined(DISABLE_DEPRECATED): + proc exit*(error_code: gint){.cdecl, dynlib: lib, importc: "gdk_exit".} +proc set_locale*(): cstring{.cdecl, dynlib: lib, importc: "gdk_set_locale".} +proc get_program_class*(): cstring{.cdecl, dynlib: lib, + importc: "gdk_get_program_class".} +proc set_program_class*(program_class: cstring){.cdecl, dynlib: lib, + importc: "gdk_set_program_class".} +proc error_trap_push*(){.cdecl, dynlib: lib, importc: "gdk_error_trap_push".} +proc error_trap_pop*(): gint{.cdecl, dynlib: lib, importc: "gdk_error_trap_pop".} +when not defined(DISABLE_DEPRECATED): + proc set_use_xshm*(use_xshm: gboolean){.cdecl, dynlib: lib, + importc: "gdk_set_use_xshm".} + proc get_use_xshm*(): gboolean{.cdecl, dynlib: lib, + importc: "gdk_get_use_xshm".} +proc get_display*(): cstring{.cdecl, dynlib: lib, importc: "gdk_get_display".} +proc get_display_arg_name*(): cstring{.cdecl, dynlib: lib, + importc: "gdk_get_display_arg_name".} +when not defined(DISABLE_DEPRECATED): + proc input_add_full*(source: gint, condition: TInputCondition, + `function`: TInputFunction, data: gpointer, + destroy: TDestroyNotify): gint{.cdecl, dynlib: lib, + importc: "gdk_input_add_full".} + proc input_add*(source: gint, condition: TInputCondition, + `function`: TInputFunction, data: gpointer): gint{.cdecl, + dynlib: lib, importc: "gdk_input_add".} + proc input_remove*(tag: gint){.cdecl, dynlib: lib, importc: "gdk_input_remove".} +proc pointer_grab*(window: PWindow, owner_events: gboolean, + event_mask: TEventMask, confine_to: PWindow, cursor: PCursor, + time: guint32): TGrabStatus{.cdecl, dynlib: lib, + importc: "gdk_pointer_grab".} +proc keyboard_grab*(window: PWindow, owner_events: gboolean, time: guint32): TGrabStatus{. + cdecl, dynlib: lib, importc: "gdk_keyboard_grab".} +when not defined(MULTIHEAD_SAFE): + proc pointer_ungrab*(time: guint32){.cdecl, dynlib: lib, + importc: "gdk_pointer_ungrab".} + proc keyboard_ungrab*(time: guint32){.cdecl, dynlib: lib, + importc: "gdk_keyboard_ungrab".} + proc pointer_is_grabbed*(): gboolean{.cdecl, dynlib: lib, + importc: "gdk_pointer_is_grabbed".} + proc screen_width*(): gint{.cdecl, dynlib: lib, importc: "gdk_screen_width".} + proc screen_height*(): gint{.cdecl, dynlib: lib, importc: "gdk_screen_height".} + proc screen_width_mm*(): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_width_mm".} + proc screen_height_mm*(): gint{.cdecl, dynlib: lib, + importc: "gdk_screen_height_mm".} + proc beep*(){.cdecl, dynlib: lib, importc: "gdk_beep".} +proc flush*(){.cdecl, dynlib: lib, importc: "gdk_flush".} +when not defined(MULTIHEAD_SAFE): + proc set_double_click_time*(msec: guint){.cdecl, dynlib: lib, + importc: "gdk_set_double_click_time".} +proc rectangle_intersect*(src1: PRectangle, src2: PRectangle, dest: PRectangle): gboolean{. + cdecl, dynlib: lib, importc: "gdk_rectangle_intersect".} +proc rectangle_union*(src1: PRectangle, src2: PRectangle, dest: PRectangle){. + cdecl, dynlib: lib, importc: "gdk_rectangle_union".} +proc rectangle_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gdk_rectangle_get_type".} +proc TYPE_RECTANGLE*(): GType +proc wcstombs*(src: PWChar): cstring{.cdecl, dynlib: lib, + importc: "gdk_wcstombs".} +proc mbstowcs*(dest: PWChar, src: cstring, dest_max: gint): gint{.cdecl, + dynlib: lib, importc: "gdk_mbstowcs".} +when not defined(MULTIHEAD_SAFE): + proc event_send_client_message*(event: PEvent, xid: guint32): gboolean{.cdecl, + dynlib: lib, importc: "gdk_event_send_client_message".} + proc event_send_clientmessage_toall*(event: PEvent){.cdecl, dynlib: lib, + importc: "gdk_event_send_clientmessage_toall".} +proc event_send_client_message_for_display*(display: PDisplay, event: PEvent, + xid: guint32): gboolean{.cdecl, dynlib: lib, importc: "gdk_event_send_client_message_for_display".} +proc threads_enter*(){.cdecl, dynlib: lib, importc: "gdk_threads_enter".} +proc threads_leave*(){.cdecl, dynlib: lib, importc: "gdk_threads_leave".} +proc threads_init*(){.cdecl, dynlib: lib, importc: "gdk_threads_init".} +proc TYPE_RECTANGLE*(): GType = + result = rectangle_get_type() + +proc TYPE_COLORMAP*(): GType = + result = colormap_get_type() + +proc COLORMAP*(anObject: pointer): PColormap = + result = cast[PColormap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_COLORMAP())) + +proc COLORMAP_CLASS*(klass: pointer): PColormapClass = + result = cast[PColormapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_COLORMAP())) + +proc IS_COLORMAP*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_COLORMAP()) + +proc IS_COLORMAP_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_COLORMAP()) + +proc COLORMAP_GET_CLASS*(obj: pointer): PColormapClass = + result = cast[PColormapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_COLORMAP())) + +proc TYPE_COLOR*(): GType = + result = color_get_type() + +proc cursor_destroy*(cursor: PCursor) = + cursor_unref(cursor) + +proc TYPE_CURSOR*(): GType = + result = cursor_get_type() + +proc TYPE_DRAG_CONTEXT*(): GType = + result = drag_context_get_type() + +proc DRAG_CONTEXT*(anObject: Pointer): PDragContext = + result = cast[PDragContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, + TYPE_DRAG_CONTEXT())) + +proc DRAG_CONTEXT_CLASS*(klass: Pointer): PDragContextClass = + result = cast[PDragContextClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_DRAG_CONTEXT())) + +proc IS_DRAG_CONTEXT*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DRAG_CONTEXT()) + +proc IS_DRAG_CONTEXT_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DRAG_CONTEXT()) + +proc DRAG_CONTEXT_GET_CLASS*(obj: Pointer): PDragContextClass = + result = cast[PDragContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_DRAG_CONTEXT())) + +proc region_EXTENTCHECK*(r1, r2: PRegionBox): bool = + result = ((r1.x2) > r2.x1) and ((r1.x1) < r2.x2) and ((r1.y2) > r2.y1) and + ((r1.y1) < r2.y2) + +proc region_EXTENTS*(r: PRegionBox, idRect: PRegion) = + if ((r.x1) < idRect.extents.x1): + idRect.extents.x1 = r.x1 + if (r.y1) < idRect.extents.y1: + idRect.extents.y1 = r.y1 + if (r.x2) > idRect.extents.x2: + idRect.extents.x2 = r.x2 + +proc region_MEMCHECK*(reg: PRegion, ARect, firstrect: var PRegionBox): bool = + assert(false) # to implement + +proc region_CHECK_PREVIOUS*(Reg: PRegion, R: PRegionBox, + Rx1, Ry1, Rx2, Ry2: gint): bool = + assert(false) # to implement + +proc region_ADDRECT*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) = + if (((rx1) < rx2) and ((ry1) < ry2) and + region_CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): + r.x1 = rx1 + r.y1 = ry1 + r.x2 = rx2 + r.y2 = ry2 + +proc region_ADDRECTNOX*(reg: PRegion, r: PRegionBox, rx1, ry1, rx2, ry2: gint) = + if (((rx1) < rx2) and ((ry1) < ry2) and + region_CHECK_PREVIOUS(reg, r, rx1, ry1, rx2, ry2)): + r.x1 = rx1 + r.y1 = ry1 + r.x2 = rx2 + r.y2 = ry2 + inc(reg.numRects) + +proc region_EMPTY_REGION*(pReg: PRegion): bool = + result = pReg.numRects == 0'i32 + +proc region_REGION_NOT_EMPTY*(pReg: PRegion): bool = + result = pReg.numRects != 0'i32 + +proc region_INBOX*(r: TRegionBox, x, y: gint): bool = + result = ((((r.x2) > x) and ((r.x1) <= x)) and ((r.y2) > y)) and + ((r.y1) <= y) + +proc TYPE_DRAWABLE*(): GType = + result = drawable_get_type() + +proc DRAWABLE*(anObject: Pointer): PDrawable = + result = cast[PDrawable](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DRAWABLE())) + +proc DRAWABLE_CLASS*(klass: Pointer): PDrawableClass = + result = cast[PDrawableClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DRAWABLE())) + +proc IS_DRAWABLE*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DRAWABLE()) + +proc IS_DRAWABLE_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DRAWABLE()) + +proc DRAWABLE_GET_CLASS*(obj: Pointer): PDrawableClass = + result = cast[PDrawableClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DRAWABLE())) + +proc draw_pixmap*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, + ysrc: gint, xdest: gint, ydest: gint, width: gint, + height: gint) = + draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height) + +proc draw_bitmap*(drawable: PDrawable, gc: PGC, src: PDrawable, xsrc: gint, + ysrc: gint, xdest: gint, ydest: gint, width: gint, + height: gint) = + draw_drawable(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height) + +proc TYPE_EVENT*(): GType = + result = event_get_type() + +proc TYPE_FONT*(): GType = + result = font_get_type() + +proc TYPE_GC*(): GType = + result = gc_get_type() + +proc GC*(anObject: Pointer): PGC = + result = cast[PGC](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_GC())) + +proc GC_CLASS*(klass: Pointer): PGCClass = + result = cast[PGCClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_GC())) + +proc IS_GC*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_GC()) + +proc IS_GC_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_GC()) + +proc GC_GET_CLASS*(obj: Pointer): PGCClass = + result = cast[PGCClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_GC())) + +proc gc_destroy*(gc: PGC) = + g_object_unref(G_OBJECT(gc)) + +proc TYPE_IMAGE*(): GType = + result = image_get_type() + +proc IMAGE*(anObject: Pointer): PImage = + result = cast[PImage](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_IMAGE())) + +proc IMAGE_CLASS*(klass: Pointer): PImageClass = + result = cast[PImageClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_IMAGE())) + +proc IS_IMAGE*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_IMAGE()) + +proc IS_IMAGE_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_IMAGE()) + +proc IMAGE_GET_CLASS*(obj: Pointer): PImageClass = + result = cast[PImageClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_IMAGE())) + +proc image_destroy*(image: PImage) = + g_object_unref(G_OBJECT(image)) + +proc TYPE_DEVICE*(): GType = + result = device_get_type() + +proc DEVICE*(anObject: Pointer): PDevice = + result = cast[PDevice](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DEVICE())) + +proc DEVICE_CLASS*(klass: Pointer): PDeviceClass = + result = cast[PDeviceClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DEVICE())) + +proc IS_DEVICE*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DEVICE()) + +proc IS_DEVICE_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DEVICE()) + +proc DEVICE_GET_CLASS*(obj: Pointer): PDeviceClass = + result = cast[PDeviceClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DEVICE())) + +proc TYPE_KEYMAP*(): GType = + result = keymap_get_type() + +proc KEYMAP*(anObject: Pointer): PKeymap = + result = cast[PKeymap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_KEYMAP())) + +proc KEYMAP_CLASS*(klass: Pointer): PKeymapClass = + result = cast[PKeymapClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_KEYMAP())) + +proc IS_KEYMAP*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_KEYMAP()) + +proc IS_KEYMAP_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_KEYMAP()) + +proc KEYMAP_GET_CLASS*(obj: Pointer): PKeymapClass = + result = cast[PKeymapClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_KEYMAP())) + +proc TYPE_PIXMAP*(): GType = + result = pixmap_get_type() + +proc PIXMAP*(anObject: Pointer): PPixmap = + result = cast[PPixmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_PIXMAP())) + +proc PIXMAP_CLASS*(klass: Pointer): PPixmapObjectClass = + result = cast[PPixmapObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_PIXMAP())) + +proc IS_PIXMAP*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_PIXMAP()) + +proc IS_PIXMAP_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_PIXMAP()) + +proc PIXMAP_GET_CLASS*(obj: Pointer): PPixmapObjectClass = + result = cast[PPixmapObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_PIXMAP())) + +proc PIXMAP_OBJECT*(anObject: Pointer): PPixmapObject = + result = cast[PPixmapObject](PIXMAP(anObject)) + +proc bitmap_ref*(drawable: PDrawable): PDrawable = + result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) + +proc bitmap_unref*(drawable: PDrawable) = + g_object_unref(G_OBJECT(drawable)) + +proc pixmap_ref*(drawable: PDrawable): PDrawable = + result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) + +proc pixmap_unref*(drawable: PDrawable) = + g_object_unref(G_OBJECT(drawable)) + +proc rgb_get_cmap*(): PColormap = + result = nil #gdk_rgb_get_colormap() + +proc TYPE_DISPLAY*(): GType = + nil + #result = nil + +proc DISPLAY_OBJECT*(anObject: pointer): PDisplay = + result = cast[PDisplay](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_DISPLAY())) + +proc DISPLAY_CLASS*(klass: pointer): PDisplayClass = + result = cast[PDisplayClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_DISPLAY())) + +proc IS_DISPLAY*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_DISPLAY()) + +proc IS_DISPLAY_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_DISPLAY()) + +proc DISPLAY_GET_CLASS*(obj: pointer): PDisplayClass = + result = cast[PDisplayClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_DISPLAY())) + +proc TYPE_SCREEN*(): GType = + nil + +proc SCREEN*(anObject: Pointer): PScreen = + result = cast[PScreen](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_SCREEN())) + +proc SCREEN_CLASS*(klass: Pointer): PScreenClass = + result = cast[PScreenClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_SCREEN())) + +proc IS_SCREEN*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_SCREEN()) + +proc IS_SCREEN_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_SCREEN()) + +proc SCREEN_GET_CLASS*(obj: Pointer): PScreenClass = + result = cast[PScreenClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_SCREEN())) + +proc SELECTION_PRIMARY*(): TAtom = + result = `MAKE_ATOM`(1) + +proc SELECTION_SECONDARY*(): TAtom = + result = `MAKE_ATOM`(2) + +proc SELECTION_CLIPBOARD*(): TAtom = + result = `MAKE_ATOM`(69) + +proc TARGET_BITMAP*(): TAtom = + result = `MAKE_ATOM`(5) + +proc TARGET_COLORMAP*(): TAtom = + result = `MAKE_ATOM`(7) + +proc TARGET_DRAWABLE*(): TAtom = + result = `MAKE_ATOM`(17) + +proc TARGET_PIXMAP*(): TAtom = + result = `MAKE_ATOM`(20) + +proc TARGET_STRING*(): TAtom = + result = `MAKE_ATOM`(31) + +proc SELECTION_TYPE_ATOM*(): TAtom = + result = `MAKE_ATOM`(4) + +proc SELECTION_TYPE_BITMAP*(): TAtom = + result = `MAKE_ATOM`(5) + +proc SELECTION_TYPE_COLORMAP*(): TAtom = + result = `MAKE_ATOM`(7) + +proc SELECTION_TYPE_DRAWABLE*(): TAtom = + result = `MAKE_ATOM`(17) + +proc SELECTION_TYPE_INTEGER*(): TAtom = + result = `MAKE_ATOM`(19) + +proc SELECTION_TYPE_PIXMAP*(): TAtom = + result = `MAKE_ATOM`(20) + +proc SELECTION_TYPE_WINDOW*(): TAtom = + result = `MAKE_ATOM`(33) + +proc SELECTION_TYPE_STRING*(): TAtom = + result = `MAKE_ATOM`(31) + +proc ATOM_TO_POINTER*(atom: TAtom): pointer = + result = cast[Pointer](atom) + +proc POINTER_TO_ATOM*(p: Pointer): TAtom = + result = cast[TAtom](p) + +proc `MAKE_ATOM`*(val: guint): TAtom = + result = cast[TAtom](val) + +proc NONE*(): TAtom = + result = `MAKE_ATOM`(0) + +proc TYPE_VISUAL*(): GType = + result = visual_get_type() + +proc VISUAL*(anObject: Pointer): PVisual = + result = cast[PVisual](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_VISUAL())) + +proc VISUAL_CLASS*(klass: Pointer): PVisualClass = + result = cast[PVisualClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_VISUAL())) + +proc IS_VISUAL*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_VISUAL()) + +proc IS_VISUAL_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_VISUAL()) + +proc VISUAL_GET_CLASS*(obj: Pointer): PVisualClass = + result = cast[PVisualClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_VISUAL())) + +proc visual_ref*(v: PVisual) = + discard g_object_ref(v) + +proc visual_unref*(v: PVisual) = + g_object_unref(v) + +proc TYPE_WINDOW*(): GType = + result = window_object_get_type() + +proc WINDOW*(anObject: Pointer): PWindow = + result = cast[PWindow](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_WINDOW())) + +proc WINDOW_CLASS*(klass: Pointer): PWindowObjectClass = + result = cast[PWindowObjectClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_WINDOW())) + +proc IS_WINDOW*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_WINDOW()) + +proc IS_WINDOW_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_WINDOW()) + +proc WINDOW_GET_CLASS*(obj: Pointer): PWindowObjectClass = + result = cast[PWindowObjectClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_WINDOW())) + +proc WINDOW_OBJECT*(anObject: Pointer): PWindowObject = + result = cast[PWindowObject](WINDOW(anObject)) + +proc WindowObject_guffaw_gravity*(a: var TWindowObject): guint = + result = (a.flag0 and bm_TGdkWindowObject_guffaw_gravity) shr + bp_TGdkWindowObject_guffaw_gravity + +proc WindowObject_set_guffaw_gravity*(a: var TWindowObject, + `guffaw_gravity`: guint) = + a.flag0 = a.flag0 or + (int16(`guffaw_gravity` shl bp_TGdkWindowObject_guffaw_gravity) and + bm_TGdkWindowObject_guffaw_gravity) + +proc WindowObject_input_only*(a: var TWindowObject): guint = + result = (a.flag0 and bm_TGdkWindowObject_input_only) shr + bp_TGdkWindowObject_input_only + +proc WindowObject_set_input_only*(a: var TWindowObject, `input_only`: guint) = + a.flag0 = a.flag0 or + (int16(`input_only` shl bp_TGdkWindowObject_input_only) and + bm_TGdkWindowObject_input_only) + +proc WindowObject_modal_hint*(a: var TWindowObject): guint = + result = (a.flag0 and bm_TGdkWindowObject_modal_hint) shr + bp_TGdkWindowObject_modal_hint + +proc WindowObject_set_modal_hint*(a: var TWindowObject, `modal_hint`: guint) = + a.flag0 = a.flag0 or + (int16(`modal_hint` shl bp_TGdkWindowObject_modal_hint) and + bm_TGdkWindowObject_modal_hint) + +proc WindowObject_destroyed*(a: var TWindowObject): guint = + result = (a.flag0 and bm_TGdkWindowObject_destroyed) shr + bp_TGdkWindowObject_destroyed + +proc WindowObject_set_destroyed*(a: var TWindowObject, `destroyed`: guint) = + a.flag0 = a.flag0 or + (int16(`destroyed` shl bp_TGdkWindowObject_destroyed) and + bm_TGdkWindowObject_destroyed) + +proc ROOT_PARENT*(): PWindow = + result = get_default_root_window() + +proc window_get_size*(drawable: PDrawable, width: Pgint, height: Pgint) = + drawable_get_size(drawable, width, height) + +proc window_get_type*(window: PWindow): TWindowType = + result = window_get_window_type(window) + +proc window_get_colormap*(drawable: PDrawable): PColormap = + result = drawable_get_colormap(drawable) + +proc window_set_colormap*(drawable: PDrawable, colormap: PColormap) = + drawable_set_colormap(drawable, colormap) + +proc window_get_visual*(drawable: PDrawable): PVisual = + result = drawable_get_visual(drawable) + +proc window_ref*(drawable: PDrawable): PDrawable = + result = DRAWABLE(g_object_ref(G_OBJECT(drawable))) + +proc window_unref*(drawable: PDrawable) = + g_object_unref(G_OBJECT(drawable)) + +proc window_copy_area*(drawable: PDrawable, gc: PGC, x, y: gint, + source_drawable: PDrawable, source_x, source_y: gint, + width, height: gint) = + draw_pixmap(drawable, gc, source_drawable, source_x, source_y, x, y, width, + height) diff --git a/lib/newwrap/gtk/gdk2pixbuf.nim b/lib/newwrap/gtk/gdk2pixbuf.nim new file mode 100644 index 000000000..f22ab345b --- /dev/null +++ b/lib/newwrap/gtk/gdk2pixbuf.nim @@ -0,0 +1,271 @@ +{.deadCodeElim: on.} +import + glib2 + +when defined(win32): + const + pixbuflib = "libgdk_pixbuf-2.0-0.dll" +elif defined(darwin): + const + pixbuflib = "gdk_pixbuf-2.0.0" + # 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 pixbuf_get_colorspace*(pixbuf: PPixbuf): TColorspace{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_get_colorspace".} +proc pixbuf_get_n_channels*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_get_n_channels".} +proc pixbuf_get_has_alpha*(pixbuf: PPixbuf): gboolean{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_get_has_alpha".} +proc pixbuf_get_bits_per_sample*(pixbuf: PPixbuf): int32{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_get_bits_per_sample".} +proc pixbuf_get_pixels*(pixbuf: PPixbuf): Pguchar{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_get_pixels".} +proc pixbuf_get_width*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_get_width".} +proc pixbuf_get_height*(pixbuf: PPixbuf): int32{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_get_height".} +proc pixbuf_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 pixbuf_copy*(pixbuf: PPixbuf): PPixbuf{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_copy".} +proc pixbuf_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 pixbuf_fill*(pixbuf: PPixbuf, pixel: guint32){.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_fill".} +proc pixbuf_save*(pixbuf: PPixbuf, filename: cstring, `type`: cstring, + error: pointer): gboolean{.cdecl, varargs, dynlib: pixbuflib, + importc: "gdk_pixbuf_save".} +proc pixbuf_savev*(pixbuf: PPixbuf, filename: cstring, `type`: cstring, + option_keys: PPchar, option_values: PPchar, error: pointer): gboolean{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_savev".} +proc pixbuf_add_alpha*(pixbuf: PPixbuf, substitute_color: gboolean, r: guchar, + g: guchar, b: guchar): PPixbuf{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_add_alpha".} +proc pixbuf_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 pixbuf_saturate_and_pixelate*(src: PPixbuf, dest: PPixbuf, + saturation: gfloat, pixelate: gboolean){. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_saturate_and_pixelate".} +proc pixbuf_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 pixbuf_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 pixbuf_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 pixbuf_scale_simple*(src: PPixbuf, dest_width: int32, dest_height: int32, + interp_type: TInterpType): PPixbuf{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_scale_simple".} +proc pixbuf_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 pixbuf_animation_get_width*(animation: PPixbufAnimation): int32{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_width".} +proc pixbuf_animation_get_height*(animation: PPixbufAnimation): int32{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_height".} +proc pixbuf_animation_is_static_image*(animation: PPixbufAnimation): gboolean{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_is_static_image".} +proc pixbuf_animation_get_static_image*(animation: PPixbufAnimation): PPixbuf{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_get_static_image".} +proc pixbuf_animation_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 pixbuf_animation_iter_get_delay_time*(iter: PPixbufAnimationIter): int32{. + cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_animation_iter_get_delay_time".} +proc pixbuf_animation_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 pixbuf_animation_iter_advance*(iter: PPixbufAnimationIter, e: var TGTimeVal): gboolean{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_animation_iter_advance".} +proc pixbuf_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_with_type*(image_type: cstring, error: pointer): PPixbufLoader{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_new_with_type".} +proc pixbuf_loader_write*(loader: PPixbufLoader, buf: Pguchar, count: gsize, + error: pointer): gboolean{.cdecl, dynlib: pixbuflib, + importc: "gdk_pixbuf_loader_write".} +proc pixbuf_loader_get_pixbuf*(loader: PPixbufLoader): PPixbuf{.cdecl, + dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_pixbuf".} +proc pixbuf_loader_get_animation*(loader: PPixbufLoader): PPixbufAnimation{. + cdecl, dynlib: pixbuflib, importc: "gdk_pixbuf_loader_get_animation".} +proc pixbuf_loader_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() diff --git a/lib/newwrap/gtk/gdkglext.nim b/lib/newwrap/gtk/gdkglext.nim new file mode 100644 index 000000000..41ec0038f --- /dev/null +++ b/lib/newwrap/gtk/gdkglext.nim @@ -0,0 +1,551 @@ +{.deadCodeElim: on.} +import + Glib2, 2 + +when defined(WIN32): + const + GLExtLib = "libgdkglext-win32-1.0-0.dll" +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 gl_config_get_screen*(glconfig: PGLConfig): PScreen{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_screen".} +proc gl_config_get_attrib*(glconfig: PGLConfig, attribute: int, value: var cint): gboolean{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_config_get_attrib".} +proc gl_config_get_colormap*(glconfig: PGLConfig): PColormap{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_colormap".} +proc gl_config_get_visual*(glconfig: PGLConfig): PVisual{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_visual".} +proc gl_config_get_depth*(glconfig: PGLConfig): gint{.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_config_get_depth".} +proc gl_config_get_layer_plane*(glconfig: PGLConfig): gint{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_layer_plane".} +proc gl_config_get_n_aux_buffers*(glconfig: PGLConfig): gint{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_n_aux_buffers".} +proc gl_config_get_n_sample_buffers*(glconfig: PGLConfig): gint{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_get_n_sample_buffers".} +proc gl_config_is_rgba*(glconfig: PGLConfig): gboolean{.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_config_is_rgba".} +proc gl_config_is_double_buffered*(glconfig: PGLConfig): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_is_double_buffered".} +proc gl_config_is_stereo*(glconfig: PGLConfig): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_is_stereo".} +proc gl_config_has_alpha*(glconfig: PGLConfig): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_has_alpha".} +proc gl_config_has_depth_buffer*(glconfig: PGLConfig): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_has_depth_buffer".} +proc gl_config_has_stencil_buffer*(glconfig: PGLConfig): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_config_has_stencil_buffer".} +proc gl_config_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 gl_context_new*(gldrawable: PGLDrawable, share_list: PGLContext, + direct: gboolean, render_type: int32): PGLContext{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_context_new".} +proc gl_context_destroy*(glcontext: PGLContext){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_context_destroy".} +proc gl_context_copy*(glcontext: PGLContext, src: PGLContext, mask: int32): gboolean{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_context_copy".} +proc gl_context_get_gl_drawable*(glcontext: PGLContext): PGLDrawable{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_drawable".} +proc gl_context_get_gl_config*(glcontext: PGLContext): PGLConfig{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_context_get_gl_config".} +proc gl_context_get_share_list*(glcontext: PGLContext): PGLContext{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_context_get_share_list".} +proc gl_context_is_direct*(glcontext: PGLContext): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_context_is_direct".} +proc gl_context_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 gl_drawable_make_current*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_make_current".} +proc gl_drawable_is_double_buffered*(gldrawable: PGLDrawable): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_drawable_is_double_buffered".} +proc gl_drawable_swap_buffers*(gldrawable: PGLDrawable){.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_drawable_swap_buffers".} +proc gl_drawable_wait_gl*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_drawable_wait_gl".} +proc gl_drawable_wait_gdk*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_drawable_wait_gdk".} +proc gl_drawable_gl_begin*(gldrawable: PGLDrawable, glcontext: PGLContext): gboolean{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_drawable_gl_begin".} +proc gl_drawable_gl_end*(gldrawable: PGLDrawable){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_drawable_gl_end".} +proc gl_drawable_get_gl_config*(gldrawable: PGLDrawable): PGLConfig{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_drawable_get_gl_config".} +proc gl_drawable_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 gl_pixmap_new*(glconfig: PGLConfig, pixmap: PPixmap, attrib_list: ptr int32): PGLPixmap{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_pixmap_new".} +proc gl_pixmap_destroy*(glpixmap: PGLPixmap){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_pixmap_destroy".} +proc gl_pixmap_get_pixmap*(glpixmap: PGLPixmap): PPixmap{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_pixmap_get_pixmap".} +proc pixmap_set_gl_capability*(pixmap: PPixmap, glconfig: PGLConfig, + attrib_list: ptr int32): PGLPixmap{.cdecl, + dynlib: GLExtLib, importc: "gdk_pixmap_set_gl_capability".} +proc pixmap_unset_gl_capability*(pixmap: PPixmap){.cdecl, dynlib: GLExtLib, + importc: "gdk_pixmap_unset_gl_capability".} +proc pixmap_is_gl_capable*(pixmap: PPixmap): gboolean{.cdecl, dynlib: GLExtLib, + importc: "gdk_pixmap_is_gl_capable".} +proc pixmap_get_gl_pixmap*(pixmap: PPixmap): PGLPixmap{.cdecl, dynlib: GLExtLib, + importc: "gdk_pixmap_get_gl_pixmap".} +proc pixmap_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 gl_window_new*(glconfig: PGLConfig, window: PWindow, attrib_list: ptr int32): PGLWindow{. + cdecl, dynlib: GLExtLib, importc: "gdk_gl_window_new".} +proc gl_window_destroy*(glwindow: PGLWindow){.cdecl, dynlib: GLExtLib, + importc: "gdk_gl_window_destroy".} +proc gl_window_get_window*(glwindow: PGLWindow): PWindow{.cdecl, + dynlib: GLExtLib, importc: "gdk_gl_window_get_window".} +proc window_set_gl_capability*(window: PWindow, glconfig: PGLConfig, + attrib_list: ptr int32): PGLWindow{.cdecl, + dynlib: GLExtLib, importc: "gdk_window_set_gl_capability".} +proc window_unset_gl_capability*(window: PWindow){.cdecl, dynlib: GLExtLib, + importc: "gdk_window_unset_gl_capability".} +proc window_is_gl_capable*(window: PWindow): gboolean{.cdecl, dynlib: GLExtLib, + importc: "gdk_window_is_gl_capable".} +proc window_get_gl_window*(window: PWindow): PGLWindow{.cdecl, dynlib: GLExtLib, + importc: "gdk_window_get_gl_window".} +proc window_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 pixmap_get_gl_drawable*(pixmap: PPixmap): PGLDrawable = + result = GL_DRAWABLE(pixmap_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 window_get_gl_drawable*(window: PWindow): PGLDrawable = + result = GL_DRAWABLE(window_get_gl_window(window)) diff --git a/lib/newwrap/gtk/glib2.nim b/lib/newwrap/gtk/glib2.nim new file mode 100644 index 000000000..0f1d45340 --- /dev/null +++ b/lib/newwrap/gtk/glib2.nim @@ -0,0 +1,4500 @@ +{.deadCodeElim: on.} +when defined(windows): + const + gliblib = "libglib-2.0-0.dll" + gmodulelib = "libgmodule-2.0-0.dll" + gobjectlib = "libgobject-2.0-0.dll" +else: + const + gliblib = "libglib-2.0.so" + gmodulelib = "libgmodule-2.0.so" + gobjectlib = "libgobject-2.0.so" +# gthreadlib = "libgthread-2.0.so" + +type + PGTypePlugin* = pointer + PGParamSpecPool* = pointer + PPchar* = ptr cstring + PPPchar* = ptr PPchar + PPPgchar* = ptr PPgchar + PPgchar* = ptr cstring + gchar* = char + gshort* = cshort + glong* = clong + gint* = cint + gboolean* = bool + guchar* = char + gushort* = int16 + gulong* = int + guint* = cint + gfloat* = cfloat + gdouble* = cdouble + gpointer* = pointer + Pgshort* = ptr gshort + Pglong* = ptr glong + Pgint* = ptr gint + PPgint* = ptr Pgint + Pgboolean* = ptr gboolean + Pguchar* = ptr guchar + PPguchar* = ptr Pguchar + Pgushort* = ptr gushort + Pgulong* = ptr gulong + Pguint* = ptr guint + Pgfloat* = ptr gfloat + Pgdouble* = ptr gdouble + pgpointer* = ptr gpointer + gconstpointer* = pointer + PGCompareFunc* = ptr TGCompareFunc + TGCompareFunc* = proc (a, b: gconstpointer): gint{.cdecl.} + PGCompareDataFunc* = ptr TGCompareDataFunc + TGCompareDataFunc* = proc (a, b: gconstpointer, user_data: gpointer): gint{. + cdecl.} + PGEqualFunc* = ptr TGEqualFunc + TGEqualFunc* = proc (a, b: gconstpointer): gboolean{.cdecl.} + PGDestroyNotify* = ptr TGDestroyNotify + TGDestroyNotify* = proc (data: gpointer){.cdecl.} + PGFunc* = ptr TGFunc + TGFunc* = proc (data, userdata: gpointer, key: gconstpointer){.cdecl.} + PGHashFunc* = ptr TGHashFunc + TGHashFunc* = proc (key: gconstpointer): guint{.cdecl.} + PGHFunc* = ptr TGHFunc + TGHFunc* = proc (key, value, user_data: gpointer){.cdecl.} + PGFreeFunc* = proc (data: gpointer){.cdecl.} + PGTimeVal* = ptr TGTimeVal + TGTimeVal*{.final.} = object + tv_sec*: glong + tv_usec*: glong + + guint64* = int64 + gint8* = int8 + guint8* = int8 + gint16* = int16 + guint16* = int16 + gint32* = int32 + guint32* = int32 + gint64* = int64 + gssize* = int32 + gsize* = int32 + Pgint8* = ptr gint8 + Pguint8* = ptr guint8 + Pgint16* = ptr gint16 + Pguint16* = ptr guint16 + Pgint32* = ptr gint32 + Pguint32* = ptr guint32 + Pgint64* = ptr gint64 + Pguint64* = ptr guint64 + pgssize* = ptr gssize + pgsize* = ptr gsize + TGQuark* = guint32 + PGQuark* = ptr TGQuark + PGTypeCValue* = ptr TGTypeCValue + TGTypeCValue*{.final.} = object + v_double*: gdouble + + GType* = gulong + PGType* = ptr GType + PGTypeClass* = ptr TGTypeClass + TGTypeClass*{.final.} = object + g_type*: GType + + PGTypeInstance* = ptr TGTypeInstance + TGTypeInstance*{.final.} = object + g_class*: PGTypeClass + + PGTypeInterface* = ptr TGTypeInterface + TGTypeInterface*{.pure.} = object + g_type*: GType + g_instance_type*: GType + + PGTypeQuery* = ptr TGTypeQuery + TGTypeQuery*{.final.} = object + theType*: GType + type_name*: cstring + class_size*: guint + instance_size*: guint + + PGValue* = ptr TGValue + TGValue*{.final.} = object + g_type*: GType + data*: array[0..1, gdouble] + + PGData* = pointer + PPGData* = ptr PGData + PGSList* = ptr TGSList + PPGSList* = ptr PGSList + TGSList*{.final.} = object + data*: gpointer + next*: PGSList + + PGList* = ptr TGList + TGList*{.final.} = object + data*: gpointer + next*: PGList + prev*: PGList + + TGParamFlags* = int32 + PGParamFlags* = ptr TGParamFlags + PGParamSpec* = ptr TGParamSpec + PPGParamSpec* = ptr PGParamSpec + TGParamSpec*{.final.} = object + g_type_instance*: TGTypeInstance + name*: cstring + flags*: TGParamFlags + value_type*: GType + owner_type*: GType + nick*: cstring + blurb*: cstring + qdata*: PGData + ref_count*: guint + param_id*: guint + + PGParamSpecClass* = ptr TGParamSpecClass + TGParamSpecClass*{.final.} = object + g_type_class*: TGTypeClass + value_type*: GType + finalize*: proc (pspec: PGParamSpec){.cdecl.} + value_set_default*: proc (pspec: PGParamSpec, value: PGValue){.cdecl.} + value_validate*: proc (pspec: PGParamSpec, value: PGValue): gboolean{.cdecl.} + values_cmp*: proc (pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{. + cdecl.} + dummy*: array[0..3, gpointer] + + PGParameter* = ptr TGParameter + TGParameter*{.final.} = object + name*: cstring + value*: TGValue + + TGBoxedCopyFunc* = proc (boxed: gpointer): gpointer{.cdecl.} + TGBoxedFreeFunc* = proc (boxed: gpointer){.cdecl.} + PGsource = pointer # I don't know and don't care + +const + G_TYPE_FUNDAMENTAL_SHIFT* = 2 + G_TYPE_FUNDAMENTAL_MAX* = 255 shl G_TYPE_FUNDAMENTAL_SHIFT + G_TYPE_INVALID* = GType(0 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_NONE* = GType(1 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_INTERFACE* = GType(2 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_CHAR* = GType(3 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_UCHAR* = GType(4 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_BOOLEAN* = GType(5 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_INT* = GType(6 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_UINT* = GType(7 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_LONG* = GType(8 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_ULONG* = GType(9 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_INT64* = GType(10 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_UINT64* = GType(11 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_ENUM* = GType(12 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_FLAGS* = GType(13 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_FLOAT* = GType(14 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_DOUBLE* = GType(15 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_STRING* = GType(16 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_POINTER* = GType(17 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_BOXED* = GType(18 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_PARAM* = GType(19 shl G_TYPE_FUNDAMENTAL_SHIFT) + G_TYPE_OBJECT* = GType(20 shl G_TYPE_FUNDAMENTAL_SHIFT) + +proc G_TYPE_MAKE_FUNDAMENTAL*(x: int): GType +const + G_TYPE_RESERVED_GLIB_FIRST* = 21 + G_TYPE_RESERVED_GLIB_LAST* = 31 + G_TYPE_RESERVED_BSE_FIRST* = 32 + G_TYPE_RESERVED_BSE_LAST* = 48 + G_TYPE_RESERVED_USER_FIRST* = 49 + +proc G_TYPE_IS_FUNDAMENTAL*(theType: GType): bool +proc G_TYPE_IS_DERIVED*(theType: GType): bool +proc G_TYPE_IS_INTERFACE*(theType: GType): bool +proc G_TYPE_IS_CLASSED*(theType: GType): gboolean +proc G_TYPE_IS_INSTANTIATABLE*(theType: GType): bool +proc G_TYPE_IS_DERIVABLE*(theType: GType): bool +proc G_TYPE_IS_DEEP_DERIVABLE*(theType: GType): bool +proc G_TYPE_IS_ABSTRACT*(theType: GType): bool +proc G_TYPE_IS_VALUE_ABSTRACT*(theType: GType): bool +proc G_TYPE_IS_VALUE_TYPE*(theType: GType): bool +proc G_TYPE_HAS_VALUE_TABLE*(theType: GType): bool +proc G_TYPE_CHECK_INSTANCE*(instance: Pointer): gboolean +proc G_TYPE_CHECK_INSTANCE_CAST*(instance: Pointer, g_type: GType): PGTypeInstance +proc G_TYPE_CHECK_INSTANCE_TYPE*(instance: Pointer, g_type: GType): bool +proc G_TYPE_INSTANCE_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass +proc G_TYPE_INSTANCE_GET_INTERFACE*(instance: Pointer, g_type: GType): Pointer +proc G_TYPE_CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer +proc G_TYPE_CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool +proc G_TYPE_CHECK_VALUE*(value: Pointer): bool +proc G_TYPE_CHECK_VALUE_TYPE*(value: pointer, g_type: GType): bool +proc G_TYPE_FROM_INSTANCE*(instance: Pointer): GType +proc G_TYPE_FROM_CLASS*(g_class: Pointer): GType +proc G_TYPE_FROM_INTERFACE*(g_iface: Pointer): GType +type + TGTypeDebugFlags* = int32 + PGTypeDebugFlags* = ptr TGTypeDebugFlags + +const + G_TYPE_DEBUG_NONE* = 0 + G_TYPE_DEBUG_OBJECTS* = 1 shl 0 + G_TYPE_DEBUG_SIGNALS* = 1 shl 1 + G_TYPE_DEBUG_MASK* = 0x00000003 + +proc g_type_init*(){.cdecl, dynlib: gobjectlib, importc: "g_type_init".} +proc g_type_init_with_debug_flags*(debug_flags: TGTypeDebugFlags){.cdecl, + dynlib: gobjectlib, importc: "g_type_init_with_debug_flags".} +proc g_type_name*(theType: GType): cstring{.cdecl, dynlib: gobjectlib, + importc: "g_type_name".} +proc g_type_qname*(theType: GType): TGQuark{.cdecl, dynlib: gobjectlib, + importc: "g_type_qname".} +proc g_type_from_name*(name: cstring): GType{.cdecl, dynlib: gobjectlib, + importc: "g_type_from_name".} +proc g_type_parent*(theType: GType): GType{.cdecl, dynlib: gobjectlib, + importc: "g_type_parent".} +proc g_type_depth*(theType: GType): guint{.cdecl, dynlib: gobjectlib, + importc: "g_type_depth".} +proc g_type_next_base*(leaf_type: GType, root_type: GType): GType{.cdecl, + dynlib: gobjectlib, importc: "g_type_next_base".} +proc g_type_is_a*(theType: GType, is_a_type: GType): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_type_is_a".} +proc g_type_class_ref*(theType: GType): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_type_class_ref".} +proc g_type_class_peek*(theType: GType): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_type_class_peek".} +proc g_type_class_unref*(g_class: gpointer){.cdecl, dynlib: gobjectlib, + importc: "g_type_class_unref".} +proc g_type_class_peek_parent*(g_class: gpointer): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_type_class_peek_parent".} +proc g_type_interface_peek*(instance_class: gpointer, iface_type: GType): gpointer{. + cdecl, dynlib: gobjectlib, importc: "g_type_interface_peek".} +proc g_type_interface_peek_parent*(g_iface: gpointer): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_type_interface_peek_parent".} +proc g_type_children*(theType: GType, n_children: Pguint): PGType{.cdecl, + dynlib: gobjectlib, importc: "g_type_children".} +proc g_type_interfaces*(theType: GType, n_interfaces: Pguint): PGType{.cdecl, + dynlib: gobjectlib, importc: "g_type_interfaces".} +proc g_type_set_qdata*(theType: GType, quark: TGQuark, data: gpointer){.cdecl, + dynlib: gobjectlib, importc: "g_type_set_qdata".} +proc g_type_get_qdata*(theType: GType, quark: TGQuark): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_type_get_qdata".} +proc g_type_query*(theType: GType, query: PGTypeQuery){.cdecl, + dynlib: gobjectlib, importc: "g_type_query".} +type + TGBaseInitFunc* = proc (g_class: gpointer){.cdecl.} + TGBaseFinalizeFunc* = proc (g_class: gpointer){.cdecl.} + TGClassInitFunc* = proc (g_class: gpointer, class_data: gpointer){.cdecl.} + TGClassFinalizeFunc* = proc (g_class: gpointer, class_data: gpointer){.cdecl.} + TGInstanceInitFunc* = proc (instance: PGTypeInstance, g_class: gpointer){. + cdecl.} + TGInterfaceInitFunc* = proc (g_iface: gpointer, iface_data: gpointer){.cdecl.} + TGInterfaceFinalizeFunc* = proc (g_iface: gpointer, iface_data: gpointer){. + cdecl.} + TGTypeClassCacheFunc* = proc (cache_data: gpointer, g_class: PGTypeClass): gboolean{. + cdecl.} + TGTypeFundamentalFlags* = int32 + PGTypeFundamentalFlags* = ptr TGTypeFundamentalFlags + +const + G_TYPE_FLAG_CLASSED* = 1 shl 0 + G_TYPE_FLAG_INSTANTIATABLE* = 1 shl 1 + G_TYPE_FLAG_DERIVABLE* = 1 shl 2 + G_TYPE_FLAG_DEEP_DERIVABLE* = 1 shl 3 + +type + TGTypeFlags* = int32 + PGTypeFlags* = ptr TGTypeFlags + +const + G_TYPE_FLAG_ABSTRACT* = 1 shl 4 + G_TYPE_FLAG_VALUE_ABSTRACT* = 1 shl 5 + +type + PGTypeValueTable* = ptr TGTypeValueTable + TGTypeValueTable*{.final.} = object + value_init*: proc (value: PGValue){.cdecl.} + value_free*: proc (value: PGValue){.cdecl.} + value_copy*: proc (src_value: PGValue, dest_value: PGValue){.cdecl.} + value_peek_pointer*: proc (value: PGValue): gpointer{.cdecl.} + collect_format*: cstring + collect_value*: proc (value: PGValue, n_collect_values: guint, + collect_values: PGTypeCValue, collect_flags: guint): cstring{. + cdecl.} + lcopy_format*: cstring + lcopy_value*: proc (value: PGValue, n_collect_values: guint, + collect_values: PGTypeCValue, collect_flags: guint): cstring{. + cdecl.} + + PGTypeInfo* = ptr TGTypeInfo + TGTypeInfo*{.final.} = object + class_size*: guint16 + base_init*: TGBaseInitFunc + base_finalize*: TGBaseFinalizeFunc + class_init*: TGClassInitFunc + class_finalize*: TGClassFinalizeFunc + class_data*: gconstpointer + instance_size*: guint16 + n_preallocs*: guint16 + instance_init*: TGInstanceInitFunc + value_table*: PGTypeValueTable + + PGTypeFundamentalInfo* = ptr TGTypeFundamentalInfo + TGTypeFundamentalInfo*{.final.} = object + type_flags*: TGTypeFundamentalFlags + + PGInterfaceInfo* = ptr TGInterfaceInfo + TGInterfaceInfo*{.final.} = object + interface_init*: TGInterfaceInitFunc + interface_finalize*: TGInterfaceFinalizeFunc + interface_data*: gpointer + + +proc g_type_register_static*(parent_type: GType, type_name: cstring, + info: PGTypeInfo, flags: TGTypeFlags): GType{. + cdecl, dynlib: gobjectlib, importc: "g_type_register_static".} +proc g_type_register_dynamic*(parent_type: GType, type_name: cstring, + plugin: PGTypePlugin, flags: TGTypeFlags): GType{. + cdecl, dynlib: gobjectlib, importc: "g_type_register_dynamic".} +proc g_type_register_fundamental*(type_id: GType, type_name: cstring, + info: PGTypeInfo, + finfo: PGTypeFundamentalInfo, + flags: TGTypeFlags): GType{.cdecl, + dynlib: gobjectlib, importc: "g_type_register_fundamental".} +proc g_type_add_interface_static*(instance_type: GType, interface_type: GType, + info: PGInterfaceInfo){.cdecl, + dynlib: gobjectlib, importc: "g_type_add_interface_static".} +proc g_type_add_interface_dynamic*(instance_type: GType, interface_type: GType, + plugin: PGTypePlugin){.cdecl, + dynlib: gobjectlib, importc: "g_type_add_interface_dynamic".} +proc g_type_interface_add_prerequisite*(interface_type: GType, + prerequisite_type: GType){.cdecl, + dynlib: gobjectlib, importc: "g_type_interface_add_prerequisite".} +proc g_type_get_plugin*(theType: GType): PGTypePlugin{.cdecl, + dynlib: gobjectlib, importc: "g_type_get_plugin".} +proc g_type_interface_get_plugin*(instance_type: GType, + implementation_type: GType): PGTypePlugin{. + cdecl, dynlib: gobjectlib, importc: "g_type_interface_get_plugin".} +proc g_type_fundamental_next*(): GType{.cdecl, dynlib: gobjectlib, + importc: "g_type_fundamental_next".} +proc g_type_fundamental*(type_id: GType): GType{.cdecl, dynlib: gobjectlib, + importc: "g_type_fundamental".} +proc g_type_create_instance*(theType: GType): PGTypeInstance{.cdecl, + dynlib: gobjectlib, importc: "g_type_create_instance".} +proc g_type_free_instance*(instance: PGTypeInstance){.cdecl, dynlib: gobjectlib, + importc: "g_type_free_instance".} +proc g_type_add_class_cache_func*(cache_data: gpointer, + cache_func: TGTypeClassCacheFunc){.cdecl, + dynlib: gobjectlib, importc: "g_type_add_class_cache_func".} +proc g_type_remove_class_cache_func*(cache_data: gpointer, + cache_func: TGTypeClassCacheFunc){.cdecl, + dynlib: gobjectlib, importc: "g_type_remove_class_cache_func".} +proc g_type_class_unref_uncached*(g_class: gpointer){.cdecl, dynlib: gobjectlib, + importc: "g_type_class_unref_uncached".} +proc g_type_value_table_peek*(theType: GType): PGTypeValueTable{.cdecl, + dynlib: gobjectlib, importc: "g_type_value_table_peek".} +proc private_g_type_check_instance*(instance: PGTypeInstance): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_type_check_instance".} +proc private_g_type_check_instance_cast*(instance: PGTypeInstance, + iface_type: GType): PGTypeInstance{.cdecl, dynlib: gobjectlib, + importc: "g_type_check_instance_cast".} +proc private_g_type_check_instance_is_a*(instance: PGTypeInstance, + iface_type: GType): gboolean{.cdecl, dynlib: gobjectlib, + importc: "g_type_check_instance_is_a".} +proc private_g_type_check_class_cast*(g_class: PGTypeClass, is_a_type: GType): PGTypeClass{. + cdecl, dynlib: gobjectlib, importc: "g_type_check_class_cast".} +proc private_g_type_check_class_is_a*(g_class: PGTypeClass, is_a_type: GType): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_type_check_class_is_a".} +proc private_g_type_check_is_value_type*(theType: GType): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_type_check_is_value_type".} +proc private_g_type_check_value*(value: PGValue): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_type_check_value".} +proc private_g_type_check_value_holds*(value: PGValue, theType: GType): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_type_check_value_holds".} +proc private_g_type_test_flags*(theType: GType, flags: guint): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_type_test_flags".} +proc g_type_name_from_instance*(instance: PGTypeInstance): cstring{.cdecl, + dynlib: gobjectlib, importc: "g_type_name_from_instance".} +proc g_type_name_from_class*(g_class: PGTypeClass): cstring{.cdecl, + dynlib: gobjectlib, importc: "g_type_name_from_class".} +const + G_TYPE_FLAG_RESERVED_ID_BIT* = GType(1 shl 0) + +proc G_TYPE_IS_VALUE*(theType: GType): bool +proc G_IS_VALUE*(value: pointer): bool +proc G_VALUE_TYPE*(value: Pointer): GType +proc G_VALUE_TYPE_NAME*(value: Pointer): cstring +proc G_VALUE_HOLDS*(value: pointer, g_type: GType): bool +type + TGValueTransform* = proc (src_value: PGValue, dest_value: PGValue){.cdecl.} + +proc g_value_init*(value: PGValue, g_type: GType): PGValue{.cdecl, + dynlib: gobjectlib, importc: "g_value_init".} +proc g_value_copy*(src_value: PGValue, dest_value: PGValue){.cdecl, + dynlib: gobjectlib, importc: "g_value_copy".} +proc g_value_reset*(value: PGValue): PGValue{.cdecl, dynlib: gobjectlib, + importc: "g_value_reset".} +proc g_value_unset*(value: PGValue){.cdecl, dynlib: gobjectlib, + importc: "g_value_unset".} +proc g_value_set_instance*(value: PGValue, instance: gpointer){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_instance".} +proc g_value_fits_pointer*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib, + importc: "g_value_fits_pointer".} +proc g_value_peek_pointer*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_value_peek_pointer".} +proc g_value_type_compatible*(src_type: GType, dest_type: GType): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_value_type_compatible".} +proc g_value_type_transformable*(src_type: GType, dest_type: GType): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_value_type_transformable".} +proc g_value_transform*(src_value: PGValue, dest_value: PGValue): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_value_transform".} +proc g_value_register_transform_func*(src_type: GType, dest_type: GType, + transform_func: TGValueTransform){.cdecl, + dynlib: gobjectlib, importc: "g_value_register_transform_func".} +const + G_VALUE_NOCOPY_CONTENTS* = 1 shl 27 + +type + PGValueArray* = ptr TGValueArray + TGValueArray*{.final.} = object + n_values*: guint + values*: PGValue + n_prealloced*: guint + + +proc g_value_array_get_nth*(value_array: PGValueArray, index: guint): PGValue{. + cdecl, dynlib: gobjectlib, importc: "g_value_array_get_nth".} +proc g_value_array_new*(n_prealloced: guint): PGValueArray{.cdecl, + dynlib: gobjectlib, importc: "g_value_array_new".} +proc g_value_array_free*(value_array: PGValueArray){.cdecl, dynlib: gobjectlib, + importc: "g_value_array_free".} +proc g_value_array_copy*(value_array: PGValueArray): PGValueArray{.cdecl, + dynlib: gobjectlib, importc: "g_value_array_copy".} +proc g_value_array_prepend*(value_array: PGValueArray, value: PGValue): PGValueArray{. + cdecl, dynlib: gobjectlib, importc: "g_value_array_prepend".} +proc g_value_array_append*(value_array: PGValueArray, value: PGValue): PGValueArray{. + cdecl, dynlib: gobjectlib, importc: "g_value_array_append".} +proc g_value_array_insert*(value_array: PGValueArray, index: guint, + value: PGValue): PGValueArray{.cdecl, + dynlib: gobjectlib, importc: "g_value_array_insert".} +proc g_value_array_remove*(value_array: PGValueArray, index: guint): PGValueArray{. + cdecl, dynlib: gobjectlib, importc: "g_value_array_remove".} +proc g_value_array_sort*(value_array: PGValueArray, compare_func: TGCompareFunc): PGValueArray{. + cdecl, dynlib: gobjectlib, importc: "g_value_array_sort".} +proc g_value_array_sort_with_data*(value_array: PGValueArray, + compare_func: TGCompareDataFunc, + user_data: gpointer): PGValueArray{.cdecl, + dynlib: gobjectlib, importc: "g_value_array_sort_with_data".} +const + G_VALUE_COLLECT_INT* = 'i' + G_VALUE_COLLECT_LONG* = 'l' + G_VALUE_COLLECT_INT64* = 'q' + G_VALUE_COLLECT_DOUBLE* = 'd' + G_VALUE_COLLECT_POINTER* = 'p' + G_VALUE_COLLECT_FORMAT_MAX_LENGTH* = 8 + +proc G_VALUE_HOLDS_CHAR*(value: PGValue): bool +proc G_VALUE_HOLDS_UCHAR*(value: PGValue): bool +proc G_VALUE_HOLDS_BOOLEAN*(value: PGValue): bool +proc G_VALUE_HOLDS_INT*(value: PGValue): bool +proc G_VALUE_HOLDS_UINT*(value: PGValue): bool +proc G_VALUE_HOLDS_LONG*(value: PGValue): bool +proc G_VALUE_HOLDS_ULONG*(value: PGValue): bool +proc G_VALUE_HOLDS_INT64*(value: PGValue): bool +proc G_VALUE_HOLDS_UINT64*(value: PGValue): bool +proc G_VALUE_HOLDS_FLOAT*(value: PGValue): bool +proc G_VALUE_HOLDS_DOUBLE*(value: PGValue): bool +proc G_VALUE_HOLDS_STRING*(value: PGValue): bool +proc G_VALUE_HOLDS_POINTER*(value: PGValue): bool +proc g_value_set_char*(value: PGValue, v_char: gchar){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_char".} +proc g_value_get_char*(value: PGValue): gchar{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_char".} +proc g_value_set_uchar*(value: PGValue, v_uchar: guchar){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_uchar".} +proc g_value_get_uchar*(value: PGValue): guchar{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_uchar".} +proc g_value_set_boolean*(value: PGValue, v_boolean: gboolean){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_boolean".} +proc g_value_get_boolean*(value: PGValue): gboolean{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_boolean".} +proc g_value_set_int*(value: PGValue, v_int: gint){.cdecl, dynlib: gobjectlib, + importc: "g_value_set_int".} +proc g_value_get_int*(value: PGValue): gint{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_int".} +proc g_value_set_uint*(value: PGValue, v_uint: guint){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_uint".} +proc g_value_get_uint*(value: PGValue): guint{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_uint".} +proc g_value_set_long*(value: PGValue, v_long: glong){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_long".} +proc g_value_get_long*(value: PGValue): glong{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_long".} +proc g_value_set_ulong*(value: PGValue, v_ulong: gulong){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_ulong".} +proc g_value_get_ulong*(value: PGValue): gulong{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_ulong".} +proc g_value_set_int64*(value: PGValue, v_int64: gint64){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_int64".} +proc g_value_get_int64*(value: PGValue): gint64{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_int64".} +proc g_value_set_uint64*(value: PGValue, v_uint64: guint64){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_uint64".} +proc g_value_get_uint64*(value: PGValue): guint64{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_uint64".} +proc g_value_set_float*(value: PGValue, v_float: gfloat){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_float".} +proc g_value_get_float*(value: PGValue): gfloat{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_float".} +proc g_value_set_double*(value: PGValue, v_double: gdouble){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_double".} +proc g_value_get_double*(value: PGValue): gdouble{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_double".} +proc g_value_set_string*(value: PGValue, v_string: cstring){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_string".} +proc g_value_set_static_string*(value: PGValue, v_string: cstring){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_static_string".} +proc g_value_get_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_string".} +proc g_value_dup_string*(value: PGValue): cstring{.cdecl, dynlib: gobjectlib, + importc: "g_value_dup_string".} +proc g_value_set_pointer*(value: PGValue, v_pointer: gpointer){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_pointer".} +proc g_value_get_pointer*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_pointer".} +proc g_pointer_type_register_static*(name: cstring): GType{.cdecl, + dynlib: gobjectlib, importc: "g_pointer_type_register_static".} +proc g_strdup_value_contents*(value: PGValue): cstring{.cdecl, + dynlib: gobjectlib, importc: "g_strdup_value_contents".} +proc g_value_set_string_take_ownership*(value: PGValue, v_string: cstring){. + cdecl, dynlib: gobjectlib, importc: "g_value_set_string_take_ownership".} +type + Tgchararray* = gchar + Pgchararray* = ptr Tgchararray + +proc G_TYPE_IS_PARAM*(theType: GType): bool +proc G_PARAM_SPEC*(pspec: Pointer): PGParamSpec +proc G_IS_PARAM_SPEC*(pspec: Pointer): bool +proc G_PARAM_SPEC_CLASS*(pclass: Pointer): PGParamSpecClass +proc G_IS_PARAM_SPEC_CLASS*(pclass: Pointer): bool +proc G_PARAM_SPEC_GET_CLASS*(pspec: Pointer): PGParamSpecClass +proc G_PARAM_SPEC_TYPE*(pspec: Pointer): GType +proc G_PARAM_SPEC_TYPE_NAME*(pspec: Pointer): cstring +proc G_PARAM_SPEC_VALUE_TYPE*(pspec: Pointer): GType +proc G_VALUE_HOLDS_PARAM*(value: Pointer): bool +const + G_PARAM_READABLE* = 1 shl 0 + G_PARAM_WRITABLE* = 1 shl 1 + G_PARAM_CONSTRUCT* = 1 shl 2 + G_PARAM_CONSTRUCT_ONLY* = 1 shl 3 + G_PARAM_LAX_VALIDATION* = 1 shl 4 + G_PARAM_PRIVATE* = 1 shl 5 + G_PARAM_READWRITE* = G_PARAM_READABLE or G_PARAM_WRITABLE + G_PARAM_MASK* = 0x000000FF + G_PARAM_USER_SHIFT* = 8 + +proc g_param_spec_ref*(pspec: PGParamSpec): PGParamSpec{.cdecl, dynlib: gliblib, + importc: "g_param_spec_ref".} +proc g_param_spec_unref*(pspec: PGParamSpec){.cdecl, dynlib: gliblib, + importc: "g_param_spec_unref".} +proc g_param_spec_sink*(pspec: PGParamSpec){.cdecl, dynlib: gliblib, + importc: "g_param_spec_sink".} +proc g_param_spec_get_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{. + cdecl, dynlib: gliblib, importc: "g_param_spec_get_qdata".} +proc g_param_spec_set_qdata*(pspec: PGParamSpec, quark: TGQuark, data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata".} +proc g_param_spec_set_qdata_full*(pspec: PGParamSpec, quark: TGQuark, + data: gpointer, destroy: TGDestroyNotify){. + cdecl, dynlib: gliblib, importc: "g_param_spec_set_qdata_full".} +proc g_param_spec_steal_qdata*(pspec: PGParamSpec, quark: TGQuark): gpointer{. + cdecl, dynlib: gliblib, importc: "g_param_spec_steal_qdata".} +proc g_param_value_set_default*(pspec: PGParamSpec, value: PGValue){.cdecl, + dynlib: gliblib, importc: "g_param_value_set_default".} +proc g_param_value_defaults*(pspec: PGParamSpec, value: PGValue): gboolean{. + cdecl, dynlib: gliblib, importc: "g_param_value_defaults".} +proc g_param_value_validate*(pspec: PGParamSpec, value: PGValue): gboolean{. + cdecl, dynlib: gliblib, importc: "g_param_value_validate".} +proc g_param_value_convert*(pspec: PGParamSpec, src_value: PGValue, + dest_value: PGValue, strict_validation: gboolean): gboolean{. + cdecl, dynlib: gliblib, importc: "g_param_value_convert".} +proc g_param_values_cmp*(pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{. + cdecl, dynlib: gliblib, importc: "g_param_values_cmp".} +proc g_param_spec_get_name*(pspec: PGParamSpec): cstring{.cdecl, + dynlib: gliblib, importc: "g_param_spec_get_name".} +proc g_param_spec_get_nick*(pspec: PGParamSpec): cstring{.cdecl, + dynlib: gliblib, importc: "g_param_spec_get_nick".} +proc g_param_spec_get_blurb*(pspec: PGParamSpec): cstring{.cdecl, + dynlib: gliblib, importc: "g_param_spec_get_blurb".} +proc g_value_set_param*(value: PGValue, param: PGParamSpec){.cdecl, + dynlib: gliblib, importc: "g_value_set_param".} +proc g_value_get_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib, + importc: "g_value_get_param".} +proc g_value_dup_param*(value: PGValue): PGParamSpec{.cdecl, dynlib: gliblib, + importc: "g_value_dup_param".} +proc g_value_set_param_take_ownership*(value: PGValue, param: PGParamSpec){. + cdecl, dynlib: gliblib, importc: "g_value_set_param_take_ownership".} +type + PGParamSpecTypeInfo* = ptr TGParamSpecTypeInfo + TGParamSpecTypeInfo*{.final.} = object + instance_size*: guint16 + n_preallocs*: guint16 + instance_init*: proc (pspec: PGParamSpec){.cdecl.} + value_type*: GType + finalize*: proc (pspec: PGParamSpec){.cdecl.} + value_set_default*: proc (pspec: PGParamSpec, value: PGValue){.cdecl.} + value_validate*: proc (pspec: PGParamSpec, value: PGValue): gboolean{.cdecl.} + values_cmp*: proc (pspec: PGParamSpec, value1: PGValue, value2: PGValue): gint{. + cdecl.} + + +proc g_param_type_register_static*(name: cstring, + pspec_info: PGParamSpecTypeInfo): GType{. + cdecl, dynlib: gliblib, importc: "g_param_type_register_static".} +proc g_param_type_register_static_constant*(name: cstring, + pspec_info: PGParamSpecTypeInfo, opt_type: GType): GType{.cdecl, + dynlib: gliblib, importc: "`g_param_type_register_static_constant`".} +proc g_param_spec_internal*(param_type: GType, name: cstring, nick: cstring, + blurb: cstring, flags: TGParamFlags): gpointer{. + cdecl, dynlib: gliblib, importc: "g_param_spec_internal".} +proc g_param_spec_pool_new*(type_prefixing: gboolean): PGParamSpecPool{.cdecl, + dynlib: gliblib, importc: "g_param_spec_pool_new".} +proc g_param_spec_pool_insert*(pool: PGParamSpecPool, pspec: PGParamSpec, + owner_type: GType){.cdecl, dynlib: gliblib, + importc: "g_param_spec_pool_insert".} +proc g_param_spec_pool_remove*(pool: PGParamSpecPool, pspec: PGParamSpec){. + cdecl, dynlib: gliblib, importc: "g_param_spec_pool_remove".} +proc g_param_spec_pool_lookup*(pool: PGParamSpecPool, param_name: cstring, + owner_type: GType, walk_ancestors: gboolean): PGParamSpec{. + cdecl, dynlib: gliblib, importc: "g_param_spec_pool_lookup".} +proc g_param_spec_pool_list_owned*(pool: PGParamSpecPool, owner_type: GType): PGList{. + cdecl, dynlib: gliblib, importc: "g_param_spec_pool_list_owned".} +proc g_param_spec_pool_list*(pool: PGParamSpecPool, owner_type: GType, + n_pspecs_p: Pguint): PPGParamSpec{.cdecl, + dynlib: gliblib, importc: "g_param_spec_pool_list".} +type + PGClosure* = ptr TGClosure + PGClosureNotifyData* = ptr TGClosureNotifyData + TGClosureNotify* = proc (data: gpointer, closure: PGClosure){.cdecl.} + TGClosure*{.final.} = object + flag0*: int32 + marshal*: proc (closure: PGClosure, return_value: PGValue, + n_param_values: guint, param_values: PGValue, + invocation_hint, marshal_data: gpointer){.cdecl.} + data*: gpointer + notifiers*: PGClosureNotifyData + + TGCallBackProcedure* = proc (){.cdecl.} + TGCallback* = proc (){.cdecl.} + TGClosureMarshal* = proc (closure: PGClosure, return_value: PGValue, + n_param_values: guint, param_values: PGValue, + invocation_hint: gpointer, marshal_data: gpointer){. + cdecl.} + TGClosureNotifyData*{.final.} = object + data*: gpointer + notify*: TGClosureNotify + + +proc G_CLOSURE_NEEDS_MARSHAL*(closure: Pointer): bool +proc G_CLOSURE_N_NOTIFIERS*(cl: PGClosure): int32 +proc G_CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32 +proc G_CALLBACK*(f: pointer): TGCallback +const + bm_TGClosure_ref_count* = 0x00007FFF'i32 + bp_TGClosure_ref_count* = 0'i32 + bm_TGClosure_meta_marshal* = 0x00008000'i32 + bp_TGClosure_meta_marshal* = 15'i32 + bm_TGClosure_n_guards* = 0x00010000'i32 + bp_TGClosure_n_guards* = 16'i32 + bm_TGClosure_n_fnotifiers* = 0x00060000'i32 + bp_TGClosure_n_fnotifiers* = 17'i32 + bm_TGClosure_n_inotifiers* = 0x07F80000'i32 + bp_TGClosure_n_inotifiers* = 19'i32 + bm_TGClosure_in_inotify* = 0x08000000'i32 + bp_TGClosure_in_inotify* = 27'i32 + bm_TGClosure_floating* = 0x10000000'i32 + bp_TGClosure_floating* = 28'i32 + bm_TGClosure_derivative_flag* = 0x20000000'i32 + bp_TGClosure_derivative_flag* = 29'i32 + bm_TGClosure_in_marshal* = 0x40000000'i32 + bp_TGClosure_in_marshal* = 30'i32 + bm_TGClosure_is_invalid* = 0x80000000'i32 + bp_TGClosure_is_invalid* = 31'i32 + +proc ref_count*(a: var TGClosure): guint +proc set_ref_count*(a: var TGClosure, ref_count: guint) +proc meta_marshal*(a: PGClosure): guint +proc set_meta_marshal*(a: var TGClosure, meta_marshal: guint) +proc n_guards*(a: PGClosure): guint +proc set_n_guards*(a: var TGClosure, n_guards: guint) +proc n_fnotifiers*(a: PGClosure): guint +proc set_n_fnotifiers*(a: var TGClosure, n_fnotifiers: guint) +proc n_inotifiers*(a: PGClosure): guint +proc in_inotify*(a: var TGClosure): guint +proc set_in_inotify*(a: var TGClosure, in_inotify: guint) +proc floating*(a: var TGClosure): guint +proc set_floating*(a: var TGClosure, floating: guint) +proc derivative_flag*(a: PGClosure): guint +proc set_derivative_flag*(a: var TGClosure, derivative_flag: guint) +proc in_marshal*(a: var TGClosure): guint +proc set_in_marshal*(a: var TGClosure, in_marshal: guint) +proc is_invalid*(a: var TGClosure): guint +proc set_is_invalid*(a: var TGClosure, is_invalid: guint) +type + PGCClosure* = ptr TGCClosure + TGCClosure*{.final.} = object + closure*: TGClosure + callback*: gpointer + + +proc g_cclosure_new*(callback_func: TGCallback, user_data: gpointer, + destroy_data: TGClosureNotify): PGClosure{.cdecl, + dynlib: gliblib, importc: "g_cclosure_new".} +proc g_cclosure_new_swap*(callback_func: TGCallback, user_data: gpointer, + destroy_data: TGClosureNotify): PGClosure{.cdecl, + dynlib: gliblib, importc: "g_cclosure_new_swap".} +proc g_signal_type_cclosure_new*(itype: GType, struct_offset: guint): PGClosure{. + cdecl, dynlib: gliblib, importc: "g_signal_type_cclosure_new".} +proc g_closure_ref*(closure: PGClosure): PGClosure{.cdecl, dynlib: gliblib, + importc: "g_closure_ref".} +proc g_closure_sink*(closure: PGClosure){.cdecl, dynlib: gliblib, + importc: "g_closure_sink".} +proc g_closure_unref*(closure: PGClosure){.cdecl, dynlib: gliblib, + importc: "g_closure_unref".} +proc g_closure_new_simple*(sizeof_closure: guint, data: gpointer): PGClosure{. + cdecl, dynlib: gliblib, importc: "g_closure_new_simple".} +proc g_closure_add_finalize_notifier*(closure: PGClosure, notify_data: gpointer, + notify_func: TGClosureNotify){.cdecl, + dynlib: gliblib, importc: "g_closure_add_finalize_notifier".} +proc g_closure_remove_finalize_notifier*(closure: PGClosure, + notify_data: gpointer, notify_func: TGClosureNotify){.cdecl, + dynlib: gliblib, importc: "g_closure_remove_finalize_notifier".} +proc g_closure_add_invalidate_notifier*(closure: PGClosure, + notify_data: gpointer, + notify_func: TGClosureNotify){.cdecl, + dynlib: gliblib, importc: "g_closure_add_invalidate_notifier".} +proc g_closure_remove_invalidate_notifier*(closure: PGClosure, + notify_data: gpointer, notify_func: TGClosureNotify){.cdecl, + dynlib: gliblib, importc: "g_closure_remove_invalidate_notifier".} +proc g_closure_add_marshal_guards*(closure: PGClosure, + pre_marshal_data: gpointer, + pre_marshal_notify: TGClosureNotify, + post_marshal_data: gpointer, + post_marshal_notify: TGClosureNotify){.cdecl, + dynlib: gliblib, importc: "g_closure_add_marshal_guards".} +proc g_closure_set_marshal*(closure: PGClosure, marshal: TGClosureMarshal){. + cdecl, dynlib: gliblib, importc: "g_closure_set_marshal".} +proc g_closure_set_meta_marshal*(closure: PGClosure, marshal_data: gpointer, + meta_marshal: TGClosureMarshal){.cdecl, + dynlib: gliblib, importc: "g_closure_set_meta_marshal".} +proc g_closure_invalidate*(closure: PGClosure){.cdecl, dynlib: gliblib, + importc: "g_closure_invalidate".} +proc g_closure_invoke*(closure: PGClosure, return_value: PGValue, + n_param_values: guint, param_values: PGValue, + invocation_hint: gpointer){.cdecl, dynlib: gliblib, + importc: "g_closure_invoke".} +type + PGSignalInvocationHint* = ptr TGSignalInvocationHint + PGSignalCMarshaller* = ptr TGSignalCMarshaller + TGSignalCMarshaller* = TGClosureMarshal + TGSignalEmissionHook* = proc (ihint: PGSignalInvocationHint, + n_param_values: guint, param_values: PGValue, + data: gpointer): gboolean{.cdecl.} + TGSignalAccumulator* = proc (ihint: PGSignalInvocationHint, + return_accu: PGValue, handler_return: PGValue, + data: gpointer): gboolean{.cdecl.} + PGSignalFlags* = ptr TGSignalFlags + TGSignalFlags* = int32 + TGSignalInvocationHint*{.final.} = object + signal_id*: guint + detail*: TGQuark + run_type*: TGSignalFlags + + PGSignalQuery* = ptr TGSignalQuery + TGSignalQuery*{.final.} = object + signal_id*: guint + signal_name*: cstring + itype*: GType + signal_flags*: TGSignalFlags + return_type*: GType + n_params*: guint + param_types*: PGType + + +const + G_SIGNAL_RUN_FIRST* = 1 shl 0 + G_SIGNAL_RUN_LAST* = 1 shl 1 + G_SIGNAL_RUN_CLEANUP* = 1 shl 2 + G_SIGNAL_NO_RECURSE* = 1 shl 3 + G_SIGNAL_DETAILED* = 1 shl 4 + G_SIGNAL_ACTION* = 1 shl 5 + G_SIGNAL_NO_HOOKS* = 1 shl 6 + G_SIGNAL_FLAGS_MASK* = 0x0000007F + +type + PGConnectFlags* = ptr TGConnectFlags + TGConnectFlags* = int32 + +const + G_CONNECT_AFTER* = 1 shl 0 + G_CONNECT_SWAPPED* = 1 shl 1 + +type + PGSignalMatchType* = ptr TGSignalMatchType + TGSignalMatchType* = int32 + +const + G_SIGNAL_MATCH_ID* = 1 shl 0 + G_SIGNAL_MATCH_DETAIL* = 1 shl 1 + G_SIGNAL_MATCH_CLOSURE* = 1 shl 2 + G_SIGNAL_MATCH_FUNC* = 1 shl 3 + G_SIGNAL_MATCH_DATA* = 1 shl 4 + G_SIGNAL_MATCH_UNBLOCKED* = 1 shl 5 + G_SIGNAL_MATCH_MASK* = 0x0000003F + G_SIGNAL_TYPE_STATIC_SCOPE* = G_TYPE_FLAG_RESERVED_ID_BIT + +proc g_signal_newv*(signal_name: cstring, itype: GType, + signal_flags: TGSignalFlags, class_closure: PGClosure, + accumulator: TGSignalAccumulator, accu_data: gpointer, + c_marshaller: TGSignalCMarshaller, return_type: GType, + n_params: guint, param_types: PGType): guint{.cdecl, + dynlib: gobjectlib, importc: "g_signal_newv".} +proc g_signal_emitv*(instance_and_params: PGValue, signal_id: guint, + detail: TGQuark, return_value: PGValue){.cdecl, + dynlib: gobjectlib, importc: "g_signal_emitv".} +proc g_signal_lookup*(name: cstring, itype: GType): guint{.cdecl, + dynlib: gobjectlib, importc: "g_signal_lookup".} +proc g_signal_name*(signal_id: guint): cstring{.cdecl, dynlib: gobjectlib, + importc: "g_signal_name".} +proc g_signal_query*(signal_id: guint, query: PGSignalQuery){.cdecl, + dynlib: gobjectlib, importc: "g_signal_query".} +proc g_signal_list_ids*(itype: GType, n_ids: Pguint): Pguint{.cdecl, + dynlib: gobjectlib, importc: "g_signal_list_ids".} +proc g_signal_parse_name*(detailed_signal: cstring, itype: GType, + signal_id_p: Pguint, detail_p: PGQuark, + force_detail_quark: gboolean): gboolean{.cdecl, + dynlib: gobjectlib, importc: "g_signal_parse_name".} +proc g_signal_get_invocation_hint*(instance: gpointer): PGSignalInvocationHint{. + cdecl, dynlib: gobjectlib, importc: "g_signal_get_invocation_hint".} +proc g_signal_stop_emission*(instance: gpointer, signal_id: guint, + detail: TGQuark){.cdecl, dynlib: gobjectlib, + importc: "g_signal_stop_emission".} +proc g_signal_stop_emission_by_name*(instance: gpointer, + detailed_signal: cstring){.cdecl, + dynlib: gobjectlib, importc: "g_signal_stop_emission_by_name".} +proc g_signal_add_emission_hook*(signal_id: guint, quark: TGQuark, + hook_func: TGSignalEmissionHook, + hook_data: gpointer, + data_destroy: TGDestroyNotify): gulong{.cdecl, + dynlib: gobjectlib, importc: "g_signal_add_emission_hook".} +proc g_signal_remove_emission_hook*(signal_id: guint, hook_id: gulong){.cdecl, + dynlib: gobjectlib, importc: "g_signal_remove_emission_hook".} +proc g_signal_has_handler_pending*(instance: gpointer, signal_id: guint, + detail: TGQuark, may_be_blocked: gboolean): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_signal_has_handler_pending".} +proc g_signal_connect_closure_by_id*(instance: gpointer, signal_id: guint, + detail: TGQuark, closure: PGClosure, + after: gboolean): gulong{.cdecl, + dynlib: gobjectlib, importc: "g_signal_connect_closure_by_id".} +proc g_signal_connect_closure*(instance: gpointer, detailed_signal: cstring, + closure: PGClosure, after: gboolean): gulong{. + cdecl, dynlib: gobjectlib, importc: "g_signal_connect_closure".} +proc g_signal_connect_data*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer, + destroy_data: TGClosureNotify, + connect_flags: TGConnectFlags): gulong{.cdecl, + dynlib: gobjectlib, importc: "g_signal_connect_data".} +proc g_signal_handler_block*(instance: gpointer, handler_id: gulong){.cdecl, + dynlib: gobjectlib, importc: "g_signal_handler_block".} +proc g_signal_handler_unblock*(instance: gpointer, handler_id: gulong){.cdecl, + dynlib: gobjectlib, importc: "g_signal_handler_unblock".} +proc g_signal_handler_disconnect*(instance: gpointer, handler_id: gulong){. + cdecl, dynlib: gobjectlib, importc: "g_signal_handler_disconnect".} +proc g_signal_handler_is_connected*(instance: gpointer, handler_id: gulong): gboolean{. + cdecl, dynlib: gobjectlib, importc: "g_signal_handler_is_connected".} +proc g_signal_handler_find*(instance: gpointer, mask: TGSignalMatchType, + signal_id: guint, detail: TGQuark, + closure: PGClosure, func: gpointer, data: gpointer): gulong{. + cdecl, dynlib: gobjectlib, importc: "g_signal_handler_find".} +proc g_signal_handlers_block_matched*(instance: gpointer, + mask: TGSignalMatchType, signal_id: guint, + detail: TGQuark, closure: PGClosure, + func: gpointer, data: gpointer): guint{. + cdecl, dynlib: gobjectlib, importc: "g_signal_handlers_block_matched".} +proc g_signal_handlers_unblock_matched*(instance: gpointer, + mask: TGSignalMatchType, + signal_id: guint, detail: TGQuark, + closure: PGClosure, func: gpointer, + data: gpointer): guint{.cdecl, + dynlib: gobjectlib, importc: "g_signal_handlers_unblock_matched".} +proc g_signal_handlers_disconnect_matched*(instance: gpointer, + mask: TGSignalMatchType, signal_id: guint, detail: TGQuark, + closure: PGClosure, func: gpointer, data: gpointer): guint{.cdecl, + dynlib: gobjectlib, importc: "g_signal_handlers_disconnect_matched".} +proc g_signal_override_class_closure*(signal_id: guint, instance_type: GType, + class_closure: PGClosure){.cdecl, + dynlib: gobjectlib, importc: "g_signal_override_class_closure".} +proc g_signal_chain_from_overridden*(instance_and_params: PGValue, + return_value: PGValue){.cdecl, + dynlib: gobjectlib, importc: "g_signal_chain_from_overridden".} +proc g_signal_connect*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong +proc g_signal_connect_after*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong +proc g_signal_connect_swapped*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong +proc g_signal_handlers_disconnect_by_func*(instance: gpointer, + func, data: gpointer): guint +proc g_signal_handlers_block_by_func*(instance: gpointer, func, data: gpointer) +proc g_signal_handlers_unblock_by_func*(instance: gpointer, func, data: gpointer) +proc g_signal_handlers_destroy*(instance: gpointer){.cdecl, dynlib: gobjectlib, + importc: "g_signal_handlers_destroy".} +proc g_signals_destroy*(itype: GType){.cdecl, dynlib: gobjectlib, + importc: "`g_signals_destroy`".} +type + TGTypePluginUse* = proc (plugin: PGTypePlugin){.cdecl.} + TGTypePluginUnuse* = proc (plugin: PGTypePlugin){.cdecl.} + TGTypePluginCompleteTypeInfo* = proc (plugin: PGTypePlugin, g_type: GType, + info: PGTypeInfo, + value_table: PGTypeValueTable){.cdecl.} + TGTypePluginCompleteInterfaceInfo* = proc (plugin: PGTypePlugin, + instance_type: GType, interface_type: GType, info: PGInterfaceInfo){.cdecl.} + PGTypePluginClass* = ptr TGTypePluginClass + TGTypePluginClass*{.final.} = object + base_iface*: TGTypeInterface + use_plugin*: TGTypePluginUse + unuse_plugin*: TGTypePluginUnuse + complete_type_info*: TGTypePluginCompleteTypeInfo + complete_interface_info*: TGTypePluginCompleteInterfaceInfo + + +proc G_TYPE_TYPE_PLUGIN*(): GType +proc G_TYPE_PLUGIN*(inst: Pointer): PGTypePlugin +proc G_TYPE_PLUGIN_CLASS*(vtable: Pointer): PGTypePluginClass +proc G_IS_TYPE_PLUGIN*(inst: Pointer): bool +proc G_IS_TYPE_PLUGIN_CLASS*(vtable: Pointer): bool +proc G_TYPE_PLUGIN_GET_CLASS*(inst: Pointer): PGTypePluginClass +proc g_type_plugin_get_type*(): GType{.cdecl, dynlib: gliblib, + importc: "g_type_plugin_get_type".} +proc g_type_plugin_use*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib, + importc: "g_type_plugin_use".} +proc g_type_plugin_unuse*(plugin: PGTypePlugin){.cdecl, dynlib: gliblib, + importc: "g_type_plugin_unuse".} +proc g_type_plugin_complete_type_info*(plugin: PGTypePlugin, g_type: GType, + info: PGTypeInfo, + value_table: PGTypeValueTable){.cdecl, + dynlib: gliblib, importc: "g_type_plugin_complete_type_info".} +proc g_type_plugin_complete_interface_info*(plugin: PGTypePlugin, + instance_type: GType, interface_type: GType, info: PGInterfaceInfo){.cdecl, + dynlib: gliblib, importc: "g_type_plugin_complete_interface_info".} +type + PGObject* = ptr TGObject + TGObject*{.pure.} = object + g_type_instance*: TGTypeInstance + ref_count*: guint + qdata*: PGData + + TGObjectGetPropertyFunc* = proc (anObject: PGObject, property_id: guint, + value: PGValue, pspec: PGParamSpec){.cdecl.} + TGObjectSetPropertyFunc* = proc (anObject: PGObject, property_id: guint, + value: PGValue, pspec: PGParamSpec){.cdecl.} + TGObjectFinalizeFunc* = proc (anObject: PGObject){.cdecl.} + TGWeakNotify* = proc (data: gpointer, where_the_object_was: PGObject){.cdecl.} + PGObjectConstructParam* = ptr TGObjectConstructParam + PGObjectClass* = ptr TGObjectClass + TGObjectClass*{.pure.} = object + g_type_class*: TGTypeClass + construct_properties*: PGSList + constructor*: proc (theType: GType, n_construct_properties: guint, + construct_properties: PGObjectConstructParam): PGObject{. + cdecl.} + set_property*: proc (anObject: PGObject, property_id: guint, value: PGValue, + pspec: PGParamSpec){.cdecl.} + get_property*: proc (anObject: PGObject, property_id: guint, value: PGValue, + pspec: PGParamSpec){.cdecl.} + dispose*: proc (anObject: PGObject){.cdecl.} + finalize*: proc (anObject: PGObject){.cdecl.} + dispatch_properties_changed*: proc (anObject: PGObject, n_pspecs: guint, + pspecs: PPGParamSpec){.cdecl.} + notify*: proc (anObject: PGObject, pspec: PGParamSpec){.cdecl.} + pdummy*: array[0..7, gpointer] + + TGObjectConstructParam*{.final.} = object + pspec*: PGParamSpec + value*: PGValue + + +proc G_TYPE_IS_OBJECT*(theType: GType): bool +proc G_OBJECT*(anObject: pointer): PGObject +proc G_OBJECT_CLASS*(class: Pointer): PGObjectClass +proc G_IS_OBJECT*(anObject: pointer): bool +proc G_IS_OBJECT_CLASS*(class: Pointer): bool +proc G_OBJECT_GET_CLASS*(anObject: pointer): PGObjectClass +proc G_OBJECT_TYPE*(anObject: pointer): GType +proc G_OBJECT_TYPE_NAME*(anObject: pointer): cstring +proc G_OBJECT_CLASS_TYPE*(class: Pointer): GType +proc G_OBJECT_CLASS_NAME*(class: Pointer): cstring +proc G_VALUE_HOLDS_OBJECT*(value: Pointer): bool +proc g_object_class_install_property*(oclass: PGObjectClass, property_id: guint, + pspec: PGParamSpec){.cdecl, + dynlib: gobjectlib, importc: "g_object_class_install_property".} +proc g_object_class_find_property*(oclass: PGObjectClass, property_name: cstring): PGParamSpec{. + cdecl, dynlib: gobjectlib, importc: "g_object_class_find_property".} +proc g_object_class_list_properties*(oclass: PGObjectClass, n_properties: Pguint): PPGParamSpec{. + cdecl, dynlib: gobjectlib, importc: "g_object_class_list_properties".} +proc g_object_set_property*(anObject: PGObject, property_name: cstring, + value: PGValue){.cdecl, dynlib: gobjectlib, + importc: "g_object_set_property".} +proc g_object_get_property*(anObject: PGObject, property_name: cstring, + value: PGValue){.cdecl, dynlib: gobjectlib, + importc: "g_object_get_property".} +proc g_object_freeze_notify*(anObject: PGObject){.cdecl, dynlib: gobjectlib, + importc: "g_object_freeze_notify".} +proc g_object_notify*(anObject: PGObject, property_name: cstring){.cdecl, + dynlib: gobjectlib, importc: "g_object_notify".} +proc g_object_thaw_notify*(anObject: PGObject){.cdecl, dynlib: gobjectlib, + importc: "g_object_thaw_notify".} +proc g_object_ref*(anObject: gpointer): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_object_ref".} +proc g_object_unref*(anObject: gpointer){.cdecl, dynlib: gobjectlib, + importc: "g_object_unref".} +proc g_object_weak_ref*(anObject: PGObject, notify: TGWeakNotify, data: gpointer){. + cdecl, dynlib: gobjectlib, importc: "g_object_weak_ref".} +proc g_object_weak_unref*(anObject: PGObject, notify: TGWeakNotify, + data: gpointer){.cdecl, dynlib: gobjectlib, + importc: "g_object_weak_unref".} +proc g_object_add_weak_pointer*(anObject: PGObject, + weak_pointer_location: Pgpointer){.cdecl, + dynlib: gobjectlib, importc: "g_object_add_weak_pointer".} +proc g_object_remove_weak_pointer*(anObject: PGObject, + weak_pointer_location: Pgpointer){.cdecl, + dynlib: gobjectlib, importc: "g_object_remove_weak_pointer".} +proc g_object_get_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_object_get_qdata".} +proc g_object_set_qdata*(anObject: PGObject, quark: TGQuark, data: gpointer){. + cdecl, dynlib: gobjectlib, importc: "g_object_set_qdata".} +proc g_object_set_qdata_full*(anObject: PGObject, quark: TGQuark, + data: gpointer, destroy: TGDestroyNotify){.cdecl, + dynlib: gobjectlib, importc: "g_object_set_qdata_full".} +proc g_object_steal_qdata*(anObject: PGObject, quark: TGQuark): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_object_steal_qdata".} +proc g_object_get_data*(anObject: PGObject, key: cstring): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_object_get_data".} +proc g_object_set_data*(anObject: PGObject, key: cstring, data: gpointer){. + cdecl, dynlib: gobjectlib, importc: "g_object_set_data".} +proc g_object_set_data_full*(anObject: PGObject, key: cstring, data: gpointer, + destroy: TGDestroyNotify){.cdecl, + dynlib: gobjectlib, importc: "g_object_set_data_full".} +proc g_object_steal_data*(anObject: PGObject, key: cstring): gpointer{.cdecl, + dynlib: gobjectlib, importc: "g_object_steal_data".} +proc g_object_watch_closure*(anObject: PGObject, closure: PGClosure){.cdecl, + dynlib: gobjectlib, importc: "g_object_watch_closure".} +proc g_cclosure_new_object*(callback_func: TGCallback, anObject: PGObject): PGClosure{. + cdecl, dynlib: gobjectlib, importc: "g_cclosure_new_object".} +proc g_cclosure_new_object_swap*(callback_func: TGCallback, anObject: PGObject): PGClosure{. + cdecl, dynlib: gobjectlib, importc: "g_cclosure_new_object_swap".} +proc g_closure_new_object*(sizeof_closure: guint, anObject: PGObject): PGClosure{. + cdecl, dynlib: gobjectlib, importc: "g_closure_new_object".} +proc g_value_set_object*(value: PGValue, v_object: gpointer){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_object".} +proc g_value_get_object*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_object".} +proc g_value_dup_object*(value: PGValue): PGObject{.cdecl, dynlib: gobjectlib, + importc: "g_value_dup_object".} +proc g_signal_connect_object*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, gobject: gpointer, + connect_flags: TGConnectFlags): gulong{.cdecl, + dynlib: gobjectlib, importc: "g_signal_connect_object".} +proc g_object_run_dispose*(anObject: PGObject){.cdecl, dynlib: gobjectlib, + importc: "g_object_run_dispose".} +proc g_value_set_object_take_ownership*(value: PGValue, v_object: gpointer){. + cdecl, dynlib: gobjectlib, importc: "g_value_set_object_take_ownership".} +proc G_OBJECT_WARN_INVALID_PSPEC*(anObject: gpointer, pname: cstring, + property_id: gint, pspec: gpointer) +proc G_OBJECT_WARN_INVALID_PROPERTY_ID*(anObject: gpointer, property_id: gint, + pspec: gpointer) +type + G_FLAGS_TYPE* = GType + +const + G_E* = 2.71828 + G_LN2* = 0.693147 + G_LN10* = 2.30259 + G_PI* = 3.14159 + G_PI_2* = 1.57080 + G_PI_4* = 0.785398 + G_SQRT2* = 1.41421 + G_LITTLE_ENDIAN* = 1234 + G_BIG_ENDIAN* = 4321 + G_PDP_ENDIAN* = 3412 + +proc GUINT16_SWAP_LE_BE_CONSTANT*(val: guint16): guint16 +proc GUINT32_SWAP_LE_BE_CONSTANT*(val: guint32): guint32 +type + PGEnumClass* = ptr TGEnumClass + PGEnumValue* = ptr TGEnumValue + TGEnumClass*{.final.} = object + g_type_class*: TGTypeClass + minimum*: gint + maximum*: gint + n_values*: guint + values*: PGEnumValue + + TGEnumValue*{.final.} = object + value*: gint + value_name*: cstring + value_nick*: cstring + + PGFlagsClass* = ptr TGFlagsClass + PGFlagsValue* = ptr TGFlagsValue + TGFlagsClass*{.final.} = object + g_type_class*: TGTypeClass + mask*: guint + n_values*: guint + values*: PGFlagsValue + + TGFlagsValue*{.final.} = object + value*: guint + value_name*: cstring + value_nick*: cstring + + +proc G_TYPE_IS_ENUM*(theType: GType): gboolean +proc G_ENUM_CLASS*(class: pointer): PGEnumClass +proc G_IS_ENUM_CLASS*(class: pointer): gboolean +proc G_ENUM_CLASS_TYPE*(class: pointer): GType +proc G_ENUM_CLASS_TYPE_NAME*(class: pointer): cstring +proc G_TYPE_IS_FLAGS*(theType: GType): gboolean +proc G_FLAGS_CLASS*(class: pointer): PGFlagsClass +proc G_IS_FLAGS_CLASS*(class: pointer): gboolean +proc G_FLAGS_CLASS_TYPE*(class: pointer): GType +proc G_FLAGS_CLASS_TYPE_NAME*(class: pointer): cstring +proc G_VALUE_HOLDS_ENUM*(value: pointer): gboolean +proc G_VALUE_HOLDS_FLAGS*(value: pointer): gboolean +proc g_enum_get_value*(enum_class: PGEnumClass, value: gint): PGEnumValue{. + cdecl, dynlib: gliblib, importc: "g_enum_get_value".} +proc g_enum_get_value_by_name*(enum_class: PGEnumClass, name: cstring): PGEnumValue{. + cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_name".} +proc g_enum_get_value_by_nick*(enum_class: PGEnumClass, nick: cstring): PGEnumValue{. + cdecl, dynlib: gliblib, importc: "g_enum_get_value_by_nick".} +proc g_flags_get_first_value*(flags_class: PGFlagsClass, value: guint): PGFlagsValue{. + cdecl, dynlib: gliblib, importc: "g_flags_get_first_value".} +proc g_flags_get_value_by_name*(flags_class: PGFlagsClass, name: cstring): PGFlagsValue{. + cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_name".} +proc g_flags_get_value_by_nick*(flags_class: PGFlagsClass, nick: cstring): PGFlagsValue{. + cdecl, dynlib: gliblib, importc: "g_flags_get_value_by_nick".} +proc g_value_set_enum*(value: PGValue, v_enum: gint){.cdecl, dynlib: gliblib, + importc: "g_value_set_enum".} +proc g_value_get_enum*(value: PGValue): gint{.cdecl, dynlib: gliblib, + importc: "g_value_get_enum".} +proc g_value_set_flags*(value: PGValue, v_flags: guint){.cdecl, dynlib: gliblib, + importc: "g_value_set_flags".} +proc g_value_get_flags*(value: PGValue): guint{.cdecl, dynlib: gliblib, + importc: "g_value_get_flags".} +proc g_enum_register_static*(name: cstring, const_static_values: PGEnumValue): GType{. + cdecl, dynlib: gliblib, importc: "g_enum_register_static".} +proc g_flags_register_static*(name: cstring, const_static_values: PGFlagsValue): GType{. + cdecl, dynlib: gliblib, importc: "g_flags_register_static".} +proc g_enum_complete_type_info*(g_enum_type: GType, info: PGTypeInfo, + const_values: PGEnumValue){.cdecl, + dynlib: gliblib, importc: "g_enum_complete_type_info".} +proc g_flags_complete_type_info*(g_flags_type: GType, info: PGTypeInfo, + const_values: PGFlagsValue){.cdecl, + dynlib: gliblib, importc: "g_flags_complete_type_info".} +const + G_MINFLOAT* = 0.00000 + G_MAXFLOAT* = 1.70000e+308 + G_MINDOUBLE* = G_MINFLOAT + G_MAXDOUBLE* = G_MAXFLOAT + G_MAXSHORT* = 32767 + G_MINSHORT* = - G_MAXSHORT - 1 + G_MAXUSHORT* = 2 * G_MAXSHORT + 1 + G_MAXINT* = 2147483647 + G_MININT* = - G_MAXINT - 1 + G_MAXUINT* = - 1 + G_MINLONG* = G_MININT + G_MAXLONG* = G_MAXINT + G_MAXULONG* = G_MAXUINT + G_MAXINT64* = high(int64) + G_MININT64* = low(int64) + +const + G_GINT16_FORMAT* = "hi" + G_GUINT16_FORMAT* = "hu" + G_GINT32_FORMAT* = 'i' + G_GUINT32_FORMAT* = 'u' + G_HAVE_GINT64* = 1 + G_GINT64_FORMAT* = "I64i" + G_GUINT64_FORMAT* = "I64u" + GLIB_SIZEOF_VOID_P* = SizeOf(Pointer) + GLIB_SIZEOF_LONG* = SizeOf(int32) + GLIB_SIZEOF_SIZE_T* = SizeOf(int32) + +type + PGSystemThread* = ptr TGSystemThread + TGSystemThread*{.final.} = object + data*: array[0..3, char] + dummy_double*: float64 + dummy_pointer*: pointer + dummy_long*: int32 + + +const + GLIB_SYSDEF_POLLIN* = 1 + GLIB_SYSDEF_POLLOUT* = 4 + GLIB_SYSDEF_POLLPRI* = 2 + GLIB_SYSDEF_POLLERR* = 8 + GLIB_SYSDEF_POLLHUP* = 16 + GLIB_SYSDEF_POLLNVAL* = 32 + +proc GUINT_TO_POINTER*(i: guint): pointer +type + PGAsciiType* = ptr TGAsciiType + TGAsciiType* = int32 + +const + G_ASCII_ALNUM* = 1 shl 0 + G_ASCII_ALPHA* = 1 shl 1 + G_ASCII_CNTRL* = 1 shl 2 + G_ASCII_DIGIT* = 1 shl 3 + G_ASCII_GRAPH* = 1 shl 4 + G_ASCII_LOWER* = 1 shl 5 + G_ASCII_PRINT* = 1 shl 6 + G_ASCII_PUNCT* = 1 shl 7 + G_ASCII_SPACE* = 1 shl 8 + G_ASCII_UPPER* = 1 shl 9 + G_ASCII_XDIGIT* = 1 shl 10 + +proc g_ascii_tolower*(c: gchar): gchar{.cdecl, dynlib: gliblib, + importc: "g_ascii_tolower".} +proc g_ascii_toupper*(c: gchar): gchar{.cdecl, dynlib: gliblib, + importc: "g_ascii_toupper".} +proc g_ascii_digit_value*(c: gchar): gint{.cdecl, dynlib: gliblib, + importc: "g_ascii_digit_value".} +proc g_ascii_xdigit_value*(c: gchar): gint{.cdecl, dynlib: gliblib, + importc: "g_ascii_xdigit_value".} +const + G_STR_DELIMITERS* = "``-|> <." + +proc g_strdelimit*(str: cstring, delimiters: cstring, new_delimiter: gchar): cstring{. + cdecl, dynlib: gliblib, importc: "g_strdelimit".} +proc g_strcanon*(str: cstring, valid_chars: cstring, substitutor: gchar): cstring{. + cdecl, dynlib: gliblib, importc: "g_strcanon".} +proc g_strerror*(errnum: gint): cstring{.cdecl, dynlib: gliblib, + importc: "g_strerror".} +proc g_strsignal*(signum: gint): cstring{.cdecl, dynlib: gliblib, + importc: "g_strsignal".} +proc g_strreverse*(str: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_strreverse".} +proc g_strlcpy*(dest: cstring, src: cstring, dest_size: gsize): gsize{.cdecl, + dynlib: gliblib, importc: "g_strlcpy".} +proc g_strlcat*(dest: cstring, src: cstring, dest_size: gsize): gsize{.cdecl, + dynlib: gliblib, importc: "g_strlcat".} +proc g_strstr_len*(haystack: cstring, haystack_len: gssize, needle: cstring): cstring{. + cdecl, dynlib: gliblib, importc: "g_strstr_len".} +proc g_strrstr*(haystack: cstring, needle: cstring): cstring{.cdecl, + dynlib: gliblib, importc: "g_strrstr".} +proc g_strrstr_len*(haystack: cstring, haystack_len: gssize, needle: cstring): cstring{. + cdecl, dynlib: gliblib, importc: "g_strrstr_len".} +proc g_str_has_suffix*(str: cstring, suffix: cstring): gboolean{.cdecl, + dynlib: gliblib, importc: "g_str_has_suffix".} +proc g_str_has_prefix*(str: cstring, prefix: cstring): gboolean{.cdecl, + dynlib: gliblib, importc: "g_str_has_prefix".} +proc g_strtod*(nptr: cstring, endptr: PPgchar): gdouble{.cdecl, dynlib: gliblib, + importc: "g_strtod".} +proc g_ascii_strtod*(nptr: cstring, endptr: PPgchar): gdouble{.cdecl, + dynlib: gliblib, importc: "g_ascii_strtod".} +const + G_ASCII_DTOSTR_BUF_SIZE* = 29 + 10 + +proc g_ascii_dtostr*(buffer: cstring, buf_len: gint, d: gdouble): cstring{. + cdecl, dynlib: gliblib, importc: "g_ascii_dtostr".} +proc g_ascii_formatd*(buffer: cstring, buf_len: gint, format: cstring, + d: gdouble): cstring{.cdecl, dynlib: gliblib, + importc: "g_ascii_formatd".} +proc g_strchug*(str: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_strchug".} +proc g_strchomp*(str: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_strchomp".} +proc g_ascii_strcasecmp*(s1: cstring, s2: cstring): gint{.cdecl, + dynlib: gliblib, importc: "g_ascii_strcasecmp".} +proc g_ascii_strncasecmp*(s1: cstring, s2: cstring, n: gsize): gint{.cdecl, + dynlib: gliblib, importc: "g_ascii_strncasecmp".} +proc g_ascii_strdown*(str: cstring, len: gssize): cstring{.cdecl, + dynlib: gliblib, importc: "g_ascii_strdown".} +proc g_ascii_strup*(str: cstring, len: gssize): cstring{.cdecl, dynlib: gliblib, + importc: "g_ascii_strup".} +proc g_strdup*(str: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_strdup".} +proc g_strndup*(str: cstring, n: gsize): cstring{.cdecl, dynlib: gliblib, + importc: "g_strndup".} +proc g_strnfill*(length: gsize, fill_char: gchar): cstring{.cdecl, + dynlib: gliblib, importc: "g_strnfill".} +proc g_strcompress*(source: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_strcompress".} +proc g_strescape*(source: cstring, exceptions: cstring): cstring{.cdecl, + dynlib: gliblib, importc: "g_strescape".} +proc g_memdup*(mem: gconstpointer, byte_size: guint): gpointer{.cdecl, + dynlib: gliblib, importc: "g_memdup".} +proc g_strsplit*(str: cstring, delimiter: cstring, max_tokens: gint): PPgchar{. + cdecl, dynlib: gliblib, importc: "g_strsplit".} +proc g_strjoinv*(separator: cstring, str_array: PPgchar): cstring{.cdecl, + dynlib: gliblib, importc: "g_strjoinv".} +proc g_strfreev*(str_array: PPgchar){.cdecl, dynlib: gliblib, + importc: "g_strfreev".} +proc g_strdupv*(str_array: PPgchar): PPgchar{.cdecl, dynlib: gliblib, + importc: "g_strdupv".} +proc g_stpcpy*(dest: cstring, src: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_stpcpy".} +proc g_get_user_name*(): cstring{.cdecl, dynlib: gliblib, + importc: "g_get_user_name".} +proc g_get_real_name*(): cstring{.cdecl, dynlib: gliblib, + importc: "g_get_real_name".} +proc g_get_home_dir*(): cstring{.cdecl, dynlib: gliblib, + importc: "g_get_home_dir".} +proc g_get_tmp_dir*(): cstring{.cdecl, dynlib: gliblib, importc: "g_get_tmp_dir".} +proc g_get_prgname*(): cstring{.cdecl, dynlib: gliblib, importc: "g_get_prgname".} +proc g_set_prgname*(prgname: cstring){.cdecl, dynlib: gliblib, + importc: "g_set_prgname".} +type + PGDebugKey* = ptr TGDebugKey + TGDebugKey*{.final.} = object + key*: cstring + value*: guint + + +proc g_parse_debug_string*(str: cstring, keys: PGDebugKey, nkeys: guint): guint{. + cdecl, dynlib: gliblib, importc: "g_parse_debug_string".} +proc g_path_is_absolute*(file_name: cstring): gboolean{.cdecl, dynlib: gliblib, + importc: "g_path_is_absolute".} +proc g_path_skip_root*(file_name: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_path_skip_root".} +proc g_basename*(file_name: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_basename".} +proc g_dirname*(file_name: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_path_get_dirname".} +proc g_get_current_dir*(): cstring{.cdecl, dynlib: gliblib, + importc: "g_get_current_dir".} +proc g_path_get_basename*(file_name: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_path_get_basename".} +proc g_path_get_dirname*(file_name: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_path_get_dirname".} +proc g_nullify_pointer*(nullify_location: Pgpointer){.cdecl, dynlib: gliblib, + importc: "g_nullify_pointer".} +proc g_getenv*(variable: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_getenv".} +type + TGVoidFunc* = proc (){.cdecl.} + +proc g_atexit*(func: TGVoidFunc){.cdecl, dynlib: gliblib, importc: "g_atexit".} +proc g_find_program_in_path*(program: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_find_program_in_path".} +proc g_bit_nth_lsf*(mask: gulong, nth_bit: gint): gint{.cdecl, dynlib: gliblib, + importc: "g_bit_nth_lsf".} +proc g_bit_nth_msf*(mask: gulong, nth_bit: gint): gint{.cdecl, dynlib: gliblib, + importc: "g_bit_nth_msf".} +proc g_bit_storage*(number: gulong): guint{.cdecl, dynlib: gliblib, + importc: "g_bit_storage".} +type + PPGTrashStack* = ptr PGTrashStack + PGTrashStack* = ptr TGTrashStack + TGTrashStack*{.final.} = object + next*: PGTrashStack + + +proc g_trash_stack_push*(stack_p: PPGTrashStack, data_p: gpointer){.cdecl, + dynlib: gliblib, importc: "g_trash_stack_push".} +proc g_trash_stack_pop*(stack_p: PPGTrashStack): gpointer{.cdecl, + dynlib: gliblib, importc: "g_trash_stack_pop".} +proc g_trash_stack_peek*(stack_p: PPGTrashStack): gpointer{.cdecl, + dynlib: gliblib, importc: "g_trash_stack_peek".} +proc g_trash_stack_height*(stack_p: PPGTrashStack): guint{.cdecl, + dynlib: gliblib, importc: "g_trash_stack_height".} +type + PGHashTable* = pointer + TGHRFunc* = proc (key, value, user_data: gpointer): gboolean{.cdecl.} + +proc g_hash_table_new*(hash_func: TGHashFunc, key_equal_func: TGEqualFunc): PGHashTable{. + cdecl, dynlib: gliblib, importc: "g_hash_table_new".} +proc g_hash_table_new_full*(hash_func: TGHashFunc, key_equal_func: TGEqualFunc, + key_destroy_func: TGDestroyNotify, + value_destroy_func: TGDestroyNotify): PGHashTable{. + cdecl, dynlib: gliblib, importc: "g_hash_table_new_full".} +proc g_hash_table_destroy*(hash_table: PGHashTable){.cdecl, dynlib: gliblib, + importc: "g_hash_table_destroy".} +proc g_hash_table_insert*(hash_table: PGHashTable, key: gpointer, + value: gpointer){.cdecl, dynlib: gliblib, + importc: "g_hash_table_insert".} +proc g_hash_table_replace*(hash_table: PGHashTable, key: gpointer, + value: gpointer){.cdecl, dynlib: gliblib, + importc: "g_hash_table_replace".} +proc g_hash_table_remove*(hash_table: PGHashTable, key: gconstpointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_hash_table_remove".} +proc g_hash_table_steal*(hash_table: PGHashTable, key: gconstpointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_hash_table_steal".} +proc g_hash_table_lookup*(hash_table: PGHashTable, key: gconstpointer): gpointer{. + cdecl, dynlib: gliblib, importc: "g_hash_table_lookup".} +proc g_hash_table_lookup_extended*(hash_table: PGHashTable, + lookup_key: gconstpointer, + orig_key: Pgpointer, value: Pgpointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_hash_table_lookup_extended".} +proc g_hash_table_foreach*(hash_table: PGHashTable, func: TGHFunc, + user_data: gpointer){.cdecl, dynlib: gliblib, + importc: "g_hash_table_foreach".} +proc g_hash_table_foreach_remove*(hash_table: PGHashTable, func: TGHRFunc, + user_data: gpointer): guint{.cdecl, + dynlib: gliblib, importc: "g_hash_table_foreach_remove".} +proc g_hash_table_foreach_steal*(hash_table: PGHashTable, func: TGHRFunc, + user_data: gpointer): guint{.cdecl, + dynlib: gliblib, importc: "g_hash_table_foreach_steal".} +proc g_hash_table_size*(hash_table: PGHashTable): guint{.cdecl, dynlib: gliblib, + importc: "g_hash_table_size".} +proc g_str_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl, + dynlib: gliblib, importc: "g_str_equal".} +proc g_str_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib, + importc: "g_str_hash".} +proc g_int_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl, + dynlib: gliblib, importc: "g_int_equal".} +proc g_int_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib, + importc: "g_int_hash".} +proc g_direct_hash*(v: gconstpointer): guint{.cdecl, dynlib: gliblib, + importc: "g_direct_hash".} +proc g_direct_equal*(v: gconstpointer, v2: gconstpointer): gboolean{.cdecl, + dynlib: gliblib, importc: "g_direct_equal".} +proc g_quark_try_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_quark_try_string".} +proc g_quark_from_static_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_quark_from_static_string".} +proc g_quark_from_string*(str: cstring): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_quark_from_string".} +proc g_quark_to_string*(quark: TGQuark): cstring{.cdecl, dynlib: gliblib, + importc: "g_quark_to_string".} +const + G_MEM_ALIGN* = GLIB_SIZEOF_VOID_P + +type + PGMemVTable* = ptr TGMemVTable + TGMemVTable*{.final.} = object + malloc*: proc (n_bytes: gsize): gpointer{.cdecl.} + realloc*: proc (mem: gpointer, n_bytes: gsize): gpointer{.cdecl.} + free*: proc (mem: gpointer){.cdecl.} + calloc*: proc (n_blocks: gsize, n_block_bytes: gsize): gpointer{.cdecl.} + try_malloc*: proc (n_bytes: gsize): gpointer{.cdecl.} + try_realloc*: proc (mem: gpointer, n_bytes: gsize): gpointer{.cdecl.} + + PGMemChunk* = pointer + PGAllocator* = pointer + +proc g_malloc*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib, + importc: "g_malloc".} +proc g_malloc0*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib, + importc: "g_malloc0".} +proc g_realloc*(mem: gpointer, n_bytes: gulong): gpointer{.cdecl, + dynlib: gliblib, importc: "g_realloc".} +proc g_free*(mem: gpointer){.cdecl, dynlib: gliblib, importc: "g_free".} +proc g_try_malloc*(n_bytes: gulong): gpointer{.cdecl, dynlib: gliblib, + importc: "g_try_malloc".} +proc g_try_realloc*(mem: gpointer, n_bytes: gulong): gpointer{.cdecl, + dynlib: gliblib, importc: "g_try_realloc".} +#proc g_new*(bytes_per_struct, n_structs: gsize): gpointer +#proc g_new0*(bytes_per_struct, n_structs: gsize): gpointer +#proc g_renew*(struct_size: gsize, OldMem: gpointer, n_structs: gsize): gpointer + +proc g_mem_set_vtable*(vtable: PGMemVTable){.cdecl, dynlib: gliblib, + importc: "g_mem_set_vtable".} +proc g_mem_is_system_malloc*(): gboolean{.cdecl, dynlib: gliblib, + importc: "g_mem_is_system_malloc".} +proc g_mem_profile*(){.cdecl, dynlib: gliblib, importc: "g_mem_profile".} +proc g_chunk_new*(chunk: Pointer): Pointer +proc g_chunk_new0*(chunk: Pointer): Pointer +proc g_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer) +const + G_ALLOC_ONLY* = 1 + G_ALLOC_AND_FREE* = 2 + +proc g_mem_chunk_new*(name: cstring, atom_size: gint, area_size: gulong, + theType: gint): PGMemChunk{.cdecl, dynlib: gliblib, + importc: "g_mem_chunk_new".} +proc g_mem_chunk_destroy*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, + importc: "g_mem_chunk_destroy".} +proc g_mem_chunk_alloc*(mem_chunk: PGMemChunk): gpointer{.cdecl, + dynlib: gliblib, importc: "g_mem_chunk_alloc".} +proc g_mem_chunk_alloc0*(mem_chunk: PGMemChunk): gpointer{.cdecl, + dynlib: gliblib, importc: "g_mem_chunk_alloc0".} +proc g_mem_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer){.cdecl, + dynlib: gliblib, importc: "g_mem_chunk_free".} +proc g_mem_chunk_clean*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, + importc: "g_mem_chunk_clean".} +proc g_mem_chunk_reset*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, + importc: "g_mem_chunk_reset".} +proc g_mem_chunk_print*(mem_chunk: PGMemChunk){.cdecl, dynlib: gliblib, + importc: "g_mem_chunk_print".} +proc g_mem_chunk_info*(){.cdecl, dynlib: gliblib, importc: "g_mem_chunk_info".} +proc g_blow_chunks*(){.cdecl, dynlib: gliblib, importc: "g_blow_chunks".} +proc g_allocator_new*(name: cstring, n_preallocs: guint): PGAllocator{.cdecl, + dynlib: gliblib, importc: "g_allocator_new".} +proc g_allocator_free*(allocator: PGAllocator){.cdecl, dynlib: gliblib, + importc: "g_allocator_free".} +const + G_ALLOCATOR_LIST* = 1 + G_ALLOCATOR_SLIST* = 2 + G_ALLOCATOR_NODE* = 3 + +proc g_slist_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib, + importc: "g_slist_push_allocator".} +proc g_slist_pop_allocator*(){.cdecl, dynlib: gliblib, + importc: "g_slist_pop_allocator".} +proc g_slist_alloc*(): PGSList{.cdecl, dynlib: gliblib, importc: "g_slist_alloc".} +proc g_slist_free*(list: PGSList){.cdecl, dynlib: gliblib, + importc: "g_slist_free".} +proc g_slist_free_1*(list: PGSList){.cdecl, dynlib: gliblib, + importc: "g_slist_free_1".} +proc g_slist_append*(list: PGSList, data: gpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_append".} +proc g_slist_prepend*(list: PGSList, data: gpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_prepend".} +proc g_slist_insert*(list: PGSList, data: gpointer, position: gint): PGSList{. + cdecl, dynlib: gliblib, importc: "g_slist_insert".} +proc g_slist_insert_sorted*(list: PGSList, data: gpointer, func: TGCompareFunc): PGSList{. + cdecl, dynlib: gliblib, importc: "g_slist_insert_sorted".} +proc g_slist_insert_before*(slist: PGSList, sibling: PGSList, data: gpointer): PGSList{. + cdecl, dynlib: gliblib, importc: "g_slist_insert_before".} +proc g_slist_concat*(list1: PGSList, list2: PGSList): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_concat".} +proc g_slist_remove*(list: PGSList, data: gconstpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_remove".} +proc g_slist_remove_all*(list: PGSList, data: gconstpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_remove_all".} +proc g_slist_remove_link*(list: PGSList, link: PGSList): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_remove_link".} +proc g_slist_delete_link*(list: PGSList, link: PGSList): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_delete_link".} +proc g_slist_reverse*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, + importc: "g_slist_reverse".} +proc g_slist_copy*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, + importc: "g_slist_copy".} +proc g_slist_nth*(list: PGSList, n: guint): PGSList{.cdecl, dynlib: gliblib, + importc: "g_slist_nth".} +proc g_slist_find*(list: PGSList, data: gconstpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_find".} +proc g_slist_find_custom*(list: PGSList, data: gconstpointer, + func: TGCompareFunc): PGSList{.cdecl, dynlib: gliblib, + importc: "g_slist_find_custom".} +proc g_slist_position*(list: PGSList, llink: PGSList): gint{.cdecl, + dynlib: gliblib, importc: "g_slist_position".} +proc g_slist_index*(list: PGSList, data: gconstpointer): gint{.cdecl, + dynlib: gliblib, importc: "g_slist_index".} +proc g_slist_last*(list: PGSList): PGSList{.cdecl, dynlib: gliblib, + importc: "g_slist_last".} +proc g_slist_length*(list: PGSList): guint{.cdecl, dynlib: gliblib, + importc: "g_slist_length".} +proc g_slist_foreach*(list: PGSList, func: TGFunc, user_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_slist_foreach".} +proc g_slist_sort*(list: PGSList, compare_func: TGCompareFunc): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_sort".} +proc g_slist_sort_with_data*(list: PGSList, compare_func: TGCompareDataFunc, + user_data: gpointer): PGSList{.cdecl, + dynlib: gliblib, importc: "g_slist_sort_with_data".} +proc g_slist_nth_data*(list: PGSList, n: guint): gpointer{.cdecl, + dynlib: gliblib, importc: "g_slist_nth_data".} +proc g_slist_next*(slist: PGSList): PGSList +proc g_list_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib, + importc: "g_list_push_allocator".} +proc g_list_pop_allocator*(){.cdecl, dynlib: gliblib, + importc: "g_list_pop_allocator".} +proc g_list_alloc*(): PGList{.cdecl, dynlib: gliblib, importc: "g_list_alloc".} +proc g_list_free*(list: PGList){.cdecl, dynlib: gliblib, importc: "g_list_free".} +proc g_list_free_1*(list: PGList){.cdecl, dynlib: gliblib, + importc: "g_list_free_1".} +proc g_list_append*(list: PGList, data: gpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_append".} +proc g_list_prepend*(list: PGList, data: gpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_prepend".} +proc g_list_insert*(list: PGList, data: gpointer, position: gint): PGList{. + cdecl, dynlib: gliblib, importc: "g_list_insert".} +proc g_list_insert_sorted*(list: PGList, data: gpointer, func: TGCompareFunc): PGList{. + cdecl, dynlib: gliblib, importc: "g_list_insert_sorted".} +proc g_list_insert_before*(list: PGList, sibling: PGList, data: gpointer): PGList{. + cdecl, dynlib: gliblib, importc: "g_list_insert_before".} +proc g_list_concat*(list1: PGList, list2: PGList): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_concat".} +proc g_list_remove*(list: PGList, data: gconstpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_remove".} +proc g_list_remove_all*(list: PGList, data: gconstpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_remove_all".} +proc g_list_remove_link*(list: PGList, llink: PGList): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_remove_link".} +proc g_list_delete_link*(list: PGList, link: PGList): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_delete_link".} +proc g_list_reverse*(list: PGList): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_reverse".} +proc g_list_copy*(list: PGList): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_copy".} +proc g_list_nth*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_nth".} +proc g_list_nth_prev*(list: PGList, n: guint): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_nth_prev".} +proc g_list_find*(list: PGList, data: gconstpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_find".} +proc g_list_find_custom*(list: PGList, data: gconstpointer, func: TGCompareFunc): PGList{. + cdecl, dynlib: gliblib, importc: "g_list_find_custom".} +proc g_list_position*(list: PGList, llink: PGList): gint{.cdecl, + dynlib: gliblib, importc: "g_list_position".} +proc g_list_index*(list: PGList, data: gconstpointer): gint{.cdecl, + dynlib: gliblib, importc: "g_list_index".} +proc g_list_last*(list: PGList): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_last".} +proc g_list_first*(list: PGList): PGList{.cdecl, dynlib: gliblib, + importc: "g_list_first".} +proc g_list_length*(list: PGList): guint{.cdecl, dynlib: gliblib, + importc: "g_list_length".} +proc g_list_foreach*(list: PGList, func: TGFunc, user_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_list_foreach".} +proc g_list_sort*(list: PGList, compare_func: TGCompareFunc): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_sort".} +proc g_list_sort_with_data*(list: PGList, compare_func: TGCompareDataFunc, + user_data: gpointer): PGList{.cdecl, + dynlib: gliblib, importc: "g_list_sort_with_data".} +proc g_list_nth_data*(list: PGList, n: guint): gpointer{.cdecl, dynlib: gliblib, + importc: "g_list_nth_data".} +proc g_list_previous*(list: PGList): PGList +proc g_list_next*(list: PGList): PGList +type + PGCache* = pointer + TGCacheNewFunc* = proc (key: gpointer): gpointer{.cdecl.} + TGCacheDupFunc* = proc (value: gpointer): gpointer{.cdecl.} + TGCacheDestroyFunc* = proc (value: gpointer){.cdecl.} + +proc g_cache_new*(value_new_func: TGCacheNewFunc, + value_destroy_func: TGCacheDestroyFunc, + key_dup_func: TGCacheDupFunc, + key_destroy_func: TGCacheDestroyFunc, + hash_key_func: TGHashFunc, hash_value_func: TGHashFunc, + key_equal_func: TGEqualFunc): PGCache{.cdecl, dynlib: gliblib, + importc: "g_cache_new".} +proc g_cache_destroy*(cache: PGCache){.cdecl, dynlib: gliblib, + importc: "g_cache_destroy".} +proc g_cache_insert*(cache: PGCache, key: gpointer): gpointer{.cdecl, + dynlib: gliblib, importc: "g_cache_insert".} +proc g_cache_remove*(cache: PGCache, value: gconstpointer){.cdecl, + dynlib: gliblib, importc: "g_cache_remove".} +proc g_cache_key_foreach*(cache: PGCache, func: TGHFunc, user_data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_cache_key_foreach".} +proc g_cache_value_foreach*(cache: PGCache, func: TGHFunc, user_data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_cache_value_foreach".} +type + PGCompletionFunc* = ptr TGCompletionFunc + TGCompletionFunc* = gchar + TGCompletionStrncmpFunc* = proc (s1: cstring, s2: cstring, n: gsize): gint{. + cdecl.} + PGCompletion* = ptr TGCompletion + TGCompletion*{.final.} = object + items*: PGList + func*: TGCompletionFunc + prefix*: cstring + cache*: PGList + strncmp_func*: TGCompletionStrncmpFunc + + +proc g_completion_new*(func: TGCompletionFunc): PGCompletion{.cdecl, + dynlib: gliblib, importc: "g_completion_new".} +proc g_completion_add_items*(cmp: PGCompletion, items: PGList){.cdecl, + dynlib: gliblib, importc: "g_completion_add_items".} +proc g_completion_remove_items*(cmp: PGCompletion, items: PGList){.cdecl, + dynlib: gliblib, importc: "g_completion_remove_items".} +proc g_completion_clear_items*(cmp: PGCompletion){.cdecl, dynlib: gliblib, + importc: "g_completion_clear_items".} +proc g_completion_complete*(cmp: PGCompletion, prefix: cstring, + new_prefix: PPgchar): PGList{.cdecl, + dynlib: gliblib, importc: "g_completion_complete".} +proc g_completion_set_compare*(cmp: PGCompletion, + strncmp_func: TGCompletionStrncmpFunc){.cdecl, + dynlib: gliblib, importc: "g_completion_set_compare".} +proc g_completion_free*(cmp: PGCompletion){.cdecl, dynlib: gliblib, + importc: "g_completion_free".} +type + PGConvertError* = ptr TGConvertError + TGConvertError* = enum + G_CONVERT_ERROR_NO_CONVERSION, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, + G_CONVERT_ERROR_FAILED, G_CONVERT_ERROR_PARTIAL_INPUT, + G_CONVERT_ERROR_BAD_URI, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH + +proc G_CONVERT_ERROR*(): TGQuark +proc g_convert_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_convert_error_quark".} +type + PGIConv* = ptr TGIConv + TGIConv* = pointer + +proc g_iconv_open*(to_codeset: cstring, from_codeset: cstring): TGIConv{.cdecl, + dynlib: gliblib, importc: "g_iconv_open".} +proc g_iconv*(`converter`: TGIConv, inbuf: PPgchar, inbytes_left: Pgsize, + outbuf: PPgchar, outbytes_left: Pgsize): gsize{.cdecl, + dynlib: gliblib, importc: "g_iconv".} +proc g_iconv_close*(`converter`: TGIConv): gint{.cdecl, dynlib: gliblib, + importc: "g_iconv_close".} +proc g_convert*(str: cstring, len: gssize, to_codeset: cstring, + from_codeset: cstring, bytes_read: Pgsize, + bytes_written: Pgsize, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_convert".} +proc g_convert_with_iconv*(str: cstring, len: gssize, `converter`: TGIConv, + bytes_read: Pgsize, bytes_written: Pgsize, + error: pointer): cstring{.cdecl, dynlib: gliblib, + importc: "g_convert_with_iconv".} +proc g_convert_with_fallback*(str: cstring, len: gssize, to_codeset: cstring, + from_codeset: cstring, fallback: cstring, + bytes_read: Pgsize, bytes_written: Pgsize, + error: pointer): cstring{.cdecl, dynlib: gliblib, + importc: "g_convert_with_fallback".} +proc g_locale_to_utf8*(opsysstring: cstring, len: gssize, bytes_read: Pgsize, + bytes_written: Pgsize, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_locale_to_utf8".} +proc g_locale_from_utf8*(utf8string: cstring, len: gssize, bytes_read: Pgsize, + bytes_written: Pgsize, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_locale_from_utf8".} +proc g_filename_to_utf8*(opsysstring: cstring, len: gssize, bytes_read: Pgsize, + bytes_written: Pgsize, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_filename_to_utf8".} +proc g_filename_from_utf8*(utf8string: cstring, len: gssize, bytes_read: Pgsize, + bytes_written: Pgsize, error: pointer): cstring{. + cdecl, dynlib: gliblib, importc: "g_filename_from_utf8".} +proc g_filename_from_uri*(uri: cstring, hostname: PPchar, error: pointer): cstring{. + cdecl, dynlib: gliblib, importc: "g_filename_from_uri".} +proc g_filename_to_uri*(filename: cstring, hostname: cstring, error: pointer): cstring{. + cdecl, dynlib: gliblib, importc: "g_filename_to_uri".} +type + TGDataForeachFunc* = proc (key_id: TGQuark, data: gpointer, + user_data: gpointer){.cdecl.} + +proc g_datalist_init*(datalist: PPGData){.cdecl, dynlib: gliblib, + importc: "g_datalist_init".} +proc g_datalist_clear*(datalist: PPGData){.cdecl, dynlib: gliblib, + importc: "g_datalist_clear".} +proc g_datalist_id_get_data*(datalist: PPGData, key_id: TGQuark): gpointer{. + cdecl, dynlib: gliblib, importc: "g_datalist_id_get_data".} +proc g_datalist_id_set_data_full*(datalist: PPGData, key_id: TGQuark, + data: gpointer, destroy_func: TGDestroyNotify){. + cdecl, dynlib: gliblib, importc: "g_datalist_id_set_data_full".} +proc g_datalist_id_remove_no_notify*(datalist: PPGData, key_id: TGQuark): gpointer{. + cdecl, dynlib: gliblib, importc: "g_datalist_id_remove_no_notify".} +proc g_datalist_foreach*(datalist: PPGData, func: TGDataForeachFunc, + user_data: gpointer){.cdecl, dynlib: gliblib, + importc: "g_datalist_foreach".} +proc g_datalist_id_set_data*(datalist: PPGData, key_id: TGQuark, data: gpointer) +proc g_datalist_id_remove_data*(datalist: PPGData, key_id: TGQuark) +proc g_datalist_get_data*(datalist: PPGData, key_str: cstring): PPGData +proc g_datalist_set_data_full*(datalist: PPGData, key_str: cstring, + data: gpointer, destroy_func: TGDestroyNotify) +proc g_datalist_set_data*(datalist: PPGData, key_str: cstring, data: gpointer) +proc g_datalist_remove_no_notify*(datalist: PPGData, key_str: cstring) +proc g_datalist_remove_data*(datalist: PPGData, key_str: cstring) +proc g_dataset_id_get_data*(dataset_location: gconstpointer, key_id: TGQuark): gpointer{. + cdecl, dynlib: gliblib, importc: "g_dataset_id_get_data".} +proc g_dataset_id_set_data_full*(dataset_location: gconstpointer, + key_id: TGQuark, data: gpointer, + destroy_func: TGDestroyNotify){.cdecl, + dynlib: gliblib, importc: "g_dataset_id_set_data_full".} +proc g_dataset_id_remove_no_notify*(dataset_location: gconstpointer, + key_id: TGQuark): gpointer{.cdecl, + dynlib: gliblib, importc: "g_dataset_id_remove_no_notify".} +proc g_dataset_foreach*(dataset_location: gconstpointer, + func: TGDataForeachFunc, user_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_dataset_foreach".} +proc g_dataset_id_set_data*(location: gconstpointer, key_id: TGQuark, + data: gpointer) +proc g_dataset_id_remove_data*(location: gconstpointer, key_id: TGQuark) +proc g_dataset_get_data*(location: gconstpointer, key_str: cstring): gpointer +proc g_dataset_set_data_full*(location: gconstpointer, key_str: cstring, + data: gpointer, destroy_func: TGDestroyNotify) +proc g_dataset_remove_no_notify*(location: gconstpointer, key_str: cstring) +proc g_dataset_set_data*(location: gconstpointer, key_str: cstring, + data: gpointer) +proc g_dataset_remove_data*(location: gconstpointer, key_str: cstring) +type + PGTime* = ptr TGTime + TGTime* = gint32 + PGDateYear* = ptr TGDateYear + TGDateYear* = guint16 + PGDateDay* = ptr TGDateDay + TGDateDay* = guint8 + Ptm* = ptr Ttm + Ttm*{.final.} = object + tm_sec*: gint + tm_min*: gint + tm_hour*: gint + tm_mday*: gint + tm_mon*: gint + tm_year*: gint + tm_wday*: gint + tm_yday*: gint + tm_isdst*: gint + tm_gmtoff*: glong + tm_zone*: cstring + + +type + PGDateDMY* = ptr TGDateDMY + TGDateDMY* = int + +const + G_DATE_DAY* = 0 + G_DATE_MONTH* = 1 + G_DATE_YEAR* = 2 + +type + PGDateWeekday* = ptr TGDateWeekday + TGDateWeekday* = int + +const + G_DATE_BAD_WEEKDAY* = 0 + G_DATE_MONDAY* = 1 + G_DATE_TUESDAY* = 2 + G_DATE_WEDNESDAY* = 3 + G_DATE_THURSDAY* = 4 + G_DATE_FRIDAY* = 5 + G_DATE_SATURDAY* = 6 + G_DATE_SUNDAY* = 7 + +type + PGDateMonth* = ptr TGDateMonth + TGDateMonth* = int + +const + G_DATE_BAD_MONTH* = 0 + G_DATE_JANUARY* = 1 + G_DATE_FEBRUARY* = 2 + G_DATE_MARCH* = 3 + G_DATE_APRIL* = 4 + G_DATE_MAY* = 5 + G_DATE_JUNE* = 6 + G_DATE_JULY* = 7 + G_DATE_AUGUST* = 8 + G_DATE_SEPTEMBER* = 9 + G_DATE_OCTOBER* = 10 + G_DATE_NOVEMBER* = 11 + G_DATE_DECEMBER* = 12 + +const + G_DATE_BAD_JULIAN* = 0 + G_DATE_BAD_DAY* = 0 + G_DATE_BAD_YEAR* = 0 + +type + PGDate* = ptr TGDate + TGDate*{.final.} = object + flag0*: int32 + flag1*: int32 + + +proc g_date_new*(): PGDate{.cdecl, dynlib: gliblib, importc: "g_date_new".} +proc g_date_new_dmy*(day: TGDateDay, month: TGDateMonth, year: TGDateYear): PGDate{. + cdecl, dynlib: gliblib, importc: "g_date_new_dmy".} +proc g_date_new_julian*(julian_day: guint32): PGDate{.cdecl, dynlib: gliblib, + importc: "g_date_new_julian".} +proc g_date_free*(date: PGDate){.cdecl, dynlib: gliblib, importc: "g_date_free".} +proc g_date_valid*(date: PGDate): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_valid".} +proc g_date_valid_month*(month: TGDateMonth): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_valid_month".} +proc g_date_valid_year*(year: TGDateYear): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_valid_year".} +proc g_date_valid_weekday*(weekday: TGDateWeekday): gboolean{.cdecl, + dynlib: gliblib, importc: "g_date_valid_weekday".} +proc g_date_valid_julian*(julian_date: guint32): gboolean{.cdecl, + dynlib: gliblib, importc: "g_date_valid_julian".} +proc g_date_get_weekday*(date: PGDate): TGDateWeekday{.cdecl, dynlib: gliblib, + importc: "g_date_get_weekday".} +proc g_date_get_month*(date: PGDate): TGDateMonth{.cdecl, dynlib: gliblib, + importc: "g_date_get_month".} +proc g_date_get_year*(date: PGDate): TGDateYear{.cdecl, dynlib: gliblib, + importc: "g_date_get_year".} +proc g_date_get_day*(date: PGDate): TGDateDay{.cdecl, dynlib: gliblib, + importc: "g_date_get_day".} +proc g_date_get_julian*(date: PGDate): guint32{.cdecl, dynlib: gliblib, + importc: "g_date_get_julian".} +proc g_date_get_day_of_year*(date: PGDate): guint{.cdecl, dynlib: gliblib, + importc: "g_date_get_day_of_year".} +proc g_date_get_monday_week_of_year*(date: PGDate): guint{.cdecl, + dynlib: gliblib, importc: "g_date_get_monday_week_of_year".} +proc g_date_get_sunday_week_of_year*(date: PGDate): guint{.cdecl, + dynlib: gliblib, importc: "g_date_get_sunday_week_of_year".} +proc g_date_clear*(date: PGDate, n_dates: guint){.cdecl, dynlib: gliblib, + importc: "g_date_clear".} +proc g_date_set_parse*(date: PGDate, str: cstring){.cdecl, dynlib: gliblib, + importc: "g_date_set_parse".} +proc g_date_set_time*(date: PGDate, time: TGTime){.cdecl, dynlib: gliblib, + importc: "g_date_set_time".} +proc g_date_set_month*(date: PGDate, month: TGDateMonth){.cdecl, + dynlib: gliblib, importc: "g_date_set_month".} +proc g_date_set_day*(date: PGDate, day: TGDateDay){.cdecl, dynlib: gliblib, + importc: "g_date_set_day".} +proc g_date_set_year*(date: PGDate, year: TGDateYear){.cdecl, dynlib: gliblib, + importc: "g_date_set_year".} +proc g_date_set_dmy*(date: PGDate, day: TGDateDay, month: TGDateMonth, + y: TGDateYear){.cdecl, dynlib: gliblib, + importc: "g_date_set_dmy".} +proc g_date_set_julian*(date: PGDate, julian_date: guint32){.cdecl, + dynlib: gliblib, importc: "g_date_set_julian".} +proc g_date_is_first_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_is_first_of_month".} +proc g_date_is_last_of_month*(date: PGDate): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_is_last_of_month".} +proc g_date_add_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib, + importc: "g_date_add_days".} +proc g_date_subtract_days*(date: PGDate, n_days: guint){.cdecl, dynlib: gliblib, + importc: "g_date_subtract_days".} +proc g_date_add_months*(date: PGDate, n_months: guint){.cdecl, dynlib: gliblib, + importc: "g_date_add_months".} +proc g_date_subtract_months*(date: PGDate, n_months: guint){.cdecl, + dynlib: gliblib, importc: "g_date_subtract_months".} +proc g_date_add_years*(date: PGDate, n_years: guint){.cdecl, dynlib: gliblib, + importc: "g_date_add_years".} +proc g_date_subtract_years*(date: PGDate, n_years: guint){.cdecl, + dynlib: gliblib, importc: "g_date_subtract_years".} +proc g_date_is_leap_year*(year: TGDateYear): gboolean{.cdecl, dynlib: gliblib, + importc: "g_date_is_leap_year".} +proc g_date_get_days_in_month*(month: TGDateMonth, year: TGDateYear): guint8{. + cdecl, dynlib: gliblib, importc: "g_date_get_days_in_month".} +proc g_date_get_monday_weeks_in_year*(year: TGDateYear): guint8{.cdecl, + dynlib: gliblib, importc: "g_date_get_monday_weeks_in_year".} +proc g_date_get_sunday_weeks_in_year*(year: TGDateYear): guint8{.cdecl, + dynlib: gliblib, importc: "g_date_get_sunday_weeks_in_year".} +proc g_date_days_between*(date1: PGDate, date2: PGDate): gint{.cdecl, + dynlib: gliblib, importc: "g_date_days_between".} +proc g_date_compare*(lhs: PGDate, rhs: PGDate): gint{.cdecl, dynlib: gliblib, + importc: "g_date_compare".} +proc g_date_to_struct_tm*(date: PGDate, tm: Ptm){.cdecl, dynlib: gliblib, + importc: "g_date_to_struct_tm".} +proc g_date_clamp*(date: PGDate, min_date: PGDate, max_date: PGDate){.cdecl, + dynlib: gliblib, importc: "g_date_clamp".} +proc g_date_order*(date1: PGDate, date2: PGDate){.cdecl, dynlib: gliblib, + importc: "g_date_order".} +proc g_date_strftime*(s: cstring, slen: gsize, format: cstring, date: PGDate): gsize{. + cdecl, dynlib: gliblib, importc: "g_date_strftime".} +type + PGDir* = pointer + +proc g_dir_open*(path: cstring, flags: guint, error: pointer): PGDir{.cdecl, + dynlib: gliblib, importc: "g_dir_open".} +proc g_dir_read_name*(dir: PGDir): cstring{.cdecl, dynlib: gliblib, + importc: "g_dir_read_name".} +proc g_dir_rewind*(dir: PGDir){.cdecl, dynlib: gliblib, importc: "g_dir_rewind".} +proc g_dir_close*(dir: PGDir){.cdecl, dynlib: gliblib, importc: "g_dir_close".} +type + PGFileError* = ptr TGFileError + TGFileError* = gint + +type + PGFileTest* = ptr TGFileTest + TGFileTest* = int + +const + G_FILE_TEST_IS_REGULAR* = 1 shl 0 + G_FILE_TEST_IS_SYMLINK* = 1 shl 1 + G_FILE_TEST_IS_DIR* = 1 shl 2 + G_FILE_TEST_IS_EXECUTABLE* = 1 shl 3 + G_FILE_TEST_EXISTS* = 1 shl 4 + +const + G_FILE_ERROR_EXIST* = 0 + G_FILE_ERROR_ISDIR* = 1 + G_FILE_ERROR_ACCES* = 2 + G_FILE_ERROR_NAMETOOLONG* = 3 + G_FILE_ERROR_NOENT* = 4 + G_FILE_ERROR_NOTDIR* = 5 + G_FILE_ERROR_NXIO* = 6 + G_FILE_ERROR_NODEV* = 7 + G_FILE_ERROR_ROFS* = 8 + G_FILE_ERROR_TXTBSY* = 9 + G_FILE_ERROR_FAULT* = 10 + G_FILE_ERROR_LOOP* = 11 + G_FILE_ERROR_NOSPC* = 12 + G_FILE_ERROR_NOMEM* = 13 + G_FILE_ERROR_MFILE* = 14 + G_FILE_ERROR_NFILE* = 15 + G_FILE_ERROR_BADF* = 16 + G_FILE_ERROR_INVAL* = 17 + G_FILE_ERROR_PIPE* = 18 + G_FILE_ERROR_AGAIN* = 19 + G_FILE_ERROR_INTR* = 20 + G_FILE_ERROR_IO* = 21 + G_FILE_ERROR_PERM* = 22 + G_FILE_ERROR_FAILED* = 23 + +proc G_FILE_ERROR*(): TGQuark +proc g_file_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_file_error_quark".} +proc g_file_error_from_errno*(err_no: gint): TGFileError{.cdecl, + dynlib: gliblib, importc: "g_file_error_from_errno".} +proc g_file_test*(filename: cstring, test: TGFileTest): gboolean{.cdecl, + dynlib: gliblib, importc: "g_file_test".} +proc g_file_get_contents*(filename: cstring, contents: PPgchar, length: Pgsize, + error: pointer): gboolean{.cdecl, dynlib: gliblib, + importc: "g_file_get_contents".} +proc g_mkstemp*(tmpl: cstring): int32{.cdecl, dynlib: gliblib, + importc: "g_mkstemp".} +proc g_file_open_tmp*(tmpl: cstring, name_used: PPchar, error: pointer): int32{. + cdecl, dynlib: gliblib, importc: "g_file_open_tmp".} +type + PGHook* = ptr TGHook + TGHook*{.final.} = object + data*: gpointer + next*: PGHook + prev*: PGHook + ref_count*: guint + hook_id*: gulong + flags*: guint + func*: gpointer + destroy*: TGDestroyNotify + + PGHookList* = ptr TGHookList + TGHookCompareFunc* = proc (new_hook: PGHook, sibling: PGHook): gint{.cdecl.} + TGHookFindFunc* = proc (hook: PGHook, data: gpointer): gboolean{.cdecl.} + TGHookMarshaller* = proc (hook: PGHook, marshal_data: gpointer){.cdecl.} + TGHookCheckMarshaller* = proc (hook: PGHook, marshal_data: gpointer): gboolean{. + cdecl.} + TGHookFunc* = proc (data: gpointer){.cdecl.} + TGHookCheckFunc* = proc (data: gpointer): gboolean{.cdecl.} + TGHookFinalizeFunc* = proc (hook_list: PGHookList, hook: PGHook){.cdecl.} + TGHookList*{.final.} = object + seq_id*: gulong + flag0*: int32 + hooks*: PGHook + hook_memchunk*: PGMemChunk + finalize_hook*: TGHookFinalizeFunc + dummy*: array[0..1, gpointer] + + +type + PGHookFlagMask* = ptr TGHookFlagMask + TGHookFlagMask* = int + +const + G_HOOK_FLAG_ACTIVE* = 1'i32 shl 0'i32 + G_HOOK_FLAG_IN_CALL* = 1'i32 shl 1'i32 + G_HOOK_FLAG_MASK* = 0x0000000F'i32 + +const + G_HOOK_FLAG_USER_SHIFT* = 4'i32 + bm_TGHookList_hook_size* = 0x0000FFFF'i32 + bp_TGHookList_hook_size* = 0'i32 + bm_TGHookList_is_setup* = 0x00010000'i32 + bp_TGHookList_is_setup* = 16'i32 + +proc TGHookList_hook_size*(a: var TGHookList): guint +proc TGHookList_set_hook_size*(a: var TGHookList, `hook_size`: guint) +proc TGHookList_is_setup*(a: var TGHookList): guint +proc TGHookList_set_is_setup*(a: var TGHookList, `is_setup`: guint) +proc G_HOOK*(hook: pointer): PGHook +proc G_HOOK_FLAGS*(hook: PGHook): guint +proc G_HOOK_ACTIVE*(hook: PGHook): bool +proc G_HOOK_IN_CALL*(hook: PGHook): bool +proc G_HOOK_IS_VALID*(hook: PGHook): bool +proc G_HOOK_IS_UNLINKED*(hook: PGHook): bool +proc g_hook_list_init*(hook_list: PGHookList, hook_size: guint){.cdecl, + dynlib: gliblib, importc: "g_hook_list_init".} +proc g_hook_list_clear*(hook_list: PGHookList){.cdecl, dynlib: gliblib, + importc: "g_hook_list_clear".} +proc g_hook_alloc*(hook_list: PGHookList): PGHook{.cdecl, dynlib: gliblib, + importc: "g_hook_alloc".} +proc g_hook_free*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, + importc: "g_hook_free".} +proc g_hook_ref*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, + importc: "g_hook_ref".} +proc g_hook_unref*(hook_list: PGHookList, hook: PGHook){.cdecl, dynlib: gliblib, + importc: "g_hook_unref".} +proc g_hook_destroy*(hook_list: PGHookList, hook_id: gulong): gboolean{.cdecl, + dynlib: gliblib, importc: "g_hook_destroy".} +proc g_hook_destroy_link*(hook_list: PGHookList, hook: PGHook){.cdecl, + dynlib: gliblib, importc: "g_hook_destroy_link".} +proc g_hook_prepend*(hook_list: PGHookList, hook: PGHook){.cdecl, + dynlib: gliblib, importc: "g_hook_prepend".} +proc g_hook_insert_before*(hook_list: PGHookList, sibling: PGHook, hook: PGHook){. + cdecl, dynlib: gliblib, importc: "g_hook_insert_before".} +proc g_hook_insert_sorted*(hook_list: PGHookList, hook: PGHook, + func: TGHookCompareFunc){.cdecl, dynlib: gliblib, + importc: "g_hook_insert_sorted".} +proc g_hook_get*(hook_list: PGHookList, hook_id: gulong): PGHook{.cdecl, + dynlib: gliblib, importc: "g_hook_get".} +proc g_hook_find*(hook_list: PGHookList, need_valids: gboolean, + func: TGHookFindFunc, data: gpointer): PGHook{.cdecl, + dynlib: gliblib, importc: "g_hook_find".} +proc g_hook_find_data*(hook_list: PGHookList, need_valids: gboolean, + data: gpointer): PGHook{.cdecl, dynlib: gliblib, + importc: "g_hook_find_data".} +proc g_hook_find_func*(hook_list: PGHookList, need_valids: gboolean, + func: gpointer): PGHook{.cdecl, dynlib: gliblib, + importc: "g_hook_find_func".} +proc g_hook_find_func_data*(hook_list: PGHookList, need_valids: gboolean, + func: gpointer, data: gpointer): PGHook{.cdecl, + dynlib: gliblib, importc: "g_hook_find_func_data".} +proc g_hook_first_valid*(hook_list: PGHookList, may_be_in_call: gboolean): PGHook{. + cdecl, dynlib: gliblib, importc: "g_hook_first_valid".} +proc g_hook_next_valid*(hook_list: PGHookList, hook: PGHook, + may_be_in_call: gboolean): PGHook{.cdecl, + dynlib: gliblib, importc: "g_hook_next_valid".} +proc g_hook_compare_ids*(new_hook: PGHook, sibling: PGHook): gint{.cdecl, + dynlib: gliblib, importc: "g_hook_compare_ids".} +proc g_hook_append*(hook_list: PGHookList, hook: PGHook) +proc g_hook_list_invoke_check*(hook_list: PGHookList, may_recurse: gboolean){. + cdecl, dynlib: gliblib, importc: "g_hook_list_invoke_check".} +proc g_hook_list_marshal*(hook_list: PGHookList, may_recurse: gboolean, + marshaller: TGHookMarshaller, marshal_data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_hook_list_marshal".} +proc g_hook_list_marshal_check*(hook_list: PGHookList, may_recurse: gboolean, + marshaller: TGHookCheckMarshaller, + marshal_data: gpointer){.cdecl, dynlib: gliblib, + importc: "g_hook_list_marshal_check".} +type + PGThreadPool* = ptr TGThreadPool + TGThreadPool*{.final.} = object + func*: TGFunc + user_data*: gpointer + exclusive*: gboolean + + +proc g_thread_pool_new*(func: TGFunc, user_data: gpointer, max_threads: gint, + exclusive: gboolean, error: pointer): PGThreadPool{. + cdecl, dynlib: gliblib, importc: "g_thread_pool_new".} +proc g_thread_pool_push*(pool: PGThreadPool, data: gpointer, error: pointer){. + cdecl, dynlib: gliblib, importc: "g_thread_pool_push".} +proc g_thread_pool_set_max_threads*(pool: PGThreadPool, max_threads: gint, + error: pointer){.cdecl, dynlib: gliblib, + importc: "g_thread_pool_set_max_threads".} +proc g_thread_pool_get_max_threads*(pool: PGThreadPool): gint{.cdecl, + dynlib: gliblib, importc: "g_thread_pool_get_max_threads".} +proc g_thread_pool_get_num_threads*(pool: PGThreadPool): guint{.cdecl, + dynlib: gliblib, importc: "g_thread_pool_get_num_threads".} +proc g_thread_pool_unprocessed*(pool: PGThreadPool): guint{.cdecl, + dynlib: gliblib, importc: "g_thread_pool_unprocessed".} +proc g_thread_pool_free*(pool: PGThreadPool, immediate: gboolean, wait: gboolean){. + cdecl, dynlib: gliblib, importc: "g_thread_pool_free".} +proc g_thread_pool_set_max_unused_threads*(max_threads: gint){.cdecl, + dynlib: gliblib, importc: "g_thread_pool_set_max_unused_threads".} +proc g_thread_pool_get_max_unused_threads*(): gint{.cdecl, dynlib: gliblib, + importc: "g_thread_pool_get_max_unused_threads".} +proc g_thread_pool_get_num_unused_threads*(): guint{.cdecl, dynlib: gliblib, + importc: "g_thread_pool_get_num_unused_threads".} +proc g_thread_pool_stop_unused_threads*(){.cdecl, dynlib: gliblib, + importc: "g_thread_pool_stop_unused_threads".} +type + PGTimer* = pointer + +const + G_USEC_PER_SEC* = 1000000 + +proc g_timer_new*(): PGTimer{.cdecl, dynlib: gliblib, importc: "g_timer_new".} +proc g_timer_destroy*(timer: PGTimer){.cdecl, dynlib: gliblib, + importc: "g_timer_destroy".} +proc g_timer_start*(timer: PGTimer){.cdecl, dynlib: gliblib, + importc: "g_timer_start".} +proc g_timer_stop*(timer: PGTimer){.cdecl, dynlib: gliblib, + importc: "g_timer_stop".} +proc g_timer_reset*(timer: PGTimer){.cdecl, dynlib: gliblib, + importc: "g_timer_reset".} +proc g_timer_elapsed*(timer: PGTimer, microseconds: Pgulong): gdouble{.cdecl, + dynlib: gliblib, importc: "g_timer_elapsed".} +proc g_usleep*(microseconds: gulong){.cdecl, dynlib: gliblib, + importc: "g_usleep".} +proc g_time_val_add*(time: PGTimeVal, microseconds: glong){.cdecl, + dynlib: gliblib, importc: "g_time_val_add".} +type + Pgunichar* = ptr gunichar + gunichar* = guint32 + Pgunichar2* = ptr gunichar2 + gunichar2* = guint16 + PGUnicodeType* = ptr TGUnicodeType + TGUnicodeType* = enum + G_UNICODE_CONTROL, G_UNICODE_FORMAT, G_UNICODE_UNASSIGNED, + G_UNICODE_PRIVATE_USE, G_UNICODE_SURROGATE, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, + G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_LINE_SEPARATOR, G_UNICODE_PARAGRAPH_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR + PGUnicodeBreakType* = ptr TGUnicodeBreakType + TGUnicodeBreakType* = enum + G_UNICODE_BREAK_MANDATORY, G_UNICODE_BREAK_CARRIAGE_RETURN, + G_UNICODE_BREAK_LINE_FEED, G_UNICODE_BREAK_COMBINING_MARK, + G_UNICODE_BREAK_SURROGATE, G_UNICODE_BREAK_ZERO_WIDTH_SPACE, + G_UNICODE_BREAK_INSEPARABLE, G_UNICODE_BREAK_NON_BREAKING_GLUE, + G_UNICODE_BREAK_CONTINGENT, G_UNICODE_BREAK_SPACE, G_UNICODE_BREAK_AFTER, + G_UNICODE_BREAK_BEFORE, G_UNICODE_BREAK_BEFORE_AND_AFTER, + G_UNICODE_BREAK_HYPHEN, G_UNICODE_BREAK_NON_STARTER, + G_UNICODE_BREAK_OPEN_PUNCTUATION, G_UNICODE_BREAK_CLOSE_PUNCTUATION, + G_UNICODE_BREAK_QUOTATION, G_UNICODE_BREAK_EXCLAMATION, + G_UNICODE_BREAK_IDEOGRAPHIC, G_UNICODE_BREAK_NUMERIC, + G_UNICODE_BREAK_INFIX_SEPARATOR, G_UNICODE_BREAK_SYMBOL, + G_UNICODE_BREAK_ALPHABETIC, G_UNICODE_BREAK_PREFIX, G_UNICODE_BREAK_POSTFIX, + G_UNICODE_BREAK_COMPLEX_CONTEXT, G_UNICODE_BREAK_AMBIGUOUS, + G_UNICODE_BREAK_UNKNOWN + +proc g_get_charset*(charset: PPchar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_get_charset".} +proc g_unichar_isalnum*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isalnum".} +proc g_unichar_isalpha*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isalpha".} +proc g_unichar_iscntrl*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_iscntrl".} +proc g_unichar_isdigit*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isdigit".} +proc g_unichar_isgraph*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isgraph".} +proc g_unichar_islower*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_islower".} +proc g_unichar_isprint*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isprint".} +proc g_unichar_ispunct*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_ispunct".} +proc g_unichar_isspace*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isspace".} +proc g_unichar_isupper*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isupper".} +proc g_unichar_isxdigit*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isxdigit".} +proc g_unichar_istitle*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_istitle".} +proc g_unichar_isdefined*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_isdefined".} +proc g_unichar_iswide*(c: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_iswide".} +proc g_unichar_toupper*(c: gunichar): gunichar{.cdecl, dynlib: gliblib, + importc: "g_unichar_toupper".} +proc g_unichar_tolower*(c: gunichar): gunichar{.cdecl, dynlib: gliblib, + importc: "g_unichar_tolower".} +proc g_unichar_totitle*(c: gunichar): gunichar{.cdecl, dynlib: gliblib, + importc: "g_unichar_totitle".} +proc g_unichar_digit_value*(c: gunichar): gint{.cdecl, dynlib: gliblib, + importc: "g_unichar_digit_value".} +proc g_unichar_xdigit_value*(c: gunichar): gint{.cdecl, dynlib: gliblib, + importc: "g_unichar_xdigit_value".} +proc g_unichar_type*(c: gunichar): TGUnicodeType{.cdecl, dynlib: gliblib, + importc: "g_unichar_type".} +proc g_unichar_break_type*(c: gunichar): TGUnicodeBreakType{.cdecl, + dynlib: gliblib, importc: "g_unichar_break_type".} +proc g_unicode_canonical_ordering*(str: Pgunichar, len: gsize){.cdecl, + dynlib: gliblib, importc: "g_unicode_canonical_ordering".} +proc g_unicode_canonical_decomposition*(ch: gunichar, result_len: Pgsize): Pgunichar{. + cdecl, dynlib: gliblib, importc: "g_unicode_canonical_decomposition".} +proc g_utf8_next_char*(p: pguchar): pguchar +proc g_utf8_get_char*(p: cstring): gunichar{.cdecl, dynlib: gliblib, + importc: "g_utf8_get_char".} +proc g_utf8_get_char_validated*(p: cstring, max_len: gssize): gunichar{.cdecl, + dynlib: gliblib, importc: "g_utf8_get_char_validated".} +proc g_utf8_offset_to_pointer*(str: cstring, offset: glong): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_offset_to_pointer".} +proc g_utf8_pointer_to_offset*(str: cstring, pos: cstring): glong{.cdecl, + dynlib: gliblib, importc: "g_utf8_pointer_to_offset".} +proc g_utf8_prev_char*(p: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_utf8_prev_char".} +proc g_utf8_find_next_char*(p: cstring, `end`: cstring): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_find_next_char".} +proc g_utf8_find_prev_char*(str: cstring, p: cstring): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_find_prev_char".} +proc g_utf8_strlen*(p: cstring, max: gssize): glong{.cdecl, dynlib: gliblib, + importc: "g_utf8_strlen".} +proc g_utf8_strncpy*(dest: cstring, src: cstring, n: gsize): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_strncpy".} +proc g_utf8_strchr*(p: cstring, len: gssize, c: gunichar): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_strchr".} +proc g_utf8_strrchr*(p: cstring, len: gssize, c: gunichar): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_strrchr".} +proc g_utf8_to_utf16*(str: cstring, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): Pgunichar2{.cdecl, + dynlib: gliblib, importc: "g_utf8_to_utf16".} +proc g_utf8_to_ucs4*(str: cstring, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): Pgunichar{.cdecl, + dynlib: gliblib, importc: "g_utf8_to_ucs4".} +proc g_utf8_to_ucs4_fast*(str: cstring, len: glong, items_written: Pglong): Pgunichar{. + cdecl, dynlib: gliblib, importc: "g_utf8_to_ucs4_fast".} +proc g_utf16_to_ucs4*(str: Pgunichar2, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): Pgunichar{.cdecl, + dynlib: gliblib, importc: "g_utf16_to_ucs4".} +proc g_utf16_to_utf8*(str: Pgunichar2, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf16_to_utf8".} +proc g_ucs4_to_utf16*(str: Pgunichar, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): Pgunichar2{.cdecl, + dynlib: gliblib, importc: "g_ucs4_to_utf16".} +proc g_ucs4_to_utf8*(str: Pgunichar, len: glong, items_read: Pglong, + items_written: Pglong, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_ucs4_to_utf8".} +proc g_unichar_to_utf8*(c: gunichar, outbuf: cstring): gint{.cdecl, + dynlib: gliblib, importc: "g_unichar_to_utf8".} +proc g_utf8_validate*(str: cstring, max_len: gssize, `end`: PPgchar): gboolean{. + cdecl, dynlib: gliblib, importc: "g_utf8_validate".} +proc g_unichar_validate*(ch: gunichar): gboolean{.cdecl, dynlib: gliblib, + importc: "g_unichar_validate".} +proc g_utf8_strup*(str: cstring, len: gssize): cstring{.cdecl, dynlib: gliblib, + importc: "g_utf8_strup".} +proc g_utf8_strdown*(str: cstring, len: gssize): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_strdown".} +proc g_utf8_casefold*(str: cstring, len: gssize): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_casefold".} +type + PGNormalizeMode* = ptr TGNormalizeMode + TGNormalizeMode* = gint + +const + G_NORMALIZE_DEFAULT* = 0 + G_NORMALIZE_NFD* = G_NORMALIZE_DEFAULT + G_NORMALIZE_DEFAULT_COMPOSE* = 1 + G_NORMALIZE_NFC* = G_NORMALIZE_DEFAULT_COMPOSE + G_NORMALIZE_ALL* = 2 + G_NORMALIZE_NFKD* = G_NORMALIZE_ALL + G_NORMALIZE_ALL_COMPOSE* = 3 + G_NORMALIZE_NFKC* = G_NORMALIZE_ALL_COMPOSE + +proc g_utf8_normalize*(str: cstring, len: gssize, mode: TGNormalizeMode): cstring{. + cdecl, dynlib: gliblib, importc: "g_utf8_normalize".} +proc g_utf8_collate*(str1: cstring, str2: cstring): gint{.cdecl, + dynlib: gliblib, importc: "g_utf8_collate".} +proc g_utf8_collate_key*(str: cstring, len: gssize): cstring{.cdecl, + dynlib: gliblib, importc: "g_utf8_collate_key".} +type + PGString* = ptr TGString + TGString*{.final.} = object + str*: cstring + len*: gsize + allocated_len*: gsize + + PGStringChunk* = pointer + +proc g_string_chunk_new*(size: gsize): PGStringChunk{.cdecl, dynlib: gliblib, + importc: "g_string_chunk_new".} +proc g_string_chunk_free*(chunk: PGStringChunk){.cdecl, dynlib: gliblib, + importc: "g_string_chunk_free".} +proc g_string_chunk_insert*(chunk: PGStringChunk, str: cstring): cstring{.cdecl, + dynlib: gliblib, importc: "g_string_chunk_insert".} +proc g_string_chunk_insert_const*(chunk: PGStringChunk, str: cstring): cstring{. + cdecl, dynlib: gliblib, importc: "g_string_chunk_insert_const".} +proc g_string_new*(init: cstring): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_new".} +proc g_string_new_len*(init: cstring, len: gssize): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_new_len".} +proc g_string_sized_new*(dfl_size: gsize): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_sized_new".} +proc g_string_free*(str: PGString, free_segment: gboolean): cstring{.cdecl, + dynlib: gliblib, importc: "g_string_free".} +proc g_string_equal*(v: PGString, v2: PGString): gboolean{.cdecl, + dynlib: gliblib, importc: "g_string_equal".} +proc g_string_hash*(str: PGString): guint{.cdecl, dynlib: gliblib, + importc: "g_string_hash".} +proc g_string_assign*(str: PGString, rval: cstring): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_assign".} +proc g_string_truncate*(str: PGString, len: gsize): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_truncate".} +proc g_string_set_size*(str: PGString, len: gsize): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_set_size".} +proc g_string_insert_len*(str: PGString, pos: gssize, val: cstring, len: gssize): PGString{. + cdecl, dynlib: gliblib, importc: "g_string_insert_len".} +proc g_string_append*(str: PGString, val: cstring): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_append".} +proc g_string_append_len*(str: PGString, val: cstring, len: gssize): PGString{. + cdecl, dynlib: gliblib, importc: "g_string_append_len".} +proc g_string_append_c*(str: PGString, c: gchar): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_append_c".} +proc g_string_append_unichar*(str: PGString, wc: gunichar): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_append_unichar".} +proc g_string_prepend*(str: PGString, val: cstring): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_prepend".} +proc g_string_prepend_c*(str: PGString, c: gchar): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_prepend_c".} +proc g_string_prepend_unichar*(str: PGString, wc: gunichar): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_prepend_unichar".} +proc g_string_prepend_len*(str: PGString, val: cstring, len: gssize): PGString{. + cdecl, dynlib: gliblib, importc: "g_string_prepend_len".} +proc g_string_insert*(str: PGString, pos: gssize, val: cstring): PGString{. + cdecl, dynlib: gliblib, importc: "g_string_insert".} +proc g_string_insert_c*(str: PGString, pos: gssize, c: gchar): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_insert_c".} +proc g_string_insert_unichar*(str: PGString, pos: gssize, wc: gunichar): PGString{. + cdecl, dynlib: gliblib, importc: "g_string_insert_unichar".} +proc g_string_erase*(str: PGString, pos: gssize, len: gssize): PGString{.cdecl, + dynlib: gliblib, importc: "g_string_erase".} +proc g_string_ascii_down*(str: PGString): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_ascii_down".} +proc g_string_ascii_up*(str: PGString): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_ascii_up".} +proc g_string_down*(str: PGString): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_down".} +proc g_string_up*(str: PGString): PGString{.cdecl, dynlib: gliblib, + importc: "g_string_up".} +type + PGIOError* = ptr TGIOError + TGIOError* = enum + G_IO_ERROR_NONE, G_IO_ERROR_AGAIN, G_IO_ERROR_INVAL, G_IO_ERROR_UNKNOWN + +proc G_IO_CHANNEL_ERROR*(): TGQuark +type + PGIOChannelError* = ptr TGIOChannelError + TGIOChannelError* = enum + G_IO_CHANNEL_ERROR_FBIG, G_IO_CHANNEL_ERROR_INVAL, G_IO_CHANNEL_ERROR_IO, + G_IO_CHANNEL_ERROR_ISDIR, G_IO_CHANNEL_ERROR_NOSPC, G_IO_CHANNEL_ERROR_NXIO, + G_IO_CHANNEL_ERROR_OVERFLOW, G_IO_CHANNEL_ERROR_PIPE, + G_IO_CHANNEL_ERROR_FAILED + PGIOStatus* = ptr TGIOStatus + TGIOStatus* = enum + G_IO_STATUS_ERROR, G_IO_STATUS_NORMAL, G_IO_STATUS_EOF, G_IO_STATUS_AGAIN + PGSeekType* = ptr TGSeekType + TGSeekType* = enum + G_SEEK_CUR, G_SEEK_SET, G_SEEK_END + PGIOCondition* = ptr TGIOCondition + TGIOCondition* = gint + +const + G_IO_IN* = GLIB_SYSDEF_POLLIN + G_IO_OUT* = GLIB_SYSDEF_POLLOUT + G_IO_PRI* = GLIB_SYSDEF_POLLPRI + G_IO_ERR* = GLIB_SYSDEF_POLLERR + G_IO_HUP* = GLIB_SYSDEF_POLLHUP + G_IO_NVAL* = GLIB_SYSDEF_POLLNVAL + +type + PGIOFlags* = ptr TGIOFlags + TGIOFlags* = gint + +const + G_IO_FLAG_APPEND* = 1 shl 0 + G_IO_FLAG_NONBLOCK* = 1 shl 1 + G_IO_FLAG_IS_READABLE* = 1 shl 2 + G_IO_FLAG_IS_WRITEABLE* = 1 shl 3 + G_IO_FLAG_IS_SEEKABLE* = 1 shl 4 + G_IO_FLAG_MASK* = (1 shl 5) - 1 + G_IO_FLAG_GET_MASK* = G_IO_FLAG_MASK + G_IO_FLAG_SET_MASK* = G_IO_FLAG_APPEND or G_IO_FLAG_NONBLOCK + +type + PGIOChannel* = ptr TGIOChannel + TGIOFunc* = proc (source: PGIOChannel, condition: TGIOCondition, + data: gpointer): gboolean{.cdecl.} + PGIOFuncs* = ptr TGIOFuncs + TGIOFuncs*{.final.} = object + io_read*: proc (channel: PGIOChannel, buf: cstring, count: gsize, + bytes_read: Pgsize, err: pointer): TGIOStatus{.cdecl.} + io_write*: proc (channel: PGIOChannel, buf: cstring, count: gsize, + bytes_written: Pgsize, err: pointer): TGIOStatus{.cdecl.} + io_seek*: proc (channel: PGIOChannel, offset: gint64, theType: TGSeekType, + err: pointer): TGIOStatus{.cdecl.} + io_close*: proc (channel: PGIOChannel, err: pointer): TGIOStatus{.cdecl.} + io_create_watch*: proc (channel: PGIOChannel, condition: TGIOCondition): PGSource{. + cdecl.} + io_free*: proc (channel: PGIOChannel){.cdecl.} + io_set_flags*: proc (channel: PGIOChannel, flags: TGIOFlags, err: pointer): TGIOStatus{. + cdecl.} + io_get_flags*: proc (channel: PGIOChannel): TGIOFlags{.cdecl.} + + TGIOChannel*{.final.} = object + ref_count*: guint + funcs*: PGIOFuncs + encoding*: cstring + read_cd*: TGIConv + write_cd*: TGIConv + line_term*: cstring + line_term_len*: guint + buf_size*: gsize + read_buf*: PGString + encoded_read_buf*: PGString + write_buf*: PGString + partial_write_buf*: array[0..5, gchar] + flag0*: guint16 + reserved1*: gpointer + reserved2*: gpointer + + +const + bm_TGIOChannel_use_buffer* = 0x0001'i16 + bp_TGIOChannel_use_buffer* = 0'i16 + bm_TGIOChannel_do_encode* = 0x0002'i16 + bp_TGIOChannel_do_encode* = 1'i16 + bm_TGIOChannel_close_on_unref* = 0x0004'i16 + bp_TGIOChannel_close_on_unref* = 2'i16 + bm_TGIOChannel_is_readable* = 0x0008'i16 + bp_TGIOChannel_is_readable* = 3'i16 + bm_TGIOChannel_is_writeable* = 0x0010'i16 + bp_TGIOChannel_is_writeable* = 4'i16 + bm_TGIOChannel_is_seekable* = 0x0020'i16 + bp_TGIOChannel_is_seekable* = 5'i16 + +proc TGIOChannel_use_buffer*(a: var TGIOChannel): guint +proc TGIOChannel_set_use_buffer*(a: var TGIOChannel, `use_buffer`: guint) +proc TGIOChannel_do_encode*(a: var TGIOChannel): guint +proc TGIOChannel_set_do_encode*(a: var TGIOChannel, `do_encode`: guint) +proc TGIOChannel_close_on_unref*(a: var TGIOChannel): guint +proc TGIOChannel_set_close_on_unref*(a: var TGIOChannel, `close_on_unref`: guint) +proc TGIOChannel_is_readable*(a: var TGIOChannel): guint +proc TGIOChannel_set_is_readable*(a: var TGIOChannel, `is_readable`: guint) +proc TGIOChannel_is_writeable*(a: var TGIOChannel): guint +proc TGIOChannel_set_is_writeable*(a: var TGIOChannel, `is_writeable`: guint) +proc TGIOChannel_is_seekable*(a: var TGIOChannel): guint +proc TGIOChannel_set_is_seekable*(a: var TGIOChannel, `is_seekable`: guint) +proc g_io_channel_init*(channel: PGIOChannel){.cdecl, dynlib: gliblib, + importc: "g_io_channel_init".} +proc g_io_channel_ref*(channel: PGIOChannel){.cdecl, dynlib: gliblib, + importc: "g_io_channel_ref".} +proc g_io_channel_unref*(channel: PGIOChannel){.cdecl, dynlib: gliblib, + importc: "g_io_channel_unref".} +proc g_io_channel_read*(channel: PGIOChannel, buf: cstring, count: gsize, + bytes_read: Pgsize): TGIOError{.cdecl, dynlib: gliblib, + importc: "g_io_channel_read".} +proc g_io_channel_write*(channel: PGIOChannel, buf: cstring, count: gsize, + bytes_written: Pgsize): TGIOError{.cdecl, + dynlib: gliblib, importc: "g_io_channel_write".} +proc g_io_channel_seek*(channel: PGIOChannel, offset: gint64, + theType: TGSeekType): TGIOError{.cdecl, dynlib: gliblib, + importc: "g_io_channel_seek".} +proc g_io_channel_close*(channel: PGIOChannel){.cdecl, dynlib: gliblib, + importc: "g_io_channel_close".} +proc g_io_channel_shutdown*(channel: PGIOChannel, flush: gboolean, err: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_shutdown".} +proc g_io_add_watch_full*(channel: PGIOChannel, priority: gint, + condition: TGIOCondition, func: TGIOFunc, + user_data: gpointer, notify: TGDestroyNotify): guint{. + cdecl, dynlib: gliblib, importc: "g_io_add_watch_full".} +proc g_io_create_watch*(channel: PGIOChannel, condition: TGIOCondition): PGSource{. + cdecl, dynlib: gliblib, importc: "g_io_create_watch".} +proc g_io_add_watch*(channel: PGIOChannel, condition: TGIOCondition, + func: TGIOFunc, user_data: gpointer): guint{.cdecl, + dynlib: gliblib, importc: "g_io_add_watch".} +proc g_io_channel_set_buffer_size*(channel: PGIOChannel, size: gsize){.cdecl, + dynlib: gliblib, importc: "g_io_channel_set_buffer_size".} +proc g_io_channel_get_buffer_size*(channel: PGIOChannel): gsize{.cdecl, + dynlib: gliblib, importc: "g_io_channel_get_buffer_size".} +proc g_io_channel_get_buffer_condition*(channel: PGIOChannel): TGIOCondition{. + cdecl, dynlib: gliblib, importc: "g_io_channel_get_buffer_condition".} +proc g_io_channel_set_flags*(channel: PGIOChannel, flags: TGIOFlags, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_set_flags".} +proc g_io_channel_get_flags*(channel: PGIOChannel): TGIOFlags{.cdecl, + dynlib: gliblib, importc: "g_io_channel_get_flags".} +proc g_io_channel_set_line_term*(channel: PGIOChannel, line_term: cstring, + length: gint){.cdecl, dynlib: gliblib, + importc: "g_io_channel_set_line_term".} +proc g_io_channel_get_line_term*(channel: PGIOChannel, length: Pgint): cstring{. + cdecl, dynlib: gliblib, importc: "g_io_channel_get_line_term".} +proc g_io_channel_set_buffered*(channel: PGIOChannel, buffered: gboolean){. + cdecl, dynlib: gliblib, importc: "g_io_channel_set_buffered".} +proc g_io_channel_get_buffered*(channel: PGIOChannel): gboolean{.cdecl, + dynlib: gliblib, importc: "g_io_channel_get_buffered".} +proc g_io_channel_set_encoding*(channel: PGIOChannel, encoding: cstring, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_set_encoding".} +proc g_io_channel_get_encoding*(channel: PGIOChannel): cstring{.cdecl, + dynlib: gliblib, importc: "g_io_channel_get_encoding".} +proc g_io_channel_set_close_on_unref*(channel: PGIOChannel, do_close: gboolean){. + cdecl, dynlib: gliblib, importc: "g_io_channel_set_close_on_unref".} +proc g_io_channel_get_close_on_unref*(channel: PGIOChannel): gboolean{.cdecl, + dynlib: gliblib, importc: "g_io_channel_get_close_on_unref".} +proc g_io_channel_flush*(channel: PGIOChannel, error: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_flush".} +proc g_io_channel_read_line*(channel: PGIOChannel, str_return: PPgchar, + length: Pgsize, terminator_pos: Pgsize, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_read_line".} +proc g_io_channel_read_line_string*(channel: PGIOChannel, buffer: PGString, + terminator_pos: Pgsize, error: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_read_line_string".} +proc g_io_channel_read_to_end*(channel: PGIOChannel, str_return: PPgchar, + length: Pgsize, error: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_read_to_end".} +proc g_io_channel_read_chars*(channel: PGIOChannel, buf: cstring, count: gsize, + bytes_read: Pgsize, error: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_read_chars".} +proc g_io_channel_read_unichar*(channel: PGIOChannel, thechar: Pgunichar, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_read_unichar".} +proc g_io_channel_write_chars*(channel: PGIOChannel, buf: cstring, + count: gssize, bytes_written: Pgsize, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_write_chars".} +proc g_io_channel_write_unichar*(channel: PGIOChannel, thechar: gunichar, + error: pointer): TGIOStatus{.cdecl, + dynlib: gliblib, importc: "g_io_channel_write_unichar".} +proc g_io_channel_seek_position*(channel: PGIOChannel, offset: gint64, + theType: TGSeekType, error: pointer): TGIOStatus{. + cdecl, dynlib: gliblib, importc: "g_io_channel_seek_position".} +proc g_io_channel_new_file*(filename: cstring, mode: cstring, error: pointer): PGIOChannel{. + cdecl, dynlib: gliblib, importc: "g_io_channel_new_file".} +proc g_io_channel_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_io_channel_error_quark".} +proc g_io_channel_error_from_errno*(en: gint): TGIOChannelError{.cdecl, + dynlib: gliblib, importc: "g_io_channel_error_from_errno".} +proc g_io_channel_unix_new*(fd: int32): PGIOChannel{.cdecl, dynlib: gliblib, + importc: "g_io_channel_unix_new".} +proc g_io_channel_unix_get_fd*(channel: PGIOChannel): gint{.cdecl, + dynlib: gliblib, importc: "g_io_channel_unix_get_fd".} +const + G_LOG_LEVEL_USER_SHIFT* = 8 + +type + PGLogLevelFlags* = ptr TGLogLevelFlags + TGLogLevelFlags* = int32 + +const + G_LOG_FLAG_RECURSION* = 1 shl 0 + G_LOG_FLAG_FATAL* = 1 shl 1 + G_LOG_LEVEL_ERROR* = 1 shl 2 + G_LOG_LEVEL_CRITICAL* = 1 shl 3 + G_LOG_LEVEL_WARNING* = 1 shl 4 + G_LOG_LEVEL_MESSAGE* = 1 shl 5 + G_LOG_LEVEL_INFO* = 1 shl 6 + G_LOG_LEVEL_DEBUG* = 1 shl 7 + G_LOG_LEVEL_MASK* = not 3 + +const + G_LOG_FATAL_MASK* = 5 + +type + TGLogFunc* = proc (log_domain: cstring, log_level: TGLogLevelFlags, + TheMessage: cstring, user_data: gpointer){.cdecl.} + +proc g_log_set_handler*(log_domain: cstring, log_levels: TGLogLevelFlags, + log_func: TGLogFunc, user_data: gpointer): guint{.cdecl, + dynlib: gliblib, importc: "g_log_set_handler".} +proc g_log_remove_handler*(log_domain: cstring, handler_id: guint){.cdecl, + dynlib: gliblib, importc: "g_log_remove_handler".} +proc g_log_default_handler*(log_domain: cstring, log_level: TGLogLevelFlags, + TheMessage: cstring, unused_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_log_default_handler".} +proc g_log_set_fatal_mask*(log_domain: cstring, fatal_mask: TGLogLevelFlags): TGLogLevelFlags{. + cdecl, dynlib: gliblib, importc: "g_log_set_fatal_mask".} +proc g_log_set_always_fatal*(fatal_mask: TGLogLevelFlags): TGLogLevelFlags{. + cdecl, dynlib: gliblib, importc: "g_log_set_always_fatal".} +proc `g_log_fallback_handler`*(log_domain: cstring, log_level: TGLogLevelFlags, + message: cstring, unused_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_log_fallback_handler".} +const + G_LOG_DOMAIN* = nil + +when false: + proc g_error*(format: cstring){.varargs.} + proc g_message*(format: cstring){.varargs.} + proc g_critical*(format: cstring){.varargs.} + proc g_warning*(format: cstring){.varargs.} +type + TGPrintFunc* = proc (str: cstring) + +proc g_set_print_handler*(func: TGPrintFunc): TGPrintFunc{.cdecl, + dynlib: gliblib, importc: "g_set_print_handler".} +proc g_set_printerr_handler*(func: TGPrintFunc): TGPrintFunc{.cdecl, + dynlib: gliblib, importc: "g_set_printerr_handler".} +type + PGMarkupError* = ptr TGMarkupError + TGMarkupError* = enum + G_MARKUP_ERROR_BAD_UTF8, G_MARKUP_ERROR_EMPTY, G_MARKUP_ERROR_PARSE, + G_MARKUP_ERROR_UNKNOWN_ELEMENT, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, + G_MARKUP_ERROR_INVALID_CONTENT + +proc G_MARKUP_ERROR*(): TGQuark +proc g_markup_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_markup_error_quark".} +type + PGMarkupParseFlags* = ptr TGMarkupParseFlags + TGMarkupParseFlags* = int + +const + G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG* = 1 shl 0 + +type + PGMarkupParseContext* = ptr TGMarkupParseContext + TGMarkupParseContext* = pointer + PGMarkupParser* = ptr TGMarkupParser + TGMarkupParser*{.final.} = object + start_element*: proc (context: PGMarkupParseContext, element_name: cstring, + attribute_names: PPgchar, attribute_values: PPgchar, + user_data: gpointer, error: pointer){.cdecl.} + end_element*: proc (context: PGMarkupParseContext, element_name: cstring, + user_data: gpointer, error: pointer){.cdecl.} + text*: proc (context: PGMarkupParseContext, text: cstring, text_len: gsize, + user_data: gpointer, error: pointer){.cdecl.} + passthrough*: proc (context: PGMarkupParseContext, + passthrough_text: cstring, text_len: gsize, + user_data: gpointer, error: pointer){.cdecl.} + error*: proc (context: PGMarkupParseContext, error: pointer, + user_data: gpointer){.cdecl.} + + +proc g_markup_parse_context_new*(parser: PGMarkupParser, + flags: TGMarkupParseFlags, user_data: gpointer, + user_data_dnotify: TGDestroyNotify): PGMarkupParseContext{. + cdecl, dynlib: gliblib, importc: "g_markup_parse_context_new".} +proc g_markup_parse_context_free*(context: PGMarkupParseContext){.cdecl, + dynlib: gliblib, importc: "g_markup_parse_context_free".} +proc g_markup_parse_context_parse*(context: PGMarkupParseContext, text: cstring, + text_len: gssize, error: pointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_markup_parse_context_parse".} +proc g_markup_parse_context_end_parse*(context: PGMarkupParseContext, + error: pointer): gboolean{.cdecl, + dynlib: gliblib, importc: "g_markup_parse_context_end_parse".} +proc g_markup_parse_context_get_position*(context: PGMarkupParseContext, + line_number: Pgint, char_number: Pgint){.cdecl, dynlib: gliblib, + importc: "g_markup_parse_context_get_position".} +proc g_markup_escape_text*(text: cstring, length: gssize): cstring{.cdecl, + dynlib: gliblib, importc: "g_markup_escape_text".} +type + PGNode* = ptr TGNode + TGNode*{.final.} = object + data*: gpointer + next*: PGNode + prev*: PGNode + parent*: PGNode + children*: PGNode + + PGTraverseFlags* = ptr TGTraverseFlags + TGTraverseFlags* = gint + +const + G_TRAVERSE_LEAFS* = 1 shl 0 + G_TRAVERSE_NON_LEAFS* = 1 shl 1 + G_TRAVERSE_ALL* = G_TRAVERSE_LEAFS or G_TRAVERSE_NON_LEAFS + G_TRAVERSE_MASK* = 0x00000003 + +type + PGTraverseType* = ptr TGTraverseType + TGTraverseType* = enum + G_IN_ORDER, G_PRE_ORDER, G_POST_ORDER, G_LEVEL_ORDER + TGNodeTraverseFunc* = proc (node: PGNode, data: gpointer): gboolean{.cdecl.} + TGNodeForeachFunc* = proc (node: PGNode, data: gpointer){.cdecl.} + +proc G_NODE_IS_ROOT*(node: PGNode): bool +proc G_NODE_IS_LEAF*(node: PGNode): bool +proc g_node_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: gliblib, + importc: "g_node_push_allocator".} +proc g_node_pop_allocator*(){.cdecl, dynlib: gliblib, + importc: "g_node_pop_allocator".} +proc g_node_new*(data: gpointer): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_new".} +proc g_node_destroy*(root: PGNode){.cdecl, dynlib: gliblib, + importc: "g_node_destroy".} +proc g_node_unlink*(node: PGNode){.cdecl, dynlib: gliblib, + importc: "g_node_unlink".} +proc g_node_copy*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_copy".} +proc g_node_insert*(parent: PGNode, position: gint, node: PGNode): PGNode{. + cdecl, dynlib: gliblib, importc: "g_node_insert".} +proc g_node_insert_before*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{. + cdecl, dynlib: gliblib, importc: "g_node_insert_before".} +proc g_node_insert_after*(parent: PGNode, sibling: PGNode, node: PGNode): PGNode{. + cdecl, dynlib: gliblib, importc: "g_node_insert_after".} +proc g_node_prepend*(parent: PGNode, node: PGNode): PGNode{.cdecl, + dynlib: gliblib, importc: "g_node_prepend".} +proc g_node_n_nodes*(root: PGNode, flags: TGTraverseFlags): guint{.cdecl, + dynlib: gliblib, importc: "g_node_n_nodes".} +proc g_node_get_root*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_get_root".} +proc g_node_is_ancestor*(node: PGNode, descendant: PGNode): gboolean{.cdecl, + dynlib: gliblib, importc: "g_node_is_ancestor".} +proc g_node_depth*(node: PGNode): guint{.cdecl, dynlib: gliblib, + importc: "g_node_depth".} +proc g_node_find*(root: PGNode, order: TGTraverseType, flags: TGTraverseFlags, + data: gpointer): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_find".} +proc g_node_append*(parent: PGNode, node: PGNode): PGNode +proc g_node_insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode +proc g_node_insert_data_before*(parent: PGNode, sibling: PGNode, data: gpointer): PGNode +proc g_node_prepend_data*(parent: PGNode, data: gpointer): PGNode +proc g_node_append_data*(parent: PGNode, data: gpointer): PGNode +proc g_node_traverse*(root: PGNode, order: TGTraverseType, + flags: TGTraverseFlags, max_depth: gint, + func: TGNodeTraverseFunc, data: gpointer): guint{.cdecl, + dynlib: gliblib, importc: "g_node_traverse".} +proc g_node_max_height*(root: PGNode): guint{.cdecl, dynlib: gliblib, + importc: "g_node_max_height".} +proc g_node_children_foreach*(node: PGNode, flags: TGTraverseFlags, + func: TGNodeForeachFunc, data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_node_children_foreach".} +proc g_node_reverse_children*(node: PGNode){.cdecl, dynlib: gliblib, + importc: "g_node_reverse_children".} +proc g_node_n_children*(node: PGNode): guint{.cdecl, dynlib: gliblib, + importc: "g_node_n_children".} +proc g_node_nth_child*(node: PGNode, n: guint): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_nth_child".} +proc g_node_last_child*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_last_child".} +proc g_node_find_child*(node: PGNode, flags: TGTraverseFlags, data: gpointer): PGNode{. + cdecl, dynlib: gliblib, importc: "g_node_find_child".} +proc g_node_child_position*(node: PGNode, child: PGNode): gint{.cdecl, + dynlib: gliblib, importc: "g_node_child_position".} +proc g_node_child_index*(node: PGNode, data: gpointer): gint{.cdecl, + dynlib: gliblib, importc: "g_node_child_index".} +proc g_node_first_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_first_sibling".} +proc g_node_last_sibling*(node: PGNode): PGNode{.cdecl, dynlib: gliblib, + importc: "g_node_last_sibling".} +proc g_node_prev_sibling*(node: PGNode): PGNode +proc g_node_next_sibling*(node: PGNode): PGNode +proc g_node_first_child*(node: PGNode): PGNode +type + PGTree* = pointer + TGTraverseFunc* = proc (key: gpointer, value: gpointer, data: gpointer): gboolean{. + cdecl.} + +proc g_tree_new*(key_compare_func: TGCompareFunc): PGTree{.cdecl, + dynlib: gliblib, importc: "g_tree_new".} +proc g_tree_new_with_data*(key_compare_func: TGCompareDataFunc, + key_compare_data: gpointer): PGTree{.cdecl, + dynlib: gliblib, importc: "g_tree_new_with_data".} +proc g_tree_new_full*(key_compare_func: TGCompareDataFunc, + key_compare_data: gpointer, + key_destroy_func: TGDestroyNotify, + value_destroy_func: TGDestroyNotify): PGTree{.cdecl, + dynlib: gliblib, importc: "g_tree_new_full".} +proc g_tree_destroy*(tree: PGTree){.cdecl, dynlib: gliblib, + importc: "g_tree_destroy".} +proc g_tree_insert*(tree: PGTree, key: gpointer, value: gpointer){.cdecl, + dynlib: gliblib, importc: "g_tree_insert".} +proc g_tree_replace*(tree: PGTree, key: gpointer, value: gpointer){.cdecl, + dynlib: gliblib, importc: "g_tree_replace".} +proc g_tree_remove*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib, + importc: "g_tree_remove".} +proc g_tree_steal*(tree: PGTree, key: gconstpointer){.cdecl, dynlib: gliblib, + importc: "g_tree_steal".} +proc g_tree_lookup*(tree: PGTree, key: gconstpointer): gpointer{.cdecl, + dynlib: gliblib, importc: "g_tree_lookup".} +proc g_tree_lookup_extended*(tree: PGTree, lookup_key: gconstpointer, + orig_key: Pgpointer, value: Pgpointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_tree_lookup_extended".} +proc g_tree_foreach*(tree: PGTree, func: TGTraverseFunc, user_data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_tree_foreach".} +proc g_tree_search*(tree: PGTree, search_func: TGCompareFunc, + user_data: gconstpointer): gpointer{.cdecl, dynlib: gliblib, + importc: "g_tree_search".} +proc g_tree_height*(tree: PGTree): gint{.cdecl, dynlib: gliblib, + importc: "g_tree_height".} +proc g_tree_nnodes*(tree: PGTree): gint{.cdecl, dynlib: gliblib, + importc: "g_tree_nnodes".} +type + PGPatternSpec* = pointer + +proc g_pattern_spec_new*(pattern: cstring): PGPatternSpec{.cdecl, + dynlib: gliblib, importc: "g_pattern_spec_new".} +proc g_pattern_spec_free*(pspec: PGPatternSpec){.cdecl, dynlib: gliblib, + importc: "g_pattern_spec_free".} +proc g_pattern_spec_equal*(pspec1: PGPatternSpec, pspec2: PGPatternSpec): gboolean{. + cdecl, dynlib: gliblib, importc: "g_pattern_spec_equal".} +proc g_pattern_match*(pspec: PGPatternSpec, string_length: guint, str: cstring, + string_reversed: cstring): gboolean{.cdecl, + dynlib: gliblib, importc: "g_pattern_match".} +proc g_pattern_match_string*(pspec: PGPatternSpec, str: cstring): gboolean{. + cdecl, dynlib: gliblib, importc: "g_pattern_match_string".} +proc g_pattern_match_simple*(pattern: cstring, str: cstring): gboolean{.cdecl, + dynlib: gliblib, importc: "g_pattern_match_simple".} +proc g_spaced_primes_closest*(num: guint): guint{.cdecl, dynlib: gliblib, + importc: "g_spaced_primes_closest".} +proc g_qsort_with_data*(pbase: gconstpointer, total_elems: gint, size: gsize, + compare_func: TGCompareDataFunc, user_data: gpointer){. + cdecl, dynlib: gliblib, importc: "g_qsort_with_data".} +type + PGQueue* = ptr TGQueue + TGQueue*{.final.} = object + head*: PGList + tail*: PGList + length*: guint + + +proc g_queue_new*(): PGQueue{.cdecl, dynlib: gliblib, importc: "g_queue_new".} +proc g_queue_free*(queue: PGQueue){.cdecl, dynlib: gliblib, + importc: "g_queue_free".} +proc g_queue_push_head*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib, + importc: "g_queue_push_head".} +proc g_queue_push_tail*(queue: PGQueue, data: gpointer){.cdecl, dynlib: gliblib, + importc: "g_queue_push_tail".} +proc g_queue_pop_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, + importc: "g_queue_pop_head".} +proc g_queue_pop_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, + importc: "g_queue_pop_tail".} +proc g_queue_is_empty*(queue: PGQueue): gboolean{.cdecl, dynlib: gliblib, + importc: "g_queue_is_empty".} +proc g_queue_peek_head*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, + importc: "g_queue_peek_head".} +proc g_queue_peek_tail*(queue: PGQueue): gpointer{.cdecl, dynlib: gliblib, + importc: "g_queue_peek_tail".} +proc g_queue_push_head_link*(queue: PGQueue, link: PGList){.cdecl, + dynlib: gliblib, importc: "g_queue_push_head_link".} +proc g_queue_push_tail_link*(queue: PGQueue, link: PGList){.cdecl, + dynlib: gliblib, importc: "g_queue_push_tail_link".} +proc g_queue_pop_head_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib, + importc: "g_queue_pop_head_link".} +proc g_queue_pop_tail_link*(queue: PGQueue): PGList{.cdecl, dynlib: gliblib, + importc: "g_queue_pop_tail_link".} +type + PGRand* = pointer + +proc g_rand_new_with_seed*(seed: guint32): PGRand{.cdecl, dynlib: gliblib, + importc: "g_rand_new_with_seed".} +proc g_rand_new*(): PGRand{.cdecl, dynlib: gliblib, importc: "g_rand_new".} +proc g_rand_free*(rand: PGRand){.cdecl, dynlib: gliblib, importc: "g_rand_free".} +proc g_rand_set_seed*(rand: PGRand, seed: guint32){.cdecl, dynlib: gliblib, + importc: "g_rand_set_seed".} +proc g_rand_boolean*(rand: PGRand): gboolean +proc g_rand_int*(rand: PGRand): guint32{.cdecl, dynlib: gliblib, + importc: "g_rand_int".} +proc g_rand_int_range*(rand: PGRand, `begin`: gint32, `end`: gint32): gint32{. + cdecl, dynlib: gliblib, importc: "g_rand_int_range".} +proc g_rand_double*(rand: PGRand): gdouble{.cdecl, dynlib: gliblib, + importc: "g_rand_double".} +proc g_rand_double_range*(rand: PGRand, `begin`: gdouble, `end`: gdouble): gdouble{. + cdecl, dynlib: gliblib, importc: "g_rand_double_range".} +proc g_random_set_seed*(seed: guint32){.cdecl, dynlib: gliblib, + importc: "g_random_set_seed".} +proc g_random_boolean*(): gboolean +proc g_random_int*(): guint32{.cdecl, dynlib: gliblib, importc: "g_random_int".} +proc g_random_int_range*(`begin`: gint32, `end`: gint32): gint32{.cdecl, + dynlib: gliblib, importc: "g_random_int_range".} +proc g_random_double*(): gdouble{.cdecl, dynlib: gliblib, + importc: "g_random_double".} +proc g_random_double_range*(`begin`: gdouble, `end`: gdouble): gdouble{.cdecl, + dynlib: gliblib, importc: "g_random_double_range".} +type + PGTuples* = ptr TGTuples + TGTuples*{.final.} = object + len*: guint + + PGRelation* = pointer + +proc g_relation_new*(fields: gint): PGRelation{.cdecl, dynlib: gliblib, + importc: "g_relation_new".} +proc g_relation_destroy*(relation: PGRelation){.cdecl, dynlib: gliblib, + importc: "g_relation_destroy".} +proc g_relation_index*(relation: PGRelation, field: gint, hash_func: TGHashFunc, + key_equal_func: TGEqualFunc){.cdecl, dynlib: gliblib, + importc: "g_relation_index".} +proc g_relation_delete*(relation: PGRelation, key: gconstpointer, field: gint): gint{. + cdecl, dynlib: gliblib, importc: "g_relation_delete".} +proc g_relation_select*(relation: PGRelation, key: gconstpointer, field: gint): PGTuples{. + cdecl, dynlib: gliblib, importc: "g_relation_select".} +proc g_relation_count*(relation: PGRelation, key: gconstpointer, field: gint): gint{. + cdecl, dynlib: gliblib, importc: "g_relation_count".} +proc g_relation_print*(relation: PGRelation){.cdecl, dynlib: gliblib, + importc: "g_relation_print".} +proc g_tuples_destroy*(tuples: PGTuples){.cdecl, dynlib: gliblib, + importc: "g_tuples_destroy".} +proc g_tuples_index*(tuples: PGTuples, index: gint, field: gint): gpointer{. + cdecl, dynlib: gliblib, importc: "g_tuples_index".} +type + PGTokenType* = ptr TGTokenType + TGTokenType* = gint + +const + G_TOKEN_LEFT_PAREN* = 40 + G_TOKEN_RIGHT_PAREN* = 41 + G_TOKEN_LEFT_CURLY* = 123 + G_TOKEN_RIGHT_CURLY* = 125 + G_TOKEN_LEFT_BRACE* = 91 + G_TOKEN_RIGHT_BRACE* = 93 + G_TOKEN_EQUAL_SIGN* = 61 + G_TOKEN_COMMA* = 44 + G_TOKEN_NONE* = 256 + G_TOKEN_ERROR* = 257 + G_TOKEN_CHAR* = 258 + G_TOKEN_OCTAL* = 260 + G_TOKEN_INT* = 261 + G_TOKEN_HEX* = 262 + G_TOKEN_FLOAT* = 263 + G_TOKEN_STRING* = 264 + G_TOKEN_SYMBOL* = 265 + G_TOKEN_IDENTIFIER* = 266 + G_TOKEN_IDENTIFIER_NULL* = 267 + G_TOKEN_COMMENT_SINGLE* = 268 + G_TOKEN_COMMENT_MULTI* = 269 + G_TOKEN_LAST* = 270 + +type + PGScanner* = ptr TGScanner + PGScannerConfig* = ptr TGScannerConfig + PGTokenValue* = ptr TGTokenValue + TGTokenValue*{.final.} = object + v_float*: gdouble + + TGScannerMsgFunc* = proc (scanner: PGScanner, message: cstring, + error: gboolean){.cdecl.} + TGScanner*{.final.} = object + user_data*: gpointer + max_parse_errors*: guint + parse_errors*: guint + input_name*: cstring + qdata*: PGData + config*: PGScannerConfig + token*: TGTokenType + value*: TGTokenValue + line*: guint + position*: guint + next_token*: TGTokenType + next_value*: TGTokenValue + next_line*: guint + next_position*: guint + symbol_table*: PGHashTable + input_fd*: gint + text*: cstring + text_end*: cstring + buffer*: cstring + scope_id*: guint + msg_handler*: TGScannerMsgFunc + + TGScannerConfig*{.final.} = object + cset_skip_characters*: cstring + cset_identifier_first*: cstring + cset_identifier_nth*: cstring + cpair_comment_single*: cstring + flag0*: int32 + padding_dummy*: guint + + +const + G_CSET_A_2_Z_UCASE* = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + G_CSET_a_2_z_lcase* = "abcdefghijklmnopqrstuvwxyz" + G_CSET_DIGITS* = "0123456789" + +const + bm_TGScannerConfig_case_sensitive* = 0x00000001'i32 + bp_TGScannerConfig_case_sensitive* = 0'i32 + bm_TGScannerConfig_skip_comment_multi* = 0x00000002'i32 + bp_TGScannerConfig_skip_comment_multi* = 1'i32 + bm_TGScannerConfig_skip_comment_single* = 0x00000004'i32 + bp_TGScannerConfig_skip_comment_single* = 2'i32 + bm_TGScannerConfig_scan_comment_multi* = 0x00000008'i32 + bp_TGScannerConfig_scan_comment_multi* = 3'i32 + bm_TGScannerConfig_scan_identifier* = 0x00000010'i32 + bp_TGScannerConfig_scan_identifier* = 4'i32 + bm_TGScannerConfig_scan_identifier_1char* = 0x00000020'i32 + bp_TGScannerConfig_scan_identifier_1char* = 5'i32 + bm_TGScannerConfig_scan_identifier_NULL* = 0x00000040'i32 + bp_TGScannerConfig_scan_identifier_NULL* = 6'i32 + bm_TGScannerConfig_scan_symbols* = 0x00000080'i32 + bp_TGScannerConfig_scan_symbols* = 7'i32 + bm_TGScannerConfig_scan_binary* = 0x00000100'i32 + bp_TGScannerConfig_scan_binary* = 8'i32 + bm_TGScannerConfig_scan_octal* = 0x00000200'i32 + bp_TGScannerConfig_scan_octal* = 9'i32 + bm_TGScannerConfig_scan_float* = 0x00000400'i32 + bp_TGScannerConfig_scan_float* = 10'i32 + bm_TGScannerConfig_scan_hex* = 0x00000800'i32 + bp_TGScannerConfig_scan_hex* = 11'i32 + bm_TGScannerConfig_scan_hex_dollar* = 0x00001000'i32 + bp_TGScannerConfig_scan_hex_dollar* = 12'i32 + bm_TGScannerConfig_scan_string_sq* = 0x00002000'i32 + bp_TGScannerConfig_scan_string_sq* = 13'i32 + bm_TGScannerConfig_scan_string_dq* = 0x00004000'i32 + bp_TGScannerConfig_scan_string_dq* = 14'i32 + bm_TGScannerConfig_numbers_2_int* = 0x00008000'i32 + bp_TGScannerConfig_numbers_2_int* = 15'i32 + bm_TGScannerConfig_int_2_float* = 0x00010000'i32 + bp_TGScannerConfig_int_2_float* = 16'i32 + bm_TGScannerConfig_identifier_2_string* = 0x00020000'i32 + bp_TGScannerConfig_identifier_2_string* = 17'i32 + bm_TGScannerConfig_char_2_token* = 0x00040000'i32 + bp_TGScannerConfig_char_2_token* = 18'i32 + bm_TGScannerConfig_symbol_2_token* = 0x00080000'i32 + bp_TGScannerConfig_symbol_2_token* = 19'i32 + bm_TGScannerConfig_scope_0_fallback* = 0x00100000'i32 + bp_TGScannerConfig_scope_0_fallback* = 20'i32 + +proc TGScannerConfig_case_sensitive*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_case_sensitive*(a: var TGScannerConfig, + `case_sensitive`: guint) +proc TGScannerConfig_skip_comment_multi*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_skip_comment_multi*(a: var TGScannerConfig, + `skip_comment_multi`: guint) +proc TGScannerConfig_skip_comment_single*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_skip_comment_single*(a: var TGScannerConfig, + `skip_comment_single`: guint) +proc TGScannerConfig_scan_comment_multi*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_comment_multi*(a: var TGScannerConfig, + `scan_comment_multi`: guint) +proc TGScannerConfig_scan_identifier*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_identifier*(a: var TGScannerConfig, + `scan_identifier`: guint) +proc TGScannerConfig_scan_identifier_1char*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_identifier_1char*(a: var TGScannerConfig, + `scan_identifier_1char`: guint) +proc TGScannerConfig_scan_identifier_NULL*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_identifier_NULL*(a: var TGScannerConfig, + `scan_identifier_NULL`: guint) +proc TGScannerConfig_scan_symbols*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_symbols*(a: var TGScannerConfig, + `scan_symbols`: guint) +proc TGScannerConfig_scan_binary*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_binary*(a: var TGScannerConfig, + `scan_binary`: guint) +proc TGScannerConfig_scan_octal*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_octal*(a: var TGScannerConfig, `scan_octal`: guint) +proc TGScannerConfig_scan_float*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_float*(a: var TGScannerConfig, `scan_float`: guint) +proc TGScannerConfig_scan_hex*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_hex*(a: var TGScannerConfig, `scan_hex`: guint) +proc TGScannerConfig_scan_hex_dollar*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_hex_dollar*(a: var TGScannerConfig, + `scan_hex_dollar`: guint) +proc TGScannerConfig_scan_string_sq*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_string_sq*(a: var TGScannerConfig, + `scan_string_sq`: guint) +proc TGScannerConfig_scan_string_dq*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scan_string_dq*(a: var TGScannerConfig, + `scan_string_dq`: guint) +proc TGScannerConfig_numbers_2_int*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_numbers_2_int*(a: var TGScannerConfig, + `numbers_2_int`: guint) +proc TGScannerConfig_int_2_float*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_int_2_float*(a: var TGScannerConfig, + `int_2_float`: guint) +proc TGScannerConfig_identifier_2_string*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_identifier_2_string*(a: var TGScannerConfig, + `identifier_2_string`: guint) +proc TGScannerConfig_char_2_token*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_char_2_token*(a: var TGScannerConfig, + `char_2_token`: guint) +proc TGScannerConfig_symbol_2_token*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_symbol_2_token*(a: var TGScannerConfig, + `symbol_2_token`: guint) +proc TGScannerConfig_scope_0_fallback*(a: var TGScannerConfig): guint +proc TGScannerConfig_set_scope_0_fallback*(a: var TGScannerConfig, + `scope_0_fallback`: guint) +proc g_scanner_new*(config_templ: PGScannerConfig): PGScanner{.cdecl, + dynlib: gliblib, importc: "g_scanner_new".} +proc g_scanner_destroy*(scanner: PGScanner){.cdecl, dynlib: gliblib, + importc: "g_scanner_destroy".} +proc g_scanner_input_file*(scanner: PGScanner, input_fd: gint){.cdecl, + dynlib: gliblib, importc: "g_scanner_input_file".} +proc g_scanner_sync_file_offset*(scanner: PGScanner){.cdecl, dynlib: gliblib, + importc: "g_scanner_sync_file_offset".} +proc g_scanner_input_text*(scanner: PGScanner, text: cstring, text_len: guint){. + cdecl, dynlib: gliblib, importc: "g_scanner_input_text".} +proc g_scanner_get_next_token*(scanner: PGScanner): TGTokenType{.cdecl, + dynlib: gliblib, importc: "g_scanner_get_next_token".} +proc g_scanner_peek_next_token*(scanner: PGScanner): TGTokenType{.cdecl, + dynlib: gliblib, importc: "g_scanner_peek_next_token".} +proc g_scanner_cur_token*(scanner: PGScanner): TGTokenType{.cdecl, + dynlib: gliblib, importc: "g_scanner_cur_token".} +proc g_scanner_cur_value*(scanner: PGScanner): TGTokenValue{.cdecl, + dynlib: gliblib, importc: "g_scanner_cur_value".} +proc g_scanner_cur_line*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib, + importc: "g_scanner_cur_line".} +proc g_scanner_cur_position*(scanner: PGScanner): guint{.cdecl, dynlib: gliblib, + importc: "g_scanner_cur_position".} +proc g_scanner_eof*(scanner: PGScanner): gboolean{.cdecl, dynlib: gliblib, + importc: "g_scanner_eof".} +proc g_scanner_set_scope*(scanner: PGScanner, scope_id: guint): guint{.cdecl, + dynlib: gliblib, importc: "g_scanner_set_scope".} +proc g_scanner_scope_add_symbol*(scanner: PGScanner, scope_id: guint, + symbol: cstring, value: gpointer){.cdecl, + dynlib: gliblib, importc: "g_scanner_scope_add_symbol".} +proc g_scanner_scope_remove_symbol*(scanner: PGScanner, scope_id: guint, + symbol: cstring){.cdecl, dynlib: gliblib, + importc: "g_scanner_scope_remove_symbol".} +proc g_scanner_scope_lookup_symbol*(scanner: PGScanner, scope_id: guint, + symbol: cstring): gpointer{.cdecl, + dynlib: gliblib, importc: "g_scanner_scope_lookup_symbol".} +proc g_scanner_scope_foreach_symbol*(scanner: PGScanner, scope_id: guint, + func: TGHFunc, user_data: gpointer){.cdecl, + dynlib: gliblib, importc: "g_scanner_scope_foreach_symbol".} +proc g_scanner_lookup_symbol*(scanner: PGScanner, symbol: cstring): gpointer{. + cdecl, dynlib: gliblib, importc: "g_scanner_lookup_symbol".} +proc g_scanner_unexp_token*(scanner: PGScanner, expected_token: TGTokenType, + identifier_spec: cstring, symbol_spec: cstring, + symbol_name: cstring, `message`: cstring, + is_error: gint){.cdecl, dynlib: gliblib, + importc: "g_scanner_unexp_token".} +proc G_SHELL_ERROR*(): TGQuark +type + PGShellError* = ptr TGShellError + TGShellError* = enum + G_SHELL_ERROR_BAD_QUOTING, G_SHELL_ERROR_EMPTY_STRING, G_SHELL_ERROR_FAILED + +proc g_shell_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_shell_error_quark".} +proc g_shell_quote*(unquoted_string: cstring): cstring{.cdecl, dynlib: gliblib, + importc: "g_shell_quote".} +proc g_shell_unquote*(quoted_string: cstring, error: pointer): cstring{.cdecl, + dynlib: gliblib, importc: "g_shell_unquote".} +proc g_shell_parse_argv*(command_line: cstring, argcp: Pgint, argvp: PPPgchar, + error: pointer): gboolean{.cdecl, dynlib: gliblib, + importc: "g_shell_parse_argv".} +proc G_SPAWN_ERROR*(): TGQuark +type + PGSpawnError* = ptr TGSpawnError + TGSpawnError* = enum + G_SPAWN_ERROR_FORK, G_SPAWN_ERROR_READ, G_SPAWN_ERROR_CHDIR, + G_SPAWN_ERROR_ACCES, G_SPAWN_ERROR_PERM, G_SPAWN_ERROR_2BIG, + G_SPAWN_ERROR_NOEXEC, G_SPAWN_ERROR_NAMETOOLONG, G_SPAWN_ERROR_NOENT, + G_SPAWN_ERROR_NOMEM, G_SPAWN_ERROR_NOTDIR, G_SPAWN_ERROR_LOOP, + G_SPAWN_ERROR_TXTBUSY, G_SPAWN_ERROR_IO, G_SPAWN_ERROR_NFILE, + G_SPAWN_ERROR_MFILE, G_SPAWN_ERROR_INVAL, G_SPAWN_ERROR_ISDIR, + G_SPAWN_ERROR_LIBBAD, G_SPAWN_ERROR_FAILED + TGSpawnChildSetupFunc* = proc (user_data: gpointer){.cdecl.} + PGSpawnFlags* = ptr TGSpawnFlags + TGSpawnFlags* = int + +const + G_SPAWN_LEAVE_DESCRIPTORS_OPEN* = 1 shl 0 + G_SPAWN_DO_NOT_REAP_CHILD* = 1 shl 1 + G_SPAWN_SEARCH_PATH* = 1 shl 2 + G_SPAWN_STDOUT_TO_DEV_NULL* = 1 shl 3 + G_SPAWN_STDERR_TO_DEV_NULL* = 1 shl 4 + G_SPAWN_CHILD_INHERITS_STDIN* = 1 shl 5 + G_SPAWN_FILE_AND_ARGV_ZERO* = 1 shl 6 + +proc g_spawn_error_quark*(): TGQuark{.cdecl, dynlib: gliblib, + importc: "g_spawn_error_quark".} +proc g_spawn_async*(working_directory: cstring, argv: PPgchar, envp: PPgchar, + flags: TGSpawnFlags, child_setup: TGSpawnChildSetupFunc, + user_data: gpointer, child_pid: Pgint, error: pointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_spawn_async".} +proc g_spawn_async_with_pipes*(working_directory: cstring, argv: PPgchar, + envp: PPgchar, flags: TGSpawnFlags, + child_setup: TGSpawnChildSetupFunc, + user_data: gpointer, child_pid: Pgint, + standard_input: Pgint, standard_output: Pgint, + standard_error: Pgint, error: pointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_spawn_async_with_pipes".} +proc g_spawn_sync*(working_directory: cstring, argv: PPgchar, envp: PPgchar, + flags: TGSpawnFlags, child_setup: TGSpawnChildSetupFunc, + user_data: gpointer, standard_output: PPgchar, + standard_error: PPgchar, exit_status: Pgint, error: pointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_spawn_sync".} +proc g_spawn_command_line_sync*(command_line: cstring, standard_output: PPgchar, + standard_error: PPgchar, exit_status: Pgint, + error: pointer): gboolean{.cdecl, + dynlib: gliblib, importc: "g_spawn_command_line_sync".} +proc g_spawn_command_line_async*(command_line: cstring, error: pointer): gboolean{. + cdecl, dynlib: gliblib, importc: "g_spawn_command_line_async".} +proc G_TYPE_IS_BOXED*(theType: GType): gboolean +proc G_VALUE_HOLDS_BOXED*(value: PGValue): gboolean +proc G_TYPE_CLOSURE*(): GType +proc G_TYPE_VALUE*(): GType +proc G_TYPE_VALUE_ARRAY*(): GType +proc G_TYPE_GSTRING*(): GType +proc g_boxed_copy*(boxed_type: GType, src_boxed: gconstpointer): gpointer{. + cdecl, dynlib: gobjectlib, importc: "g_boxed_copy".} +proc g_boxed_free*(boxed_type: GType, boxed: gpointer){.cdecl, + dynlib: gobjectlib, importc: "g_boxed_free".} +proc g_value_set_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_boxed".} +proc g_value_set_static_boxed*(value: PGValue, v_boxed: gconstpointer){.cdecl, + dynlib: gobjectlib, importc: "g_value_set_static_boxed".} +proc g_value_get_boxed*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_boxed".} +proc g_value_dup_boxed*(value: PGValue): gpointer{.cdecl, dynlib: gobjectlib, + importc: "g_value_dup_boxed".} +proc g_boxed_type_register_static*(name: cstring, boxed_copy: TGBoxedCopyFunc, + boxed_free: TGBoxedFreeFunc): GType{.cdecl, + dynlib: gobjectlib, importc: "g_boxed_type_register_static".} +proc g_value_set_boxed_take_ownership*(value: PGValue, v_boxed: gconstpointer){. + cdecl, dynlib: gobjectlib, importc: "g_value_set_boxed_take_ownership".} +proc g_closure_get_type*(): GType{.cdecl, dynlib: gobjectlib, + importc: "g_closure_get_type".} +proc g_value_get_type*(): GType{.cdecl, dynlib: gobjectlib, + importc: "g_value_get_type".} +proc g_value_array_get_type*(): GType{.cdecl, dynlib: gobjectlib, + importc: "g_value_array_get_type".} +proc g_gstring_get_type*(): GType{.cdecl, dynlib: gobjectlib, + importc: "g_gstring_get_type".} +type + PGModule* = pointer + TGModuleFlags* = int32 + TGModuleCheckInit* = proc (module: PGModule): cstring{.cdecl.} + TGModuleUnload* = proc (module: PGModule){.cdecl.} + +const + G_MODULE_BIND_LAZY* = 1 shl 0 + G_MODULE_BIND_MASK* = 1 + +proc g_module_supported*(): gboolean{.cdecl, dynlib: gmodulelib, + importc: "g_module_supported".} +proc g_module_open*(file_name: cstring, flags: TGModuleFlags): PGModule{.cdecl, + dynlib: gmodulelib, importc: "g_module_open".} +proc g_module_close*(module: PGModule): gboolean{.cdecl, dynlib: gmodulelib, + importc: "g_module_close".} +proc g_module_make_resident*(module: PGModule){.cdecl, dynlib: gmodulelib, + importc: "g_module_make_resident".} +proc g_module_error*(): cstring{.cdecl, dynlib: gmodulelib, + importc: "g_module_error".} +proc g_module_symbol*(module: PGModule, symbol_name: cstring, symbol: Pgpointer): gboolean{. + cdecl, dynlib: gmodulelib, importc: "g_module_symbol".} +proc g_module_name*(module: PGModule): cstring{.cdecl, dynlib: gmodulelib, + importc: "g_module_name".} +proc g_module_build_path*(directory: cstring, module_name: cstring): cstring{. + cdecl, dynlib: gmodulelib, importc: "g_module_build_path".} +proc g_cclosure_marshal_VOID__VOID*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__VOID".} +proc g_cclosure_marshal_VOID__BOOLEAN*(closure: PGClosure, + return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__BOOLEAN".} +proc g_cclosure_marshal_VOID__CHAR*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__CHAR".} +proc g_cclosure_marshal_VOID__UCHAR*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UCHAR".} +proc g_cclosure_marshal_VOID__INT*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__INT".} +proc g_cclosure_marshal_VOID__UINT*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UINT".} +proc g_cclosure_marshal_VOID__LONG*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__LONG".} +proc g_cclosure_marshal_VOID__ULONG*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__ULONG".} +proc g_cclosure_marshal_VOID__ENUM*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__ENUM".} +proc g_cclosure_marshal_VOID__FLAGS*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__FLAGS".} +proc g_cclosure_marshal_VOID__FLOAT*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__FLOAT".} +proc g_cclosure_marshal_VOID__DOUBLE*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__DOUBLE".} +proc g_cclosure_marshal_VOID__STRING*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__STRING".} +proc g_cclosure_marshal_VOID__PARAM*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__PARAM".} +proc g_cclosure_marshal_VOID__BOXED*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__BOXED".} +proc g_cclosure_marshal_VOID__POINTER*(closure: PGClosure, + return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__POINTER".} +proc g_cclosure_marshal_VOID__OBJECT*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__OBJECT".} +proc g_cclosure_marshal_STRING__OBJECT_POINTER*(closure: PGClosure, + return_value: PGValue, n_param_values: GUInt, param_values: PGValue, + invocation_hint: GPointer, marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_STRING__OBJECT_POINTER".} +proc g_cclosure_marshal_VOID__UINT_POINTER*(closure: PGClosure, + return_value: PGValue, n_param_values: GUInt, param_values: PGValue, + invocation_hint: GPointer, marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_VOID__UINT_POINTER".} +proc g_cclosure_marshal_BOOLEAN__FLAGS*(closure: PGClosure, + return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gobjectlib, importc: "g_cclosure_marshal_BOOLEAN__FLAGS".} +proc g_cclosure_marshal_BOOL__FLAGS*(closure: PGClosure, return_value: PGValue, + n_param_values: GUInt, + param_values: PGValue, + invocation_hint: GPointer, + marshal_data: GPointer){.cdecl, + dynlib: gliblib, importc: "g_cclosure_marshal_BOOLEAN__FLAGS".} +proc GUINT16_SWAP_LE_BE_CONSTANT*(val: guint16): guint16 = + Result = ((val and 0x00FF'i16) shl 8'i16) or + ((val and 0xFF00'i16) shr 8'i16) + +proc GUINT32_SWAP_LE_BE_CONSTANT*(val: guint32): guint32 = + Result = ((val and 0x000000FF'i32) shl 24'i32) or + ((val and 0x0000FF00'i32) shl 8'i32) or + ((val and 0x00FF0000'i32) shr 8'i32) or + ((val and 0xFF000000'i32) shr 24'i32) + +proc GUINT_TO_POINTER*(i: guint): pointer = + Result = cast[Pointer](TAddress(i)) + +when false: + type + PGArray* = pointer + proc g_array_append_val*(a: PGArray, v: gpointer): PGArray = + result = g_array_append_vals(a, addr(v), 1) + + proc g_array_prepend_val*(a: PGArray, v: gpointer): PGArray = + result = g_array_prepend_vals(a, addr(v), 1) + + proc g_array_insert_val*(a: PGArray, i: guint, v: gpointer): PGArray = + result = g_array_insert_vals(a, i, addr(v), 1) + + proc g_ptr_array_index*(parray: PGPtrArray, index: guint): gpointer = + result = cast[PGPointer](cast[int](parray ^. pdata) + + index * SizeOf(GPointer))^ + + proc G_THREAD_ERROR*(): TGQuark = + result = g_thread_error_quark() + + proc g_mutex_lock*(mutex: PGMutex) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.mutex_lock(mutex) + + proc g_mutex_trylock*(mutex: PGMutex): gboolean = + if g_threads_got_initialized: + result = g_thread_functions_for_glib_use.mutex_trylock(mutex) + else: + result = true + + proc g_mutex_unlock*(mutex: PGMutex) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.mutex_unlock(mutex) + + proc g_mutex_free*(mutex: PGMutex) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.mutex_free(mutex) + + proc g_cond_wait*(cond: PGCond, mutex: PGMutex) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.cond_wait(cond, mutex) + + proc g_cond_timed_wait*(cond: PGCond, mutex: PGMutex, end_time: PGTimeVal): gboolean = + if g_threads_got_initialized: + result = g_thread_functions_for_glib_use.cond_timed_wait(cond, mutex, + end_time) + else: + result = true + + proc g_thread_supported*(): gboolean = + result = g_threads_got_initialized + + proc g_mutex_new*(): PGMutex = + result = g_thread_functions_for_glib_use.mutex_new() + + proc g_cond_new*(): PGCond = + result = g_thread_functions_for_glib_use.cond_new() + + proc g_cond_signal*(cond: PGCond) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.cond_signal(cond) + + proc g_cond_broadcast*(cond: PGCond) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.cond_broadcast(cond) + + proc g_cond_free*(cond: PGCond) = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.cond_free(cond) + + proc g_private_new*(dest: TGDestroyNotify): PGPrivate = + result = g_thread_functions_for_glib_use.private_new(dest) + + proc g_private_get*(private_key: PGPrivate): gpointer = + if g_threads_got_initialized: + result = g_thread_functions_for_glib_use.private_get(private_key) + else: + result = private_key + + proc g_private_set*(private_key: var PGPrivate, data: gpointer) = + if g_threads_got_initialized: + nil + else: + private_key = data + + proc g_thread_yield*() = + if g_threads_got_initialized: + g_thread_functions_for_glib_use.thread_yield + + proc g_thread_create*(func: TGThreadFunc, data: gpointer, joinable: gboolean, + error: pointer): PGThread = + result = g_thread_create_full(func, data, 0, joinable, false, + G_THREAD_PRIORITY_NORMAL, error) + + proc g_static_mutex_get_mutex*(mutex: PPGMutex): PGMutex = + result = g_static_mutex_get_mutex_impl(mutex) + + proc g_static_mutex_lock*(mutex: PGStaticMutex) = + g_mutex_lock(g_static_mutex_get_mutex_impl(PPGMutex(mutex))) + + proc g_static_mutex_trylock*(mutex: PGStaticMutex): gboolean = + result = g_mutex_trylock(g_static_mutex_get_mutex(PPGMutex(mutex))) + + proc g_static_mutex_unlock*(mutex: PGStaticMutex) = + g_mutex_unlock(g_static_mutex_get_mutex_impl(PPGMutex(mutex))) + + proc g_main_new*(is_running: gboolean): PGMainLoop = + result = g_main_loop_new(nil, is_running) + + proc g_main_iteration*(may_block: gboolean): gboolean = + result = g_main_context_iteration(nil, may_block) + + proc g_main_pending*(): gboolean = + result = g_main_context_pending(nil) + + proc g_main_set_poll_func*(func: TGPollFunc) = + g_main_context_set_poll_func(nil, func) + +proc g_slist_next*(slist: PGSList): PGSList = + if slist != nil: + result = slist.next + else: + result = nil + +proc g_new*(bytes_per_struct, n_structs: int): gpointer = + result = g_malloc(n_structs * bytes_per_struct) + +proc g_new0*(bytes_per_struct, n_structs: int): gpointer = + result = g_malloc0(n_structs * bytes_per_struct) + +proc g_renew*(struct_size: int, OldMem: gpointer, n_structs: int): gpointer = + result = g_realloc(OldMem, struct_size * n_structs) + +proc g_chunk_new*(chunk: Pointer): Pointer = + result = g_mem_chunk_alloc(chunk) + +proc g_chunk_new0*(chunk: Pointer): Pointer = + result = g_mem_chunk_alloc0(chunk) + +proc g_chunk_free*(mem_chunk: PGMemChunk, mem: gpointer) = + g_mem_chunk_free(mem_chunk, mem) + +proc g_list_previous*(list: PGList): PGList = + if list != nil: + result = list.prev + else: + result = nil + +proc g_list_next*(list: PGList): PGList = + if list != nil: + result = list.next + else: + result = nil + +proc G_CONVERT_ERROR*(): TGQuark = + result = g_convert_error_quark() + +proc g_datalist_id_set_data*(datalist: PPGData, key_id: TGQuark, data: gpointer) = + g_datalist_id_set_data_full(datalist, key_id, data, TGDestroyNotify(nil)) + +proc g_datalist_id_remove_data*(datalist: PPGData, key_id: TGQuark) = + g_datalist_id_set_data(datalist, key_id, nil) + +proc g_datalist_get_data*(datalist: PPGData, key_str: cstring): PPGData = + result = cast[PPGData](g_datalist_id_get_data(datalist, + g_quark_try_string(key_str))) + +proc g_datalist_set_data_full*(datalist: PPGData, key_str: cstring, + data: gpointer, destroy_func: TGDestroyNotify) = + g_datalist_id_set_data_full(datalist, g_quark_from_string(key_str), data, + destroy_func) + +proc g_datalist_set_data*(datalist: PPGData, key_str: cstring, data: gpointer) = + g_datalist_set_data_full(datalist, key_str, data, nil) + +proc g_datalist_remove_no_notify*(datalist: PPGData, key_str: cstring) = + discard g_datalist_id_remove_no_notify(datalist, g_quark_try_string(key_str)) + +proc g_datalist_remove_data*(datalist: PPGData, key_str: cstring) = + g_datalist_id_set_data(datalist, g_quark_try_string(key_str), nil) + +proc g_dataset_id_set_data*(location: gconstpointer, key_id: TGQuark, + data: gpointer) = + g_dataset_id_set_data_full(location, key_id, data, nil) + +proc g_dataset_id_remove_data*(location: gconstpointer, key_id: TGQuark) = + g_dataset_id_set_data(location, key_id, nil) + +proc g_dataset_get_data*(location: gconstpointer, key_str: cstring): gpointer = + result = g_dataset_id_get_data(location, g_quark_try_string(key_str)) + +proc g_dataset_set_data_full*(location: gconstpointer, key_str: cstring, + data: gpointer, destroy_func: TGDestroyNotify) = + g_dataset_id_set_data_full(location, g_quark_from_string(key_str), data, + destroy_func) + +proc g_dataset_remove_no_notify*(location: gconstpointer, key_str: cstring) = + discard g_dataset_id_remove_no_notify(location, g_quark_try_string(key_str)) + +proc g_dataset_set_data*(location: gconstpointer, key_str: cstring, + data: gpointer) = + g_dataset_set_data_full(location, key_str, data, nil) + +proc g_dataset_remove_data*(location: gconstpointer, key_str: cstring) = + g_dataset_id_set_data(location, g_quark_try_string(key_str), nil) + +proc G_FILE_ERROR*(): TGQuark = + result = g_file_error_quark() + +proc TGHookList_hook_size*(a: var TGHookList): guint = + result = (a.flag0 and bm_TGHookList_hook_size) shr bp_TGHookList_hook_size + +proc TGHookList_set_hook_size*(a: var TGHookList, `hook_size`: guint) = + a.flag0 = a.flag0 or + ((`hook_size` shl bp_TGHookList_hook_size) and bm_TGHookList_hook_size) + +proc TGHookList_is_setup*(a: var TGHookList): guint = + result = (a.flag0 and bm_TGHookList_is_setup) shr bp_TGHookList_is_setup + +proc TGHookList_set_is_setup*(a: var TGHookList, `is_setup`: guint) = + a.flag0 = a.flag0 or + ((`is_setup` shl bp_TGHookList_is_setup) and bm_TGHookList_is_setup) + +proc G_HOOK*(hook: pointer): PGHook = + result = cast[PGHook](hook) + +proc G_HOOK_FLAGS*(hook: PGHook): guint = + result = hook.flags + +proc G_HOOK_ACTIVE*(hook: PGHook): bool = + result = (hook.flags and G_HOOK_FLAG_ACTIVE) != 0'i32 + +proc G_HOOK_IN_CALL*(hook: PGHook): bool = + result = (hook.flags and G_HOOK_FLAG_IN_CALL) != 0'i32 + +proc G_HOOK_IS_VALID*(hook: PGHook): bool = + result = (hook.hook_id != 0) and G_HOOK_ACTIVE(hook) + +proc G_HOOK_IS_UNLINKED*(hook: PGHook): bool = + result = (hook.next == nil) and (hook.prev == nil) and (hook.hook_id == 0) and + (hook.ref_count == 0'i32) + +proc g_hook_append*(hook_list: PGHookList, hook: PGHook) = + g_hook_insert_before(hook_list, nil, hook) + +proc G_IO_CHANNEL_ERROR*(): TGQuark = + result = g_io_channel_error_quark() + +proc TGIOChannel_use_buffer*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_use_buffer) shr + bp_TGIOChannel_use_buffer + +proc TGIOChannel_set_use_buffer*(a: var TGIOChannel, `use_buffer`: guint) = + a.flag0 = a.flag0 or + (int16(`use_buffer` shl bp_TGIOChannel_use_buffer) and + bm_TGIOChannel_use_buffer) + +proc TGIOChannel_do_encode*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_do_encode) shr + bp_TGIOChannel_do_encode + +proc TGIOChannel_set_do_encode*(a: var TGIOChannel, `do_encode`: guint) = + a.flag0 = a.flag0 or + (int16(`do_encode` shl bp_TGIOChannel_do_encode) and + bm_TGIOChannel_do_encode) + +proc TGIOChannel_close_on_unref*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_close_on_unref) shr + bp_TGIOChannel_close_on_unref + +proc TGIOChannel_set_close_on_unref*(a: var TGIOChannel, `close_on_unref`: guint) = + a.flag0 = a.flag0 or + (int16(`close_on_unref` shl bp_TGIOChannel_close_on_unref) and + bm_TGIOChannel_close_on_unref) + +proc TGIOChannel_is_readable*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_is_readable) shr + bp_TGIOChannel_is_readable + +proc TGIOChannel_set_is_readable*(a: var TGIOChannel, `is_readable`: guint) = + a.flag0 = a.flag0 or + (int16(`is_readable` shl bp_TGIOChannel_is_readable) and + bm_TGIOChannel_is_readable) + +proc TGIOChannel_is_writeable*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_is_writeable) shr + bp_TGIOChannel_is_writeable + +proc TGIOChannel_set_is_writeable*(a: var TGIOChannel, `is_writeable`: guint) = + a.flag0 = a.flag0 or + (int16(`is_writeable` shl bp_TGIOChannel_is_writeable) and + bm_TGIOChannel_is_writeable) + +proc TGIOChannel_is_seekable*(a: var TGIOChannel): guint = + result = (a.flag0 and bm_TGIOChannel_is_seekable) shr + bp_TGIOChannel_is_seekable + +proc TGIOChannel_set_is_seekable*(a: var TGIOChannel, `is_seekable`: guint) = + a.flag0 = a.flag0 or + (int16(`is_seekable` shl bp_TGIOChannel_is_seekable) and + bm_TGIOChannel_is_seekable) + +proc g_utf8_next_char*(p: pguchar): pguchar = + result = cast[pguchar](cast[TAddress](p) + 1) # p + ord((g_utf8_skip + p^ )^ ) + +when false: + proc GLIB_CHECK_VERSION*(major, minor, micro: guint): bool = + result = ((GLIB_MAJOR_VERSION > major) or + ((GLIB_MAJOR_VERSION == major) and (GLIB_MINOR_VERSION > minor)) or + ((GLIB_MAJOR_VERSION == major) and (GLIB_MINOR_VERSION == minor) and + (GLIB_MICRO_VERSION >= micro))) + + proc g_error*(format: cstring) = + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format) + + proc g_message*(format: cstring) = + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format) + + proc g_critical*(format: cstring) = + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format) + + proc g_warning*(format: cstring) = + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format) + +proc G_MARKUP_ERROR*(): TGQuark = + result = g_markup_error_quark() + +proc G_NODE_IS_ROOT*(node: PGNode): bool = + result = (node.parent == nil) and (node.next == nil) and (node.prev == nil) + +proc G_NODE_IS_LEAF*(node: PGNode): bool = + result = node.children == nil + +proc g_node_append*(parent: PGNode, node: PGNode): PGNode = + result = g_node_insert_before(parent, nil, node) + +proc g_node_insert_data*(parent: PGNode, position: gint, data: gpointer): PGNode = + result = g_node_insert(parent, position, g_node_new(data)) + +proc g_node_insert_data_before*(parent: PGNode, sibling: PGNode, data: gpointer): PGNode = + result = g_node_insert_before(parent, sibling, g_node_new(data)) + +proc g_node_prepend_data*(parent: PGNode, data: gpointer): PGNode = + result = g_node_prepend(parent, g_node_new(data)) + +proc g_node_append_data*(parent: PGNode, data: gpointer): PGNode = + result = g_node_insert_before(parent, nil, g_node_new(data)) + +proc g_node_prev_sibling*(node: PGNode): PGNode = + if node != nil: + result = node.prev + else: + result = nil + +proc g_node_next_sibling*(node: PGNode): PGNode = + if node != nil: + result = node.next + else: + result = nil + +proc g_node_first_child*(node: PGNode): PGNode = + if node != nil: + result = node.children + else: + result = nil + +proc g_rand_boolean*(rand: PGRand): gboolean = + result = (int(g_rand_int(rand)) and (1 shl 15)) != 0 + +proc g_random_boolean*(): gboolean = + result = (int(g_random_int()) and (1 shl 15)) != 0 + +proc TGScannerConfig_case_sensitive*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_case_sensitive) shr + bp_TGScannerConfig_case_sensitive + +proc TGScannerConfig_set_case_sensitive*(a: var TGScannerConfig, + `case_sensitive`: guint) = + a.flag0 = a.flag0 or + ((`case_sensitive` shl bp_TGScannerConfig_case_sensitive) and + bm_TGScannerConfig_case_sensitive) + +proc TGScannerConfig_skip_comment_multi*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_skip_comment_multi) shr + bp_TGScannerConfig_skip_comment_multi + +proc TGScannerConfig_set_skip_comment_multi*(a: var TGScannerConfig, + `skip_comment_multi`: guint) = + a.flag0 = a.flag0 or + ((`skip_comment_multi` shl bp_TGScannerConfig_skip_comment_multi) and + bm_TGScannerConfig_skip_comment_multi) + +proc TGScannerConfig_skip_comment_single*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_skip_comment_single) shr + bp_TGScannerConfig_skip_comment_single + +proc TGScannerConfig_set_skip_comment_single*(a: var TGScannerConfig, + `skip_comment_single`: guint) = + a.flag0 = a.flag0 or + ((`skip_comment_single` shl bp_TGScannerConfig_skip_comment_single) and + bm_TGScannerConfig_skip_comment_single) + +proc TGScannerConfig_scan_comment_multi*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_comment_multi) shr + bp_TGScannerConfig_scan_comment_multi + +proc TGScannerConfig_set_scan_comment_multi*(a: var TGScannerConfig, + `scan_comment_multi`: guint) = + a.flag0 = a.flag0 or + ((`scan_comment_multi` shl bp_TGScannerConfig_scan_comment_multi) and + bm_TGScannerConfig_scan_comment_multi) + +proc TGScannerConfig_scan_identifier*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_identifier) shr + bp_TGScannerConfig_scan_identifier + +proc TGScannerConfig_set_scan_identifier*(a: var TGScannerConfig, + `scan_identifier`: guint) = + a.flag0 = a.flag0 or + ((`scan_identifier` shl bp_TGScannerConfig_scan_identifier) and + bm_TGScannerConfig_scan_identifier) + +proc TGScannerConfig_scan_identifier_1char*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_identifier_1char) shr + bp_TGScannerConfig_scan_identifier_1char + +proc TGScannerConfig_set_scan_identifier_1char*(a: var TGScannerConfig, + `scan_identifier_1char`: guint) = + a.flag0 = a.flag0 or + ((`scan_identifier_1char` shl bp_TGScannerConfig_scan_identifier_1char) and + bm_TGScannerConfig_scan_identifier_1char) + +proc TGScannerConfig_scan_identifier_NULL*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_identifier_NULL) shr + bp_TGScannerConfig_scan_identifier_NULL + +proc TGScannerConfig_set_scan_identifier_NULL*(a: var TGScannerConfig, + `scan_identifier_NULL`: guint) = + a.flag0 = a.flag0 or + ((`scan_identifier_NULL` shl bp_TGScannerConfig_scan_identifier_NULL) and + bm_TGScannerConfig_scan_identifier_NULL) + +proc TGScannerConfig_scan_symbols*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_symbols) shr + bp_TGScannerConfig_scan_symbols + +proc TGScannerConfig_set_scan_symbols*(a: var TGScannerConfig, + `scan_symbols`: guint) = + a.flag0 = a.flag0 or + ((`scan_symbols` shl bp_TGScannerConfig_scan_symbols) and + bm_TGScannerConfig_scan_symbols) + +proc TGScannerConfig_scan_binary*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_binary) shr + bp_TGScannerConfig_scan_binary + +proc TGScannerConfig_set_scan_binary*(a: var TGScannerConfig, + `scan_binary`: guint) = + a.flag0 = a.flag0 or + ((`scan_binary` shl bp_TGScannerConfig_scan_binary) and + bm_TGScannerConfig_scan_binary) + +proc TGScannerConfig_scan_octal*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_octal) shr + bp_TGScannerConfig_scan_octal + +proc TGScannerConfig_set_scan_octal*(a: var TGScannerConfig, `scan_octal`: guint) = + a.flag0 = a.flag0 or + ((`scan_octal` shl bp_TGScannerConfig_scan_octal) and + bm_TGScannerConfig_scan_octal) + +proc TGScannerConfig_scan_float*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_float) shr + bp_TGScannerConfig_scan_float + +proc TGScannerConfig_set_scan_float*(a: var TGScannerConfig, `scan_float`: guint) = + a.flag0 = a.flag0 or + ((`scan_float` shl bp_TGScannerConfig_scan_float) and + bm_TGScannerConfig_scan_float) + +proc TGScannerConfig_scan_hex*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_hex) shr + bp_TGScannerConfig_scan_hex + +proc TGScannerConfig_set_scan_hex*(a: var TGScannerConfig, `scan_hex`: guint) = + a.flag0 = a.flag0 or + ((`scan_hex` shl bp_TGScannerConfig_scan_hex) and + bm_TGScannerConfig_scan_hex) + +proc TGScannerConfig_scan_hex_dollar*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_hex_dollar) shr + bp_TGScannerConfig_scan_hex_dollar + +proc TGScannerConfig_set_scan_hex_dollar*(a: var TGScannerConfig, + `scan_hex_dollar`: guint) = + a.flag0 = a.flag0 or + ((`scan_hex_dollar` shl bp_TGScannerConfig_scan_hex_dollar) and + bm_TGScannerConfig_scan_hex_dollar) + +proc TGScannerConfig_scan_string_sq*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_string_sq) shr + bp_TGScannerConfig_scan_string_sq + +proc TGScannerConfig_set_scan_string_sq*(a: var TGScannerConfig, + `scan_string_sq`: guint) = + a.flag0 = a.flag0 or + ((`scan_string_sq` shl bp_TGScannerConfig_scan_string_sq) and + bm_TGScannerConfig_scan_string_sq) + +proc TGScannerConfig_scan_string_dq*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scan_string_dq) shr + bp_TGScannerConfig_scan_string_dq + +proc TGScannerConfig_set_scan_string_dq*(a: var TGScannerConfig, + `scan_string_dq`: guint) = + a.flag0 = a.flag0 or + ((`scan_string_dq` shl bp_TGScannerConfig_scan_string_dq) and + bm_TGScannerConfig_scan_string_dq) + +proc TGScannerConfig_numbers_2_int*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_numbers_2_int) shr + bp_TGScannerConfig_numbers_2_int + +proc TGScannerConfig_set_numbers_2_int*(a: var TGScannerConfig, + `numbers_2_int`: guint) = + a.flag0 = a.flag0 or + ((`numbers_2_int` shl bp_TGScannerConfig_numbers_2_int) and + bm_TGScannerConfig_numbers_2_int) + +proc TGScannerConfig_int_2_float*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_int_2_float) shr + bp_TGScannerConfig_int_2_float + +proc TGScannerConfig_set_int_2_float*(a: var TGScannerConfig, + `int_2_float`: guint) = + a.flag0 = a.flag0 or + ((`int_2_float` shl bp_TGScannerConfig_int_2_float) and + bm_TGScannerConfig_int_2_float) + +proc TGScannerConfig_identifier_2_string*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_identifier_2_string) shr + bp_TGScannerConfig_identifier_2_string + +proc TGScannerConfig_set_identifier_2_string*(a: var TGScannerConfig, + `identifier_2_string`: guint) = + a.flag0 = a.flag0 or + ((`identifier_2_string` shl bp_TGScannerConfig_identifier_2_string) and + bm_TGScannerConfig_identifier_2_string) + +proc TGScannerConfig_char_2_token*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_char_2_token) shr + bp_TGScannerConfig_char_2_token + +proc TGScannerConfig_set_char_2_token*(a: var TGScannerConfig, + `char_2_token`: guint) = + a.flag0 = a.flag0 or + ((`char_2_token` shl bp_TGScannerConfig_char_2_token) and + bm_TGScannerConfig_char_2_token) + +proc TGScannerConfig_symbol_2_token*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_symbol_2_token) shr + bp_TGScannerConfig_symbol_2_token + +proc TGScannerConfig_set_symbol_2_token*(a: var TGScannerConfig, + `symbol_2_token`: guint) = + a.flag0 = a.flag0 or + ((`symbol_2_token` shl bp_TGScannerConfig_symbol_2_token) and + bm_TGScannerConfig_symbol_2_token) + +proc TGScannerConfig_scope_0_fallback*(a: var TGScannerConfig): guint = + result = (a.flag0 and bm_TGScannerConfig_scope_0_fallback) shr + bp_TGScannerConfig_scope_0_fallback + +proc TGScannerConfig_set_scope_0_fallback*(a: var TGScannerConfig, + `scope_0_fallback`: guint) = + a.flag0 = a.flag0 or + ((`scope_0_fallback` shl bp_TGScannerConfig_scope_0_fallback) and + bm_TGScannerConfig_scope_0_fallback) + +proc g_scanner_freeze_symbol_table*(scanner: PGScanner) = + if Scanner == nil: nil + +proc g_scanner_thaw_symbol_table*(scanner: PGScanner) = + if Scanner == nil: nil + +proc G_SHELL_ERROR*(): TGQuark = + result = g_shell_error_quark() + +proc G_SPAWN_ERROR*(): TGQuark = + result = g_spawn_error_quark() + +when false: + proc g_ascii_isalnum*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_ALNUM) != 0 + + proc g_ascii_isalpha*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_ALPHA) != 0 + + proc g_ascii_iscntrl*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_CNTRL) != 0 + + proc g_ascii_isdigit*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_DIGIT) != 0 + + proc g_ascii_isgraph*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_GRAPH) != 0 + + proc g_ascii_islower*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_LOWER) != 0 + + proc g_ascii_isprint*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_PRINT) != 0 + + proc g_ascii_ispunct*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_PUNCT) != 0 + + proc g_ascii_isspace*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_SPACE) != 0 + + proc g_ascii_isupper*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_UPPER) != 0 + + proc g_ascii_isxdigit*(c: gchar): bool = + result = ((g_ascii_table[guchar(c)]) and G_ASCII_XDIGIT) != 0 + + proc g_strstrip*(str: cstring): cstring = + result = g_strchomp(g_strchug(str)) + +proc G_TYPE_MAKE_FUNDAMENTAL*(x: int): GType = + result = GType(x shl G_TYPE_FUNDAMENTAL_SHIFT) + +proc G_TYPE_IS_FUNDAMENTAL*(theType: GType): bool = + result = theType <= G_TYPE_FUNDAMENTAL_MAX + +proc G_TYPE_IS_DERIVED*(theType: GType): bool = + result = theType > G_TYPE_FUNDAMENTAL_MAX + +proc G_TYPE_IS_INTERFACE*(theType: GType): bool = + result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_INTERFACE + +proc G_TYPE_IS_CLASSED*(theType: GType): gboolean = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_CLASSED) + +proc G_TYPE_IS_INSTANTIATABLE*(theType: GType): bool = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_INSTANTIATABLE) + +proc G_TYPE_IS_DERIVABLE*(theType: GType): bool = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_DERIVABLE) + +proc G_TYPE_IS_DEEP_DERIVABLE*(theType: GType): bool = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_DEEP_DERIVABLE) + +proc G_TYPE_IS_ABSTRACT*(theType: GType): bool = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_ABSTRACT) + +proc G_TYPE_IS_VALUE_ABSTRACT*(theType: GType): bool = + result = private_g_type_test_flags(theType, G_TYPE_FLAG_VALUE_ABSTRACT) + +proc G_TYPE_IS_VALUE_TYPE*(theType: GType): bool = + result = private_g_type_check_is_value_type(theType) + +proc G_TYPE_HAS_VALUE_TABLE*(theType: GType): bool = + result = (g_type_value_table_peek(theType)) != nil + +proc G_TYPE_CHECK_INSTANCE*(instance: Pointer): gboolean = + result = private_g_type_check_instance(cast[PGTypeInstance](instance)) + +proc G_TYPE_CHECK_INSTANCE_CAST*(instance: Pointer, g_type: GType): PGTypeInstance = + result = cast[PGTypeInstance](private_g_type_check_instance_cast( + cast[PGTypeInstance](instance), g_type)) + +proc G_TYPE_CHECK_INSTANCE_TYPE*(instance: Pointer, g_type: GType): bool = + result = private_g_type_check_instance_is_a(cast[PGTypeInstance](instance), + g_type) + +proc G_TYPE_INSTANCE_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass = + result = cast[PGTypeInstance](Instance).g_class + result = private_g_type_check_class_cast(result, g_type) + +proc G_TYPE_INSTANCE_GET_INTERFACE*(instance: Pointer, g_type: GType): Pointer = + result = g_type_interface_peek((cast[PGTypeInstance](instance)).g_class, + g_type) + +proc G_TYPE_CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer = + result = private_g_type_check_class_cast(cast[PGTypeClass](g_class), g_type) + +proc G_TYPE_CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool = + result = private_g_type_check_class_is_a(cast[PGTypeClass](g_class), g_type) + +proc G_TYPE_CHECK_VALUE*(value: Pointer): bool = + result = private_g_type_check_value(cast[PGValue](Value)) + +proc G_TYPE_CHECK_VALUE_TYPE*(value: pointer, g_type: GType): bool = + result = private_g_type_check_value_holds(cast[PGValue](value), g_type) + +proc G_TYPE_FROM_INSTANCE*(instance: Pointer): GType = + result = G_TYPE_FROM_CLASS((cast[PGTypeInstance](instance)).g_class) + +proc G_TYPE_FROM_CLASS*(g_class: Pointer): GType = + result = (cast[PGTypeClass](g_class)).g_type + +proc G_TYPE_FROM_INTERFACE*(g_iface: Pointer): GType = + result = (cast[PGTypeInterface](g_iface)).g_type + +proc G_TYPE_IS_VALUE*(theType: GType): bool = + result = private_g_type_check_is_value_type(theType) + +proc G_IS_VALUE*(value: Pointer): bool = + result = G_TYPE_CHECK_VALUE(value) + +proc G_VALUE_TYPE*(value: Pointer): GType = + result = (cast[PGValue](value)).g_type + +proc G_VALUE_TYPE_NAME*(value: Pointer): cstring = + result = g_type_name(G_VALUE_TYPE(value)) + +proc G_VALUE_HOLDS*(value: pointer, g_type: GType): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, g_type) + +proc G_TYPE_IS_PARAM*(theType: GType): bool = + result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_PARAM + +proc G_PARAM_SPEC*(pspec: Pointer): PGParamSpec = + result = cast[PGParamSpec](G_TYPE_CHECK_INSTANCE_CAST(pspec, G_TYPE_PARAM)) + +proc G_IS_PARAM_SPEC*(pspec: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(pspec, G_TYPE_PARAM) + +proc G_PARAM_SPEC_CLASS*(pclass: Pointer): PGParamSpecClass = + result = cast[PGParamSpecClass](G_TYPE_CHECK_CLASS_CAST(pclass, G_TYPE_PARAM)) + +proc G_IS_PARAM_SPEC_CLASS*(pclass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(pclass, G_TYPE_PARAM) + +proc G_PARAM_SPEC_GET_CLASS*(pspec: Pointer): PGParamSpecClass = + result = cast[PGParamSpecClass](G_TYPE_INSTANCE_GET_CLASS(pspec, G_TYPE_PARAM)) + +proc G_PARAM_SPEC_TYPE*(pspec: Pointer): GType = + result = G_TYPE_FROM_INSTANCE(pspec) + +proc G_PARAM_SPEC_TYPE_NAME*(pspec: Pointer): cstring = + result = g_type_name(G_PARAM_SPEC_TYPE(pspec)) + +proc G_PARAM_SPEC_VALUE_TYPE*(pspec: Pointer): GType = + result = (G_PARAM_SPEC(pspec)).value_type + +proc G_VALUE_HOLDS_PARAM*(value: Pointer): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_PARAM) + +proc G_CLOSURE_NEEDS_MARSHAL*(closure: Pointer): bool = + result = cast[PGClosure](closure).marshal == nil + +proc G_CLOSURE_N_NOTIFIERS*(cl: PGClosure): int32 = + result = ((meta_marshal(cl) + ((n_guards(cl)) shl 1'i32)) + + (n_fnotifiers(cl))) + (n_inotifiers(cl)) + +proc G_CCLOSURE_SWAP_DATA*(cclosure: PGClosure): int32 = + result = derivative_flag(cclosure) + +proc G_CALLBACK*(f: pointer): TGCallback = + result = cast[TGCallback](f) + +proc ref_count*(a: var TGClosure): guint = + result = (a.flag0 and bm_TGClosure_ref_count) shr bp_TGClosure_ref_count + +proc set_ref_count*(a: var TGClosure, `ref_count`: guint) = + a.flag0 = a.flag0 or + ((`ref_count` shl bp_TGClosure_ref_count) and bm_TGClosure_ref_count) + +proc meta_marshal*(a: PGClosure): guint = + result = (a.flag0 and bm_TGClosure_meta_marshal) shr + bp_TGClosure_meta_marshal + +proc set_meta_marshal*(a: var TGClosure, `meta_marshal`: guint) = + a.flag0 = a.flag0 or + ((`meta_marshal` shl bp_TGClosure_meta_marshal) and + bm_TGClosure_meta_marshal) + +proc n_guards*(a: PGClosure): guint = + result = (a.flag0 and bm_TGClosure_n_guards) shr bp_TGClosure_n_guards + +proc set_n_guards*(a: var TGClosure, `n_guards`: guint) = + a.flag0 = a.flag0 or + ((`n_guards` shl bp_TGClosure_n_guards) and bm_TGClosure_n_guards) + +proc n_fnotifiers*(a: PGClosure): guint = + result = (a.flag0 and bm_TGClosure_n_fnotifiers) shr + bp_TGClosure_n_fnotifiers + +proc set_n_fnotifiers*(a: var TGClosure, `n_fnotifiers`: guint) = + a.flag0 = a.flag0 or + ((`n_fnotifiers` shl bp_TGClosure_n_fnotifiers) and + bm_TGClosure_n_fnotifiers) + +proc n_inotifiers*(a: PGClosure): guint = + result = (a.flag0 and bm_TGClosure_n_inotifiers) shr + bp_TGClosure_n_inotifiers + +proc set_n_inotifiers*(a: var TGClosure, `n_inotifiers`: guint) = + a.flag0 = a.flag0 or + ((`n_inotifiers` shl bp_TGClosure_n_inotifiers) and + bm_TGClosure_n_inotifiers) + +proc in_inotify*(a: var TGClosure): guint = + result = (a.flag0 and bm_TGClosure_in_inotify) shr bp_TGClosure_in_inotify + +proc set_in_inotify*(a: var TGClosure, `in_inotify`: guint) = + a.flag0 = a.flag0 or + ((`in_inotify` shl bp_TGClosure_in_inotify) and bm_TGClosure_in_inotify) + +proc floating*(a: var TGClosure): guint = + result = (a.flag0 and bm_TGClosure_floating) shr bp_TGClosure_floating + +proc set_floating*(a: var TGClosure, `floating`: guint) = + a.flag0 = a.flag0 or + ((`floating` shl bp_TGClosure_floating) and bm_TGClosure_floating) + +proc derivative_flag*(a: PGClosure): guint = + result = (a.flag0 and bm_TGClosure_derivative_flag) shr + bp_TGClosure_derivative_flag + +proc set_derivative_flag*(a: var TGClosure, `derivative_flag`: guint) = + a.flag0 = a.flag0 or + ((`derivative_flag` shl bp_TGClosure_derivative_flag) and + bm_TGClosure_derivative_flag) + +proc in_marshal*(a: var TGClosure): guint = + result = (a.flag0 and bm_TGClosure_in_marshal) shr bp_TGClosure_in_marshal + +proc set_in_marshal*(a: var TGClosure, in_marshal: guint) = + a.flag0 = a.flag0 or + ((in_marshal shl bp_TGClosure_in_marshal) and bm_TGClosure_in_marshal) + +proc is_invalid*(a: var TGClosure): guint = + result = (a.flag0 and bm_TGClosure_is_invalid) shr bp_TGClosure_is_invalid + +proc set_is_invalid*(a: var TGClosure, is_invalid: guint) = + a.flag0 = a.flag0 or + ((is_invalid shl bp_TGClosure_is_invalid) and bm_TGClosure_is_invalid) + +proc g_signal_connect*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong = + result = g_signal_connect_data(instance, detailed_signal, c_handler, data, + nil, TGConnectFlags(0)) + +proc g_signal_connect_after*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong = + result = g_signal_connect_data(instance, detailed_signal, c_handler, data, + nil, G_CONNECT_AFTER) + +proc g_signal_connect_swapped*(instance: gpointer, detailed_signal: cstring, + c_handler: TGCallback, data: gpointer): gulong = + result = g_signal_connect_data(instance, detailed_signal, c_handler, data, + nil, G_CONNECT_SWAPPED) + +proc g_signal_handlers_disconnect_by_func*(instance: gpointer, + func, data: gpointer): guint = + result = g_signal_handlers_disconnect_matched(instance, + TGSignalMatchType(G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil, + func, data) + +proc g_signal_handlers_block_by_func*(instance: gpointer, func, data: gpointer) = + discard g_signal_handlers_block_matched(instance, + TGSignalMatchType(G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil, + func, data) + +proc g_signal_handlers_unblock_by_func*(instance: gpointer, func, data: gpointer) = + discard g_signal_handlers_unblock_matched(instance, + TGSignalMatchType(G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0, 0, nil, + func, data) + +proc G_TYPE_IS_OBJECT*(theType: GType): bool = + result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_OBJECT + +proc G_OBJECT*(anObject: pointer): PGObject = + result = cast[PGObject](G_TYPE_CHECK_INSTANCE_CAST(anObject, G_TYPE_OBJECT)) + +proc G_OBJECT_CLASS*(class: Pointer): PGObjectClass = + result = cast[PGObjectClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_OBJECT)) + +proc G_IS_OBJECT*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, G_TYPE_OBJECT) + +proc G_IS_OBJECT_CLASS*(class: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_OBJECT) + +proc G_OBJECT_GET_CLASS*(anObject: pointer): PGObjectClass = + result = cast[PGObjectClass](G_TYPE_INSTANCE_GET_CLASS(anObject, G_TYPE_OBJECT)) + +proc G_OBJECT_TYPE*(anObject: pointer): GType = + result = G_TYPE_FROM_INSTANCE(anObject) + +proc G_OBJECT_TYPE_NAME*(anObject: pointer): cstring = + result = g_type_name(G_OBJECT_TYPE(anObject)) + +proc G_OBJECT_CLASS_TYPE*(class: Pointer): GType = + result = G_TYPE_FROM_CLASS(class) + +proc G_OBJECT_CLASS_NAME*(class: Pointer): cstring = + result = g_type_name(G_OBJECT_CLASS_TYPE(class)) + +proc G_VALUE_HOLDS_OBJECT*(value: Pointer): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_OBJECT) + +proc G_OBJECT_WARN_INVALID_PROPERTY_ID*(anObject: gpointer, property_id: gint, + pspec: gpointer) = + G_OBJECT_WARN_INVALID_PSPEC(anObject, "property", property_id, pspec) + +proc G_OBJECT_WARN_INVALID_PSPEC*(anObject: gpointer, pname: cstring, + property_id: gint, pspec: gpointer) = + var + theObject: PGObject + pspec2: PGParamSpec + property_id: guint + theObject = cast[PGObject](anObject) + pspec2 = cast[PGParamSpec](pspec) + property_id = (property_id) + write(stdout, "invalid thingy\x0A") + #g_warning("%s: invalid %s id %u for \"%s\" of type `%s\' in `%s\'", "", pname, + # `property_id`, `pspec` . name, + # g_type_name(G_PARAM_SPEC_TYPE(`pspec`)), + # G_OBJECT_TYPE_NAME(theobject)) + +proc G_TYPE_TYPE_PLUGIN*(): GType = + result = g_type_plugin_get_type() + +proc G_TYPE_PLUGIN*(inst: Pointer): PGTypePlugin = + result = PGTypePlugin(G_TYPE_CHECK_INSTANCE_CAST(inst, G_TYPE_TYPE_PLUGIN())) + +proc G_TYPE_PLUGIN_CLASS*(vtable: Pointer): PGTypePluginClass = + result = cast[PGTypePluginClass](G_TYPE_CHECK_CLASS_CAST(vtable, + G_TYPE_TYPE_PLUGIN())) + +proc G_IS_TYPE_PLUGIN*(inst: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(inst, G_TYPE_TYPE_PLUGIN()) + +proc G_IS_TYPE_PLUGIN_CLASS*(vtable: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(vtable, G_TYPE_TYPE_PLUGIN()) + +proc G_TYPE_PLUGIN_GET_CLASS*(inst: Pointer): PGTypePluginClass = + result = cast[PGTypePluginClass](G_TYPE_INSTANCE_GET_INTERFACE(inst, + G_TYPE_TYPE_PLUGIN())) + +proc G_TYPE_IS_ENUM*(theType: GType): gboolean = + result = (G_TYPE_FUNDAMENTAL(theType) == G_TYPE_ENUM) + +proc G_ENUM_CLASS*(class: pointer): PGEnumClass = + result = cast[PGEnumClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_ENUM)) + +proc G_IS_ENUM_CLASS*(class: pointer): gboolean = + result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_ENUM) + +proc G_ENUM_CLASS_TYPE*(class: pointer): GType = + result = G_TYPE_FROM_CLASS(class) + +proc G_ENUM_CLASS_TYPE_NAME*(class: pointer): cstring = + result = g_type_name(G_ENUM_CLASS_TYPE(class)) + +proc G_TYPE_IS_FLAGS*(theType: GType): gboolean = + result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_FLAGS + +proc G_FLAGS_CLASS*(class: pointer): PGFlagsClass = + result = cast[PGFlagsClass](G_TYPE_CHECK_CLASS_CAST(class, G_TYPE_FLAGS)) + +proc G_IS_FLAGS_CLASS*(class: pointer): gboolean = + result = G_TYPE_CHECK_CLASS_TYPE(class, G_TYPE_FLAGS) + +proc G_FLAGS_CLASS_TYPE*(class: pointer): GType = + result = G_TYPE_FROM_CLASS(class) + +proc G_FLAGS_CLASS_TYPE_NAME*(class: pointer): cstring = + result = g_type_name(G_FLAGS_TYPE(cast[TAddress](class))) + +proc G_VALUE_HOLDS_ENUM*(value: pointer): gboolean = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_ENUM) + +proc G_VALUE_HOLDS_FLAGS*(value: pointer): gboolean = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_FLAGS) + +proc CLAMP*(x, MinX, MaxX: int): int = + if x < MinX: + result = MinX + elif x > MaxX: + result = MaxX + else: + result = x + +proc GPOINTER_TO_SIZE*(p: GPointer): GSize = + result = GSize(cast[TAddress](p)) + +proc GSIZE_TO_POINTER*(s: GSize): GPointer = + result = cast[GPointer](s) + +proc G_VALUE_HOLDS_CHAR*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_CHAR) + +proc G_VALUE_HOLDS_UCHAR*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UCHAR) + +proc G_VALUE_HOLDS_BOOLEAN*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_BOOLEAN) + +proc G_VALUE_HOLDS_INT*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT) + +proc G_VALUE_HOLDS_UINT*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT) + +proc G_VALUE_HOLDS_LONG*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_LONG) + +proc G_VALUE_HOLDS_ULONG*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_ULONG) + +proc G_VALUE_HOLDS_INT64*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_INT64) + +proc G_VALUE_HOLDS_UINT64*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_UINT64) + +proc G_VALUE_HOLDS_FLOAT*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_FLOAT) + +proc G_VALUE_HOLDS_DOUBLE*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_DOUBLE) + +proc G_VALUE_HOLDS_STRING*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_STRING) + +proc G_VALUE_HOLDS_POINTER*(value: PGValue): bool = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_POINTER) + +proc G_TYPE_IS_BOXED*(theType: GType): gboolean = + result = (G_TYPE_FUNDAMENTAL(theType)) == G_TYPE_BOXED + +proc G_VALUE_HOLDS_BOXED*(value: PGValue): gboolean = + result = G_TYPE_CHECK_VALUE_TYPE(value, G_TYPE_BOXED) + +proc G_TYPE_CLOSURE*(): GType = + result = g_closure_get_type() + +proc G_TYPE_VALUE*(): GType = + result = g_value_get_type() + +proc G_TYPE_VALUE_ARRAY*(): GType = + result = g_value_array_get_type() + +proc G_TYPE_GSTRING*(): GType = + result = g_gstring_get_type() diff --git a/lib/newwrap/gtk/gtk2.nim b/lib/newwrap/gtk/gtk2.nim new file mode 100644 index 000000000..3c1eed666 --- /dev/null +++ b/lib/newwrap/gtk/gtk2.nim @@ -0,0 +1,16883 @@ +{.deadCodeElim: on.} +import + glib2, atk, pango, gdk2pixbuf, gdk2 + +when defined(win32): + const + lib = "libgtk-win32-2.0-0.dll" +elif defined(darwin): + const + lib = "gtk-x11-2.0" + # 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 + lib = "libgtk-x11-2.0.so" +type + PPPchar* = PPPgchar + +const + MAX_COMPOSE_LEN* = 7 + +type + PObject* = ptr TObject + PPGtkObject* = ptr PObject + PArg* = ptr TArg + PType* = ptr TType + TType* = GType + PWidget* = ptr TWidget + PMisc* = ptr TMisc + PLabel* = ptr TLabel + PMenu* = ptr TMenu + PAnchorType* = ptr TAnchorType + TAnchorType* = int32 + PArrowType* = ptr TArrowType + TArrowType* = int32 + PAttachOptions* = ptr TAttachOptions + TAttachOptions* = int32 + PButtonBoxStyle* = ptr TButtonBoxStyle + TButtonBoxStyle* = int32 + PCurveType* = ptr TCurveType + TCurveType* = int32 + PDeleteType* = ptr TDeleteType + TDeleteType* = int32 + PDirectionType* = ptr TDirectionType + TDirectionType* = int32 + PExpanderStyle* = ptr TExpanderStyle + TExpanderStyle* = int32 + PPGtkIconSize* = ptr PIconSize + PIconSize* = ptr TIconSize + TIconSize* = int32 + PTextDirection* = ptr TTextDirection + TTextDirection* = int32 + PJustification* = ptr TJustification + TJustification* = int32 + PMenuDirectionType* = ptr TMenuDirectionType + TMenuDirectionType* = int32 + PMetricType* = ptr TMetricType + TMetricType* = int32 + PMovementStep* = ptr TMovementStep + TMovementStep* = int32 + POrientation* = ptr TOrientation + TOrientation* = int32 + PCornerType* = ptr TCornerType + TCornerType* = int32 + PPackType* = ptr TPackType + TPackType* = int32 + PPathPriorityType* = ptr TPathPriorityType + TPathPriorityType* = int32 + PPathType* = ptr TPathType + TPathType* = int32 + PPolicyType* = ptr TPolicyType + TPolicyType* = int32 + PPositionType* = ptr TPositionType + TPositionType* = int32 + PReliefStyle* = ptr TReliefStyle + TReliefStyle* = int32 + PResizeMode* = ptr TResizeMode + TResizeMode* = int32 + PScrollType* = ptr TScrollType + TScrollType* = int32 + PSelectionMode* = ptr TSelectionMode + TSelectionMode* = int32 + PShadowType* = ptr TShadowType + TShadowType* = int32 + PStateType* = ptr TStateType + TStateType* = int32 + PSubmenuDirection* = ptr TSubmenuDirection + TSubmenuDirection* = int32 + PSubmenuPlacement* = ptr TSubmenuPlacement + TSubmenuPlacement* = int32 + PToolbarStyle* = ptr TToolbarStyle + TToolbarStyle* = int32 + PUpdateType* = ptr TUpdateType + TUpdateType* = int32 + PVisibility* = ptr TVisibility + TVisibility* = int32 + PWindowPosition* = ptr TWindowPosition + TWindowPosition* = int32 + PWindowType* = ptr TWindowType + TWindowType* = int32 + PWrapMode* = ptr TWrapMode + TWrapMode* = int32 + PSortType* = ptr TSortType + TSortType* = int32 + PStyle* = ptr TStyle + PPGtkTreeModel* = ptr PTreeModel + PTreeModel* = pointer + PTreePath* = pointer + PTreeIter* = ptr TTreeIter + PSelectionData* = ptr TSelectionData + PTextTagTable* = ptr TTextTagTable + PTextBTreeNode* = pointer + PTextBTree* = pointer + PTextLine* = ptr TTextLine + PTreeViewColumn* = ptr TTreeViewColumn + PTreeView* = ptr TTreeView + TTreeViewColumnDropFunc* = proc (tree_view: PTreeView, + column: PTreeViewColumn, + prev_column: PTreeViewColumn, + next_column: PTreeViewColumn, data: gpointer): gboolean{. + cdecl.} + TTreeViewMappingFunc* = proc (tree_view: PTreeView, path: PTreePath, + user_data: gpointer){.cdecl.} + TTreeViewSearchEqualFunc* = proc (model: PTreeModel, column: gint, + key: cstring, iter: PTreeIter, + search_data: gpointer): gboolean{.cdecl.} + TTreeDestroyCountFunc* = proc (tree_view: PTreeView, path: PTreePath, + children: gint, user_data: gpointer){.cdecl.} + PTreeViewDropPosition* = ptr TTreeViewDropPosition + TTreeViewDropPosition* = enum + TREE_VIEW_DROP_BEFORE, TREE_VIEW_DROP_AFTER, TREE_VIEW_DROP_INTO_OR_BEFORE, + TREE_VIEW_DROP_INTO_OR_AFTER + PObjectFlags* = ptr TObjectFlags + TObjectFlags* = int32 + TObject* = object of TGObject + flags*: guint32 + + PObjectClass* = ptr TObjectClass + TObjectClass* = object of TGObjectClass + set_arg*: proc (anObject: PObject, arg: PArg, arg_id: guint){.cdecl.} + get_arg*: proc (anObject: PObject, arg: PArg, arg_id: guint){.cdecl.} + destroy*: proc (anObject: PObject){.cdecl.} + + PFundamentalType* = ptr TFundamentalType + TFundamentalType* = GType + TFunction* = proc (data: gpointer): gboolean{.cdecl.} + TDestroyNotify* = proc (data: gpointer){.cdecl.} + TCallbackMarshal* = proc (anObject: PObject, data: gpointer, n_args: guint, + args: PArg){.cdecl.} + TSignalFuncProc* = proc () + TSignalFunc* = proc (para1: TSignalFuncProc){.cdecl.} + PSignalMarshaller* = ptr TSignalMarshaller + TSignalMarshaller* = TGSignalCMarshaller + TArgSignalData*{.final, pure.} = object + f*: TSignalFunc + d*: gpointer + + TArg*{.final, pure.} = object + `type`*: TType + name*: cstring + d*: gdouble # was a union type + + PTypeInfo* = ptr TTypeInfo + TTypeInfo*{.final, pure.} = object + type_name*: cstring + object_size*: guint + class_size*: guint + class_init_func*: pointer #TGtkClassInitFunc + object_init_func*: pointer #TGtkObjectInitFunc + reserved_1*: gpointer + reserved_2*: gpointer + base_class_init_func*: pointer #TGtkClassInitFunc + + PEnumValue* = ptr TEnumValue + TEnumValue* = TGEnumValue + PFlagValue* = ptr TFlagValue + TFlagValue* = TGFlagsValue + PWidgetFlags* = ptr TWidgetFlags + TWidgetFlags* = int32 + PWidgetHelpType* = ptr TWidgetHelpType + TWidgetHelpType* = enum + WIDGET_HELP_TOOLTIP, WIDGET_HELP_WHATS_THIS + PAllocation* = ptr TAllocation + TAllocation* = TGdkRectangle + TCallback* = proc (widget: PWidget, data: gpointer){.cdecl.} + PRequisition* = ptr TRequisition + TRequisition*{.final, pure.} = object + width*: gint + height*: gint + + TWidget* = object of TObject + private_flags*: guint16 + state*: guint8 + saved_state*: guint8 + name*: cstring + style*: PStyle + requisition*: TRequisition + allocation*: TAllocation + window*: PGdkWindow + parent*: PWidget + + PWidgetClass* = ptr TWidgetClass + TWidgetClass* = object of TObjectClass + activate_signal*: guint + set_scroll_adjustments_signal*: guint + dispatch_child_properties_changed*: proc (widget: PWidget, n_pspecs: guint, + pspecs: PPGParamSpec){.cdecl.} + show*: proc (widget: PWidget){.cdecl.} + show_all*: proc (widget: PWidget){.cdecl.} + hide*: proc (widget: PWidget){.cdecl.} + hide_all*: proc (widget: PWidget){.cdecl.} + map*: proc (widget: PWidget){.cdecl.} + unmap*: proc (widget: PWidget){.cdecl.} + realize*: proc (widget: PWidget){.cdecl.} + unrealize*: proc (widget: PWidget){.cdecl.} + size_request*: proc (widget: PWidget, requisition: PRequisition){.cdecl.} + size_allocate*: proc (widget: PWidget, allocation: PAllocation){.cdecl.} + state_changed*: proc (widget: PWidget, previous_state: TStateType){.cdecl.} + parent_set*: proc (widget: PWidget, previous_parent: PWidget){.cdecl.} + hierarchy_changed*: proc (widget: PWidget, previous_toplevel: PWidget){. + cdecl.} + style_set*: proc (widget: PWidget, previous_style: PStyle){.cdecl.} + direction_changed*: proc (widget: PWidget, + previous_direction: TTextDirection){.cdecl.} + grab_notify*: proc (widget: PWidget, was_grabbed: gboolean){.cdecl.} + child_notify*: proc (widget: PWidget, pspec: PGParamSpec){.cdecl.} + mnemonic_activate*: proc (widget: PWidget, group_cycling: gboolean): gboolean{. + cdecl.} + grab_focus*: proc (widget: PWidget){.cdecl.} + focus*: proc (widget: PWidget, direction: TDirectionType): gboolean{.cdecl.} + event*: proc (widget: PWidget, event: PGdkEvent): gboolean{.cdecl.} + button_press_event*: proc (widget: PWidget, event: PGdkEventButton): gboolean{. + cdecl.} + button_release_event*: proc (widget: PWidget, event: PGdkEventButton): gboolean{. + cdecl.} + scroll_event*: proc (widget: PWidget, event: PGdkEventScroll): gboolean{. + cdecl.} + motion_notify_event*: proc (widget: PWidget, event: PGdkEventMotion): gboolean{. + cdecl.} + delete_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.} + destroy_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.} + expose_event*: proc (widget: PWidget, event: PGdkEventExpose): gboolean{. + cdecl.} + key_press_event*: proc (widget: PWidget, event: PGdkEventKey): gboolean{. + cdecl.} + key_release_event*: proc (widget: PWidget, event: PGdkEventKey): gboolean{. + cdecl.} + enter_notify_event*: proc (widget: PWidget, event: PGdkEventCrossing): gboolean{. + cdecl.} + leave_notify_event*: proc (widget: PWidget, event: PGdkEventCrossing): gboolean{. + cdecl.} + configure_event*: proc (widget: PWidget, event: PGdkEventConfigure): gboolean{. + cdecl.} + focus_in_event*: proc (widget: PWidget, event: PGdkEventFocus): gboolean{. + cdecl.} + focus_out_event*: proc (widget: PWidget, event: PGdkEventFocus): gboolean{. + cdecl.} + map_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.} + unmap_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{.cdecl.} + property_notify_event*: proc (widget: PWidget, event: PGdkEventProperty): gboolean{. + cdecl.} + selection_clear_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl.} + selection_request_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl.} + selection_notify_event*: proc (widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl.} + proximity_in_event*: proc (widget: PWidget, event: PGdkEventProximity): gboolean{. + cdecl.} + proximity_out_event*: proc (widget: PWidget, event: PGdkEventProximity): gboolean{. + cdecl.} + visibility_notify_event*: proc (widget: PWidget, event: PGdkEventVisibility): gboolean{. + cdecl.} + client_event*: proc (widget: PWidget, event: PGdkEventClient): gboolean{. + cdecl.} + no_expose_event*: proc (widget: PWidget, event: PGdkEventAny): gboolean{. + cdecl.} + window_state_event*: proc (widget: PWidget, event: PGdkEventWindowState): gboolean{. + cdecl.} + selection_get*: proc (widget: PWidget, selection_data: PSelectionData, + info: guint, time: guint){.cdecl.} + selection_received*: proc (widget: PWidget, selection_data: PSelectionData, + time: guint){.cdecl.} + drag_begin*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.} + drag_end*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.} + drag_data_get*: proc (widget: PWidget, context: PGdkDragContext, + selection_data: PSelectionData, info: guint, + time: guint){.cdecl.} + drag_data_delete*: proc (widget: PWidget, context: PGdkDragContext){.cdecl.} + drag_leave*: proc (widget: PWidget, context: PGdkDragContext, time: guint){. + cdecl.} + drag_motion*: proc (widget: PWidget, context: PGdkDragContext, x: gint, + y: gint, time: guint): gboolean{.cdecl.} + drag_drop*: proc (widget: PWidget, context: PGdkDragContext, x: gint, + y: gint, time: guint): gboolean{.cdecl.} + drag_data_received*: proc (widget: PWidget, context: PGdkDragContext, + x: gint, y: gint, selection_data: PSelectionData, + info: guint, time: guint){.cdecl.} + popup_menu*: proc (widget: PWidget): gboolean{.cdecl.} + show_help*: proc (widget: PWidget, help_type: TWidgetHelpType): gboolean{. + cdecl.} + get_accessible*: proc (widget: PWidget): PAtkObject{.cdecl.} + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + reserved5*: proc (){.cdecl.} + reserved6*: proc (){.cdecl.} + reserved7*: proc (){.cdecl.} + reserved8*: proc (){.cdecl.} + + PWidgetAuxInfo* = ptr TWidgetAuxInfo + TWidgetAuxInfo*{.final, pure.} = object + x*: gint + y*: gint + width*: gint + height*: gint + flag0*: guint16 + + PWidgetShapeInfo* = ptr TWidgetShapeInfo + TWidgetShapeInfo*{.final, pure.} = object + offset_x*: gint16 + offset_y*: gint16 + shape_mask*: PGdkBitmap + + TMisc* = object of TWidget + xalign*: gfloat + yalign*: gfloat + xpad*: guint16 + ypad*: guint16 + + PMiscClass* = ptr TMiscClass + TMiscClass* = object of TWidgetClass + PAccelFlags* = ptr TAccelFlags + TAccelFlags* = int32 + PAccelGroup* = ptr TAccelGroup + PAccelGroupEntry* = ptr TAccelGroupEntry + TAccelGroupActivate* = proc (accel_group: PAccelGroup, + acceleratable: PGObject, keyval: guint, + modifier: TGdkModifierType): gboolean{.cdecl.} + TAccelGroup* = object of TGObject + lock_count*: guint + modifier_mask*: TGdkModifierType + acceleratables*: PGSList + n_accels*: guint + priv_accels*: PAccelGroupEntry + + PAccelGroupClass* = ptr TAccelGroupClass + TAccelGroupClass* = object of TGObjectClass + accel_changed*: proc (accel_group: PAccelGroup, keyval: guint, + modifier: TGdkModifierType, accel_closure: PGClosure){. + cdecl.} + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PAccelKey* = ptr TAccelKey + TAccelKey*{.final, pure.} = object + accel_key*: guint + accel_mods*: TGdkModifierType + flag0*: guint16 + + TAccelGroupEntry*{.final, pure.} = object + key*: TAccelKey + closure*: PGClosure + accel_path_quark*: TGQuark + + Taccel_group_find_func* = proc (key: PAccelKey, closure: PGClosure, + data: gpointer): gboolean{.cdecl.} + PContainer* = ptr TContainer + TContainer* = object of TWidget + focus_child*: PWidget + Container_flag0*: int32 + + PContainerClass* = ptr TContainerClass + TContainerClass* = object of TWidgetClass + add*: proc (container: PContainer, widget: PWidget){.cdecl.} + remove*: proc (container: PContainer, widget: PWidget){.cdecl.} + check_resize*: proc (container: PContainer){.cdecl.} + forall*: proc (container: PContainer, include_internals: gboolean, + callback: TCallback, callback_data: gpointer){.cdecl.} + set_focus_child*: proc (container: PContainer, widget: PWidget){.cdecl.} + child_type*: proc (container: PContainer): TType{.cdecl.} + composite_name*: proc (container: PContainer, child: PWidget): cstring{. + cdecl.} + set_child_property*: proc (container: PContainer, child: PWidget, + property_id: guint, value: PGValue, + pspec: PGParamSpec){.cdecl.} + get_child_property*: proc (container: PContainer, child: PWidget, + property_id: guint, value: PGValue, + pspec: PGParamSpec){.cdecl.} + reserved20: proc (){.cdecl.} + reserved21: proc (){.cdecl.} + reserved23: proc (){.cdecl.} + reserved24: proc (){.cdecl.} + + PBin* = ptr TBin + TBin* = object of TContainer + child*: PWidget + + PBinClass* = ptr TBinClass + TBinClass* = object of TContainerClass + PWindowGeometryInfo* = pointer + PWindowGroup* = ptr TWindowGroup + PWindow* = ptr TWindow + TWindow* = object of TBin + title*: cstring + wmclass_name*: cstring + wmclass_class*: cstring + wm_role*: cstring + focus_widget*: PWidget + default_widget*: PWidget + transient_parent*: PWindow + geometry_info*: PWindowGeometryInfo + frame*: PGdkWindow + group*: PWindowGroup + configure_request_count*: guint16 + window_flag0*: int32 + frame_left*: guint + frame_top*: guint + frame_right*: guint + frame_bottom*: guint + keys_changed_handler*: guint + mnemonic_modifier*: TGdkModifierType + screen*: PGdkScreen + + PWindowClass* = ptr TWindowClass + TWindowClass* = object of TBinClass + set_focus*: proc (window: PWindow, focus: PWidget){.cdecl.} + frame_event*: proc (window: PWindow, event: PGdkEvent): gboolean{.cdecl.} + activate_focus*: proc (window: PWindow){.cdecl.} + activate_default*: proc (window: PWindow){.cdecl.} + move_focus*: proc (window: PWindow, direction: TDirectionType){.cdecl.} + keys_changed*: proc (window: PWindow){.cdecl.} + reserved30: proc (){.cdecl.} + reserved31: proc (){.cdecl.} + reserved32: proc (){.cdecl.} + reserved33: proc (){.cdecl.} + + TWindowGroup* = object of TGObject + grabs*: PGSList + + PWindowGroupClass* = ptr TWindowGroupClass + TWindowGroupClass* = object of TGObjectClass + reserved40: proc (){.cdecl.} + reserved41: proc (){.cdecl.} + reserved42: proc (){.cdecl.} + reserved43: proc (){.cdecl.} + + TWindowKeysForeachFunc* = proc (window: PWindow, keyval: guint, + modifiers: TGdkModifierType, + is_mnemonic: gboolean, data: gpointer){.cdecl.} + PLabelSelectionInfo* = pointer + TLabel* = object of TMisc + `label`*: cstring + Label_flag0*: guint16 + mnemonic_keyval*: guint + text*: cstring + attrs*: PPangoAttrList + effective_attrs*: PPangoAttrList + layout*: PPangoLayout + mnemonic_widget*: PWidget + mnemonic_window*: PWindow + select_info*: PLabelSelectionInfo + + PLabelClass* = ptr TLabelClass + TLabelClass* = object of TMiscClass + move_cursor*: proc (`label`: PLabel, step: TMovementStep, count: gint, + extend_selection: gboolean){.cdecl.} + copy_clipboard*: proc (`label`: PLabel){.cdecl.} + populate_popup*: proc (`label`: PLabel, menu: PMenu){.cdecl.} + reserved50: proc (){.cdecl.} + reserved51: proc (){.cdecl.} + reserved52: proc (){.cdecl.} + reserved53: proc (){.cdecl.} + + PAccelLabel* = ptr TAccelLabel + TAccelLabel* = object of TLabel + queue_id*: guint + accel_padding*: guint + accel_widget*: PWidget + accel_closure*: PGClosure + accel_group*: PAccelGroup + accel_string*: cstring + accel_string_width*: guint16 + + PAccelLabelClass* = ptr TAccelLabelClass + TAccelLabelClass* = object of TLabelClass + signal_quote1*: cstring + signal_quote2*: cstring + mod_name_shift*: cstring + mod_name_control*: cstring + mod_name_alt*: cstring + mod_separator*: cstring + accel_seperator*: cstring + AccelLabelClass_flag0*: guint16 + reserved61: proc (){.cdecl.} + reserved62: proc (){.cdecl.} + reserved63: proc (){.cdecl.} + reserved64: proc (){.cdecl.} + + TAccelMapForeach* = proc (data: gpointer, accel_path: cstring, + accel_key: guint, accel_mods: TGdkModifierType, + changed: gboolean){.cdecl.} + PAccessible* = ptr TAccessible + TAccessible* = object of TAtkObject + widget*: PWidget + + PAccessibleClass* = ptr TAccessibleClass + TAccessibleClass* = object of TAtkObjectClass + connect_widget_destroyed*: proc (accessible: PAccessible){.cdecl.} + reserved71: proc (){.cdecl.} + reserved72: proc (){.cdecl.} + reserved73: proc (){.cdecl.} + reserved74: proc (){.cdecl.} + + PAdjustment* = ptr TAdjustment + TAdjustment* = object of TObject + lower*: gdouble + upper*: gdouble + value*: gdouble + step_increment*: gdouble + page_increment*: gdouble + page_size*: gdouble + + PAdjustmentClass* = ptr TAdjustmentClass + TAdjustmentClass* = object of TObjectClass + changed*: proc (adjustment: PAdjustment){.cdecl.} + value_changed*: proc (adjustment: PAdjustment){.cdecl.} + reserved81: proc (){.cdecl.} + reserved82: proc (){.cdecl.} + reserved83: proc (){.cdecl.} + reserved84: proc (){.cdecl.} + + PAlignment* = ptr TAlignment + TAlignment* = object of TBin + xalign*: gfloat + yalign*: gfloat + xscale*: gfloat + yscale*: gfloat + + PAlignmentClass* = ptr TAlignmentClass + TAlignmentClass* = object of TBinClass + PFrame* = ptr TFrame + TFrame* = object of TBin + label_widget*: PWidget + shadow_type*: gint16 + label_xalign*: gfloat + label_yalign*: gfloat + child_allocation*: TAllocation + + PFrameClass* = ptr TFrameClass + TFrameClass* = object of TBinClass + compute_child_allocation*: proc (frame: PFrame, allocation: PAllocation){. + cdecl.} + + PAspectFrame* = ptr TAspectFrame + TAspectFrame* = object of TFrame + xalign*: gfloat + yalign*: gfloat + ratio*: gfloat + obey_child*: gboolean + center_allocation*: TAllocation + + PAspectFrameClass* = ptr TAspectFrameClass + TAspectFrameClass* = object of TFrameClass + PArrow* = ptr TArrow + TArrow* = object of TMisc + arrow_type*: gint16 + shadow_type*: gint16 + + PArrowClass* = ptr TArrowClass + TArrowClass* = object of TMiscClass + PBindingEntry* = ptr TBindingEntry + PBindingSignal* = ptr TBindingSignal + PBindingArg* = ptr TBindingArg + PBindingSet* = ptr TBindingSet + TBindingSet*{.final, pure.} = object + set_name*: cstring + priority*: gint + widget_path_pspecs*: PGSList + widget_class_pspecs*: PGSList + class_branch_pspecs*: PGSList + entries*: PBindingEntry + current*: PBindingEntry + flag0*: guint16 + + TBindingEntry*{.final, pure.} = object + keyval*: guint + modifiers*: TGdkModifierType + binding_set*: PBindingSet + flag0*: guint16 + set_next*: PBindingEntry + hash_next*: PBindingEntry + signals*: PBindingSignal + + TBindingSignal*{.final, pure.} = object + next*: PBindingSignal + signal_name*: cstring + n_args*: guint + args*: PBindingArg + + TBindingArg*{.final, pure.} = object + arg_type*: TType + d*: gdouble + + PBox* = ptr TBox + TBox* = object of TContainer + children*: PGList + spacing*: gint16 + box_flag0*: guint16 + + PBoxClass* = ptr TBoxClass + TBoxClass* = object of TContainerClass + PBoxChild* = ptr TBoxChild + TBoxChild*{.final, pure.} = object + widget*: PWidget + padding*: guint16 + flag0*: guint16 + + PButtonBox* = ptr TButtonBox + TButtonBox* = object of TBox + child_min_width*: gint + child_min_height*: gint + child_ipad_x*: gint + child_ipad_y*: gint + layout_style*: TButtonBoxStyle + + PButtonBoxClass* = ptr TButtonBoxClass + TButtonBoxClass* = object of TBoxClass + PButton* = ptr TButton + TButton* = object of TBin + event_window*: PGdkWindow + label_text*: cstring + activate_timeout*: guint + button_flag0*: guint16 + + PButtonClass* = ptr TButtonClass + TButtonClass* = object of TBinClass + pressed*: proc (button: PButton){.cdecl.} + released*: proc (button: PButton){.cdecl.} + clicked*: proc (button: PButton){.cdecl.} + enter*: proc (button: PButton){.cdecl.} + leave*: proc (button: PButton){.cdecl.} + activate*: proc (button: PButton){.cdecl.} + reserved101: proc (){.cdecl.} + reserved102: proc (){.cdecl.} + reserved103: proc (){.cdecl.} + reserved104: proc (){.cdecl.} + + PCalendarDisplayOptions* = ptr TCalendarDisplayOptions + TCalendarDisplayOptions* = int32 + PCalendar* = ptr TCalendar + TCalendar* = object of TWidget + header_style*: PStyle + label_style*: PStyle + month*: gint + year*: gint + selected_day*: gint + day_month*: array[0..5, array[0..6, gint]] + day*: array[0..5, array[0..6, gint]] + num_marked_dates*: gint + marked_date*: array[0..30, gint] + display_flags*: TCalendarDisplayOptions + marked_date_color*: array[0..30, TGdkColor] + gc*: PGdkGC + xor_gc*: PGdkGC + focus_row*: gint + focus_col*: gint + highlight_row*: gint + highlight_col*: gint + private_data*: gpointer + grow_space*: array[0..31, gchar] + reserved111: proc (){.cdecl.} + reserved112: proc (){.cdecl.} + reserved113: proc (){.cdecl.} + reserved114: proc (){.cdecl.} + + PCalendarClass* = ptr TCalendarClass + TCalendarClass* = object of TWidgetClass + month_changed*: proc (calendar: PCalendar){.cdecl.} + day_selected*: proc (calendar: PCalendar){.cdecl.} + day_selected_double_click*: proc (calendar: PCalendar){.cdecl.} + prev_month*: proc (calendar: PCalendar){.cdecl.} + next_month*: proc (calendar: PCalendar){.cdecl.} + prev_year*: proc (calendar: PCalendar){.cdecl.} + next_year*: proc (calendar: PCalendar){.cdecl.} + + PCellEditable* = pointer + PCellEditableIface* = ptr TCellEditableIface + TCellEditableIface* = object of TGTypeInterface + editing_done*: proc (cell_editable: PCellEditable){.cdecl.} + remove_widget*: proc (cell_editable: PCellEditable){.cdecl.} + start_editing*: proc (cell_editable: PCellEditable, event: PGdkEvent){.cdecl.} + + PCellRendererState* = ptr TCellRendererState + TCellRendererState* = int32 + PCellRendererMode* = ptr TCellRendererMode + TCellRendererMode* = enum + CELL_RENDERER_MODE_INERT, CELL_RENDERER_MODE_ACTIVATABLE, + CELL_RENDERER_MODE_EDITABLE + PCellRenderer* = ptr TCellRenderer + TCellRenderer* = object of TObject + xalign*: gfloat + yalign*: gfloat + width*: gint + height*: gint + xpad*: guint16 + ypad*: guint16 + CellRenderer_flag0*: guint16 + + PCellRendererClass* = ptr TCellRendererClass + TCellRendererClass* = object of TObjectClass + get_size*: proc (cell: PCellRenderer, widget: PWidget, + cell_area: PGdkRectangle, x_offset: Pgint, y_offset: Pgint, + width: Pgint, height: Pgint){.cdecl.} + render*: proc (cell: PCellRenderer, window: PGdkWindow, widget: PWidget, + background_area: PGdkRectangle, cell_area: PGdkRectangle, + expose_area: PGdkRectangle, flags: TCellRendererState){.cdecl.} + activate*: proc (cell: PCellRenderer, event: PGdkEvent, widget: PWidget, + path: cstring, background_area: PGdkRectangle, + cell_area: PGdkRectangle, flags: TCellRendererState): gboolean{. + cdecl.} + start_editing*: proc (cell: PCellRenderer, event: PGdkEvent, + widget: PWidget, path: cstring, + background_area: PGdkRectangle, + cell_area: PGdkRectangle, flags: TCellRendererState): PCellEditable{. + cdecl.} + reserved121: proc (){.cdecl.} + reserved122: proc (){.cdecl.} + reserved123: proc (){.cdecl.} + reserved124: proc (){.cdecl.} + + PCellRendererText* = ptr TCellRendererText + TCellRendererText* = object of TCellRenderer + text*: cstring + font*: PPangoFontDescription + font_scale*: gdouble + foreground*: TPangoColor + background*: TPangoColor + extra_attrs*: PPangoAttrList + underline_style*: TPangoUnderline + rise*: gint + fixed_height_rows*: gint + CellRendererText_flag0*: guint16 + + PCellRendererTextClass* = ptr TCellRendererTextClass + TCellRendererTextClass* = object of TCellRendererClass + edited*: proc (cell_renderer_text: PCellRendererText, path: cstring, + new_text: cstring){.cdecl.} + reserved131: proc (){.cdecl.} + reserved132: proc (){.cdecl.} + reserved133: proc (){.cdecl.} + reserved134: proc (){.cdecl.} + + PCellRendererToggle* = ptr TCellRendererToggle + TCellRendererToggle* = object of TCellRenderer + CellRendererToggle_flag0*: guint16 + + PCellRendererToggleClass* = ptr TCellRendererToggleClass + TCellRendererToggleClass* = object of TCellRendererClass + toggled*: proc (cell_renderer_toggle: PCellRendererToggle, path: cstring){. + cdecl.} + reserved141: proc (){.cdecl.} + reserved142: proc (){.cdecl.} + reserved143: proc (){.cdecl.} + reserved144: proc (){.cdecl.} + + PCellRendererPixbuf* = ptr TCellRendererPixbuf + TCellRendererPixbuf* = object of TCellRenderer + pixbuf*: PGdkPixbuf + pixbuf_expander_open*: PGdkPixbuf + pixbuf_expander_closed*: PGdkPixbuf + + PCellRendererPixbufClass* = ptr TCellRendererPixbufClass + TCellRendererPixbufClass* = object of TCellRendererClass + reserved151: proc (){.cdecl.} + reserved152: proc (){.cdecl.} + reserved153: proc (){.cdecl.} + reserved154: proc (){.cdecl.} + + PItem* = ptr TItem + TItem* = object of TBin + PItemClass* = ptr TItemClass + TItemClass* = object of TBinClass + select*: proc (item: PItem){.cdecl.} + deselect*: proc (item: PItem){.cdecl.} + toggle*: proc (item: PItem){.cdecl.} + reserved161: proc (){.cdecl.} + reserved162: proc (){.cdecl.} + reserved163: proc (){.cdecl.} + reserved164: proc (){.cdecl.} + + PMenuItem* = ptr TMenuItem + TMenuItem* = object of TItem + submenu*: PWidget + event_window*: PGdkWindow + toggle_size*: guint16 + accelerator_width*: guint16 + accel_path*: cstring + MenuItem_flag0*: guint16 + timer*: guint + + PMenuItemClass* = ptr TMenuItemClass + TMenuItemClass* = object of TItemClass + MenuItemClass_flag0*: guint16 + activate*: proc (menu_item: PMenuItem){.cdecl.} + activate_item*: proc (menu_item: PMenuItem){.cdecl.} + toggle_size_request*: proc (menu_item: PMenuItem, requisition: Pgint){.cdecl.} + toggle_size_allocate*: proc (menu_item: PMenuItem, allocation: gint){.cdecl.} + reserved171: proc (){.cdecl.} + reserved172: proc (){.cdecl.} + reserved173: proc (){.cdecl.} + reserved174: proc (){.cdecl.} + + PToggleButton* = ptr TToggleButton + TToggleButton* = object of TButton + ToggleButton_flag0*: guint16 + + PToggleButtonClass* = ptr TToggleButtonClass + TToggleButtonClass* = object of TButtonClass + toggled*: proc (toggle_button: PToggleButton){.cdecl.} + reserved171: proc (){.cdecl.} + reserved172: proc (){.cdecl.} + reserved173: proc (){.cdecl.} + reserved174: proc (){.cdecl.} + + PCheckButton* = ptr TCheckButton + TCheckButton* = object of TToggleButton + PCheckButtonClass* = ptr TCheckButtonClass + TCheckButtonClass* = object of TToggleButtonClass + draw_indicator*: proc (check_button: PCheckButton, area: PGdkRectangle){. + cdecl.} + reserved181: proc (){.cdecl.} + reserved182: proc (){.cdecl.} + reserved183: proc (){.cdecl.} + reserved184: proc (){.cdecl.} + + PCheckMenuItem* = ptr TCheckMenuItem + TCheckMenuItem* = object of TMenuItem + CheckMenuItem_flag0*: guint16 + + PCheckMenuItemClass* = ptr TCheckMenuItemClass + TCheckMenuItemClass* = object of TMenuItemClass + toggled*: proc (check_menu_item: PCheckMenuItem){.cdecl.} + draw_indicator*: proc (check_menu_item: PCheckMenuItem, area: PGdkRectangle){. + cdecl.} + reserved191: proc (){.cdecl.} + reserved192: proc (){.cdecl.} + reserved193: proc (){.cdecl.} + reserved194: proc (){.cdecl.} + + PClipboard* = pointer + TClipboardReceivedFunc* = proc (clipboard: PClipboard, + selection_data: PSelectionData, data: gpointer){. + cdecl.} + TClipboardTextReceivedFunc* = proc (clipboard: PClipboard, text: cstring, + data: gpointer){.cdecl.} + TClipboardGetFunc* = proc (clipboard: PClipboard, + selection_data: PSelectionData, info: guint, + user_data_or_owner: gpointer){.cdecl.} + TClipboardClearFunc* = proc (clipboard: PClipboard, + user_data_or_owner: gpointer){.cdecl.} + PCList* = ptr TCList + PCListColumn* = ptr TCListColumn + PCListRow* = ptr TCListRow + PCell* = ptr TCell + PCellType* = ptr TCellType + TCellType* = enum + CELL_EMPTY, CELL_TEXT, CELL_PIXMAP, CELL_PIXTEXT, CELL_WIDGET + PCListDragPos* = ptr TCListDragPos + TCListDragPos* = enum + CLIST_DRAG_NONE, CLIST_DRAG_BEFORE, CLIST_DRAG_INTO, CLIST_DRAG_AFTER + PButtonAction* = ptr TButtonAction + TButtonAction* = int32 + TCListCompareFunc* = proc (clist: PCList, ptr1: gconstpointer, + ptr2: gconstpointer): gint{.cdecl.} + PCListCellInfo* = ptr TCListCellInfo + TCListCellInfo*{.final, pure.} = object + row*: gint + column*: gint + + PCListDestInfo* = ptr TCListDestInfo + TCListDestInfo*{.final, pure.} = object + cell*: TCListCellInfo + insert_pos*: TCListDragPos + + TCList* = object of TContainer + CList_flags*: guint16 + row_mem_chunk*: PGMemChunk + cell_mem_chunk*: PGMemChunk + freeze_count*: guint + internal_allocation*: TGdkRectangle + rows*: gint + row_height*: gint + row_list*: PGList + row_list_end*: PGList + columns*: gint + column_title_area*: TGdkRectangle + title_window*: PGdkWindow + column*: PCListColumn + clist_window*: PGdkWindow + clist_window_width*: gint + clist_window_height*: gint + hoffset*: gint + voffset*: gint + shadow_type*: TShadowType + selection_mode*: TSelectionMode + selection*: PGList + selection_end*: PGList + undo_selection*: PGList + undo_unselection*: PGList + undo_anchor*: gint + button_actions*: array[0..4, guint8] + drag_button*: guint8 + click_cell*: TCListCellInfo + hadjustment*: PAdjustment + vadjustment*: PAdjustment + xor_gc*: PGdkGC + fg_gc*: PGdkGC + bg_gc*: PGdkGC + cursor_drag*: PGdkCursor + x_drag*: gint + focus_row*: gint + focus_header_column*: gint + anchor*: gint + anchor_state*: TStateType + drag_pos*: gint + htimer*: gint + vtimer*: gint + sort_type*: TSortType + compare*: TCListCompareFunc + sort_column*: gint + drag_highlight_row*: gint + drag_highlight_pos*: TCListDragPos + + PCListClass* = ptr TCListClass + TCListClass* = object of TContainerClass + set_scroll_adjustments*: proc (clist: PCList, hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + refresh*: proc (clist: PCList){.cdecl.} + select_row*: proc (clist: PCList, row: gint, column: gint, event: PGdkEvent){. + cdecl.} + unselect_row*: proc (clist: PCList, row: gint, column: gint, + event: PGdkEvent){.cdecl.} + row_move*: proc (clist: PCList, source_row: gint, dest_row: gint){.cdecl.} + click_column*: proc (clist: PCList, column: gint){.cdecl.} + resize_column*: proc (clist: PCList, column: gint, width: gint){.cdecl.} + toggle_focus_row*: proc (clist: PCList){.cdecl.} + select_all*: proc (clist: PCList){.cdecl.} + unselect_all*: proc (clist: PCList){.cdecl.} + undo_selection*: proc (clist: PCList){.cdecl.} + start_selection*: proc (clist: PCList){.cdecl.} + end_selection*: proc (clist: PCList){.cdecl.} + extend_selection*: proc (clist: PCList, scroll_type: TScrollType, + position: gfloat, auto_start_selection: gboolean){. + cdecl.} + scroll_horizontal*: proc (clist: PCList, scroll_type: TScrollType, + position: gfloat){.cdecl.} + scroll_vertical*: proc (clist: PCList, scroll_type: TScrollType, + position: gfloat){.cdecl.} + toggle_add_mode*: proc (clist: PCList){.cdecl.} + abort_column_resize*: proc (clist: PCList){.cdecl.} + resync_selection*: proc (clist: PCList, event: PGdkEvent){.cdecl.} + selection_find*: proc (clist: PCList, row_number: gint, + row_list_element: PGList): PGList{.cdecl.} + draw_row*: proc (clist: PCList, area: PGdkRectangle, row: gint, + clist_row: PCListRow){.cdecl.} + draw_drag_highlight*: proc (clist: PCList, target_row: PCListRow, + target_row_number: gint, drag_pos: TCListDragPos){. + cdecl.} + clear*: proc (clist: PCList){.cdecl.} + fake_unselect_all*: proc (clist: PCList, row: gint){.cdecl.} + sort_list*: proc (clist: PCList){.cdecl.} + insert_row*: proc (clist: PCList, row: gint): gint{.cdecl, varargs.} + remove_row*: proc (clist: PCList, row: gint){.cdecl.} + set_cell_contents*: proc (clist: PCList, clist_row: PCListRow, column: gint, + thetype: TCellType, text: cstring, + spacing: guint8, pixmap: PGdkPixmap, + mask: PGdkBitmap){.cdecl.} + cell_size_request*: proc (clist: PCList, clist_row: PCListRow, column: gint, + requisition: PRequisition){.cdecl.} + + PGPtrArray = pointer + PGArray = pointer + TCListColumn*{.final, pure.} = object + title*: cstring + area*: TGdkRectangle + button*: PWidget + window*: PGdkWindow + width*: gint + min_width*: gint + max_width*: gint + justification*: TJustification + flag0*: guint16 + + TCListRow*{.final, pure.} = object + cell*: PCell + state*: TStateType + foreground*: TGdkColor + background*: TGdkColor + style*: PStyle + data*: gpointer + destroy*: TDestroyNotify + flag0*: guint16 + + PCellText* = ptr TCellText + TCellText*{.final, pure.} = object + `type`*: TCellType + vertical*: gint16 + horizontal*: gint16 + style*: PStyle + text*: cstring + + PCellPixmap* = ptr TCellPixmap + TCellPixmap*{.final, pure.} = object + `type`*: TCellType + vertical*: gint16 + horizontal*: gint16 + style*: PStyle + pixmap*: PGdkPixmap + mask*: PGdkBitmap + + PCellPixText* = ptr TCellPixText + TCellPixText*{.final, pure.} = object + `type`*: TCellType + vertical*: gint16 + horizontal*: gint16 + style*: PStyle + text*: cstring + spacing*: guint8 + pixmap*: PGdkPixmap + mask*: PGdkBitmap + + PCellWidget* = ptr TCellWidget + TCellWidget*{.final, pure.} = object + `type`*: TCellType + vertical*: gint16 + horizontal*: gint16 + style*: PStyle + widget*: PWidget + + TCell*{.final, pure.} = object + `type`*: TCellType + vertical*: gint16 + horizontal*: gint16 + style*: PStyle + text*: cstring + spacing*: guint8 + pixmap*: PGdkPixmap + mask*: PGdkBitmap + + PDialogFlags* = ptr TDialogFlags + TDialogFlags* = int32 + PResponseType* = ptr TResponseType + TResponseType* = int32 + PDialog* = ptr TDialog + TDialog* = object of TWindow + vbox*: PWidget + action_area*: PWidget + separator*: PWidget + + PDialogClass* = ptr TDialogClass + TDialogClass* = object of TWindowClass + response*: proc (dialog: PDialog, response_id: gint){.cdecl.} + closeFile*: proc (dialog: PDialog){.cdecl.} + reserved201: proc (){.cdecl.} + reserved202: proc (){.cdecl.} + reserved203: proc (){.cdecl.} + reserved204: proc (){.cdecl.} + + PVBox* = ptr TVBox + TVBox* = object of TBox + PVBoxClass* = ptr TVBoxClass + TVBoxClass* = object of TBoxClass + TColorSelectionChangePaletteFunc* = proc (colors: PGdkColor, n_colors: gint){. + cdecl.} + TColorSelectionChangePaletteWithScreenFunc* = proc (screen: PGdkScreen, + colors: PGdkColor, n_colors: gint){.cdecl.} + PColorSelection* = ptr TColorSelection + TColorSelection* = object of TVBox + private_data*: gpointer + + PColorSelectionClass* = ptr TColorSelectionClass + TColorSelectionClass* = object of TVBoxClass + color_changed*: proc (color_selection: PColorSelection){.cdecl.} + reserved211: proc (){.cdecl.} + reserved212: proc (){.cdecl.} + reserved213: proc (){.cdecl.} + reserved214: proc (){.cdecl.} + + PColorSelectionDialog* = ptr TColorSelectionDialog + TColorSelectionDialog* = object of TDialog + colorsel*: PWidget + ok_button*: PWidget + cancel_button*: PWidget + help_button*: PWidget + + PColorSelectionDialogClass* = ptr TColorSelectionDialogClass + TColorSelectionDialogClass* = object of TDialogClass + reserved221: proc (){.cdecl.} + reserved222: proc (){.cdecl.} + reserved223: proc (){.cdecl.} + reserved224: proc (){.cdecl.} + + PHBox* = ptr THBox + THBox* = object of TBox + PHBoxClass* = ptr THBoxClass + THBoxClass* = object of TBoxClass + PCombo* = ptr TCombo + TCombo* = object of THBox + entry*: PWidget + button*: PWidget + popup*: PWidget + popwin*: PWidget + list*: PWidget + entry_change_id*: guint + list_change_id*: guint + Combo_flag0*: guint16 + current_button*: guint16 + activate_id*: guint + + PComboClass* = ptr TComboClass + TComboClass* = object of THBoxClass + reserved231: proc (){.cdecl.} + reserved232: proc (){.cdecl.} + reserved233: proc (){.cdecl.} + reserved234: proc (){.cdecl.} + + PCTreePos* = ptr TCTreePos + TCTreePos* = enum + CTREE_POS_BEFORE, CTREE_POS_AS_CHILD, CTREE_POS_AFTER + PCTreeLineStyle* = ptr TCTreeLineStyle + TCTreeLineStyle* = enum + CTREE_LINES_NONE, CTREE_LINES_SOLID, CTREE_LINES_DOTTED, CTREE_LINES_TABBED + PCTreeExpanderStyle* = ptr TCTreeExpanderStyle + TCTreeExpanderStyle* = enum + CTREE_EXPANDER_NONE, CTREE_EXPANDER_SQUARE, CTREE_EXPANDER_TRIANGLE, + CTREE_EXPANDER_CIRCULAR + PCTreeExpansionType* = ptr TCTreeExpansionType + TCTreeExpansionType* = enum + CTREE_EXPANSION_EXPAND, CTREE_EXPANSION_EXPAND_RECURSIVE, + CTREE_EXPANSION_COLLAPSE, CTREE_EXPANSION_COLLAPSE_RECURSIVE, + CTREE_EXPANSION_TOGGLE, CTREE_EXPANSION_TOGGLE_RECURSIVE + PCTree* = ptr TCTree + PCTreeNode* = ptr TCTreeNode + TCTreeFunc* = proc (ctree: PCTree, node: PCTreeNode, data: gpointer){.cdecl.} + TCTreeGNodeFunc* = proc (ctree: PCTree, depth: guint, gnode: PGNode, + cnode: PCTreeNode, data: gpointer): gboolean{.cdecl.} + TCTreeCompareDragFunc* = proc (ctree: PCTree, source_node: PCTreeNode, + new_parent: PCTreeNode, new_sibling: PCTreeNode): gboolean{. + cdecl.} + TCTree* = object of TCList + lines_gc*: PGdkGC + tree_indent*: gint + tree_spacing*: gint + tree_column*: gint + CTree_flag0*: guint16 + drag_compare*: TCTreeCompareDragFunc + + PCTreeClass* = ptr TCTreeClass + TCTreeClass* = object of TCListClass + tree_select_row*: proc (ctree: PCTree, row: PCTreeNode, column: gint){.cdecl.} + tree_unselect_row*: proc (ctree: PCTree, row: PCTreeNode, column: gint){. + cdecl.} + tree_expand*: proc (ctree: PCTree, node: PCTreeNode){.cdecl.} + tree_collapse*: proc (ctree: PCTree, node: PCTreeNode){.cdecl.} + tree_move*: proc (ctree: PCTree, node: PCTreeNode, new_parent: PCTreeNode, + new_sibling: PCTreeNode){.cdecl.} + change_focus_row_expansion*: proc (ctree: PCTree, + action: TCTreeExpansionType){.cdecl.} + + PCTreeRow* = ptr TCTreeRow + TCTreeRow*{.final, pure.} = object + row*: TCListRow + parent*: PCTreeNode + sibling*: PCTreeNode + children*: PCTreeNode + pixmap_closed*: PGdkPixmap + mask_closed*: PGdkBitmap + pixmap_opened*: PGdkPixmap + mask_opened*: PGdkBitmap + level*: guint16 + CTreeRow_flag0*: guint16 + + TCTreeNode*{.final, pure.} = object + list*: TGList + + PDrawingArea* = ptr TDrawingArea + TDrawingArea* = object of TWidget + draw_data*: gpointer + + PDrawingAreaClass* = ptr TDrawingAreaClass + TDrawingAreaClass* = object of TWidgetClass + reserved241: proc (){.cdecl.} + reserved242: proc (){.cdecl.} + reserved243: proc (){.cdecl.} + reserved244: proc (){.cdecl.} + + Tctlpoint* = array[0..1, gfloat] + Pctlpoint* = ptr Tctlpoint + PCurve* = ptr TCurve + TCurve* = object of TDrawingArea + cursor_type*: gint + min_x*: gfloat + max_x*: gfloat + min_y*: gfloat + max_y*: gfloat + pixmap*: PGdkPixmap + curve_type*: TCurveType + height*: gint + grab_point*: gint + last*: gint + num_points*: gint + point*: PGdkPoint + num_ctlpoints*: gint + ctlpoint*: Pctlpoint + + PCurveClass* = ptr TCurveClass + TCurveClass* = object of TDrawingAreaClass + curve_type_changed*: proc (curve: PCurve){.cdecl.} + reserved251: proc (){.cdecl.} + reserved252: proc (){.cdecl.} + reserved253: proc (){.cdecl.} + reserved254: proc (){.cdecl.} + + PDestDefaults* = ptr TDestDefaults + TDestDefaults* = int32 + PTargetFlags* = ptr TTargetFlags + TTargetFlags* = int32 + PEditable* = pointer + PEditableClass* = ptr TEditableClass + TEditableClass* = object of TGTypeInterface + insert_text*: proc (editable: PEditable, text: cstring, length: gint, + position: Pgint){.cdecl.} + delete_text*: proc (editable: PEditable, start_pos: gint, end_pos: gint){. + cdecl.} + changed*: proc (editable: PEditable){.cdecl.} + do_insert_text*: proc (editable: PEditable, text: cstring, length: gint, + position: Pgint){.cdecl.} + do_delete_text*: proc (editable: PEditable, start_pos: gint, end_pos: gint){. + cdecl.} + get_chars*: proc (editable: PEditable, start_pos: gint, end_pos: gint): cstring{. + cdecl.} + set_selection_bounds*: proc (editable: PEditable, start_pos: gint, + end_pos: gint){.cdecl.} + get_selection_bounds*: proc (editable: PEditable, start_pos: Pgint, + end_pos: Pgint): gboolean{.cdecl.} + set_position*: proc (editable: PEditable, position: gint){.cdecl.} + get_position*: proc (editable: PEditable): gint{.cdecl.} + + PIMContext* = ptr TIMContext + TIMContext* = object of TGObject + PIMContextClass* = ptr TIMContextClass + TIMContextClass* = object of TObjectClass + preedit_start*: proc (context: PIMContext){.cdecl.} + preedit_end*: proc (context: PIMContext){.cdecl.} + preedit_changed*: proc (context: PIMContext){.cdecl.} + commit*: proc (context: PIMContext, str: cstring){.cdecl.} + retrieve_surrounding*: proc (context: PIMContext): gboolean{.cdecl.} + delete_surrounding*: proc (context: PIMContext, offset: gint, n_chars: gint): gboolean{. + cdecl.} + set_client_window*: proc (context: PIMContext, window: PGdkWindow){.cdecl.} + get_preedit_string*: proc (context: PIMContext, str: PPgchar, + attrs: var PPangoAttrList, cursor_pos: Pgint){. + cdecl.} + filter_keypress*: proc (context: PIMContext, event: PGdkEventKey): gboolean{. + cdecl.} + focus_in*: proc (context: PIMContext){.cdecl.} + focus_out*: proc (context: PIMContext){.cdecl.} + reset*: proc (context: PIMContext){.cdecl.} + set_cursor_location*: proc (context: PIMContext, area: PGdkRectangle){.cdecl.} + set_use_preedit*: proc (context: PIMContext, use_preedit: gboolean){.cdecl.} + set_surrounding*: proc (context: PIMContext, text: cstring, len: gint, + cursor_index: gint){.cdecl.} + get_surrounding*: proc (context: PIMContext, text: PPgchar, + cursor_index: Pgint): gboolean{.cdecl.} + reserved261: proc (){.cdecl.} + reserved262: proc (){.cdecl.} + reserved263: proc (){.cdecl.} + reserved264: proc (){.cdecl.} + reserved265: proc (){.cdecl.} + reserved266: proc (){.cdecl.} + + PMenuShell* = ptr TMenuShell + TMenuShell* = object of TContainer + children*: PGList + active_menu_item*: PWidget + parent_menu_shell*: PWidget + button*: guint + activate_time*: guint32 + MenuShell_flag0*: guint16 + + PMenuShellClass* = ptr TMenuShellClass + TMenuShellClass* = object of TContainerClass + MenuShellClass_flag0*: guint16 + deactivate*: proc (menu_shell: PMenuShell){.cdecl.} + selection_done*: proc (menu_shell: PMenuShell){.cdecl.} + move_current*: proc (menu_shell: PMenuShell, direction: TMenuDirectionType){. + cdecl.} + activate_current*: proc (menu_shell: PMenuShell, force_hide: gboolean){. + cdecl.} + cancel*: proc (menu_shell: PMenuShell){.cdecl.} + select_item*: proc (menu_shell: PMenuShell, menu_item: PWidget){.cdecl.} + insert*: proc (menu_shell: PMenuShell, child: PWidget, position: gint){. + cdecl.} + reserved271: proc (){.cdecl.} + reserved272: proc (){.cdecl.} + reserved273: proc (){.cdecl.} + reserved274: proc (){.cdecl.} + + TMenuPositionFunc* = proc (menu: PMenu, x: Pgint, y: Pgint, + push_in: Pgboolean, user_data: gpointer){.cdecl.} + TMenuDetachFunc* = proc (attach_widget: PWidget, menu: PMenu){.cdecl.} + TMenu* = object of TMenuShell + parent_menu_item*: PWidget + old_active_menu_item*: PWidget + accel_group*: PAccelGroup + accel_path*: cstring + position_func*: TMenuPositionFunc + position_func_data*: gpointer + toggle_size*: guint + toplevel*: PWidget + tearoff_window*: PWidget + tearoff_hbox*: PWidget + tearoff_scrollbar*: PWidget + tearoff_adjustment*: PAdjustment + view_window*: PGdkWindow + bin_window*: PGdkWindow + scroll_offset*: gint + saved_scroll_offset*: gint + scroll_step*: gint + timeout_id*: guint + navigation_region*: PGdkRegion + navigation_timeout*: guint + Menu_flag0*: guint16 + + PMenuClass* = ptr TMenuClass + TMenuClass* = object of TMenuShellClass + reserved281: proc (){.cdecl.} + reserved282: proc (){.cdecl.} + reserved283: proc (){.cdecl.} + reserved284: proc (){.cdecl.} + + PEntry* = ptr TEntry + TEntry* = object of TWidget + text*: cstring + Entry_flag0*: guint16 + text_length*: guint16 + text_max_length*: guint16 + text_area*: PGdkWindow + im_context*: PIMContext + popup_menu*: PWidget + current_pos*: gint + selection_bound*: gint + cached_layout*: PPangoLayout + flag1*: guint16 + button*: guint + blink_timeout*: guint + recompute_idle*: guint + scroll_offset*: gint + ascent*: gint + descent*: gint + text_size*: guint16 + n_bytes*: guint16 + preedit_length*: guint16 + preedit_cursor*: guint16 + dnd_position*: gint + drag_start_x*: gint + drag_start_y*: gint + invisible_char*: gunichar + width_chars*: gint + + PEntryClass* = ptr TEntryClass + TEntryClass* = object of TWidgetClass + populate_popup*: proc (entry: PEntry, menu: PMenu){.cdecl.} + activate*: proc (entry: PEntry){.cdecl.} + move_cursor*: proc (entry: PEntry, step: TMovementStep, count: gint, + extend_selection: gboolean){.cdecl.} + insert_at_cursor*: proc (entry: PEntry, str: cstring){.cdecl.} + delete_from_cursor*: proc (entry: PEntry, thetype: TDeleteType, count: gint){. + cdecl.} + cut_clipboard*: proc (entry: PEntry){.cdecl.} + copy_clipboard*: proc (entry: PEntry){.cdecl.} + paste_clipboard*: proc (entry: PEntry){.cdecl.} + toggle_overwrite*: proc (entry: PEntry){.cdecl.} + reserved291: proc (){.cdecl.} + reserved292: proc (){.cdecl.} + reserved293: proc (){.cdecl.} + reserved294: proc (){.cdecl.} + + PEventBox* = ptr TEventBox + TEventBox* = object of TBin + PEventBoxClass* = ptr TEventBoxClass + TEventBoxClass* = object of TBinClass + PFileSelection* = ptr TFileSelection + TFileSelection* = object of TDialog + dir_list*: PWidget + file_list*: PWidget + selection_entry*: PWidget + selection_text*: PWidget + main_vbox*: PWidget + ok_button*: PWidget + cancel_button*: PWidget + help_button*: PWidget + history_pulldown*: PWidget + history_menu*: PWidget + history_list*: PGList + fileop_dialog*: PWidget + fileop_entry*: PWidget + fileop_file*: cstring + cmpl_state*: gpointer + fileop_c_dir*: PWidget + fileop_del_file*: PWidget + fileop_ren_file*: PWidget + button_area*: PWidget + FileSelection_action_area*: PWidget + selected_names*: PGPtrArray + last_selected*: cstring + + PFileSelectionClass* = ptr TFileSelectionClass + TFileSelectionClass* = object of TDialogClass + reserved301: proc (){.cdecl.} + reserved302: proc (){.cdecl.} + reserved303: proc (){.cdecl.} + reserved304: proc (){.cdecl.} + + PFixed* = ptr TFixed + TFixed* = object of TContainer + children*: PGList + + PFixedClass* = ptr TFixedClass + TFixedClass* = object of TContainerClass + PFixedChild* = ptr TFixedChild + TFixedChild*{.final, pure.} = object + widget*: PWidget + x*: gint + y*: gint + + PFontSelection* = ptr TFontSelection + TFontSelection* = object of TVBox + font_entry*: PWidget + family_list*: PWidget + font_style_entry*: PWidget + face_list*: PWidget + size_entry*: PWidget + size_list*: PWidget + pixels_button*: PWidget + points_button*: PWidget + filter_button*: PWidget + preview_entry*: PWidget + family*: PPangoFontFamily + face*: PPangoFontFace + size*: gint + font*: PGdkFont + + PFontSelectionClass* = ptr TFontSelectionClass + TFontSelectionClass* = object of TVBoxClass + reserved311: proc (){.cdecl.} + reserved312: proc (){.cdecl.} + reserved313: proc (){.cdecl.} + reserved314: proc (){.cdecl.} + + PFontSelectionDialog* = ptr TFontSelectionDialog + TFontSelectionDialog* = object of TDialog + fontsel*: PWidget + main_vbox*: PWidget + FontSelectionDialog_action_area*: PWidget + ok_button*: PWidget + apply_button*: PWidget + cancel_button*: PWidget + dialog_width*: gint + auto_resize*: gboolean + + PFontSelectionDialogClass* = ptr TFontSelectionDialogClass + TFontSelectionDialogClass* = object of TDialogClass + reserved321: proc (){.cdecl.} + reserved322: proc (){.cdecl.} + reserved323: proc (){.cdecl.} + reserved324: proc (){.cdecl.} + + PGammaCurve* = ptr TGammaCurve + TGammaCurve* = object of TVBox + table*: PWidget + curve*: PWidget + button*: array[0..4, PWidget] + gamma*: gfloat + gamma_dialog*: PWidget + gamma_text*: PWidget + + PGammaCurveClass* = ptr TGammaCurveClass + TGammaCurveClass* = object of TVBoxClass + reserved331: proc (){.cdecl.} + reserved332: proc (){.cdecl.} + reserved333: proc (){.cdecl.} + reserved334: proc (){.cdecl.} + + PHandleBox* = ptr THandleBox + THandleBox* = object of TBin + bin_window*: PGdkWindow + float_window*: PGdkWindow + shadow_type*: TShadowType + HandleBox_flag0*: guint16 + deskoff_x*: gint + deskoff_y*: gint + attach_allocation*: TAllocation + float_allocation*: TAllocation + + PHandleBoxClass* = ptr THandleBoxClass + THandleBoxClass* = object of TBinClass + child_attached*: proc (handle_box: PHandleBox, child: PWidget){.cdecl.} + child_detached*: proc (handle_box: PHandleBox, child: PWidget){.cdecl.} + reserved341: proc (){.cdecl.} + reserved342: proc (){.cdecl.} + reserved343: proc (){.cdecl.} + reserved344: proc (){.cdecl.} + + PPaned* = ptr TPaned + TPaned* = object of TContainer + child1*: PWidget + child2*: PWidget + handle*: PGdkWindow + xor_gc*: PGdkGC + cursor_type*: TGdkCursorType + handle_pos*: TGdkRectangle + child1_size*: gint + last_allocation*: gint + min_position*: gint + max_position*: gint + Paned_flag0*: guint16 + last_child1_focus*: PWidget + last_child2_focus*: PWidget + saved_focus*: PWidget + drag_pos*: gint + original_position*: gint + + PPanedClass* = ptr TPanedClass + TPanedClass* = object of TContainerClass + cycle_child_focus*: proc (paned: PPaned, reverse: gboolean): gboolean{.cdecl.} + toggle_handle_focus*: proc (paned: PPaned): gboolean{.cdecl.} + move_handle*: proc (paned: PPaned, scroll: TScrollType): gboolean{.cdecl.} + cycle_handle_focus*: proc (paned: PPaned, reverse: gboolean): gboolean{. + cdecl.} + accept_position*: proc (paned: PPaned): gboolean{.cdecl.} + cancel_position*: proc (paned: PPaned): gboolean{.cdecl.} + reserved351: proc (){.cdecl.} + reserved352: proc (){.cdecl.} + reserved353: proc (){.cdecl.} + reserved354: proc (){.cdecl.} + + PHButtonBox* = ptr THButtonBox + THButtonBox* = object of TButtonBox + PHButtonBoxClass* = ptr THButtonBoxClass + THButtonBoxClass* = object of TButtonBoxClass + PHPaned* = ptr THPaned + THPaned* = object of TPaned + PHPanedClass* = ptr THPanedClass + THPanedClass* = object of TPanedClass + PRulerMetric* = ptr TRulerMetric + PRuler* = ptr TRuler + TRuler* = object of TWidget + backing_store*: PGdkPixmap + non_gr_exp_gc*: PGdkGC + metric*: PRulerMetric + xsrc*: gint + ysrc*: gint + slider_size*: gint + lower*: gdouble + upper*: gdouble + position*: gdouble + max_size*: gdouble + + PRulerClass* = ptr TRulerClass + TRulerClass* = object of TWidgetClass + draw_ticks*: proc (ruler: PRuler){.cdecl.} + draw_pos*: proc (ruler: PRuler){.cdecl.} + reserved361: proc (){.cdecl.} + reserved362: proc (){.cdecl.} + reserved363: proc (){.cdecl.} + reserved364: proc (){.cdecl.} + + TRulerMetric*{.final, pure.} = object + metric_name*: cstring + abbrev*: cstring + pixels_per_unit*: gdouble + ruler_scale*: array[0..9, gdouble] + subdivide*: array[0..4, gint] + + PHRuler* = ptr THRuler + THRuler* = object of TRuler + PHRulerClass* = ptr THRulerClass + THRulerClass* = object of TRulerClass + PRcContext* = pointer + PSettings* = ptr TSettings + TSettings* = object of TGObject + queued_settings*: PGData + property_values*: PGValue + rc_context*: PRcContext + screen*: PGdkScreen + + PSettingsClass* = ptr TSettingsClass + TSettingsClass* = object of TGObjectClass + PSettingsValue* = ptr TSettingsValue + TSettingsValue*{.final, pure.} = object + origin*: cstring + value*: TGValue + + PRcFlags* = ptr TRcFlags + TRcFlags* = int32 + PRcStyle* = ptr TRcStyle + TRcStyle* = object of TGObject + name*: cstring + bg_pixmap_name*: array[0..4, cstring] + font_desc*: PPangoFontDescription + color_flags*: array[0..4, TRcFlags] + fg*: array[0..4, TGdkColor] + bg*: array[0..4, TGdkColor] + text*: array[0..4, TGdkColor] + base*: array[0..4, TGdkColor] + xthickness*: gint + ythickness*: gint + rc_properties*: PGArray + rc_style_lists*: PGSList + icon_factories*: PGSList + RcStyle_flag0*: guint16 + + PRcStyleClass* = ptr TRcStyleClass + TRcStyleClass* = object of TGObjectClass + create_rc_style*: proc (rc_style: PRcStyle): PRcStyle{.cdecl.} + parse*: proc (rc_style: PRcStyle, settings: PSettings, scanner: PGScanner): guint{. + cdecl.} + merge*: proc (dest: PRcStyle, src: PRcStyle){.cdecl.} + create_style*: proc (rc_style: PRcStyle): PStyle{.cdecl.} + reserved371: proc (){.cdecl.} + reserved372: proc (){.cdecl.} + reserved373: proc (){.cdecl.} + reserved374: proc (){.cdecl.} + + PRcTokenType* = ptr TRcTokenType + TRcTokenType* = enum + RC_TOKEN_INVALID, RC_TOKEN_INCLUDE, RC_TOKEN_NORMAL, RC_TOKEN_ACTIVE, + RC_TOKEN_PRELIGHT, RC_TOKEN_SELECTED, RC_TOKEN_INSENSITIVE, RC_TOKEN_FG, + RC_TOKEN_BG, RC_TOKEN_TEXT, RC_TOKEN_BASE, RC_TOKEN_XTHICKNESS, + RC_TOKEN_YTHICKNESS, RC_TOKEN_FONT, RC_TOKEN_FONTSET, RC_TOKEN_FONT_NAME, + RC_TOKEN_BG_PIXMAP, RC_TOKEN_PIXMAP_PATH, RC_TOKEN_STYLE, RC_TOKEN_BINDING, + RC_TOKEN_BIND, RC_TOKEN_WIDGET, RC_TOKEN_WIDGET_CLASS, RC_TOKEN_CLASS, + RC_TOKEN_LOWEST, RC_TOKEN_GTK, RC_TOKEN_APPLICATION, RC_TOKEN_THEME, + RC_TOKEN_RC, RC_TOKEN_HIGHEST, RC_TOKEN_ENGINE, RC_TOKEN_MODULE_PATH, + RC_TOKEN_IM_MODULE_PATH, RC_TOKEN_IM_MODULE_FILE, RC_TOKEN_STOCK, + RC_TOKEN_LTR, RC_TOKEN_RTL, RC_TOKEN_LAST + PRcProperty* = ptr TRcProperty + TRcProperty*{.final, pure.} = object + type_name*: TGQuark + property_name*: TGQuark + origin*: cstring + value*: TGValue + + PIconSource* = pointer + TRcPropertyParser* = proc (pspec: PGParamSpec, rc_string: PGString, + property_value: PGValue): gboolean{.cdecl.} + TStyle* = object of TGObject + fg*: array[0..4, TGdkColor] + bg*: array[0..4, TGdkColor] + light*: array[0..4, TGdkColor] + dark*: array[0..4, TGdkColor] + mid*: array[0..4, TGdkColor] + text*: array[0..4, TGdkColor] + base*: array[0..4, TGdkColor] + text_aa*: array[0..4, TGdkColor] + black*: TGdkColor + white*: TGdkColor + font_desc*: PPangoFontDescription + xthickness*: gint + ythickness*: gint + fg_gc*: array[0..4, PGdkGC] + bg_gc*: array[0..4, PGdkGC] + light_gc*: array[0..4, PGdkGC] + dark_gc*: array[0..4, PGdkGC] + mid_gc*: array[0..4, PGdkGC] + text_gc*: array[0..4, PGdkGC] + base_gc*: array[0..4, PGdkGC] + text_aa_gc*: array[0..4, PGdkGC] + black_gc*: PGdkGC + white_gc*: PGdkGC + bg_pixmap*: array[0..4, PGdkPixmap] + attach_count*: gint + depth*: gint + colormap*: PGdkColormap + private_font*: PGdkFont + private_font_desc*: PPangoFontDescription + rc_style*: PRcStyle + styles*: PGSList + property_cache*: PGArray + icon_factories*: PGSList + + PStyleClass* = ptr TStyleClass + TStyleClass* = object of TGObjectClass + realize*: proc (style: PStyle){.cdecl.} + unrealize*: proc (style: PStyle){.cdecl.} + copy*: proc (style: PStyle, src: PStyle){.cdecl.} + clone*: proc (style: PStyle): PStyle{.cdecl.} + init_from_rc*: proc (style: PStyle, rc_style: PRcStyle){.cdecl.} + set_background*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType){.cdecl.} + render_icon*: proc (style: PStyle, source: PIconSource, + direction: TTextDirection, state: TStateType, + size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{. + cdecl.} + draw_hline*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x1: gint, x2: gint, + y: gint){.cdecl.} + draw_vline*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, y1: gint, y2: gint, + x: gint){.cdecl.} + draw_shadow*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl.} + draw_polygon*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + point: PGdkPoint, npoints: gint, fill: gboolean){.cdecl.} + draw_arrow*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + arrow_type: TArrowType, fill: gboolean, x: gint, y: gint, + width: gint, height: gint){.cdecl.} + draw_diamond*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl.} + draw_string*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + `string`: cstring){.cdecl.} + draw_box*: proc (style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl.} + draw_flat_box*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl.} + draw_check*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl.} + draw_option*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl.} + draw_tab*: proc (style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl.} + draw_shadow_gap*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, + detail: cstring, x: gint, y: gint, width: gint, + height: gint, gap_side: TPositionType, gap_x: gint, + gap_width: gint){.cdecl.} + draw_box_gap*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint, + gap_side: TPositionType, gap_x: gint, gap_width: gint){. + cdecl.} + draw_extension*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, + detail: cstring, x: gint, y: gint, width: gint, + height: gint, gap_side: TPositionType){.cdecl.} + draw_focus*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl.} + draw_slider*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint, + orientation: TOrientation){.cdecl.} + draw_handle*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint, + orientation: TOrientation){.cdecl.} + draw_expander*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + expander_style: TExpanderStyle){.cdecl.} + draw_layout*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, use_text: gboolean, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, layout: PPangoLayout){.cdecl.} + draw_resize_grip*: proc (style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, + edge: TGdkWindowEdge, x: gint, y: gint, + width: gint, height: gint){.cdecl.} + reserved381: proc (){.cdecl.} + reserved382: proc (){.cdecl.} + reserved383: proc (){.cdecl.} + reserved384: proc (){.cdecl.} + reserved385: proc (){.cdecl.} + reserved386: proc (){.cdecl.} + reserved387: proc (){.cdecl.} + reserved388: proc (){.cdecl.} + reserved389: proc (){.cdecl.} + reserved3810: proc (){.cdecl.} + reserved3811: proc (){.cdecl.} + reserved3812: proc (){.cdecl.} + + PBorder* = ptr TBorder + TBorder*{.final, pure.} = object + left*: gint + right*: gint + top*: gint + bottom*: gint + + PRangeLayout* = pointer + PRangeStepTimer* = pointer + PRange* = ptr TRange + TRange* = object of TWidget + adjustment*: PAdjustment + update_policy*: TUpdateType + Range_flag0*: guint16 + min_slider_size*: gint + orientation*: TOrientation + range_rect*: TGdkRectangle + slider_start*: gint + slider_end*: gint + round_digits*: gint + flag1*: guint16 + layout*: PRangeLayout + timer*: PRangeStepTimer + slide_initial_slider_position*: gint + slide_initial_coordinate*: gint + update_timeout_id*: guint + event_window*: PGdkWindow + + PRangeClass* = ptr TRangeClass + TRangeClass* = object of TWidgetClass + slider_detail*: cstring + stepper_detail*: cstring + value_changed*: proc (range: PRange){.cdecl.} + adjust_bounds*: proc (range: PRange, new_value: gdouble){.cdecl.} + move_slider*: proc (range: PRange, scroll: TScrollType){.cdecl.} + get_range_border*: proc (range: PRange, border: PBorder){.cdecl.} + reserved401: proc (){.cdecl.} + reserved402: proc (){.cdecl.} + reserved403: proc (){.cdecl.} + reserved404: proc (){.cdecl.} + + PScale* = ptr TScale + TScale* = object of TRange + digits*: gint + Scale_flag0*: guint16 + + PScaleClass* = ptr TScaleClass + TScaleClass* = object of TRangeClass + format_value*: proc (scale: PScale, value: gdouble): cstring{.cdecl.} + draw_value*: proc (scale: PScale){.cdecl.} + reserved411: proc (){.cdecl.} + reserved412: proc (){.cdecl.} + reserved413: proc (){.cdecl.} + reserved414: proc (){.cdecl.} + + PHScale* = ptr THScale + THScale* = object of TScale + PHScaleClass* = ptr THScaleClass + THScaleClass* = object of TScaleClass + PScrollbar* = ptr TScrollbar + TScrollbar* = object of TRange + PScrollbarClass* = ptr TScrollbarClass + TScrollbarClass* = object of TRangeClass + reserved421: proc (){.cdecl.} + reserved422: proc (){.cdecl.} + reserved423: proc (){.cdecl.} + reserved424: proc (){.cdecl.} + + PHScrollbar* = ptr THScrollbar + THScrollbar* = object of TScrollbar + PHScrollbarClass* = ptr THScrollbarClass + THScrollbarClass* = object of TScrollbarClass + PSeparator* = ptr TSeparator + TSeparator* = object of TWidget + PSeparatorClass* = ptr TSeparatorClass + TSeparatorClass* = object of TWidgetClass + PHSeparator* = ptr THSeparator + THSeparator* = object of TSeparator + PHSeparatorClass* = ptr THSeparatorClass + THSeparatorClass* = object of TSeparatorClass + PIconFactory* = ptr TIconFactory + TIconFactory* = object of TGObject + icons*: PGHashTable + + PIconFactoryClass* = ptr TIconFactoryClass + TIconFactoryClass* = object of TGObjectClass + reserved431: proc (){.cdecl.} + reserved432: proc (){.cdecl.} + reserved433: proc (){.cdecl.} + reserved434: proc (){.cdecl.} + + PIconSet* = pointer + PImagePixmapData* = ptr TImagePixmapData + TImagePixmapData*{.final, pure.} = object + pixmap*: PGdkPixmap + + PImageImageData* = ptr TImageImageData + TImageImageData*{.final, pure.} = object + image*: PGdkImage + + PImagePixbufData* = ptr TImagePixbufData + TImagePixbufData*{.final, pure.} = object + pixbuf*: PGdkPixbuf + + PImageStockData* = ptr TImageStockData + TImageStockData*{.final, pure.} = object + stock_id*: cstring + + PImageIconSetData* = ptr TImageIconSetData + TImageIconSetData*{.final, pure.} = object + icon_set*: PIconSet + + PImageAnimationData* = ptr TImageAnimationData + TImageAnimationData*{.final, pure.} = object + anim*: PGdkPixbufAnimation + iter*: PGdkPixbufAnimationIter + frame_timeout*: guint + + PImageType* = ptr TImageType + TImageType* = enum + IMAGE_EMPTY, IMAGE_PIXMAP, IMAGE_IMAGE, IMAGE_PIXBUF, IMAGE_STOCK, + IMAGE_ICON_SET, IMAGE_ANIMATION + PImage* = ptr TImage + TImage* = object of TMisc + storage_type*: TImageType + pixmap*: TImagePixmapData + mask*: PGdkBitmap + icon_size*: TIconSize + + PImageClass* = ptr TImageClass + TImageClass* = object of TMiscClass + reserved441: proc (){.cdecl.} + reserved442: proc (){.cdecl.} + reserved443: proc (){.cdecl.} + reserved444: proc (){.cdecl.} + + PImageMenuItem* = ptr TImageMenuItem + TImageMenuItem* = object of TMenuItem + image*: PWidget + + PImageMenuItemClass* = ptr TImageMenuItemClass + TImageMenuItemClass* = object of TMenuItemClass + PIMContextSimple* = ptr TIMContextSimple + TIMContextSimple* = object of TIMContext + tables*: PGSList + compose_buffer*: array[0..(MAX_COMPOSE_LEN + 1) - 1, guint] + tentative_match*: gunichar + tentative_match_len*: gint + IMContextSimple_flag0*: guint16 + + PIMContextSimpleClass* = ptr TIMContextSimpleClass + TIMContextSimpleClass* = object of TIMContextClass + PIMMulticontext* = ptr TIMMulticontext + TIMMulticontext* = object of TIMContext + slave*: PIMContext + client_window*: PGdkWindow + context_id*: cstring + + PIMMulticontextClass* = ptr TIMMulticontextClass + TIMMulticontextClass* = object of TIMContextClass + reserved451: proc (){.cdecl.} + reserved452: proc (){.cdecl.} + reserved453: proc (){.cdecl.} + reserved454: proc (){.cdecl.} + + PInputDialog* = ptr TInputDialog + TInputDialog* = object of TDialog + axis_list*: PWidget + axis_listbox*: PWidget + mode_optionmenu*: PWidget + close_button*: PWidget + save_button*: PWidget + axis_items*: array[0..(GDK_AXIS_LAST) - 1, PWidget] + current_device*: PGdkDevice + keys_list*: PWidget + keys_listbox*: PWidget + + PInputDialogClass* = ptr TInputDialogClass + TInputDialogClass* = object of TDialogClass + enable_device*: proc (inputd: PInputDialog, device: PGdkDevice){.cdecl.} + disable_device*: proc (inputd: PInputDialog, device: PGdkDevice){.cdecl.} + reserved461: proc (){.cdecl.} + reserved462: proc (){.cdecl.} + reserved463: proc (){.cdecl.} + reserved464: proc (){.cdecl.} + + PInvisible* = ptr TInvisible + TInvisible* = object of TWidget + has_user_ref_count*: gboolean + screen*: PGdkScreen + + PInvisibleClass* = ptr TInvisibleClass + TInvisibleClass* = object of TWidgetClass + reserved701: proc (){.cdecl.} + reserved702: proc (){.cdecl.} + reserved703: proc (){.cdecl.} + reserved704: proc (){.cdecl.} + + TPrintFunc* = proc (func_data: gpointer, str: cstring){.cdecl.} + PTranslateFunc* = ptr TTranslateFunc + TTranslateFunc* = gchar + TItemFactoryCallback* = proc (){.cdecl.} + TItemFactoryCallback1* = proc (callback_data: gpointer, + callback_action: guint, widget: PWidget){.cdecl.} + PItemFactory* = ptr TItemFactory + TItemFactory* = object of TObject + path*: cstring + accel_group*: PAccelGroup + widget*: PWidget + items*: PGSList + translate_func*: TTranslateFunc + translate_data*: gpointer + translate_notify*: TDestroyNotify + + PItemFactoryClass* = ptr TItemFactoryClass + TItemFactoryClass* = object of TObjectClass + item_ht*: PGHashTable + reserved471: proc (){.cdecl.} + reserved472: proc (){.cdecl.} + reserved473: proc (){.cdecl.} + reserved474: proc (){.cdecl.} + + PItemFactoryEntry* = ptr TItemFactoryEntry + TItemFactoryEntry*{.final, pure.} = object + path*: cstring + accelerator*: cstring + callback*: TItemFactoryCallback + callback_action*: guint + item_type*: cstring + extra_data*: gconstpointer + + PItemFactoryItem* = ptr TItemFactoryItem + TItemFactoryItem*{.final, pure.} = object + path*: cstring + widgets*: PGSList + + PLayout* = ptr TLayout + TLayout* = object of TContainer + children*: PGList + width*: guint + height*: guint + hadjustment*: PAdjustment + vadjustment*: PAdjustment + bin_window*: PGdkWindow + visibility*: TGdkVisibilityState + scroll_x*: gint + scroll_y*: gint + freeze_count*: guint + + PLayoutClass* = ptr TLayoutClass + TLayoutClass* = object of TContainerClass + set_scroll_adjustments*: proc (layout: PLayout, hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + reserved481: proc (){.cdecl.} + reserved482: proc (){.cdecl.} + reserved483: proc (){.cdecl.} + reserved484: proc (){.cdecl.} + + PList* = ptr TList + TList* = object of TContainer + children*: PGList + selection*: PGList + undo_selection*: PGList + undo_unselection*: PGList + last_focus_child*: PWidget + undo_focus_child*: PWidget + htimer*: guint + vtimer*: guint + anchor*: gint + drag_pos*: gint + anchor_state*: TStateType + List_flag0*: guint16 + + PListClass* = ptr TListClass + TListClass* = object of TContainerClass + selection_changed*: proc (list: PList){.cdecl.} + select_child*: proc (list: PList, child: PWidget){.cdecl.} + unselect_child*: proc (list: PList, child: PWidget){.cdecl.} + + TTreeModelForeachFunc* = proc (model: PTreeModel, path: PTreePath, + iter: PTreeIter, data: gpointer): gboolean{. + cdecl.} + PTreeModelFlags* = ptr TTreeModelFlags + TTreeModelFlags* = int32 + TTreeIter*{.final, pure.} = object + stamp*: gint + user_data*: gpointer + user_data2*: gpointer + user_data3*: gpointer + + PTreeModelIface* = ptr TTreeModelIface + TTreeModelIface* = object of TGTypeInterface + row_changed*: proc (tree_model: PTreeModel, path: PTreePath, iter: PTreeIter){. + cdecl.} + row_inserted*: proc (tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter){.cdecl.} + row_has_child_toggled*: proc (tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter){.cdecl.} + row_deleted*: proc (tree_model: PTreeModel, path: PTreePath){.cdecl.} + rows_reordered*: proc (tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter, new_order: Pgint){.cdecl.} + get_flags*: proc (tree_model: PTreeModel): TTreeModelFlags{.cdecl.} + get_n_columns*: proc (tree_model: PTreeModel): gint{.cdecl.} + get_column_type*: proc (tree_model: PTreeModel, index: gint): GType{.cdecl.} + get_iter*: proc (tree_model: PTreeModel, iter: PTreeIter, path: PTreePath): gboolean{. + cdecl.} + get_path*: proc (tree_model: PTreeModel, iter: PTreeIter): PTreePath{.cdecl.} + get_value*: proc (tree_model: PTreeModel, iter: PTreeIter, column: gint, + value: PGValue){.cdecl.} + iter_next*: proc (tree_model: PTreeModel, iter: PTreeIter): gboolean{.cdecl.} + iter_children*: proc (tree_model: PTreeModel, iter: PTreeIter, + parent: PTreeIter): gboolean{.cdecl.} + iter_has_child*: proc (tree_model: PTreeModel, iter: PTreeIter): gboolean{. + cdecl.} + iter_n_children*: proc (tree_model: PTreeModel, iter: PTreeIter): gint{. + cdecl.} + iter_nth_child*: proc (tree_model: PTreeModel, iter: PTreeIter, + parent: PTreeIter, n: gint): gboolean{.cdecl.} + iter_parent*: proc (tree_model: PTreeModel, iter: PTreeIter, + child: PTreeIter): gboolean{.cdecl.} + ref_node*: proc (tree_model: PTreeModel, iter: PTreeIter){.cdecl.} + unref_node*: proc (tree_model: PTreeModel, iter: PTreeIter){.cdecl.} + + PTreeSortable* = pointer + TTreeIterCompareFunc* = proc (model: PTreeModel, a: PTreeIter, b: PTreeIter, + user_data: gpointer): gint{.cdecl.} + PTreeSortableIface* = ptr TTreeSortableIface + TTreeSortableIface* = object of TGTypeInterface + sort_column_changed*: proc (sortable: PTreeSortable){.cdecl.} + get_sort_column_id*: proc (sortable: PTreeSortable, sort_column_id: Pgint, + order: PSortType): gboolean{.cdecl.} + set_sort_column_id*: proc (sortable: PTreeSortable, sort_column_id: gint, + order: TSortType){.cdecl.} + set_sort_func*: proc (sortable: PTreeSortable, sort_column_id: gint, + func: TTreeIterCompareFunc, data: gpointer, + destroy: TDestroyNotify){.cdecl.} + set_default_sort_func*: proc (sortable: PTreeSortable, + func: TTreeIterCompareFunc, data: gpointer, + destroy: TDestroyNotify){.cdecl.} + has_default_sort_func*: proc (sortable: PTreeSortable): gboolean{.cdecl.} + + PTreeModelSort* = ptr TTreeModelSort + TTreeModelSort* = object of TGObject + root*: gpointer + stamp*: gint + child_flags*: guint + child_model*: PTreeModel + zero_ref_count*: gint + sort_list*: PGList + sort_column_id*: gint + order*: TSortType + default_sort_func*: TTreeIterCompareFunc + default_sort_data*: gpointer + default_sort_destroy*: TDestroyNotify + changed_id*: guint + inserted_id*: guint + has_child_toggled_id*: guint + deleted_id*: guint + reordered_id*: guint + + PTreeModelSortClass* = ptr TTreeModelSortClass + TTreeModelSortClass* = object of TGObjectClass + reserved491: proc (){.cdecl.} + reserved492: proc (){.cdecl.} + reserved493: proc (){.cdecl.} + reserved494: proc (){.cdecl.} + + PListStore* = ptr TListStore + TListStore* = object of TGObject + stamp*: gint + root*: gpointer + tail*: gpointer + sort_list*: PGList + n_columns*: gint + sort_column_id*: gint + order*: TSortType + column_headers*: PGType + length*: gint + default_sort_func*: TTreeIterCompareFunc + default_sort_data*: gpointer + default_sort_destroy*: TDestroyNotify + ListStore_flag0*: guint16 + + PListStoreClass* = ptr TListStoreClass + TListStoreClass* = object of TGObjectClass + reserved501: proc (){.cdecl.} + reserved502: proc (){.cdecl.} + reserved503: proc (){.cdecl.} + reserved504: proc (){.cdecl.} + + TModuleInitFunc* = proc (argc: Pgint, argv: PPPgchar){.cdecl.} + TKeySnoopFunc* = proc (grab_widget: PWidget, event: PGdkEventKey, + func_data: gpointer): gint{.cdecl.} + PMenuBar* = ptr TMenuBar + TMenuBar* = object of TMenuShell + PMenuBarClass* = ptr TMenuBarClass + TMenuBarClass* = object of TMenuShellClass + reserved511: proc (){.cdecl.} + reserved512: proc (){.cdecl.} + reserved513: proc (){.cdecl.} + reserved514: proc (){.cdecl.} + + PMessageType* = ptr TMessageType + TMessageType* = enum + MESSAGE_INFO, MESSAGE_WARNING, MESSAGE_QUESTION, MESSAGE_ERROR + PButtonsType* = ptr TButtonsType + TButtonsType* = enum + BUTTONS_NONE, BUTTONS_OK, BUTTONS_CLOSE, BUTTONS_CANCEL, BUTTONS_YES_NO, + BUTTONS_OK_CANCEL + PMessageDialog* = ptr TMessageDialog + TMessageDialog* = object of TDialog + image*: PWidget + label*: PWidget + + PMessageDialogClass* = ptr TMessageDialogClass + TMessageDialogClass* = object of TDialogClass + reserved521: proc (){.cdecl.} + reserved522: proc (){.cdecl.} + reserved523: proc (){.cdecl.} + reserved524: proc (){.cdecl.} + + PNotebookPage* = pointer + PNotebookTab* = ptr TNotebookTab + TNotebookTab* = enum + NOTEBOOK_TAB_FIRST, NOTEBOOK_TAB_LAST + PNotebook* = ptr TNotebook + TNotebook* = object of TContainer + cur_page*: PNotebookPage + children*: PGList + first_tab*: PGList + focus_tab*: PGList + menu*: PWidget + event_window*: PGdkWindow + timer*: guint32 + tab_hborder*: guint16 + tab_vborder*: guint16 + Notebook_flag0*: guint16 + + PNotebookClass* = ptr TNotebookClass + TNotebookClass* = object of TContainerClass + switch_page*: proc (notebook: PNotebook, page: PNotebookPage, + page_num: guint){.cdecl.} + select_page*: proc (notebook: PNotebook, move_focus: gboolean): gboolean{. + cdecl.} + focus_tab*: proc (notebook: PNotebook, thetype: TNotebookTab): gboolean{. + cdecl.} + change_current_page*: proc (notebook: PNotebook, offset: gint){.cdecl.} + move_focus_out*: proc (notebook: PNotebook, direction: TDirectionType){. + cdecl.} + reserved531: proc (){.cdecl.} + reserved532: proc (){.cdecl.} + reserved533: proc (){.cdecl.} + reserved534: proc (){.cdecl.} + + POldEditable* = ptr TOldEditable + TOldEditable* = object of TWidget + current_pos*: guint + selection_start_pos*: guint + selection_end_pos*: guint + OldEditable_flag0*: guint16 + clipboard_text*: cstring + + TTextFunction* = proc (editable: POldEditable, time: guint32){.cdecl.} + POldEditableClass* = ptr TOldEditableClass + TOldEditableClass* = object of TWidgetClass + activate*: proc (editable: POldEditable){.cdecl.} + set_editable*: proc (editable: POldEditable, is_editable: gboolean){.cdecl.} + move_cursor*: proc (editable: POldEditable, x: gint, y: gint){.cdecl.} + move_word*: proc (editable: POldEditable, n: gint){.cdecl.} + move_page*: proc (editable: POldEditable, x: gint, y: gint){.cdecl.} + move_to_row*: proc (editable: POldEditable, row: gint){.cdecl.} + move_to_column*: proc (editable: POldEditable, row: gint){.cdecl.} + kill_char*: proc (editable: POldEditable, direction: gint){.cdecl.} + kill_word*: proc (editable: POldEditable, direction: gint){.cdecl.} + kill_line*: proc (editable: POldEditable, direction: gint){.cdecl.} + cut_clipboard*: proc (editable: POldEditable){.cdecl.} + copy_clipboard*: proc (editable: POldEditable){.cdecl.} + paste_clipboard*: proc (editable: POldEditable){.cdecl.} + update_text*: proc (editable: POldEditable, start_pos: gint, end_pos: gint){. + cdecl.} + get_chars*: proc (editable: POldEditable, start_pos: gint, end_pos: gint): cstring{. + cdecl.} + set_selection*: proc (editable: POldEditable, start_pos: gint, end_pos: gint){. + cdecl.} + set_position*: proc (editable: POldEditable, position: gint){.cdecl.} + + POptionMenu* = ptr TOptionMenu + TOptionMenu* = object of TButton + menu*: PWidget + menu_item*: PWidget + width*: guint16 + height*: guint16 + + POptionMenuClass* = ptr TOptionMenuClass + TOptionMenuClass* = object of TButtonClass + changed*: proc (option_menu: POptionMenu){.cdecl.} + reserved541: proc (){.cdecl.} + reserved542: proc (){.cdecl.} + reserved543: proc (){.cdecl.} + reserved544: proc (){.cdecl.} + + PPixmap* = ptr TPixmap + TPixmap* = object of TMisc + pixmap*: PGdkPixmap + mask*: PGdkBitmap + pixmap_insensitive*: PGdkPixmap + Pixmap_flag0*: guint16 + + PPixmapClass* = ptr TPixmapClass + TPixmapClass* = object of TMiscClass + PPlug* = ptr TPlug + TPlug* = object of TWindow + socket_window*: PGdkWindow + modality_window*: PWidget + modality_group*: PWindowGroup + grabbed_keys*: PGHashTable + Plug_flag0*: guint16 + + PPlugClass* = ptr TPlugClass + TPlugClass* = object of TWindowClass + embedded*: proc (plug: PPlug){.cdecl.} + reserved551: proc (){.cdecl.} + reserved552: proc (){.cdecl.} + reserved553: proc (){.cdecl.} + reserved554: proc (){.cdecl.} + + PPreview* = ptr TPreview + TPreview* = object of TWidget + buffer*: Pguchar + buffer_width*: guint16 + buffer_height*: guint16 + bpp*: guint16 + rowstride*: guint16 + dither*: TGdkRgbDither + Preview_flag0*: guint16 + + PPreviewInfo* = ptr TPreviewInfo + TPreviewInfo*{.final, pure.} = object + lookup*: Pguchar + gamma*: gdouble + + PDitherInfo* = ptr TDitherInfo + TDitherInfo*{.final, pure.} = object + c*: array[0..3, guchar] + + PPreviewClass* = ptr TPreviewClass + TPreviewClass* = object of TWidgetClass + info*: TPreviewInfo + + PProgress* = ptr TProgress + TProgress* = object of TWidget + adjustment*: PAdjustment + offscreen_pixmap*: PGdkPixmap + format*: cstring + x_align*: gfloat + y_align*: gfloat + Progress_flag0*: guint16 + + PProgressClass* = ptr TProgressClass + TProgressClass* = object of TWidgetClass + paint*: proc (progress: PProgress){.cdecl.} + update*: proc (progress: PProgress){.cdecl.} + act_mode_enter*: proc (progress: PProgress){.cdecl.} + reserved561: proc (){.cdecl.} + reserved562: proc (){.cdecl.} + reserved563: proc (){.cdecl.} + reserved564: proc (){.cdecl.} + + PProgressBarStyle* = ptr TProgressBarStyle + TProgressBarStyle* = enum + PROGRESS_CONTINUOUS, PROGRESS_DISCRETE + PProgressBarOrientation* = ptr TProgressBarOrientation + TProgressBarOrientation* = enum + PROGRESS_LEFT_TO_RIGHT, PROGRESS_RIGHT_TO_LEFT, PROGRESS_BOTTOM_TO_TOP, + PROGRESS_TOP_TO_BOTTOM + PProgressBar* = ptr TProgressBar + TProgressBar* = object of TProgress + bar_style*: TProgressBarStyle + orientation*: TProgressBarOrientation + blocks*: guint + in_block*: gint + activity_pos*: gint + activity_step*: guint + activity_blocks*: guint + pulse_fraction*: gdouble + ProgressBar_flag0*: guint16 + + PProgressBarClass* = ptr TProgressBarClass + TProgressBarClass* = object of TProgressClass + reserved571: proc (){.cdecl.} + reserved572: proc (){.cdecl.} + reserved573: proc (){.cdecl.} + reserved574: proc (){.cdecl.} + + PRadioButton* = ptr TRadioButton + TRadioButton* = object of TCheckButton + group*: PGSList + + PRadioButtonClass* = ptr TRadioButtonClass + TRadioButtonClass* = object of TCheckButtonClass + reserved581: proc (){.cdecl.} + reserved582: proc (){.cdecl.} + reserved583: proc (){.cdecl.} + reserved584: proc (){.cdecl.} + + PRadioMenuItem* = ptr TRadioMenuItem + TRadioMenuItem* = object of TCheckMenuItem + group*: PGSList + + PRadioMenuItemClass* = ptr TRadioMenuItemClass + TRadioMenuItemClass* = object of TCheckMenuItemClass + reserved591: proc (){.cdecl.} + reserved592: proc (){.cdecl.} + reserved593: proc (){.cdecl.} + reserved594: proc (){.cdecl.} + + PScrolledWindow* = ptr TScrolledWindow + TScrolledWindow* = object of TBin + hscrollbar*: PWidget + vscrollbar*: PWidget + ScrolledWindow_flag0*: guint16 + shadow_type*: guint16 + + PScrolledWindowClass* = ptr TScrolledWindowClass + TScrolledWindowClass* = object of TBinClass + scrollbar_spacing*: gint + scroll_child*: proc (scrolled_window: PScrolledWindow, scroll: TScrollType, + horizontal: gboolean){.cdecl.} + move_focus_out*: proc (scrolled_window: PScrolledWindow, + direction: TDirectionType){.cdecl.} + reserved601: proc (){.cdecl.} + reserved602: proc (){.cdecl.} + reserved603: proc (){.cdecl.} + reserved604: proc (){.cdecl.} + + TSelectionData*{.final, pure.} = object + selection*: TGdkAtom + target*: TGdkAtom + thetype*: TGdkAtom + format*: gint + data*: Pguchar + length*: gint + display*: PGdkDisplay + + PTargetEntry* = ptr TTargetEntry + TTargetEntry*{.final, pure.} = object + target*: cstring + flags*: guint + info*: guint + + PTargetList* = ptr TTargetList + TTargetList*{.final, pure.} = object + list*: PGList + ref_count*: guint + + PTargetPair* = ptr TTargetPair + TTargetPair*{.final, pure.} = object + target*: TGdkAtom + flags*: guint + info*: guint + + PSeparatorMenuItem* = ptr TSeparatorMenuItem + TSeparatorMenuItem* = object of TMenuItem + PSeparatorMenuItemClass* = ptr TSeparatorMenuItemClass + TSeparatorMenuItemClass* = object of TMenuItemClass + PSizeGroup* = ptr TSizeGroup + TSizeGroup* = object of TGObject + widgets*: PGSList + mode*: guint8 + SizeGroup_flag0*: guint16 + requisition*: TRequisition + + PSizeGroupClass* = ptr TSizeGroupClass + TSizeGroupClass* = object of TGObjectClass + reserved611: proc (){.cdecl.} + reserved612: proc (){.cdecl.} + reserved613: proc (){.cdecl.} + reserved614: proc (){.cdecl.} + + PSizeGroupMode* = ptr TSizeGroupMode + TSizeGroupMode* = enum + SIZE_GROUP_NONE, SIZE_GROUP_HORIZONTAL, SIZE_GROUP_VERTICAL, SIZE_GROUP_BOTH + PSocket* = ptr TSocket + TSocket* = object of TContainer + request_width*: guint16 + request_height*: guint16 + current_width*: guint16 + current_height*: guint16 + plug_window*: PGdkWindow + plug_widget*: PWidget + xembed_version*: gshort + Socket_flag0*: guint16 + accel_group*: PAccelGroup + toplevel*: PWidget + + PSocketClass* = ptr TSocketClass + TSocketClass* = object of TContainerClass + plug_added*: proc (socket: PSocket){.cdecl.} + plug_removed*: proc (socket: PSocket): gboolean{.cdecl.} + reserved621: proc (){.cdecl.} + reserved622: proc (){.cdecl.} + reserved623: proc (){.cdecl.} + reserved624: proc (){.cdecl.} + + PSpinButtonUpdatePolicy* = ptr TSpinButtonUpdatePolicy + TSpinButtonUpdatePolicy* = enum + UPDATE_ALWAYS, UPDATE_IF_VALID + PSpinType* = ptr TSpinType + TSpinType* = enum + SPIN_STEP_FORWARD, SPIN_STEP_BACKWARD, SPIN_PAGE_FORWARD, + SPIN_PAGE_BACKWARD, SPIN_HOME, SPIN_END, SPIN_USER_DEFINED + PSpinButton* = ptr TSpinButton + TSpinButton* = object of TEntry + adjustment*: PAdjustment + panel*: PGdkWindow + timer*: guint32 + climb_rate*: gdouble + timer_step*: gdouble + update_policy*: TSpinButtonUpdatePolicy + SpinButton_flag0*: int32 + + PSpinButtonClass* = ptr TSpinButtonClass + TSpinButtonClass* = object of TEntryClass + input*: proc (spin_button: PSpinButton, new_value: Pgdouble): gint{.cdecl.} + output*: proc (spin_button: PSpinButton): gint{.cdecl.} + value_changed*: proc (spin_button: PSpinButton){.cdecl.} + change_value*: proc (spin_button: PSpinButton, scroll: TScrollType){.cdecl.} + reserved631: proc (){.cdecl.} + reserved632: proc (){.cdecl.} + reserved633: proc (){.cdecl.} + reserved634: proc (){.cdecl.} + + PStockItem* = ptr TStockItem + TStockItem*{.final, pure.} = object + stock_id*: cstring + label*: cstring + modifier*: TGdkModifierType + keyval*: guint + translation_domain*: cstring + + PStatusbar* = ptr TStatusbar + TStatusbar* = object of THBox + frame*: PWidget + `label`*: PWidget + messages*: PGSList + keys*: PGSList + seq_context_id*: guint + seq_message_id*: guint + grip_window*: PGdkWindow + Statusbar_flag0*: guint16 + + PStatusbarClass* = ptr TStatusbarClass + TStatusbarClass* = object of THBoxClass + messages_mem_chunk*: PGMemChunk + text_pushed*: proc (statusbar: PStatusbar, context_id: guint, text: cstring){. + cdecl.} + text_popped*: proc (statusbar: PStatusbar, context_id: guint, text: cstring){. + cdecl.} + reserved641: proc (){.cdecl.} + reserved642: proc (){.cdecl.} + reserved643: proc (){.cdecl.} + reserved644: proc (){.cdecl.} + + PTableRowCol* = ptr TTableRowCol + PTable* = ptr TTable + TTable* = object of TContainer + children*: PGList + rows*: PTableRowCol + cols*: PTableRowCol + nrows*: guint16 + ncols*: guint16 + column_spacing*: guint16 + row_spacing*: guint16 + Table_flag0*: guint16 + + PTableClass* = ptr TTableClass + TTableClass* = object of TContainerClass + PTableChild* = ptr TTableChild + TTableChild*{.final, pure.} = object + widget*: PWidget + left_attach*: guint16 + right_attach*: guint16 + top_attach*: guint16 + bottom_attach*: guint16 + xpadding*: guint16 + ypadding*: guint16 + TableChild_flag0*: guint16 + + TTableRowCol*{.final, pure.} = object + requisition*: guint16 + allocation*: guint16 + spacing*: guint16 + flag0*: guint16 + + PTearoffMenuItem* = ptr TTearoffMenuItem + TTearoffMenuItem* = object of TMenuItem + TearoffMenuItem_flag0*: guint16 + + PTearoffMenuItemClass* = ptr TTearoffMenuItemClass + TTearoffMenuItemClass* = object of TMenuItemClass + reserved651: proc (){.cdecl.} + reserved652: proc (){.cdecl.} + reserved653: proc (){.cdecl.} + reserved654: proc (){.cdecl.} + + PTextFont* = pointer + PPropertyMark* = ptr TPropertyMark + TPropertyMark*{.final, pure.} = object + `property`*: PGList + offset*: guint + index*: guint + + PText* = ptr TText + TText* = object of TOldEditable + text_area*: PGdkWindow + hadj*: PAdjustment + vadj*: PAdjustment + gc*: PGdkGC + line_wrap_bitmap*: PGdkPixmap + line_arrow_bitmap*: PGdkPixmap + text*: Pguchar + text_len*: guint + gap_position*: guint + gap_size*: guint + text_end*: guint + line_start_cache*: PGList + first_line_start_index*: guint + first_cut_pixels*: guint + first_onscreen_hor_pixel*: guint + first_onscreen_ver_pixel*: guint + Text_flag0*: guint16 + freeze_count*: guint + text_properties*: PGList + text_properties_end*: PGList + point*: TPropertyMark + scratch_buffer*: Pguchar + scratch_buffer_len*: guint + last_ver_value*: gint + cursor_pos_x*: gint + cursor_pos_y*: gint + cursor_mark*: TPropertyMark + cursor_char*: TGdkWChar + cursor_char_offset*: gchar + cursor_virtual_x*: gint + cursor_drawn_level*: gint + current_line*: PGList + tab_stops*: PGList + default_tab_width*: gint + current_font*: PTextFont + timer*: gint + button*: guint + bg_gc*: PGdkGC + + PTextClass* = ptr TTextClass + TTextClass* = object of TOldEditableClass + set_scroll_adjustments*: proc (text: PText, hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + + PTextSearchFlags* = ptr TTextSearchFlags + TTextSearchFlags* = int32 + PTextIter* = ptr TTextIter + TTextIter*{.final, pure.} = object + dummy1*: gpointer + dummy2*: gpointer + dummy3*: gint + dummy4*: gint + dummy5*: gint + dummy6*: gint + dummy7*: gint + dummy8*: gint + dummy9*: gpointer + dummy10*: gpointer + dummy11*: gint + dummy12*: gint + dummy13*: gint + dummy14*: gpointer + + TTextCharPredicate* = proc (ch: gunichar, user_data: gpointer): gboolean{. + cdecl.} + PTextTagClass* = ptr TTextTagClass + PTextAttributes* = ptr TTextAttributes + PTextTag* = ptr TTextTag + PPGtkTextTag* = ptr PTextTag + TTextTag* = object of TGObject + table*: PTextTagTable + name*: cstring + priority*: int32 + values*: PTextAttributes + TextTag_flag0*: int32 + + TTextTagClass* = object of TGObjectClass + event*: proc (tag: PTextTag, event_object: PGObject, event: PGdkEvent, + iter: PTextIter): gboolean{.cdecl.} + reserved661: proc (){.cdecl.} + reserved662: proc (){.cdecl.} + reserved663: proc (){.cdecl.} + reserved664: proc (){.cdecl.} + + PTextAppearance* = ptr TTextAppearance + TTextAppearance*{.final, pure.} = object + bg_color*: TGdkColor + fg_color*: TGdkColor + bg_stipple*: PGdkBitmap + fg_stipple*: PGdkBitmap + rise*: gint + padding1*: gpointer + flag0*: guint16 + + TTextAttributes*{.final, pure.} = object + refcount*: guint + appearance*: TTextAppearance + justification*: TJustification + direction*: TTextDirection + font*: PPangoFontDescription + font_scale*: gdouble + left_margin*: gint + indent*: gint + right_margin*: gint + pixels_above_lines*: gint + pixels_below_lines*: gint + pixels_inside_wrap*: gint + tabs*: PPangoTabArray + wrap_mode*: TWrapMode + language*: PPangoLanguage + padding1*: gpointer + flag0*: guint16 + + TTextTagTableForeach* = proc (tag: PTextTag, data: gpointer){.cdecl.} + TTextTagTable* = object of TGObject + hash*: PGHashTable + anonymous*: PGSList + anon_count*: gint + buffers*: PGSList + + PTextTagTableClass* = ptr TTextTagTableClass + TTextTagTableClass* = object of TGObjectClass + tag_changed*: proc (table: PTextTagTable, tag: PTextTag, + size_changed: gboolean){.cdecl.} + tag_added*: proc (table: PTextTagTable, tag: PTextTag){.cdecl.} + tag_removed*: proc (table: PTextTagTable, tag: PTextTag){.cdecl.} + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PTextMark* = ptr TTextMark + TTextMark* = object of TGObject + segment*: gpointer + + PTextMarkClass* = ptr TTextMarkClass + TTextMarkClass* = object of TGObjectClass + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PTextMarkBody* = ptr TTextMarkBody + TTextMarkBody*{.final, pure.} = object + obj*: PTextMark + name*: cstring + tree*: PTextBTree + line*: PTextLine + flag0*: guint16 + + PTextChildAnchor* = ptr TTextChildAnchor + TTextChildAnchor* = object of TGObject + segment*: gpointer + + PTextChildAnchorClass* = ptr TTextChildAnchorClass + TTextChildAnchorClass* = object of TGObjectClass + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PTextPixbuf* = ptr TTextPixbuf + TTextPixbuf*{.final, pure.} = object + pixbuf*: PGdkPixbuf + + PTextChildBody* = ptr TTextChildBody + TTextChildBody*{.final, pure.} = object + obj*: PTextChildAnchor + widgets*: PGSList + tree*: PTextBTree + line*: PTextLine + + PTextLineSegment* = ptr TTextLineSegment + PTextLineSegmentClass* = ptr TTextLineSegmentClass + PTextTagInfo* = ptr TTextTagInfo + TTextTagInfo*{.final, pure.} = object + tag*: PTextTag + tag_root*: PTextBTreeNode + toggle_count*: gint + + PTextToggleBody* = ptr TTextToggleBody + TTextToggleBody*{.final, pure.} = object + info*: PTextTagInfo + inNodeCounts*: gboolean + + TTextLineSegment*{.final, pure.} = object + `type`*: PTextLineSegmentClass + next*: PTextLineSegment + char_count*: int32 + byte_count*: int32 + body*: TTextChildBody + + PTextSegSplitFunc* = ptr TTextSegSplitFunc + TTextSegSplitFunc* = TTextLineSegment + TTextSegDeleteFunc* = proc (seg: PTextLineSegment, line: PTextLine, + tree_gone: gboolean): gboolean{.cdecl.} + PTextSegCleanupFunc* = ptr TTextSegCleanupFunc + TTextSegCleanupFunc* = TTextLineSegment + TTextSegLineChangeFunc* = proc (seg: PTextLineSegment, line: PTextLine){.cdecl.} + TTextSegCheckFunc* = proc (seg: PTextLineSegment, line: PTextLine){.cdecl.} + TTextLineSegmentClass*{.final, pure.} = object + name*: cstring + leftGravity*: gboolean + splitFunc*: TTextSegSplitFunc + deleteFunc*: TTextSegDeleteFunc + cleanupFunc*: TTextSegCleanupFunc + lineChangeFunc*: TTextSegLineChangeFunc + checkFunc*: TTextSegCheckFunc + + PTextLineData* = ptr TTextLineData + TTextLineData*{.final, pure.} = object + view_id*: gpointer + next*: PTextLineData + height*: gint + flag0*: int32 + + TTextLine*{.final, pure.} = object + parent*: PTextBTreeNode + next*: PTextLine + segments*: PTextLineSegment + views*: PTextLineData + + PTextLogAttrCache* = pointer + PTextBuffer* = ptr TTextBuffer + TTextBuffer* = object of TGObject + tag_table*: PTextTagTable + btree*: PTextBTree + clipboard_contents_buffers*: PGSList + selection_clipboards*: PGSList + log_attr_cache*: PTextLogAttrCache + user_action_count*: guint + TextBuffer_flag0*: guint16 + + PTextBufferClass* = ptr TTextBufferClass + TTextBufferClass* = object of TGObjectClass + insert_text*: proc (buffer: PTextBuffer, pos: PTextIter, text: cstring, + length: gint){.cdecl.} + insert_pixbuf*: proc (buffer: PTextBuffer, pos: PTextIter, + pixbuf: PGdkPixbuf){.cdecl.} + insert_child_anchor*: proc (buffer: PTextBuffer, pos: PTextIter, + anchor: PTextChildAnchor){.cdecl.} + delete_range*: proc (buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter){.cdecl.} + changed*: proc (buffer: PTextBuffer){.cdecl.} + modified_changed*: proc (buffer: PTextBuffer){.cdecl.} + mark_set*: proc (buffer: PTextBuffer, location: PTextIter, mark: PTextMark){. + cdecl.} + mark_deleted*: proc (buffer: PTextBuffer, mark: PTextMark){.cdecl.} + apply_tag*: proc (buffer: PTextBuffer, tag: PTextTag, start_char: PTextIter, + end_char: PTextIter){.cdecl.} + remove_tag*: proc (buffer: PTextBuffer, tag: PTextTag, + start_char: PTextIter, end_char: PTextIter){.cdecl.} + begin_user_action*: proc (buffer: PTextBuffer){.cdecl.} + end_user_action*: proc (buffer: PTextBuffer){.cdecl.} + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + reserved5: proc (){.cdecl.} + reserved6: proc (){.cdecl.} + + PTextLineDisplay* = ptr TTextLineDisplay + PTextLayout* = ptr TTextLayout + TTextLayout* = object of TGObject + screen_width*: gint + width*: gint + height*: gint + buffer*: PTextBuffer + default_style*: PTextAttributes + ltr_context*: PPangoContext + rtl_context*: PPangoContext + one_style_cache*: PTextAttributes + one_display_cache*: PTextLineDisplay + wrap_loop_count*: gint + TextLayout_flag0*: guint16 + preedit_string*: cstring + preedit_attrs*: PPangoAttrList + preedit_len*: gint + preedit_cursor*: gint + + PTextLayoutClass* = ptr TTextLayoutClass + TTextLayoutClass* = object of TGObjectClass + invalidated*: proc (layout: PTextLayout){.cdecl.} + changed*: proc (layout: PTextLayout, y: gint, old_height: gint, + new_height: gint){.cdecl.} + wrap*: proc (layout: PTextLayout, line: PTextLine, line_data: PTextLineData): PTextLineData{. + cdecl.} + get_log_attrs*: proc (layout: PTextLayout, line: PTextLine, + attrs: var PPangoLogAttr, n_attrs: Pgint){.cdecl.} + invalidate*: proc (layout: PTextLayout, start: PTextIter, theEnd: PTextIter){. + cdecl.} + free_line_data*: proc (layout: PTextLayout, line: PTextLine, + line_data: PTextLineData){.cdecl.} + allocate_child*: proc (layout: PTextLayout, child: PWidget, x: gint, y: gint){. + cdecl.} + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PTextAttrAppearance* = ptr TTextAttrAppearance + TTextAttrAppearance*{.final, pure.} = object + attr*: TPangoAttribute + appearance*: TTextAppearance + + PTextCursorDisplay* = ptr TTextCursorDisplay + TTextCursorDisplay*{.final, pure.} = object + x*: gint + y*: gint + height*: gint + flag0*: guint16 + + TTextLineDisplay*{.final, pure.} = object + layout*: PPangoLayout + cursors*: PGSList + shaped_objects*: PGSList + direction*: TTextDirection + width*: gint + total_width*: gint + height*: gint + x_offset*: gint + left_margin*: gint + right_margin*: gint + top_margin*: gint + bottom_margin*: gint + insert_index*: gint + size_only*: gboolean + line*: PTextLine + + PTextWindow* = pointer + PTextPendingScroll* = pointer + PTextWindowType* = ptr TTextWindowType + TTextWindowType* = enum + TEXT_WINDOW_PRIVATE, TEXT_WINDOW_WIDGET, TEXT_WINDOW_TEXT, TEXT_WINDOW_LEFT, + TEXT_WINDOW_RIGHT, TEXT_WINDOW_TOP, TEXT_WINDOW_BOTTOM + PTextView* = ptr TTextView + TTextView* = object of TContainer + layout*: PTextLayout + buffer*: PTextBuffer + selection_drag_handler*: guint + scroll_timeout*: guint + pixels_above_lines*: gint + pixels_below_lines*: gint + pixels_inside_wrap*: gint + wrap_mode*: TWrapMode + justify*: TJustification + left_margin*: gint + right_margin*: gint + indent*: gint + tabs*: PPangoTabArray + TextView_flag0*: guint16 + text_window*: PTextWindow + left_window*: PTextWindow + right_window*: PTextWindow + top_window*: PTextWindow + bottom_window*: PTextWindow + hadjustment*: PAdjustment + vadjustment*: PAdjustment + xoffset*: gint + yoffset*: gint + width*: gint + height*: gint + virtual_cursor_x*: gint + virtual_cursor_y*: gint + first_para_mark*: PTextMark + first_para_pixels*: gint + dnd_mark*: PTextMark + blink_timeout*: guint + first_validate_idle*: guint + incremental_validate_idle*: guint + im_context*: PIMContext + popup_menu*: PWidget + drag_start_x*: gint + drag_start_y*: gint + children*: PGSList + pending_scroll*: PTextPendingScroll + pending_place_cursor_button*: gint + + PTextViewClass* = ptr TTextViewClass + TTextViewClass* = object of TContainerClass + set_scroll_adjustments*: proc (text_view: PTextView, + hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + populate_popup*: proc (text_view: PTextView, menu: PMenu){.cdecl.} + move_cursor*: proc (text_view: PTextView, step: TMovementStep, count: gint, + extend_selection: gboolean){.cdecl.} + page_horizontally*: proc (text_view: PTextView, count: gint, + extend_selection: gboolean){.cdecl.} + set_anchor*: proc (text_view: PTextView){.cdecl.} + insert_at_cursor*: proc (text_view: PTextView, str: cstring){.cdecl.} + delete_from_cursor*: proc (text_view: PTextView, thetype: TDeleteType, + count: gint){.cdecl.} + cut_clipboard*: proc (text_view: PTextView){.cdecl.} + copy_clipboard*: proc (text_view: PTextView){.cdecl.} + paste_clipboard*: proc (text_view: PTextView){.cdecl.} + toggle_overwrite*: proc (text_view: PTextView){.cdecl.} + move_focus*: proc (text_view: PTextView, direction: TDirectionType){.cdecl.} + reserved711: proc (){.cdecl.} + reserved712: proc (){.cdecl.} + reserved713: proc (){.cdecl.} + reserved714: proc (){.cdecl.} + reserved715: proc (){.cdecl.} + reserved716: proc (){.cdecl.} + reserved717: proc (){.cdecl.} + reserved718: proc (){.cdecl.} + + PTipsQuery* = ptr TTipsQuery + TTipsQuery* = object of TLabel + TipsQuery_flag0*: guint16 + label_inactive*: cstring + label_no_tip*: cstring + caller*: PWidget + last_crossed*: PWidget + query_cursor*: PGdkCursor + + PTipsQueryClass* = ptr TTipsQueryClass + TTipsQueryClass* = object of TLabelClass + start_query*: proc (tips_query: PTipsQuery){.cdecl.} + stop_query*: proc (tips_query: PTipsQuery){.cdecl.} + widget_entered*: proc (tips_query: PTipsQuery, widget: PWidget, + tip_text: cstring, tip_private: cstring){.cdecl.} + widget_selected*: proc (tips_query: PTipsQuery, widget: PWidget, + tip_text: cstring, tip_private: cstring, + event: PGdkEventButton): gint{.cdecl.} + reserved721: proc (){.cdecl.} + reserved722: proc (){.cdecl.} + reserved723: proc (){.cdecl.} + reserved724: proc (){.cdecl.} + + PTooltips* = ptr TTooltips + PTooltipsData* = ptr TTooltipsData + TTooltipsData*{.final, pure.} = object + tooltips*: PTooltips + widget*: PWidget + tip_text*: cstring + tip_private*: cstring + + TTooltips* = object of TObject + tip_window*: PWidget + tip_label*: PWidget + active_tips_data*: PTooltipsData + tips_data_list*: PGList + Tooltips_flag0*: int32 + flag1*: guint16 + timer_tag*: gint + last_popdown*: TGTimeVal + + PTooltipsClass* = ptr TTooltipsClass + TTooltipsClass* = object of TObjectClass + reserved1: proc (){.cdecl.} + reserved2: proc (){.cdecl.} + reserved3: proc (){.cdecl.} + reserved4: proc (){.cdecl.} + + PToolbarChildType* = ptr TToolbarChildType + TToolbarChildType* = enum + TOOLBAR_CHILD_SPACE, TOOLBAR_CHILD_BUTTON, TOOLBAR_CHILD_TOGGLEBUTTON, + TOOLBAR_CHILD_RADIOBUTTON, TOOLBAR_CHILD_WIDGET + PToolbarSpaceStyle* = ptr TToolbarSpaceStyle + TToolbarSpaceStyle* = enum + TOOLBAR_SPACE_EMPTY, TOOLBAR_SPACE_LINE + PToolbarChild* = ptr TToolbarChild + TToolbarChild*{.final, pure.} = object + `type`*: TToolbarChildType + widget*: PWidget + icon*: PWidget + label*: PWidget + + PToolbar* = ptr TToolbar + TToolbar* = object of TContainer + num_children*: gint + children*: PGList + orientation*: TOrientation + Toolbar_style*: TToolbarStyle + icon_size*: TIconSize + tooltips*: PTooltips + button_maxw*: gint + button_maxh*: gint + style_set_connection*: guint + icon_size_connection*: guint + Toolbar_flag0*: guint16 + + PToolbarClass* = ptr TToolbarClass + TToolbarClass* = object of TContainerClass + orientation_changed*: proc (toolbar: PToolbar, orientation: TOrientation){. + cdecl.} + style_changed*: proc (toolbar: PToolbar, style: TToolbarStyle){.cdecl.} + reserved731: proc (){.cdecl.} + reserved732: proc (){.cdecl.} + reserved733: proc (){.cdecl.} + reserved734: proc (){.cdecl.} + + PTreeViewMode* = ptr TTreeViewMode + TTreeViewMode* = enum + TREE_VIEW_LINE, TREE_VIEW_ITEM + PTree* = ptr TTree + TTree* = object of TContainer + children*: PGList + root_tree*: PTree + tree_owner*: PWidget + selection*: PGList + level*: guint + indent_value*: guint + current_indent*: guint + Tree_flag0*: guint16 + + PTreeClass* = ptr TTreeClass + TTreeClass* = object of TContainerClass + selection_changed*: proc (tree: PTree){.cdecl.} + select_child*: proc (tree: PTree, child: PWidget){.cdecl.} + unselect_child*: proc (tree: PTree, child: PWidget){.cdecl.} + + PTreeDragSource* = pointer + PTreeDragDest* = pointer + PTreeDragSourceIface* = ptr TTreeDragSourceIface + TTreeDragSourceIface* = object of TGTypeInterface + row_draggable*: proc (drag_source: PTreeDragSource, path: PTreePath): gboolean{. + cdecl.} + drag_data_get*: proc (drag_source: PTreeDragSource, path: PTreePath, + selection_data: PSelectionData): gboolean{.cdecl.} + drag_data_delete*: proc (drag_source: PTreeDragSource, path: PTreePath): gboolean{. + cdecl.} + + PTreeDragDestIface* = ptr TTreeDragDestIface + TTreeDragDestIface* = object of TGTypeInterface + drag_data_received*: proc (drag_dest: PTreeDragDest, dest: PTreePath, + selection_data: PSelectionData): gboolean{.cdecl.} + row_drop_possible*: proc (drag_dest: PTreeDragDest, dest_path: PTreePath, + selection_data: PSelectionData): gboolean{.cdecl.} + + PTreeItem* = ptr TTreeItem + TTreeItem* = object of TItem + subtree*: PWidget + pixmaps_box*: PWidget + plus_pix_widget*: PWidget + minus_pix_widget*: PWidget + pixmaps*: PGList + TreeItem_flag0*: guint16 + + PTreeItemClass* = ptr TTreeItemClass + TTreeItemClass* = object of TItemClass + expand*: proc (tree_item: PTreeItem){.cdecl.} + collapse*: proc (tree_item: PTreeItem){.cdecl.} + + PTreeSelection* = ptr TTreeSelection + TTreeSelectionFunc* = proc (selection: PTreeSelection, model: PTreeModel, + path: PTreePath, + path_currently_selected: gboolean, data: gpointer): gboolean{. + cdecl.} + TTreeSelectionForeachFunc* = proc (model: PTreeModel, path: PTreePath, + iter: PTreeIter, data: gpointer){.cdecl.} + TTreeSelection* = object of TGObject + tree_view*: PTreeView + thetype*: TSelectionMode + user_func*: TTreeSelectionFunc + user_data*: gpointer + destroy*: TDestroyNotify + + PTreeSelectionClass* = ptr TTreeSelectionClass + TTreeSelectionClass* = object of TGObjectClass + changed*: proc (selection: PTreeSelection){.cdecl.} + reserved741: proc (){.cdecl.} + reserved742: proc (){.cdecl.} + reserved743: proc (){.cdecl.} + reserved744: proc (){.cdecl.} + + PTreeStore* = ptr TTreeStore + TTreeStore* = object of TGObject + stamp*: gint + root*: gpointer + last*: gpointer + n_columns*: gint + sort_column_id*: gint + sort_list*: PGList + order*: TSortType + column_headers*: PGType + default_sort_func*: TTreeIterCompareFunc + default_sort_data*: gpointer + default_sort_destroy*: TDestroyNotify + TreeStore_flag0*: guint16 + + PTreeStoreClass* = ptr TTreeStoreClass + TTreeStoreClass* = object of TGObjectClass + reserved751: proc (){.cdecl.} + reserved752: proc (){.cdecl.} + reserved753: proc (){.cdecl.} + reserved754: proc (){.cdecl.} + + PTreeViewColumnSizing* = ptr TTreeViewColumnSizing + TTreeViewColumnSizing* = enum + TREE_VIEW_COLUMN_GROW_ONLY, TREE_VIEW_COLUMN_AUTOSIZE, + TREE_VIEW_COLUMN_FIXED + TTreeCellDataFunc* = proc (tree_column: PTreeViewColumn, cell: PCellRenderer, + tree_model: PTreeModel, iter: PTreeIter, + data: gpointer){.cdecl.} + TTreeViewColumn* = object of TObject + tree_view*: PWidget + button*: PWidget + child*: PWidget + arrow*: PWidget + alignment*: PWidget + window*: PGdkWindow + editable_widget*: PCellEditable + xalign*: gfloat + property_changed_signal*: guint + spacing*: gint + column_type*: TTreeViewColumnSizing + requested_width*: gint + button_request*: gint + resized_width*: gint + width*: gint + fixed_width*: gint + min_width*: gint + max_width*: gint + drag_x*: gint + drag_y*: gint + title*: cstring + cell_list*: PGList + sort_clicked_signal*: guint + sort_column_changed_signal*: guint + sort_column_id*: gint + sort_order*: TSortType + TreeViewColumn_flag0*: guint16 + + PTreeViewColumnClass* = ptr TTreeViewColumnClass + TTreeViewColumnClass* = object of TObjectClass + clicked*: proc (tree_column: PTreeViewColumn){.cdecl.} + reserved751: proc (){.cdecl.} + reserved752: proc (){.cdecl.} + reserved753: proc (){.cdecl.} + reserved754: proc (){.cdecl.} + + PRBNodeColor* = ptr TRBNodeColor + TRBNodeColor* = int32 + PRBTree* = ptr TRBTree + PRBNode* = ptr TRBNode + TRBTreeTraverseFunc* = proc (tree: PRBTree, node: PRBNode, data: gpointer){. + cdecl.} + TRBTree*{.final, pure.} = object + root*: PRBNode + `nil`*: PRBNode + parent_tree*: PRBTree + parent_node*: PRBNode + + TRBNode*{.final, pure.} = object + flag0*: guint16 + left*: PRBNode + right*: PRBNode + parent*: PRBNode + count*: gint + offset*: gint + children*: PRBTree + + PTreeRowReference* = pointer + PTreeViewFlags* = ptr TTreeViewFlags + TTreeViewFlags* = int32 + TTreeViewSearchDialogPositionFunc* = proc (tree_view: PTreeView, + search_dialog: PWidget){.cdecl.} + PTreeViewColumnReorder* = ptr TTreeViewColumnReorder + TTreeViewColumnReorder*{.final, pure.} = object + left_align*: gint + right_align*: gint + left_column*: PTreeViewColumn + right_column*: PTreeViewColumn + + PTreeViewPrivate* = ptr TTreeViewPrivate + TTreeViewPrivate*{.final, pure.} = object + model*: PTreeModel + flags*: guint + tree*: PRBTree + button_pressed_node*: PRBNode + button_pressed_tree*: PRBTree + children*: PGList + width*: gint + height*: gint + expander_size*: gint + hadjustment*: PAdjustment + vadjustment*: PAdjustment + bin_window*: PGdkWindow + header_window*: PGdkWindow + drag_window*: PGdkWindow + drag_highlight_window*: PGdkWindow + drag_column*: PTreeViewColumn + last_button_press*: PTreeRowReference + last_button_press_2*: PTreeRowReference + top_row*: PTreeRowReference + top_row_dy*: gint + dy*: gint + drag_column_x*: gint + expander_column*: PTreeViewColumn + edited_column*: PTreeViewColumn + presize_handler_timer*: guint + validate_rows_timer*: guint + scroll_sync_timer*: guint + focus_column*: PTreeViewColumn + anchor*: PTreeRowReference + cursor*: PTreeRowReference + drag_pos*: gint + x_drag*: gint + prelight_node*: PRBNode + prelight_tree*: PRBTree + expanded_collapsed_node*: PRBNode + expanded_collapsed_tree*: PRBTree + expand_collapse_timeout*: guint + selection*: PTreeSelection + n_columns*: gint + columns*: PGList + header_height*: gint + column_drop_func*: TTreeViewColumnDropFunc + column_drop_func_data*: gpointer + column_drop_func_data_destroy*: TDestroyNotify + column_drag_info*: PGList + cur_reorder*: PTreeViewColumnReorder + destroy_count_func*: TTreeDestroyCountFunc + destroy_count_data*: gpointer + destroy_count_destroy*: TDestroyNotify + scroll_timeout*: guint + drag_dest_row*: PTreeRowReference + drag_dest_pos*: TTreeViewDropPosition + open_dest_timeout*: guint + pressed_button*: gint + press_start_x*: gint + press_start_y*: gint + scroll_to_path*: PTreeRowReference + scroll_to_column*: PTreeViewColumn + scroll_to_row_align*: gfloat + scroll_to_col_align*: gfloat + flag0*: guint16 + search_column*: gint + search_dialog_position_func*: TTreeViewSearchDialogPositionFunc + search_equal_func*: TTreeViewSearchEqualFunc + search_user_data*: gpointer + search_destroy*: TDestroyNotify + + TTreeView* = object of TContainer + priv*: PTreeViewPrivate + + PTreeViewClass* = ptr TTreeViewClass + TTreeViewClass* = object of TContainerClass + set_scroll_adjustments*: proc (tree_view: PTreeView, + hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + row_activated*: proc (tree_view: PTreeView, path: PTreePath, + column: PTreeViewColumn){.cdecl.} + test_expand_row*: proc (tree_view: PTreeView, iter: PTreeIter, + path: PTreePath): gboolean{.cdecl.} + test_collapse_row*: proc (tree_view: PTreeView, iter: PTreeIter, + path: PTreePath): gboolean{.cdecl.} + row_expanded*: proc (tree_view: PTreeView, iter: PTreeIter, path: PTreePath){. + cdecl.} + row_collapsed*: proc (tree_view: PTreeView, iter: PTreeIter, path: PTreePath){. + cdecl.} + columns_changed*: proc (tree_view: PTreeView){.cdecl.} + cursor_changed*: proc (tree_view: PTreeView){.cdecl.} + move_cursor*: proc (tree_view: PTreeView, step: TMovementStep, count: gint): gboolean{. + cdecl.} + select_all*: proc (tree_view: PTreeView){.cdecl.} + unselect_all*: proc (tree_view: PTreeView){.cdecl.} + select_cursor_row*: proc (tree_view: PTreeView, start_editing: gboolean){. + cdecl.} + toggle_cursor_row*: proc (tree_view: PTreeView){.cdecl.} + expand_collapse_cursor_row*: proc (tree_view: PTreeView, logical: gboolean, + expand: gboolean, open_all: gboolean){. + cdecl.} + select_cursor_parent*: proc (tree_view: PTreeView){.cdecl.} + start_interactive_search*: proc (tree_view: PTreeView){.cdecl.} + reserved760: proc (){.cdecl.} + reserved761: proc (){.cdecl.} + reserved762: proc (){.cdecl.} + reserved763: proc (){.cdecl.} + reserved764: proc (){.cdecl.} + + PVButtonBox* = ptr TVButtonBox + TVButtonBox* = object of TButtonBox + PVButtonBoxClass* = ptr TVButtonBoxClass + TVButtonBoxClass* = object of TButtonBoxClass + PViewport* = ptr TViewport + TViewport* = object of TBin + shadow_type*: TShadowType + view_window*: PGdkWindow + bin_window*: PGdkWindow + hadjustment*: PAdjustment + vadjustment*: PAdjustment + + PViewportClass* = ptr TViewportClass + TViewportClass* = object of TBinClass + set_scroll_adjustments*: proc (viewport: PViewport, + hadjustment: PAdjustment, + vadjustment: PAdjustment){.cdecl.} + + PVPaned* = ptr TVPaned + TVPaned* = object of TPaned + PVPanedClass* = ptr TVPanedClass + TVPanedClass* = object of TPanedClass + PVRuler* = ptr TVRuler + TVRuler* = object of TRuler + PVRulerClass* = ptr TVRulerClass + TVRulerClass* = object of TRulerClass + PVScale* = ptr TVScale + TVScale* = object of TScale + PVScaleClass* = ptr TVScaleClass + TVScaleClass* = object of TScaleClass + PVScrollbar* = ptr TVScrollbar + TVScrollbar* = object of TScrollbar + PVScrollbarClass* = ptr TVScrollbarClass + TVScrollbarClass* = object of TScrollbarClass + PVSeparator* = ptr TVSeparator + TVSeparator* = object of TSeparator + PVSeparatorClass* = ptr TVSeparatorClass + TVSeparatorClass* = object of TSeparatorClass + +const + IN_DESTRUCTION* = 1 shl 0 + FLOATING* = 1 shl 1 + RESERVED_1* = 1 shl 2 + RESERVED_2* = 1 shl 3 + ARG_READABLE* = G_PARAM_READABLE + ARG_WRITABLE* = G_PARAM_WRITABLE + ARG_CONSTRUCT* = G_PARAM_CONSTRUCT + ARG_CONSTRUCT_ONLY* = G_PARAM_CONSTRUCT_ONLY + ARG_CHILD_ARG* = 1 shl 4 + +proc TYPE_OBJECT*(): GType +proc OBJECT*(anObject: pointer): PObject +proc OBJECT_CLASS*(klass: pointer): PObjectClass +proc IS_OBJECT*(anObject: pointer): bool +proc IS_OBJECT_CLASS*(klass: pointer): bool +proc OBJECT_GET_CLASS*(anObject: pointer): PObjectClass +proc OBJECT_TYPE*(anObject: pointer): GType +proc OBJECT_TYPE_NAME*(anObject: pointer): cstring +proc OBJECT_FLAGS*(obj: pointer): guint32 +proc OBJECT_FLOATING*(obj: pointer): gboolean +proc OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) +proc OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) +proc object_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_object_get_type".} +proc object_new*(thetype: TType, first_property_name: cstring): PObject{.cdecl, + varargs, dynlib: lib, importc: "gtk_object_new".} +proc object_sink*(anObject: PObject){.cdecl, dynlib: lib, + importc: "gtk_object_sink".} +proc object_destroy*(anObject: PObject){.cdecl, dynlib: lib, + importc: "gtk_object_destroy".} +const + TYPE_INVALID* = G_TYPE_INVALID + TYPE_NONE* = G_TYPE_NONE + TYPE_ENUM* = G_TYPE_ENUM + TYPE_FLAGS* = G_TYPE_FLAGS + TYPE_CHAR* = G_TYPE_CHAR + TYPE_UCHAR* = G_TYPE_UCHAR + TYPE_BOOL* = G_TYPE_BOOLEAN + TYPE_INT* = G_TYPE_INT + TYPE_UINT* = G_TYPE_UINT + TYPE_LONG* = G_TYPE_LONG + TYPE_ULONG* = G_TYPE_ULONG + TYPE_FLOAT* = G_TYPE_FLOAT + TYPE_DOUBLE* = G_TYPE_DOUBLE + TYPE_STRING* = G_TYPE_STRING + TYPE_BOXED* = G_TYPE_BOXED + TYPE_POINTER* = G_TYPE_POINTER + +proc TYPE_IDENTIFIER*(): GType +proc identifier_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_identifier_get_type".} +proc SIGNAL_FUNC*(f: pointer): TSignalFunc +proc type_class*(thetype: TType): gpointer{.cdecl, dynlib: lib, + importc: "gtk_type_class".} +const + TOPLEVEL* = 1 shl 4 + NO_WINDOW* = 1 shl 5 + REALIZED* = 1 shl 6 + MAPPED* = 1 shl 7 + VISIBLE* = 1 shl 8 + SENSITIVE* = 1 shl 9 + PARENT_SENSITIVE* = 1 shl 10 + CAN_FOCUS* = 1 shl 11 + HAS_FOCUS* = 1 shl 12 + CAN_DEFAULT* = 1 shl 13 + HAS_DEFAULT* = 1 shl 14 + HAS_GRAB* = 1 shl 15 + RC_STYLE* = 1 shl 16 + COMPOSITE_CHILD* = 1 shl 17 + NO_REPARENT* = 1 shl 18 + APP_PAINTABLE* = 1 shl 19 + RECEIVES_DEFAULT* = 1 shl 20 + DOUBLE_BUFFERED* = 1 shl 21 + +const + bm_TGtkWidgetAuxInfo_x_set* = 0x0001'i16 + bp_TGtkWidgetAuxInfo_x_set* = 0'i16 + bm_TGtkWidgetAuxInfo_y_set* = 0x0002'i16 + bp_TGtkWidgetAuxInfo_y_set* = 1'i16 + +proc TYPE_WIDGET*(): GType +proc WIDGET*(widget: pointer): PWidget +proc WIDGET_CLASS*(klass: pointer): PWidgetClass +proc IS_WIDGET*(widget: pointer): bool +proc IS_WIDGET_CLASS*(klass: pointer): bool +proc WIDGET_GET_CLASS*(obj: pointer): PWidgetClass +proc WIDGET_TYPE*(wid: pointer): GType +proc WIDGET_STATE*(wid: pointer): int32 +proc WIDGET_SAVED_STATE*(wid: pointer): int32 +proc WIDGET_FLAGS*(wid: pointer): guint32 +proc WIDGET_TOPLEVEL*(wid: pointer): gboolean +proc WIDGET_NO_WINDOW*(wid: pointer): gboolean +proc WIDGET_REALIZED*(wid: pointer): gboolean +proc WIDGET_MAPPED*(wid: pointer): gboolean +proc WIDGET_VISIBLE*(wid: pointer): gboolean +proc WIDGET_DRAWABLE*(wid: pointer): gboolean +proc WIDGET_SENSITIVE*(wid: pointer): gboolean +proc WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean +proc WIDGET_IS_SENSITIVE*(wid: pointer): gboolean +proc WIDGET_CAN_FOCUS*(wid: pointer): gboolean +proc WIDGET_HAS_FOCUS*(wid: pointer): gboolean +proc WIDGET_CAN_DEFAULT*(wid: pointer): gboolean +proc WIDGET_HAS_DEFAULT*(wid: pointer): gboolean +proc WIDGET_HAS_GRAB*(wid: pointer): gboolean +proc WIDGET_RC_STYLE*(wid: pointer): gboolean +proc WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean +proc WIDGET_APP_PAINTABLE*(wid: pointer): gboolean +proc WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean +proc WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean +proc WIDGET_SET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags +proc WIDGET_UNSET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags +proc TYPE_REQUISITION*(): GType +proc x_set*(a: var TWidgetAuxInfo): guint +proc set_x_set*(a: var TWidgetAuxInfo, x_set: guint) +proc y_set*(a: var TWidgetAuxInfo): guint +proc set_y_set*(a: var TWidgetAuxInfo, y_set: guint) +proc widget_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_widget_get_type".} +proc widget_ref*(widget: PWidget): PWidget{.cdecl, dynlib: lib, + importc: "gtk_widget_ref".} +proc widget_unref*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_unref".} +proc widget_destroy*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_destroy".} +proc widget_destroyed*(widget: PWidget, r: var PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_destroyed".} +proc widget_unparent*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_unparent".} +proc widget_show*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_show".} +proc widget_show_now*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_show_now".} +proc widget_hide*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_hide".} +proc widget_show_all*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_show_all".} +proc widget_hide_all*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_hide_all".} +proc widget_map*(widget: PWidget){.cdecl, dynlib: lib, importc: "gtk_widget_map".} +proc widget_unmap*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_unmap".} +proc widget_realize*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_realize".} +proc widget_unrealize*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_unrealize".} +proc widget_queue_draw*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_queue_draw".} +proc widget_queue_draw_area*(widget: PWidget, x: gint, y: gint, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gtk_widget_queue_draw_area".} +proc widget_queue_resize*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_queue_resize".} +proc widget_size_request*(widget: PWidget, requisition: PRequisition){.cdecl, + dynlib: lib, importc: "gtk_widget_size_request".} +proc widget_size_allocate*(widget: PWidget, allocation: PAllocation){.cdecl, + dynlib: lib, importc: "gtk_widget_size_allocate".} +proc widget_get_child_requisition*(widget: PWidget, requisition: PRequisition){. + cdecl, dynlib: lib, importc: "gtk_widget_get_child_requisition".} +proc widget_add_accelerator*(widget: PWidget, accel_signal: cstring, + accel_group: PAccelGroup, accel_key: guint, + accel_mods: TGdkModifierType, + accel_flags: TAccelFlags){.cdecl, dynlib: lib, + importc: "gtk_widget_add_accelerator".} +proc widget_remove_accelerator*(widget: PWidget, accel_group: PAccelGroup, + accel_key: guint, accel_mods: TGdkModifierType): gboolean{. + cdecl, dynlib: lib, importc: "gtk_widget_remove_accelerator".} +proc widget_set_accel_path*(widget: PWidget, accel_path: cstring, + accel_group: PAccelGroup){.cdecl, dynlib: lib, + importc: "gtk_widget_set_accel_path".} +proc widget_get_accel_path*(widget: PWidget, locked: Pgboolean): cstring{.cdecl, + dynlib: lib, importc: "_gtk_widget_get_accel_path".} +proc widget_list_accel_closures*(widget: PWidget): PGList{.cdecl, dynlib: lib, + importc: "gtk_widget_list_accel_closures".} +proc widget_mnemonic_activate*(widget: PWidget, group_cycling: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_widget_mnemonic_activate".} +proc widget_event*(widget: PWidget, event: PGdkEvent): gboolean{.cdecl, + dynlib: lib, importc: "gtk_widget_event".} +proc widget_send_expose*(widget: PWidget, event: PGdkEvent): gint{.cdecl, + dynlib: lib, importc: "gtk_widget_send_expose".} +proc widget_activate*(widget: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_activate".} +proc widget_set_scroll_adjustments*(widget: PWidget, hadjustment: PAdjustment, + vadjustment: PAdjustment): gboolean{.cdecl, + dynlib: lib, importc: "gtk_widget_set_scroll_adjustments".} +proc widget_reparent*(widget: PWidget, new_parent: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_reparent".} +proc widget_intersect*(widget: PWidget, area: PGdkRectangle, + intersection: PGdkRectangle): gboolean{.cdecl, + dynlib: lib, importc: "gtk_widget_intersect".} +proc widget_region_intersect*(widget: PWidget, region: PGdkRegion): PGdkRegion{. + cdecl, dynlib: lib, importc: "gtk_widget_region_intersect".} +proc widget_freeze_child_notify*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_freeze_child_notify".} +proc widget_child_notify*(widget: PWidget, child_property: cstring){.cdecl, + dynlib: lib, importc: "gtk_widget_child_notify".} +proc widget_thaw_child_notify*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_thaw_child_notify".} +proc widget_is_focus*(widget: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_is_focus".} +proc widget_grab_focus*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_grab_focus".} +proc widget_grab_default*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_grab_default".} +proc widget_set_name*(widget: PWidget, name: cstring){.cdecl, dynlib: lib, + importc: "gtk_widget_set_name".} +proc widget_get_name*(widget: PWidget): cstring{.cdecl, dynlib: lib, + importc: "gtk_widget_get_name".} +proc widget_set_state*(widget: PWidget, state: TStateType){.cdecl, dynlib: lib, + importc: "gtk_widget_set_state".} +proc widget_set_sensitive*(widget: PWidget, sensitive: gboolean){.cdecl, + dynlib: lib, importc: "gtk_widget_set_sensitive".} +proc widget_set_app_paintable*(widget: PWidget, app_paintable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_widget_set_app_paintable".} +proc widget_set_double_buffered*(widget: PWidget, double_buffered: gboolean){. + cdecl, dynlib: lib, importc: "gtk_widget_set_double_buffered".} +proc widget_set_redraw_on_allocate*(widget: PWidget, + redraw_on_allocate: gboolean){.cdecl, + dynlib: lib, importc: "gtk_widget_set_redraw_on_allocate".} +proc widget_set_parent*(widget: PWidget, parent: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_set_parent".} +proc widget_set_parent_window*(widget: PWidget, parent_window: PGdkWindow){. + cdecl, dynlib: lib, importc: "gtk_widget_set_parent_window".} +proc widget_set_child_visible*(widget: PWidget, is_visible: gboolean){.cdecl, + dynlib: lib, importc: "gtk_widget_set_child_visible".} +proc widget_get_child_visible*(widget: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_get_child_visible".} +proc widget_get_parent*(widget: PWidget): PWidget{.cdecl, dynlib: lib, + importc: "gtk_widget_get_parent".} +proc widget_get_parent_window*(widget: PWidget): PGdkWindow{.cdecl, dynlib: lib, + importc: "gtk_widget_get_parent_window".} +proc widget_child_focus*(widget: PWidget, direction: TDirectionType): gboolean{. + cdecl, dynlib: lib, importc: "gtk_widget_child_focus".} +proc widget_set_size_request*(widget: PWidget, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gtk_widget_set_size_request".} +proc widget_get_size_request*(widget: PWidget, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "gtk_widget_get_size_request".} +proc widget_set_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib, + importc: "gtk_widget_set_events".} +proc widget_add_events*(widget: PWidget, events: gint){.cdecl, dynlib: lib, + importc: "gtk_widget_add_events".} +proc widget_set_extension_events*(widget: PWidget, mode: TGdkExtensionMode){. + cdecl, dynlib: lib, importc: "gtk_widget_set_extension_events".} +proc widget_get_extension_events*(widget: PWidget): TGdkExtensionMode{.cdecl, + dynlib: lib, importc: "gtk_widget_get_extension_events".} +proc widget_get_toplevel*(widget: PWidget): PWidget{.cdecl, dynlib: lib, + importc: "gtk_widget_get_toplevel".} +proc widget_get_ancestor*(widget: PWidget, widget_type: TType): PWidget{.cdecl, + dynlib: lib, importc: "gtk_widget_get_ancestor".} +proc widget_get_colormap*(widget: PWidget): PGdkColormap{.cdecl, dynlib: lib, + importc: "gtk_widget_get_colormap".} +proc widget_get_visual*(widget: PWidget): PGdkVisual{.cdecl, dynlib: lib, + importc: "gtk_widget_get_visual".} +proc widget_get_screen*(widget: PWidget): PGdkScreen{.cdecl, dynlib: lib, + importc: "gtk_widget_get_screen".} +proc widget_has_screen*(widget: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_has_screen".} +proc widget_get_display*(widget: PWidget): PGdkDisplay{.cdecl, dynlib: lib, + importc: "gtk_widget_get_display".} +proc widget_get_root_window*(widget: PWidget): PGdkWindow{.cdecl, dynlib: lib, + importc: "gtk_widget_get_root_window".} +proc widget_get_settings*(widget: PWidget): PSettings{.cdecl, dynlib: lib, + importc: "gtk_widget_get_settings".} +proc widget_get_clipboard*(widget: PWidget, selection: TGdkAtom): PClipboard{. + cdecl, dynlib: lib, importc: "gtk_widget_get_clipboard".} +proc widget_get_accessible*(widget: PWidget): PAtkObject{.cdecl, dynlib: lib, + importc: "gtk_widget_get_accessible".} +proc widget_set_colormap*(widget: PWidget, colormap: PGdkColormap){.cdecl, + dynlib: lib, importc: "gtk_widget_set_colormap".} +proc widget_get_events*(widget: PWidget): gint{.cdecl, dynlib: lib, + importc: "gtk_widget_get_events".} +proc widget_get_pointer*(widget: PWidget, x: Pgint, y: Pgint){.cdecl, + dynlib: lib, importc: "gtk_widget_get_pointer".} +proc widget_is_ancestor*(widget: PWidget, ancestor: PWidget): gboolean{.cdecl, + dynlib: lib, importc: "gtk_widget_is_ancestor".} +proc widget_translate_coordinates*(src_widget: PWidget, dest_widget: PWidget, + src_x: gint, src_y: gint, dest_x: Pgint, + dest_y: Pgint): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_translate_coordinates".} +proc widget_hide_on_delete*(widget: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "gtk_widget_hide_on_delete".} +proc widget_set_style*(widget: PWidget, style: PStyle){.cdecl, dynlib: lib, + importc: "gtk_widget_set_style".} +proc widget_ensure_style*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_ensure_style".} +proc widget_get_style*(widget: PWidget): PStyle{.cdecl, dynlib: lib, + importc: "gtk_widget_get_style".} +proc widget_modify_style*(widget: PWidget, style: PRcStyle){.cdecl, dynlib: lib, + importc: "gtk_widget_modify_style".} +proc widget_get_modifier_style*(widget: PWidget): PRcStyle{.cdecl, dynlib: lib, + importc: "gtk_widget_get_modifier_style".} +proc widget_modify_fg*(widget: PWidget, state: TStateType, color: PGdkColor){. + cdecl, dynlib: lib, importc: "gtk_widget_modify_fg".} +proc widget_modify_bg*(widget: PWidget, state: TStateType, color: PGdkColor){. + cdecl, dynlib: lib, importc: "gtk_widget_modify_bg".} +proc widget_modify_text*(widget: PWidget, state: TStateType, color: PGdkColor){. + cdecl, dynlib: lib, importc: "gtk_widget_modify_text".} +proc widget_modify_base*(widget: PWidget, state: TStateType, color: PGdkColor){. + cdecl, dynlib: lib, importc: "gtk_widget_modify_base".} +proc widget_modify_font*(widget: PWidget, font_desc: PPangoFontDescription){. + cdecl, dynlib: lib, importc: "gtk_widget_modify_font".} +proc widget_create_pango_context*(widget: PWidget): PPangoContext{.cdecl, + dynlib: lib, importc: "gtk_widget_create_pango_context".} +proc widget_get_pango_context*(widget: PWidget): PPangoContext{.cdecl, + dynlib: lib, importc: "gtk_widget_get_pango_context".} +proc widget_create_pango_layout*(widget: PWidget, text: cstring): PPangoLayout{. + cdecl, dynlib: lib, importc: "gtk_widget_create_pango_layout".} +proc widget_render_icon*(widget: PWidget, stock_id: cstring, size: TIconSize, + detail: cstring): PGdkPixbuf{.cdecl, dynlib: lib, + importc: "gtk_widget_render_icon".} +proc widget_set_composite_name*(widget: PWidget, name: cstring){.cdecl, + dynlib: lib, importc: "gtk_widget_set_composite_name".} +proc widget_get_composite_name*(widget: PWidget): cstring{.cdecl, dynlib: lib, + importc: "gtk_widget_get_composite_name".} +proc widget_reset_rc_styles*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_reset_rc_styles".} +proc widget_push_colormap*(cmap: PGdkColormap){.cdecl, dynlib: lib, + importc: "gtk_widget_push_colormap".} +proc widget_push_composite_child*(){.cdecl, dynlib: lib, + importc: "gtk_widget_push_composite_child".} +proc widget_pop_composite_child*(){.cdecl, dynlib: lib, + importc: "gtk_widget_pop_composite_child".} +proc widget_pop_colormap*(){.cdecl, dynlib: lib, + importc: "gtk_widget_pop_colormap".} +proc widget_class_install_style_property*(klass: PWidgetClass, + pspec: PGParamSpec){.cdecl, dynlib: lib, + importc: "gtk_widget_class_install_style_property".} +proc widget_class_install_style_property_parser*(klass: PWidgetClass, + pspec: PGParamSpec, parser: TRcPropertyParser){.cdecl, dynlib: lib, + importc: "gtk_widget_class_install_style_property_parser".} +proc widget_class_find_style_property*(klass: PWidgetClass, + property_name: cstring): PGParamSpec{. + cdecl, dynlib: lib, importc: "gtk_widget_class_find_style_property".} +proc widget_class_list_style_properties*(klass: PWidgetClass, + n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: lib, + importc: "gtk_widget_class_list_style_properties".} +proc widget_style_get_property*(widget: PWidget, property_name: cstring, + value: PGValue){.cdecl, dynlib: lib, + importc: "gtk_widget_style_get_property".} +proc widget_set_default_colormap*(colormap: PGdkColormap){.cdecl, dynlib: lib, + importc: "gtk_widget_set_default_colormap".} +proc widget_get_default_style*(): PStyle{.cdecl, dynlib: lib, + importc: "gtk_widget_get_default_style".} +proc widget_set_direction*(widget: PWidget, dir: TTextDirection){.cdecl, + dynlib: lib, importc: "gtk_widget_set_direction".} +proc widget_get_direction*(widget: PWidget): TTextDirection{.cdecl, dynlib: lib, + importc: "gtk_widget_get_direction".} +proc widget_set_default_direction*(dir: TTextDirection){.cdecl, dynlib: lib, + importc: "gtk_widget_set_default_direction".} +proc widget_get_default_direction*(): TTextDirection{.cdecl, dynlib: lib, + importc: "gtk_widget_get_default_direction".} +proc widget_shape_combine_mask*(widget: PWidget, shape_mask: PGdkBitmap, + offset_x: gint, offset_y: gint){.cdecl, + dynlib: lib, importc: "gtk_widget_shape_combine_mask".} +proc widget_reset_shapes*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_widget_reset_shapes".} +proc widget_path*(widget: PWidget, path_length: Pguint, path: PPgchar, + path_reversed: PPgchar){.cdecl, dynlib: lib, + importc: "gtk_widget_path".} +proc widget_class_path*(widget: PWidget, path_length: Pguint, path: PPgchar, + path_reversed: PPgchar){.cdecl, dynlib: lib, + importc: "gtk_widget_class_path".} +proc requisition_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_requisition_get_type".} +proc requisition_copy*(requisition: PRequisition): PRequisition{.cdecl, + dynlib: lib, importc: "gtk_requisition_copy".} +proc requisition_free*(requisition: PRequisition){.cdecl, dynlib: lib, + importc: "gtk_requisition_free".} +proc widget_get_aux_info*(widget: PWidget, create: gboolean): PWidgetAuxInfo{. + cdecl, dynlib: lib, importc: "gtk_widget_get_aux_info".} +proc widget_propagate_hierarchy_changed*(widget: PWidget, + previous_toplevel: PWidget){.cdecl, dynlib: lib, importc: "_gtk_widget_propagate_hierarchy_changed".} +proc widget_peek_colormap*(): PGdkColormap{.cdecl, dynlib: lib, + importc: "_gtk_widget_peek_colormap".} +proc TYPE_MISC*(): GType +proc MISC*(obj: pointer): PMisc +proc MISC_CLASS*(klass: pointer): PMiscClass +proc IS_MISC*(obj: pointer): bool +proc IS_MISC_CLASS*(klass: pointer): bool +proc MISC_GET_CLASS*(obj: pointer): PMiscClass +proc misc_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_misc_get_type".} +proc misc_set_alignment*(misc: PMisc, xalign: gfloat, yalign: gfloat){.cdecl, + dynlib: lib, importc: "gtk_misc_set_alignment".} +proc misc_get_alignment*(misc: PMisc, xalign, yalign: var Pgfloat){.cdecl, + dynlib: lib, importc: "gtk_misc_get_alignment".} +proc misc_set_padding*(misc: PMisc, xpad: gint, ypad: gint){.cdecl, dynlib: lib, + importc: "gtk_misc_set_padding".} +proc misc_get_padding*(misc: PMisc, xpad, ypad: var Pgint){.cdecl, dynlib: lib, + importc: "gtk_misc_get_padding".} +const + ACCEL_VISIBLE* = 1 shl 0 + ACCEL_LOCKED* = 1 shl 1 + ACCEL_MASK* = 0x00000007 + bm_TGtkAccelKey_accel_flags* = 0xFFFF'i16 + bp_TGtkAccelKey_accel_flags* = 0'i16 + +proc TYPE_ACCEL_GROUP*(): GType +proc ACCEL_GROUP*(anObject: pointer): PAccelGroup +proc ACCEL_GROUP_CLASS*(klass: pointer): PAccelGroupClass +proc IS_ACCEL_GROUP*(anObject: pointer): bool +proc IS_ACCEL_GROUP_CLASS*(klass: pointer): bool +proc ACCEL_GROUP_GET_CLASS*(obj: pointer): PAccelGroupClass +proc accel_flags*(a: var TAccelKey): guint +proc set_accel_flags*(a: var TAccelKey, `accel_flags`: guint) +proc accel_group_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_accel_group_get_type".} +proc accel_group_new*(): PAccelGroup{.cdecl, dynlib: lib, + importc: "gtk_accel_group_new".} +proc accel_group_lock*(accel_group: PAccelGroup){.cdecl, dynlib: lib, + importc: "gtk_accel_group_lock".} +proc accel_group_unlock*(accel_group: PAccelGroup){.cdecl, dynlib: lib, + importc: "gtk_accel_group_unlock".} +proc accel_group_connect*(accel_group: PAccelGroup, accel_key: guint, + accel_mods: TGdkModifierType, + accel_flags: TAccelFlags, closure: PGClosure){.cdecl, + dynlib: lib, importc: "gtk_accel_group_connect".} +proc accel_group_connect_by_path*(accel_group: PAccelGroup, accel_path: cstring, + closure: PGClosure){.cdecl, dynlib: lib, + importc: "gtk_accel_group_connect_by_path".} +proc accel_group_disconnect*(accel_group: PAccelGroup, closure: PGClosure): gboolean{. + cdecl, dynlib: lib, importc: "gtk_accel_group_disconnect".} +proc accel_group_disconnect_key*(accel_group: PAccelGroup, accel_key: guint, + accel_mods: TGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gtk_accel_group_disconnect_key".} +proc accel_group_attach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, + dynlib: lib, importc: "_gtk_accel_group_attach".} +proc accel_group_detach*(accel_group: PAccelGroup, anObject: PGObject){.cdecl, + dynlib: lib, importc: "_gtk_accel_group_detach".} +proc accel_groups_activate*(anObject: PGObject, accel_key: guint, + accel_mods: TGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gtk_accel_groups_activate".} +proc accel_groups_from_object*(anObject: PGObject): PGSList{.cdecl, dynlib: lib, + importc: "gtk_accel_groups_from_object".} +proc accel_group_find*(accel_group: PAccelGroup, + find_func: Taccel_group_find_func, data: gpointer): PAccelKey{. + cdecl, dynlib: lib, importc: "gtk_accel_group_find".} +proc accel_group_from_accel_closure*(closure: PGClosure): PAccelGroup{.cdecl, + dynlib: lib, importc: "gtk_accel_group_from_accel_closure".} +proc accelerator_valid*(keyval: guint, modifiers: TGdkModifierType): gboolean{. + cdecl, dynlib: lib, importc: "gtk_accelerator_valid".} +proc accelerator_parse*(accelerator: cstring, accelerator_key: Pguint, + accelerator_mods: PGdkModifierType){.cdecl, dynlib: lib, + importc: "gtk_accelerator_parse".} +proc accelerator_name*(accelerator_key: guint, + accelerator_mods: TGdkModifierType): cstring{.cdecl, + dynlib: lib, importc: "gtk_accelerator_name".} +proc accelerator_set_default_mod_mask*(default_mod_mask: TGdkModifierType){. + cdecl, dynlib: lib, importc: "gtk_accelerator_set_default_mod_mask".} +proc accelerator_get_default_mod_mask*(): guint{.cdecl, dynlib: lib, + importc: "gtk_accelerator_get_default_mod_mask".} +proc accel_group_query*(accel_group: PAccelGroup, accel_key: guint, + accel_mods: TGdkModifierType, n_entries: Pguint): PAccelGroupEntry{. + cdecl, dynlib: lib, importc: "gtk_accel_group_query".} +proc accel_group_reconnect*(accel_group: PAccelGroup, accel_path_quark: TGQuark){. + cdecl, dynlib: lib, importc: "_gtk_accel_group_reconnect".} +const + bm_TGtkContainer_border_width* = 0x0000FFFF'i32 + bp_TGtkContainer_border_width* = 0'i32 + bm_TGtkContainer_need_resize* = 0x00010000'i32 + bp_TGtkContainer_need_resize* = 16'i32 + bm_TGtkContainer_resize_mode* = 0x00060000'i32 + bp_TGtkContainer_resize_mode* = 17'i32 + bm_TGtkContainer_reallocate_redraws* = 0x00080000'i32 + bp_TGtkContainer_reallocate_redraws* = 19'i32 + bm_TGtkContainer_has_focus_chain* = 0x00100000'i32 + bp_TGtkContainer_has_focus_chain* = 20'i32 + +proc TYPE_CONTAINER*(): GType +proc CONTAINER*(obj: pointer): PContainer +proc CONTAINER_CLASS*(klass: pointer): PContainerClass +proc IS_CONTAINER*(obj: pointer): bool +proc IS_CONTAINER_CLASS*(klass: pointer): bool +proc CONTAINER_GET_CLASS*(obj: pointer): PContainerClass +proc IS_RESIZE_CONTAINER*(widget: pointer): bool +proc border_width*(a: var TContainer): guint +proc set_border_width*(a: var TContainer, `border_width`: guint) +proc need_resize*(a: var TContainer): guint +proc set_need_resize*(a: var TContainer, `need_resize`: guint) +proc resize_mode*(a: PContainer): guint +proc set_resize_mode*(a: var TContainer, `resize_mode`: guint) +proc reallocate_redraws*(a: var TContainer): guint +proc set_reallocate_redraws*(a: var TContainer, `reallocate_redraws`: guint) +proc has_focus_chain*(a: var TContainer): guint +proc set_has_focus_chain*(a: var TContainer, `has_focus_chain`: guint) +proc container_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_container_get_type".} +proc container_set_border_width*(container: PContainer, border_width: guint){. + cdecl, dynlib: lib, importc: "gtk_container_set_border_width".} +proc container_get_border_width*(container: PContainer): guint{.cdecl, + dynlib: lib, importc: "gtk_container_get_border_width".} +proc container_add*(container: PContainer, widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_container_add".} +proc container_remove*(container: PContainer, widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_container_remove".} +proc container_set_resize_mode*(container: PContainer, resize_mode: TResizeMode){. + cdecl, dynlib: lib, importc: "gtk_container_set_resize_mode".} +proc container_get_resize_mode*(container: PContainer): TResizeMode{.cdecl, + dynlib: lib, importc: "gtk_container_get_resize_mode".} +proc container_check_resize*(container: PContainer){.cdecl, dynlib: lib, + importc: "gtk_container_check_resize".} +proc container_foreach*(container: PContainer, callback: TCallback, + callback_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_container_foreach".} +proc container_get_children*(container: PContainer): PGList{.cdecl, dynlib: lib, + importc: "gtk_container_get_children".} +proc container_propagate_expose*(container: PContainer, child: PWidget, + event: PGdkEventExpose){.cdecl, dynlib: lib, + importc: "gtk_container_propagate_expose".} +proc container_set_focus_chain*(container: PContainer, focusable_widgets: PGList){. + cdecl, dynlib: lib, importc: "gtk_container_set_focus_chain".} +proc container_get_focus_chain*(container: PContainer, s: var PGList): gboolean{. + cdecl, dynlib: lib, importc: "gtk_container_get_focus_chain".} +proc container_unset_focus_chain*(container: PContainer){.cdecl, dynlib: lib, + importc: "gtk_container_unset_focus_chain".} +proc container_set_reallocate_redraws*(container: PContainer, + needs_redraws: gboolean){.cdecl, + dynlib: lib, importc: "gtk_container_set_reallocate_redraws".} +proc container_set_focus_child*(container: PContainer, child: PWidget){.cdecl, + dynlib: lib, importc: "gtk_container_set_focus_child".} +proc container_set_focus_vadjustment*(container: PContainer, + adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_container_set_focus_vadjustment".} +proc container_get_focus_vadjustment*(container: PContainer): PAdjustment{. + cdecl, dynlib: lib, importc: "gtk_container_get_focus_vadjustment".} +proc container_set_focus_hadjustment*(container: PContainer, + adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_container_set_focus_hadjustment".} +proc container_get_focus_hadjustment*(container: PContainer): PAdjustment{. + cdecl, dynlib: lib, importc: "gtk_container_get_focus_hadjustment".} +proc container_resize_children*(container: PContainer){.cdecl, dynlib: lib, + importc: "gtk_container_resize_children".} +proc container_child_type*(container: PContainer): TType{.cdecl, dynlib: lib, + importc: "gtk_container_child_type".} +proc container_class_install_child_property*(cclass: PContainerClass, + property_id: guint, pspec: PGParamSpec){.cdecl, dynlib: lib, + importc: "gtk_container_class_install_child_property".} +proc container_class_find_child_property*(cclass: PGObjectClass, + property_name: cstring): PGParamSpec{.cdecl, dynlib: lib, + importc: "gtk_container_class_find_child_property".} +proc container_class_list_child_properties*(cclass: PGObjectClass, + n_properties: Pguint): PPGParamSpec{.cdecl, dynlib: lib, + importc: "gtk_container_class_list_child_properties".} +proc container_child_set_property*(container: PContainer, child: PWidget, + property_name: cstring, value: PGValue){. + cdecl, dynlib: lib, importc: "gtk_container_child_set_property".} +proc container_child_get_property*(container: PContainer, child: PWidget, + property_name: cstring, value: PGValue){. + cdecl, dynlib: lib, importc: "gtk_container_child_get_property".} +proc CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer, + property_id: guint, pspec: pointer) +proc container_forall*(container: PContainer, callback: TCallback, + callback_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_container_forall".} +proc container_queue_resize*(container: PContainer){.cdecl, dynlib: lib, + importc: "_gtk_container_queue_resize".} +proc container_clear_resize_widgets*(container: PContainer){.cdecl, dynlib: lib, + importc: "_gtk_container_clear_resize_widgets".} +proc container_child_composite_name*(container: PContainer, child: PWidget): cstring{. + cdecl, dynlib: lib, importc: "_gtk_container_child_composite_name".} +proc container_dequeue_resize_handler*(container: PContainer){.cdecl, + dynlib: lib, importc: "_gtk_container_dequeue_resize_handler".} +proc container_focus_sort*(container: PContainer, children: PGList, + direction: TDirectionType, old_focus: PWidget): PGList{. + cdecl, dynlib: lib, importc: "_gtk_container_focus_sort".} +proc TYPE_BIN*(): GType +proc BIN*(obj: pointer): PBin +proc BIN_CLASS*(klass: pointer): PBinClass +proc IS_BIN*(obj: pointer): bool +proc IS_BIN_CLASS*(klass: pointer): bool +proc BIN_GET_CLASS*(obj: pointer): PBinClass +proc bin_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_bin_get_type".} +proc bin_get_child*(bin: PBin): PWidget{.cdecl, dynlib: lib, + importc: "gtk_bin_get_child".} +const + bm_TGtkWindow_allow_shrink* = 0x00000001'i32 + bp_TGtkWindow_allow_shrink* = 0'i32 + bm_TGtkWindow_allow_grow* = 0x00000002'i32 + bp_TGtkWindow_allow_grow* = 1'i32 + bm_TGtkWindow_configure_notify_received* = 0x00000004'i32 + bp_TGtkWindow_configure_notify_received* = 2'i32 + bm_TGtkWindow_need_default_position* = 0x00000008'i32 + bp_TGtkWindow_need_default_position* = 3'i32 + bm_TGtkWindow_need_default_size* = 0x00000010'i32 + bp_TGtkWindow_need_default_size* = 4'i32 + bm_TGtkWindow_position* = 0x000000E0'i32 + bp_TGtkWindow_position* = 5'i32 + bm_TGtkWindow_type* = 0x00000F00'i32 + bp_TGtkWindow_type* = 8'i32 + bm_TGtkWindow_has_user_ref_count* = 0x00001000'i32 + bp_TGtkWindow_has_user_ref_count* = 12'i32 + bm_TGtkWindow_has_focus* = 0x00002000'i32 + bp_TGtkWindow_has_focus* = 13'i32 + bm_TGtkWindow_modal* = 0x00004000'i32 + bp_TGtkWindow_modal* = 14'i32 + bm_TGtkWindow_destroy_with_parent* = 0x00008000'i32 + bp_TGtkWindow_destroy_with_parent* = 15'i32 + bm_TGtkWindow_has_frame* = 0x00010000'i32 + bp_TGtkWindow_has_frame* = 16'i32 + bm_TGtkWindow_iconify_initially* = 0x00020000'i32 + bp_TGtkWindow_iconify_initially* = 17'i32 + bm_TGtkWindow_stick_initially* = 0x00040000'i32 + bp_TGtkWindow_stick_initially* = 18'i32 + bm_TGtkWindow_maximize_initially* = 0x00080000'i32 + bp_TGtkWindow_maximize_initially* = 19'i32 + bm_TGtkWindow_decorated* = 0x00100000'i32 + bp_TGtkWindow_decorated* = 20'i32 + bm_TGtkWindow_type_hint* = 0x00E00000'i32 + bp_TGtkWindow_type_hint* = 21'i32 + bm_TGtkWindow_gravity* = 0x1F000000'i32 + bp_TGtkWindow_gravity* = 24'i32 + +proc TYPE_WINDOW*(): GType +proc WINDOW*(obj: pointer): PWindow +proc WINDOW_CLASS*(klass: pointer): PWindowClass +proc IS_WINDOW*(obj: pointer): bool +proc IS_WINDOW_CLASS*(klass: pointer): bool +proc WINDOW_GET_CLASS*(obj: pointer): PWindowClass +proc allow_shrink*(a: var TWindow): guint +proc set_allow_shrink*(a: var TWindow, `allow_shrink`: guint) +proc allow_grow*(a: var TWindow): guint +proc set_allow_grow*(a: var TWindow, `allow_grow`: guint) +proc configure_notify_received*(a: var TWindow): guint +proc set_configure_notify_received*(a: var TWindow, + `configure_notify_received`: guint) +proc need_default_position*(a: var TWindow): guint +proc set_need_default_position*(a: var TWindow, `need_default_position`: guint) +proc need_default_size*(a: var TWindow): guint +proc set_need_default_size*(a: var TWindow, `need_default_size`: guint) +proc position*(a: var TWindow): guint +proc set_position*(a: var TWindow, `position`: guint) +proc get_type*(a: var TWindow): guint +proc set_type*(a: var TWindow, `type`: guint) +proc has_user_ref_count*(a: var TWindow): guint +proc set_has_user_ref_count*(a: var TWindow, `has_user_ref_count`: guint) +proc has_focus*(a: var TWindow): guint +proc set_has_focus*(a: var TWindow, `has_focus`: guint) +proc modal*(a: var TWindow): guint +proc set_modal*(a: var TWindow, `modal`: guint) +proc destroy_with_parent*(a: var TWindow): guint +proc set_destroy_with_parent*(a: var TWindow, `destroy_with_parent`: guint) +proc has_frame*(a: var TWindow): guint +proc set_has_frame*(a: var TWindow, `has_frame`: guint) +proc iconify_initially*(a: var TWindow): guint +proc set_iconify_initially*(a: var TWindow, `iconify_initially`: guint) +proc stick_initially*(a: var TWindow): guint +proc set_stick_initially*(a: var TWindow, `stick_initially`: guint) +proc maximize_initially*(a: var TWindow): guint +proc set_maximize_initially*(a: var TWindow, `maximize_initially`: guint) +proc decorated*(a: var TWindow): guint +proc set_decorated*(a: var TWindow, `decorated`: guint) +proc type_hint*(a: var TWindow): guint +proc set_type_hint*(a: var TWindow, `type_hint`: guint) +proc gravity*(a: var TWindow): guint +proc set_gravity*(a: var TWindow, `gravity`: guint) +proc TYPE_WINDOW_GROUP*(): GType +proc WINDOW_GROUP*(anObject: pointer): PWindowGroup +proc WINDOW_GROUP_CLASS*(klass: pointer): PWindowGroupClass +proc IS_WINDOW_GROUP*(anObject: pointer): bool +proc IS_WINDOW_GROUP_CLASS*(klass: pointer): bool +proc WINDOW_GROUP_GET_CLASS*(obj: pointer): PWindowGroupClass +proc window_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_window_get_type".} +proc window_new*(thetype: TWindowType): PWindow{.cdecl, dynlib: lib, + importc: "gtk_window_new".} +proc window_set_title*(window: PWindow, title: cstring){.cdecl, dynlib: lib, + importc: "gtk_window_set_title".} +proc window_get_title*(window: PWindow): cstring{.cdecl, dynlib: lib, + importc: "gtk_window_get_title".} +proc window_set_wmclass*(window: PWindow, wmclass_name: cstring, + wmclass_class: cstring){.cdecl, dynlib: lib, + importc: "gtk_window_set_wmclass".} +proc window_set_role*(window: PWindow, role: cstring){.cdecl, dynlib: lib, + importc: "gtk_window_set_role".} +proc window_get_role*(window: PWindow): cstring{.cdecl, dynlib: lib, + importc: "gtk_window_get_role".} +proc window_add_accel_group*(window: PWindow, accel_group: PAccelGroup){.cdecl, + dynlib: lib, importc: "gtk_window_add_accel_group".} +proc window_remove_accel_group*(window: PWindow, accel_group: PAccelGroup){. + cdecl, dynlib: lib, importc: "gtk_window_remove_accel_group".} +proc window_set_position*(window: PWindow, position: TWindowPosition){.cdecl, + dynlib: lib, importc: "gtk_window_set_position".} +proc window_activate_focus*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_activate_focus".} +proc window_set_focus*(window: PWindow, focus: PWidget){.cdecl, dynlib: lib, + importc: "gtk_window_set_focus".} +proc window_get_focus*(window: PWindow): PWidget{.cdecl, dynlib: lib, + importc: "gtk_window_get_focus".} +proc window_set_default*(window: PWindow, default_widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_window_set_default".} +proc window_activate_default*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_activate_default".} +proc window_set_transient_for*(window: PWindow, parent: PWindow){.cdecl, + dynlib: lib, importc: "gtk_window_set_transient_for".} +proc window_get_transient_for*(window: PWindow): PWindow{.cdecl, dynlib: lib, + importc: "gtk_window_get_transient_for".} +proc window_set_type_hint*(window: PWindow, hint: TGdkWindowTypeHint){.cdecl, + dynlib: lib, importc: "gtk_window_set_type_hint".} +proc window_get_type_hint*(window: PWindow): TGdkWindowTypeHint{.cdecl, + dynlib: lib, importc: "gtk_window_get_type_hint".} +proc window_set_destroy_with_parent*(window: PWindow, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_window_set_destroy_with_parent".} +proc window_get_destroy_with_parent*(window: PWindow): gboolean{.cdecl, + dynlib: lib, importc: "gtk_window_get_destroy_with_parent".} +proc window_set_resizable*(window: PWindow, resizable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_window_set_resizable".} +proc window_get_resizable*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_get_resizable".} +proc window_set_gravity*(window: PWindow, gravity: TGdkGravity){.cdecl, + dynlib: lib, importc: "gtk_window_set_gravity".} +proc window_get_gravity*(window: PWindow): TGdkGravity{.cdecl, dynlib: lib, + importc: "gtk_window_get_gravity".} +proc window_set_geometry_hints*(window: PWindow, geometry_widget: PWidget, + geometry: PGdkGeometry, + geom_mask: TGdkWindowHints){.cdecl, dynlib: lib, + importc: "gtk_window_set_geometry_hints".} +proc window_set_screen*(window: PWindow, screen: PGdkScreen){.cdecl, + dynlib: lib, importc: "gtk_window_set_screen".} +proc window_get_screen*(window: PWindow): PGdkScreen{.cdecl, dynlib: lib, + importc: "gtk_window_get_screen".} +proc window_set_has_frame*(window: PWindow, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_window_set_has_frame".} +proc window_get_has_frame*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_get_has_frame".} +proc window_set_frame_dimensions*(window: PWindow, left: gint, top: gint, + right: gint, bottom: gint){.cdecl, + dynlib: lib, importc: "gtk_window_set_frame_dimensions".} +proc window_get_frame_dimensions*(window: PWindow, left: Pgint, top: Pgint, + right: Pgint, bottom: Pgint){.cdecl, + dynlib: lib, importc: "gtk_window_get_frame_dimensions".} +proc window_set_decorated*(window: PWindow, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_window_set_decorated".} +proc window_get_decorated*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_get_decorated".} +proc window_set_icon_list*(window: PWindow, list: PGList){.cdecl, dynlib: lib, + importc: "gtk_window_set_icon_list".} +proc window_get_icon_list*(window: PWindow): PGList{.cdecl, dynlib: lib, + importc: "gtk_window_get_icon_list".} +proc window_set_icon*(window: PWindow, icon: PGdkPixbuf){.cdecl, dynlib: lib, + importc: "gtk_window_set_icon".} +proc window_get_icon*(window: PWindow): PGdkPixbuf{.cdecl, dynlib: lib, + importc: "gtk_window_get_icon".} +proc window_set_default_icon_list*(list: PGList){.cdecl, dynlib: lib, + importc: "gtk_window_set_default_icon_list".} +proc window_get_default_icon_list*(): PGList{.cdecl, dynlib: lib, + importc: "gtk_window_get_default_icon_list".} +proc window_set_modal*(window: PWindow, modal: gboolean){.cdecl, dynlib: lib, + importc: "gtk_window_set_modal".} +proc window_get_modal*(window: PWindow): gboolean{.cdecl, dynlib: lib, + importc: "gtk_window_get_modal".} +proc window_list_toplevels*(): PGList{.cdecl, dynlib: lib, + importc: "gtk_window_list_toplevels".} +proc window_add_mnemonic*(window: PWindow, keyval: guint, target: PWidget){. + cdecl, dynlib: lib, importc: "gtk_window_add_mnemonic".} +proc window_remove_mnemonic*(window: PWindow, keyval: guint, target: PWidget){. + cdecl, dynlib: lib, importc: "gtk_window_remove_mnemonic".} +proc window_mnemonic_activate*(window: PWindow, keyval: guint, + modifier: TGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gtk_window_mnemonic_activate".} +proc window_set_mnemonic_modifier*(window: PWindow, modifier: TGdkModifierType){. + cdecl, dynlib: lib, importc: "gtk_window_set_mnemonic_modifier".} +proc window_get_mnemonic_modifier*(window: PWindow): TGdkModifierType{.cdecl, + dynlib: lib, importc: "gtk_window_get_mnemonic_modifier".} +proc window_present*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_present".} +proc window_iconify*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_iconify".} +proc window_deiconify*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_deiconify".} +proc window_stick*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_stick".} +proc window_unstick*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_unstick".} +proc window_maximize*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_maximize".} +proc window_unmaximize*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_unmaximize".} +proc window_begin_resize_drag*(window: PWindow, edge: TGdkWindowEdge, + button: gint, root_x: gint, root_y: gint, + timestamp: guint32){.cdecl, dynlib: lib, + importc: "gtk_window_begin_resize_drag".} +proc window_begin_move_drag*(window: PWindow, button: gint, root_x: gint, + root_y: gint, timestamp: guint32){.cdecl, + dynlib: lib, importc: "gtk_window_begin_move_drag".} +proc window_set_default_size*(window: PWindow, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gtk_window_set_default_size".} +proc window_get_default_size*(window: PWindow, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "gtk_window_get_default_size".} +proc window_resize*(window: PWindow, width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gtk_window_resize".} +proc window_get_size*(window: PWindow, width: Pgint, height: Pgint){.cdecl, + dynlib: lib, importc: "gtk_window_get_size".} +proc window_move*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gtk_window_move".} +proc window_get_position*(window: PWindow, root_x: Pgint, root_y: Pgint){.cdecl, + dynlib: lib, importc: "gtk_window_get_position".} +proc window_parse_geometry*(window: PWindow, geometry: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_window_parse_geometry".} +proc window_reshow_with_initial_size*(window: PWindow){.cdecl, dynlib: lib, + importc: "gtk_window_reshow_with_initial_size".} +proc window_group_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_window_group_get_type".} +proc window_group_new*(): PWindowGroup{.cdecl, dynlib: lib, + importc: "gtk_window_group_new".} +proc window_group_add_window*(window_group: PWindowGroup, window: PWindow){. + cdecl, dynlib: lib, importc: "gtk_window_group_add_window".} +proc window_group_remove_window*(window_group: PWindowGroup, window: PWindow){. + cdecl, dynlib: lib, importc: "gtk_window_group_remove_window".} +proc window_set_default_icon_name*(name: cstring){.cdecl, dynlib: lib, + importc: "gtk_window_set_default_icon_name".} +proc window_internal_set_focus*(window: PWindow, focus: PWidget){.cdecl, + dynlib: lib, importc: "_gtk_window_internal_set_focus".} +proc window_remove_embedded_xid*(window: PWindow, xid: guint){.cdecl, + dynlib: lib, importc: "gtk_window_remove_embedded_xid".} +proc window_add_embedded_xid*(window: PWindow, xid: guint){.cdecl, dynlib: lib, + importc: "gtk_window_add_embedded_xid".} +proc window_reposition*(window: PWindow, x: gint, y: gint){.cdecl, dynlib: lib, + importc: "_gtk_window_reposition".} +proc window_constrain_size*(window: PWindow, width: gint, height: gint, + new_width: Pgint, new_height: Pgint){.cdecl, + dynlib: lib, importc: "_gtk_window_constrain_size".} +proc window_get_group*(window: PWindow): PWindowGroup{.cdecl, dynlib: lib, + importc: "_gtk_window_get_group".} +proc window_activate_key*(window: PWindow, event: PGdkEventKey): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_window_activate_key".} +proc window_keys_foreach*(window: PWindow, func: TWindowKeysForeachFunc, + func_data: gpointer){.cdecl, dynlib: lib, + importc: "_gtk_window_keys_foreach".} +proc window_query_nonaccels*(window: PWindow, accel_key: guint, + accel_mods: TGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_window_query_nonaccels".} +const + bm_TGtkLabel_jtype* = 0x0003'i16 + bp_TGtkLabel_jtype* = 0'i16 + bm_TGtkLabel_wrap* = 0x0004'i16 + bp_TGtkLabel_wrap* = 2'i16 + bm_TGtkLabel_use_underline* = 0x0008'i16 + bp_TGtkLabel_use_underline* = 3'i16 + bm_TGtkLabel_use_markup* = 0x0010'i16 + bp_TGtkLabel_use_markup* = 4'i16 + +proc TYPE_LABEL*(): GType +proc LABEL*(obj: pointer): PLabel +proc LABEL_CLASS*(klass: pointer): PLabelClass +proc IS_LABEL*(obj: pointer): bool +proc IS_LABEL_CLASS*(klass: pointer): bool +proc LABEL_GET_CLASS*(obj: pointer): PLabelClass +proc jtype*(a: var TLabel): guint +proc set_jtype*(a: var TLabel, `jtype`: guint) +proc wrap*(a: var TLabel): guint +proc set_wrap*(a: var TLabel, `wrap`: guint) +proc use_underline*(a: var TLabel): guint +proc set_use_underline*(a: var TLabel, `use_underline`: guint) +proc use_markup*(a: var TLabel): guint +proc set_use_markup*(a: var TLabel, `use_markup`: guint) +proc label_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_label_get_type".} +proc label_new*(str: cstring): PLabel{.cdecl, dynlib: lib, + importc: "gtk_label_new".} +proc label_new_with_mnemonic*(str: cstring): PLabel{.cdecl, dynlib: lib, + importc: "gtk_label_new_with_mnemonic".} +proc label_set_text*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, + importc: "gtk_label_set_text".} +proc label_get_text*(`label`: PLabel): cstring{.cdecl, dynlib: lib, + importc: "gtk_label_get_text".} +proc label_set_attributes*(`label`: PLabel, attrs: PPangoAttrList){.cdecl, + dynlib: lib, importc: "gtk_label_set_attributes".} +proc label_get_attributes*(`label`: PLabel): PPangoAttrList{.cdecl, dynlib: lib, + importc: "gtk_label_get_attributes".} +proc label_set_label*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, + importc: "gtk_label_set_label".} +proc label_get_label*(`label`: PLabel): cstring{.cdecl, dynlib: lib, + importc: "gtk_label_get_label".} +proc label_set_markup*(`label`: PLabel, str: cstring){.cdecl, dynlib: lib, + importc: "gtk_label_set_markup".} +proc label_set_use_markup*(`label`: PLabel, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_label_set_use_markup".} +proc label_get_use_markup*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, + importc: "gtk_label_get_use_markup".} +proc label_set_use_underline*(`label`: PLabel, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_label_set_use_underline".} +proc label_get_use_underline*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, + importc: "gtk_label_get_use_underline".} +proc label_set_markup_with_mnemonic*(`label`: PLabel, str: cstring){.cdecl, + dynlib: lib, importc: "gtk_label_set_markup_with_mnemonic".} +proc label_get_mnemonic_keyval*(`label`: PLabel): guint{.cdecl, dynlib: lib, + importc: "gtk_label_get_mnemonic_keyval".} +proc label_set_mnemonic_widget*(`label`: PLabel, widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_label_set_mnemonic_widget".} +proc label_get_mnemonic_widget*(`label`: PLabel): PWidget{.cdecl, dynlib: lib, + importc: "gtk_label_get_mnemonic_widget".} +proc label_set_text_with_mnemonic*(`label`: PLabel, str: cstring){.cdecl, + dynlib: lib, importc: "gtk_label_set_text_with_mnemonic".} +proc label_set_justify*(`label`: PLabel, jtype: TJustification){.cdecl, + dynlib: lib, importc: "gtk_label_set_justify".} +proc label_get_justify*(`label`: PLabel): TJustification{.cdecl, dynlib: lib, + importc: "gtk_label_get_justify".} +proc label_set_pattern*(`label`: PLabel, pattern: cstring){.cdecl, dynlib: lib, + importc: "gtk_label_set_pattern".} +proc label_set_line_wrap*(`label`: PLabel, wrap: gboolean){.cdecl, dynlib: lib, + importc: "gtk_label_set_line_wrap".} +proc label_get_line_wrap*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, + importc: "gtk_label_get_line_wrap".} +proc label_set_selectable*(`label`: PLabel, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_label_set_selectable".} +proc label_get_selectable*(`label`: PLabel): gboolean{.cdecl, dynlib: lib, + importc: "gtk_label_get_selectable".} +proc label_select_region*(`label`: PLabel, start_offset: gint, end_offset: gint){. + cdecl, dynlib: lib, importc: "gtk_label_select_region".} +proc label_get_selection_bounds*(`label`: PLabel, start: Pgint, theEnd: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_label_get_selection_bounds".} +proc label_get_layout*(`label`: PLabel): PPangoLayout{.cdecl, dynlib: lib, + importc: "gtk_label_get_layout".} +proc label_get_layout_offsets*(`label`: PLabel, x: Pgint, y: Pgint){.cdecl, + dynlib: lib, importc: "gtk_label_get_layout_offsets".} +const + bm_TGtkAccelLabelClass_latin1_to_char* = 0x0001'i16 + bp_TGtkAccelLabelClass_latin1_to_char* = 0'i16 + +proc TYPE_ACCEL_LABEL*(): GType +proc ACCEL_LABEL*(obj: pointer): PAccelLabel +proc ACCEL_LABEL_CLASS*(klass: pointer): PAccelLabelClass +proc IS_ACCEL_LABEL*(obj: pointer): bool +proc IS_ACCEL_LABEL_CLASS*(klass: pointer): bool +proc ACCEL_LABEL_GET_CLASS*(obj: pointer): PAccelLabelClass +proc latin1_to_char*(a: var TAccelLabelClass): guint +proc set_latin1_to_char*(a: var TAccelLabelClass, `latin1_to_char`: guint) +proc accel_label_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_accel_label_get_type".} +proc accel_label_new*(`string`: cstring): PAccelLabel{.cdecl, dynlib: lib, + importc: "gtk_accel_label_new".} +proc accel_label_get_accel_widget*(accel_label: PAccelLabel): PWidget{.cdecl, + dynlib: lib, importc: "gtk_accel_label_get_accel_widget".} +proc accel_label_get_accel_width*(accel_label: PAccelLabel): guint{.cdecl, + dynlib: lib, importc: "gtk_accel_label_get_accel_width".} +proc accel_label_set_accel_widget*(accel_label: PAccelLabel, + accel_widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_accel_label_set_accel_widget".} +proc accel_label_set_accel_closure*(accel_label: PAccelLabel, + accel_closure: PGClosure){.cdecl, + dynlib: lib, importc: "gtk_accel_label_set_accel_closure".} +proc accel_label_refetch*(accel_label: PAccelLabel): gboolean{.cdecl, + dynlib: lib, importc: "gtk_accel_label_refetch".} +proc accel_map_add_entry*(accel_path: cstring, accel_key: guint, + accel_mods: TGdkModifierType){.cdecl, dynlib: lib, + importc: "gtk_accel_map_add_entry".} +proc accel_map_lookup_entry*(accel_path: cstring, key: PAccelKey): gboolean{. + cdecl, dynlib: lib, importc: "gtk_accel_map_lookup_entry".} +proc accel_map_change_entry*(accel_path: cstring, accel_key: guint, + accel_mods: TGdkModifierType, replace: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_accel_map_change_entry".} +proc accel_map_load*(file_name: cstring){.cdecl, dynlib: lib, + importc: "gtk_accel_map_load".} +proc accel_map_save*(file_name: cstring){.cdecl, dynlib: lib, + importc: "gtk_accel_map_save".} +proc accel_map_foreach*(data: gpointer, foreach_func: TAccelMapForeach){.cdecl, + dynlib: lib, importc: "gtk_accel_map_foreach".} +proc accel_map_load_fd*(fd: gint){.cdecl, dynlib: lib, + importc: "gtk_accel_map_load_fd".} +proc accel_map_load_scanner*(scanner: PGScanner){.cdecl, dynlib: lib, + importc: "gtk_accel_map_load_scanner".} +proc accel_map_save_fd*(fd: gint){.cdecl, dynlib: lib, + importc: "gtk_accel_map_save_fd".} +proc accel_map_add_filter*(filter_pattern: cstring){.cdecl, dynlib: lib, + importc: "gtk_accel_map_add_filter".} +proc accel_map_foreach_unfiltered*(data: gpointer, + foreach_func: TAccelMapForeach){.cdecl, + dynlib: lib, importc: "gtk_accel_map_foreach_unfiltered".} +proc accel_map_init*(){.cdecl, dynlib: lib, importc: "_gtk_accel_map_init".} +proc accel_map_add_group*(accel_path: cstring, accel_group: PAccelGroup){.cdecl, + dynlib: lib, importc: "_gtk_accel_map_add_group".} +proc accel_map_remove_group*(accel_path: cstring, accel_group: PAccelGroup){. + cdecl, dynlib: lib, importc: "_gtk_accel_map_remove_group".} +proc accel_path_is_valid*(accel_path: cstring): gboolean{.cdecl, dynlib: lib, + importc: "_gtk_accel_path_is_valid".} +proc TYPE_ACCESSIBLE*(): GType +proc ACCESSIBLE*(obj: pointer): PAccessible +proc ACCESSIBLE_CLASS*(klass: pointer): PAccessibleClass +proc IS_ACCESSIBLE*(obj: pointer): bool +proc IS_ACCESSIBLE_CLASS*(klass: pointer): bool +proc ACCESSIBLE_GET_CLASS*(obj: pointer): PAccessibleClass +proc accessible_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_accessible_get_type".} +proc accessible_connect_widget_destroyed*(accessible: PAccessible){.cdecl, + dynlib: lib, importc: "gtk_accessible_connect_widget_destroyed".} +proc TYPE_ADJUSTMENT*(): GType +proc ADJUSTMENT*(obj: pointer): PAdjustment +proc ADJUSTMENT_CLASS*(klass: pointer): PAdjustmentClass +proc IS_ADJUSTMENT*(obj: pointer): bool +proc IS_ADJUSTMENT_CLASS*(klass: pointer): bool +proc ADJUSTMENT_GET_CLASS*(obj: pointer): PAdjustmentClass +proc adjustment_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_adjustment_get_type".} +proc adjustment_new*(value: gdouble, lower: gdouble, upper: gdouble, + step_increment: gdouble, page_increment: gdouble, + page_size: gdouble): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_adjustment_new".} +proc adjustment_changed*(adjustment: PAdjustment){.cdecl, dynlib: lib, + importc: "gtk_adjustment_changed".} +proc adjustment_value_changed*(adjustment: PAdjustment){.cdecl, dynlib: lib, + importc: "gtk_adjustment_value_changed".} +proc adjustment_clamp_page*(adjustment: PAdjustment, lower: gdouble, + upper: gdouble){.cdecl, dynlib: lib, + importc: "gtk_adjustment_clamp_page".} +proc adjustment_get_value*(adjustment: PAdjustment): gdouble{.cdecl, + dynlib: lib, importc: "gtk_adjustment_get_value".} +proc adjustment_set_value*(adjustment: PAdjustment, value: gdouble){.cdecl, + dynlib: lib, importc: "gtk_adjustment_set_value".} +proc TYPE_ALIGNMENT*(): GType +proc ALIGNMENT*(obj: pointer): PAlignment +proc ALIGNMENT_CLASS*(klass: pointer): PAlignmentClass +proc IS_ALIGNMENT*(obj: pointer): bool +proc IS_ALIGNMENT_CLASS*(klass: pointer): bool +proc ALIGNMENT_GET_CLASS*(obj: pointer): PAlignmentClass +proc alignment_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_alignment_get_type".} +proc alignment_new*(xalign: gfloat, yalign: gfloat, xscale: gfloat, + yscale: gfloat): PAlignment{.cdecl, dynlib: lib, + importc: "gtk_alignment_new".} +proc alignment_set*(alignment: PAlignment, xalign: gfloat, yalign: gfloat, + xscale: gfloat, yscale: gfloat){.cdecl, dynlib: lib, + importc: "gtk_alignment_set".} +proc TYPE_FRAME*(): GType +proc FRAME*(obj: pointer): PFrame +proc FRAME_CLASS*(klass: pointer): PFrameClass +proc IS_FRAME*(obj: pointer): bool +proc IS_FRAME_CLASS*(klass: pointer): bool +proc FRAME_GET_CLASS*(obj: pointer): PFrameClass +proc frame_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_frame_get_type".} +proc frame_new*(`label`: cstring): PFrame{.cdecl, dynlib: lib, + importc: "gtk_frame_new".} +proc frame_set_label*(frame: PFrame, `label`: cstring){.cdecl, dynlib: lib, + importc: "gtk_frame_set_label".} +proc frame_get_label*(frame: PFrame): cstring{.cdecl, dynlib: lib, + importc: "gtk_frame_get_label".} +proc frame_set_label_widget*(frame: PFrame, label_widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_frame_set_label_widget".} +proc frame_get_label_widget*(frame: PFrame): PWidget{.cdecl, dynlib: lib, + importc: "gtk_frame_get_label_widget".} +proc frame_set_label_align*(frame: PFrame, xalign: gfloat, yalign: gfloat){. + cdecl, dynlib: lib, importc: "gtk_frame_set_label_align".} +proc frame_get_label_align*(frame: PFrame, xalign: Pgfloat, yalign: Pgfloat){. + cdecl, dynlib: lib, importc: "gtk_frame_get_label_align".} +proc frame_set_shadow_type*(frame: PFrame, thetype: TShadowType){.cdecl, + dynlib: lib, importc: "gtk_frame_set_shadow_type".} +proc frame_get_shadow_type*(frame: PFrame): TShadowType{.cdecl, dynlib: lib, + importc: "gtk_frame_get_shadow_type".} +proc TYPE_ASPECT_FRAME*(): GType +proc ASPECT_FRAME*(obj: pointer): PAspectFrame +proc ASPECT_FRAME_CLASS*(klass: pointer): PAspectFrameClass +proc IS_ASPECT_FRAME*(obj: pointer): bool +proc IS_ASPECT_FRAME_CLASS*(klass: pointer): bool +proc ASPECT_FRAME_GET_CLASS*(obj: pointer): PAspectFrameClass +proc aspect_frame_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_aspect_frame_get_type".} +proc aspect_frame_new*(`label`: cstring, xalign: gfloat, yalign: gfloat, + ratio: gfloat, obey_child: gboolean): PAspectFrame{. + cdecl, dynlib: lib, importc: "gtk_aspect_frame_new".} +proc aspect_frame_set*(aspect_frame: PAspectFrame, xalign: gfloat, + yalign: gfloat, ratio: gfloat, obey_child: gboolean){. + cdecl, dynlib: lib, importc: "gtk_aspect_frame_set".} +proc TYPE_ARROW*(): GType +proc ARROW*(obj: pointer): PArrow +proc ARROW_CLASS*(klass: pointer): PArrowClass +proc IS_ARROW*(obj: pointer): bool +proc IS_ARROW_CLASS*(klass: pointer): bool +proc ARROW_GET_CLASS*(obj: pointer): PArrowClass +proc arrow_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_arrow_get_type".} +proc arrow_new*(arrow_type: TArrowType, shadow_type: TShadowType): PArrow{. + cdecl, dynlib: lib, importc: "gtk_arrow_new".} +proc arrow_set*(arrow: PArrow, arrow_type: TArrowType, shadow_type: TShadowType){. + cdecl, dynlib: lib, importc: "gtk_arrow_set".} +const + bm_TGtkBindingSet_parsed* = 0x0001'i16 + bp_TGtkBindingSet_parsed* = 0'i16 + bm_TGtkBindingEntry_destroyed* = 0x0001'i16 + bp_TGtkBindingEntry_destroyed* = 0'i16 + bm_TGtkBindingEntry_in_emission* = 0x0002'i16 + bp_TGtkBindingEntry_in_emission* = 1'i16 + +proc binding_entry_add*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType) +proc parsed*(a: var TBindingSet): guint +proc set_parsed*(a: var TBindingSet, `parsed`: guint) +proc destroyed*(a: var TBindingEntry): guint +proc set_destroyed*(a: var TBindingEntry, `destroyed`: guint) +proc in_emission*(a: var TBindingEntry): guint +proc set_in_emission*(a: var TBindingEntry, `in_emission`: guint) +proc binding_set_new*(set_name: cstring): PBindingSet{.cdecl, dynlib: lib, + importc: "gtk_binding_set_new".} +proc binding_set_by_class*(object_class: gpointer): PBindingSet{.cdecl, + dynlib: lib, importc: "gtk_binding_set_by_class".} +proc binding_set_find*(set_name: cstring): PBindingSet{.cdecl, dynlib: lib, + importc: "gtk_binding_set_find".} +proc bindings_activate*(anObject: PObject, keyval: guint, + modifiers: TGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gtk_bindings_activate".} +proc binding_set_activate*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType, anObject: PObject): gboolean{. + cdecl, dynlib: lib, importc: "gtk_binding_set_activate".} +proc binding_entry_clear*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType){.cdecl, dynlib: lib, + importc: "gtk_binding_entry_clear".} +proc binding_set_add_path*(binding_set: PBindingSet, path_type: TPathType, + path_pattern: cstring, priority: TPathPriorityType){. + cdecl, dynlib: lib, importc: "gtk_binding_set_add_path".} +proc binding_entry_remove*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType){.cdecl, dynlib: lib, + importc: "gtk_binding_entry_remove".} +proc binding_entry_add_signall*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType, + signal_name: cstring, binding_args: PGSList){. + cdecl, dynlib: lib, importc: "gtk_binding_entry_add_signall".} +proc binding_parse_binding*(scanner: PGScanner): guint{.cdecl, dynlib: lib, + importc: "gtk_binding_parse_binding".} +proc bindings_activate_event*(anObject: PObject, event: PGdkEventKey): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_bindings_activate_event".} +proc binding_reset_parsed*(){.cdecl, dynlib: lib, + importc: "_gtk_binding_reset_parsed".} +const + bm_TGtkBox_homogeneous* = 0x0001'i16 + bp_TGtkBox_homogeneous* = 0'i16 + bm_TGtkBoxChild_expand* = 0x0001'i16 + bp_TGtkBoxChild_expand* = 0'i16 + bm_TGtkBoxChild_fill* = 0x0002'i16 + bp_TGtkBoxChild_fill* = 1'i16 + bm_TGtkBoxChild_pack* = 0x0004'i16 + bp_TGtkBoxChild_pack* = 2'i16 + bm_TGtkBoxChild_is_secondary* = 0x0008'i16 + bp_TGtkBoxChild_is_secondary* = 3'i16 + +proc TYPE_BOX*(): GType +proc BOX*(obj: pointer): PBox +proc BOX_CLASS*(klass: pointer): PBoxClass +proc IS_BOX*(obj: pointer): bool +proc IS_BOX_CLASS*(klass: pointer): bool +proc BOX_GET_CLASS*(obj: pointer): PBoxClass +proc homogeneous*(a: var TBox): guint +proc set_homogeneous*(a: var TBox, `homogeneous`: guint) +proc expand*(a: var TBoxChild): guint +proc set_expand*(a: var TBoxChild, `expand`: guint) +proc fill*(a: var TBoxChild): guint +proc set_fill*(a: var TBoxChild, `fill`: guint) +proc pack*(a: var TBoxChild): guint +proc set_pack*(a: var TBoxChild, `pack`: guint) +proc is_secondary*(a: var TBoxChild): guint +proc set_is_secondary*(a: var TBoxChild, `is_secondary`: guint) +proc box_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_box_get_type".} +proc box_pack_start*(box: PBox, child: PWidget, expand: gboolean, + fill: gboolean, padding: guint){.cdecl, dynlib: lib, + importc: "gtk_box_pack_start".} +proc box_pack_end*(box: PBox, child: PWidget, expand: gboolean, fill: gboolean, + padding: guint){.cdecl, dynlib: lib, + importc: "gtk_box_pack_end".} +proc box_pack_start_defaults*(box: PBox, widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_box_pack_start_defaults".} +proc box_pack_end_defaults*(box: PBox, widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_box_pack_end_defaults".} +proc box_set_homogeneous*(box: PBox, homogeneous: gboolean){.cdecl, dynlib: lib, + importc: "gtk_box_set_homogeneous".} +proc box_get_homogeneous*(box: PBox): gboolean{.cdecl, dynlib: lib, + importc: "gtk_box_get_homogeneous".} +proc box_set_spacing*(box: PBox, spacing: gint){.cdecl, dynlib: lib, + importc: "gtk_box_set_spacing".} +proc box_get_spacing*(box: PBox): gint{.cdecl, dynlib: lib, + importc: "gtk_box_get_spacing".} +proc box_reorder_child*(box: PBox, child: PWidget, position: gint){.cdecl, + dynlib: lib, importc: "gtk_box_reorder_child".} +proc box_query_child_packing*(box: PBox, child: PWidget, expand: Pgboolean, + fill: Pgboolean, padding: Pguint, + pack_type: PPackType){.cdecl, dynlib: lib, + importc: "gtk_box_query_child_packing".} +proc box_set_child_packing*(box: PBox, child: PWidget, expand: gboolean, + fill: gboolean, padding: guint, pack_type: TPackType){. + cdecl, dynlib: lib, importc: "gtk_box_set_child_packing".} +const + BUTTONBOX_DEFAULT* = - (1) + +proc TYPE_BUTTON_BOX*(): GType +proc BUTTON_BOX*(obj: pointer): PButtonBox +proc BUTTON_BOX_CLASS*(klass: pointer): PButtonBoxClass +proc IS_BUTTON_BOX*(obj: pointer): bool +proc IS_BUTTON_BOX_CLASS*(klass: pointer): bool +proc BUTTON_BOX_GET_CLASS*(obj: pointer): PButtonBoxClass +proc button_box_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_button_box_get_type".} +proc button_box_get_layout*(widget: PButtonBox): TButtonBoxStyle{.cdecl, + dynlib: lib, importc: "gtk_button_box_get_layout".} +proc button_box_set_layout*(widget: PButtonBox, layout_style: TButtonBoxStyle){. + cdecl, dynlib: lib, importc: "gtk_button_box_set_layout".} +proc button_box_set_child_secondary*(widget: PButtonBox, child: PWidget, + is_secondary: gboolean){.cdecl, + dynlib: lib, importc: "gtk_button_box_set_child_secondary".} +proc button_box_child_requisition*(widget: PWidget, nvis_children: var int32, + nvis_secondaries: var int32, + width: var int32, height: var int32){.cdecl, + dynlib: lib, importc: "_gtk_button_box_child_requisition".} +const + bm_TGtkButton_constructed* = 0x0001'i16 + bp_TGtkButton_constructed* = 0'i16 + bm_TGtkButton_in_button* = 0x0002'i16 + bp_TGtkButton_in_button* = 1'i16 + bm_TGtkButton_button_down* = 0x0004'i16 + bp_TGtkButton_button_down* = 2'i16 + bm_TGtkButton_relief* = 0x0018'i16 + bp_TGtkButton_relief* = 3'i16 + bm_TGtkButton_use_underline* = 0x0020'i16 + bp_TGtkButton_use_underline* = 5'i16 + bm_TGtkButton_use_stock* = 0x0040'i16 + bp_TGtkButton_use_stock* = 6'i16 + bm_TGtkButton_depressed* = 0x0080'i16 + bp_TGtkButton_depressed* = 7'i16 + bm_TGtkButton_depress_on_activate* = 0x0100'i16 + bp_TGtkButton_depress_on_activate* = 8'i16 + +proc TYPE_BUTTON*(): GType +proc BUTTON*(obj: pointer): PButton +proc BUTTON_CLASS*(klass: pointer): PButtonClass +proc IS_BUTTON*(obj: pointer): bool +proc IS_BUTTON_CLASS*(klass: pointer): bool +proc BUTTON_GET_CLASS*(obj: pointer): PButtonClass +proc constructed*(a: var TButton): guint +proc set_constructed*(a: var TButton, `constructed`: guint) +proc in_button*(a: var TButton): guint +proc set_in_button*(a: var TButton, `in_button`: guint) +proc button_down*(a: var TButton): guint +proc set_button_down*(a: var TButton, `button_down`: guint) +proc relief*(a: var TButton): guint +proc set_relief*(a: var TButton, `relief`: guint) +proc use_underline*(a: var TButton): guint +proc set_use_underline*(a: var TButton, `use_underline`: guint) +proc use_stock*(a: var TButton): guint +proc set_use_stock*(a: var TButton, `use_stock`: guint) +proc depressed*(a: var TButton): guint +proc set_depressed*(a: var TButton, `depressed`: guint) +proc depress_on_activate*(a: var TButton): guint +proc set_depress_on_activate*(a: var TButton, `depress_on_activate`: guint) +proc button_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_button_get_type".} +proc button_new*(): PButton{.cdecl, dynlib: lib, importc: "gtk_button_new".} +proc button_new_with_label*(`label`: cstring): PButton{.cdecl, dynlib: lib, + importc: "gtk_button_new_with_label".} +proc button_new_from_stock*(stock_id: cstring): PButton{.cdecl, dynlib: lib, + importc: "gtk_button_new_from_stock".} +proc button_new_with_mnemonic*(`label`: cstring): PButton{.cdecl, dynlib: lib, + importc: "gtk_button_new_with_mnemonic".} +proc button_pressed*(button: PButton){.cdecl, dynlib: lib, + importc: "gtk_button_pressed".} +proc button_released*(button: PButton){.cdecl, dynlib: lib, + importc: "gtk_button_released".} +proc button_clicked*(button: PButton){.cdecl, dynlib: lib, + importc: "gtk_button_clicked".} +proc button_enter*(button: PButton){.cdecl, dynlib: lib, + importc: "gtk_button_enter".} +proc button_leave*(button: PButton){.cdecl, dynlib: lib, + importc: "gtk_button_leave".} +proc button_set_relief*(button: PButton, newstyle: TReliefStyle){.cdecl, + dynlib: lib, importc: "gtk_button_set_relief".} +proc button_get_relief*(button: PButton): TReliefStyle{.cdecl, dynlib: lib, + importc: "gtk_button_get_relief".} +proc button_set_label*(button: PButton, `label`: cstring){.cdecl, dynlib: lib, + importc: "gtk_button_set_label".} +proc button_get_label*(button: PButton): cstring{.cdecl, dynlib: lib, + importc: "gtk_button_get_label".} +proc button_set_use_underline*(button: PButton, use_underline: gboolean){.cdecl, + dynlib: lib, importc: "gtk_button_set_use_underline".} +proc button_get_use_underline*(button: PButton): gboolean{.cdecl, dynlib: lib, + importc: "gtk_button_get_use_underline".} +proc button_set_use_stock*(button: PButton, use_stock: gboolean){.cdecl, + dynlib: lib, importc: "gtk_button_set_use_stock".} +proc button_get_use_stock*(button: PButton): gboolean{.cdecl, dynlib: lib, + importc: "gtk_button_get_use_stock".} +proc button_set_depressed*(button: PButton, depressed: gboolean){.cdecl, + dynlib: lib, importc: "_gtk_button_set_depressed".} +proc button_paint*(button: PButton, area: PGdkRectangle, state_type: TStateType, + shadow_type: TShadowType, main_detail: cstring, + default_detail: cstring){.cdecl, dynlib: lib, + importc: "_gtk_button_paint".} +proc button_set_image*(button: PButton, image: PWidget){.cdecl, dynlib: lib, + importc: "gtk_button_set_image".} +proc button_get_image*(button: PButton): PWidget{.cdecl, dynlib: lib, + importc: "gtk_button_get_image".} +const + CALENDAR_SHOW_HEADING* = 1 shl 0 + CALENDAR_SHOW_DAY_NAMES* = 1 shl 1 + CALENDAR_NO_MONTH_CHANGE* = 1 shl 2 + CALENDAR_SHOW_WEEK_NUMBERS* = 1 shl 3 + CALENDAR_WEEK_START_MONDAY* = 1 shl 4 + +proc TYPE_CALENDAR*(): GType +proc CALENDAR*(obj: pointer): PCalendar +proc CALENDAR_CLASS*(klass: pointer): PCalendarClass +proc IS_CALENDAR*(obj: pointer): bool +proc IS_CALENDAR_CLASS*(klass: pointer): bool +proc CALENDAR_GET_CLASS*(obj: pointer): PCalendarClass +proc calendar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_calendar_get_type".} +proc calendar_new*(): PCalendar{.cdecl, dynlib: lib, importc: "gtk_calendar_new".} +proc calendar_select_month*(calendar: PCalendar, month: guint, year: guint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_calendar_select_month".} +proc calendar_select_day*(calendar: PCalendar, day: guint){.cdecl, dynlib: lib, + importc: "gtk_calendar_select_day".} +proc calendar_mark_day*(calendar: PCalendar, day: guint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_calendar_mark_day".} +proc calendar_unmark_day*(calendar: PCalendar, day: guint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_calendar_unmark_day".} +proc calendar_clear_marks*(calendar: PCalendar){.cdecl, dynlib: lib, + importc: "gtk_calendar_clear_marks".} +proc calendar_display_options*(calendar: PCalendar, + flags: TCalendarDisplayOptions){.cdecl, + dynlib: lib, importc: "gtk_calendar_display_options".} +proc calendar_get_date*(calendar: PCalendar, year: Pguint, month: Pguint, + day: Pguint){.cdecl, dynlib: lib, + importc: "gtk_calendar_get_date".} +proc calendar_freeze*(calendar: PCalendar){.cdecl, dynlib: lib, + importc: "gtk_calendar_freeze".} +proc calendar_thaw*(calendar: PCalendar){.cdecl, dynlib: lib, + importc: "gtk_calendar_thaw".} +proc TYPE_CELL_EDITABLE*(): GType +proc CELL_EDITABLE*(obj: pointer): PCellEditable +proc CELL_EDITABLE_CLASS*(obj: pointer): PCellEditableIface +proc IS_CELL_EDITABLE*(obj: pointer): bool +proc CELL_EDITABLE_GET_IFACE*(obj: pointer): PCellEditableIface +proc cell_editable_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_cell_editable_get_type".} +proc cell_editable_start_editing*(cell_editable: PCellEditable, event: PGdkEvent){. + cdecl, dynlib: lib, importc: "gtk_cell_editable_start_editing".} +proc cell_editable_editing_done*(cell_editable: PCellEditable){.cdecl, + dynlib: lib, importc: "gtk_cell_editable_editing_done".} +proc cell_editable_remove_widget*(cell_editable: PCellEditable){.cdecl, + dynlib: lib, importc: "gtk_cell_editable_remove_widget".} +const + CELL_RENDERER_SELECTED* = 1 shl 0 + CELL_RENDERER_PRELIT* = 1 shl 1 + CELL_RENDERER_INSENSITIVE* = 1 shl 2 + CELL_RENDERER_SORTED* = 1 shl 3 + +const + bm_TGtkCellRenderer_mode* = 0x0003'i16 + bp_TGtkCellRenderer_mode* = 0'i16 + bm_TGtkCellRenderer_visible* = 0x0004'i16 + bp_TGtkCellRenderer_visible* = 2'i16 + bm_TGtkCellRenderer_is_expander* = 0x0008'i16 + bp_TGtkCellRenderer_is_expander* = 3'i16 + bm_TGtkCellRenderer_is_expanded* = 0x0010'i16 + bp_TGtkCellRenderer_is_expanded* = 4'i16 + bm_TGtkCellRenderer_cell_background_set* = 0x0020'i16 + bp_TGtkCellRenderer_cell_background_set* = 5'i16 + +proc TYPE_CELL_RENDERER*(): GType +proc CELL_RENDERER*(obj: pointer): PCellRenderer +proc CELL_RENDERER_CLASS*(klass: pointer): PCellRendererClass +proc IS_CELL_RENDERER*(obj: pointer): bool +proc IS_CELL_RENDERER_CLASS*(klass: pointer): bool +proc CELL_RENDERER_GET_CLASS*(obj: pointer): PCellRendererClass +proc mode*(a: var TCellRenderer): guint +proc set_mode*(a: var TCellRenderer, `mode`: guint) +proc visible*(a: var TCellRenderer): guint +proc set_visible*(a: var TCellRenderer, `visible`: guint) +proc is_expander*(a: var TCellRenderer): guint +proc set_is_expander*(a: var TCellRenderer, `is_expander`: guint) +proc is_expanded*(a: var TCellRenderer): guint +proc set_is_expanded*(a: var TCellRenderer, `is_expanded`: guint) +proc cell_background_set*(a: var TCellRenderer): guint +proc set_cell_background_set*(a: var TCellRenderer, `cell_background_set`: guint) +proc cell_renderer_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_get_type".} +proc cell_renderer_get_size*(cell: PCellRenderer, widget: PWidget, + cell_area: PGdkRectangle, x_offset: Pgint, + y_offset: Pgint, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "gtk_cell_renderer_get_size".} +proc cell_renderer_render*(cell: PCellRenderer, window: PGdkWindow, + widget: PWidget, background_area: PGdkRectangle, + cell_area: PGdkRectangle, expose_area: PGdkRectangle, + flags: TCellRendererState){.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_render".} +proc cell_renderer_activate*(cell: PCellRenderer, event: PGdkEvent, + widget: PWidget, path: cstring, + background_area: PGdkRectangle, + cell_area: PGdkRectangle, flags: TCellRendererState): gboolean{. + cdecl, dynlib: lib, importc: "gtk_cell_renderer_activate".} +proc cell_renderer_start_editing*(cell: PCellRenderer, event: PGdkEvent, + widget: PWidget, path: cstring, + background_area: PGdkRectangle, + cell_area: PGdkRectangle, + flags: TCellRendererState): PCellEditable{. + cdecl, dynlib: lib, importc: "gtk_cell_renderer_start_editing".} +proc cell_renderer_set_fixed_size*(cell: PCellRenderer, width: gint, + height: gint){.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_set_fixed_size".} +proc cell_renderer_get_fixed_size*(cell: PCellRenderer, width: Pgint, + height: Pgint){.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_get_fixed_size".} +const + bm_TGtkCellRendererText_strikethrough* = 0x0001'i16 + bp_TGtkCellRendererText_strikethrough* = 0'i16 + bm_TGtkCellRendererText_editable* = 0x0002'i16 + bp_TGtkCellRendererText_editable* = 1'i16 + bm_TGtkCellRendererText_scale_set* = 0x0004'i16 + bp_TGtkCellRendererText_scale_set* = 2'i16 + bm_TGtkCellRendererText_foreground_set* = 0x0008'i16 + bp_TGtkCellRendererText_foreground_set* = 3'i16 + bm_TGtkCellRendererText_background_set* = 0x0010'i16 + bp_TGtkCellRendererText_background_set* = 4'i16 + bm_TGtkCellRendererText_underline_set* = 0x0020'i16 + bp_TGtkCellRendererText_underline_set* = 5'i16 + bm_TGtkCellRendererText_rise_set* = 0x0040'i16 + bp_TGtkCellRendererText_rise_set* = 6'i16 + bm_TGtkCellRendererText_strikethrough_set* = 0x0080'i16 + bp_TGtkCellRendererText_strikethrough_set* = 7'i16 + bm_TGtkCellRendererText_editable_set* = 0x0100'i16 + bp_TGtkCellRendererText_editable_set* = 8'i16 + bm_TGtkCellRendererText_calc_fixed_height* = 0x0200'i16 + bp_TGtkCellRendererText_calc_fixed_height* = 9'i16 + +proc TYPE_CELL_RENDERER_TEXT*(): GType +proc CELL_RENDERER_TEXT*(obj: pointer): PCellRendererText +proc CELL_RENDERER_TEXT_CLASS*(klass: pointer): PCellRendererTextClass +proc IS_CELL_RENDERER_TEXT*(obj: pointer): bool +proc IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool +proc CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PCellRendererTextClass +proc strikethrough*(a: var TCellRendererText): guint +proc set_strikethrough*(a: var TCellRendererText, `strikethrough`: guint) +proc editable*(a: var TCellRendererText): guint +proc set_editable*(a: var TCellRendererText, `editable`: guint) +proc scale_set*(a: var TCellRendererText): guint +proc set_scale_set*(a: var TCellRendererText, `scale_set`: guint) +proc foreground_set*(a: var TCellRendererText): guint +proc set_foreground_set*(a: var TCellRendererText, `foreground_set`: guint) +proc background_set*(a: var TCellRendererText): guint +proc set_background_set*(a: var TCellRendererText, `background_set`: guint) +proc underline_set*(a: var TCellRendererText): guint +proc set_underline_set*(a: var TCellRendererText, `underline_set`: guint) +proc rise_set*(a: var TCellRendererText): guint +proc set_rise_set*(a: var TCellRendererText, `rise_set`: guint) +proc strikethrough_set*(a: var TCellRendererText): guint +proc set_strikethrough_set*(a: var TCellRendererText, `strikethrough_set`: guint) +proc editable_set*(a: var TCellRendererText): guint +proc set_editable_set*(a: var TCellRendererText, `editable_set`: guint) +proc calc_fixed_height*(a: var TCellRendererText): guint +proc set_calc_fixed_height*(a: var TCellRendererText, `calc_fixed_height`: guint) +proc cell_renderer_text_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_text_get_type".} +proc cell_renderer_text_new*(): PCellRenderer{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_text_new".} +proc cell_renderer_text_set_fixed_height_from_font*(renderer: PCellRendererText, + number_of_rows: gint){.cdecl, dynlib: lib, importc: "gtk_cell_renderer_text_set_fixed_height_from_font".} +const + bm_TGtkCellRendererToggle_active* = 0x0001'i16 + bp_TGtkCellRendererToggle_active* = 0'i16 + bm_TGtkCellRendererToggle_activatable* = 0x0002'i16 + bp_TGtkCellRendererToggle_activatable* = 1'i16 + bm_TGtkCellRendererToggle_radio* = 0x0004'i16 + bp_TGtkCellRendererToggle_radio* = 2'i16 + +proc TYPE_CELL_RENDERER_TOGGLE*(): GType +proc CELL_RENDERER_TOGGLE*(obj: pointer): PCellRendererToggle +proc CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PCellRendererToggleClass +proc IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool +proc IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool +proc CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PCellRendererToggleClass +proc active*(a: var TCellRendererToggle): guint +proc set_active*(a: var TCellRendererToggle, `active`: guint) +proc activatable*(a: var TCellRendererToggle): guint +proc set_activatable*(a: var TCellRendererToggle, `activatable`: guint) +proc radio*(a: var TCellRendererToggle): guint +proc set_radio*(a: var TCellRendererToggle, `radio`: guint) +proc cell_renderer_toggle_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_toggle_get_type".} +proc cell_renderer_toggle_new*(): PCellRenderer{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_toggle_new".} +proc cell_renderer_toggle_get_radio*(toggle: PCellRendererToggle): gboolean{. + cdecl, dynlib: lib, importc: "gtk_cell_renderer_toggle_get_radio".} +proc cell_renderer_toggle_set_radio*(toggle: PCellRendererToggle, + radio: gboolean){.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_toggle_set_radio".} +proc cell_renderer_toggle_get_active*(toggle: PCellRendererToggle): gboolean{. + cdecl, dynlib: lib, importc: "gtk_cell_renderer_toggle_get_active".} +proc cell_renderer_toggle_set_active*(toggle: PCellRendererToggle, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_toggle_set_active".} +proc TYPE_CELL_RENDERER_PIXBUF*(): GType +proc CELL_RENDERER_PIXBUF*(obj: pointer): PCellRendererPixbuf +proc CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PCellRendererPixbufClass +proc IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool +proc IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool +proc CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PCellRendererPixbufClass +proc cell_renderer_pixbuf_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_pixbuf_get_type".} +proc cell_renderer_pixbuf_new*(): PCellRenderer{.cdecl, dynlib: lib, + importc: "gtk_cell_renderer_pixbuf_new".} +proc TYPE_ITEM*(): GType +proc ITEM*(obj: pointer): PItem +proc ITEM_CLASS*(klass: pointer): PItemClass +proc IS_ITEM*(obj: pointer): bool +proc IS_ITEM_CLASS*(klass: pointer): bool +proc ITEM_GET_CLASS*(obj: pointer): PItemClass +proc item_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_item_get_type".} +proc item_select*(item: PItem){.cdecl, dynlib: lib, importc: "gtk_item_select".} +proc item_deselect*(item: PItem){.cdecl, dynlib: lib, + importc: "gtk_item_deselect".} +proc item_toggle*(item: PItem){.cdecl, dynlib: lib, importc: "gtk_item_toggle".} +const + bm_TGtkMenuItem_show_submenu_indicator* = 0x0001'i16 + bp_TGtkMenuItem_show_submenu_indicator* = 0'i16 + bm_TGtkMenuItem_submenu_placement* = 0x0002'i16 + bp_TGtkMenuItem_submenu_placement* = 1'i16 + bm_TGtkMenuItem_submenu_direction* = 0x0004'i16 + bp_TGtkMenuItem_submenu_direction* = 2'i16 + bm_TGtkMenuItem_right_justify* = 0x0008'i16 + bp_TGtkMenuItem_right_justify* = 3'i16 + bm_TGtkMenuItem_timer_from_keypress* = 0x0010'i16 + bp_TGtkMenuItem_timer_from_keypress* = 4'i16 + bm_TGtkMenuItemClass_hide_on_activate* = 0x0001'i16 + bp_TGtkMenuItemClass_hide_on_activate* = 0'i16 + +proc TYPE_MENU_ITEM*(): GType +proc MENU_ITEM*(obj: pointer): PMenuItem +proc MENU_ITEM_CLASS*(klass: pointer): PMenuItemClass +proc IS_MENU_ITEM*(obj: pointer): bool +proc IS_MENU_ITEM_CLASS*(klass: pointer): bool +proc MENU_ITEM_GET_CLASS*(obj: pointer): PMenuItemClass +proc show_submenu_indicator*(a: var TMenuItem): guint +proc set_show_submenu_indicator*(a: var TMenuItem, + `show_submenu_indicator`: guint) +proc submenu_placement*(a: var TMenuItem): guint +proc set_submenu_placement*(a: var TMenuItem, `submenu_placement`: guint) +proc submenu_direction*(a: var TMenuItem): guint +proc set_submenu_direction*(a: var TMenuItem, `submenu_direction`: guint) +proc right_justify*(a: var TMenuItem): guint +proc set_right_justify*(a: var TMenuItem, `right_justify`: guint) +proc timer_from_keypress*(a: var TMenuItem): guint +proc set_timer_from_keypress*(a: var TMenuItem, `timer_from_keypress`: guint) +proc hide_on_activate*(a: var TMenuItemClass): guint +proc set_hide_on_activate*(a: var TMenuItemClass, `hide_on_activate`: guint) +proc menu_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_menu_item_get_type".} +proc menu_item_new*(): PMenuItem{.cdecl, dynlib: lib, + importc: "gtk_menu_item_new".} +proc menu_item_new_with_label*(`label`: cstring): PMenuItem{.cdecl, dynlib: lib, + importc: "gtk_menu_item_new_with_label".} +proc menu_item_new_with_mnemonic*(`label`: cstring): PMenuItem{.cdecl, + dynlib: lib, importc: "gtk_menu_item_new_with_mnemonic".} +proc menu_item_set_submenu*(menu_item: PMenuItem, submenu: PWidget){.cdecl, + dynlib: lib, importc: "gtk_menu_item_set_submenu".} +proc menu_item_get_submenu*(menu_item: PMenuItem): PWidget{.cdecl, dynlib: lib, + importc: "gtk_menu_item_get_submenu".} +proc menu_item_remove_submenu*(menu_item: PMenuItem){.cdecl, dynlib: lib, + importc: "gtk_menu_item_remove_submenu".} +proc menu_item_select*(menu_item: PMenuItem){.cdecl, dynlib: lib, + importc: "gtk_menu_item_select".} +proc menu_item_deselect*(menu_item: PMenuItem){.cdecl, dynlib: lib, + importc: "gtk_menu_item_deselect".} +proc menu_item_activate*(menu_item: PMenuItem){.cdecl, dynlib: lib, + importc: "gtk_menu_item_activate".} +proc menu_item_toggle_size_request*(menu_item: PMenuItem, requisition: Pgint){. + cdecl, dynlib: lib, importc: "gtk_menu_item_toggle_size_request".} +proc menu_item_toggle_size_allocate*(menu_item: PMenuItem, allocation: gint){. + cdecl, dynlib: lib, importc: "gtk_menu_item_toggle_size_allocate".} +proc menu_item_set_right_justified*(menu_item: PMenuItem, + right_justified: gboolean){.cdecl, + dynlib: lib, importc: "gtk_menu_item_set_right_justified".} +proc menu_item_get_right_justified*(menu_item: PMenuItem): gboolean{.cdecl, + dynlib: lib, importc: "gtk_menu_item_get_right_justified".} +proc menu_item_set_accel_path*(menu_item: PMenuItem, accel_path: cstring){. + cdecl, dynlib: lib, importc: "gtk_menu_item_set_accel_path".} +proc menu_item_refresh_accel_path*(menu_item: PMenuItem, prefix: cstring, + accel_group: PAccelGroup, + group_changed: gboolean){.cdecl, dynlib: lib, + importc: "_gtk_menu_item_refresh_accel_path".} +proc menu_item_is_selectable*(menu_item: PWidget): gboolean{.cdecl, dynlib: lib, + importc: "_gtk_menu_item_is_selectable".} +const + bm_TGtkToggleButton_active* = 0x0001'i16 + bp_TGtkToggleButton_active* = 0'i16 + bm_TGtkToggleButton_draw_indicator* = 0x0002'i16 + bp_TGtkToggleButton_draw_indicator* = 1'i16 + bm_TGtkToggleButton_inconsistent* = 0x0004'i16 + bp_TGtkToggleButton_inconsistent* = 2'i16 + +proc TYPE_TOGGLE_BUTTON*(): GType +proc TOGGLE_BUTTON*(obj: pointer): PToggleButton +proc TOGGLE_BUTTON_CLASS*(klass: pointer): PToggleButtonClass +proc IS_TOGGLE_BUTTON*(obj: pointer): bool +proc IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool +proc TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PToggleButtonClass +proc active*(a: var TToggleButton): guint +proc set_active*(a: var TToggleButton, `active`: guint) +proc draw_indicator*(a: var TToggleButton): guint +proc set_draw_indicator*(a: var TToggleButton, `draw_indicator`: guint) +proc inconsistent*(a: var TToggleButton): guint +proc set_inconsistent*(a: var TToggleButton, `inconsistent`: guint) +proc toggle_button_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_toggle_button_get_type".} +proc toggle_button_new*(): PToggleButton{.cdecl, dynlib: lib, + importc: "gtk_toggle_button_new".} +proc toggle_button_new_with_label*(`label`: cstring): PToggleButton{.cdecl, + dynlib: lib, importc: "gtk_toggle_button_new_with_label".} +proc toggle_button_new_with_mnemonic*(`label`: cstring): PToggleButton{.cdecl, + dynlib: lib, importc: "gtk_toggle_button_new_with_mnemonic".} +proc toggle_button_set_mode*(toggle_button: PToggleButton, + draw_indicator: gboolean){.cdecl, dynlib: lib, + importc: "gtk_toggle_button_set_mode".} +proc toggle_button_get_mode*(toggle_button: PToggleButton): gboolean{.cdecl, + dynlib: lib, importc: "gtk_toggle_button_get_mode".} +proc toggle_button_set_active*(toggle_button: PToggleButton, is_active: gboolean){. + cdecl, dynlib: lib, importc: "gtk_toggle_button_set_active".} +proc toggle_button_get_active*(toggle_button: PToggleButton): gboolean{.cdecl, + dynlib: lib, importc: "gtk_toggle_button_get_active".} +proc toggle_button_toggled*(toggle_button: PToggleButton){.cdecl, dynlib: lib, + importc: "gtk_toggle_button_toggled".} +proc toggle_button_set_inconsistent*(toggle_button: PToggleButton, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_toggle_button_set_inconsistent".} +proc toggle_button_get_inconsistent*(toggle_button: PToggleButton): gboolean{. + cdecl, dynlib: lib, importc: "gtk_toggle_button_get_inconsistent".} +proc TYPE_CHECK_BUTTON*(): GType +proc CHECK_BUTTON*(obj: pointer): PCheckButton +proc CHECK_BUTTON_CLASS*(klass: pointer): PCheckButtonClass +proc IS_CHECK_BUTTON*(obj: pointer): bool +proc IS_CHECK_BUTTON_CLASS*(klass: pointer): bool +proc CHECK_BUTTON_GET_CLASS*(obj: pointer): PCheckButtonClass +proc check_button_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_check_button_get_type".} +proc check_button_new*(): PCheckButton{.cdecl, dynlib: lib, + importc: "gtk_check_button_new".} +proc check_button_new_with_label*(`label`: cstring): PCheckButton{.cdecl, + dynlib: lib, importc: "gtk_check_button_new_with_label".} +proc check_button_new_with_mnemonic*(`label`: cstring): PCheckButton{.cdecl, + dynlib: lib, importc: "gtk_check_button_new_with_mnemonic".} +proc check_button_get_props*(check_button: PCheckButton, indicator_size: Pgint, + indicator_spacing: Pgint){.cdecl, dynlib: lib, + importc: "_gtk_check_button_get_props".} +const + bm_TGtkCheckMenuItem_active* = 0x0001'i16 + bp_TGtkCheckMenuItem_active* = 0'i16 + bm_TGtkCheckMenuItem_always_show_toggle* = 0x0002'i16 + bp_TGtkCheckMenuItem_always_show_toggle* = 1'i16 + bm_TGtkCheckMenuItem_inconsistent* = 0x0004'i16 + bp_TGtkCheckMenuItem_inconsistent* = 2'i16 + +proc TYPE_CHECK_MENU_ITEM*(): GType +proc CHECK_MENU_ITEM*(obj: pointer): PCheckMenuItem +proc CHECK_MENU_ITEM_CLASS*(klass: pointer): PCheckMenuItemClass +proc IS_CHECK_MENU_ITEM*(obj: pointer): bool +proc IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool +proc CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PCheckMenuItemClass +proc active*(a: var TCheckMenuItem): guint +proc set_active*(a: var TCheckMenuItem, `active`: guint) +proc always_show_toggle*(a: var TCheckMenuItem): guint +proc set_always_show_toggle*(a: var TCheckMenuItem, `always_show_toggle`: guint) +proc inconsistent*(a: var TCheckMenuItem): guint +proc set_inconsistent*(a: var TCheckMenuItem, `inconsistent`: guint) +proc check_menu_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_check_menu_item_get_type".} +proc check_menu_item_new*(): PWidget{.cdecl, dynlib: lib, + importc: "gtk_check_menu_item_new".} +proc check_menu_item_new_with_label*(`label`: cstring): PWidget{.cdecl, + dynlib: lib, importc: "gtk_check_menu_item_new_with_label".} +proc check_menu_item_new_with_mnemonic*(`label`: cstring): PWidget{.cdecl, + dynlib: lib, importc: "gtk_check_menu_item_new_with_mnemonic".} +proc check_menu_item_set_active*(check_menu_item: PCheckMenuItem, + is_active: gboolean){.cdecl, dynlib: lib, + importc: "gtk_check_menu_item_set_active".} +proc check_menu_item_get_active*(check_menu_item: PCheckMenuItem): gboolean{. + cdecl, dynlib: lib, importc: "gtk_check_menu_item_get_active".} +proc check_menu_item_toggled*(check_menu_item: PCheckMenuItem){.cdecl, + dynlib: lib, importc: "gtk_check_menu_item_toggled".} +proc check_menu_item_set_inconsistent*(check_menu_item: PCheckMenuItem, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_check_menu_item_set_inconsistent".} +proc check_menu_item_get_inconsistent*(check_menu_item: PCheckMenuItem): gboolean{. + cdecl, dynlib: lib, importc: "gtk_check_menu_item_get_inconsistent".} +proc clipboard_get_for_display*(display: PGdkDisplay, selection: TGdkAtom): PClipboard{. + cdecl, dynlib: lib, importc: "gtk_clipboard_get_for_display".} +proc clipboard_get_display*(clipboard: PClipboard): PGdkDisplay{.cdecl, + dynlib: lib, importc: "gtk_clipboard_get_display".} +proc clipboard_set_with_data*(clipboard: PClipboard, targets: PTargetEntry, + n_targets: guint, get_func: TClipboardGetFunc, + clear_func: TClipboardClearFunc, + user_data: gpointer): gboolean{.cdecl, + dynlib: lib, importc: "gtk_clipboard_set_with_data".} +proc clipboard_set_with_owner*(clipboard: PClipboard, targets: PTargetEntry, + n_targets: guint, get_func: TClipboardGetFunc, + clear_func: TClipboardClearFunc, owner: PGObject): gboolean{. + cdecl, dynlib: lib, importc: "gtk_clipboard_set_with_owner".} +proc clipboard_get_owner*(clipboard: PClipboard): PGObject{.cdecl, dynlib: lib, + importc: "gtk_clipboard_get_owner".} +proc clipboard_clear*(clipboard: PClipboard){.cdecl, dynlib: lib, + importc: "gtk_clipboard_clear".} +proc clipboard_set_text*(clipboard: PClipboard, text: cstring, len: gint){. + cdecl, dynlib: lib, importc: "gtk_clipboard_set_text".} +proc clipboard_request_contents*(clipboard: PClipboard, target: TGdkAtom, + callback: TClipboardReceivedFunc, + user_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_clipboard_request_contents".} +proc clipboard_request_text*(clipboard: PClipboard, + callback: TClipboardTextReceivedFunc, + user_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_clipboard_request_text".} +proc clipboard_wait_for_contents*(clipboard: PClipboard, target: TGdkAtom): PSelectionData{. + cdecl, dynlib: lib, importc: "gtk_clipboard_wait_for_contents".} +proc clipboard_wait_for_text*(clipboard: PClipboard): cstring{.cdecl, + dynlib: lib, importc: "gtk_clipboard_wait_for_text".} +proc clipboard_wait_is_text_available*(clipboard: PClipboard): gboolean{.cdecl, + dynlib: lib, importc: "gtk_clipboard_wait_is_text_available".} +const + CLIST_IN_DRAG* = 1 shl 0 + CLIST_ROW_HEIGHT_SET* = 1 shl 1 + CLIST_SHOW_TITLES* = 1 shl 2 + CLIST_ADD_MODE* = 1 shl 4 + CLIST_AUTO_SORT* = 1 shl 5 + CLIST_AUTO_RESIZE_BLOCKED* = 1 shl 6 + CLIST_REORDERABLE* = 1 shl 7 + CLIST_USE_DRAG_ICONS* = 1 shl 8 + CLIST_DRAW_DRAG_LINE* = 1 shl 9 + CLIST_DRAW_DRAG_RECT* = 1 shl 10 + BUTTON_IGNORED* = 0 + BUTTON_SELECTS* = 1 shl 0 + BUTTON_DRAGS* = 1 shl 1 + BUTTON_EXPANDS* = 1 shl 2 + +const + bm_TGtkCListColumn_visible* = 0x0001'i16 + bp_TGtkCListColumn_visible* = 0'i16 + bm_TGtkCListColumn_width_set* = 0x0002'i16 + bp_TGtkCListColumn_width_set* = 1'i16 + bm_TGtkCListColumn_resizeable* = 0x0004'i16 + bp_TGtkCListColumn_resizeable* = 2'i16 + bm_TGtkCListColumn_auto_resize* = 0x0008'i16 + bp_TGtkCListColumn_auto_resize* = 3'i16 + bm_TGtkCListColumn_button_passive* = 0x0010'i16 + bp_TGtkCListColumn_button_passive* = 4'i16 + bm_TGtkCListRow_fg_set* = 0x0001'i16 + bp_TGtkCListRow_fg_set* = 0'i16 + bm_TGtkCListRow_bg_set* = 0x0002'i16 + bp_TGtkCListRow_bg_set* = 1'i16 + bm_TGtkCListRow_selectable* = 0x0004'i16 + bp_TGtkCListRow_selectable* = 2'i16 + +proc TYPE_CLIST*(): GType +proc CLIST*(obj: pointer): PCList +proc CLIST_CLASS*(klass: pointer): PCListClass +proc IS_CLIST*(obj: pointer): bool +proc IS_CLIST_CLASS*(klass: pointer): bool +proc CLIST_GET_CLASS*(obj: pointer): PCListClass +proc CLIST_FLAGS*(clist: pointer): guint16 +proc CLIST_SET_FLAG*(clist: PCList, flag: guint16) +proc CLIST_UNSET_FLAG*(clist: PCList, flag: guint16) +#proc GTK_CLIST_IN_DRAG_get*(clist: pointer): bool +#proc GTK_CLIST_ROW_HEIGHT_SET_get*(clist: pointer): bool +#proc GTK_CLIST_SHOW_TITLES_get*(clist: pointer): bool +#proc GTK_CLIST_ADD_MODE_get*(clist: pointer): bool +#proc GTK_CLIST_AUTO_SORT_get*(clist: pointer): bool +#proc GTK_CLIST_AUTO_RESIZE_BLOCKED_get*(clist: pointer): bool +#proc GTK_CLIST_REORDERABLE_get*(clist: pointer): bool +#proc GTK_CLIST_USE_DRAG_ICONS_get*(clist: pointer): bool +#proc GTK_CLIST_DRAW_DRAG_LINE_get*(clist: pointer): bool +#proc GTK_CLIST_DRAW_DRAG_RECT_get*(clist: pointer): bool +#proc GTK_CLIST_ROW_get*(`glist_`: PGList): PGtkCListRow +#proc GTK_CELL_TEXT_get*(cell: pointer): PGtkCellText +#proc GTK_CELL_PIXMAP_get*(cell: pointer): PGtkCellPixmap +#proc GTK_CELL_PIXTEXT_get*(cell: pointer): PGtkCellPixText +#proc GTK_CELL_WIDGET_get*(cell: pointer): PGtkCellWidget + +proc visible*(a: var TCListColumn): guint +proc set_visible*(a: var TCListColumn, `visible`: guint) +proc width_set*(a: var TCListColumn): guint +proc set_width_set*(a: var TCListColumn, `width_set`: guint) +proc resizeable*(a: var TCListColumn): guint +proc set_resizeable*(a: var TCListColumn, `resizeable`: guint) +proc auto_resize*(a: var TCListColumn): guint +proc set_auto_resize*(a: var TCListColumn, `auto_resize`: guint) +proc button_passive*(a: var TCListColumn): guint +proc set_button_passive*(a: var TCListColumn, `button_passive`: guint) +proc fg_set*(a: var TCListRow): guint +proc set_fg_set*(a: var TCListRow, `fg_set`: guint) +proc bg_set*(a: var TCListRow): guint +proc set_bg_set*(a: var TCListRow, `bg_set`: guint) +proc selectable*(a: var TCListRow): guint +proc set_selectable*(a: var TCListRow, `selectable`: guint) +proc clist_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_clist_get_type".} +proc clist_new*(columns: gint): PCList{.cdecl, dynlib: lib, + importc: "gtk_clist_new".} +proc clist_set_hadjustment*(clist: PCList, adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_clist_set_hadjustment".} +proc clist_set_vadjustment*(clist: PCList, adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_clist_set_vadjustment".} +proc clist_get_hadjustment*(clist: PCList): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_clist_get_hadjustment".} +proc clist_get_vadjustment*(clist: PCList): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_clist_get_vadjustment".} +proc clist_set_shadow_type*(clist: PCList, thetype: TShadowType){.cdecl, + dynlib: lib, importc: "gtk_clist_set_shadow_type".} +proc clist_set_selection_mode*(clist: PCList, mode: TSelectionMode){.cdecl, + dynlib: lib, importc: "gtk_clist_set_selection_mode".} +proc clist_set_reorderable*(clist: PCList, reorderable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_clist_set_reorderable".} +proc clist_set_use_drag_icons*(clist: PCList, use_icons: gboolean){.cdecl, + dynlib: lib, importc: "gtk_clist_set_use_drag_icons".} +proc clist_set_button_actions*(clist: PCList, button: guint, + button_actions: guint8){.cdecl, dynlib: lib, + importc: "gtk_clist_set_button_actions".} +proc clist_freeze*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_freeze".} +proc clist_thaw*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_thaw".} +proc clist_column_titles_show*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_column_titles_show".} +proc clist_column_titles_hide*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_column_titles_hide".} +proc clist_column_title_active*(clist: PCList, column: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_column_title_active".} +proc clist_column_title_passive*(clist: PCList, column: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_column_title_passive".} +proc clist_column_titles_active*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_column_titles_active".} +proc clist_column_titles_passive*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_column_titles_passive".} +proc clist_set_column_title*(clist: PCList, column: gint, title: cstring){. + cdecl, dynlib: lib, importc: "gtk_clist_set_column_title".} +proc clist_get_column_title*(clist: PCList, column: gint): cstring{.cdecl, + dynlib: lib, importc: "gtk_clist_get_column_title".} +proc clist_set_column_widget*(clist: PCList, column: gint, widget: PWidget){. + cdecl, dynlib: lib, importc: "gtk_clist_set_column_widget".} +proc clist_get_column_widget*(clist: PCList, column: gint): PWidget{.cdecl, + dynlib: lib, importc: "gtk_clist_get_column_widget".} +proc clist_set_column_justification*(clist: PCList, column: gint, + justification: TJustification){.cdecl, + dynlib: lib, importc: "gtk_clist_set_column_justification".} +proc clist_set_column_visibility*(clist: PCList, column: gint, visible: gboolean){. + cdecl, dynlib: lib, importc: "gtk_clist_set_column_visibility".} +proc clist_set_column_resizeable*(clist: PCList, column: gint, + resizeable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_clist_set_column_resizeable".} +proc clist_set_column_auto_resize*(clist: PCList, column: gint, + auto_resize: gboolean){.cdecl, dynlib: lib, + importc: "gtk_clist_set_column_auto_resize".} +proc clist_columns_autosize*(clist: PCList): gint{.cdecl, dynlib: lib, + importc: "gtk_clist_columns_autosize".} +proc clist_optimal_column_width*(clist: PCList, column: gint): gint{.cdecl, + dynlib: lib, importc: "gtk_clist_optimal_column_width".} +proc clist_set_column_width*(clist: PCList, column: gint, width: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_set_column_width".} +proc clist_set_column_min_width*(clist: PCList, column: gint, min_width: gint){. + cdecl, dynlib: lib, importc: "gtk_clist_set_column_min_width".} +proc clist_set_column_max_width*(clist: PCList, column: gint, max_width: gint){. + cdecl, dynlib: lib, importc: "gtk_clist_set_column_max_width".} +proc clist_set_row_height*(clist: PCList, height: guint){.cdecl, dynlib: lib, + importc: "gtk_clist_set_row_height".} +proc clist_moveto*(clist: PCList, row: gint, column: gint, row_align: gfloat, + col_align: gfloat){.cdecl, dynlib: lib, + importc: "gtk_clist_moveto".} +proc clist_row_is_visible*(clist: PCList, row: gint): TVisibility{.cdecl, + dynlib: lib, importc: "gtk_clist_row_is_visible".} +proc clist_get_cell_type*(clist: PCList, row: gint, column: gint): TCellType{. + cdecl, dynlib: lib, importc: "gtk_clist_get_cell_type".} +proc clist_set_text*(clist: PCList, row: gint, column: gint, text: cstring){. + cdecl, dynlib: lib, importc: "gtk_clist_set_text".} +proc clist_get_text*(clist: PCList, row: gint, column: gint, text: PPgchar): gint{. + cdecl, dynlib: lib, importc: "gtk_clist_get_text".} +proc clist_set_pixmap*(clist: PCList, row: gint, column: gint, + pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, + dynlib: lib, importc: "gtk_clist_set_pixmap".} +proc clist_get_pixmap*(clist: PCList, row: gint, column: gint, + pixmap: var PGdkPixmap, mask: var PGdkBitmap): gint{. + cdecl, dynlib: lib, importc: "gtk_clist_get_pixmap".} +proc clist_set_pixtext*(clist: PCList, row: gint, column: gint, text: cstring, + spacing: guint8, pixmap: PGdkPixmap, mask: PGdkBitmap){. + cdecl, dynlib: lib, importc: "gtk_clist_set_pixtext".} +proc clist_set_foreground*(clist: PCList, row: gint, color: PGdkColor){.cdecl, + dynlib: lib, importc: "gtk_clist_set_foreground".} +proc clist_set_background*(clist: PCList, row: gint, color: PGdkColor){.cdecl, + dynlib: lib, importc: "gtk_clist_set_background".} +proc clist_set_cell_style*(clist: PCList, row: gint, column: gint, style: PStyle){. + cdecl, dynlib: lib, importc: "gtk_clist_set_cell_style".} +proc clist_get_cell_style*(clist: PCList, row: gint, column: gint): PStyle{. + cdecl, dynlib: lib, importc: "gtk_clist_get_cell_style".} +proc clist_set_row_style*(clist: PCList, row: gint, style: PStyle){.cdecl, + dynlib: lib, importc: "gtk_clist_set_row_style".} +proc clist_get_row_style*(clist: PCList, row: gint): PStyle{.cdecl, dynlib: lib, + importc: "gtk_clist_get_row_style".} +proc clist_set_shift*(clist: PCList, row: gint, column: gint, vertical: gint, + horizontal: gint){.cdecl, dynlib: lib, + importc: "gtk_clist_set_shift".} +proc clist_set_selectable*(clist: PCList, row: gint, selectable: gboolean){. + cdecl, dynlib: lib, importc: "gtk_clist_set_selectable".} +proc clist_get_selectable*(clist: PCList, row: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_clist_get_selectable".} +proc clist_remove*(clist: PCList, row: gint){.cdecl, dynlib: lib, + importc: "gtk_clist_remove".} +proc clist_set_row_data*(clist: PCList, row: gint, data: gpointer){.cdecl, + dynlib: lib, importc: "gtk_clist_set_row_data".} +proc clist_set_row_data_full*(clist: PCList, row: gint, data: gpointer, + destroy: TDestroyNotify){.cdecl, dynlib: lib, + importc: "gtk_clist_set_row_data_full".} +proc clist_get_row_data*(clist: PCList, row: gint): gpointer{.cdecl, + dynlib: lib, importc: "gtk_clist_get_row_data".} +proc clist_find_row_from_data*(clist: PCList, data: gpointer): gint{.cdecl, + dynlib: lib, importc: "gtk_clist_find_row_from_data".} +proc clist_select_row*(clist: PCList, row: gint, column: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_select_row".} +proc clist_unselect_row*(clist: PCList, row: gint, column: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_unselect_row".} +proc clist_undo_selection*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_undo_selection".} +proc clist_clear*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_clear".} +proc clist_get_selection_info*(clist: PCList, x: gint, y: gint, row: Pgint, + column: Pgint): gint{.cdecl, dynlib: lib, + importc: "gtk_clist_get_selection_info".} +proc clist_select_all*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_select_all".} +proc clist_unselect_all*(clist: PCList){.cdecl, dynlib: lib, + importc: "gtk_clist_unselect_all".} +proc clist_swap_rows*(clist: PCList, row1: gint, row2: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_swap_rows".} +proc clist_row_move*(clist: PCList, source_row: gint, dest_row: gint){.cdecl, + dynlib: lib, importc: "gtk_clist_row_move".} +proc clist_set_compare_func*(clist: PCList, cmp_func: TCListCompareFunc){.cdecl, + dynlib: lib, importc: "gtk_clist_set_compare_func".} +proc clist_set_sort_column*(clist: PCList, column: gint){.cdecl, dynlib: lib, + importc: "gtk_clist_set_sort_column".} +proc clist_set_sort_type*(clist: PCList, sort_type: TSortType){.cdecl, + dynlib: lib, importc: "gtk_clist_set_sort_type".} +proc clist_sort*(clist: PCList){.cdecl, dynlib: lib, importc: "gtk_clist_sort".} +proc clist_set_auto_sort*(clist: PCList, auto_sort: gboolean){.cdecl, + dynlib: lib, importc: "gtk_clist_set_auto_sort".} +proc clist_create_cell_layout*(clist: PCList, clist_row: PCListRow, column: gint): PPangoLayout{. + cdecl, dynlib: lib, importc: "_gtk_clist_create_cell_layout".} +const + DIALOG_MODAL* = 1 shl 0 + DIALOG_DESTROY_WITH_PARENT* = 1 shl 1 + DIALOG_NO_SEPARATOR* = 1 shl 2 + RESPONSE_NONE* = - (1) + RESPONSE_REJECT* = - (2) + RESPONSE_ACCEPT* = - (3) + RESPONSE_DELETE_EVENT* = - (4) + RESPONSE_OK* = - (5) + RESPONSE_CANCEL* = - (6) + RESPONSE_CLOSE* = - (7) + RESPONSE_YES* = - (8) + RESPONSE_NO* = - (9) + RESPONSE_APPLY* = - (10) + RESPONSE_HELP* = - (11) + +proc TYPE_DIALOG*(): GType +proc DIALOG*(obj: pointer): PDialog +proc DIALOG_CLASS*(klass: pointer): PDialogClass +proc IS_DIALOG*(obj: pointer): bool +proc IS_DIALOG_CLASS*(klass: pointer): bool +proc DIALOG_GET_CLASS*(obj: pointer): PDialogClass +proc dialog_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_dialog_get_type".} +proc dialog_new*(): PDialog{.cdecl, dynlib: lib, importc: "gtk_dialog_new".} +proc dialog_add_action_widget*(dialog: PDialog, child: PWidget, + response_id: gint){.cdecl, dynlib: lib, + importc: "gtk_dialog_add_action_widget".} +proc dialog_add_button*(dialog: PDialog, button_text: cstring, response_id: gint): PWidget{. + cdecl, dynlib: lib, importc: "gtk_dialog_add_button".} +proc dialog_set_response_sensitive*(dialog: PDialog, response_id: gint, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_dialog_set_response_sensitive".} +proc dialog_set_default_response*(dialog: PDialog, response_id: gint){.cdecl, + dynlib: lib, importc: "gtk_dialog_set_default_response".} +proc dialog_set_has_separator*(dialog: PDialog, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_dialog_set_has_separator".} +proc dialog_get_has_separator*(dialog: PDialog): gboolean{.cdecl, dynlib: lib, + importc: "gtk_dialog_get_has_separator".} +proc dialog_response*(dialog: PDialog, response_id: gint){.cdecl, dynlib: lib, + importc: "gtk_dialog_response".} +proc dialog_run*(dialog: PDialog): gint{.cdecl, dynlib: lib, + importc: "gtk_dialog_run".} +proc show_about_dialog*(parent: PWindow, firstPropertyName: cstring){.cdecl, + dynlib: lib, importc: "gtk_show_about_dialog", varargs.} +proc TYPE_VBOX*(): GType +proc VBOX*(obj: pointer): PVBox +proc VBOX_CLASS*(klass: pointer): PVBoxClass +proc IS_VBOX*(obj: pointer): bool +proc IS_VBOX_CLASS*(klass: pointer): bool +proc VBOX_GET_CLASS*(obj: pointer): PVBoxClass +proc vbox_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_vbox_get_type".} +proc vbox_new*(homogeneous: gboolean, spacing: gint): PVBox{.cdecl, dynlib: lib, + importc: "gtk_vbox_new".} +proc TYPE_COLOR_SELECTION*(): GType +proc COLOR_SELECTION*(obj: pointer): PColorSelection +proc COLOR_SELECTION_CLASS*(klass: pointer): PColorSelectionClass +proc IS_COLOR_SELECTION*(obj: pointer): bool +proc IS_COLOR_SELECTION_CLASS*(klass: pointer): bool +proc COLOR_SELECTION_GET_CLASS*(obj: pointer): PColorSelectionClass +proc color_selection_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_color_selection_get_type".} +proc color_selection_new*(): PColorSelection{.cdecl, dynlib: lib, + importc: "gtk_color_selection_new".} +proc color_selection_get_has_opacity_control*(colorsel: PColorSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_color_selection_get_has_opacity_control".} +proc color_selection_set_has_opacity_control*(colorsel: PColorSelection, + has_opacity: gboolean){.cdecl, dynlib: lib, importc: "gtk_color_selection_set_has_opacity_control".} +proc color_selection_get_has_palette*(colorsel: PColorSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_color_selection_get_has_palette".} +proc color_selection_set_has_palette*(colorsel: PColorSelection, + has_palette: gboolean){.cdecl, + dynlib: lib, importc: "gtk_color_selection_set_has_palette".} +proc color_selection_set_current_color*(colorsel: PColorSelection, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_color_selection_set_current_color".} +proc color_selection_set_current_alpha*(colorsel: PColorSelection, + alpha: guint16){.cdecl, dynlib: lib, + importc: "gtk_color_selection_set_current_alpha".} +proc color_selection_get_current_color*(colorsel: PColorSelection, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_color_selection_get_current_color".} +proc color_selection_get_current_alpha*(colorsel: PColorSelection): guint16{. + cdecl, dynlib: lib, importc: "gtk_color_selection_get_current_alpha".} +proc color_selection_set_previous_color*(colorsel: PColorSelection, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_color_selection_set_previous_color".} +proc color_selection_set_previous_alpha*(colorsel: PColorSelection, + alpha: guint16){.cdecl, dynlib: lib, + importc: "gtk_color_selection_set_previous_alpha".} +proc color_selection_get_previous_color*(colorsel: PColorSelection, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_color_selection_get_previous_color".} +proc color_selection_get_previous_alpha*(colorsel: PColorSelection): guint16{. + cdecl, dynlib: lib, importc: "gtk_color_selection_get_previous_alpha".} +proc color_selection_is_adjusting*(colorsel: PColorSelection): gboolean{.cdecl, + dynlib: lib, importc: "gtk_color_selection_is_adjusting".} +proc color_selection_palette_from_string*(str: cstring, colors: var PGdkColor, + n_colors: Pgint): gboolean{.cdecl, dynlib: lib, importc: "gtk_color_selection_palette_from_string".} +proc color_selection_palette_to_string*(colors: PGdkColor, n_colors: gint): cstring{. + cdecl, dynlib: lib, importc: "gtk_color_selection_palette_to_string".} +proc color_selection_set_change_palette_with_screen_hook*( + func: TColorSelectionChangePaletteWithScreenFunc): TColorSelectionChangePaletteWithScreenFunc{. + cdecl, dynlib: lib, + importc: "gtk_color_selection_set_change_palette_with_screen_hook".} +proc TYPE_COLOR_SELECTION_DIALOG*(): GType +proc COLOR_SELECTION_DIALOG*(obj: pointer): PColorSelectionDialog +proc COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PColorSelectionDialogClass +proc IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool +proc IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool +proc COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PColorSelectionDialogClass +proc color_selection_dialog_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_color_selection_dialog_get_type".} +proc color_selection_dialog_new*(title: cstring): PColorSelectionDialog{.cdecl, + dynlib: lib, importc: "gtk_color_selection_dialog_new".} +proc TYPE_HBOX*(): GType +proc HBOX*(obj: pointer): PHBox +proc HBOX_CLASS*(klass: pointer): PHBoxClass +proc IS_HBOX*(obj: pointer): bool +proc IS_HBOX_CLASS*(klass: pointer): bool +proc HBOX_GET_CLASS*(obj: pointer): PHBoxClass +proc hbox_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_hbox_get_type".} +proc hbox_new*(homogeneous: gboolean, spacing: gint): PHBox{.cdecl, dynlib: lib, + importc: "gtk_hbox_new".} +const + bm_TGtkCombo_value_in_list* = 0x0001'i16 + bp_TGtkCombo_value_in_list* = 0'i16 + bm_TGtkCombo_ok_if_empty* = 0x0002'i16 + bp_TGtkCombo_ok_if_empty* = 1'i16 + bm_TGtkCombo_case_sensitive* = 0x0004'i16 + bp_TGtkCombo_case_sensitive* = 2'i16 + bm_TGtkCombo_use_arrows* = 0x0008'i16 + bp_TGtkCombo_use_arrows* = 3'i16 + bm_TGtkCombo_use_arrows_always* = 0x0010'i16 + bp_TGtkCombo_use_arrows_always* = 4'i16 + +proc TYPE_COMBO*(): GType +proc COMBO*(obj: pointer): PCombo +proc COMBO_CLASS*(klass: pointer): PComboClass +proc IS_COMBO*(obj: pointer): bool +proc IS_COMBO_CLASS*(klass: pointer): bool +proc COMBO_GET_CLASS*(obj: pointer): PComboClass +proc value_in_list*(a: var TCombo): guint +proc set_value_in_list*(a: var TCombo, `value_in_list`: guint) +proc ok_if_empty*(a: var TCombo): guint +proc set_ok_if_empty*(a: var TCombo, `ok_if_empty`: guint) +proc case_sensitive*(a: var TCombo): guint +proc set_case_sensitive*(a: var TCombo, `case_sensitive`: guint) +proc use_arrows*(a: var TCombo): guint +proc set_use_arrows*(a: var TCombo, `use_arrows`: guint) +proc use_arrows_always*(a: var TCombo): guint +proc set_use_arrows_always*(a: var TCombo, `use_arrows_always`: guint) +proc combo_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_combo_get_type".} +proc combo_new*(): PCombo{.cdecl, dynlib: lib, importc: "gtk_combo_new".} +proc combo_set_value_in_list*(combo: PCombo, val: gboolean, + ok_if_empty: gboolean){.cdecl, dynlib: lib, + importc: "gtk_combo_set_value_in_list".} +proc combo_set_use_arrows*(combo: PCombo, val: gboolean){.cdecl, dynlib: lib, + importc: "gtk_combo_set_use_arrows".} +proc combo_set_use_arrows_always*(combo: PCombo, val: gboolean){.cdecl, + dynlib: lib, importc: "gtk_combo_set_use_arrows_always".} +proc combo_set_case_sensitive*(combo: PCombo, val: gboolean){.cdecl, + dynlib: lib, importc: "gtk_combo_set_case_sensitive".} +proc combo_set_item_string*(combo: PCombo, item: PItem, item_value: cstring){. + cdecl, dynlib: lib, importc: "gtk_combo_set_item_string".} +proc combo_set_popdown_strings*(combo: PCombo, strings: PGList){.cdecl, + dynlib: lib, importc: "gtk_combo_set_popdown_strings".} +proc combo_disable_activate*(combo: PCombo){.cdecl, dynlib: lib, + importc: "gtk_combo_disable_activate".} +const + bm_TGtkCTree_line_style* = 0x0003'i16 + bp_TGtkCTree_line_style* = 0'i16 + bm_TGtkCTree_expander_style* = 0x000C'i16 + bp_TGtkCTree_expander_style* = 2'i16 + bm_TGtkCTree_show_stub* = 0x0010'i16 + bp_TGtkCTree_show_stub* = 4'i16 + bm_TGtkCTreeRow_is_leaf* = 0x0001'i16 + bp_TGtkCTreeRow_is_leaf* = 0'i16 + bm_TGtkCTreeRow_expanded* = 0x0002'i16 + bp_TGtkCTreeRow_expanded* = 1'i16 + +proc TYPE_CTREE*(): GType +proc CTREE*(obj: pointer): PCTree +proc CTREE_CLASS*(klass: pointer): PCTreeClass +proc IS_CTREE*(obj: pointer): bool +proc IS_CTREE_CLASS*(klass: pointer): bool +proc CTREE_GET_CLASS*(obj: pointer): PCTreeClass +proc CTREE_ROW*(`node_`: TAddress): PCTreeRow +proc CTREE_NODE*(`node_`: TAddress): PCTreeNode +proc CTREE_NODE_NEXT*(`nnode_`: TAddress): PCTreeNode +proc CTREE_NODE_PREV*(`pnode_`: TAddress): PCTreeNode +proc CTREE_FUNC*(`func_`: TAddress): TCTreeFunc +proc TYPE_CTREE_NODE*(): GType +proc line_style*(a: var TCTree): guint +proc set_line_style*(a: var TCTree, `line_style`: guint) +proc expander_style*(a: var TCTree): guint +proc set_expander_style*(a: var TCTree, `expander_style`: guint) +proc show_stub*(a: var TCTree): guint +proc set_show_stub*(a: var TCTree, `show_stub`: guint) +proc is_leaf*(a: var TCTreeRow): guint +proc set_is_leaf*(a: var TCTreeRow, `is_leaf`: guint) +proc expanded*(a: var TCTreeRow): guint +proc set_expanded*(a: var TCTreeRow, `expanded`: guint) +proc ctree_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_ctree_get_type".} +proc ctree_new*(columns: gint, tree_column: gint): PCTree{.cdecl, dynlib: lib, + importc: "gtk_ctree_new".} +proc ctree_insert_node*(ctree: PCTree, parent: PCTreeNode, sibling: PCTreeNode, + text: openarray[cstring], spacing: guint8, + pixmap_closed: PGdkPixmap, mask_closed: PGdkBitmap, + pixmap_opened: PGdkPixmap, mask_opened: PGdkBitmap, + is_leaf: gboolean, expanded: gboolean): PCTreeNode{. + cdecl, dynlib: lib, importc: "gtk_ctree_insert_node".} +proc ctree_remove_node*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_remove_node".} +proc ctree_insert_gnode*(ctree: PCTree, parent: PCTreeNode, sibling: PCTreeNode, + gnode: PGNode, func_: TCTreeGNodeFunc, data: gpointer): PCTreeNode{. + cdecl, dynlib: lib, importc: "gtk_ctree_insert_gnode".} +proc ctree_export_to_gnode*(ctree: PCTree, parent: PGNode, sibling: PGNode, + node_: PCTreeNode, func_: TCTreeGNodeFunc, + data: gpointer): PGNode{.cdecl, dynlib: lib, + importc: "gtk_ctree_export_to_gnode".} +proc ctree_post_recursive*(ctree: PCTree, node_: PCTreeNode, func_: TCTreeFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_ctree_post_recursive".} +proc ctree_post_recursive_to_depth*(ctree: PCTree, node_: PCTreeNode, + depth: gint, func_: TCTreeFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_ctree_post_recursive_to_depth".} +proc ctree_pre_recursive*(ctree: PCTree, node_: PCTreeNode, func_: TCTreeFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_ctree_pre_recursive".} +proc ctree_pre_recursive_to_depth*(ctree: PCTree, node_: PCTreeNode, + depth: gint, func_: TCTreeFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_ctree_pre_recursive_to_depth".} +proc ctree_is_viewable*(ctree: PCTree, node_: PCTreeNode): gboolean{.cdecl, + dynlib: lib, importc: "gtk_ctree_is_viewable".} +proc ctree_last*(ctree: PCTree, node_: PCTreeNode): PCTreeNode{.cdecl, + dynlib: lib, importc: "gtk_ctree_last".} +proc ctree_find_node_ptr*(ctree: PCTree, ctree_row: PCTreeRow): PCTreeNode{. + cdecl, dynlib: lib, importc: "gtk_ctree_find_node_ptr".} +proc ctree_node_nth*(ctree: PCTree, row: guint): PCTreeNode{.cdecl, dynlib: lib, + importc: "gtk_ctree_node_nth".} +proc ctree_find*(ctree: PCTree, node_: PCTreeNode, child: PCTreeNode): gboolean{. + cdecl, dynlib: lib, importc: "gtk_ctree_find".} +proc ctree_is_ancestor*(ctree: PCTree, node_: PCTreeNode, child: PCTreeNode): gboolean{. + cdecl, dynlib: lib, importc: "gtk_ctree_is_ancestor".} +proc ctree_find_by_row_data*(ctree: PCTree, node_: PCTreeNode, data: gpointer): PCTreeNode{. + cdecl, dynlib: lib, importc: "gtk_ctree_find_by_row_data".} +proc ctree_find_all_by_row_data*(ctree: PCTree, node_: PCTreeNode, + data: gpointer): PGList{.cdecl, dynlib: lib, + importc: "gtk_ctree_find_all_by_row_data".} +proc ctree_find_by_row_data_custom*(ctree: PCTree, node_: PCTreeNode, + data: gpointer, func_: TGCompareFunc): PCTreeNode{. + cdecl, dynlib: lib, importc: "gtk_ctree_find_by_row_data_custom".} +proc ctree_find_all_by_row_data_custom*(ctree: PCTree, node_: PCTreeNode, + data: gpointer, func_: TGCompareFunc): PGList{. + cdecl, dynlib: lib, importc: "gtk_ctree_find_all_by_row_data_custom".} +proc ctree_is_hot_spot*(ctree: PCTree, x: gint, y: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_ctree_is_hot_spot".} +proc ctree_move*(ctree: PCTree, node_: PCTreeNode, new_parent: PCTreeNode, + new_sibling: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_move".} +proc ctree_expand*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_expand".} +proc ctree_expand_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_expand_recursive".} +proc ctree_expand_to_depth*(ctree: PCTree, node_: PCTreeNode, depth: gint){. + cdecl, dynlib: lib, importc: "gtk_ctree_expand_to_depth".} +proc ctree_collapse*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_collapse".} +proc ctree_collapse_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_collapse_recursive".} +proc ctree_collapse_to_depth*(ctree: PCTree, node_: PCTreeNode, depth: gint){. + cdecl, dynlib: lib, importc: "gtk_ctree_collapse_to_depth".} +proc ctree_toggle_expansion*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_toggle_expansion".} +proc ctree_toggle_expansion_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_toggle_expansion_recursive".} +proc ctree_select*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_select".} +proc ctree_select_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_select_recursive".} +proc ctree_unselect*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_unselect".} +proc ctree_unselect_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_unselect_recursive".} +proc ctree_real_select_recursive*(ctree: PCTree, node_: PCTreeNode, state: gint){. + cdecl, dynlib: lib, importc: "gtk_ctree_real_select_recursive".} +proc ctree_node_set_text*(ctree: PCTree, node_: PCTreeNode, column: gint, + text: cstring){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_text".} +proc ctree_node_set_pixmap*(ctree: PCTree, node_: PCTreeNode, column: gint, + pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, + dynlib: lib, importc: "gtk_ctree_node_set_pixmap".} +proc ctree_node_set_pixtext*(ctree: PCTree, node_: PCTreeNode, column: gint, + text: cstring, spacing: guint8, pixmap: PGdkPixmap, + mask: PGdkBitmap){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_pixtext".} +proc ctree_set_node_info*(ctree: PCTree, node_: PCTreeNode, text: cstring, + spacing: guint8, pixmap_closed: PGdkPixmap, + mask_closed: PGdkBitmap, pixmap_opened: PGdkPixmap, + mask_opened: PGdkBitmap, is_leaf: gboolean, + expanded: gboolean){.cdecl, dynlib: lib, + importc: "gtk_ctree_set_node_info".} +proc ctree_node_set_shift*(ctree: PCTree, node_: PCTreeNode, column: gint, + vertical: gint, horizontal: gint){.cdecl, + dynlib: lib, importc: "gtk_ctree_node_set_shift".} +proc ctree_node_set_selectable*(ctree: PCTree, node_: PCTreeNode, + selectable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_selectable".} +proc ctree_node_get_selectable*(ctree: PCTree, node_: PCTreeNode): gboolean{. + cdecl, dynlib: lib, importc: "gtk_ctree_node_get_selectable".} +proc ctree_node_get_cell_type*(ctree: PCTree, node_: PCTreeNode, column: gint): TCellType{. + cdecl, dynlib: lib, importc: "gtk_ctree_node_get_cell_type".} +proc ctree_node_get_text*(ctree: PCTree, node_: PCTreeNode, column: gint, + text: PPgchar): gboolean{.cdecl, dynlib: lib, + importc: "gtk_ctree_node_get_text".} +proc ctree_node_set_row_style*(ctree: PCTree, node_: PCTreeNode, style: PStyle){. + cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_style".} +proc ctree_node_get_row_style*(ctree: PCTree, node_: PCTreeNode): PStyle{.cdecl, + dynlib: lib, importc: "gtk_ctree_node_get_row_style".} +proc ctree_node_set_cell_style*(ctree: PCTree, node_: PCTreeNode, column: gint, + style: PStyle){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_cell_style".} +proc ctree_node_get_cell_style*(ctree: PCTree, node_: PCTreeNode, column: gint): PStyle{. + cdecl, dynlib: lib, importc: "gtk_ctree_node_get_cell_style".} +proc ctree_node_set_foreground*(ctree: PCTree, node_: PCTreeNode, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_foreground".} +proc ctree_node_set_background*(ctree: PCTree, node_: PCTreeNode, + color: PGdkColor){.cdecl, dynlib: lib, + importc: "gtk_ctree_node_set_background".} +proc ctree_node_set_row_data*(ctree: PCTree, node_: PCTreeNode, data: gpointer){. + cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_data".} +proc ctree_node_set_row_data_full*(ctree: PCTree, node_: PCTreeNode, + data: gpointer, destroy: TDestroyNotify){. + cdecl, dynlib: lib, importc: "gtk_ctree_node_set_row_data_full".} +proc ctree_node_get_row_data*(ctree: PCTree, node_: PCTreeNode): gpointer{. + cdecl, dynlib: lib, importc: "gtk_ctree_node_get_row_data".} +proc ctree_node_moveto*(ctree: PCTree, node_: PCTreeNode, column: gint, + row_align: gfloat, col_align: gfloat){.cdecl, + dynlib: lib, importc: "gtk_ctree_node_moveto".} +proc ctree_node_is_visible*(ctree: PCTree, node_: PCTreeNode): TVisibility{. + cdecl, dynlib: lib, importc: "gtk_ctree_node_is_visible".} +proc ctree_set_indent*(ctree: PCTree, indent: gint){.cdecl, dynlib: lib, + importc: "gtk_ctree_set_indent".} +proc ctree_set_spacing*(ctree: PCTree, spacing: gint){.cdecl, dynlib: lib, + importc: "gtk_ctree_set_spacing".} +proc ctree_set_show_stub*(ctree: PCTree, show_stub: gboolean){.cdecl, + dynlib: lib, importc: "gtk_ctree_set_show_stub".} +proc ctree_set_line_style*(ctree: PCTree, line_style: TCTreeLineStyle){.cdecl, + dynlib: lib, importc: "gtk_ctree_set_line_style".} +proc ctree_set_expander_style*(ctree: PCTree, + expander_style: TCTreeExpanderStyle){.cdecl, + dynlib: lib, importc: "gtk_ctree_set_expander_style".} +proc ctree_set_drag_compare_func*(ctree: PCTree, cmp_func: TCTreeCompareDragFunc){. + cdecl, dynlib: lib, importc: "gtk_ctree_set_drag_compare_func".} +proc ctree_sort_node*(ctree: PCTree, node_: PCTreeNode){.cdecl, dynlib: lib, + importc: "gtk_ctree_sort_node".} +proc ctree_sort_recursive*(ctree: PCTree, node_: PCTreeNode){.cdecl, + dynlib: lib, importc: "gtk_ctree_sort_recursive".} +proc ctree_set_reorderable*(t: pointer, r: bool) +proc ctree_node_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_ctree_node_get_type".} +proc TYPE_DRAWING_AREA*(): GType +proc DRAWING_AREA*(obj: pointer): PDrawingArea +proc DRAWING_AREA_CLASS*(klass: pointer): PDrawingAreaClass +proc IS_DRAWING_AREA*(obj: pointer): bool +proc IS_DRAWING_AREA_CLASS*(klass: pointer): bool +proc DRAWING_AREA_GET_CLASS*(obj: pointer): PDrawingAreaClass +proc drawing_area_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_drawing_area_get_type".} +proc drawing_area_new*(): PDrawingArea{.cdecl, dynlib: lib, + importc: "gtk_drawing_area_new".} +proc TYPE_CURVE*(): GType +proc CURVE*(obj: pointer): PCurve +proc CURVE_CLASS*(klass: pointer): PCurveClass +proc IS_CURVE*(obj: pointer): bool +proc IS_CURVE_CLASS*(klass: pointer): bool +proc CURVE_GET_CLASS*(obj: pointer): PCurveClass +proc curve_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_curve_get_type".} +proc curve_new*(): PCurve{.cdecl, dynlib: lib, importc: "gtk_curve_new".} +proc curve_reset*(curve: PCurve){.cdecl, dynlib: lib, importc: "gtk_curve_reset".} +proc curve_set_gamma*(curve: PCurve, gamma: gfloat){.cdecl, dynlib: lib, + importc: "gtk_curve_set_gamma".} +proc curve_set_range*(curve: PCurve, min_x: gfloat, max_x: gfloat, + min_y: gfloat, max_y: gfloat){.cdecl, dynlib: lib, + importc: "gtk_curve_set_range".} +proc curve_set_curve_type*(curve: PCurve, thetype: TCurveType){.cdecl, + dynlib: lib, importc: "gtk_curve_set_curve_type".} +const + DEST_DEFAULT_MOTION* = 1 shl 0 + DEST_DEFAULT_HIGHLIGHT* = 1 shl 1 + DEST_DEFAULT_DROP* = 1 shl 2 + DEST_DEFAULT_ALL* = 0x00000007 + TARGET_SAME_APP* = 1 shl 0 + TARGET_SAME_WIDGET* = 1 shl 1 + +proc drag_get_data*(widget: PWidget, context: PGdkDragContext, target: TGdkAtom, + time: guint32){.cdecl, dynlib: lib, + importc: "gtk_drag_get_data".} +proc drag_finish*(context: PGdkDragContext, success: gboolean, del: gboolean, + time: guint32){.cdecl, dynlib: lib, importc: "gtk_drag_finish".} +proc drag_get_source_widget*(context: PGdkDragContext): PWidget{.cdecl, + dynlib: lib, importc: "gtk_drag_get_source_widget".} +proc drag_highlight*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_drag_highlight".} +proc drag_unhighlight*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_drag_unhighlight".} +proc drag_dest_set*(widget: PWidget, flags: TDestDefaults, + targets: PTargetEntry, n_targets: gint, + actions: TGdkDragAction){.cdecl, dynlib: lib, + importc: "gtk_drag_dest_set".} +proc drag_dest_set_proxy*(widget: PWidget, proxy_window: PGdkWindow, + protocol: TGdkDragProtocol, use_coordinates: gboolean){. + cdecl, dynlib: lib, importc: "gtk_drag_dest_set_proxy".} +proc drag_dest_unset*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_drag_dest_unset".} +proc drag_dest_find_target*(widget: PWidget, context: PGdkDragContext, + target_list: PTargetList): TGdkAtom{.cdecl, + dynlib: lib, importc: "gtk_drag_dest_find_target".} +proc drag_dest_get_target_list*(widget: PWidget): PTargetList{.cdecl, + dynlib: lib, importc: "gtk_drag_dest_get_target_list".} +proc drag_dest_set_target_list*(widget: PWidget, target_list: PTargetList){. + cdecl, dynlib: lib, importc: "gtk_drag_dest_set_target_list".} +proc drag_source_set*(widget: PWidget, start_button_mask: TGdkModifierType, + targets: PTargetEntry, n_targets: gint, + actions: TGdkDragAction){.cdecl, dynlib: lib, + importc: "gtk_drag_source_set".} +proc drag_source_unset*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_drag_source_unset".} +proc drag_source_set_icon*(widget: PWidget, colormap: PGdkColormap, + pixmap: PGdkPixmap, mask: PGdkBitmap){.cdecl, + dynlib: lib, importc: "gtk_drag_source_set_icon".} +proc drag_source_set_icon_pixbuf*(widget: PWidget, pixbuf: PGdkPixbuf){.cdecl, + dynlib: lib, importc: "gtk_drag_source_set_icon_pixbuf".} +proc drag_source_set_icon_stock*(widget: PWidget, stock_id: cstring){.cdecl, + dynlib: lib, importc: "gtk_drag_source_set_icon_stock".} +proc drag_begin*(widget: PWidget, targets: PTargetList, actions: TGdkDragAction, + button: gint, event: PGdkEvent): PGdkDragContext{.cdecl, + dynlib: lib, importc: "gtk_drag_begin".} +proc drag_set_icon_widget*(context: PGdkDragContext, widget: PWidget, + hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, + importc: "gtk_drag_set_icon_widget".} +proc drag_set_icon_pixmap*(context: PGdkDragContext, colormap: PGdkColormap, + pixmap: PGdkPixmap, mask: PGdkBitmap, hot_x: gint, + hot_y: gint){.cdecl, dynlib: lib, + importc: "gtk_drag_set_icon_pixmap".} +proc drag_set_icon_pixbuf*(context: PGdkDragContext, pixbuf: PGdkPixbuf, + hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, + importc: "gtk_drag_set_icon_pixbuf".} +proc drag_set_icon_stock*(context: PGdkDragContext, stock_id: cstring, + hot_x: gint, hot_y: gint){.cdecl, dynlib: lib, + importc: "gtk_drag_set_icon_stock".} +proc drag_set_icon_default*(context: PGdkDragContext){.cdecl, dynlib: lib, + importc: "gtk_drag_set_icon_default".} +proc drag_check_threshold*(widget: PWidget, start_x: gint, start_y: gint, + current_x: gint, current_y: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_drag_check_threshold".} +proc drag_source_handle_event*(widget: PWidget, event: PGdkEvent){.cdecl, + dynlib: lib, importc: "_gtk_drag_source_handle_event".} +proc drag_dest_handle_event*(toplevel: PWidget, event: PGdkEvent){.cdecl, + dynlib: lib, importc: "_gtk_drag_dest_handle_event".} +proc TYPE_EDITABLE*(): GType +proc EDITABLE*(obj: pointer): PEditable +proc EDITABLE_CLASS*(vtable: pointer): PEditableClass +proc IS_EDITABLE*(obj: pointer): bool +proc IS_EDITABLE_CLASS*(vtable: pointer): bool +proc EDITABLE_GET_CLASS*(inst: pointer): PEditableClass +proc editable_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_editable_get_type".} +proc editable_select_region*(editable: PEditable, start: gint, theEnd: gint){. + cdecl, dynlib: lib, importc: "gtk_editable_select_region".} +proc editable_get_selection_bounds*(editable: PEditable, start: Pgint, + theEnd: Pgint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_editable_get_selection_bounds".} +proc editable_insert_text*(editable: PEditable, new_text: cstring, + new_text_length: gint, position: Pgint){.cdecl, + dynlib: lib, importc: "gtk_editable_insert_text".} +proc editable_delete_text*(editable: PEditable, start_pos: gint, end_pos: gint){. + cdecl, dynlib: lib, importc: "gtk_editable_delete_text".} +proc editable_get_chars*(editable: PEditable, start_pos: gint, end_pos: gint): cstring{. + cdecl, dynlib: lib, importc: "gtk_editable_get_chars".} +proc editable_cut_clipboard*(editable: PEditable){.cdecl, dynlib: lib, + importc: "gtk_editable_cut_clipboard".} +proc editable_copy_clipboard*(editable: PEditable){.cdecl, dynlib: lib, + importc: "gtk_editable_copy_clipboard".} +proc editable_paste_clipboard*(editable: PEditable){.cdecl, dynlib: lib, + importc: "gtk_editable_paste_clipboard".} +proc editable_delete_selection*(editable: PEditable){.cdecl, dynlib: lib, + importc: "gtk_editable_delete_selection".} +proc editable_set_position*(editable: PEditable, position: gint){.cdecl, + dynlib: lib, importc: "gtk_editable_set_position".} +proc editable_get_position*(editable: PEditable): gint{.cdecl, dynlib: lib, + importc: "gtk_editable_get_position".} +proc editable_set_editable*(editable: PEditable, is_editable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_editable_set_editable".} +proc editable_get_editable*(editable: PEditable): gboolean{.cdecl, dynlib: lib, + importc: "gtk_editable_get_editable".} +proc TYPE_IM_CONTEXT*(): GType +proc IM_CONTEXT*(obj: pointer): PIMContext +proc IM_CONTEXT_CLASS*(klass: pointer): PIMContextClass +proc IS_IM_CONTEXT*(obj: pointer): bool +proc IS_IM_CONTEXT_CLASS*(klass: pointer): bool +proc IM_CONTEXT_GET_CLASS*(obj: pointer): PIMContextClass +proc im_context_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_im_context_get_type".} +proc im_context_set_client_window*(context: PIMContext, window: PGdkWindow){. + cdecl, dynlib: lib, importc: "gtk_im_context_set_client_window".} +proc im_context_filter_keypress*(context: PIMContext, event: PGdkEventKey): gboolean{. + cdecl, dynlib: lib, importc: "gtk_im_context_filter_keypress".} +proc im_context_focus_in*(context: PIMContext){.cdecl, dynlib: lib, + importc: "gtk_im_context_focus_in".} +proc im_context_focus_out*(context: PIMContext){.cdecl, dynlib: lib, + importc: "gtk_im_context_focus_out".} +proc im_context_reset*(context: PIMContext){.cdecl, dynlib: lib, + importc: "gtk_im_context_reset".} +proc im_context_set_cursor_location*(context: PIMContext, area: PGdkRectangle){. + cdecl, dynlib: lib, importc: "gtk_im_context_set_cursor_location".} +proc im_context_set_use_preedit*(context: PIMContext, use_preedit: gboolean){. + cdecl, dynlib: lib, importc: "gtk_im_context_set_use_preedit".} +proc im_context_set_surrounding*(context: PIMContext, text: cstring, len: gint, + cursor_index: gint){.cdecl, dynlib: lib, + importc: "gtk_im_context_set_surrounding".} +proc im_context_get_surrounding*(context: PIMContext, text: PPgchar, + cursor_index: Pgint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_im_context_get_surrounding".} +proc im_context_delete_surrounding*(context: PIMContext, offset: gint, + n_chars: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_im_context_delete_surrounding".} +const + bm_TGtkMenuShell_active* = 0x0001'i16 + bp_TGtkMenuShell_active* = 0'i16 + bm_TGtkMenuShell_have_grab* = 0x0002'i16 + bp_TGtkMenuShell_have_grab* = 1'i16 + bm_TGtkMenuShell_have_xgrab* = 0x0004'i16 + bp_TGtkMenuShell_have_xgrab* = 2'i16 + bm_TGtkMenuShell_ignore_leave* = 0x0008'i16 + bp_TGtkMenuShell_ignore_leave* = 3'i16 + bm_TGtkMenuShell_menu_flag* = 0x0010'i16 + bp_TGtkMenuShell_menu_flag* = 4'i16 + bm_TGtkMenuShell_ignore_enter* = 0x0020'i16 + bp_TGtkMenuShell_ignore_enter* = 5'i16 + bm_TGtkMenuShellClass_submenu_placement* = 0x0001'i16 + bp_TGtkMenuShellClass_submenu_placement* = 0'i16 + +proc TYPE_MENU_SHELL*(): GType +proc MENU_SHELL*(obj: pointer): PMenuShell +proc MENU_SHELL_CLASS*(klass: pointer): PMenuShellClass +proc IS_MENU_SHELL*(obj: pointer): bool +proc IS_MENU_SHELL_CLASS*(klass: pointer): bool +proc MENU_SHELL_GET_CLASS*(obj: pointer): PMenuShellClass +proc active*(a: var TMenuShell): guint +proc set_active*(a: var TMenuShell, `active`: guint) +proc have_grab*(a: var TMenuShell): guint +proc set_have_grab*(a: var TMenuShell, `have_grab`: guint) +proc have_xgrab*(a: var TMenuShell): guint +proc set_have_xgrab*(a: var TMenuShell, `have_xgrab`: guint) +proc ignore_leave*(a: var TMenuShell): guint +proc set_ignore_leave*(a: var TMenuShell, `ignore_leave`: guint) +proc menu_flag*(a: var TMenuShell): guint +proc set_menu_flag*(a: var TMenuShell, `menu_flag`: guint) +proc ignore_enter*(a: var TMenuShell): guint +proc set_ignore_enter*(a: var TMenuShell, `ignore_enter`: guint) +proc submenu_placement*(a: var TMenuShellClass): guint +proc set_submenu_placement*(a: var TMenuShellClass, `submenu_placement`: guint) +proc menu_shell_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_menu_shell_get_type".} +proc menu_shell_append*(menu_shell: PMenuShell, child: PWidget){.cdecl, + dynlib: lib, importc: "gtk_menu_shell_append".} +proc menu_shell_prepend*(menu_shell: PMenuShell, child: PWidget){.cdecl, + dynlib: lib, importc: "gtk_menu_shell_prepend".} +proc menu_shell_insert*(menu_shell: PMenuShell, child: PWidget, position: gint){. + cdecl, dynlib: lib, importc: "gtk_menu_shell_insert".} +proc menu_shell_deactivate*(menu_shell: PMenuShell){.cdecl, dynlib: lib, + importc: "gtk_menu_shell_deactivate".} +proc menu_shell_select_item*(menu_shell: PMenuShell, menu_item: PWidget){.cdecl, + dynlib: lib, importc: "gtk_menu_shell_select_item".} +proc menu_shell_deselect*(menu_shell: PMenuShell){.cdecl, dynlib: lib, + importc: "gtk_menu_shell_deselect".} +proc menu_shell_activate_item*(menu_shell: PMenuShell, menu_item: PWidget, + force_deactivate: gboolean){.cdecl, dynlib: lib, + importc: "gtk_menu_shell_activate_item".} +proc menu_shell_select_first*(menu_shell: PMenuShell){.cdecl, dynlib: lib, + importc: "_gtk_menu_shell_select_first".} +proc menu_shell_activate*(menu_shell: PMenuShell){.cdecl, dynlib: lib, + importc: "_gtk_menu_shell_activate".} +const + bm_TGtkMenu_needs_destruction_ref_count* = 0x0001'i16 + bp_TGtkMenu_needs_destruction_ref_count* = 0'i16 + bm_TGtkMenu_torn_off* = 0x0002'i16 + bp_TGtkMenu_torn_off* = 1'i16 + bm_TGtkMenu_tearoff_active* = 0x0004'i16 + bp_TGtkMenu_tearoff_active* = 2'i16 + bm_TGtkMenu_scroll_fast* = 0x0008'i16 + bp_TGtkMenu_scroll_fast* = 3'i16 + bm_TGtkMenu_upper_arrow_visible* = 0x0010'i16 + bp_TGtkMenu_upper_arrow_visible* = 4'i16 + bm_TGtkMenu_lower_arrow_visible* = 0x0020'i16 + bp_TGtkMenu_lower_arrow_visible* = 5'i16 + bm_TGtkMenu_upper_arrow_prelight* = 0x0040'i16 + bp_TGtkMenu_upper_arrow_prelight* = 6'i16 + bm_TGtkMenu_lower_arrow_prelight* = 0x0080'i16 + bp_TGtkMenu_lower_arrow_prelight* = 7'i16 + +proc TYPE_MENU*(): GType +proc MENU*(obj: pointer): PMenu +proc MENU_CLASS*(klass: pointer): PMenuClass +proc IS_MENU*(obj: pointer): bool +proc IS_MENU_CLASS*(klass: pointer): bool +proc MENU_GET_CLASS*(obj: pointer): PMenuClass +proc needs_destruction_ref_count*(a: var TMenu): guint +proc set_needs_destruction_ref_count*(a: var TMenu, + `needs_destruction_ref_count`: guint) +proc torn_off*(a: var TMenu): guint +proc set_torn_off*(a: var TMenu, `torn_off`: guint) +proc tearoff_active*(a: var TMenu): guint +proc set_tearoff_active*(a: var TMenu, `tearoff_active`: guint) +proc scroll_fast*(a: var TMenu): guint +proc set_scroll_fast*(a: var TMenu, `scroll_fast`: guint) +proc upper_arrow_visible*(a: var TMenu): guint +proc set_upper_arrow_visible*(a: var TMenu, `upper_arrow_visible`: guint) +proc lower_arrow_visible*(a: var TMenu): guint +proc set_lower_arrow_visible*(a: var TMenu, `lower_arrow_visible`: guint) +proc upper_arrow_prelight*(a: var TMenu): guint +proc set_upper_arrow_prelight*(a: var TMenu, `upper_arrow_prelight`: guint) +proc lower_arrow_prelight*(a: var TMenu): guint +proc set_lower_arrow_prelight*(a: var TMenu, `lower_arrow_prelight`: guint) +proc menu_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_menu_get_type".} +proc menu_new*(): PMenu{.cdecl, dynlib: lib, importc: "gtk_menu_new".} +proc menu_popup*(menu: PMenu, parent_menu_shell: PWidget, + parent_menu_item: PWidget, func_: TMenuPositionFunc, + data: gpointer, button: guint, activate_time: guint32){.cdecl, + dynlib: lib, importc: "gtk_menu_popup".} +proc menu_reposition*(menu: PMenu){.cdecl, dynlib: lib, + importc: "gtk_menu_reposition".} +proc menu_popdown*(menu: PMenu){.cdecl, dynlib: lib, importc: "gtk_menu_popdown".} +proc menu_get_active*(menu: PMenu): PWidget{.cdecl, dynlib: lib, + importc: "gtk_menu_get_active".} +proc menu_set_active*(menu: PMenu, index: guint){.cdecl, dynlib: lib, + importc: "gtk_menu_set_active".} +proc menu_set_accel_group*(menu: PMenu, accel_group: PAccelGroup){.cdecl, + dynlib: lib, importc: "gtk_menu_set_accel_group".} +proc menu_get_accel_group*(menu: PMenu): PAccelGroup{.cdecl, dynlib: lib, + importc: "gtk_menu_get_accel_group".} +proc menu_set_accel_path*(menu: PMenu, accel_path: cstring){.cdecl, dynlib: lib, + importc: "gtk_menu_set_accel_path".} +proc menu_attach_to_widget*(menu: PMenu, attach_widget: PWidget, + detacher: TMenuDetachFunc){.cdecl, dynlib: lib, + importc: "gtk_menu_attach_to_widget".} +proc menu_detach*(menu: PMenu){.cdecl, dynlib: lib, importc: "gtk_menu_detach".} +proc menu_get_attach_widget*(menu: PMenu): PWidget{.cdecl, dynlib: lib, + importc: "gtk_menu_get_attach_widget".} +proc menu_set_tearoff_state*(menu: PMenu, torn_off: gboolean){.cdecl, + dynlib: lib, importc: "gtk_menu_set_tearoff_state".} +proc menu_get_tearoff_state*(menu: PMenu): gboolean{.cdecl, dynlib: lib, + importc: "gtk_menu_get_tearoff_state".} +proc menu_set_title*(menu: PMenu, title: cstring){.cdecl, dynlib: lib, + importc: "gtk_menu_set_title".} +proc menu_get_title*(menu: PMenu): cstring{.cdecl, dynlib: lib, + importc: "gtk_menu_get_title".} +proc menu_reorder_child*(menu: PMenu, child: PWidget, position: gint){.cdecl, + dynlib: lib, importc: "gtk_menu_reorder_child".} +proc menu_set_screen*(menu: PMenu, screen: PGdkScreen){.cdecl, dynlib: lib, + importc: "gtk_menu_set_screen".} +const + bm_TGtkEntry_editable* = 0x0001'i16 + bp_TGtkEntry_editable* = 0'i16 + bm_TGtkEntry_visible* = 0x0002'i16 + bp_TGtkEntry_visible* = 1'i16 + bm_TGtkEntry_overwrite_mode* = 0x0004'i16 + bp_TGtkEntry_overwrite_mode* = 2'i16 + bm_TGtkEntry_in_drag* = 0x0008'i16 + bp_TGtkEntry_in_drag* = 3'i16 + bm_TGtkEntry_cache_includes_preedit* = 0x0001'i16 + bp_TGtkEntry_cache_includes_preedit* = 0'i16 + bm_TGtkEntry_need_im_reset* = 0x0002'i16 + bp_TGtkEntry_need_im_reset* = 1'i16 + bm_TGtkEntry_has_frame* = 0x0004'i16 + bp_TGtkEntry_has_frame* = 2'i16 + bm_TGtkEntry_activates_default* = 0x0008'i16 + bp_TGtkEntry_activates_default* = 3'i16 + bm_TGtkEntry_cursor_visible* = 0x0010'i16 + bp_TGtkEntry_cursor_visible* = 4'i16 + bm_TGtkEntry_in_click* = 0x0020'i16 + bp_TGtkEntry_in_click* = 5'i16 + bm_TGtkEntry_is_cell_renderer* = 0x0040'i16 + bp_TGtkEntry_is_cell_renderer* = 6'i16 + bm_TGtkEntry_editing_canceled* = 0x0080'i16 + bp_TGtkEntry_editing_canceled* = 7'i16 + bm_TGtkEntry_mouse_cursor_obscured* = 0x0100'i16 + bp_TGtkEntry_mouse_cursor_obscured* = 8'i16 + +proc TYPE_ENTRY*(): GType +proc ENTRY*(obj: pointer): PEntry +proc ENTRY_CLASS*(klass: pointer): PEntryClass +proc IS_ENTRY*(obj: pointer): bool +proc IS_ENTRY_CLASS*(klass: pointer): bool +proc ENTRY_GET_CLASS*(obj: pointer): PEntryClass +proc editable*(a: var TEntry): guint +proc set_editable*(a: var TEntry, `editable`: guint) +proc visible*(a: var TEntry): guint +proc set_visible*(a: var TEntry, `visible`: guint) +proc overwrite_mode*(a: var TEntry): guint +proc set_overwrite_mode*(a: var TEntry, `overwrite_mode`: guint) +proc in_drag*(a: var TEntry): guint +proc set_in_drag*(a: var TEntry, `in_drag`: guint) +proc cache_includes_preedit*(a: var TEntry): guint +proc set_cache_includes_preedit*(a: var TEntry, `cache_includes_preedit`: guint) +proc need_im_reset*(a: var TEntry): guint +proc set_need_im_reset*(a: var TEntry, `need_im_reset`: guint) +proc has_frame*(a: var TEntry): guint +proc set_has_frame*(a: var TEntry, `has_frame`: guint) +proc activates_default*(a: var TEntry): guint +proc set_activates_default*(a: var TEntry, `activates_default`: guint) +proc cursor_visible*(a: var TEntry): guint +proc set_cursor_visible*(a: var TEntry, `cursor_visible`: guint) +proc in_click*(a: var TEntry): guint +proc set_in_click*(a: var TEntry, `in_click`: guint) +proc is_cell_renderer*(a: var TEntry): guint +proc set_is_cell_renderer*(a: var TEntry, `is_cell_renderer`: guint) +proc editing_canceled*(a: var TEntry): guint +proc set_editing_canceled*(a: var TEntry, `editing_canceled`: guint) +proc mouse_cursor_obscured*(a: var TEntry): guint +proc set_mouse_cursor_obscured*(a: var TEntry, `mouse_cursor_obscured`: guint) +proc entry_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_entry_get_type".} +proc entry_new*(): PEntry{.cdecl, dynlib: lib, importc: "gtk_entry_new".} +proc entry_set_visibility*(entry: PEntry, visible: gboolean){.cdecl, + dynlib: lib, importc: "gtk_entry_set_visibility".} +proc entry_get_visibility*(entry: PEntry): gboolean{.cdecl, dynlib: lib, + importc: "gtk_entry_get_visibility".} +proc entry_set_invisible_char*(entry: PEntry, ch: gunichar){.cdecl, dynlib: lib, + importc: "gtk_entry_set_invisible_char".} +proc entry_get_invisible_char*(entry: PEntry): gunichar{.cdecl, dynlib: lib, + importc: "gtk_entry_get_invisible_char".} +proc entry_set_has_frame*(entry: PEntry, setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_entry_set_has_frame".} +proc entry_get_has_frame*(entry: PEntry): gboolean{.cdecl, dynlib: lib, + importc: "gtk_entry_get_has_frame".} +proc entry_set_max_length*(entry: PEntry, max: gint){.cdecl, dynlib: lib, + importc: "gtk_entry_set_max_length".} +proc entry_get_max_length*(entry: PEntry): gint{.cdecl, dynlib: lib, + importc: "gtk_entry_get_max_length".} +proc entry_set_activates_default*(entry: PEntry, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_entry_set_activates_default".} +proc entry_get_activates_default*(entry: PEntry): gboolean{.cdecl, dynlib: lib, + importc: "gtk_entry_get_activates_default".} +proc entry_set_width_chars*(entry: PEntry, n_chars: gint){.cdecl, dynlib: lib, + importc: "gtk_entry_set_width_chars".} +proc entry_get_width_chars*(entry: PEntry): gint{.cdecl, dynlib: lib, + importc: "gtk_entry_get_width_chars".} +proc entry_set_text*(entry: PEntry, text: cstring){.cdecl, dynlib: lib, + importc: "gtk_entry_set_text".} +proc entry_get_text*(entry: PEntry): cstring{.cdecl, dynlib: lib, + importc: "gtk_entry_get_text".} +proc entry_get_layout*(entry: PEntry): PPangoLayout{.cdecl, dynlib: lib, + importc: "gtk_entry_get_layout".} +proc entry_get_layout_offsets*(entry: PEntry, x: Pgint, y: Pgint){.cdecl, + dynlib: lib, importc: "gtk_entry_get_layout_offsets".} +const + ANCHOR_CENTER* = 0 + ANCHOR_NORTH* = 1 + ANCHOR_NORTH_WEST* = 2 + ANCHOR_NORTH_EAST* = 3 + ANCHOR_SOUTH* = 4 + ANCHOR_SOUTH_WEST* = 5 + ANCHOR_SOUTH_EAST* = 6 + ANCHOR_WEST* = 7 + ANCHOR_EAST* = 8 + ANCHOR_N* = ANCHOR_NORTH + ANCHOR_NW* = ANCHOR_NORTH_WEST + ANCHOR_NE* = ANCHOR_NORTH_EAST + ANCHOR_S* = ANCHOR_SOUTH + ANCHOR_SW* = ANCHOR_SOUTH_WEST + ANCHOR_SE* = ANCHOR_SOUTH_EAST + ANCHOR_W* = ANCHOR_WEST + ANCHOR_E* = ANCHOR_EAST + ARROW_UP* = 0 + ARROW_DOWN* = 1 + ARROW_LEFT* = 2 + ARROW_RIGHT* = 3 + EXPAND* = 1 shl 0 + SHRINK* = 1 shl 1 + FILL* = 1 shl 2 + BUTTONBOX_DEFAULT_STYLE* = 0 + BUTTONBOX_SPREAD* = 1 + BUTTONBOX_EDGE* = 2 + BUTTONBOX_START* = 3 + BUTTONBOX_END* = 4 + CURVE_TYPE_LINEAR* = 0 + CURVE_TYPE_SPLINE* = 1 + CURVE_TYPE_FREE* = 2 + DELETE_CHARS* = 0 + DELETE_WORD_ENDS* = 1 + DELETE_WORDS* = 2 + DELETE_DISPLAY_LINES* = 3 + DELETE_DISPLAY_LINE_ENDS* = 4 + DELETE_PARAGRAPH_ENDS* = 5 + DELETE_PARAGRAPHS* = 6 + DELETE_WHITESPACE* = 7 + DIR_TAB_FORWARD* = 0 + DIR_TAB_BACKWARD* = 1 + DIR_UP* = 2 + DIR_DOWN* = 3 + DIR_LEFT* = 4 + DIR_RIGHT* = 5 + EXPANDER_COLLAPSED* = 0 + EXPANDER_SEMI_COLLAPSED* = 1 + EXPANDER_SEMI_EXPANDED* = 2 + EXPANDER_EXPANDED* = 3 + ICON_SIZE_INVALID* = 0 + ICON_SIZE_MENU* = 1 + ICON_SIZE_SMALL_TOOLBAR* = 2 + ICON_SIZE_LARGE_TOOLBAR* = 3 + ICON_SIZE_BUTTON* = 4 + ICON_SIZE_DND* = 5 + ICON_SIZE_DIALOG* = 6 + TEXT_DIR_NONE* = 0 + TEXT_DIR_LTR* = 1 + TEXT_DIR_RTL* = 2 + JUSTIFY_LEFT* = 0 + JUSTIFY_RIGHT* = 1 + JUSTIFY_CENTER* = 2 + JUSTIFY_FILL* = 3 + MENU_DIR_PARENT* = 0 + MENU_DIR_CHILD* = 1 + MENU_DIR_NEXT* = 2 + MENU_DIR_PREV* = 3 + PIXELS* = 0 + INCHES* = 1 + CENTIMETERS* = 2 + MOVEMENT_LOGICAL_POSITIONS* = 0 + MOVEMENT_VISUAL_POSITIONS* = 1 + MOVEMENT_WORDS* = 2 + MOVEMENT_DISPLAY_LINES* = 3 + MOVEMENT_DISPLAY_LINE_ENDS* = 4 + MOVEMENT_PARAGRAPHS* = 5 + MOVEMENT_PARAGRAPH_ENDS* = 6 + MOVEMENT_PAGES* = 7 + MOVEMENT_BUFFER_ENDS* = 8 + ORIENTATION_HORIZONTAL* = 0 + ORIENTATION_VERTICAL* = 1 + CORNER_TOP_LEFT* = 0 + CORNER_BOTTOM_LEFT* = 1 + CORNER_TOP_RIGHT* = 2 + CORNER_BOTTOM_RIGHT* = 3 + PACK_START* = 0 + PACK_END* = 1 + PATH_PRIO_LOWEST* = 0 + PATH_PRIO_GTK* = 4 + PATH_PRIO_APPLICATION* = 8 + PATH_PRIO_THEME* = 10 + PATH_PRIO_RC* = 12 + PATH_PRIO_HIGHEST* = 15 + PATH_WIDGET* = 0 + PATH_WIDGET_CLASS* = 1 + PATH_CLASS* = 2 + POLICY_ALWAYS* = 0 + POLICY_AUTOMATIC* = 1 + POLICY_NEVER* = 2 + POS_LEFT* = 0 + POS_RIGHT* = 1 + POS_TOP* = 2 + POS_BOTTOM* = 3 + PREVIEW_COLOR* = 0 + PREVIEW_GRAYSCALE* = 1 + RELIEF_NORMAL* = 0 + RELIEF_HALF* = 1 + RELIEF_NONE* = 2 + RESIZE_PARENT* = 0 + RESIZE_QUEUE* = 1 + RESIZE_IMMEDIATE* = 2 + SCROLL_NONE* = 0 + SCROLL_JUMP* = 1 + SCROLL_STEP_BACKWARD* = 2 + SCROLL_STEP_FORWARD* = 3 + SCROLL_PAGE_BACKWARD* = 4 + SCROLL_PAGE_FORWARD* = 5 + SCROLL_STEP_UP* = 6 + SCROLL_STEP_DOWN* = 7 + SCROLL_PAGE_UP* = 8 + SCROLL_PAGE_DOWN* = 9 + SCROLL_STEP_LEFT* = 10 + SCROLL_STEP_RIGHT* = 11 + SCROLL_PAGE_LEFT* = 12 + SCROLL_PAGE_RIGHT* = 13 + SCROLL_START* = 14 + SCROLL_END* = 15 + SELECTION_NONE* = 0 + SELECTION_SINGLE* = 1 + SELECTION_BROWSE* = 2 + SELECTION_MULTIPLE* = 3 + SELECTION_EXTENDED* = SELECTION_MULTIPLE + SHADOW_NONE* = 0 + SHADOW_IN* = 1 + SHADOW_OUT* = 2 + SHADOW_ETCHED_IN* = 3 + SHADOW_ETCHED_OUT* = 4 + STATE_NORMAL* = 0 + STATE_ACTIVE* = 1 + STATE_PRELIGHT* = 2 + STATE_SELECTED* = 3 + STATE_INSENSITIVE* = 4 + DIRECTION_LEFT* = 0 + DIRECTION_RIGHT* = 1 + TOP_BOTTOM* = 0 + LEFT_RIGHT* = 1 + TOOLBAR_ICONS* = 0 + TOOLBAR_TEXT* = 1 + TOOLBAR_BOTH* = 2 + TOOLBAR_BOTH_HORIZ* = 3 + UPDATE_CONTINUOUS* = 0 + UPDATE_DISCONTINUOUS* = 1 + UPDATE_DELAYED* = 2 + VISIBILITY_NONE* = 0 + VISIBILITY_PARTIAL* = 1 + VISIBILITY_FULL* = 2 + WIN_POS_NONE* = 0 + WIN_POS_CENTER* = 1 + WIN_POS_MOUSE* = 2 + WIN_POS_CENTER_ALWAYS* = 3 + WIN_POS_CENTER_ON_PARENT* = 4 + WINDOW_TOPLEVEL* = 0 + WINDOW_POPUP* = 1 + WRAP_NONE* = 0 + WRAP_CHAR* = 1 + WRAP_WORD* = 2 + SORT_ASCENDING* = 0 + SORT_DESCENDING* = 1 + +proc TYPE_EVENT_BOX*(): GType +proc EVENT_BOX*(obj: pointer): PEventBox +proc EVENT_BOX_CLASS*(klass: pointer): PEventBoxClass +proc IS_EVENT_BOX*(obj: pointer): bool +proc IS_EVENT_BOX_CLASS*(klass: pointer): bool +proc EVENT_BOX_GET_CLASS*(obj: pointer): PEventBoxClass +proc event_box_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_event_box_get_type".} +proc event_box_new*(): PEventBox{.cdecl, dynlib: lib, + importc: "gtk_event_box_new".} +const + FNM_PATHNAME* = 1 shl 0 + FNM_NOESCAPE* = 1 shl 1 + FNM_PERIOD* = 1 shl 2 + +const + FNM_FILE_NAME* = FNM_PATHNAME + FNM_LEADING_DIR* = 1 shl 3 + FNM_CASEFOLD* = 1 shl 4 + +const + FNM_NOMATCH* = 1 + +proc fnmatch*(`pattern`: char, `string`: char, `flags`: gint): gint{.cdecl, + dynlib: lib, importc: "fnmatch".} +proc TYPE_FILE_SELECTION*(): GType +proc FILE_SELECTION*(obj: pointer): PFileSelection +proc FILE_SELECTION_CLASS*(klass: pointer): PFileSelectionClass +proc IS_FILE_SELECTION*(obj: pointer): bool +proc IS_FILE_SELECTION_CLASS*(klass: pointer): bool +proc FILE_SELECTION_GET_CLASS*(obj: pointer): PFileSelectionClass +proc file_selection_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_file_selection_get_type".} +proc file_selection_new*(title: cstring): PFileSelection{.cdecl, dynlib: lib, + importc: "gtk_file_selection_new".} +proc file_selection_set_filename*(filesel: PFileSelection, filename: cstring){. + cdecl, dynlib: lib, importc: "gtk_file_selection_set_filename".} +proc file_selection_get_filename*(filesel: PFileSelection): cstring{.cdecl, + dynlib: lib, importc: "gtk_file_selection_get_filename".} +proc file_selection_complete*(filesel: PFileSelection, pattern: cstring){.cdecl, + dynlib: lib, importc: "gtk_file_selection_complete".} +proc file_selection_show_fileop_buttons*(filesel: PFileSelection){.cdecl, + dynlib: lib, importc: "gtk_file_selection_show_fileop_buttons".} +proc file_selection_hide_fileop_buttons*(filesel: PFileSelection){.cdecl, + dynlib: lib, importc: "gtk_file_selection_hide_fileop_buttons".} +proc file_selection_get_selections*(filesel: PFileSelection): PPgchar{.cdecl, + dynlib: lib, importc: "gtk_file_selection_get_selections".} +proc file_selection_set_select_multiple*(filesel: PFileSelection, + select_multiple: gboolean){.cdecl, dynlib: lib, importc: "gtk_file_selection_set_select_multiple".} +proc file_selection_get_select_multiple*(filesel: PFileSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_selection_get_select_multiple".} +proc TYPE_FIXED*(): GType +proc FIXED*(obj: pointer): PFixed +proc FIXED_CLASS*(klass: pointer): PFixedClass +proc IS_FIXED*(obj: pointer): bool +proc IS_FIXED_CLASS*(klass: pointer): bool +proc FIXED_GET_CLASS*(obj: pointer): PFixedClass +proc fixed_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_fixed_get_type".} +proc fixed_new*(): PFixed{.cdecl, dynlib: lib, importc: "gtk_fixed_new".} +proc fixed_put*(fixed: PFixed, widget: PWidget, x: gint, y: gint){.cdecl, + dynlib: lib, importc: "gtk_fixed_put".} +proc fixed_move*(fixed: PFixed, widget: PWidget, x: gint, y: gint){.cdecl, + dynlib: lib, importc: "gtk_fixed_move".} +proc fixed_set_has_window*(fixed: PFixed, has_window: gboolean){.cdecl, + dynlib: lib, importc: "gtk_fixed_set_has_window".} +proc fixed_get_has_window*(fixed: PFixed): gboolean{.cdecl, dynlib: lib, + importc: "gtk_fixed_get_has_window".} +proc TYPE_FONT_SELECTION*(): GType +proc FONT_SELECTION*(obj: pointer): PFontSelection +proc FONT_SELECTION_CLASS*(klass: pointer): PFontSelectionClass +proc IS_FONT_SELECTION*(obj: pointer): bool +proc IS_FONT_SELECTION_CLASS*(klass: pointer): bool +proc FONT_SELECTION_GET_CLASS*(obj: pointer): PFontSelectionClass +proc TYPE_FONT_SELECTION_DIALOG*(): GType +proc FONT_SELECTION_DIALOG*(obj: pointer): PFontSelectionDialog +proc FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PFontSelectionDialogClass +proc IS_FONT_SELECTION_DIALOG*(obj: pointer): bool +proc IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool +proc FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PFontSelectionDialogClass +proc font_selection_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_font_selection_get_type".} +proc font_selection_new*(): PFontSelection{.cdecl, dynlib: lib, + importc: "gtk_font_selection_new".} +proc font_selection_get_font_name*(fontsel: PFontSelection): cstring{.cdecl, + dynlib: lib, importc: "gtk_font_selection_get_font_name".} +proc font_selection_set_font_name*(fontsel: PFontSelection, fontname: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_font_selection_set_font_name".} +proc font_selection_get_preview_text*(fontsel: PFontSelection): cstring{.cdecl, + dynlib: lib, importc: "gtk_font_selection_get_preview_text".} +proc font_selection_set_preview_text*(fontsel: PFontSelection, text: cstring){. + cdecl, dynlib: lib, importc: "gtk_font_selection_set_preview_text".} +proc font_selection_dialog_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_font_selection_dialog_get_type".} +proc font_selection_dialog_new*(title: cstring): PFontSelectionDialog{.cdecl, + dynlib: lib, importc: "gtk_font_selection_dialog_new".} +proc font_selection_dialog_get_font_name*(fsd: PFontSelectionDialog): cstring{. + cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_get_font_name".} +proc font_selection_dialog_set_font_name*(fsd: PFontSelectionDialog, + fontname: cstring): gboolean{.cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_set_font_name".} +proc font_selection_dialog_get_preview_text*(fsd: PFontSelectionDialog): cstring{. + cdecl, dynlib: lib, importc: "gtk_font_selection_dialog_get_preview_text".} +proc font_selection_dialog_set_preview_text*(fsd: PFontSelectionDialog, + text: cstring){.cdecl, dynlib: lib, + importc: "gtk_font_selection_dialog_set_preview_text".} +proc TYPE_GAMMA_CURVE*(): GType +proc GAMMA_CURVE*(obj: pointer): PGammaCurve +proc GAMMA_CURVE_CLASS*(klass: pointer): PGammaCurveClass +proc IS_GAMMA_CURVE*(obj: pointer): bool +proc IS_GAMMA_CURVE_CLASS*(klass: pointer): bool +proc GAMMA_CURVE_GET_CLASS*(obj: pointer): PGammaCurveClass +proc gamma_curve_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_gamma_curve_get_type".} +proc gamma_curve_new*(): PGammaCurve{.cdecl, dynlib: lib, + importc: "gtk_gamma_curve_new".} +proc gc_get*(depth: gint, colormap: PGdkColormap, values: PGdkGCValues, + values_mask: TGdkGCValuesMask): PGdkGC{.cdecl, dynlib: lib, + importc: "gtk_gc_get".} +proc gc_release*(gc: PGdkGC){.cdecl, dynlib: lib, importc: "gtk_gc_release".} +const + bm_TGtkHandleBox_handle_position* = 0x0003'i16 + bp_TGtkHandleBox_handle_position* = 0'i16 + bm_TGtkHandleBox_float_window_mapped* = 0x0004'i16 + bp_TGtkHandleBox_float_window_mapped* = 2'i16 + bm_TGtkHandleBox_child_detached* = 0x0008'i16 + bp_TGtkHandleBox_child_detached* = 3'i16 + bm_TGtkHandleBox_in_drag* = 0x0010'i16 + bp_TGtkHandleBox_in_drag* = 4'i16 + bm_TGtkHandleBox_shrink_on_detach* = 0x0020'i16 + bp_TGtkHandleBox_shrink_on_detach* = 5'i16 + bm_TGtkHandleBox_snap_edge* = 0x01C0'i16 + bp_TGtkHandleBox_snap_edge* = 6'i16 + +proc TYPE_HANDLE_BOX*(): GType +proc HANDLE_BOX*(obj: pointer): PHandleBox +proc HANDLE_BOX_CLASS*(klass: pointer): PHandleBoxClass +proc IS_HANDLE_BOX*(obj: pointer): bool +proc IS_HANDLE_BOX_CLASS*(klass: pointer): bool +proc HANDLE_BOX_GET_CLASS*(obj: pointer): PHandleBoxClass +proc handle_position*(a: var THandleBox): guint +proc set_handle_position*(a: var THandleBox, `handle_position`: guint) +proc float_window_mapped*(a: var THandleBox): guint +proc set_float_window_mapped*(a: var THandleBox, `float_window_mapped`: guint) +proc child_detached*(a: var THandleBox): guint +proc set_child_detached*(a: var THandleBox, `child_detached`: guint) +proc in_drag*(a: var THandleBox): guint +proc set_in_drag*(a: var THandleBox, `in_drag`: guint) +proc shrink_on_detach*(a: var THandleBox): guint +proc set_shrink_on_detach*(a: var THandleBox, `shrink_on_detach`: guint) +proc snap_edge*(a: var THandleBox): gint +proc set_snap_edge*(a: var THandleBox, `snap_edge`: gint) +proc handle_box_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_handle_box_get_type".} +proc handle_box_new*(): PHandleBox{.cdecl, dynlib: lib, + importc: "gtk_handle_box_new".} +proc handle_box_set_shadow_type*(handle_box: PHandleBox, thetype: TShadowType){. + cdecl, dynlib: lib, importc: "gtk_handle_box_set_shadow_type".} +proc handle_box_get_shadow_type*(handle_box: PHandleBox): TShadowType{.cdecl, + dynlib: lib, importc: "gtk_handle_box_get_shadow_type".} +proc handle_box_set_handle_position*(handle_box: PHandleBox, + position: TPositionType){.cdecl, + dynlib: lib, importc: "gtk_handle_box_set_handle_position".} +proc handle_box_get_handle_position*(handle_box: PHandleBox): TPositionType{. + cdecl, dynlib: lib, importc: "gtk_handle_box_get_handle_position".} +proc handle_box_set_snap_edge*(handle_box: PHandleBox, edge: TPositionType){. + cdecl, dynlib: lib, importc: "gtk_handle_box_set_snap_edge".} +proc handle_box_get_snap_edge*(handle_box: PHandleBox): TPositionType{.cdecl, + dynlib: lib, importc: "gtk_handle_box_get_snap_edge".} +const + bm_TGtkPaned_position_set* = 0x0001'i16 + bp_TGtkPaned_position_set* = 0'i16 + bm_TGtkPaned_in_drag* = 0x0002'i16 + bp_TGtkPaned_in_drag* = 1'i16 + bm_TGtkPaned_child1_shrink* = 0x0004'i16 + bp_TGtkPaned_child1_shrink* = 2'i16 + bm_TGtkPaned_child1_resize* = 0x0008'i16 + bp_TGtkPaned_child1_resize* = 3'i16 + bm_TGtkPaned_child2_shrink* = 0x0010'i16 + bp_TGtkPaned_child2_shrink* = 4'i16 + bm_TGtkPaned_child2_resize* = 0x0020'i16 + bp_TGtkPaned_child2_resize* = 5'i16 + bm_TGtkPaned_orientation* = 0x0040'i16 + bp_TGtkPaned_orientation* = 6'i16 + bm_TGtkPaned_in_recursion* = 0x0080'i16 + bp_TGtkPaned_in_recursion* = 7'i16 + bm_TGtkPaned_handle_prelit* = 0x0100'i16 + bp_TGtkPaned_handle_prelit* = 8'i16 + +proc TYPE_PANED*(): GType +proc PANED*(obj: pointer): PPaned +proc PANED_CLASS*(klass: pointer): PPanedClass +proc IS_PANED*(obj: pointer): bool +proc IS_PANED_CLASS*(klass: pointer): bool +proc PANED_GET_CLASS*(obj: pointer): PPanedClass +proc position_set*(a: var TPaned): guint +proc set_position_set*(a: var TPaned, `position_set`: guint) +proc in_drag*(a: var TPaned): guint +proc set_in_drag*(a: var TPaned, `in_drag`: guint) +proc child1_shrink*(a: var TPaned): guint +proc set_child1_shrink*(a: var TPaned, `child1_shrink`: guint) +proc child1_resize*(a: var TPaned): guint +proc set_child1_resize*(a: var TPaned, `child1_resize`: guint) +proc child2_shrink*(a: var TPaned): guint +proc set_child2_shrink*(a: var TPaned, `child2_shrink`: guint) +proc child2_resize*(a: var TPaned): guint +proc set_child2_resize*(a: var TPaned, `child2_resize`: guint) +proc orientation*(a: var TPaned): guint +proc set_orientation*(a: var TPaned, `orientation`: guint) +proc in_recursion*(a: var TPaned): guint +proc set_in_recursion*(a: var TPaned, `in_recursion`: guint) +proc handle_prelit*(a: var TPaned): guint +proc set_handle_prelit*(a: var TPaned, `handle_prelit`: guint) +proc paned_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_paned_get_type".} +proc paned_add1*(paned: PPaned, child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_paned_add1".} +proc paned_add2*(paned: PPaned, child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_paned_add2".} +proc paned_pack1*(paned: PPaned, child: PWidget, resize: gboolean, + shrink: gboolean){.cdecl, dynlib: lib, + importc: "gtk_paned_pack1".} +proc paned_pack2*(paned: PPaned, child: PWidget, resize: gboolean, + shrink: gboolean){.cdecl, dynlib: lib, + importc: "gtk_paned_pack2".} +proc paned_get_position*(paned: PPaned): gint{.cdecl, dynlib: lib, + importc: "gtk_paned_get_position".} +proc paned_set_position*(paned: PPaned, position: gint){.cdecl, dynlib: lib, + importc: "gtk_paned_set_position".} +proc paned_compute_position*(paned: PPaned, allocation: gint, child1_req: gint, + child2_req: gint){.cdecl, dynlib: lib, + importc: "gtk_paned_compute_position".} +proc TYPE_HBUTTON_BOX*(): GType +proc HBUTTON_BOX*(obj: pointer): PHButtonBox +proc HBUTTON_BOX_CLASS*(klass: pointer): PHButtonBoxClass +proc IS_HBUTTON_BOX*(obj: pointer): bool +proc IS_HBUTTON_BOX_CLASS*(klass: pointer): bool +proc HBUTTON_BOX_GET_CLASS*(obj: pointer): PHButtonBoxClass +proc hbutton_box_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hbutton_box_get_type".} +proc hbutton_box_new*(): PHButtonBox{.cdecl, dynlib: lib, + importc: "gtk_hbutton_box_new".} +proc TYPE_HPANED*(): GType +proc HPANED*(obj: pointer): PHPaned +proc HPANED_CLASS*(klass: pointer): PHPanedClass +proc IS_HPANED*(obj: pointer): bool +proc IS_HPANED_CLASS*(klass: pointer): bool +proc HPANED_GET_CLASS*(obj: pointer): PHPanedClass +proc hpaned_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hpaned_get_type".} +proc hpaned_new*(): PHPaned{.cdecl, dynlib: lib, importc: "gtk_hpaned_new".} +proc TYPE_RULER*(): GType +proc RULER*(obj: pointer): PRuler +proc RULER_CLASS*(klass: pointer): PRulerClass +proc IS_RULER*(obj: pointer): bool +proc IS_RULER_CLASS*(klass: pointer): bool +proc RULER_GET_CLASS*(obj: pointer): PRulerClass +proc ruler_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_ruler_get_type".} +proc ruler_set_metric*(ruler: PRuler, metric: TMetricType){.cdecl, dynlib: lib, + importc: "gtk_ruler_set_metric".} +proc ruler_set_range*(ruler: PRuler, lower: gdouble, upper: gdouble, + position: gdouble, max_size: gdouble){.cdecl, dynlib: lib, + importc: "gtk_ruler_set_range".} +proc ruler_draw_ticks*(ruler: PRuler){.cdecl, dynlib: lib, + importc: "gtk_ruler_draw_ticks".} +proc ruler_draw_pos*(ruler: PRuler){.cdecl, dynlib: lib, + importc: "gtk_ruler_draw_pos".} +proc ruler_get_metric*(ruler: PRuler): TMetricType{.cdecl, dynlib: lib, + importc: "gtk_ruler_get_metric".} +proc ruler_get_range*(ruler: PRuler, lower: Pgdouble, upper: Pgdouble, + position: Pgdouble, max_size: Pgdouble){.cdecl, + dynlib: lib, importc: "gtk_ruler_get_range".} +proc TYPE_HRULER*(): GType +proc HRULER*(obj: pointer): PHRuler +proc HRULER_CLASS*(klass: pointer): PHRulerClass +proc IS_HRULER*(obj: pointer): bool +proc IS_HRULER_CLASS*(klass: pointer): bool +proc HRULER_GET_CLASS*(obj: pointer): PHRulerClass +proc hruler_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hruler_get_type".} +proc hruler_new*(): PHRuler{.cdecl, dynlib: lib, importc: "gtk_hruler_new".} +proc TYPE_SETTINGS*(): GType +proc SETTINGS*(obj: pointer): PSettings +proc SETTINGS_CLASS*(klass: pointer): PSettingsClass +proc IS_SETTINGS*(obj: pointer): bool +proc IS_SETTINGS_CLASS*(klass: pointer): bool +proc SETTINGS_GET_CLASS*(obj: pointer): PSettingsClass +proc settings_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_settings_get_type".} +proc settings_get_for_screen*(screen: PGdkScreen): PSettings{.cdecl, + dynlib: lib, importc: "gtk_settings_get_for_screen".} +proc settings_install_property*(pspec: PGParamSpec){.cdecl, dynlib: lib, + importc: "gtk_settings_install_property".} +proc settings_install_property_parser*(pspec: PGParamSpec, + parser: TRcPropertyParser){.cdecl, + dynlib: lib, importc: "gtk_settings_install_property_parser".} +proc rc_property_parse_color*(pspec: PGParamSpec, gstring: PGString, + property_value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "gtk_rc_property_parse_color".} +proc rc_property_parse_enum*(pspec: PGParamSpec, gstring: PGString, + property_value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "gtk_rc_property_parse_enum".} +proc rc_property_parse_flags*(pspec: PGParamSpec, gstring: PGString, + property_value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "gtk_rc_property_parse_flags".} +proc rc_property_parse_requisition*(pspec: PGParamSpec, gstring: PGString, + property_value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "gtk_rc_property_parse_requisition".} +proc rc_property_parse_border*(pspec: PGParamSpec, gstring: PGString, + property_value: PGValue): gboolean{.cdecl, + dynlib: lib, importc: "gtk_rc_property_parse_border".} +proc settings_set_property_value*(settings: PSettings, name: cstring, + svalue: PSettingsValue){.cdecl, dynlib: lib, + importc: "gtk_settings_set_property_value".} +proc settings_set_string_property*(settings: PSettings, name: cstring, + v_string: cstring, origin: cstring){.cdecl, + dynlib: lib, importc: "gtk_settings_set_string_property".} +proc settings_set_long_property*(settings: PSettings, name: cstring, + v_long: glong, origin: cstring){.cdecl, + dynlib: lib, importc: "gtk_settings_set_long_property".} +proc settings_set_double_property*(settings: PSettings, name: cstring, + v_double: gdouble, origin: cstring){.cdecl, + dynlib: lib, importc: "gtk_settings_set_double_property".} +proc settings_handle_event*(event: PGdkEventSetting){.cdecl, dynlib: lib, + importc: "_gtk_settings_handle_event".} +proc rc_property_parser_from_type*(thetype: GType): TRcPropertyParser{.cdecl, + dynlib: lib, importc: "_gtk_rc_property_parser_from_type".} +proc settings_parse_convert*(parser: TRcPropertyParser, src_value: PGValue, + pspec: PGParamSpec, dest_value: PGValue): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_settings_parse_convert".} +const + RC_FG* = 1 shl 0 + RC_BG* = 1 shl 1 + RC_TEXT* = 1 shl 2 + RC_BASE* = 1 shl 3 + bm_TGtkRcStyle_engine_specified* = 0x0001'i16 + bp_TGtkRcStyle_engine_specified* = 0'i16 + +proc TYPE_RC_STYLE*(): GType +proc RC_STYLE_get*(anObject: pointer): PRcStyle +proc RC_STYLE_CLASS*(klass: pointer): PRcStyleClass +proc IS_RC_STYLE*(anObject: pointer): bool +proc IS_RC_STYLE_CLASS*(klass: pointer): bool +proc RC_STYLE_GET_CLASS*(obj: pointer): PRcStyleClass +proc engine_specified*(a: var TRcStyle): guint +proc set_engine_specified*(a: var TRcStyle, `engine_specified`: guint) +proc rc_init*(){.cdecl, dynlib: lib, importc: "_gtk_rc_init".} +proc rc_add_default_file*(filename: cstring){.cdecl, dynlib: lib, + importc: "gtk_rc_add_default_file".} +proc rc_set_default_files*(filenames: PPgchar){.cdecl, dynlib: lib, + importc: "gtk_rc_set_default_files".} +proc rc_get_default_files*(): PPgchar{.cdecl, dynlib: lib, + importc: "gtk_rc_get_default_files".} +proc rc_get_style*(widget: PWidget): PStyle{.cdecl, dynlib: lib, + importc: "gtk_rc_get_style".} +proc rc_get_style_by_paths*(settings: PSettings, widget_path: cstring, + class_path: cstring, thetype: GType): PStyle{.cdecl, + dynlib: lib, importc: "gtk_rc_get_style_by_paths".} +proc rc_reparse_all_for_settings*(settings: PSettings, force_load: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_rc_reparse_all_for_settings".} +proc rc_find_pixmap_in_path*(settings: PSettings, scanner: PGScanner, + pixmap_file: cstring): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_find_pixmap_in_path".} +proc rc_parse*(filename: cstring){.cdecl, dynlib: lib, importc: "gtk_rc_parse".} +proc rc_parse_string*(rc_string: cstring){.cdecl, dynlib: lib, + importc: "gtk_rc_parse_string".} +proc rc_reparse_all*(): gboolean{.cdecl, dynlib: lib, + importc: "gtk_rc_reparse_all".} +proc rc_style_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_rc_style_get_type".} +proc rc_style_new*(): PRcStyle{.cdecl, dynlib: lib, importc: "gtk_rc_style_new".} +proc rc_style_copy*(orig: PRcStyle): PRcStyle{.cdecl, dynlib: lib, + importc: "gtk_rc_style_copy".} +proc rc_style_ref*(rc_style: PRcStyle){.cdecl, dynlib: lib, + importc: "gtk_rc_style_ref".} +proc rc_style_unref*(rc_style: PRcStyle){.cdecl, dynlib: lib, + importc: "gtk_rc_style_unref".} +proc rc_find_module_in_path*(module_file: cstring): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_find_module_in_path".} +proc rc_get_theme_dir*(): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_get_theme_dir".} +proc rc_get_module_dir*(): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_get_module_dir".} +proc rc_get_im_module_path*(): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_get_im_module_path".} +proc rc_get_im_module_file*(): cstring{.cdecl, dynlib: lib, + importc: "gtk_rc_get_im_module_file".} +proc rc_scanner_new*(): PGScanner{.cdecl, dynlib: lib, + importc: "gtk_rc_scanner_new".} +proc rc_parse_color*(scanner: PGScanner, color: PGdkColor): guint{.cdecl, + dynlib: lib, importc: "gtk_rc_parse_color".} +proc rc_parse_state*(scanner: PGScanner, state: PStateType): guint{.cdecl, + dynlib: lib, importc: "gtk_rc_parse_state".} +proc rc_parse_priority*(scanner: PGScanner, priority: PPathPriorityType): guint{. + cdecl, dynlib: lib, importc: "gtk_rc_parse_priority".} +proc rc_style_lookup_rc_property*(rc_style: PRcStyle, type_name: TGQuark, + property_name: TGQuark): PRcProperty{.cdecl, + dynlib: lib, importc: "_gtk_rc_style_lookup_rc_property".} +proc rc_context_get_default_font_name*(settings: PSettings): cstring{.cdecl, + dynlib: lib, importc: "_gtk_rc_context_get_default_font_name".} +proc TYPE_STYLE*(): GType +proc STYLE*(anObject: pointer): PStyle +proc STYLE_CLASS*(klass: pointer): PStyleClass +proc IS_STYLE*(anObject: pointer): bool +proc IS_STYLE_CLASS*(klass: pointer): bool +proc STYLE_GET_CLASS*(obj: pointer): PStyleClass +proc TYPE_BORDER*(): GType +proc STYLE_ATTACHED*(style: pointer): bool +proc style_get_type*(): GType{.cdecl, dynlib: lib, importc: "gtk_style_get_type".} +proc style_new*(): PStyle{.cdecl, dynlib: lib, importc: "gtk_style_new".} +proc style_copy*(style: PStyle): PStyle{.cdecl, dynlib: lib, + importc: "gtk_style_copy".} +proc style_attach*(style: PStyle, window: PGdkWindow): PStyle{.cdecl, + dynlib: lib, importc: "gtk_style_attach".} +proc style_detach*(style: PStyle){.cdecl, dynlib: lib, + importc: "gtk_style_detach".} +proc style_set_background*(style: PStyle, window: PGdkWindow, + state_type: TStateType){.cdecl, dynlib: lib, + importc: "gtk_style_set_background".} +proc style_apply_default_background*(style: PStyle, window: PGdkWindow, + set_bg: gboolean, state_type: TStateType, + area: PGdkRectangle, x: gint, y: gint, + width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gtk_style_apply_default_background".} +proc style_lookup_icon_set*(style: PStyle, stock_id: cstring): PIconSet{.cdecl, + dynlib: lib, importc: "gtk_style_lookup_icon_set".} +proc style_render_icon*(style: PStyle, source: PIconSource, + direction: TTextDirection, state: TStateType, + size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{. + cdecl, dynlib: lib, importc: "gtk_style_render_icon".} +proc paint_hline*(style: PStyle, window: PGdkWindow, state_type: TStateType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x1: gint, x2: gint, y: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_hline".} +proc paint_vline*(style: PStyle, window: PGdkWindow, state_type: TStateType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + y1: gint, y2: gint, x: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_vline".} +proc paint_shadow*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_shadow".} +proc paint_polygon*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, points: PGdkPoint, + npoints: gint, fill: gboolean){.cdecl, dynlib: lib, + importc: "gtk_paint_polygon".} +proc paint_arrow*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, arrow_type: TArrowType, + fill: gboolean, x: gint, y: gint, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gtk_paint_arrow".} +proc paint_diamond*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_diamond".} +proc paint_box*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, widget: PWidget, + detail: cstring, x: gint, y: gint, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gtk_paint_box".} +proc paint_flat_box*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_flat_box".} +proc paint_check*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_check".} +proc paint_option*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_option".} +proc paint_tab*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, widget: PWidget, + detail: cstring, x: gint, y: gint, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "gtk_paint_tab".} +proc paint_shadow_gap*(style: PStyle, window: PGdkWindow, + state_type: TStateType, shadow_type: TShadowType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint, + gap_side: TPositionType, gap_x: gint, gap_width: gint){. + cdecl, dynlib: lib, importc: "gtk_paint_shadow_gap".} +proc paint_box_gap*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint, gap_side: TPositionType, + gap_x: gint, gap_width: gint){.cdecl, dynlib: lib, + importc: "gtk_paint_box_gap".} +proc paint_extension*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint, gap_side: TPositionType){. + cdecl, dynlib: lib, importc: "gtk_paint_extension".} +proc paint_focus*(style: PStyle, window: PGdkWindow, state_type: TStateType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gtk_paint_focus".} +proc paint_slider*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint, orientation: TOrientation){.cdecl, + dynlib: lib, importc: "gtk_paint_slider".} +proc paint_handle*(style: PStyle, window: PGdkWindow, state_type: TStateType, + shadow_type: TShadowType, area: PGdkRectangle, + widget: PWidget, detail: cstring, x: gint, y: gint, + width: gint, height: gint, orientation: TOrientation){.cdecl, + dynlib: lib, importc: "gtk_paint_handle".} +proc paint_expander*(style: PStyle, window: PGdkWindow, state_type: TStateType, + area: PGdkRectangle, widget: PWidget, detail: cstring, + x: gint, y: gint, expander_style: TExpanderStyle){.cdecl, + dynlib: lib, importc: "gtk_paint_expander".} +proc paint_layout*(style: PStyle, window: PGdkWindow, state_type: TStateType, + use_text: gboolean, area: PGdkRectangle, widget: PWidget, + detail: cstring, x: gint, y: gint, layout: PPangoLayout){. + cdecl, dynlib: lib, importc: "gtk_paint_layout".} +proc paint_resize_grip*(style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + widget: PWidget, detail: cstring, edge: TGdkWindowEdge, + x: gint, y: gint, width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gtk_paint_resize_grip".} +proc border_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_border_get_type".} +proc border_copy*(border: PBorder): PBorder{.cdecl, dynlib: lib, + importc: "gtk_border_copy".} +proc border_free*(border: PBorder){.cdecl, dynlib: lib, + importc: "gtk_border_free".} +proc style_peek_property_value*(style: PStyle, widget_type: GType, + pspec: PGParamSpec, parser: TRcPropertyParser): PGValue{. + cdecl, dynlib: lib, importc: "_gtk_style_peek_property_value".} +proc get_insertion_cursor_gc*(widget: PWidget, is_primary: gboolean): PGdkGC{. + cdecl, dynlib: lib, importc: "_gtk_get_insertion_cursor_gc".} +proc draw_insertion_cursor*(widget: PWidget, drawable: PGdkDrawable, gc: PGdkGC, + location: PGdkRectangle, direction: TTextDirection, + draw_arrow: gboolean){.cdecl, dynlib: lib, + importc: "_gtk_draw_insertion_cursor".} +const + bm_TGtkRange_inverted* = 0x0001'i16 + bp_TGtkRange_inverted* = 0'i16 + bm_TGtkRange_flippable* = 0x0002'i16 + bp_TGtkRange_flippable* = 1'i16 + bm_TGtkRange_has_stepper_a* = 0x0004'i16 + bp_TGtkRange_has_stepper_a* = 2'i16 + bm_TGtkRange_has_stepper_b* = 0x0008'i16 + bp_TGtkRange_has_stepper_b* = 3'i16 + bm_TGtkRange_has_stepper_c* = 0x0010'i16 + bp_TGtkRange_has_stepper_c* = 4'i16 + bm_TGtkRange_has_stepper_d* = 0x0020'i16 + bp_TGtkRange_has_stepper_d* = 5'i16 + bm_TGtkRange_need_recalc* = 0x0040'i16 + bp_TGtkRange_need_recalc* = 6'i16 + bm_TGtkRange_slider_size_fixed* = 0x0080'i16 + bp_TGtkRange_slider_size_fixed* = 7'i16 + bm_TGtkRange_trough_click_forward* = 0x0001'i16 + bp_TGtkRange_trough_click_forward* = 0'i16 + bm_TGtkRange_update_pending* = 0x0002'i16 + bp_TGtkRange_update_pending* = 1'i16 + +proc TYPE_RANGE*(): GType +proc RANGE*(obj: pointer): PRange +proc RANGE_CLASS*(klass: pointer): PRangeClass +proc IS_RANGE*(obj: pointer): bool +proc IS_RANGE_CLASS*(klass: pointer): bool +proc RANGE_GET_CLASS*(obj: pointer): PRangeClass +proc inverted*(a: var TRange): guint +proc set_inverted*(a: var TRange, `inverted`: guint) +proc flippable*(a: var TRange): guint +proc set_flippable*(a: var TRange, `flippable`: guint) +proc has_stepper_a*(a: var TRange): guint +proc set_has_stepper_a*(a: var TRange, `has_stepper_a`: guint) +proc has_stepper_b*(a: var TRange): guint +proc set_has_stepper_b*(a: var TRange, `has_stepper_b`: guint) +proc has_stepper_c*(a: var TRange): guint +proc set_has_stepper_c*(a: var TRange, `has_stepper_c`: guint) +proc has_stepper_d*(a: var TRange): guint +proc set_has_stepper_d*(a: var TRange, `has_stepper_d`: guint) +proc need_recalc*(a: var TRange): guint +proc set_need_recalc*(a: var TRange, `need_recalc`: guint) +proc slider_size_fixed*(a: var TRange): guint +proc set_slider_size_fixed*(a: var TRange, `slider_size_fixed`: guint) +proc trough_click_forward*(a: var TRange): guint +proc set_trough_click_forward*(a: var TRange, `trough_click_forward`: guint) +proc update_pending*(a: var TRange): guint +proc set_update_pending*(a: var TRange, `update_pending`: guint) +proc range_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_range_get_type".} +proc range_set_update_policy*(range: PRange, policy: TUpdateType){.cdecl, + dynlib: lib, importc: "gtk_range_set_update_policy".} +proc range_get_update_policy*(range: PRange): TUpdateType{.cdecl, dynlib: lib, + importc: "gtk_range_get_update_policy".} +proc range_set_adjustment*(range: PRange, adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_range_set_adjustment".} +proc range_get_adjustment*(range: PRange): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_range_get_adjustment".} +proc range_set_inverted*(range: PRange, setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_range_set_inverted".} +proc range_get_inverted*(range: PRange): gboolean{.cdecl, dynlib: lib, + importc: "gtk_range_get_inverted".} +proc range_set_increments*(range: PRange, step: gdouble, page: gdouble){.cdecl, + dynlib: lib, importc: "gtk_range_set_increments".} +proc range_set_range*(range: PRange, min: gdouble, max: gdouble){.cdecl, + dynlib: lib, importc: "gtk_range_set_range".} +proc range_set_value*(range: PRange, value: gdouble){.cdecl, dynlib: lib, + importc: "gtk_range_set_value".} +proc range_get_value*(range: PRange): gdouble{.cdecl, dynlib: lib, + importc: "gtk_range_get_value".} +const + bm_TGtkScale_draw_value* = 0x0001'i16 + bp_TGtkScale_draw_value* = 0'i16 + bm_TGtkScale_value_pos* = 0x0006'i16 + bp_TGtkScale_value_pos* = 1'i16 + +proc TYPE_SCALE*(): GType +proc SCALE*(obj: pointer): PScale +proc SCALE_CLASS*(klass: pointer): PScaleClass +proc IS_SCALE*(obj: pointer): bool +proc IS_SCALE_CLASS*(klass: pointer): bool +proc SCALE_GET_CLASS*(obj: pointer): PScaleClass +proc draw_value*(a: var TScale): guint +proc set_draw_value*(a: var TScale, `draw_value`: guint) +proc value_pos*(a: var TScale): guint +proc set_value_pos*(a: var TScale, `value_pos`: guint) +proc scale_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_scale_get_type".} +proc scale_set_digits*(scale: PScale, digits: gint){.cdecl, dynlib: lib, + importc: "gtk_scale_set_digits".} +proc scale_get_digits*(scale: PScale): gint{.cdecl, dynlib: lib, + importc: "gtk_scale_get_digits".} +proc scale_set_draw_value*(scale: PScale, draw_value: gboolean){.cdecl, + dynlib: lib, importc: "gtk_scale_set_draw_value".} +proc scale_get_draw_value*(scale: PScale): gboolean{.cdecl, dynlib: lib, + importc: "gtk_scale_get_draw_value".} +proc scale_set_value_pos*(scale: PScale, pos: TPositionType){.cdecl, + dynlib: lib, importc: "gtk_scale_set_value_pos".} +proc scale_get_value_pos*(scale: PScale): TPositionType{.cdecl, dynlib: lib, + importc: "gtk_scale_get_value_pos".} +proc scale_get_value_size*(scale: PScale, width: Pgint, height: Pgint){.cdecl, + dynlib: lib, importc: "_gtk_scale_get_value_size".} +proc scale_format_value*(scale: PScale, value: gdouble): cstring{.cdecl, + dynlib: lib, importc: "_gtk_scale_format_value".} +proc TYPE_HSCALE*(): GType +proc HSCALE*(obj: pointer): PHScale +proc HSCALE_CLASS*(klass: pointer): PHScaleClass +proc IS_HSCALE*(obj: pointer): bool +proc IS_HSCALE_CLASS*(klass: pointer): bool +proc HSCALE_GET_CLASS*(obj: pointer): PHScaleClass +proc hscale_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hscale_get_type".} +proc hscale_new*(adjustment: PAdjustment): PHScale{.cdecl, dynlib: lib, + importc: "gtk_hscale_new".} +proc hscale_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PHScale{. + cdecl, dynlib: lib, importc: "gtk_hscale_new_with_range".} +proc TYPE_SCROLLBAR*(): GType +proc SCROLLBAR*(obj: pointer): PScrollbar +proc SCROLLBAR_CLASS*(klass: pointer): PScrollbarClass +proc IS_SCROLLBAR*(obj: pointer): bool +proc IS_SCROLLBAR_CLASS*(klass: pointer): bool +proc SCROLLBAR_GET_CLASS*(obj: pointer): PScrollbarClass +proc scrollbar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_scrollbar_get_type".} +proc TYPE_HSCROLLBAR*(): GType +proc HSCROLLBAR*(obj: pointer): PHScrollbar +proc HSCROLLBAR_CLASS*(klass: pointer): PHScrollbarClass +proc IS_HSCROLLBAR*(obj: pointer): bool +proc IS_HSCROLLBAR_CLASS*(klass: pointer): bool +proc HSCROLLBAR_GET_CLASS*(obj: pointer): PHScrollbarClass +proc hscrollbar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hscrollbar_get_type".} +proc hscrollbar_new*(adjustment: PAdjustment): PHScrollbar{.cdecl, dynlib: lib, + importc: "gtk_hscrollbar_new".} +proc TYPE_SEPARATOR*(): GType +proc SEPARATOR*(obj: pointer): PSeparator +proc SEPARATOR_CLASS*(klass: pointer): PSeparatorClass +proc IS_SEPARATOR*(obj: pointer): bool +proc IS_SEPARATOR_CLASS*(klass: pointer): bool +proc SEPARATOR_GET_CLASS*(obj: pointer): PSeparatorClass +proc separator_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_separator_get_type".} +proc TYPE_HSEPARATOR*(): GType +proc HSEPARATOR*(obj: pointer): PHSeparator +proc HSEPARATOR_CLASS*(klass: pointer): PHSeparatorClass +proc IS_HSEPARATOR*(obj: pointer): bool +proc IS_HSEPARATOR_CLASS*(klass: pointer): bool +proc HSEPARATOR_GET_CLASS*(obj: pointer): PHSeparatorClass +proc hseparator_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_hseparator_get_type".} +proc hseparator_new*(): PHSeparator{.cdecl, dynlib: lib, + importc: "gtk_hseparator_new".} +proc TYPE_ICON_FACTORY*(): GType +proc ICON_FACTORY*(anObject: pointer): PIconFactory +proc ICON_FACTORY_CLASS*(klass: pointer): PIconFactoryClass +proc IS_ICON_FACTORY*(anObject: pointer): bool +proc IS_ICON_FACTORY_CLASS*(klass: pointer): bool +proc ICON_FACTORY_GET_CLASS*(obj: pointer): PIconFactoryClass +proc TYPE_ICON_SET*(): GType +proc TYPE_ICON_SOURCE*(): GType +proc icon_factory_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_icon_factory_get_type".} +proc icon_factory_new*(): PIconFactory{.cdecl, dynlib: lib, + importc: "gtk_icon_factory_new".} +proc icon_factory_add*(factory: PIconFactory, stock_id: cstring, + icon_set: PIconSet){.cdecl, dynlib: lib, + importc: "gtk_icon_factory_add".} +proc icon_factory_lookup*(factory: PIconFactory, stock_id: cstring): PIconSet{. + cdecl, dynlib: lib, importc: "gtk_icon_factory_lookup".} +proc icon_factory_add_default*(factory: PIconFactory){.cdecl, dynlib: lib, + importc: "gtk_icon_factory_add_default".} +proc icon_factory_remove_default*(factory: PIconFactory){.cdecl, dynlib: lib, + importc: "gtk_icon_factory_remove_default".} +proc icon_factory_lookup_default*(stock_id: cstring): PIconSet{.cdecl, + dynlib: lib, importc: "gtk_icon_factory_lookup_default".} +proc icon_size_lookup*(size: TIconSize, width: Pgint, height: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_icon_size_lookup".} +proc icon_size_register*(name: cstring, width: gint, height: gint): TIconSize{. + cdecl, dynlib: lib, importc: "gtk_icon_size_register".} +proc icon_size_register_alias*(alias: cstring, target: TIconSize){.cdecl, + dynlib: lib, importc: "gtk_icon_size_register_alias".} +proc icon_size_from_name*(name: cstring): TIconSize{.cdecl, dynlib: lib, + importc: "gtk_icon_size_from_name".} +proc icon_size_get_name*(size: TIconSize): cstring{.cdecl, dynlib: lib, + importc: "gtk_icon_size_get_name".} +proc icon_set_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_icon_set_get_type".} +proc icon_set_new*(): PIconSet{.cdecl, dynlib: lib, importc: "gtk_icon_set_new".} +proc icon_set_new_from_pixbuf*(pixbuf: PGdkPixbuf): PIconSet{.cdecl, + dynlib: lib, importc: "gtk_icon_set_new_from_pixbuf".} +proc icon_set_ref*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib, + importc: "gtk_icon_set_ref".} +proc icon_set_unref*(icon_set: PIconSet){.cdecl, dynlib: lib, + importc: "gtk_icon_set_unref".} +proc icon_set_copy*(icon_set: PIconSet): PIconSet{.cdecl, dynlib: lib, + importc: "gtk_icon_set_copy".} +proc icon_set_render_icon*(icon_set: PIconSet, style: PStyle, + direction: TTextDirection, state: TStateType, + size: TIconSize, widget: PWidget, detail: cstring): PGdkPixbuf{. + cdecl, dynlib: lib, importc: "gtk_icon_set_render_icon".} +proc icon_set_add_source*(icon_set: PIconSet, source: PIconSource){.cdecl, + dynlib: lib, importc: "gtk_icon_set_add_source".} +proc icon_set_get_sizes*(icon_set: PIconSet, sizes: PPGtkIconSize, + n_sizes: pgint){.cdecl, dynlib: lib, + importc: "gtk_icon_set_get_sizes".} +proc icon_source_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_icon_source_get_type".} +proc icon_source_new*(): PIconSource{.cdecl, dynlib: lib, + importc: "gtk_icon_source_new".} +proc icon_source_copy*(source: PIconSource): PIconSource{.cdecl, dynlib: lib, + importc: "gtk_icon_source_copy".} +proc icon_source_free*(source: PIconSource){.cdecl, dynlib: lib, + importc: "gtk_icon_source_free".} +proc icon_source_set_filename*(source: PIconSource, filename: cstring){.cdecl, + dynlib: lib, importc: "gtk_icon_source_set_filename".} +proc icon_source_set_pixbuf*(source: PIconSource, pixbuf: PGdkPixbuf){.cdecl, + dynlib: lib, importc: "gtk_icon_source_set_pixbuf".} +proc icon_source_get_filename*(source: PIconSource): cstring{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_filename".} +proc icon_source_get_pixbuf*(source: PIconSource): PGdkPixbuf{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_pixbuf".} +proc icon_source_set_direction_wildcarded*(source: PIconSource, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_icon_source_set_direction_wildcarded".} +proc icon_source_set_state_wildcarded*(source: PIconSource, setting: gboolean){. + cdecl, dynlib: lib, importc: "gtk_icon_source_set_state_wildcarded".} +proc icon_source_set_size_wildcarded*(source: PIconSource, setting: gboolean){. + cdecl, dynlib: lib, importc: "gtk_icon_source_set_size_wildcarded".} +proc icon_source_get_size_wildcarded*(source: PIconSource): gboolean{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_size_wildcarded".} +proc icon_source_get_state_wildcarded*(source: PIconSource): gboolean{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_state_wildcarded".} +proc icon_source_get_direction_wildcarded*(source: PIconSource): gboolean{. + cdecl, dynlib: lib, importc: "gtk_icon_source_get_direction_wildcarded".} +proc icon_source_set_direction*(source: PIconSource, direction: TTextDirection){. + cdecl, dynlib: lib, importc: "gtk_icon_source_set_direction".} +proc icon_source_set_state*(source: PIconSource, state: TStateType){.cdecl, + dynlib: lib, importc: "gtk_icon_source_set_state".} +proc icon_source_set_size*(source: PIconSource, size: TIconSize){.cdecl, + dynlib: lib, importc: "gtk_icon_source_set_size".} +proc icon_source_get_direction*(source: PIconSource): TTextDirection{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_direction".} +proc icon_source_get_state*(source: PIconSource): TStateType{.cdecl, + dynlib: lib, importc: "gtk_icon_source_get_state".} +proc icon_source_get_size*(source: PIconSource): TIconSize{.cdecl, dynlib: lib, + importc: "gtk_icon_source_get_size".} +proc icon_set_invalidate_caches*(){.cdecl, dynlib: lib, + importc: "_gtk_icon_set_invalidate_caches".} +proc icon_factory_list_ids*(): PGSList{.cdecl, dynlib: lib, + importc: "_gtk_icon_factory_list_ids".} +proc TYPE_IMAGE*(): GType +proc IMAGE*(obj: pointer): PImage +proc IMAGE_CLASS*(klass: pointer): PImageClass +proc IS_IMAGE*(obj: pointer): bool +proc IS_IMAGE_CLASS*(klass: pointer): bool +proc IMAGE_GET_CLASS*(obj: pointer): PImageClass +proc image_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_image_get_type".} +proc image_new*(): PImage{.cdecl, dynlib: lib, importc: "gtk_image_new".} +proc image_new_from_pixmap*(pixmap: PGdkPixmap, mask: PGdkBitmap): PImage{. + cdecl, dynlib: lib, importc: "gtk_image_new_from_pixmap".} +proc image_new_from_image*(image: PGdkImage, mask: PGdkBitmap): PImage{.cdecl, + dynlib: lib, importc: "gtk_image_new_from_image".} +proc image_new_from_file*(filename: cstring): PImage{.cdecl, dynlib: lib, + importc: "gtk_image_new_from_file".} +proc image_new_from_pixbuf*(pixbuf: PGdkPixbuf): PImage{.cdecl, dynlib: lib, + importc: "gtk_image_new_from_pixbuf".} +proc image_new_from_stock*(stock_id: cstring, size: TIconSize): PImage{.cdecl, + dynlib: lib, importc: "gtk_image_new_from_stock".} +proc image_new_from_icon_set*(icon_set: PIconSet, size: TIconSize): PImage{. + cdecl, dynlib: lib, importc: "gtk_image_new_from_icon_set".} +proc image_new_from_animation*(animation: PGdkPixbufAnimation): PImage{.cdecl, + dynlib: lib, importc: "gtk_image_new_from_animation".} +proc image_set_from_pixmap*(image: PImage, pixmap: PGdkPixmap, mask: PGdkBitmap){. + cdecl, dynlib: lib, importc: "gtk_image_set_from_pixmap".} +proc image_set_from_image*(image: PImage, gdk_image: PGdkImage, mask: PGdkBitmap){. + cdecl, dynlib: lib, importc: "gtk_image_set_from_image".} +proc image_set_from_file*(image: PImage, filename: cstring){.cdecl, dynlib: lib, + importc: "gtk_image_set_from_file".} +proc image_set_from_pixbuf*(image: PImage, pixbuf: PGdkPixbuf){.cdecl, + dynlib: lib, importc: "gtk_image_set_from_pixbuf".} +proc image_set_from_stock*(image: PImage, stock_id: cstring, size: TIconSize){. + cdecl, dynlib: lib, importc: "gtk_image_set_from_stock".} +proc image_set_from_icon_set*(image: PImage, icon_set: PIconSet, size: TIconSize){. + cdecl, dynlib: lib, importc: "gtk_image_set_from_icon_set".} +proc image_set_from_animation*(image: PImage, animation: PGdkPixbufAnimation){. + cdecl, dynlib: lib, importc: "gtk_image_set_from_animation".} +proc image_get_storage_type*(image: PImage): TImageType{.cdecl, dynlib: lib, + importc: "gtk_image_get_storage_type".} +proc image_get_pixbuf*(image: PImage): PGdkPixbuf{.cdecl, dynlib: lib, + importc: "gtk_image_get_pixbuf".} +proc image_get_stock*(image: PImage, stock_id: PPgchar, size: PIconSize){.cdecl, + dynlib: lib, importc: "gtk_image_get_stock".} +proc image_get_animation*(image: PImage): PGdkPixbufAnimation{.cdecl, + dynlib: lib, importc: "gtk_image_get_animation".} +proc TYPE_IMAGE_MENU_ITEM*(): GType +proc IMAGE_MENU_ITEM*(obj: pointer): PImageMenuItem +proc IMAGE_MENU_ITEM_CLASS*(klass: pointer): PImageMenuItemClass +proc IS_IMAGE_MENU_ITEM*(obj: pointer): bool +proc IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool +proc IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PImageMenuItemClass +proc image_menu_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_image_menu_item_get_type".} +proc image_menu_item_new*(): PImageMenuItem{.cdecl, dynlib: lib, + importc: "gtk_image_menu_item_new".} +proc image_menu_item_new_with_label*(`label`: cstring): PImageMenuItem{.cdecl, + dynlib: lib, importc: "gtk_image_menu_item_new_with_label".} +proc image_menu_item_new_with_mnemonic*(`label`: cstring): PImageMenuItem{. + cdecl, dynlib: lib, importc: "gtk_image_menu_item_new_with_mnemonic".} +proc image_menu_item_new_from_stock*(stock_id: cstring, accel_group: PAccelGroup): PImageMenuItem{. + cdecl, dynlib: lib, importc: "gtk_image_menu_item_new_from_stock".} +proc image_menu_item_set_image*(image_menu_item: PImageMenuItem, image: PWidget){. + cdecl, dynlib: lib, importc: "gtk_image_menu_item_set_image".} +proc image_menu_item_get_image*(image_menu_item: PImageMenuItem): PWidget{. + cdecl, dynlib: lib, importc: "gtk_image_menu_item_get_image".} +const + bm_TGtkIMContextSimple_in_hex_sequence* = 0x0001'i16 + bp_TGtkIMContextSimple_in_hex_sequence* = 0'i16 + +proc TYPE_IM_CONTEXT_SIMPLE*(): GType +proc IM_CONTEXT_SIMPLE*(obj: pointer): PIMContextSimple +proc IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PIMContextSimpleClass +proc IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool +proc IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool +proc IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PIMContextSimpleClass +proc in_hex_sequence*(a: var TIMContextSimple): guint +proc set_in_hex_sequence*(a: var TIMContextSimple, `in_hex_sequence`: guint) +proc im_context_simple_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_im_context_simple_get_type".} +proc im_context_simple_new*(): PIMContext{.cdecl, dynlib: lib, + importc: "gtk_im_context_simple_new".} +proc im_context_simple_add_table*(context_simple: PIMContextSimple, + data: Pguint16, max_seq_len: gint, + n_seqs: gint){.cdecl, dynlib: lib, + importc: "gtk_im_context_simple_add_table".} +proc TYPE_IM_MULTICONTEXT*(): GType +proc IM_MULTICONTEXT*(obj: pointer): PIMMulticontext +proc IM_MULTICONTEXT_CLASS*(klass: pointer): PIMMulticontextClass +proc IS_IM_MULTICONTEXT*(obj: pointer): bool +proc IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool +proc IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PIMMulticontextClass +proc im_multicontext_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_im_multicontext_get_type".} +proc im_multicontext_new*(): PIMContext{.cdecl, dynlib: lib, + importc: "gtk_im_multicontext_new".} +proc im_multicontext_append_menuitems*(context: PIMMulticontext, + menushell: PMenuShell){.cdecl, + dynlib: lib, importc: "gtk_im_multicontext_append_menuitems".} +proc TYPE_INPUT_DIALOG*(): GType +proc INPUT_DIALOG*(obj: pointer): PInputDialog +proc INPUT_DIALOG_CLASS*(klass: pointer): PInputDialogClass +proc IS_INPUT_DIALOG*(obj: pointer): bool +proc IS_INPUT_DIALOG_CLASS*(klass: pointer): bool +proc INPUT_DIALOG_GET_CLASS*(obj: pointer): PInputDialogClass +proc input_dialog_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_input_dialog_get_type".} +proc input_dialog_new*(): PInputDialog{.cdecl, dynlib: lib, + importc: "gtk_input_dialog_new".} +proc TYPE_INVISIBLE*(): GType +proc INVISIBLE*(obj: pointer): PInvisible +proc INVISIBLE_CLASS*(klass: pointer): PInvisibleClass +proc IS_INVISIBLE*(obj: pointer): bool +proc IS_INVISIBLE_CLASS*(klass: pointer): bool +proc INVISIBLE_GET_CLASS*(obj: pointer): PInvisibleClass +proc invisible_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_invisible_get_type".} +proc invisible_new*(): PInvisible{.cdecl, dynlib: lib, + importc: "gtk_invisible_new".} +proc invisible_new_for_screen*(screen: PGdkScreen): PInvisible{.cdecl, + dynlib: lib, importc: "gtk_invisible_new_for_screen".} +proc invisible_set_screen*(invisible: PInvisible, screen: PGdkScreen){.cdecl, + dynlib: lib, importc: "gtk_invisible_set_screen".} +proc invisible_get_screen*(invisible: PInvisible): PGdkScreen{.cdecl, + dynlib: lib, importc: "gtk_invisible_get_screen".} +proc TYPE_ITEM_FACTORY*(): GType +proc ITEM_FACTORY*(anObject: pointer): PItemFactory +proc ITEM_FACTORY_CLASS*(klass: pointer): PItemFactoryClass +proc IS_ITEM_FACTORY*(anObject: pointer): bool +proc IS_ITEM_FACTORY_CLASS*(klass: pointer): bool +proc ITEM_FACTORY_GET_CLASS*(obj: pointer): PItemFactoryClass +proc item_factory_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_item_factory_get_type".} +proc item_factory_new*(container_type: TType, path: cstring, + accel_group: PAccelGroup): PItemFactory{.cdecl, + dynlib: lib, importc: "gtk_item_factory_new".} +proc item_factory_construct*(ifactory: PItemFactory, container_type: TType, + path: cstring, accel_group: PAccelGroup){.cdecl, + dynlib: lib, importc: "gtk_item_factory_construct".} +proc item_factory_add_foreign*(accel_widget: PWidget, full_path: cstring, + accel_group: PAccelGroup, keyval: guint, + modifiers: TGdkModifierType){.cdecl, dynlib: lib, + importc: "gtk_item_factory_add_foreign".} +proc item_factory_from_widget*(widget: PWidget): PItemFactory{.cdecl, + dynlib: lib, importc: "gtk_item_factory_from_widget".} +proc item_factory_path_from_widget*(widget: PWidget): cstring{.cdecl, + dynlib: lib, importc: "gtk_item_factory_path_from_widget".} +proc item_factory_get_item*(ifactory: PItemFactory, path: cstring): PWidget{. + cdecl, dynlib: lib, importc: "gtk_item_factory_get_item".} +proc item_factory_get_widget*(ifactory: PItemFactory, path: cstring): PWidget{. + cdecl, dynlib: lib, importc: "gtk_item_factory_get_widget".} +proc item_factory_get_widget_by_action*(ifactory: PItemFactory, action: guint): PWidget{. + cdecl, dynlib: lib, importc: "gtk_item_factory_get_widget_by_action".} +proc item_factory_get_item_by_action*(ifactory: PItemFactory, action: guint): PWidget{. + cdecl, dynlib: lib, importc: "gtk_item_factory_get_item_by_action".} +proc item_factory_create_item*(ifactory: PItemFactory, entry: PItemFactoryEntry, + callback_data: gpointer, callback_type: guint){. + cdecl, dynlib: lib, importc: "gtk_item_factory_create_item".} +proc item_factory_create_items*(ifactory: PItemFactory, n_entries: guint, + entries: PItemFactoryEntry, + callback_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_item_factory_create_items".} +proc item_factory_delete_item*(ifactory: PItemFactory, path: cstring){.cdecl, + dynlib: lib, importc: "gtk_item_factory_delete_item".} +proc item_factory_delete_entry*(ifactory: PItemFactory, entry: PItemFactoryEntry){. + cdecl, dynlib: lib, importc: "gtk_item_factory_delete_entry".} +proc item_factory_delete_entries*(ifactory: PItemFactory, n_entries: guint, + entries: PItemFactoryEntry){.cdecl, + dynlib: lib, importc: "gtk_item_factory_delete_entries".} +proc item_factory_popup*(ifactory: PItemFactory, x: guint, y: guint, + mouse_button: guint, time: guint32){.cdecl, + dynlib: lib, importc: "gtk_item_factory_popup".} +proc item_factory_popup_with_data*(ifactory: PItemFactory, popup_data: gpointer, + destroy: TDestroyNotify, x: guint, y: guint, + mouse_button: guint, time: guint32){.cdecl, + dynlib: lib, importc: "gtk_item_factory_popup_with_data".} +proc item_factory_popup_data*(ifactory: PItemFactory): gpointer{.cdecl, + dynlib: lib, importc: "gtk_item_factory_popup_data".} +proc item_factory_popup_data_from_widget*(widget: PWidget): gpointer{.cdecl, + dynlib: lib, importc: "gtk_item_factory_popup_data_from_widget".} +proc item_factory_set_translate_func*(ifactory: PItemFactory, + func_: TTranslateFunc, data: gpointer, + notify: TDestroyNotify){.cdecl, + dynlib: lib, importc: "gtk_item_factory_set_translate_func".} +proc TYPE_LAYOUT*(): GType +proc LAYOUT*(obj: pointer): PLayout +proc LAYOUT_CLASS*(klass: pointer): PLayoutClass +proc IS_LAYOUT*(obj: pointer): bool +proc IS_LAYOUT_CLASS*(klass: pointer): bool +proc LAYOUT_GET_CLASS*(obj: pointer): PLayoutClass +proc layout_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_layout_get_type".} +proc layout_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PLayout{. + cdecl, dynlib: lib, importc: "gtk_layout_new".} +proc layout_put*(layout: PLayout, child_widget: PWidget, x: gint, y: gint){. + cdecl, dynlib: lib, importc: "gtk_layout_put".} +proc layout_move*(layout: PLayout, child_widget: PWidget, x: gint, y: gint){. + cdecl, dynlib: lib, importc: "gtk_layout_move".} +proc layout_set_size*(layout: PLayout, width: guint, height: guint){.cdecl, + dynlib: lib, importc: "gtk_layout_set_size".} +proc layout_get_size*(layout: PLayout, width: Pguint, height: Pguint){.cdecl, + dynlib: lib, importc: "gtk_layout_get_size".} +proc layout_get_hadjustment*(layout: PLayout): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_layout_get_hadjustment".} +proc layout_get_vadjustment*(layout: PLayout): PAdjustment{.cdecl, dynlib: lib, + importc: "gtk_layout_get_vadjustment".} +proc layout_set_hadjustment*(layout: PLayout, adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_layout_set_hadjustment".} +proc layout_set_vadjustment*(layout: PLayout, adjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_layout_set_vadjustment".} +const + bm_TGtkList_selection_mode* = 0x0003'i16 + bp_TGtkList_selection_mode* = 0'i16 + bm_TGtkList_drag_selection* = 0x0004'i16 + bp_TGtkList_drag_selection* = 2'i16 + bm_TGtkList_add_mode* = 0x0008'i16 + bp_TGtkList_add_mode* = 3'i16 + +proc TYPE_LIST*(): GType +proc LIST*(obj: pointer): PList +proc LIST_CLASS*(klass: pointer): PListClass +proc IS_LIST*(obj: pointer): bool +proc IS_LIST_CLASS*(klass: pointer): bool +proc LIST_GET_CLASS*(obj: pointer): PListClass +proc selection_mode*(a: var TList): guint +proc set_selection_mode*(a: var TList, `selection_mode`: guint) +proc drag_selection*(a: var TList): guint +proc set_drag_selection*(a: var TList, `drag_selection`: guint) +proc add_mode*(a: var TList): guint +proc set_add_mode*(a: var TList, `add_mode`: guint) +proc list_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_list_get_type".} +proc list_new*(): PList{.cdecl, dynlib: lib, importc: "gtk_list_new".} +proc list_insert_items*(list: PList, items: PGList, position: gint){.cdecl, + dynlib: lib, importc: "gtk_list_insert_items".} +proc list_append_items*(list: PList, items: PGList){.cdecl, dynlib: lib, + importc: "gtk_list_append_items".} +proc list_prepend_items*(list: PList, items: PGList){.cdecl, dynlib: lib, + importc: "gtk_list_prepend_items".} +proc list_remove_items*(list: PList, items: PGList){.cdecl, dynlib: lib, + importc: "gtk_list_remove_items".} +proc list_remove_items_no_unref*(list: PList, items: PGList){.cdecl, + dynlib: lib, importc: "gtk_list_remove_items_no_unref".} +proc list_clear_items*(list: PList, start: gint, theEnd: gint){.cdecl, + dynlib: lib, importc: "gtk_list_clear_items".} +proc list_select_item*(list: PList, item: gint){.cdecl, dynlib: lib, + importc: "gtk_list_select_item".} +proc list_unselect_item*(list: PList, item: gint){.cdecl, dynlib: lib, + importc: "gtk_list_unselect_item".} +proc list_select_child*(list: PList, child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_list_select_child".} +proc list_unselect_child*(list: PList, child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_list_unselect_child".} +proc list_child_position*(list: PList, child: PWidget): gint{.cdecl, + dynlib: lib, importc: "gtk_list_child_position".} +proc list_set_selection_mode*(list: PList, mode: TSelectionMode){.cdecl, + dynlib: lib, importc: "gtk_list_set_selection_mode".} +proc list_extend_selection*(list: PList, scroll_type: TScrollType, + position: gfloat, auto_start_selection: gboolean){. + cdecl, dynlib: lib, importc: "gtk_list_extend_selection".} +proc list_start_selection*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_start_selection".} +proc list_end_selection*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_end_selection".} +proc list_select_all*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_select_all".} +proc list_unselect_all*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_unselect_all".} +proc list_scroll_horizontal*(list: PList, scroll_type: TScrollType, + position: gfloat){.cdecl, dynlib: lib, + importc: "gtk_list_scroll_horizontal".} +proc list_scroll_vertical*(list: PList, scroll_type: TScrollType, + position: gfloat){.cdecl, dynlib: lib, + importc: "gtk_list_scroll_vertical".} +proc list_toggle_add_mode*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_toggle_add_mode".} +proc list_toggle_focus_row*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_toggle_focus_row".} +proc list_toggle_row*(list: PList, item: PWidget){.cdecl, dynlib: lib, + importc: "gtk_list_toggle_row".} +proc list_undo_selection*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_undo_selection".} +proc list_end_drag_selection*(list: PList){.cdecl, dynlib: lib, + importc: "gtk_list_end_drag_selection".} +const + TREE_MODEL_ITERS_PERSIST* = 1 shl 0 + TREE_MODEL_LIST_ONLY* = 1 shl 1 + +proc TYPE_TREE_MODEL*(): GType +proc TREE_MODEL*(obj: pointer): PTreeModel +proc IS_TREE_MODEL*(obj: pointer): bool +proc TREE_MODEL_GET_IFACE*(obj: pointer): PTreeModelIface +proc TYPE_TREE_ITER*(): GType +proc TYPE_TREE_PATH*(): GType +proc tree_path_new*(): PTreePath{.cdecl, dynlib: lib, + importc: "gtk_tree_path_new".} +proc tree_path_new_from_string*(path: cstring): PTreePath{.cdecl, dynlib: lib, + importc: "gtk_tree_path_new_from_string".} +proc tree_path_to_string*(path: PTreePath): cstring{.cdecl, dynlib: lib, + importc: "gtk_tree_path_to_string".} +proc tree_path_new_root*(): PTreePath +proc tree_path_new_first*(): PTreePath{.cdecl, dynlib: lib, + importc: "gtk_tree_path_new_first".} +proc tree_path_append_index*(path: PTreePath, index: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_path_append_index".} +proc tree_path_prepend_index*(path: PTreePath, index: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_path_prepend_index".} +proc tree_path_get_depth*(path: PTreePath): gint{.cdecl, dynlib: lib, + importc: "gtk_tree_path_get_depth".} +proc tree_path_get_indices*(path: PTreePath): Pgint{.cdecl, dynlib: lib, + importc: "gtk_tree_path_get_indices".} +proc tree_path_free*(path: PTreePath){.cdecl, dynlib: lib, + importc: "gtk_tree_path_free".} +proc tree_path_copy*(path: PTreePath): PTreePath{.cdecl, dynlib: lib, + importc: "gtk_tree_path_copy".} +proc tree_path_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_path_get_type".} +proc tree_path_compare*(a: PTreePath, b: PTreePath): gint{.cdecl, dynlib: lib, + importc: "gtk_tree_path_compare".} +proc tree_path_next*(path: PTreePath){.cdecl, dynlib: lib, + importc: "gtk_tree_path_next".} +proc tree_path_prev*(path: PTreePath): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_path_prev".} +proc tree_path_up*(path: PTreePath): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_path_up".} +proc tree_path_down*(path: PTreePath){.cdecl, dynlib: lib, + importc: "gtk_tree_path_down".} +proc tree_path_is_ancestor*(path: PTreePath, descendant: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_path_is_ancestor".} +proc tree_path_is_descendant*(path: PTreePath, ancestor: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_path_is_descendant".} +proc tree_row_reference_new*(model: PTreeModel, path: PTreePath): PTreeRowReference{. + cdecl, dynlib: lib, importc: "gtk_tree_row_reference_new".} +proc tree_row_reference_new_proxy*(proxy: PGObject, model: PTreeModel, + path: PTreePath): PTreeRowReference{.cdecl, + dynlib: lib, importc: "gtk_tree_row_reference_new_proxy".} +proc tree_row_reference_get_path*(reference: PTreeRowReference): PTreePath{. + cdecl, dynlib: lib, importc: "gtk_tree_row_reference_get_path".} +proc tree_row_reference_valid*(reference: PTreeRowReference): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_row_reference_valid".} +proc tree_row_reference_free*(reference: PTreeRowReference){.cdecl, dynlib: lib, + importc: "gtk_tree_row_reference_free".} +proc tree_row_reference_inserted*(proxy: PGObject, path: PTreePath){.cdecl, + dynlib: lib, importc: "gtk_tree_row_reference_inserted".} +proc tree_row_reference_deleted*(proxy: PGObject, path: PTreePath){.cdecl, + dynlib: lib, importc: "gtk_tree_row_reference_deleted".} +proc tree_row_reference_reordered*(proxy: PGObject, path: PTreePath, + iter: PTreeIter, new_order: Pgint){.cdecl, + dynlib: lib, importc: "gtk_tree_row_reference_reordered".} +proc tree_iter_copy*(iter: PTreeIter): PTreeIter{.cdecl, dynlib: lib, + importc: "gtk_tree_iter_copy".} +proc tree_iter_free*(iter: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_iter_free".} +proc tree_iter_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_iter_get_type".} +proc tree_model_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_model_get_type".} +proc tree_model_get_flags*(tree_model: PTreeModel): TTreeModelFlags{.cdecl, + dynlib: lib, importc: "gtk_tree_model_get_flags".} +proc tree_model_get_n_columns*(tree_model: PTreeModel): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_model_get_n_columns".} +proc tree_model_get_column_type*(tree_model: PTreeModel, index: gint): GType{. + cdecl, dynlib: lib, importc: "gtk_tree_model_get_column_type".} +proc tree_model_get_iter*(tree_model: PTreeModel, iter: PTreeIter, + path: PTreePath): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_model_get_iter".} +proc tree_model_get_iter_from_string*(tree_model: PTreeModel, iter: PTreeIter, + path_string: cstring): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_model_get_iter_from_string".} +proc tree_model_get_iter_root*(tree_model: PTreeModel, iter: PTreeIter): gboolean +proc tree_model_get_iter_first*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_model_get_iter_first".} +proc tree_model_get_path*(tree_model: PTreeModel, iter: PTreeIter): PTreePath{. + cdecl, dynlib: lib, importc: "gtk_tree_model_get_path".} +proc tree_model_get_value*(tree_model: PTreeModel, iter: PTreeIter, + column: gint, value: PGValue){.cdecl, dynlib: lib, + importc: "gtk_tree_model_get_value".} +proc tree_model_iter_next*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_model_iter_next".} +proc tree_model_iter_children*(tree_model: PTreeModel, iter: PTreeIter, + parent: PTreeIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_model_iter_children".} +proc tree_model_iter_has_child*(tree_model: PTreeModel, iter: PTreeIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_model_iter_has_child".} +proc tree_model_iter_n_children*(tree_model: PTreeModel, iter: PTreeIter): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_model_iter_n_children".} +proc tree_model_iter_nth_child*(tree_model: PTreeModel, iter: PTreeIter, + parent: PTreeIter, n: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_model_iter_nth_child".} +proc tree_model_iter_parent*(tree_model: PTreeModel, iter: PTreeIter, + child: PTreeIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_model_iter_parent".} +proc tree_model_ref_node*(tree_model: PTreeModel, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_tree_model_ref_node".} +proc tree_model_unref_node*(tree_model: PTreeModel, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_tree_model_unref_node".} +proc tree_model_foreach*(model: PTreeModel, func_: TTreeModelForeachFunc, + user_data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_tree_model_foreach".} +proc tree_model_row_changed*(tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_model_row_changed".} +proc tree_model_row_inserted*(tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_model_row_inserted".} +proc tree_model_row_has_child_toggled*(tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_model_row_has_child_toggled".} +proc tree_model_row_deleted*(tree_model: PTreeModel, path: PTreePath){.cdecl, + dynlib: lib, importc: "gtk_tree_model_row_deleted".} +proc tree_model_rows_reordered*(tree_model: PTreeModel, path: PTreePath, + iter: PTreeIter, new_order: Pgint){.cdecl, + dynlib: lib, importc: "gtk_tree_model_rows_reordered".} +const + TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID* = - (1) + +proc TYPE_TREE_SORTABLE*(): GType +proc TREE_SORTABLE*(obj: pointer): PTreeSortable +proc TREE_SORTABLE_CLASS*(obj: pointer): PTreeSortableIface +proc IS_TREE_SORTABLE*(obj: pointer): bool +proc TREE_SORTABLE_GET_IFACE*(obj: pointer): PTreeSortableIface +proc tree_sortable_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_sortable_get_type".} +proc tree_sortable_sort_column_changed*(sortable: PTreeSortable){.cdecl, + dynlib: lib, importc: "gtk_tree_sortable_sort_column_changed".} +proc tree_sortable_get_sort_column_id*(sortable: PTreeSortable, + sort_column_id: Pgint, order: PSortType): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_sortable_get_sort_column_id".} +proc tree_sortable_set_sort_column_id*(sortable: PTreeSortable, + sort_column_id: gint, order: TSortType){. + cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_sort_column_id".} +proc tree_sortable_set_sort_func*(sortable: PTreeSortable, sort_column_id: gint, + sort_func: TTreeIterCompareFunc, + user_data: gpointer, destroy: TDestroyNotify){. + cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_sort_func".} +proc tree_sortable_set_default_sort_func*(sortable: PTreeSortable, + sort_func: TTreeIterCompareFunc, user_data: gpointer, + destroy: TDestroyNotify){.cdecl, dynlib: lib, importc: "gtk_tree_sortable_set_default_sort_func".} +proc tree_sortable_has_default_sort_func*(sortable: PTreeSortable): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_sortable_has_default_sort_func".} +proc TYPE_TREE_MODEL_SORT*(): GType +proc TREE_MODEL_SORT*(obj: pointer): PTreeModelSort +proc TREE_MODEL_SORT_CLASS*(klass: pointer): PTreeModelSortClass +proc IS_TREE_MODEL_SORT*(obj: pointer): bool +proc IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool +proc TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PTreeModelSortClass +proc tree_model_sort_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_model_sort_get_type".} +proc tree_model_sort_new_with_model*(child_model: PTreeModel): PTreeModel{. + cdecl, dynlib: lib, importc: "gtk_tree_model_sort_new_with_model".} +proc tree_model_sort_get_model*(tree_model: PTreeModelSort): PTreeModel{.cdecl, + dynlib: lib, importc: "gtk_tree_model_sort_get_model".} +proc tree_model_sort_convert_child_path_to_path*( + tree_model_sort: PTreeModelSort, child_path: PTreePath): PTreePath{.cdecl, + dynlib: lib, importc: "gtk_tree_model_sort_convert_child_path_to_path".} +proc tree_model_sort_convert_child_iter_to_iter*( + tree_model_sort: PTreeModelSort, sort_iter: PTreeIter, child_iter: PTreeIter){. + cdecl, dynlib: lib, + importc: "gtk_tree_model_sort_convert_child_iter_to_iter".} +proc tree_model_sort_convert_path_to_child_path*( + tree_model_sort: PTreeModelSort, sorted_path: PTreePath): PTreePath{.cdecl, + dynlib: lib, importc: "gtk_tree_model_sort_convert_path_to_child_path".} +proc tree_model_sort_convert_iter_to_child_iter*( + tree_model_sort: PTreeModelSort, child_iter: PTreeIter, + sorted_iter: PTreeIter){.cdecl, dynlib: lib, importc: "gtk_tree_model_sort_convert_iter_to_child_iter".} +proc tree_model_sort_reset_default_sort_func*(tree_model_sort: PTreeModelSort){. + cdecl, dynlib: lib, importc: "gtk_tree_model_sort_reset_default_sort_func".} +proc tree_model_sort_clear_cache*(tree_model_sort: PTreeModelSort){.cdecl, + dynlib: lib, importc: "gtk_tree_model_sort_clear_cache".} +const + bm_TGtkListStore_columns_dirty* = 0x0001'i16 + bp_TGtkListStore_columns_dirty* = 0'i16 + +proc TYPE_LIST_STORE*(): GType +proc LIST_STORE*(obj: pointer): PListStore +proc LIST_STORE_CLASS*(klass: pointer): PListStoreClass +proc IS_LIST_STORE*(obj: pointer): bool +proc IS_LIST_STORE_CLASS*(klass: pointer): bool +proc LIST_STORE_GET_CLASS*(obj: pointer): PListStoreClass +proc columns_dirty*(a: var TListStore): guint +proc set_columns_dirty*(a: var TListStore, `columns_dirty`: guint) +proc list_store_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_list_store_get_type".} +proc list_store_newv*(n_columns: gint, types: PGType): PListStore{.cdecl, + dynlib: lib, importc: "gtk_list_store_newv".} +proc list_store_set_column_types*(list_store: PListStore, n_columns: gint, + types: PGType){.cdecl, dynlib: lib, + importc: "gtk_list_store_set_column_types".} +proc list_store_set_value*(list_store: PListStore, iter: PTreeIter, + column: gint, value: PGValue){.cdecl, dynlib: lib, + importc: "gtk_list_store_set_value".} +proc list_store_remove*(list_store: PListStore, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_list_store_remove".} +proc list_store_insert*(list_store: PListStore, iter: PTreeIter, position: gint){. + cdecl, dynlib: lib, importc: "gtk_list_store_insert".} +proc list_store_insert_before*(list_store: PListStore, iter: PTreeIter, + sibling: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_list_store_insert_before".} +proc list_store_insert_after*(list_store: PListStore, iter: PTreeIter, + sibling: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_list_store_insert_after".} +proc list_store_prepend*(list_store: PListStore, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_list_store_prepend".} +proc list_store_append*(list_store: PListStore, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_list_store_append".} +proc list_store_clear*(list_store: PListStore){.cdecl, dynlib: lib, + importc: "gtk_list_store_clear".} +when false: + const + PRIORITY_RESIZE* = G_PRIORITY_HIGH_IDLE + 10 +proc check_version*(required_major: guint, required_minor: guint, + required_micro: guint): cstring{.cdecl, dynlib: lib, + importc: "gtk_check_version".} +proc disable_setlocale*(){.cdecl, dynlib: lib, importc: "gtk_disable_setlocale".} +proc set_locale*(): cstring{.cdecl, dynlib: lib, importc: "gtk_set_locale".} +proc get_default_language*(): PPangoLanguage{.cdecl, dynlib: lib, + importc: "gtk_get_default_language".} +proc events_pending*(): gint{.cdecl, dynlib: lib, importc: "gtk_events_pending".} +proc main_do_event*(event: PGdkEvent){.cdecl, dynlib: lib, + importc: "gtk_main_do_event".} +proc main*(){.cdecl, dynlib: lib, importc: "gtk_main".} +proc init*(argc, argv: pointer){.cdecl, dynlib: lib, importc: "gtk_init".} +proc main_level*(): guint{.cdecl, dynlib: lib, importc: "gtk_main_level".} +proc main_quit*(){.cdecl, dynlib: lib, importc: "gtk_main_quit".} +proc main_iteration*(): gboolean{.cdecl, dynlib: lib, + importc: "gtk_main_iteration".} +proc main_iteration_do*(blocking: gboolean): gboolean{.cdecl, dynlib: lib, + importc: "gtk_main_iteration_do".} +proc true*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_true".} +proc false*(): gboolean{.cdecl, dynlib: lib, importc: "gtk_false".} +proc grab_add*(widget: PWidget){.cdecl, dynlib: lib, importc: "gtk_grab_add".} +proc grab_get_current*(): PWidget{.cdecl, dynlib: lib, + importc: "gtk_grab_get_current".} +proc grab_remove*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_grab_remove".} +proc init_add*(`function`: TFunction, data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_init_add".} +proc quit_add_destroy*(main_level: guint, anObject: PObject){.cdecl, + dynlib: lib, importc: "gtk_quit_add_destroy".} +proc quit_add*(main_level: guint, `function`: TFunction, data: gpointer): guint{. + cdecl, dynlib: lib, importc: "gtk_quit_add".} +proc quit_add_full*(main_level: guint, `function`: TFunction, + marshal: TCallbackMarshal, data: gpointer, + destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, + importc: "gtk_quit_add_full".} +proc quit_remove*(quit_handler_id: guint){.cdecl, dynlib: lib, + importc: "gtk_quit_remove".} +proc quit_remove_by_data*(data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_quit_remove_by_data".} +proc timeout_add*(interval: guint32, `function`: TFunction, data: gpointer): guint{. + cdecl, dynlib: lib, importc: "gtk_timeout_add".} +proc timeout_add_full*(interval: guint32, `function`: TFunction, + marshal: TCallbackMarshal, data: gpointer, + destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, + importc: "gtk_timeout_add_full".} +proc timeout_remove*(timeout_handler_id: guint){.cdecl, dynlib: lib, + importc: "gtk_timeout_remove".} +proc idle_add*(`function`: TFunction, data: gpointer): guint{.cdecl, + dynlib: lib, importc: "gtk_idle_add".} +proc idle_add_priority*(priority: gint, `function`: TFunction, data: gpointer): guint{. + cdecl, dynlib: lib, importc: "gtk_idle_add_priority".} +proc idle_add_full*(priority: gint, `function`: TFunction, + marshal: TCallbackMarshal, data: gpointer, + destroy: TDestroyNotify): guint{.cdecl, dynlib: lib, + importc: "gtk_idle_add_full".} +proc idle_remove*(idle_handler_id: guint){.cdecl, dynlib: lib, + importc: "gtk_idle_remove".} +proc idle_remove_by_data*(data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_idle_remove_by_data".} +proc input_add_full*(source: gint, condition: TGdkInputCondition, + `function`: TGdkInputFunction, marshal: TCallbackMarshal, + data: gpointer, destroy: TDestroyNotify): guint{.cdecl, + dynlib: lib, importc: "gtk_input_add_full".} +proc input_remove*(input_handler_id: guint){.cdecl, dynlib: lib, + importc: "gtk_input_remove".} +proc key_snooper_install*(snooper: TKeySnoopFunc, func_data: gpointer): guint{. + cdecl, dynlib: lib, importc: "gtk_key_snooper_install".} +proc key_snooper_remove*(snooper_handler_id: guint){.cdecl, dynlib: lib, + importc: "gtk_key_snooper_remove".} +proc get_current_event*(): PGdkEvent{.cdecl, dynlib: lib, + importc: "gtk_get_current_event".} +proc get_current_event_time*(): guint32{.cdecl, dynlib: lib, + importc: "gtk_get_current_event_time".} +proc get_current_event_state*(state: PGdkModifierType): gboolean{.cdecl, + dynlib: lib, importc: "gtk_get_current_event_state".} +proc get_event_widget*(event: PGdkEvent): PWidget{.cdecl, dynlib: lib, + importc: "gtk_get_event_widget".} +proc propagate_event*(widget: PWidget, event: PGdkEvent){.cdecl, dynlib: lib, + importc: "gtk_propagate_event".} +proc boolean_handled_accumulator*(ihint: PGSignalInvocationHint, + return_accu: PGValue, handler_return: PGValue, + dummy: gpointer): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_boolean_handled_accumulator".} +proc find_module*(name: cstring, thetype: cstring): cstring{.cdecl, dynlib: lib, + importc: "_gtk_find_module".} +proc get_module_path*(thetype: cstring): PPgchar{.cdecl, dynlib: lib, + importc: "_gtk_get_module_path".} +proc TYPE_MENU_BAR*(): GType +proc MENU_BAR*(obj: pointer): PMenuBar +proc MENU_BAR_CLASS*(klass: pointer): PMenuBarClass +proc IS_MENU_BAR*(obj: pointer): bool +proc IS_MENU_BAR_CLASS*(klass: pointer): bool +proc MENU_BAR_GET_CLASS*(obj: pointer): PMenuBarClass +proc menu_bar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_menu_bar_get_type".} +proc menu_bar_new*(): PMenuBar{.cdecl, dynlib: lib, importc: "gtk_menu_bar_new".} +proc menu_bar_cycle_focus*(menubar: PMenuBar, dir: TDirectionType){.cdecl, + dynlib: lib, importc: "_gtk_menu_bar_cycle_focus".} +proc TYPE_MESSAGE_DIALOG*(): GType +proc MESSAGE_DIALOG*(obj: pointer): PMessageDialog +proc MESSAGE_DIALOG_CLASS*(klass: pointer): PMessageDialogClass +proc IS_MESSAGE_DIALOG*(obj: pointer): bool +proc IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool +proc MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PMessageDialogClass +proc message_dialog_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_message_dialog_get_type".} +const + bm_TGtkNotebook_show_tabs* = 0x0001'i16 + bp_TGtkNotebook_show_tabs* = 0'i16 + bm_TGtkNotebook_homogeneous* = 0x0002'i16 + bp_TGtkNotebook_homogeneous* = 1'i16 + bm_TGtkNotebook_show_border* = 0x0004'i16 + bp_TGtkNotebook_show_border* = 2'i16 + bm_TGtkNotebook_tab_pos* = 0x0018'i16 + bp_TGtkNotebook_tab_pos* = 3'i16 + bm_TGtkNotebook_scrollable* = 0x0020'i16 + bp_TGtkNotebook_scrollable* = 5'i16 + bm_TGtkNotebook_in_child* = 0x00C0'i16 + bp_TGtkNotebook_in_child* = 6'i16 + bm_TGtkNotebook_click_child* = 0x0300'i16 + bp_TGtkNotebook_click_child* = 8'i16 + bm_TGtkNotebook_button* = 0x0C00'i16 + bp_TGtkNotebook_button* = 10'i16 + bm_TGtkNotebook_need_timer* = 0x1000'i16 + bp_TGtkNotebook_need_timer* = 12'i16 + bm_TGtkNotebook_child_has_focus* = 0x2000'i16 + bp_TGtkNotebook_child_has_focus* = 13'i16 + bm_TGtkNotebook_have_visible_child* = 0x4000'i16 + bp_TGtkNotebook_have_visible_child* = 14'i16 + bm_TGtkNotebook_focus_out* = 0x8000'i16 + bp_TGtkNotebook_focus_out* = 15'i16 + +proc TYPE_NOTEBOOK*(): GType +proc NOTEBOOK*(obj: pointer): PNotebook +proc NOTEBOOK_CLASS*(klass: pointer): PNotebookClass +proc IS_NOTEBOOK*(obj: pointer): bool +proc IS_NOTEBOOK_CLASS*(klass: pointer): bool +proc NOTEBOOK_GET_CLASS*(obj: pointer): PNotebookClass +proc show_tabs*(a: var TNotebook): guint +proc set_show_tabs*(a: var TNotebook, `show_tabs`: guint) +proc homogeneous*(a: var TNotebook): guint +proc set_homogeneous*(a: var TNotebook, `homogeneous`: guint) +proc show_border*(a: var TNotebook): guint +proc set_show_border*(a: var TNotebook, `show_border`: guint) +proc tab_pos*(a: var TNotebook): guint +proc set_tab_pos*(a: var TNotebook, `tab_pos`: guint) +proc scrollable*(a: var TNotebook): guint +proc set_scrollable*(a: var TNotebook, `scrollable`: guint) +proc in_child*(a: var TNotebook): guint +proc set_in_child*(a: var TNotebook, `in_child`: guint) +proc click_child*(a: var TNotebook): guint +proc set_click_child*(a: var TNotebook, `click_child`: guint) +proc button*(a: var TNotebook): guint +proc set_button*(a: var TNotebook, `button`: guint) +proc need_timer*(a: var TNotebook): guint +proc set_need_timer*(a: var TNotebook, `need_timer`: guint) +proc child_has_focus*(a: var TNotebook): guint +proc set_child_has_focus*(a: var TNotebook, `child_has_focus`: guint) +proc have_visible_child*(a: var TNotebook): guint +proc set_have_visible_child*(a: var TNotebook, `have_visible_child`: guint) +proc focus_out*(a: var TNotebook): guint +proc set_focus_out*(a: var TNotebook, `focus_out`: guint) +proc notebook_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_notebook_get_type".} +proc notebook_new*(): PNotebook{.cdecl, dynlib: lib, importc: "gtk_notebook_new".} +proc notebook_append_page*(notebook: PNotebook, child: PWidget, + tab_label: PWidget): gint{.cdecl, dynlib: lib, + importc: "gtk_notebook_append_page".} +proc notebook_append_page_menu*(notebook: PNotebook, child: PWidget, + tab_label: PWidget, menu_label: PWidget): gint{. + cdecl, dynlib: lib, importc: "gtk_notebook_append_page_menu".} +proc notebook_prepend_page*(notebook: PNotebook, child: PWidget, + tab_label: PWidget): gint{.cdecl, dynlib: lib, + importc: "gtk_notebook_prepend_page".} +proc notebook_prepend_page_menu*(notebook: PNotebook, child: PWidget, + tab_label: PWidget, menu_label: PWidget): gint{. + cdecl, dynlib: lib, importc: "gtk_notebook_prepend_page_menu".} +proc notebook_insert_page*(notebook: PNotebook, child: PWidget, + tab_label: PWidget, position: gint): gint{.cdecl, + dynlib: lib, importc: "gtk_notebook_insert_page".} +proc notebook_insert_page_menu*(notebook: PNotebook, child: PWidget, + tab_label: PWidget, menu_label: PWidget, + position: gint): gint{.cdecl, dynlib: lib, + importc: "gtk_notebook_insert_page_menu".} +proc notebook_remove_page*(notebook: PNotebook, page_num: gint){.cdecl, + dynlib: lib, importc: "gtk_notebook_remove_page".} +proc notebook_get_current_page*(notebook: PNotebook): gint{.cdecl, dynlib: lib, + importc: "gtk_notebook_get_current_page".} +proc notebook_get_n_pages*(notebook: PNotebook): gint{.cdecl, dynlib: lib, + importc: "gtk_notebook_get_n_pages".} +proc notebook_get_nth_page*(notebook: PNotebook, page_num: gint): PWidget{. + cdecl, dynlib: lib, importc: "gtk_notebook_get_nth_page".} +proc notebook_page_num*(notebook: PNotebook, child: PWidget): gint{.cdecl, + dynlib: lib, importc: "gtk_notebook_page_num".} +proc notebook_set_current_page*(notebook: PNotebook, page_num: gint){.cdecl, + dynlib: lib, importc: "gtk_notebook_set_current_page".} +proc notebook_next_page*(notebook: PNotebook){.cdecl, dynlib: lib, + importc: "gtk_notebook_next_page".} +proc notebook_prev_page*(notebook: PNotebook){.cdecl, dynlib: lib, + importc: "gtk_notebook_prev_page".} +proc notebook_set_show_border*(notebook: PNotebook, show_border: gboolean){. + cdecl, dynlib: lib, importc: "gtk_notebook_set_show_border".} +proc notebook_get_show_border*(notebook: PNotebook): gboolean{.cdecl, + dynlib: lib, importc: "gtk_notebook_get_show_border".} +proc notebook_set_show_tabs*(notebook: PNotebook, show_tabs: gboolean){.cdecl, + dynlib: lib, importc: "gtk_notebook_set_show_tabs".} +proc notebook_get_show_tabs*(notebook: PNotebook): gboolean{.cdecl, dynlib: lib, + importc: "gtk_notebook_get_show_tabs".} +proc notebook_set_tab_pos*(notebook: PNotebook, pos: TPositionType){.cdecl, + dynlib: lib, importc: "gtk_notebook_set_tab_pos".} +proc notebook_get_tab_pos*(notebook: PNotebook): TPositionType{.cdecl, + dynlib: lib, importc: "gtk_notebook_get_tab_pos".} +proc notebook_set_scrollable*(notebook: PNotebook, scrollable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_notebook_set_scrollable".} +proc notebook_get_scrollable*(notebook: PNotebook): gboolean{.cdecl, + dynlib: lib, importc: "gtk_notebook_get_scrollable".} +proc notebook_popup_enable*(notebook: PNotebook){.cdecl, dynlib: lib, + importc: "gtk_notebook_popup_enable".} +proc notebook_popup_disable*(notebook: PNotebook){.cdecl, dynlib: lib, + importc: "gtk_notebook_popup_disable".} +proc notebook_get_tab_label*(notebook: PNotebook, child: PWidget): PWidget{. + cdecl, dynlib: lib, importc: "gtk_notebook_get_tab_label".} +proc notebook_set_tab_label*(notebook: PNotebook, child: PWidget, + tab_label: PWidget){.cdecl, dynlib: lib, + importc: "gtk_notebook_set_tab_label".} +proc notebook_set_tab_label_text*(notebook: PNotebook, child: PWidget, + tab_text: cstring){.cdecl, dynlib: lib, + importc: "gtk_notebook_set_tab_label_text".} +proc notebook_get_tab_label_text*(notebook: PNotebook, child: PWidget): cstring{. + cdecl, dynlib: lib, importc: "gtk_notebook_get_tab_label_text".} +proc notebook_get_menu_label*(notebook: PNotebook, child: PWidget): PWidget{. + cdecl, dynlib: lib, importc: "gtk_notebook_get_menu_label".} +proc notebook_set_menu_label*(notebook: PNotebook, child: PWidget, + menu_label: PWidget){.cdecl, dynlib: lib, + importc: "gtk_notebook_set_menu_label".} +proc notebook_set_menu_label_text*(notebook: PNotebook, child: PWidget, + menu_text: cstring){.cdecl, dynlib: lib, + importc: "gtk_notebook_set_menu_label_text".} +proc notebook_get_menu_label_text*(notebook: PNotebook, child: PWidget): cstring{. + cdecl, dynlib: lib, importc: "gtk_notebook_get_menu_label_text".} +proc notebook_query_tab_label_packing*(notebook: PNotebook, child: PWidget, + expand: Pgboolean, fill: Pgboolean, + pack_type: PPackType){.cdecl, + dynlib: lib, importc: "gtk_notebook_query_tab_label_packing".} +proc notebook_set_tab_label_packing*(notebook: PNotebook, child: PWidget, + expand: gboolean, fill: gboolean, + pack_type: TPackType){.cdecl, dynlib: lib, + importc: "gtk_notebook_set_tab_label_packing".} +proc notebook_reorder_child*(notebook: PNotebook, child: PWidget, position: gint){. + cdecl, dynlib: lib, importc: "gtk_notebook_reorder_child".} +const + bm_TGtkOldEditable_has_selection* = 0x0001'i16 + bp_TGtkOldEditable_has_selection* = 0'i16 + bm_TGtkOldEditable_editable* = 0x0002'i16 + bp_TGtkOldEditable_editable* = 1'i16 + bm_TGtkOldEditable_visible* = 0x0004'i16 + bp_TGtkOldEditable_visible* = 2'i16 + +proc TYPE_OLD_EDITABLE*(): GType +proc OLD_EDITABLE*(obj: pointer): POldEditable +proc OLD_EDITABLE_CLASS*(klass: pointer): POldEditableClass +proc IS_OLD_EDITABLE*(obj: pointer): bool +proc IS_OLD_EDITABLE_CLASS*(klass: pointer): bool +proc OLD_EDITABLE_GET_CLASS*(obj: pointer): POldEditableClass +proc has_selection*(a: var TOldEditable): guint +proc set_has_selection*(a: var TOldEditable, `has_selection`: guint) +proc editable*(a: var TOldEditable): guint +proc set_editable*(a: var TOldEditable, `editable`: guint) +proc visible*(a: var TOldEditable): guint +proc set_visible*(a: var TOldEditable, `visible`: guint) +proc old_editable_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_old_editable_get_type".} +proc old_editable_claim_selection*(old_editable: POldEditable, claim: gboolean, + time: guint32){.cdecl, dynlib: lib, + importc: "gtk_old_editable_claim_selection".} +proc old_editable_changed*(old_editable: POldEditable){.cdecl, dynlib: lib, + importc: "gtk_old_editable_changed".} +proc TYPE_OPTION_MENU*(): GType +proc OPTION_MENU*(obj: pointer): POptionMenu +proc OPTION_MENU_CLASS*(klass: pointer): POptionMenuClass +proc IS_OPTION_MENU*(obj: pointer): bool +proc IS_OPTION_MENU_CLASS*(klass: pointer): bool +proc OPTION_MENU_GET_CLASS*(obj: pointer): POptionMenuClass +proc option_menu_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_option_menu_get_type".} +proc option_menu_new*(): POptionMenu{.cdecl, dynlib: lib, + importc: "gtk_option_menu_new".} +proc option_menu_get_menu*(option_menu: POptionMenu): PWidget{.cdecl, + dynlib: lib, importc: "gtk_option_menu_get_menu".} +proc option_menu_set_menu*(option_menu: POptionMenu, menu: PWidget){.cdecl, + dynlib: lib, importc: "gtk_option_menu_set_menu".} +proc option_menu_remove_menu*(option_menu: POptionMenu){.cdecl, dynlib: lib, + importc: "gtk_option_menu_remove_menu".} +proc option_menu_get_history*(option_menu: POptionMenu): gint{.cdecl, + dynlib: lib, importc: "gtk_option_menu_get_history".} +proc option_menu_set_history*(option_menu: POptionMenu, index: guint){.cdecl, + dynlib: lib, importc: "gtk_option_menu_set_history".} +const + bm_TGtkPixmap_build_insensitive* = 0x0001'i16 + bp_TGtkPixmap_build_insensitive* = 0'i16 + +proc TYPE_PIXMAP*(): GType +proc PIXMAP*(obj: pointer): PPixmap +proc PIXMAP_CLASS*(klass: pointer): PPixmapClass +proc IS_PIXMAP*(obj: pointer): bool +proc IS_PIXMAP_CLASS*(klass: pointer): bool +proc PIXMAP_GET_CLASS*(obj: pointer): PPixmapClass +proc build_insensitive*(a: var TPixmap): guint +proc set_build_insensitive*(a: var TPixmap, `build_insensitive`: guint) +proc pixmap_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_pixmap_get_type".} +proc pixmap_new*(pixmap: PGdkPixmap, mask: PGdkBitmap): PPixmap{.cdecl, + dynlib: lib, importc: "gtk_pixmap_new".} +proc pixmap_set*(pixmap: PPixmap, val: PGdkPixmap, mask: PGdkBitmap){.cdecl, + dynlib: lib, importc: "gtk_pixmap_set".} +proc pixmap_get*(pixmap: PPixmap, val: var PGdkPixmap, mask: var PGdkBitmap){. + cdecl, dynlib: lib, importc: "gtk_pixmap_get".} +proc pixmap_set_build_insensitive*(pixmap: PPixmap, build: gboolean){.cdecl, + dynlib: lib, importc: "gtk_pixmap_set_build_insensitive".} +const + bm_TGtkPlug_same_app* = 0x0001'i16 + bp_TGtkPlug_same_app* = 0'i16 + +proc TYPE_PLUG*(): GType +proc PLUG*(obj: pointer): PPlug +proc PLUG_CLASS*(klass: pointer): PPlugClass +proc IS_PLUG*(obj: pointer): bool +proc IS_PLUG_CLASS*(klass: pointer): bool +proc PLUG_GET_CLASS*(obj: pointer): PPlugClass +proc same_app*(a: var TPlug): guint +proc set_same_app*(a: var TPlug, `same_app`: guint) +proc plug_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_plug_get_type".} +proc plug_construct_for_display*(plug: PPlug, display: PGdkDisplay, + socket_id: TGdkNativeWindow){.cdecl, + dynlib: lib, importc: "gtk_plug_construct_for_display".} +proc plug_new_for_display*(display: PGdkDisplay, socket_id: TGdkNativeWindow): PPlug{. + cdecl, dynlib: lib, importc: "gtk_plug_new_for_display".} +proc plug_get_id*(plug: PPlug): TGdkNativeWindow{.cdecl, dynlib: lib, + importc: "gtk_plug_get_id".} +proc plug_add_to_socket*(plug: PPlug, socket: PSocket){.cdecl, dynlib: lib, + importc: "_gtk_plug_add_to_socket".} +proc plug_remove_from_socket*(plug: PPlug, socket: PSocket){.cdecl, dynlib: lib, + importc: "_gtk_plug_remove_from_socket".} +const + bm_TGtkPreview_type* = 0x0001'i16 + bp_TGtkPreview_type* = 0'i16 + bm_TGtkPreview_expand* = 0x0002'i16 + bp_TGtkPreview_expand* = 1'i16 + +proc TYPE_PREVIEW*(): GType +proc PREVIEW*(obj: pointer): PPreview +proc PREVIEW_CLASS*(klass: pointer): PPreviewClass +proc IS_PREVIEW*(obj: pointer): bool +proc IS_PREVIEW_CLASS*(klass: pointer): bool +proc PREVIEW_GET_CLASS*(obj: pointer): PPreviewClass +proc get_type*(a: var TPreview): guint +proc set_type*(a: var TPreview, `type`: guint) +proc get_expand*(a: var TPreview): guint +proc set_expand*(a: var TPreview, `expand`: guint) +proc preview_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_preview_get_type".} +proc preview_uninit*(){.cdecl, dynlib: lib, importc: "gtk_preview_uninit".} +proc preview_new*(thetype: TPreviewClass): PPreview{.cdecl, dynlib: lib, + importc: "gtk_preview_new".} +proc preview_size*(preview: PPreview, width: gint, height: gint){.cdecl, + dynlib: lib, importc: "gtk_preview_size".} +proc preview_put*(preview: PPreview, window: PGdkWindow, gc: PGdkGC, srcx: gint, + srcy: gint, destx: gint, desty: gint, width: gint, + height: gint){.cdecl, dynlib: lib, importc: "gtk_preview_put".} +proc preview_draw_row*(preview: PPreview, data: Pguchar, x: gint, y: gint, + w: gint){.cdecl, dynlib: lib, + importc: "gtk_preview_draw_row".} +proc preview_set_expand*(preview: PPreview, expand: gboolean){.cdecl, + dynlib: lib, importc: "gtk_preview_set_expand".} +proc preview_set_gamma*(gamma: float64){.cdecl, dynlib: lib, + importc: "gtk_preview_set_gamma".} +proc preview_set_color_cube*(nred_shades: guint, ngreen_shades: guint, + nblue_shades: guint, ngray_shades: guint){.cdecl, + dynlib: lib, importc: "gtk_preview_set_color_cube".} +proc preview_set_install_cmap*(install_cmap: gint){.cdecl, dynlib: lib, + importc: "gtk_preview_set_install_cmap".} +proc preview_set_reserved*(nreserved: gint){.cdecl, dynlib: lib, + importc: "gtk_preview_set_reserved".} +proc preview_set_dither*(preview: PPreview, dither: TGdkRgbDither){.cdecl, + dynlib: lib, importc: "gtk_preview_set_dither".} +proc preview_get_info*(): PPreviewInfo{.cdecl, dynlib: lib, + importc: "gtk_preview_get_info".} +proc preview_reset*(){.cdecl, dynlib: lib, importc: "gtk_preview_reset".} +const + bm_TGtkProgress_show_text* = 0x0001'i16 + bp_TGtkProgress_show_text* = 0'i16 + bm_TGtkProgress_activity_mode* = 0x0002'i16 + bp_TGtkProgress_activity_mode* = 1'i16 + bm_TGtkProgress_use_text_format* = 0x0004'i16 + bp_TGtkProgress_use_text_format* = 2'i16 + +proc show_text*(a: var TProgress): guint +proc set_show_text*(a: var TProgress, `show_text`: guint) +proc activity_mode*(a: var TProgress): guint +proc set_activity_mode*(a: var TProgress, `activity_mode`: guint) +proc use_text_format*(a: var TProgress): guint +proc set_use_text_format*(a: var TProgress, `use_text_format`: guint) +const + bm_TGtkProgressBar_activity_dir* = 0x0001'i16 + bp_TGtkProgressBar_activity_dir* = 0'i16 + +proc TYPE_PROGRESS_BAR*(): GType +proc PROGRESS_BAR*(obj: pointer): PProgressBar +proc PROGRESS_BAR_CLASS*(klass: pointer): PProgressBarClass +proc IS_PROGRESS_BAR*(obj: pointer): bool +proc IS_PROGRESS_BAR_CLASS*(klass: pointer): bool +proc PROGRESS_BAR_GET_CLASS*(obj: pointer): PProgressBarClass +proc activity_dir*(a: var TProgressBar): guint +proc set_activity_dir*(a: var TProgressBar, `activity_dir`: guint) +proc progress_bar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_progress_bar_get_type".} +proc progress_bar_new*(): PProgressBar{.cdecl, dynlib: lib, + importc: "gtk_progress_bar_new".} +proc progress_bar_pulse*(pbar: PProgressBar){.cdecl, dynlib: lib, + importc: "gtk_progress_bar_pulse".} +proc progress_bar_set_text*(pbar: PProgressBar, text: cstring){.cdecl, + dynlib: lib, importc: "gtk_progress_bar_set_text".} +proc progress_bar_set_fraction*(pbar: PProgressBar, fraction: gdouble){.cdecl, + dynlib: lib, importc: "gtk_progress_bar_set_fraction".} +proc progress_bar_set_pulse_step*(pbar: PProgressBar, fraction: gdouble){.cdecl, + dynlib: lib, importc: "gtk_progress_bar_set_pulse_step".} +proc progress_bar_set_orientation*(pbar: PProgressBar, + orientation: TProgressBarOrientation){.cdecl, + dynlib: lib, importc: "gtk_progress_bar_set_orientation".} +proc progress_bar_get_text*(pbar: PProgressBar): cstring{.cdecl, dynlib: lib, + importc: "gtk_progress_bar_get_text".} +proc progress_bar_get_fraction*(pbar: PProgressBar): gdouble{.cdecl, + dynlib: lib, importc: "gtk_progress_bar_get_fraction".} +proc progress_bar_get_pulse_step*(pbar: PProgressBar): gdouble{.cdecl, + dynlib: lib, importc: "gtk_progress_bar_get_pulse_step".} +proc progress_bar_get_orientation*(pbar: PProgressBar): TProgressBarOrientation{. + cdecl, dynlib: lib, importc: "gtk_progress_bar_get_orientation".} +proc TYPE_RADIO_BUTTON*(): GType +proc RADIO_BUTTON*(obj: pointer): PRadioButton +proc RADIO_BUTTON_CLASS*(klass: pointer): PRadioButtonClass +proc IS_RADIO_BUTTON*(obj: pointer): bool +proc IS_RADIO_BUTTON_CLASS*(klass: pointer): bool +proc RADIO_BUTTON_GET_CLASS*(obj: pointer): PRadioButtonClass +proc radio_button_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_radio_button_get_type".} +proc radio_button_new*(group: PGSList): PRadioButton{.cdecl, dynlib: lib, + importc: "gtk_radio_button_new".} +proc radio_button_new_from_widget*(group: PRadioButton): PRadioButton{.cdecl, + dynlib: lib, importc: "gtk_radio_button_new_from_widget".} +proc radio_button_new_with_label*(group: PGSList, `label`: cstring): PRadioButton{. + cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_label".} +proc radio_button_new_with_label_from_widget*(group: PRadioButton, + `label`: cstring): PRadioButton{.cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_label_from_widget".} +proc radio_button_new_with_mnemonic*(group: PGSList, `label`: cstring): PRadioButton{. + cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_mnemonic".} +proc radio_button_new_with_mnemonic_from_widget*(group: PRadioButton, + `label`: cstring): PRadioButton{.cdecl, dynlib: lib, importc: "gtk_radio_button_new_with_mnemonic_from_widget".} +proc radio_button_get_group*(radio_button: PRadioButton): PGSList{.cdecl, + dynlib: lib, importc: "gtk_radio_button_get_group".} +proc radio_button_set_group*(radio_button: PRadioButton, group: PGSList){.cdecl, + dynlib: lib, importc: "gtk_radio_button_set_group".} +proc TYPE_RADIO_MENU_ITEM*(): GType +proc RADIO_MENU_ITEM*(obj: pointer): PRadioMenuItem +proc RADIO_MENU_ITEM_CLASS*(klass: pointer): PRadioMenuItemClass +proc IS_RADIO_MENU_ITEM*(obj: pointer): bool +proc IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool +proc RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PRadioMenuItemClass +proc radio_menu_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_radio_menu_item_get_type".} +proc radio_menu_item_new*(group: PGSList): PRadioMenuItem{.cdecl, dynlib: lib, + importc: "gtk_radio_menu_item_new".} +proc radio_menu_item_new_with_label*(group: PGSList, `label`: cstring): PRadioMenuItem{. + cdecl, dynlib: lib, importc: "gtk_radio_menu_item_new_with_label".} +proc radio_menu_item_new_with_mnemonic*(group: PGSList, `label`: cstring): PRadioMenuItem{. + cdecl, dynlib: lib, importc: "gtk_radio_menu_item_new_with_mnemonic".} +proc radio_menu_item_get_group*(radio_menu_item: PRadioMenuItem): PGSList{. + cdecl, dynlib: lib, importc: "gtk_radio_menu_item_get_group".} +proc radio_menu_item_set_group*(radio_menu_item: PRadioMenuItem, group: PGSList){. + cdecl, dynlib: lib, importc: "gtk_radio_menu_item_set_group".} +const + bm_TGtkScrolledWindow_hscrollbar_policy* = 0x0003'i16 + bp_TGtkScrolledWindow_hscrollbar_policy* = 0'i16 + bm_TGtkScrolledWindow_vscrollbar_policy* = 0x000C'i16 + bp_TGtkScrolledWindow_vscrollbar_policy* = 2'i16 + bm_TGtkScrolledWindow_hscrollbar_visible* = 0x0010'i16 + bp_TGtkScrolledWindow_hscrollbar_visible* = 4'i16 + bm_TGtkScrolledWindow_vscrollbar_visible* = 0x0020'i16 + bp_TGtkScrolledWindow_vscrollbar_visible* = 5'i16 + bm_TGtkScrolledWindow_window_placement* = 0x00C0'i16 + bp_TGtkScrolledWindow_window_placement* = 6'i16 + bm_TGtkScrolledWindow_focus_out* = 0x0100'i16 + bp_TGtkScrolledWindow_focus_out* = 8'i16 + +proc TYPE_SCROLLED_WINDOW*(): GType +proc SCROLLED_WINDOW*(obj: pointer): PScrolledWindow +proc SCROLLED_WINDOW_CLASS*(klass: pointer): PScrolledWindowClass +proc IS_SCROLLED_WINDOW*(obj: pointer): bool +proc IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool +proc SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PScrolledWindowClass +proc hscrollbar_policy*(a: var TScrolledWindow): guint +proc set_hscrollbar_policy*(a: var TScrolledWindow, `hscrollbar_policy`: guint) +proc vscrollbar_policy*(a: var TScrolledWindow): guint +proc set_vscrollbar_policy*(a: var TScrolledWindow, `vscrollbar_policy`: guint) +proc hscrollbar_visible*(a: var TScrolledWindow): guint +proc set_hscrollbar_visible*(a: var TScrolledWindow, `hscrollbar_visible`: guint) +proc vscrollbar_visible*(a: var TScrolledWindow): guint +proc set_vscrollbar_visible*(a: var TScrolledWindow, `vscrollbar_visible`: guint) +proc window_placement*(a: var TScrolledWindow): guint +proc set_window_placement*(a: var TScrolledWindow, `window_placement`: guint) +proc focus_out*(a: var TScrolledWindow): guint +proc set_focus_out*(a: var TScrolledWindow, `focus_out`: guint) +proc scrolled_window_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_scrolled_window_get_type".} +proc scrolled_window_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PScrolledWindow{. + cdecl, dynlib: lib, importc: "gtk_scrolled_window_new".} +proc scrolled_window_set_hadjustment*(scrolled_window: PScrolledWindow, + hadjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_scrolled_window_set_hadjustment".} +proc scrolled_window_set_vadjustment*(scrolled_window: PScrolledWindow, + hadjustment: PAdjustment){.cdecl, + dynlib: lib, importc: "gtk_scrolled_window_set_vadjustment".} +proc scrolled_window_get_hadjustment*(scrolled_window: PScrolledWindow): PAdjustment{. + cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_hadjustment".} +proc scrolled_window_get_vadjustment*(scrolled_window: PScrolledWindow): PAdjustment{. + cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_vadjustment".} +proc scrolled_window_set_policy*(scrolled_window: PScrolledWindow, + hscrollbar_policy: TPolicyType, + vscrollbar_policy: TPolicyType){.cdecl, + dynlib: lib, importc: "gtk_scrolled_window_set_policy".} +proc scrolled_window_get_policy*(scrolled_window: PScrolledWindow, + hscrollbar_policy: PPolicyType, + vscrollbar_policy: PPolicyType){.cdecl, + dynlib: lib, importc: "gtk_scrolled_window_get_policy".} +proc scrolled_window_set_placement*(scrolled_window: PScrolledWindow, + window_placement: TCornerType){.cdecl, + dynlib: lib, importc: "gtk_scrolled_window_set_placement".} +proc scrolled_window_get_placement*(scrolled_window: PScrolledWindow): TCornerType{. + cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_placement".} +proc scrolled_window_set_shadow_type*(scrolled_window: PScrolledWindow, + thetype: TShadowType){.cdecl, dynlib: lib, + importc: "gtk_scrolled_window_set_shadow_type".} +proc scrolled_window_get_shadow_type*(scrolled_window: PScrolledWindow): TShadowType{. + cdecl, dynlib: lib, importc: "gtk_scrolled_window_get_shadow_type".} +proc scrolled_window_add_with_viewport*(scrolled_window: PScrolledWindow, + child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_scrolled_window_add_with_viewport".} +proc TYPE_SELECTION_DATA*(): GType +proc target_list_new*(targets: PTargetEntry, ntargets: guint): PTargetList{. + cdecl, dynlib: lib, importc: "gtk_target_list_new".} +proc target_list_ref*(list: PTargetList){.cdecl, dynlib: lib, + importc: "gtk_target_list_ref".} +proc target_list_unref*(list: PTargetList){.cdecl, dynlib: lib, + importc: "gtk_target_list_unref".} +proc target_list_add*(list: PTargetList, target: TGdkAtom, flags: guint, + info: guint){.cdecl, dynlib: lib, + importc: "gtk_target_list_add".} +proc target_list_add_table*(list: PTargetList, targets: PTargetEntry, + ntargets: guint){.cdecl, dynlib: lib, + importc: "gtk_target_list_add_table".} +proc target_list_remove*(list: PTargetList, target: TGdkAtom){.cdecl, + dynlib: lib, importc: "gtk_target_list_remove".} +proc target_list_find*(list: PTargetList, target: TGdkAtom, info: Pguint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_target_list_find".} +proc selection_owner_set*(widget: PWidget, selection: TGdkAtom, time: guint32): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_owner_set".} +proc selection_owner_set_for_display*(display: PGdkDisplay, widget: PWidget, + selection: TGdkAtom, time: guint32): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_owner_set_for_display".} +proc selection_add_target*(widget: PWidget, selection: TGdkAtom, + target: TGdkAtom, info: guint){.cdecl, dynlib: lib, + importc: "gtk_selection_add_target".} +proc selection_add_targets*(widget: PWidget, selection: TGdkAtom, + targets: PTargetEntry, ntargets: guint){.cdecl, + dynlib: lib, importc: "gtk_selection_add_targets".} +proc selection_clear_targets*(widget: PWidget, selection: TGdkAtom){.cdecl, + dynlib: lib, importc: "gtk_selection_clear_targets".} +proc selection_convert*(widget: PWidget, selection: TGdkAtom, target: TGdkAtom, + time: guint32): gboolean{.cdecl, dynlib: lib, + importc: "gtk_selection_convert".} +proc selection_data_set*(selection_data: PSelectionData, thetype: TGdkAtom, + format: gint, data: Pguchar, length: gint){.cdecl, + dynlib: lib, importc: "gtk_selection_data_set".} +proc selection_data_set_text*(selection_data: PSelectionData, str: cstring, + len: gint): gboolean{.cdecl, dynlib: lib, + importc: "gtk_selection_data_set_text".} +proc selection_data_get_text*(selection_data: PSelectionData): Pguchar{.cdecl, + dynlib: lib, importc: "gtk_selection_data_get_text".} +proc selection_data_targets_include_text*(selection_data: PSelectionData): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_data_targets_include_text".} +proc selection_remove_all*(widget: PWidget){.cdecl, dynlib: lib, + importc: "gtk_selection_remove_all".} +proc selection_clear*(widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_clear".} +proc selection_request*(widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_request".} +proc selection_incr_event*(window: PGdkWindow, event: PGdkEventProperty): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_incr_event".} +proc selection_notify*(widget: PWidget, event: PGdkEventSelection): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_notify".} +proc selection_property_notify*(widget: PWidget, event: PGdkEventProperty): gboolean{. + cdecl, dynlib: lib, importc: "gtk_selection_property_notify".} +proc selection_data_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_selection_data_get_type".} +proc selection_data_copy*(data: PSelectionData): PSelectionData{.cdecl, + dynlib: lib, importc: "gtk_selection_data_copy".} +proc selection_data_free*(data: PSelectionData){.cdecl, dynlib: lib, + importc: "gtk_selection_data_free".} +proc TYPE_SEPARATOR_MENU_ITEM*(): GType +proc SEPARATOR_MENU_ITEM*(obj: pointer): PSeparatorMenuItem +proc SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PSeparatorMenuItemClass +proc IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool +proc IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool +proc SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PSeparatorMenuItemClass +proc separator_menu_item_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_separator_menu_item_get_type".} +proc separator_menu_item_new*(): PSeparatorMenuItem{.cdecl, dynlib: lib, + importc: "gtk_separator_menu_item_new".} +const + bm_TGtkSizeGroup_have_width* = 0x0001'i16 + bp_TGtkSizeGroup_have_width* = 0'i16 + bm_TGtkSizeGroup_have_height* = 0x0002'i16 + bp_TGtkSizeGroup_have_height* = 1'i16 + +proc TYPE_SIZE_GROUP*(): GType +proc SIZE_GROUP*(obj: pointer): PSizeGroup +proc SIZE_GROUP_CLASS*(klass: pointer): PSizeGroupClass +proc IS_SIZE_GROUP*(obj: pointer): bool +proc IS_SIZE_GROUP_CLASS*(klass: pointer): bool +proc SIZE_GROUP_GET_CLASS*(obj: pointer): PSizeGroupClass +proc have_width*(a: var TSizeGroup): guint +proc set_have_width*(a: var TSizeGroup, `have_width`: guint) +proc have_height*(a: var TSizeGroup): guint +proc set_have_height*(a: var TSizeGroup, `have_height`: guint) +proc size_group_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_size_group_get_type".} +proc size_group_new*(mode: TSizeGroupMode): PSizeGroup{.cdecl, dynlib: lib, + importc: "gtk_size_group_new".} +proc size_group_set_mode*(size_group: PSizeGroup, mode: TSizeGroupMode){.cdecl, + dynlib: lib, importc: "gtk_size_group_set_mode".} +proc size_group_get_mode*(size_group: PSizeGroup): TSizeGroupMode{.cdecl, + dynlib: lib, importc: "gtk_size_group_get_mode".} +proc size_group_add_widget*(size_group: PSizeGroup, widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_size_group_add_widget".} +proc size_group_remove_widget*(size_group: PSizeGroup, widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_size_group_remove_widget".} +proc size_group_get_child_requisition*(widget: PWidget, + requisition: PRequisition){.cdecl, + dynlib: lib, importc: "_gtk_size_group_get_child_requisition".} +proc size_group_compute_requisition*(widget: PWidget, requisition: PRequisition){. + cdecl, dynlib: lib, importc: "_gtk_size_group_compute_requisition".} +proc size_group_queue_resize*(widget: PWidget){.cdecl, dynlib: lib, + importc: "_gtk_size_group_queue_resize".} +const + bm_TGtkSocket_same_app* = 0x0001'i16 + bp_TGtkSocket_same_app* = 0'i16 + bm_TGtkSocket_focus_in* = 0x0002'i16 + bp_TGtkSocket_focus_in* = 1'i16 + bm_TGtkSocket_have_size* = 0x0004'i16 + bp_TGtkSocket_have_size* = 2'i16 + bm_TGtkSocket_need_map* = 0x0008'i16 + bp_TGtkSocket_need_map* = 3'i16 + bm_TGtkSocket_is_mapped* = 0x0010'i16 + bp_TGtkSocket_is_mapped* = 4'i16 + +proc TYPE_SOCKET*(): GType +proc SOCKET*(obj: pointer): PSocket +proc SOCKET_CLASS*(klass: pointer): PSocketClass +proc IS_SOCKET*(obj: pointer): bool +proc IS_SOCKET_CLASS*(klass: pointer): bool +proc SOCKET_GET_CLASS*(obj: pointer): PSocketClass +proc same_app*(a: var TSocket): guint +proc set_same_app*(a: var TSocket, `same_app`: guint) +proc focus_in*(a: var TSocket): guint +proc set_focus_in*(a: var TSocket, `focus_in`: guint) +proc have_size*(a: var TSocket): guint +proc set_have_size*(a: var TSocket, `have_size`: guint) +proc need_map*(a: var TSocket): guint +proc set_need_map*(a: var TSocket, `need_map`: guint) +proc is_mapped*(a: var TSocket): guint +proc set_is_mapped*(a: var TSocket, `is_mapped`: guint) +proc socket_new*(): PSocket{.cdecl, dynlib: lib, importc: "gtk_socket_new".} +proc socket_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_socket_get_type".} +proc socket_add_id*(socket: PSocket, window_id: TGdkNativeWindow){.cdecl, + dynlib: lib, importc: "gtk_socket_add_id".} +proc socket_get_id*(socket: PSocket): TGdkNativeWindow{.cdecl, dynlib: lib, + importc: "gtk_socket_get_id".} +const + INPUT_ERROR* = - (1) + bm_TGtkSpinButton_in_child* = 0x00000003'i32 + bp_TGtkSpinButton_in_child* = 0'i32 + bm_TGtkSpinButton_click_child* = 0x0000000C'i32 + bp_TGtkSpinButton_click_child* = 2'i32 + bm_TGtkSpinButton_button* = 0x00000030'i32 + bp_TGtkSpinButton_button* = 4'i32 + bm_TGtkSpinButton_need_timer* = 0x00000040'i32 + bp_TGtkSpinButton_need_timer* = 6'i32 + bm_TGtkSpinButton_timer_calls* = 0x00000380'i32 + bp_TGtkSpinButton_timer_calls* = 7'i32 + bm_TGtkSpinButton_digits* = 0x000FFC00'i32 + bp_TGtkSpinButton_digits* = 10'i32 + bm_TGtkSpinButton_numeric* = 0x00100000'i32 + bp_TGtkSpinButton_numeric* = 20'i32 + bm_TGtkSpinButton_wrap* = 0x00200000'i32 + bp_TGtkSpinButton_wrap* = 21'i32 + bm_TGtkSpinButton_snap_to_ticks* = 0x00400000'i32 + bp_TGtkSpinButton_snap_to_ticks* = 22'i32 + +proc TYPE_SPIN_BUTTON*(): GType +proc SPIN_BUTTON*(obj: pointer): PSpinButton +proc SPIN_BUTTON_CLASS*(klass: pointer): PSpinButtonClass +proc IS_SPIN_BUTTON*(obj: pointer): bool +proc IS_SPIN_BUTTON_CLASS*(klass: pointer): bool +proc SPIN_BUTTON_GET_CLASS*(obj: pointer): PSpinButtonClass +proc in_child*(a: var TSpinButton): guint +proc set_in_child*(a: var TSpinButton, `in_child`: guint) +proc click_child*(a: var TSpinButton): guint +proc set_click_child*(a: var TSpinButton, `click_child`: guint) +proc button*(a: var TSpinButton): guint +proc set_button*(a: var TSpinButton, `button`: guint) +proc need_timer*(a: var TSpinButton): guint +proc set_need_timer*(a: var TSpinButton, `need_timer`: guint) +proc timer_calls*(a: var TSpinButton): guint +proc set_timer_calls*(a: var TSpinButton, `timer_calls`: guint) +proc digits*(a: var TSpinButton): guint +proc set_digits*(a: var TSpinButton, `digits`: guint) +proc numeric*(a: var TSpinButton): guint +proc set_numeric*(a: var TSpinButton, `numeric`: guint) +proc wrap*(a: var TSpinButton): guint +proc set_wrap*(a: var TSpinButton, `wrap`: guint) +proc snap_to_ticks*(a: var TSpinButton): guint +proc set_snap_to_ticks*(a: var TSpinButton, `snap_to_ticks`: guint) +proc spin_button_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_spin_button_get_type".} +proc spin_button_configure*(spin_button: PSpinButton, adjustment: PAdjustment, + climb_rate: gdouble, digits: guint){.cdecl, + dynlib: lib, importc: "gtk_spin_button_configure".} +proc spin_button_new*(adjustment: PAdjustment, climb_rate: gdouble, + digits: guint): PSpinButton{.cdecl, dynlib: lib, + importc: "gtk_spin_button_new".} +proc spin_button_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PSpinButton{. + cdecl, dynlib: lib, importc: "gtk_spin_button_new_with_range".} +proc spin_button_set_adjustment*(spin_button: PSpinButton, + adjustment: PAdjustment){.cdecl, dynlib: lib, + importc: "gtk_spin_button_set_adjustment".} +proc spin_button_get_adjustment*(spin_button: PSpinButton): PAdjustment{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_adjustment".} +proc spin_button_set_digits*(spin_button: PSpinButton, digits: guint){.cdecl, + dynlib: lib, importc: "gtk_spin_button_set_digits".} +proc spin_button_get_digits*(spin_button: PSpinButton): guint{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_digits".} +proc spin_button_set_increments*(spin_button: PSpinButton, step: gdouble, + page: gdouble){.cdecl, dynlib: lib, + importc: "gtk_spin_button_set_increments".} +proc spin_button_get_increments*(spin_button: PSpinButton, step: Pgdouble, + page: Pgdouble){.cdecl, dynlib: lib, + importc: "gtk_spin_button_get_increments".} +proc spin_button_set_range*(spin_button: PSpinButton, min: gdouble, max: gdouble){. + cdecl, dynlib: lib, importc: "gtk_spin_button_set_range".} +proc spin_button_get_range*(spin_button: PSpinButton, min: Pgdouble, + max: Pgdouble){.cdecl, dynlib: lib, + importc: "gtk_spin_button_get_range".} +proc spin_button_get_value*(spin_button: PSpinButton): gdouble{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_value".} +proc spin_button_get_value_as_int*(spin_button: PSpinButton): gint{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_value_as_int".} +proc spin_button_set_value*(spin_button: PSpinButton, value: gdouble){.cdecl, + dynlib: lib, importc: "gtk_spin_button_set_value".} +proc spin_button_set_update_policy*(spin_button: PSpinButton, + policy: TSpinButtonUpdatePolicy){.cdecl, + dynlib: lib, importc: "gtk_spin_button_set_update_policy".} +proc spin_button_get_update_policy*(spin_button: PSpinButton): TSpinButtonUpdatePolicy{. + cdecl, dynlib: lib, importc: "gtk_spin_button_get_update_policy".} +proc spin_button_set_numeric*(spin_button: PSpinButton, numeric: gboolean){. + cdecl, dynlib: lib, importc: "gtk_spin_button_set_numeric".} +proc spin_button_get_numeric*(spin_button: PSpinButton): gboolean{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_numeric".} +proc spin_button_spin*(spin_button: PSpinButton, direction: TSpinType, + increment: gdouble){.cdecl, dynlib: lib, + importc: "gtk_spin_button_spin".} +proc spin_button_set_wrap*(spin_button: PSpinButton, wrap: gboolean){.cdecl, + dynlib: lib, importc: "gtk_spin_button_set_wrap".} +proc spin_button_get_wrap*(spin_button: PSpinButton): gboolean{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_wrap".} +proc spin_button_set_snap_to_ticks*(spin_button: PSpinButton, + snap_to_ticks: gboolean){.cdecl, + dynlib: lib, importc: "gtk_spin_button_set_snap_to_ticks".} +proc spin_button_get_snap_to_ticks*(spin_button: PSpinButton): gboolean{.cdecl, + dynlib: lib, importc: "gtk_spin_button_get_snap_to_ticks".} +proc spin_button_update*(spin_button: PSpinButton){.cdecl, dynlib: lib, + importc: "gtk_spin_button_update".} +const + STOCK_DIALOG_INFO* = "gtk-dialog-info" + STOCK_DIALOG_WARNING* = "gtk-dialog-warning" + STOCK_DIALOG_ERROR* = "gtk-dialog-error" + STOCK_DIALOG_QUESTION* = "gtk-dialog-question" + STOCK_DND* = "gtk-dnd" + STOCK_DND_MULTIPLE* = "gtk-dnd-multiple" + STOCK_ABOUT* = "gtk-about" + STOCK_ADD_name* = "gtk-add" + STOCK_APPLY* = "gtk-apply" + STOCK_BOLD* = "gtk-bold" + STOCK_CANCEL* = "gtk-cancel" + STOCK_CDROM* = "gtk-cdrom" + STOCK_CLEAR* = "gtk-clear" + STOCK_CLOSE* = "gtk-close" + STOCK_COLOR_PICKER* = "gtk-color-picker" + STOCK_CONVERT* = "gtk-convert" + STOCK_CONNECT* = "gtk-connect" + STOCK_COPY* = "gtk-copy" + STOCK_CUT* = "gtk-cut" + STOCK_DELETE* = "gtk-delete" + STOCK_EDIT* = "gtk-edit" + STOCK_EXECUTE* = "gtk-execute" + STOCK_FIND* = "gtk-find" + STOCK_FIND_AND_REPLACE* = "gtk-find-and-replace" + STOCK_FLOPPY* = "gtk-floppy" + STOCK_GOTO_BOTTOM* = "gtk-goto-bottom" + STOCK_GOTO_FIRST* = "gtk-goto-first" + STOCK_GOTO_LAST* = "gtk-goto-last" + STOCK_GOTO_TOP* = "gtk-goto-top" + STOCK_GO_BACK* = "gtk-go-back" + STOCK_GO_DOWN* = "gtk-go-down" + STOCK_GO_FORWARD* = "gtk-go-forward" + STOCK_GO_UP* = "gtk-go-up" + STOCK_HELP* = "gtk-help" + STOCK_HOME* = "gtk-home" + STOCK_INDEX* = "gtk-index" + STOCK_ITALIC* = "gtk-italic" + STOCK_JUMP_TO* = "gtk-jump-to" + STOCK_JUSTIFY_CENTER* = "gtk-justify-center" + STOCK_JUSTIFY_FILL* = "gtk-justify-fill" + STOCK_JUSTIFY_LEFT* = "gtk-justify-left" + STOCK_JUSTIFY_RIGHT* = "gtk-justify-right" + STOCK_MEDIA_FORWARD* = "gtk-media-forward" + STOCK_MEDIA_NEXT* = "gtk-media-next" + STOCK_MEDIA_PAUSE* = "gtk-media-pause" + STOCK_MEDIA_PLAY* = "gtk-media-play" + STOCK_MEDIA_PREVIOUS* = "gtk-media-previous" + STOCK_MEDIA_RECORD* = "gtk-media-record" + STOCK_MEDIA_REWIND* = "gtk-media-rewind" + STOCK_MEDIA_STOP* = "gtk-media-stop" + STOCK_MISSING_IMAGE* = "gtk-missing-image" + STOCK_NEW* = "gtk-new" + STOCK_NO* = "gtk-no" + STOCK_OK* = "gtk-ok" + STOCK_OPEN* = "gtk-open" + STOCK_PASTE* = "gtk-paste" + STOCK_PREFERENCES* = "gtk-preferences" + STOCK_PRINT* = "gtk-print" + STOCK_PRINT_PREVIEW* = "gtk-print-preview" + STOCK_PROPERTIES* = "gtk-properties" + STOCK_QUIT* = "gtk-quit" + STOCK_REDO* = "gtk-redo" + STOCK_REFRESH* = "gtk-refresh" + STOCK_REMOVE* = "gtk-remove" + STOCK_REVERT_TO_SAVED* = "gtk-revert-to-saved" + STOCK_SAVE* = "gtk-save" + STOCK_SAVE_AS* = "gtk-save-as" + STOCK_SELECT_COLOR* = "gtk-select-color" + STOCK_SELECT_FONT* = "gtk-select-font" + STOCK_SORT_ASCENDING* = "gtk-sort-ascending" + STOCK_SORT_DESCENDING* = "gtk-sort-descending" + STOCK_SPELL_CHECK* = "gtk-spell-check" + STOCK_STOP* = "gtk-stop" + STOCK_STRIKETHROUGH* = "gtk-strikethrough" + STOCK_UNDELETE* = "gtk-undelete" + STOCK_UNDERLINE* = "gtk-underline" + STOCK_UNDO* = "gtk-undo" + STOCK_YES* = "gtk-yes" + STOCK_ZOOM_100* = "gtk-zoom-100" + STOCK_ZOOM_FIT* = "gtk-zoom-fit" + STOCK_ZOOM_IN* = "gtk-zoom-in" + STOCK_ZOOM_OUT* = "gtk-zoom-out" + +proc stock_add*(items: PStockItem, n_items: guint){.cdecl, dynlib: lib, + importc: "gtk_stock_add".} +proc stock_add_static*(items: PStockItem, n_items: guint){.cdecl, dynlib: lib, + importc: "gtk_stock_add_static".} +proc stock_lookup*(stock_id: cstring, item: PStockItem): gboolean{.cdecl, + dynlib: lib, importc: "gtk_stock_lookup".} +proc stock_list_ids*(): PGSList{.cdecl, dynlib: lib, + importc: "gtk_stock_list_ids".} +proc stock_item_copy*(item: PStockItem): PStockItem{.cdecl, dynlib: lib, + importc: "gtk_stock_item_copy".} +proc stock_item_free*(item: PStockItem){.cdecl, dynlib: lib, + importc: "gtk_stock_item_free".} +proc TYPE_STATUSBAR*(): GType +proc STATUSBAR*(obj: pointer): PStatusbar +proc STATUSBAR_CLASS*(klass: pointer): PStatusbarClass +proc IS_STATUSBAR*(obj: pointer): bool +proc IS_STATUSBAR_CLASS*(klass: pointer): bool +proc STATUSBAR_GET_CLASS*(obj: pointer): PStatusbarClass +const + bm_TGtkStatusbar_has_resize_grip* = 0x0001'i16 + bp_TGtkStatusbar_has_resize_grip* = 0'i16 + +proc has_resize_grip*(a: var TStatusbar): guint +proc set_has_resize_grip*(a: var TStatusbar, `has_resize_grip`: guint) +proc statusbar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_statusbar_get_type".} +proc statusbar_new*(): PStatusbar{.cdecl, dynlib: lib, + importc: "gtk_statusbar_new".} +proc statusbar_get_context_id*(statusbar: PStatusbar, + context_description: cstring): guint{.cdecl, + dynlib: lib, importc: "gtk_statusbar_get_context_id".} +proc statusbar_push*(statusbar: PStatusbar, context_id: guint, text: cstring): guint{. + cdecl, dynlib: lib, importc: "gtk_statusbar_push".} +proc statusbar_pop*(statusbar: PStatusbar, context_id: guint){.cdecl, + dynlib: lib, importc: "gtk_statusbar_pop".} +proc statusbar_remove*(statusbar: PStatusbar, context_id: guint, + message_id: guint){.cdecl, dynlib: lib, + importc: "gtk_statusbar_remove".} +proc statusbar_set_has_resize_grip*(statusbar: PStatusbar, setting: gboolean){. + cdecl, dynlib: lib, importc: "gtk_statusbar_set_has_resize_grip".} +proc statusbar_get_has_resize_grip*(statusbar: PStatusbar): gboolean{.cdecl, + dynlib: lib, importc: "gtk_statusbar_get_has_resize_grip".} +const + bm_TGtkTable_homogeneous* = 0x0001'i16 + bp_TGtkTable_homogeneous* = 0'i16 + bm_TGtkTableChild_xexpand* = 0x0001'i16 + bp_TGtkTableChild_xexpand* = 0'i16 + bm_TGtkTableChild_yexpand* = 0x0002'i16 + bp_TGtkTableChild_yexpand* = 1'i16 + bm_TGtkTableChild_xshrink* = 0x0004'i16 + bp_TGtkTableChild_xshrink* = 2'i16 + bm_TGtkTableChild_yshrink* = 0x0008'i16 + bp_TGtkTableChild_yshrink* = 3'i16 + bm_TGtkTableChild_xfill* = 0x0010'i16 + bp_TGtkTableChild_xfill* = 4'i16 + bm_TGtkTableChild_yfill* = 0x0020'i16 + bp_TGtkTableChild_yfill* = 5'i16 + bm_TGtkTableRowCol_need_expand* = 0x0001'i16 + bp_TGtkTableRowCol_need_expand* = 0'i16 + bm_TGtkTableRowCol_need_shrink* = 0x0002'i16 + bp_TGtkTableRowCol_need_shrink* = 1'i16 + bm_TGtkTableRowCol_expand* = 0x0004'i16 + bp_TGtkTableRowCol_expand* = 2'i16 + bm_TGtkTableRowCol_shrink* = 0x0008'i16 + bp_TGtkTableRowCol_shrink* = 3'i16 + bm_TGtkTableRowCol_empty* = 0x0010'i16 + bp_TGtkTableRowCol_empty* = 4'i16 + +proc TYPE_TABLE*(): GType +proc TABLE*(obj: pointer): PTable +proc TABLE_CLASS*(klass: pointer): PTableClass +proc IS_TABLE*(obj: pointer): bool +proc IS_TABLE_CLASS*(klass: pointer): bool +proc TABLE_GET_CLASS*(obj: pointer): PTableClass +proc homogeneous*(a: var TTable): guint +proc set_homogeneous*(a: var TTable, `homogeneous`: guint) +proc xexpand*(a: var TTableChild): guint +proc set_xexpand*(a: var TTableChild, `xexpand`: guint) +proc yexpand*(a: var TTableChild): guint +proc set_yexpand*(a: var TTableChild, `yexpand`: guint) +proc xshrink*(a: var TTableChild): guint +proc set_xshrink*(a: var TTableChild, `xshrink`: guint) +proc yshrink*(a: var TTableChild): guint +proc set_yshrink*(a: var TTableChild, `yshrink`: guint) +proc xfill*(a: var TTableChild): guint +proc set_xfill*(a: var TTableChild, `xfill`: guint) +proc yfill*(a: var TTableChild): guint +proc set_yfill*(a: var TTableChild, `yfill`: guint) +proc need_expand*(a: var TTableRowCol): guint +proc set_need_expand*(a: var TTableRowCol, `need_expand`: guint) +proc need_shrink*(a: var TTableRowCol): guint +proc set_need_shrink*(a: var TTableRowCol, `need_shrink`: guint) +proc expand*(a: var TTableRowCol): guint +proc set_expand*(a: var TTableRowCol, `expand`: guint) +proc shrink*(a: var TTableRowCol): guint +proc set_shrink*(a: var TTableRowCol, `shrink`: guint) +proc empty*(a: var TTableRowCol): guint +proc set_empty*(a: var TTableRowCol, `empty`: guint) +proc table_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_table_get_type".} +proc table_new*(rows: guint, columns: guint, homogeneous: gboolean): PTable{. + cdecl, dynlib: lib, importc: "gtk_table_new".} +proc table_resize*(table: PTable, rows: guint, columns: guint){.cdecl, + dynlib: lib, importc: "gtk_table_resize".} +proc table_attach*(table: PTable, child: PWidget, left_attach: guint, + right_attach: guint, top_attach: guint, bottom_attach: guint, + xoptions: TAttachOptions, yoptions: TAttachOptions, + xpadding: guint, ypadding: guint){.cdecl, dynlib: lib, + importc: "gtk_table_attach".} +proc table_attach_defaults*(table: PTable, widget: PWidget, left_attach: guint, + right_attach: guint, top_attach: guint, + bottom_attach: guint){.cdecl, dynlib: lib, + importc: "gtk_table_attach_defaults".} +proc table_set_row_spacing*(table: PTable, row: guint, spacing: guint){.cdecl, + dynlib: lib, importc: "gtk_table_set_row_spacing".} +proc table_get_row_spacing*(table: PTable, row: guint): guint{.cdecl, + dynlib: lib, importc: "gtk_table_get_row_spacing".} +proc table_set_col_spacing*(table: PTable, column: guint, spacing: guint){. + cdecl, dynlib: lib, importc: "gtk_table_set_col_spacing".} +proc table_get_col_spacing*(table: PTable, column: guint): guint{.cdecl, + dynlib: lib, importc: "gtk_table_get_col_spacing".} +proc table_set_row_spacings*(table: PTable, spacing: guint){.cdecl, dynlib: lib, + importc: "gtk_table_set_row_spacings".} +proc table_get_default_row_spacing*(table: PTable): guint{.cdecl, dynlib: lib, + importc: "gtk_table_get_default_row_spacing".} +proc table_set_col_spacings*(table: PTable, spacing: guint){.cdecl, dynlib: lib, + importc: "gtk_table_set_col_spacings".} +proc table_get_default_col_spacing*(table: PTable): guint{.cdecl, dynlib: lib, + importc: "gtk_table_get_default_col_spacing".} +proc table_set_homogeneous*(table: PTable, homogeneous: gboolean){.cdecl, + dynlib: lib, importc: "gtk_table_set_homogeneous".} +proc table_get_homogeneous*(table: PTable): gboolean{.cdecl, dynlib: lib, + importc: "gtk_table_get_homogeneous".} +const + bm_TGtkTearoffMenuItem_torn_off* = 0x0001'i16 + bp_TGtkTearoffMenuItem_torn_off* = 0'i16 + +proc TYPE_TEAROFF_MENU_ITEM*(): GType +proc TEAROFF_MENU_ITEM*(obj: pointer): PTearoffMenuItem +proc TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PTearoffMenuItemClass +proc IS_TEAROFF_MENU_ITEM*(obj: pointer): bool +proc IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool +proc TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PTearoffMenuItemClass +proc torn_off*(a: var TTearoffMenuItem): guint +proc set_torn_off*(a: var TTearoffMenuItem, `torn_off`: guint) +proc tearoff_menu_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tearoff_menu_item_get_type".} +proc tearoff_menu_item_new*(): PTearoffMenuItem{.cdecl, dynlib: lib, + importc: "gtk_tearoff_menu_item_new".} +const + bm_TGtkText_line_wrap* = 0x0001'i16 + bp_TGtkText_line_wrap* = 0'i16 + bm_TGtkText_word_wrap* = 0x0002'i16 + bp_TGtkText_word_wrap* = 1'i16 + bm_TGtkText_use_wchar* = 0x0004'i16 + bp_TGtkText_use_wchar* = 2'i16 + +proc TYPE_TEXT*(): GType +proc TEXT*(obj: pointer): PText +proc TEXT_CLASS*(klass: pointer): PTextClass +proc IS_TEXT*(obj: pointer): bool +proc IS_TEXT_CLASS*(klass: pointer): bool +proc TEXT_GET_CLASS*(obj: pointer): PTextClass +proc line_wrap*(a: PText): guint +proc set_line_wrap*(a: PText, `line_wrap`: guint) +proc word_wrap*(a: PText): guint +proc set_word_wrap*(a: PText, `word_wrap`: guint) +proc use_wchar*(a: PText): gboolean +proc set_use_wchar*(a: PText, `use_wchar`: gboolean) +proc text_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_text_get_type".} +proc text_new*(hadj: PAdjustment, vadj: PAdjustment): PText{.cdecl, dynlib: lib, + importc: "gtk_text_new".} +proc text_set_editable*(text: PText, editable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_text_set_editable".} +proc text_set_word_wrap*(text: PText, word_wrap: gboolean){.cdecl, dynlib: lib, + importc: "gtk_text_set_word_wrap".} +proc text_set_line_wrap*(text: PText, line_wrap: gboolean){.cdecl, dynlib: lib, + importc: "gtk_text_set_line_wrap".} +proc text_set_adjustments*(text: PText, hadj: PAdjustment, vadj: PAdjustment){. + cdecl, dynlib: lib, importc: "gtk_text_set_adjustments".} +proc text_set_point*(text: PText, index: guint){.cdecl, dynlib: lib, + importc: "gtk_text_set_point".} +proc text_get_point*(text: PText): guint{.cdecl, dynlib: lib, + importc: "gtk_text_get_point".} +proc text_get_length*(text: PText): guint{.cdecl, dynlib: lib, + importc: "gtk_text_get_length".} +proc text_freeze*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_freeze".} +proc text_thaw*(text: PText){.cdecl, dynlib: lib, importc: "gtk_text_thaw".} +proc text_insert*(text: PText, font: PGdkFont, fore: PGdkColor, back: PGdkColor, + chars: cstring, length: gint){.cdecl, dynlib: lib, + importc: "gtk_text_insert".} +proc text_backward_delete*(text: PText, nchars: guint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_backward_delete".} +proc text_forward_delete*(text: PText, nchars: guint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_forward_delete".} +proc TEXT_INDEX_WCHAR*(t: PText, index: guint): guint32 +proc TEXT_INDEX_UCHAR*(t: PText, index: guint): GUChar +const + TEXT_SEARCH_VISIBLE_ONLY* = 0 + TEXT_SEARCH_TEXT_ONLY* = 1 + +proc TYPE_TEXT_ITER*(): GType +proc text_iter_get_buffer*(iter: PTextIter): PTextBuffer{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_buffer".} +proc text_iter_copy*(iter: PTextIter): PTextIter{.cdecl, dynlib: lib, + importc: "gtk_text_iter_copy".} +proc text_iter_free*(iter: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_iter_free".} +proc text_iter_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_type".} +proc text_iter_get_offset*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_offset".} +proc text_iter_get_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_line".} +proc text_iter_get_line_offset*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_line_offset".} +proc text_iter_get_line_index*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_line_index".} +proc text_iter_get_visible_line_offset*(iter: PTextIter): gint{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_visible_line_offset".} +proc text_iter_get_visible_line_index*(iter: PTextIter): gint{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_visible_line_index".} +proc text_iter_get_char*(iter: PTextIter): gunichar{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_char".} +proc text_iter_get_slice*(start: PTextIter, theEnd: PTextIter): cstring{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_slice".} +proc text_iter_get_text*(start: PTextIter, theEnd: PTextIter): cstring{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_text".} +proc text_iter_get_visible_slice*(start: PTextIter, theEnd: PTextIter): cstring{. + cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_slice".} +proc text_iter_get_visible_text*(start: PTextIter, theEnd: PTextIter): cstring{. + cdecl, dynlib: lib, importc: "gtk_text_iter_get_visible_text".} +proc text_iter_get_pixbuf*(iter: PTextIter): PGdkPixbuf{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_pixbuf".} +proc text_iter_get_marks*(iter: PTextIter): PGSList{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_marks".} +proc text_iter_get_child_anchor*(iter: PTextIter): PTextChildAnchor{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_child_anchor".} +proc text_iter_get_toggled_tags*(iter: PTextIter, toggled_on: gboolean): PGSList{. + cdecl, dynlib: lib, importc: "gtk_text_iter_get_toggled_tags".} +proc text_iter_begins_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_begins_tag".} +proc text_iter_ends_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_ends_tag".} +proc text_iter_toggles_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_toggles_tag".} +proc text_iter_has_tag*(iter: PTextIter, tag: PTextTag): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_has_tag".} +proc text_iter_get_tags*(iter: PTextIter): PGSList{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_tags".} +proc text_iter_editable*(iter: PTextIter, default_setting: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_editable".} +proc text_iter_can_insert*(iter: PTextIter, default_editability: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_can_insert".} +proc text_iter_starts_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_starts_word".} +proc text_iter_ends_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_ends_word".} +proc text_iter_inside_word*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_inside_word".} +proc text_iter_starts_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_starts_sentence".} +proc text_iter_ends_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_ends_sentence".} +proc text_iter_inside_sentence*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_inside_sentence".} +proc text_iter_starts_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_starts_line".} +proc text_iter_ends_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_ends_line".} +proc text_iter_is_cursor_position*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_is_cursor_position".} +proc text_iter_get_chars_in_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_chars_in_line".} +proc text_iter_get_bytes_in_line*(iter: PTextIter): gint{.cdecl, dynlib: lib, + importc: "gtk_text_iter_get_bytes_in_line".} +proc text_iter_get_attributes*(iter: PTextIter, values: PTextAttributes): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_get_attributes".} +proc text_iter_get_language*(iter: PTextIter): PPangoLanguage{.cdecl, + dynlib: lib, importc: "gtk_text_iter_get_language".} +proc text_iter_is_end*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_is_end".} +proc text_iter_is_start*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_is_start".} +proc text_iter_forward_char*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_forward_char".} +proc text_iter_backward_char*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_backward_char".} +proc text_iter_forward_chars*(iter: PTextIter, count: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_forward_chars".} +proc text_iter_backward_chars*(iter: PTextIter, count: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_backward_chars".} +proc text_iter_forward_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_forward_line".} +proc text_iter_backward_line*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_backward_line".} +proc text_iter_forward_lines*(iter: PTextIter, count: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_forward_lines".} +proc text_iter_backward_lines*(iter: PTextIter, count: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_backward_lines".} +proc text_iter_forward_word_end*(iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_iter_forward_word_end".} +proc text_iter_backward_word_start*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_backward_word_start".} +proc text_iter_forward_word_ends*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_word_ends".} +proc text_iter_backward_word_starts*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_word_starts".} +proc text_iter_forward_sentence_end*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_forward_sentence_end".} +proc text_iter_backward_sentence_start*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_backward_sentence_start".} +proc text_iter_forward_sentence_ends*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_sentence_ends".} +proc text_iter_backward_sentence_starts*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_sentence_starts".} +proc text_iter_forward_cursor_position*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_forward_cursor_position".} +proc text_iter_backward_cursor_position*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_backward_cursor_position".} +proc text_iter_forward_cursor_positions*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_cursor_positions".} +proc text_iter_backward_cursor_positions*(iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_cursor_positions".} +proc text_iter_set_offset*(iter: PTextIter, char_offset: gint){.cdecl, + dynlib: lib, importc: "gtk_text_iter_set_offset".} +proc text_iter_set_line*(iter: PTextIter, line_number: gint){.cdecl, + dynlib: lib, importc: "gtk_text_iter_set_line".} +proc text_iter_set_line_offset*(iter: PTextIter, char_on_line: gint){.cdecl, + dynlib: lib, importc: "gtk_text_iter_set_line_offset".} +proc text_iter_set_line_index*(iter: PTextIter, byte_on_line: gint){.cdecl, + dynlib: lib, importc: "gtk_text_iter_set_line_index".} +proc text_iter_forward_to_end*(iter: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_iter_forward_to_end".} +proc text_iter_forward_to_line_end*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_forward_to_line_end".} +proc text_iter_set_visible_line_offset*(iter: PTextIter, char_on_line: gint){. + cdecl, dynlib: lib, importc: "gtk_text_iter_set_visible_line_offset".} +proc text_iter_set_visible_line_index*(iter: PTextIter, byte_on_line: gint){. + cdecl, dynlib: lib, importc: "gtk_text_iter_set_visible_line_index".} +proc text_iter_forward_to_tag_toggle*(iter: PTextIter, tag: PTextTag): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_to_tag_toggle".} +proc text_iter_backward_to_tag_toggle*(iter: PTextIter, tag: PTextTag): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_to_tag_toggle".} +proc text_iter_forward_find_char*(iter: PTextIter, pred: TTextCharPredicate, + user_data: gpointer, limit: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_find_char".} +proc text_iter_backward_find_char*(iter: PTextIter, pred: TTextCharPredicate, + user_data: gpointer, limit: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_find_char".} +proc text_iter_forward_search*(iter: PTextIter, str: cstring, + flags: TTextSearchFlags, match_start: PTextIter, + match_end: PTextIter, limit: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_forward_search".} +proc text_iter_backward_search*(iter: PTextIter, str: cstring, + flags: TTextSearchFlags, match_start: PTextIter, + match_end: PTextIter, limit: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_backward_search".} +proc text_iter_equal*(lhs: PTextIter, rhs: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_iter_equal".} +proc text_iter_compare*(lhs: PTextIter, rhs: PTextIter): gint{.cdecl, + dynlib: lib, importc: "gtk_text_iter_compare".} +proc text_iter_in_range*(iter: PTextIter, start: PTextIter, theEnd: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_iter_in_range".} +proc text_iter_order*(first: PTextIter, second: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_iter_order".} +proc TYPE_TEXT_TAG*(): GType +proc TEXT_TAG*(obj: pointer): PTextTag +proc TEXT_TAG_CLASS*(klass: pointer): PTextTagClass +proc IS_TEXT_TAG*(obj: pointer): bool +proc IS_TEXT_TAG_CLASS*(klass: pointer): bool +proc TEXT_TAG_GET_CLASS*(obj: pointer): PTextTagClass +proc TYPE_TEXT_ATTRIBUTES*(): GType +proc text_tag_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_tag_get_type".} +proc text_tag_new*(name: cstring): PTextTag{.cdecl, dynlib: lib, + importc: "gtk_text_tag_new".} +proc text_tag_get_priority*(tag: PTextTag): gint{.cdecl, dynlib: lib, + importc: "gtk_text_tag_get_priority".} +proc text_tag_set_priority*(tag: PTextTag, priority: gint){.cdecl, dynlib: lib, + importc: "gtk_text_tag_set_priority".} +proc text_tag_event*(tag: PTextTag, event_object: PGObject, event: PGdkEvent, + iter: PTextIter): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_tag_event".} +proc text_attributes_new*(): PTextAttributes{.cdecl, dynlib: lib, + importc: "gtk_text_attributes_new".} +proc text_attributes_copy*(src: PTextAttributes): PTextAttributes{.cdecl, + dynlib: lib, importc: "gtk_text_attributes_copy".} +proc text_attributes_copy_values*(src: PTextAttributes, dest: PTextAttributes){. + cdecl, dynlib: lib, importc: "gtk_text_attributes_copy_values".} +proc text_attributes_unref*(values: PTextAttributes){.cdecl, dynlib: lib, + importc: "gtk_text_attributes_unref".} +proc text_attributes_ref*(values: PTextAttributes){.cdecl, dynlib: lib, + importc: "gtk_text_attributes_ref".} +proc text_attributes_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_attributes_get_type".} +const + bm_TGtkTextTag_bg_color_set* = 0x00000001'i32 + bp_TGtkTextTag_bg_color_set* = 0'i32 + bm_TGtkTextTag_bg_stipple_set* = 0x00000002'i32 + bp_TGtkTextTag_bg_stipple_set* = 1'i32 + bm_TGtkTextTag_fg_color_set* = 0x00000004'i32 + bp_TGtkTextTag_fg_color_set* = 2'i32 + bm_TGtkTextTag_scale_set* = 0x00000008'i32 + bp_TGtkTextTag_scale_set* = 3'i32 + bm_TGtkTextTag_fg_stipple_set* = 0x00000010'i32 + bp_TGtkTextTag_fg_stipple_set* = 4'i32 + bm_TGtkTextTag_justification_set* = 0x00000020'i32 + bp_TGtkTextTag_justification_set* = 5'i32 + bm_TGtkTextTag_left_margin_set* = 0x00000040'i32 + bp_TGtkTextTag_left_margin_set* = 6'i32 + bm_TGtkTextTag_indent_set* = 0x00000080'i32 + bp_TGtkTextTag_indent_set* = 7'i32 + bm_TGtkTextTag_rise_set* = 0x00000100'i32 + bp_TGtkTextTag_rise_set* = 8'i32 + bm_TGtkTextTag_strikethrough_set* = 0x00000200'i32 + bp_TGtkTextTag_strikethrough_set* = 9'i32 + bm_TGtkTextTag_right_margin_set* = 0x00000400'i32 + bp_TGtkTextTag_right_margin_set* = 10'i32 + bm_TGtkTextTag_pixels_above_lines_set* = 0x00000800'i32 + bp_TGtkTextTag_pixels_above_lines_set* = 11'i32 + bm_TGtkTextTag_pixels_below_lines_set* = 0x00001000'i32 + bp_TGtkTextTag_pixels_below_lines_set* = 12'i32 + bm_TGtkTextTag_pixels_inside_wrap_set* = 0x00002000'i32 + bp_TGtkTextTag_pixels_inside_wrap_set* = 13'i32 + bm_TGtkTextTag_tabs_set* = 0x00004000'i32 + bp_TGtkTextTag_tabs_set* = 14'i32 + bm_TGtkTextTag_underline_set* = 0x00008000'i32 + bp_TGtkTextTag_underline_set* = 15'i32 + bm_TGtkTextTag_wrap_mode_set* = 0x00010000'i32 + bp_TGtkTextTag_wrap_mode_set* = 16'i32 + bm_TGtkTextTag_bg_full_height_set* = 0x00020000'i32 + bp_TGtkTextTag_bg_full_height_set* = 17'i32 + bm_TGtkTextTag_invisible_set* = 0x00040000'i32 + bp_TGtkTextTag_invisible_set* = 18'i32 + bm_TGtkTextTag_editable_set* = 0x00080000'i32 + bp_TGtkTextTag_editable_set* = 19'i32 + bm_TGtkTextTag_language_set* = 0x00100000'i32 + bp_TGtkTextTag_language_set* = 20'i32 + bm_TGtkTextTag_pad1* = 0x00200000'i32 + bp_TGtkTextTag_pad1* = 21'i32 + bm_TGtkTextTag_pad2* = 0x00400000'i32 + bp_TGtkTextTag_pad2* = 22'i32 + bm_TGtkTextTag_pad3* = 0x00800000'i32 + bp_TGtkTextTag_pad3* = 23'i32 + +proc bg_color_set*(a: var TTextTag): guint +proc set_bg_color_set*(a: var TTextTag, `bg_color_set`: guint) +proc bg_stipple_set*(a: var TTextTag): guint +proc set_bg_stipple_set*(a: var TTextTag, `bg_stipple_set`: guint) +proc fg_color_set*(a: var TTextTag): guint +proc set_fg_color_set*(a: var TTextTag, `fg_color_set`: guint) +proc scale_set*(a: var TTextTag): guint +proc set_scale_set*(a: var TTextTag, `scale_set`: guint) +proc fg_stipple_set*(a: var TTextTag): guint +proc set_fg_stipple_set*(a: var TTextTag, `fg_stipple_set`: guint) +proc justification_set*(a: var TTextTag): guint +proc set_justification_set*(a: var TTextTag, `justification_set`: guint) +proc left_margin_set*(a: var TTextTag): guint +proc set_left_margin_set*(a: var TTextTag, `left_margin_set`: guint) +proc indent_set*(a: var TTextTag): guint +proc set_indent_set*(a: var TTextTag, `indent_set`: guint) +proc rise_set*(a: var TTextTag): guint +proc set_rise_set*(a: var TTextTag, `rise_set`: guint) +proc strikethrough_set*(a: var TTextTag): guint +proc set_strikethrough_set*(a: var TTextTag, `strikethrough_set`: guint) +proc right_margin_set*(a: var TTextTag): guint +proc set_right_margin_set*(a: var TTextTag, `right_margin_set`: guint) +proc pixels_above_lines_set*(a: var TTextTag): guint +proc set_pixels_above_lines_set*(a: var TTextTag, + `pixels_above_lines_set`: guint) +proc pixels_below_lines_set*(a: var TTextTag): guint +proc set_pixels_below_lines_set*(a: var TTextTag, + `pixels_below_lines_set`: guint) +proc pixels_inside_wrap_set*(a: var TTextTag): guint +proc set_pixels_inside_wrap_set*(a: var TTextTag, + `pixels_inside_wrap_set`: guint) +proc tabs_set*(a: var TTextTag): guint +proc set_tabs_set*(a: var TTextTag, `tabs_set`: guint) +proc underline_set*(a: var TTextTag): guint +proc set_underline_set*(a: var TTextTag, `underline_set`: guint) +proc wrap_mode_set*(a: var TTextTag): guint +proc set_wrap_mode_set*(a: var TTextTag, `wrap_mode_set`: guint) +proc bg_full_height_set*(a: var TTextTag): guint +proc set_bg_full_height_set*(a: var TTextTag, `bg_full_height_set`: guint) +proc invisible_set*(a: var TTextTag): guint +proc set_invisible_set*(a: var TTextTag, `invisible_set`: guint) +proc editable_set*(a: var TTextTag): guint +proc set_editable_set*(a: var TTextTag, `editable_set`: guint) +proc language_set*(a: var TTextTag): guint +proc set_language_set*(a: var TTextTag, `language_set`: guint) +proc pad1*(a: var TTextTag): guint +proc set_pad1*(a: var TTextTag, `pad1`: guint) +proc pad2*(a: var TTextTag): guint +proc set_pad2*(a: var TTextTag, `pad2`: guint) +proc pad3*(a: var TTextTag): guint +proc set_pad3*(a: var TTextTag, `pad3`: guint) +const + bm_TGtkTextAppearance_underline* = 0x000F'i16 + bp_TGtkTextAppearance_underline* = 0'i16 + bm_TGtkTextAppearance_strikethrough* = 0x0010'i16 + bp_TGtkTextAppearance_strikethrough* = 4'i16 + bm_TGtkTextAppearance_draw_bg* = 0x0020'i16 + bp_TGtkTextAppearance_draw_bg* = 5'i16 + bm_TGtkTextAppearance_inside_selection* = 0x0040'i16 + bp_TGtkTextAppearance_inside_selection* = 6'i16 + bm_TGtkTextAppearance_is_text* = 0x0080'i16 + bp_TGtkTextAppearance_is_text* = 7'i16 + bm_TGtkTextAppearance_pad1* = 0x0100'i16 + bp_TGtkTextAppearance_pad1* = 8'i16 + bm_TGtkTextAppearance_pad2* = 0x0200'i16 + bp_TGtkTextAppearance_pad2* = 9'i16 + bm_TGtkTextAppearance_pad3* = 0x0400'i16 + bp_TGtkTextAppearance_pad3* = 10'i16 + bm_TGtkTextAppearance_pad4* = 0x0800'i16 + bp_TGtkTextAppearance_pad4* = 11'i16 + +proc underline*(a: var TTextAppearance): guint +proc set_underline*(a: var TTextAppearance, `underline`: guint) +proc strikethrough*(a: var TTextAppearance): guint +proc set_strikethrough*(a: var TTextAppearance, `strikethrough`: guint) +proc draw_bg*(a: var TTextAppearance): guint +proc set_draw_bg*(a: var TTextAppearance, `draw_bg`: guint) +proc inside_selection*(a: var TTextAppearance): guint +proc set_inside_selection*(a: var TTextAppearance, `inside_selection`: guint) +proc is_text*(a: var TTextAppearance): guint +proc set_is_text*(a: var TTextAppearance, `is_text`: guint) +proc pad1*(a: var TTextAppearance): guint +proc set_pad1*(a: var TTextAppearance, `pad1`: guint) +proc pad2*(a: var TTextAppearance): guint +proc set_pad2*(a: var TTextAppearance, `pad2`: guint) +proc pad3*(a: var TTextAppearance): guint +proc set_pad3*(a: var TTextAppearance, `pad3`: guint) +proc pad4*(a: var TTextAppearance): guint +proc set_pad4*(a: var TTextAppearance, `pad4`: guint) +const + bm_TGtkTextAttributes_invisible* = 0x0001'i16 + bp_TGtkTextAttributes_invisible* = 0'i16 + bm_TGtkTextAttributes_bg_full_height* = 0x0002'i16 + bp_TGtkTextAttributes_bg_full_height* = 1'i16 + bm_TGtkTextAttributes_editable* = 0x0004'i16 + bp_TGtkTextAttributes_editable* = 2'i16 + bm_TGtkTextAttributes_realized* = 0x0008'i16 + bp_TGtkTextAttributes_realized* = 3'i16 + bm_TGtkTextAttributes_pad1* = 0x0010'i16 + bp_TGtkTextAttributes_pad1* = 4'i16 + bm_TGtkTextAttributes_pad2* = 0x0020'i16 + bp_TGtkTextAttributes_pad2* = 5'i16 + bm_TGtkTextAttributes_pad3* = 0x0040'i16 + bp_TGtkTextAttributes_pad3* = 6'i16 + bm_TGtkTextAttributes_pad4* = 0x0080'i16 + bp_TGtkTextAttributes_pad4* = 7'i16 + +proc invisible*(a: var TTextAttributes): guint +proc set_invisible*(a: var TTextAttributes, `invisible`: guint) +proc bg_full_height*(a: var TTextAttributes): guint +proc set_bg_full_height*(a: var TTextAttributes, `bg_full_height`: guint) +proc editable*(a: var TTextAttributes): guint +proc set_editable*(a: var TTextAttributes, `editable`: guint) +proc realized*(a: var TTextAttributes): guint +proc set_realized*(a: var TTextAttributes, `realized`: guint) +proc pad1*(a: var TTextAttributes): guint +proc set_pad1*(a: var TTextAttributes, `pad1`: guint) +proc pad2*(a: var TTextAttributes): guint +proc set_pad2*(a: var TTextAttributes, `pad2`: guint) +proc pad3*(a: var TTextAttributes): guint +proc set_pad3*(a: var TTextAttributes, `pad3`: guint) +proc pad4*(a: var TTextAttributes): guint +proc set_pad4*(a: var TTextAttributes, `pad4`: guint) +proc TYPE_TEXT_TAG_TABLE*(): GType +proc TEXT_TAG_TABLE*(obj: pointer): PTextTagTable +proc TEXT_TAG_TABLE_CLASS*(klass: pointer): PTextTagTableClass +proc IS_TEXT_TAG_TABLE*(obj: pointer): bool +proc IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool +proc TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PTextTagTableClass +proc text_tag_table_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_tag_table_get_type".} +proc text_tag_table_new*(): PTextTagTable{.cdecl, dynlib: lib, + importc: "gtk_text_tag_table_new".} +proc text_tag_table_add*(table: PTextTagTable, tag: PTextTag){.cdecl, + dynlib: lib, importc: "gtk_text_tag_table_add".} +proc text_tag_table_remove*(table: PTextTagTable, tag: PTextTag){.cdecl, + dynlib: lib, importc: "gtk_text_tag_table_remove".} +proc text_tag_table_lookup*(table: PTextTagTable, name: cstring): PTextTag{. + cdecl, dynlib: lib, importc: "gtk_text_tag_table_lookup".} +proc text_tag_table_foreach*(table: PTextTagTable, func_: TTextTagTableForeach, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_text_tag_table_foreach".} +proc text_tag_table_get_size*(table: PTextTagTable): gint{.cdecl, dynlib: lib, + importc: "gtk_text_tag_table_get_size".} +proc text_tag_table_add_buffer*(table: PTextTagTable, buffer: gpointer){.cdecl, + dynlib: lib, importc: "_gtk_text_tag_table_add_buffer".} +proc text_tag_table_remove_buffer*(table: PTextTagTable, buffer: gpointer){. + cdecl, dynlib: lib, importc: "_gtk_text_tag_table_remove_buffer".} +proc TYPE_TEXT_MARK*(): GType +proc TEXT_MARK*(anObject: pointer): PTextMark +proc TEXT_MARK_CLASS*(klass: pointer): PTextMarkClass +proc IS_TEXT_MARK*(anObject: pointer): bool +proc IS_TEXT_MARK_CLASS*(klass: pointer): bool +proc TEXT_MARK_GET_CLASS*(obj: pointer): PTextMarkClass +proc text_mark_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_type".} +proc text_mark_set_visible*(mark: PTextMark, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_text_mark_set_visible".} +proc text_mark_get_visible*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_visible".} +proc text_mark_get_name*(mark: PTextMark): cstring{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_name".} +proc text_mark_get_deleted*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_deleted".} +proc text_mark_get_buffer*(mark: PTextMark): PTextBuffer{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_buffer".} +proc text_mark_get_left_gravity*(mark: PTextMark): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_mark_get_left_gravity".} +const + bm_TGtkTextMarkBody_visible* = 0x0001'i16 + bp_TGtkTextMarkBody_visible* = 0'i16 + bm_TGtkTextMarkBody_not_deleteable* = 0x0002'i16 + bp_TGtkTextMarkBody_not_deleteable* = 1'i16 + +proc visible*(a: var TTextMarkBody): guint +proc set_visible*(a: var TTextMarkBody, `visible`: guint) +proc not_deleteable*(a: var TTextMarkBody): guint +proc set_not_deleteable*(a: var TTextMarkBody, `not_deleteable`: guint) +proc mark_segment_new*(tree: PTextBTree, left_gravity: gboolean, name: cstring): PTextLineSegment{. + cdecl, dynlib: lib, importc: "_gtk_mark_segment_new".} +proc TYPE_TEXT_CHILD_ANCHOR*(): GType +proc TEXT_CHILD_ANCHOR*(anObject: pointer): PTextChildAnchor +proc TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PTextChildAnchorClass +proc IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool +proc IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool +proc TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PTextChildAnchorClass +proc text_child_anchor_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_child_anchor_get_type".} +proc text_child_anchor_new*(): PTextChildAnchor{.cdecl, dynlib: lib, + importc: "gtk_text_child_anchor_new".} +proc text_child_anchor_get_widgets*(anchor: PTextChildAnchor): PGList{.cdecl, + dynlib: lib, importc: "gtk_text_child_anchor_get_widgets".} +proc text_child_anchor_get_deleted*(anchor: PTextChildAnchor): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_child_anchor_get_deleted".} +proc pixbuf_segment_new*(pixbuf: PGdkPixbuf): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_pixbuf_segment_new".} +proc widget_segment_new*(anchor: PTextChildAnchor): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_widget_segment_new".} +proc widget_segment_add*(widget_segment: PTextLineSegment, child: PWidget){. + cdecl, dynlib: lib, importc: "_gtk_widget_segment_add".} +proc widget_segment_remove*(widget_segment: PTextLineSegment, child: PWidget){. + cdecl, dynlib: lib, importc: "_gtk_widget_segment_remove".} +proc widget_segment_ref*(widget_segment: PTextLineSegment){.cdecl, dynlib: lib, + importc: "_gtk_widget_segment_ref".} +proc widget_segment_unref*(widget_segment: PTextLineSegment){.cdecl, + dynlib: lib, importc: "_gtk_widget_segment_unref".} +proc anchored_child_get_layout*(child: PWidget): PTextLayout{.cdecl, + dynlib: lib, importc: "_gtk_anchored_child_get_layout".} +proc text_line_segment_split*(iter: PTextIter): PTextLineSegment{.cdecl, + dynlib: lib, importc: "gtk_text_line_segment_split".} +proc char_segment_new*(text: cstring, len: guint): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_char_segment_new".} +proc char_segment_new_from_two_strings*(text1: cstring, len1: guint, + text2: cstring, len2: guint): PTextLineSegment{. + cdecl, dynlib: lib, importc: "_gtk_char_segment_new_from_two_strings".} +proc toggle_segment_new*(info: PTextTagInfo, StateOn: gboolean): PTextLineSegment{. + cdecl, dynlib: lib, importc: "_gtk_toggle_segment_new".} +proc text_btree_new*(table: PTextTagTable, buffer: PTextBuffer): PTextBTree{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_new".} +proc text_btree_ref*(tree: PTextBTree){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_ref".} +proc text_btree_unref*(tree: PTextBTree){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_unref".} +proc text_btree_get_buffer*(tree: PTextBTree): PTextBuffer{.cdecl, dynlib: lib, + importc: "_gtk_text_btree_get_buffer".} +proc text_btree_get_chars_changed_stamp*(tree: PTextBTree): guint{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_chars_changed_stamp".} +proc text_btree_get_segments_changed_stamp*(tree: PTextBTree): guint{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_segments_changed_stamp".} +proc text_btree_segments_changed*(tree: PTextBTree){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_segments_changed".} +proc text_btree_is_end*(tree: PTextBTree, line: PTextLine, + seg: PTextLineSegment, byte_index: int32, + char_offset: int32): gboolean{.cdecl, dynlib: lib, + importc: "_gtk_text_btree_is_end".} +proc text_btree_delete*(start: PTextIter, theEnd: PTextIter){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_delete".} +proc text_btree_insert*(iter: PTextIter, text: cstring, len: gint){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_insert".} +proc text_btree_insert_pixbuf*(iter: PTextIter, pixbuf: PGdkPixbuf){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_insert_pixbuf".} +proc text_btree_insert_child_anchor*(iter: PTextIter, anchor: PTextChildAnchor){. + cdecl, dynlib: lib, importc: "_gtk_text_btree_insert_child_anchor".} +proc text_btree_unregister_child_anchor*(anchor: PTextChildAnchor){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_unregister_child_anchor".} +proc text_btree_find_line_by_y*(tree: PTextBTree, view_id: gpointer, + ypixel: gint, line_top_y: Pgint): PTextLine{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_find_line_by_y".} +proc text_btree_find_line_top*(tree: PTextBTree, line: PTextLine, + view_id: gpointer): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_btree_find_line_top".} +proc text_btree_add_view*(tree: PTextBTree, layout: PTextLayout){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_add_view".} +proc text_btree_remove_view*(tree: PTextBTree, view_id: gpointer){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_remove_view".} +proc text_btree_invalidate_region*(tree: PTextBTree, start: PTextIter, + theEnd: PTextIter){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_invalidate_region".} +proc text_btree_get_view_size*(tree: PTextBTree, view_id: gpointer, + width: Pgint, height: Pgint){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_get_view_size".} +proc text_btree_is_valid*(tree: PTextBTree, view_id: gpointer): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_is_valid".} +proc text_btree_validate*(tree: PTextBTree, view_id: gpointer, max_pixels: gint, + y: Pgint, old_height: Pgint, new_height: Pgint): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_validate".} +proc text_btree_validate_line*(tree: PTextBTree, line: PTextLine, + view_id: gpointer){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_validate_line".} +proc text_btree_tag*(start: PTextIter, theEnd: PTextIter, tag: PTextTag, + apply: gboolean){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_tag".} +proc text_btree_get_line*(tree: PTextBTree, line_number: gint, + real_line_number: Pgint): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_line".} +proc text_btree_get_line_no_last*(tree: PTextBTree, line_number: gint, + real_line_number: Pgint): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_line_no_last".} +proc text_btree_get_end_iter_line*(tree: PTextBTree): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_end_iter_line".} +proc text_btree_get_line_at_char*(tree: PTextBTree, char_index: gint, + line_start_index: Pgint, + real_char_index: Pgint): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_line_at_char".} +proc text_btree_get_tags*(iter: PTextIter, num_tags: Pgint): PPGtkTextTag{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_get_tags".} +proc text_btree_get_text*(start: PTextIter, theEnd: PTextIter, + include_hidden: gboolean, include_nonchars: gboolean): cstring{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_get_text".} +proc text_btree_line_count*(tree: PTextBTree): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_btree_line_count".} +proc text_btree_char_count*(tree: PTextBTree): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_btree_char_count".} +proc text_btree_char_is_invisible*(iter: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_char_is_invisible".} +proc text_btree_get_iter_at_char*(tree: PTextBTree, iter: PTextIter, + char_index: gint){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_get_iter_at_char".} +proc text_btree_get_iter_at_line_char*(tree: PTextBTree, iter: PTextIter, + line_number: gint, char_index: gint){. + cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line_char".} +proc text_btree_get_iter_at_line_byte*(tree: PTextBTree, iter: PTextIter, + line_number: gint, byte_index: gint){. + cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line_byte".} +proc text_btree_get_iter_from_string*(tree: PTextBTree, iter: PTextIter, + `string`: cstring): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_iter_from_string".} +proc text_btree_get_iter_at_mark_name*(tree: PTextBTree, iter: PTextIter, + mark_name: cstring): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_iter_at_mark_name".} +proc text_btree_get_iter_at_mark*(tree: PTextBTree, iter: PTextIter, + mark: PTextMark){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_get_iter_at_mark".} +proc text_btree_get_end_iter*(tree: PTextBTree, iter: PTextIter){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_end_iter".} +proc text_btree_get_iter_at_line*(tree: PTextBTree, iter: PTextIter, + line: PTextLine, byte_offset: gint){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_iter_at_line".} +proc text_btree_get_iter_at_first_toggle*(tree: PTextBTree, iter: PTextIter, + tag: PTextTag): gboolean{.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_first_toggle".} +proc text_btree_get_iter_at_last_toggle*(tree: PTextBTree, iter: PTextIter, + tag: PTextTag): gboolean{.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_last_toggle".} +proc text_btree_get_iter_at_child_anchor*(tree: PTextBTree, iter: PTextIter, + anchor: PTextChildAnchor){.cdecl, dynlib: lib, importc: "_gtk_text_btree_get_iter_at_child_anchor".} +proc text_btree_set_mark*(tree: PTextBTree, existing_mark: PTextMark, + name: cstring, left_gravity: gboolean, + index: PTextIter, should_exist: gboolean): PTextMark{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_set_mark".} +proc text_btree_remove_mark_by_name*(tree: PTextBTree, name: cstring){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_remove_mark_by_name".} +proc text_btree_remove_mark*(tree: PTextBTree, segment: PTextMark){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_remove_mark".} +proc text_btree_get_selection_bounds*(tree: PTextBTree, start: PTextIter, + theEnd: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_btree_get_selection_bounds".} +proc text_btree_place_cursor*(tree: PTextBTree, `where`: PTextIter){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_place_cursor".} +proc text_btree_mark_is_insert*(tree: PTextBTree, segment: PTextMark): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_mark_is_insert".} +proc text_btree_mark_is_selection_bound*(tree: PTextBTree, segment: PTextMark): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_mark_is_selection_bound".} +proc text_btree_get_mark_by_name*(tree: PTextBTree, name: cstring): PTextMark{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_get_mark_by_name".} +proc text_btree_first_could_contain_tag*(tree: PTextBTree, tag: PTextTag): PTextLine{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_first_could_contain_tag".} +proc text_btree_last_could_contain_tag*(tree: PTextBTree, tag: PTextTag): PTextLine{. + cdecl, dynlib: lib, importc: "_gtk_text_btree_last_could_contain_tag".} +const + bm_TGtkTextLineData_width* = 0x00FFFFFF'i32 + bp_TGtkTextLineData_width* = 0'i32 + bm_TGtkTextLineData_valid* = 0xFF000000'i32 + bp_TGtkTextLineData_valid* = 24'i32 + +proc width*(a: PTextLineData): gint +proc set_width*(a: PTextLineData, NewWidth: gint) +proc valid*(a: PTextLineData): gint +proc set_valid*(a: PTextLineData, `valid`: gint) +proc text_line_get_number*(line: PTextLine): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_line_get_number".} +proc text_line_char_has_tag*(line: PTextLine, tree: PTextBTree, + char_in_line: gint, tag: PTextTag): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_line_char_has_tag".} +proc text_line_byte_has_tag*(line: PTextLine, tree: PTextBTree, + byte_in_line: gint, tag: PTextTag): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_line_byte_has_tag".} +proc text_line_is_last*(line: PTextLine, tree: PTextBTree): gboolean{.cdecl, + dynlib: lib, importc: "_gtk_text_line_is_last".} +proc text_line_contains_end_iter*(line: PTextLine, tree: PTextBTree): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_text_line_contains_end_iter".} +proc text_line_next*(line: PTextLine): PTextLine{.cdecl, dynlib: lib, + importc: "_gtk_text_line_next".} +proc text_line_next_excluding_last*(line: PTextLine): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_line_next_excluding_last".} +proc text_line_previous*(line: PTextLine): PTextLine{.cdecl, dynlib: lib, + importc: "_gtk_text_line_previous".} +proc text_line_add_data*(line: PTextLine, data: PTextLineData){.cdecl, + dynlib: lib, importc: "_gtk_text_line_add_data".} +proc text_line_remove_data*(line: PTextLine, view_id: gpointer): gpointer{. + cdecl, dynlib: lib, importc: "_gtk_text_line_remove_data".} +proc text_line_get_data*(line: PTextLine, view_id: gpointer): gpointer{.cdecl, + dynlib: lib, importc: "_gtk_text_line_get_data".} +proc text_line_invalidate_wrap*(line: PTextLine, ld: PTextLineData){.cdecl, + dynlib: lib, importc: "_gtk_text_line_invalidate_wrap".} +proc text_line_char_count*(line: PTextLine): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_line_char_count".} +proc text_line_byte_count*(line: PTextLine): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_line_byte_count".} +proc text_line_char_index*(line: PTextLine): gint{.cdecl, dynlib: lib, + importc: "_gtk_text_line_char_index".} +proc text_line_byte_to_segment*(line: PTextLine, byte_offset: gint, + seg_offset: Pgint): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_text_line_byte_to_segment".} +proc text_line_char_to_segment*(line: PTextLine, char_offset: gint, + seg_offset: Pgint): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_text_line_char_to_segment".} +proc text_line_byte_to_char_offsets*(line: PTextLine, byte_offset: gint, + line_char_offset: Pgint, + seg_char_offset: Pgint){.cdecl, + dynlib: lib, importc: "_gtk_text_line_byte_to_char_offsets".} +proc text_line_char_to_byte_offsets*(line: PTextLine, char_offset: gint, + line_byte_offset: Pgint, + seg_byte_offset: Pgint){.cdecl, + dynlib: lib, importc: "_gtk_text_line_char_to_byte_offsets".} +proc text_line_byte_to_any_segment*(line: PTextLine, byte_offset: gint, + seg_offset: Pgint): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_text_line_byte_to_any_segment".} +proc text_line_char_to_any_segment*(line: PTextLine, char_offset: gint, + seg_offset: Pgint): PTextLineSegment{.cdecl, + dynlib: lib, importc: "_gtk_text_line_char_to_any_segment".} +proc text_line_byte_to_char*(line: PTextLine, byte_offset: gint): gint{.cdecl, + dynlib: lib, importc: "_gtk_text_line_byte_to_char".} +proc text_line_char_to_byte*(line: PTextLine, char_offset: gint): gint{.cdecl, + dynlib: lib, importc: "_gtk_text_line_char_to_byte".} +proc text_line_next_could_contain_tag*(line: PTextLine, tree: PTextBTree, + tag: PTextTag): PTextLine{.cdecl, + dynlib: lib, importc: "_gtk_text_line_next_could_contain_tag".} +proc text_line_previous_could_contain_tag*(line: PTextLine, tree: PTextBTree, + tag: PTextTag): PTextLine{.cdecl, dynlib: lib, importc: "_gtk_text_line_previous_could_contain_tag".} +proc text_line_data_new*(layout: PTextLayout, line: PTextLine): PTextLineData{. + cdecl, dynlib: lib, importc: "_gtk_text_line_data_new".} +proc text_btree_check*(tree: PTextBTree){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_check".} +proc text_btree_spew*(tree: PTextBTree){.cdecl, dynlib: lib, + importc: "_gtk_text_btree_spew".} +proc toggle_segment_check_func*(segPtr: PTextLineSegment, line: PTextLine){. + cdecl, dynlib: lib, importc: "_gtk_toggle_segment_check_func".} +proc change_node_toggle_count*(node_: PTextBTreeNode, info: PTextTagInfo, + delta: gint){.cdecl, dynlib: lib, + importc: "_gtk_change_node_toggle_count".} +proc text_btree_release_mark_segment*(tree: PTextBTree, + segment: PTextLineSegment){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_release_mark_segment".} +proc text_btree_notify_will_remove_tag*(tree: PTextBTree, tag: PTextTag){.cdecl, + dynlib: lib, importc: "_gtk_text_btree_notify_will_remove_tag".} +const + bm_TGtkTextBuffer_modified* = 0x0001'i16 + bp_TGtkTextBuffer_modified* = 0'i16 + +proc TYPE_TEXT_BUFFER*(): GType +proc TEXT_BUFFER*(obj: pointer): PTextBuffer +proc TEXT_BUFFER_CLASS*(klass: pointer): PTextBufferClass +proc IS_TEXT_BUFFER*(obj: pointer): bool +proc IS_TEXT_BUFFER_CLASS*(klass: pointer): bool +proc TEXT_BUFFER_GET_CLASS*(obj: pointer): PTextBufferClass +proc modified*(a: var TTextBuffer): guint +proc set_modified*(a: var TTextBuffer, `modified`: guint) +proc text_buffer_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_type".} +proc text_buffer_new*(table: PTextTagTable): PTextBuffer{.cdecl, dynlib: lib, + importc: "gtk_text_buffer_new".} +proc text_buffer_get_line_count*(buffer: PTextBuffer): gint{.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_line_count".} +proc text_buffer_get_char_count*(buffer: PTextBuffer): gint{.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_char_count".} +proc text_buffer_get_tag_table*(buffer: PTextBuffer): PTextTagTable{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_tag_table".} +proc text_buffer_set_text*(buffer: PTextBuffer, text: cstring, len: gint){. + cdecl, dynlib: lib, importc: "gtk_text_buffer_set_text".} +proc text_buffer_insert*(buffer: PTextBuffer, iter: PTextIter, text: cstring, + len: gint){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_insert".} +proc text_buffer_insert_at_cursor*(buffer: PTextBuffer, text: cstring, len: gint){. + cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_at_cursor".} +proc text_buffer_insert_interactive*(buffer: PTextBuffer, iter: PTextIter, + text: cstring, len: gint, + default_editable: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_interactive".} +proc text_buffer_insert_interactive_at_cursor*(buffer: PTextBuffer, + text: cstring, len: gint, default_editable: gboolean): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_insert_interactive_at_cursor".} +proc text_buffer_insert_range*(buffer: PTextBuffer, iter: PTextIter, + start: PTextIter, theEnd: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_insert_range".} +proc text_buffer_insert_range_interactive*(buffer: PTextBuffer, iter: PTextIter, + start: PTextIter, theEnd: PTextIter, default_editable: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_insert_range_interactive".} +proc text_buffer_delete*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_delete".} +proc text_buffer_delete_interactive*(buffer: PTextBuffer, start_iter: PTextIter, + end_iter: PTextIter, + default_editable: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_delete_interactive".} +proc text_buffer_get_text*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter, include_hidden_chars: gboolean): cstring{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_get_text".} +proc text_buffer_get_slice*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter, include_hidden_chars: gboolean): cstring{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_get_slice".} +proc text_buffer_insert_pixbuf*(buffer: PTextBuffer, iter: PTextIter, + pixbuf: PGdkPixbuf){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_insert_pixbuf".} +proc text_buffer_insert_child_anchor*(buffer: PTextBuffer, iter: PTextIter, + anchor: PTextChildAnchor){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_insert_child_anchor".} +proc text_buffer_create_child_anchor*(buffer: PTextBuffer, iter: PTextIter): PTextChildAnchor{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_create_child_anchor".} +proc text_buffer_create_mark*(buffer: PTextBuffer, mark_name: cstring, + `where`: PTextIter, left_gravity: gboolean): PTextMark{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_create_mark".} +proc text_buffer_move_mark*(buffer: PTextBuffer, mark: PTextMark, + `where`: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_move_mark".} +proc text_buffer_delete_mark*(buffer: PTextBuffer, mark: PTextMark){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_delete_mark".} +proc text_buffer_get_mark*(buffer: PTextBuffer, name: cstring): PTextMark{. + cdecl, dynlib: lib, importc: "gtk_text_buffer_get_mark".} +proc text_buffer_move_mark_by_name*(buffer: PTextBuffer, name: cstring, + `where`: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_move_mark_by_name".} +proc text_buffer_delete_mark_by_name*(buffer: PTextBuffer, name: cstring){. + cdecl, dynlib: lib, importc: "gtk_text_buffer_delete_mark_by_name".} +proc text_buffer_get_insert*(buffer: PTextBuffer): PTextMark{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_insert".} +proc text_buffer_get_selection_bound*(buffer: PTextBuffer): PTextMark{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_selection_bound".} +proc text_buffer_place_cursor*(buffer: PTextBuffer, `where`: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_place_cursor".} +proc text_buffer_apply_tag*(buffer: PTextBuffer, tag: PTextTag, + start: PTextIter, theEnd: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_apply_tag".} +proc text_buffer_remove_tag*(buffer: PTextBuffer, tag: PTextTag, + start: PTextIter, theEnd: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_remove_tag".} +proc text_buffer_apply_tag_by_name*(buffer: PTextBuffer, name: cstring, + start: PTextIter, theEnd: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_apply_tag_by_name".} +proc text_buffer_remove_tag_by_name*(buffer: PTextBuffer, name: cstring, + start: PTextIter, theEnd: PTextIter){. + cdecl, dynlib: lib, importc: "gtk_text_buffer_remove_tag_by_name".} +proc text_buffer_remove_all_tags*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_remove_all_tags".} +proc text_buffer_get_iter_at_line_offset*(buffer: PTextBuffer, iter: PTextIter, + line_number: gint, char_offset: gint){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_iter_at_line_offset".} +proc text_buffer_get_iter_at_line_index*(buffer: PTextBuffer, iter: PTextIter, + line_number: gint, byte_index: gint){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_iter_at_line_index".} +proc text_buffer_get_iter_at_offset*(buffer: PTextBuffer, iter: PTextIter, + char_offset: gint){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_iter_at_offset".} +proc text_buffer_get_iter_at_line*(buffer: PTextBuffer, iter: PTextIter, + line_number: gint){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_iter_at_line".} +proc text_buffer_get_start_iter*(buffer: PTextBuffer, iter: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_start_iter".} +proc text_buffer_get_end_iter*(buffer: PTextBuffer, iter: PTextIter){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_end_iter".} +proc text_buffer_get_bounds*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_bounds".} +proc text_buffer_get_iter_at_mark*(buffer: PTextBuffer, iter: PTextIter, + mark: PTextMark){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_get_iter_at_mark".} +proc text_buffer_get_iter_at_child_anchor*(buffer: PTextBuffer, iter: PTextIter, + anchor: PTextChildAnchor){.cdecl, dynlib: lib, importc: "gtk_text_buffer_get_iter_at_child_anchor".} +proc text_buffer_get_modified*(buffer: PTextBuffer): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_modified".} +proc text_buffer_set_modified*(buffer: PTextBuffer, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_set_modified".} +proc text_buffer_add_selection_clipboard*(buffer: PTextBuffer, + clipboard: PClipboard){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_add_selection_clipboard".} +proc text_buffer_remove_selection_clipboard*(buffer: PTextBuffer, + clipboard: PClipboard){.cdecl, dynlib: lib, importc: "gtk_text_buffer_remove_selection_clipboard".} +proc text_buffer_cut_clipboard*(buffer: PTextBuffer, clipboard: PClipboard, + default_editable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_cut_clipboard".} +proc text_buffer_copy_clipboard*(buffer: PTextBuffer, clipboard: PClipboard){. + cdecl, dynlib: lib, importc: "gtk_text_buffer_copy_clipboard".} +proc text_buffer_paste_clipboard*(buffer: PTextBuffer, clipboard: PClipboard, + override_location: PTextIter, + default_editable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_text_buffer_paste_clipboard".} +proc text_buffer_get_selection_bounds*(buffer: PTextBuffer, start: PTextIter, + theEnd: PTextIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_get_selection_bounds".} +proc text_buffer_delete_selection*(buffer: PTextBuffer, interactive: gboolean, + default_editable: gboolean): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_buffer_delete_selection".} +proc text_buffer_begin_user_action*(buffer: PTextBuffer){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_begin_user_action".} +proc text_buffer_end_user_action*(buffer: PTextBuffer){.cdecl, dynlib: lib, + importc: "gtk_text_buffer_end_user_action".} +proc text_buffer_spew*(buffer: PTextBuffer){.cdecl, dynlib: lib, + importc: "_gtk_text_buffer_spew".} +proc text_buffer_get_btree*(buffer: PTextBuffer): PTextBTree{.cdecl, + dynlib: lib, importc: "_gtk_text_buffer_get_btree".} +proc text_buffer_get_line_log_attrs*(buffer: PTextBuffer, + anywhere_in_line: PTextIter, + char_len: Pgint): PPangoLogAttr{.cdecl, + dynlib: lib, importc: "_gtk_text_buffer_get_line_log_attrs".} +proc text_buffer_notify_will_remove_tag*(buffer: PTextBuffer, tag: PTextTag){. + cdecl, dynlib: lib, importc: "_gtk_text_buffer_notify_will_remove_tag".} +proc TYPE_TEXT_LAYOUT*(): GType +proc TEXT_LAYOUT*(obj: pointer): PTextLayout +proc TEXT_LAYOUT_CLASS*(klass: pointer): PTextLayoutClass +proc IS_TEXT_LAYOUT*(obj: pointer): bool +proc IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool +proc TEXT_LAYOUT_GET_CLASS*(obj: pointer): PTextLayoutClass +const + bm_TGtkTextLayout_cursor_visible* = 0x0001'i16 + bp_TGtkTextLayout_cursor_visible* = 0'i16 + bm_TGtkTextLayout_cursor_direction* = 0x0006'i16 + bp_TGtkTextLayout_cursor_direction* = 1'i16 + +proc cursor_visible*(a: var TTextLayout): guint +proc set_cursor_visible*(a: var TTextLayout, `cursor_visible`: guint) +proc cursor_direction*(a: var TTextLayout): gint +proc set_cursor_direction*(a: var TTextLayout, `cursor_direction`: gint) +const + bm_TGtkTextCursorDisplay_is_strong* = 0x0001'i16 + bp_TGtkTextCursorDisplay_is_strong* = 0'i16 + bm_TGtkTextCursorDisplay_is_weak* = 0x0002'i16 + bp_TGtkTextCursorDisplay_is_weak* = 1'i16 + +proc is_strong*(a: var TTextCursorDisplay): guint +proc set_is_strong*(a: var TTextCursorDisplay, `is_strong`: guint) +proc is_weak*(a: var TTextCursorDisplay): guint +proc set_is_weak*(a: var TTextCursorDisplay, `is_weak`: guint) +proc text_layout_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_type".} +proc text_layout_new*(): PTextLayout{.cdecl, dynlib: lib, + importc: "gtk_text_layout_new".} +proc text_layout_set_buffer*(layout: PTextLayout, buffer: PTextBuffer){.cdecl, + dynlib: lib, importc: "gtk_text_layout_set_buffer".} +proc text_layout_get_buffer*(layout: PTextLayout): PTextBuffer{.cdecl, + dynlib: lib, importc: "gtk_text_layout_get_buffer".} +proc text_layout_set_default_style*(layout: PTextLayout, values: PTextAttributes){. + cdecl, dynlib: lib, importc: "gtk_text_layout_set_default_style".} +proc text_layout_set_contexts*(layout: PTextLayout, ltr_context: PPangoContext, + rtl_context: PPangoContext){.cdecl, dynlib: lib, + importc: "gtk_text_layout_set_contexts".} +proc text_layout_set_cursor_direction*(layout: PTextLayout, + direction: TTextDirection){.cdecl, + dynlib: lib, importc: "gtk_text_layout_set_cursor_direction".} +proc text_layout_default_style_changed*(layout: PTextLayout){.cdecl, + dynlib: lib, importc: "gtk_text_layout_default_style_changed".} +proc text_layout_set_screen_width*(layout: PTextLayout, width: gint){.cdecl, + dynlib: lib, importc: "gtk_text_layout_set_screen_width".} +proc text_layout_set_preedit_string*(layout: PTextLayout, + preedit_string: cstring, + preedit_attrs: PPangoAttrList, + cursor_pos: gint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_set_preedit_string".} +proc text_layout_set_cursor_visible*(layout: PTextLayout, + cursor_visible: gboolean){.cdecl, + dynlib: lib, importc: "gtk_text_layout_set_cursor_visible".} +proc text_layout_get_cursor_visible*(layout: PTextLayout): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_layout_get_cursor_visible".} +proc text_layout_get_size*(layout: PTextLayout, width: Pgint, height: Pgint){. + cdecl, dynlib: lib, importc: "gtk_text_layout_get_size".} +proc text_layout_get_lines*(layout: PTextLayout, top_y: gint, bottom_y: gint, + first_line_y: Pgint): PGSList{.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_lines".} +proc text_layout_wrap_loop_start*(layout: PTextLayout){.cdecl, dynlib: lib, + importc: "gtk_text_layout_wrap_loop_start".} +proc text_layout_wrap_loop_end*(layout: PTextLayout){.cdecl, dynlib: lib, + importc: "gtk_text_layout_wrap_loop_end".} +proc text_layout_get_line_display*(layout: PTextLayout, line: PTextLine, + size_only: gboolean): PTextLineDisplay{. + cdecl, dynlib: lib, importc: "gtk_text_layout_get_line_display".} +proc text_layout_free_line_display*(layout: PTextLayout, + display: PTextLineDisplay){.cdecl, + dynlib: lib, importc: "gtk_text_layout_free_line_display".} +proc text_layout_get_line_at_y*(layout: PTextLayout, target_iter: PTextIter, + y: gint, line_top: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_line_at_y".} +proc text_layout_get_iter_at_pixel*(layout: PTextLayout, iter: PTextIter, + x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_iter_at_pixel".} +proc text_layout_invalidate*(layout: PTextLayout, start: PTextIter, + theEnd: PTextIter){.cdecl, dynlib: lib, + importc: "gtk_text_layout_invalidate".} +proc text_layout_free_line_data*(layout: PTextLayout, line: PTextLine, + line_data: PTextLineData){.cdecl, dynlib: lib, + importc: "gtk_text_layout_free_line_data".} +proc text_layout_is_valid*(layout: PTextLayout): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_layout_is_valid".} +proc text_layout_validate_yrange*(layout: PTextLayout, anchor_line: PTextIter, + y0: gint, y1: gint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_validate_yrange".} +proc text_layout_validate*(layout: PTextLayout, max_pixels: gint){.cdecl, + dynlib: lib, importc: "gtk_text_layout_validate".} +proc text_layout_wrap*(layout: PTextLayout, line: PTextLine, + line_data: PTextLineData): PTextLineData{.cdecl, + dynlib: lib, importc: "gtk_text_layout_wrap".} +proc text_layout_changed*(layout: PTextLayout, y: gint, old_height: gint, + new_height: gint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_changed".} +proc text_layout_get_iter_location*(layout: PTextLayout, iter: PTextIter, + rect: PGdkRectangle){.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_iter_location".} +proc text_layout_get_line_yrange*(layout: PTextLayout, iter: PTextIter, + y: Pgint, height: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_layout_get_line_yrange".} +proc text_layout_get_line_xrange*(layout: PTextLayout, iter: PTextIter, + x: Pgint, width: Pgint){.cdecl, dynlib: lib, + importc: "_gtk_text_layout_get_line_xrange".} +proc text_layout_get_cursor_locations*(layout: PTextLayout, iter: PTextIter, + strong_pos: PGdkRectangle, + weak_pos: PGdkRectangle){.cdecl, + dynlib: lib, importc: "gtk_text_layout_get_cursor_locations".} +proc text_layout_clamp_iter_to_vrange*(layout: PTextLayout, iter: PTextIter, + top: gint, bottom: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_layout_clamp_iter_to_vrange".} +proc text_layout_move_iter_to_line_end*(layout: PTextLayout, iter: PTextIter, + direction: gint): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_layout_move_iter_to_line_end".} +proc text_layout_move_iter_to_previous_line*(layout: PTextLayout, + iter: PTextIter): gboolean{.cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_previous_line".} +proc text_layout_move_iter_to_next_line*(layout: PTextLayout, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_next_line".} +proc text_layout_move_iter_to_x*(layout: PTextLayout, iter: PTextIter, x: gint){. + cdecl, dynlib: lib, importc: "gtk_text_layout_move_iter_to_x".} +proc text_layout_move_iter_visually*(layout: PTextLayout, iter: PTextIter, + count: gint): gboolean{.cdecl, dynlib: lib, + importc: "gtk_text_layout_move_iter_visually".} +proc text_layout_iter_starts_line*(layout: PTextLayout, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_layout_iter_starts_line".} +proc text_layout_get_iter_at_line*(layout: PTextLayout, iter: PTextIter, + line: PTextLine, byte_offset: gint){.cdecl, + dynlib: lib, importc: "gtk_text_layout_get_iter_at_line".} +proc text_child_anchor_register_child*(anchor: PTextChildAnchor, child: PWidget, + layout: PTextLayout){.cdecl, dynlib: lib, + importc: "gtk_text_child_anchor_register_child".} +proc text_child_anchor_unregister_child*(anchor: PTextChildAnchor, + child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_text_child_anchor_unregister_child".} +proc text_child_anchor_queue_resize*(anchor: PTextChildAnchor, + layout: PTextLayout){.cdecl, dynlib: lib, + importc: "gtk_text_child_anchor_queue_resize".} +proc text_anchored_child_set_layout*(child: PWidget, layout: PTextLayout){. + cdecl, dynlib: lib, importc: "gtk_text_anchored_child_set_layout".} +proc text_layout_spew*(layout: PTextLayout){.cdecl, dynlib: lib, + importc: "gtk_text_layout_spew".} +const # GTK_TEXT_VIEW_PRIORITY_VALIDATE* = GDK_PRIORITY_REDRAW + 5 + bm_TGtkTextView_editable* = 0x0001'i16 + bp_TGtkTextView_editable* = 0'i16 + bm_TGtkTextView_overwrite_mode* = 0x0002'i16 + bp_TGtkTextView_overwrite_mode* = 1'i16 + bm_TGtkTextView_cursor_visible* = 0x0004'i16 + bp_TGtkTextView_cursor_visible* = 2'i16 + bm_TGtkTextView_need_im_reset* = 0x0008'i16 + bp_TGtkTextView_need_im_reset* = 3'i16 + bm_TGtkTextView_just_selected_element* = 0x0010'i16 + bp_TGtkTextView_just_selected_element* = 4'i16 + bm_TGtkTextView_disable_scroll_on_focus* = 0x0020'i16 + bp_TGtkTextView_disable_scroll_on_focus* = 5'i16 + bm_TGtkTextView_onscreen_validated* = 0x0040'i16 + bp_TGtkTextView_onscreen_validated* = 6'i16 + bm_TGtkTextView_mouse_cursor_obscured* = 0x0080'i16 + bp_TGtkTextView_mouse_cursor_obscured* = 7'i16 + +proc TYPE_TEXT_VIEW*(): GType +proc TEXT_VIEW*(obj: pointer): PTextView +proc TEXT_VIEW_CLASS*(klass: pointer): PTextViewClass +proc IS_TEXT_VIEW*(obj: pointer): bool +proc IS_TEXT_VIEW_CLASS*(klass: pointer): bool +proc TEXT_VIEW_GET_CLASS*(obj: pointer): PTextViewClass +proc editable*(a: var TTextView): guint +proc set_editable*(a: var TTextView, `editable`: guint) +proc overwrite_mode*(a: var TTextView): guint +proc set_overwrite_mode*(a: var TTextView, `overwrite_mode`: guint) +proc cursor_visible*(a: var TTextView): guint +proc set_cursor_visible*(a: var TTextView, `cursor_visible`: guint) +proc need_im_reset*(a: var TTextView): guint +proc set_need_im_reset*(a: var TTextView, `need_im_reset`: guint) +proc just_selected_element*(a: var TTextView): guint +proc set_just_selected_element*(a: var TTextView, `just_selected_element`: guint) +proc disable_scroll_on_focus*(a: var TTextView): guint +proc set_disable_scroll_on_focus*(a: var TTextView, + `disable_scroll_on_focus`: guint) +proc onscreen_validated*(a: var TTextView): guint +proc set_onscreen_validated*(a: var TTextView, `onscreen_validated`: guint) +proc mouse_cursor_obscured*(a: var TTextView): guint +proc set_mouse_cursor_obscured*(a: var TTextView, `mouse_cursor_obscured`: guint) +proc text_view_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_text_view_get_type".} +proc text_view_new*(): PTextView{.cdecl, dynlib: lib, + importc: "gtk_text_view_new".} +proc text_view_new_with_buffer*(buffer: PTextBuffer): PTextView{.cdecl, + dynlib: lib, importc: "gtk_text_view_new_with_buffer".} +proc text_view_set_buffer*(text_view: PTextView, buffer: PTextBuffer){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_buffer".} +proc text_view_get_buffer*(text_view: PTextView): PTextBuffer{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_buffer".} +proc text_view_scroll_to_iter*(text_view: PTextView, iter: PTextIter, + within_margin: gdouble, use_align: gboolean, + xalign: gdouble, yalign: gdouble): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_scroll_to_iter".} +proc text_view_scroll_to_mark*(text_view: PTextView, mark: PTextMark, + within_margin: gdouble, use_align: gboolean, + xalign: gdouble, yalign: gdouble){.cdecl, + dynlib: lib, importc: "gtk_text_view_scroll_to_mark".} +proc text_view_scroll_mark_onscreen*(text_view: PTextView, mark: PTextMark){. + cdecl, dynlib: lib, importc: "gtk_text_view_scroll_mark_onscreen".} +proc text_view_move_mark_onscreen*(text_view: PTextView, mark: PTextMark): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_move_mark_onscreen".} +proc text_view_place_cursor_onscreen*(text_view: PTextView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_view_place_cursor_onscreen".} +proc text_view_get_visible_rect*(text_view: PTextView, + visible_rect: PGdkRectangle){.cdecl, + dynlib: lib, importc: "gtk_text_view_get_visible_rect".} +proc text_view_set_cursor_visible*(text_view: PTextView, setting: gboolean){. + cdecl, dynlib: lib, importc: "gtk_text_view_set_cursor_visible".} +proc text_view_get_cursor_visible*(text_view: PTextView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_cursor_visible".} +proc text_view_get_iter_location*(text_view: PTextView, iter: PTextIter, + location: PGdkRectangle){.cdecl, dynlib: lib, + importc: "gtk_text_view_get_iter_location".} +proc text_view_get_iter_at_location*(text_view: PTextView, iter: PTextIter, + x: gint, y: gint){.cdecl, dynlib: lib, + importc: "gtk_text_view_get_iter_at_location".} +proc text_view_get_line_yrange*(text_view: PTextView, iter: PTextIter, y: Pgint, + height: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_view_get_line_yrange".} +proc text_view_get_line_at_y*(text_view: PTextView, target_iter: PTextIter, + y: gint, line_top: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_view_get_line_at_y".} +proc text_view_buffer_to_window_coords*(text_view: PTextView, + win: TTextWindowType, buffer_x: gint, + buffer_y: gint, window_x: Pgint, + window_y: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_view_buffer_to_window_coords".} +proc text_view_window_to_buffer_coords*(text_view: PTextView, + win: TTextWindowType, window_x: gint, + window_y: gint, buffer_x: Pgint, + buffer_y: Pgint){.cdecl, dynlib: lib, + importc: "gtk_text_view_window_to_buffer_coords".} +proc text_view_get_window*(text_view: PTextView, win: TTextWindowType): PGdkWindow{. + cdecl, dynlib: lib, importc: "gtk_text_view_get_window".} +proc text_view_get_window_type*(text_view: PTextView, window: PGdkWindow): TTextWindowType{. + cdecl, dynlib: lib, importc: "gtk_text_view_get_window_type".} +proc text_view_set_border_window_size*(text_view: PTextView, + thetype: TTextWindowType, size: gint){. + cdecl, dynlib: lib, importc: "gtk_text_view_set_border_window_size".} +proc text_view_get_border_window_size*(text_view: PTextView, + thetype: TTextWindowType): gint{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_border_window_size".} +proc text_view_forward_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_forward_display_line".} +proc text_view_backward_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_backward_display_line".} +proc text_view_forward_display_line_end*(text_view: PTextView, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_forward_display_line_end".} +proc text_view_backward_display_line_start*(text_view: PTextView, + iter: PTextIter): gboolean{.cdecl, dynlib: lib, importc: "gtk_text_view_backward_display_line_start".} +proc text_view_starts_display_line*(text_view: PTextView, iter: PTextIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_starts_display_line".} +proc text_view_move_visually*(text_view: PTextView, iter: PTextIter, count: gint): gboolean{. + cdecl, dynlib: lib, importc: "gtk_text_view_move_visually".} +proc text_view_add_child_at_anchor*(text_view: PTextView, child: PWidget, + anchor: PTextChildAnchor){.cdecl, + dynlib: lib, importc: "gtk_text_view_add_child_at_anchor".} +proc text_view_add_child_in_window*(text_view: PTextView, child: PWidget, + which_window: TTextWindowType, xpos: gint, + ypos: gint){.cdecl, dynlib: lib, + importc: "gtk_text_view_add_child_in_window".} +proc text_view_move_child*(text_view: PTextView, child: PWidget, xpos: gint, + ypos: gint){.cdecl, dynlib: lib, + importc: "gtk_text_view_move_child".} +proc text_view_set_wrap_mode*(text_view: PTextView, wrap_mode: TWrapMode){. + cdecl, dynlib: lib, importc: "gtk_text_view_set_wrap_mode".} +proc text_view_get_wrap_mode*(text_view: PTextView): TWrapMode{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_wrap_mode".} +proc text_view_set_editable*(text_view: PTextView, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_editable".} +proc text_view_get_editable*(text_view: PTextView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_editable".} +proc text_view_set_pixels_above_lines*(text_view: PTextView, + pixels_above_lines: gint){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_pixels_above_lines".} +proc text_view_get_pixels_above_lines*(text_view: PTextView): gint{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_pixels_above_lines".} +proc text_view_set_pixels_below_lines*(text_view: PTextView, + pixels_below_lines: gint){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_pixels_below_lines".} +proc text_view_get_pixels_below_lines*(text_view: PTextView): gint{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_pixels_below_lines".} +proc text_view_set_pixels_inside_wrap*(text_view: PTextView, + pixels_inside_wrap: gint){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_pixels_inside_wrap".} +proc text_view_get_pixels_inside_wrap*(text_view: PTextView): gint{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_pixels_inside_wrap".} +proc text_view_set_justification*(text_view: PTextView, + justification: TJustification){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_justification".} +proc text_view_get_justification*(text_view: PTextView): TJustification{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_justification".} +proc text_view_set_left_margin*(text_view: PTextView, left_margin: gint){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_left_margin".} +proc text_view_get_left_margin*(text_view: PTextView): gint{.cdecl, dynlib: lib, + importc: "gtk_text_view_get_left_margin".} +proc text_view_set_right_margin*(text_view: PTextView, right_margin: gint){. + cdecl, dynlib: lib, importc: "gtk_text_view_set_right_margin".} +proc text_view_get_right_margin*(text_view: PTextView): gint{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_right_margin".} +proc text_view_set_indent*(text_view: PTextView, indent: gint){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_indent".} +proc text_view_get_indent*(text_view: PTextView): gint{.cdecl, dynlib: lib, + importc: "gtk_text_view_get_indent".} +proc text_view_set_tabs*(text_view: PTextView, tabs: PPangoTabArray){.cdecl, + dynlib: lib, importc: "gtk_text_view_set_tabs".} +proc text_view_get_tabs*(text_view: PTextView): PPangoTabArray{.cdecl, + dynlib: lib, importc: "gtk_text_view_get_tabs".} +proc text_view_get_default_attributes*(text_view: PTextView): PTextAttributes{. + cdecl, dynlib: lib, importc: "gtk_text_view_get_default_attributes".} +const + bm_TGtkTipsQuery_emit_always* = 0x0001'i16 + bp_TGtkTipsQuery_emit_always* = 0'i16 + bm_TGtkTipsQuery_in_query* = 0x0002'i16 + bp_TGtkTipsQuery_in_query* = 1'i16 + +proc TYPE_TIPS_QUERY*(): GType +proc TIPS_QUERY*(obj: pointer): PTipsQuery +proc TIPS_QUERY_CLASS*(klass: pointer): PTipsQueryClass +proc IS_TIPS_QUERY*(obj: pointer): bool +proc IS_TIPS_QUERY_CLASS*(klass: pointer): bool +proc TIPS_QUERY_GET_CLASS*(obj: pointer): PTipsQueryClass +proc emit_always*(a: var TTipsQuery): guint +proc set_emit_always*(a: var TTipsQuery, `emit_always`: guint) +proc in_query*(a: var TTipsQuery): guint +proc set_in_query*(a: var TTipsQuery, `in_query`: guint) +proc tips_query_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tips_query_get_type".} +proc tips_query_new*(): PTipsQuery{.cdecl, dynlib: lib, + importc: "gtk_tips_query_new".} +proc tips_query_start_query*(tips_query: PTipsQuery){.cdecl, dynlib: lib, + importc: "gtk_tips_query_start_query".} +proc tips_query_stop_query*(tips_query: PTipsQuery){.cdecl, dynlib: lib, + importc: "gtk_tips_query_stop_query".} +proc tips_query_set_caller*(tips_query: PTipsQuery, caller: PWidget){.cdecl, + dynlib: lib, importc: "gtk_tips_query_set_caller".} +proc tips_query_set_labels*(tips_query: PTipsQuery, label_inactive: cstring, + label_no_tip: cstring){.cdecl, dynlib: lib, + importc: "gtk_tips_query_set_labels".} +const + bm_TGtkTooltips_delay* = 0x3FFFFFFF'i32 + bp_TGtkTooltips_delay* = 0'i32 + bm_TGtkTooltips_enabled* = 0x40000000'i32 + bp_TGtkTooltips_enabled* = 30'i32 + bm_TGtkTooltips_have_grab* = 0x80000000'i32 + bp_TGtkTooltips_have_grab* = 31'i32 + bm_TGtkTooltips_use_sticky_delay* = 0x00000001'i32 + bp_TGtkTooltips_use_sticky_delay* = 0'i32 + +proc TYPE_TOOLTIPS*(): GType +proc TOOLTIPS*(obj: pointer): PTooltips +proc TOOLTIPS_CLASS*(klass: pointer): PTooltipsClass +proc IS_TOOLTIPS*(obj: pointer): bool +proc IS_TOOLTIPS_CLASS*(klass: pointer): bool +proc TOOLTIPS_GET_CLASS*(obj: pointer): PTooltipsClass +proc delay*(a: var TTooltips): guint +proc set_delay*(a: var TTooltips, `delay`: guint) +proc enabled*(a: var TTooltips): guint +proc set_enabled*(a: var TTooltips, `enabled`: guint) +proc have_grab*(a: var TTooltips): guint +proc set_have_grab*(a: var TTooltips, `have_grab`: guint) +proc use_sticky_delay*(a: var TTooltips): guint +proc set_use_sticky_delay*(a: var TTooltips, `use_sticky_delay`: guint) +proc tooltips_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tooltips_get_type".} +proc tooltips_new*(): PTooltips{.cdecl, dynlib: lib, importc: "gtk_tooltips_new".} +proc tooltips_enable*(tooltips: PTooltips){.cdecl, dynlib: lib, + importc: "gtk_tooltips_enable".} +proc tooltips_disable*(tooltips: PTooltips){.cdecl, dynlib: lib, + importc: "gtk_tooltips_disable".} +proc tooltips_set_tip*(tooltips: PTooltips, widget: PWidget, tip_text: cstring, + tip_private: cstring){.cdecl, dynlib: lib, + importc: "gtk_tooltips_set_tip".} +proc tooltips_data_get*(widget: PWidget): PTooltipsData{.cdecl, dynlib: lib, + importc: "gtk_tooltips_data_get".} +proc tooltips_force_window*(tooltips: PTooltips){.cdecl, dynlib: lib, + importc: "gtk_tooltips_force_window".} +proc tooltips_toggle_keyboard_mode*(widget: PWidget){.cdecl, dynlib: lib, + importc: "_gtk_tooltips_toggle_keyboard_mode".} +const + bm_TGtkToolbar_style_set* = 0x0001'i16 + bp_TGtkToolbar_style_set* = 0'i16 + bm_TGtkToolbar_icon_size_set* = 0x0002'i16 + bp_TGtkToolbar_icon_size_set* = 1'i16 + +proc TYPE_TOOLBAR*(): GType +proc TOOLBAR*(obj: pointer): PToolbar +proc TOOLBAR_CLASS*(klass: pointer): PToolbarClass +proc IS_TOOLBAR*(obj: pointer): bool +proc IS_TOOLBAR_CLASS*(klass: pointer): bool +proc TOOLBAR_GET_CLASS*(obj: pointer): PToolbarClass +proc style_set*(a: var TToolbar): guint +proc set_style_set*(a: var TToolbar, `style_set`: guint) +proc icon_size_set*(a: var TToolbar): guint +proc set_icon_size_set*(a: var TToolbar, `icon_size_set`: guint) +proc toolbar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_toolbar_get_type".} +proc toolbar_new*(): PToolbar{.cdecl, dynlib: lib, importc: "gtk_toolbar_new".} +proc toolbar_append_item*(toolbar: PToolbar, text: cstring, + tooltip_text: cstring, tooltip_private_text: cstring, + icon: PWidget, callback: TSignalFunc, + user_data: gpointer): PWidget{.cdecl, dynlib: lib, + importc: "gtk_toolbar_append_item".} +proc toolbar_prepend_item*(toolbar: PToolbar, text: cstring, + tooltip_text: cstring, tooltip_private_text: cstring, + icon: PWidget, callback: TSignalFunc, + user_data: gpointer): PWidget{.cdecl, dynlib: lib, + importc: "gtk_toolbar_prepend_item".} +proc toolbar_insert_item*(toolbar: PToolbar, text: cstring, + tooltip_text: cstring, tooltip_private_text: cstring, + icon: PWidget, callback: TSignalFunc, + user_data: gpointer, position: gint): PWidget{.cdecl, + dynlib: lib, importc: "gtk_toolbar_insert_item".} +proc toolbar_insert_stock*(toolbar: PToolbar, stock_id: cstring, + tooltip_text: cstring, tooltip_private_text: cstring, + callback: TSignalFunc, user_data: gpointer, + position: gint): PWidget{.cdecl, dynlib: lib, + importc: "gtk_toolbar_insert_stock".} +proc toolbar_append_space*(toolbar: PToolbar){.cdecl, dynlib: lib, + importc: "gtk_toolbar_append_space".} +proc toolbar_prepend_space*(toolbar: PToolbar){.cdecl, dynlib: lib, + importc: "gtk_toolbar_prepend_space".} +proc toolbar_insert_space*(toolbar: PToolbar, position: gint){.cdecl, + dynlib: lib, importc: "gtk_toolbar_insert_space".} +proc toolbar_remove_space*(toolbar: PToolbar, position: gint){.cdecl, + dynlib: lib, importc: "gtk_toolbar_remove_space".} +proc toolbar_append_element*(toolbar: PToolbar, thetype: TToolbarChildType, + widget: PWidget, text: cstring, + tooltip_text: cstring, + tooltip_private_text: cstring, icon: PWidget, + callback: TSignalFunc, user_data: gpointer): PWidget{. + cdecl, dynlib: lib, importc: "gtk_toolbar_append_element".} +proc toolbar_prepend_element*(toolbar: PToolbar, thetype: TToolbarChildType, + widget: PWidget, text: cstring, + tooltip_text: cstring, + tooltip_private_text: cstring, icon: PWidget, + callback: TSignalFunc, user_data: gpointer): PWidget{. + cdecl, dynlib: lib, importc: "gtk_toolbar_prepend_element".} +proc toolbar_insert_element*(toolbar: PToolbar, thetype: TToolbarChildType, + widget: PWidget, text: cstring, + tooltip_text: cstring, + tooltip_private_text: cstring, icon: PWidget, + callback: TSignalFunc, user_data: gpointer, + position: gint): PWidget{.cdecl, dynlib: lib, + importc: "gtk_toolbar_insert_element".} +proc toolbar_append_widget*(toolbar: PToolbar, widget: PWidget, + tooltip_text: cstring, tooltip_private_text: cstring){. + cdecl, dynlib: lib, importc: "gtk_toolbar_append_widget".} +proc toolbar_prepend_widget*(toolbar: PToolbar, widget: PWidget, + tooltip_text: cstring, + tooltip_private_text: cstring){.cdecl, dynlib: lib, + importc: "gtk_toolbar_prepend_widget".} +proc toolbar_insert_widget*(toolbar: PToolbar, widget: PWidget, + tooltip_text: cstring, + tooltip_private_text: cstring, position: gint){. + cdecl, dynlib: lib, importc: "gtk_toolbar_insert_widget".} +proc toolbar_set_orientation*(toolbar: PToolbar, orientation: TOrientation){. + cdecl, dynlib: lib, importc: "gtk_toolbar_set_orientation".} +proc toolbar_set_style*(toolbar: PToolbar, style: TToolbarStyle){.cdecl, + dynlib: lib, importc: "gtk_toolbar_set_style".} +proc toolbar_set_icon_size*(toolbar: PToolbar, icon_size: TIconSize){.cdecl, + dynlib: lib, importc: "gtk_toolbar_set_icon_size".} +proc toolbar_set_tooltips*(toolbar: PToolbar, enable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_toolbar_set_tooltips".} +proc toolbar_unset_style*(toolbar: PToolbar){.cdecl, dynlib: lib, + importc: "gtk_toolbar_unset_style".} +proc toolbar_unset_icon_size*(toolbar: PToolbar){.cdecl, dynlib: lib, + importc: "gtk_toolbar_unset_icon_size".} +proc toolbar_get_orientation*(toolbar: PToolbar): TOrientation{.cdecl, + dynlib: lib, importc: "gtk_toolbar_get_orientation".} +proc toolbar_get_style*(toolbar: PToolbar): TToolbarStyle{.cdecl, dynlib: lib, + importc: "gtk_toolbar_get_style".} +proc toolbar_get_icon_size*(toolbar: PToolbar): TIconSize{.cdecl, dynlib: lib, + importc: "gtk_toolbar_get_icon_size".} +proc toolbar_get_tooltips*(toolbar: PToolbar): gboolean{.cdecl, dynlib: lib, + importc: "gtk_toolbar_get_tooltips".} +const + bm_TGtkTree_selection_mode* = 0x0003'i16 + bp_TGtkTree_selection_mode* = 0'i16 + bm_TGtkTree_view_mode* = 0x0004'i16 + bp_TGtkTree_view_mode* = 2'i16 + bm_TGtkTree_view_line* = 0x0008'i16 + bp_TGtkTree_view_line* = 3'i16 + +proc TYPE_TREE*(): GType +proc TREE*(obj: pointer): PTree +proc TREE_CLASS*(klass: pointer): PTreeClass +proc IS_TREE*(obj: pointer): bool +proc IS_TREE_CLASS*(klass: pointer): bool +proc TREE_GET_CLASS*(obj: pointer): PTreeClass +proc IS_ROOT_TREE*(obj: pointer): bool +proc TREE_ROOT_TREE*(obj: pointer): PTree +proc TREE_SELECTION_OLD*(obj: pointer): PGList +proc selection_mode*(a: var TTree): guint +proc set_selection_mode*(a: var TTree, `selection_mode`: guint) +proc view_mode*(a: var TTree): guint +proc set_view_mode*(a: var TTree, `view_mode`: guint) +proc view_line*(a: var TTree): guint +proc set_view_line*(a: var TTree, `view_line`: guint) +proc tree_get_type*(): TType{.cdecl, dynlib: lib, importc: "gtk_tree_get_type".} +proc tree_new*(): PTree{.cdecl, dynlib: lib, importc: "gtk_tree_new".} +proc tree_append*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, + importc: "gtk_tree_append".} +proc tree_prepend*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, + importc: "gtk_tree_prepend".} +proc tree_insert*(tree: PTree, tree_item: PWidget, position: gint){.cdecl, + dynlib: lib, importc: "gtk_tree_insert".} +proc tree_remove_items*(tree: PTree, items: PGList){.cdecl, dynlib: lib, + importc: "gtk_tree_remove_items".} +proc tree_clear_items*(tree: PTree, start: gint, theEnd: gint){.cdecl, + dynlib: lib, importc: "gtk_tree_clear_items".} +proc tree_select_item*(tree: PTree, item: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_select_item".} +proc tree_unselect_item*(tree: PTree, item: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_unselect_item".} +proc tree_select_child*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, + importc: "gtk_tree_select_child".} +proc tree_unselect_child*(tree: PTree, tree_item: PWidget){.cdecl, dynlib: lib, + importc: "gtk_tree_unselect_child".} +proc tree_child_position*(tree: PTree, child: PWidget): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_child_position".} +proc tree_set_selection_mode*(tree: PTree, mode: TSelectionMode){.cdecl, + dynlib: lib, importc: "gtk_tree_set_selection_mode".} +proc tree_set_view_mode*(tree: PTree, mode: TTreeViewMode){.cdecl, dynlib: lib, + importc: "gtk_tree_set_view_mode".} +proc tree_set_view_lines*(tree: PTree, flag: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_set_view_lines".} +proc tree_remove_item*(tree: PTree, child: PWidget){.cdecl, dynlib: lib, + importc: "gtk_tree_remove_item".} +proc TYPE_TREE_DRAG_SOURCE*(): GType +proc TREE_DRAG_SOURCE*(obj: pointer): PTreeDragSource +proc IS_TREE_DRAG_SOURCE*(obj: pointer): bool +proc TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PTreeDragSourceIface +proc tree_drag_source_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_drag_source_get_type".} +proc tree_drag_source_row_draggable*(drag_source: PTreeDragSource, + path: PTreePath): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_drag_source_row_draggable".} +proc tree_drag_source_drag_data_delete*(drag_source: PTreeDragSource, + path: PTreePath): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_drag_source_drag_data_delete".} +proc tree_drag_source_drag_data_get*(drag_source: PTreeDragSource, + path: PTreePath, + selection_data: PSelectionData): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_drag_source_drag_data_get".} +proc TYPE_TREE_DRAG_DEST*(): GType +proc TREE_DRAG_DEST*(obj: pointer): PTreeDragDest +proc IS_TREE_DRAG_DEST*(obj: pointer): bool +proc TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PTreeDragDestIface +proc tree_drag_dest_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_tree_drag_dest_get_type".} +proc tree_drag_dest_drag_data_received*(drag_dest: PTreeDragDest, + dest: PTreePath, + selection_data: PSelectionData): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_drag_dest_drag_data_received".} +proc tree_drag_dest_row_drop_possible*(drag_dest: PTreeDragDest, + dest_path: PTreePath, + selection_data: PSelectionData): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_drag_dest_row_drop_possible".} +proc tree_set_row_drag_data*(selection_data: PSelectionData, + tree_model: PTreeModel, path: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_set_row_drag_data".} +const + bm_TGtkTreeItem_expanded* = 0x0001'i16 + bp_TGtkTreeItem_expanded* = 0'i16 + +proc TYPE_TREE_ITEM*(): GType +proc TREE_ITEM*(obj: pointer): PTreeItem +proc TREE_ITEM_CLASS*(klass: pointer): PTreeItemClass +proc IS_TREE_ITEM*(obj: pointer): bool +proc IS_TREE_ITEM_CLASS*(klass: pointer): bool +proc TREE_ITEM_GET_CLASS*(obj: pointer): PTreeItemClass +proc TREE_ITEM_SUBTREE*(obj: pointer): PWidget +proc expanded*(a: var TTreeItem): guint +proc set_expanded*(a: var TTreeItem, `expanded`: guint) +proc tree_item_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_item_get_type".} +proc tree_item_new*(): PTreeItem{.cdecl, dynlib: lib, + importc: "gtk_tree_item_new".} +proc tree_item_new_with_label*(`label`: cstring): PTreeItem{.cdecl, dynlib: lib, + importc: "gtk_tree_item_new_with_label".} +proc tree_item_set_subtree*(tree_item: PTreeItem, subtree: PWidget){.cdecl, + dynlib: lib, importc: "gtk_tree_item_set_subtree".} +proc tree_item_remove_subtree*(tree_item: PTreeItem){.cdecl, dynlib: lib, + importc: "gtk_tree_item_remove_subtree".} +proc tree_item_select*(tree_item: PTreeItem){.cdecl, dynlib: lib, + importc: "gtk_tree_item_select".} +proc tree_item_deselect*(tree_item: PTreeItem){.cdecl, dynlib: lib, + importc: "gtk_tree_item_deselect".} +proc tree_item_expand*(tree_item: PTreeItem){.cdecl, dynlib: lib, + importc: "gtk_tree_item_expand".} +proc tree_item_collapse*(tree_item: PTreeItem){.cdecl, dynlib: lib, + importc: "gtk_tree_item_collapse".} +proc TYPE_TREE_SELECTION*(): GType +proc TREE_SELECTION*(obj: pointer): PTreeSelection +proc TREE_SELECTION_CLASS*(klass: pointer): PTreeSelectionClass +proc IS_TREE_SELECTION*(obj: pointer): bool +proc IS_TREE_SELECTION_CLASS*(klass: pointer): bool +proc TREE_SELECTION_GET_CLASS*(obj: pointer): PTreeSelectionClass +proc tree_selection_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_selection_get_type".} +proc tree_selection_set_mode*(selection: PTreeSelection, thetype: TSelectionMode){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_set_mode".} +proc tree_selection_get_mode*(selection: PTreeSelection): TSelectionMode{.cdecl, + dynlib: lib, importc: "gtk_tree_selection_get_mode".} +proc tree_selection_set_select_function*(selection: PTreeSelection, + func_: TTreeSelectionFunc, data: gpointer, destroy: TDestroyNotify){.cdecl, + dynlib: lib, importc: "gtk_tree_selection_set_select_function".} +proc tree_selection_get_user_data*(selection: PTreeSelection): gpointer{.cdecl, + dynlib: lib, importc: "gtk_tree_selection_get_user_data".} +proc tree_selection_get_tree_view*(selection: PTreeSelection): PTreeView{.cdecl, + dynlib: lib, importc: "gtk_tree_selection_get_tree_view".} +proc tree_selection_get_selected*(selection: PTreeSelection, + model: PPGtkTreeModel, iter: PTreeIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_selection_get_selected".} +proc tree_selection_get_selected_rows*(selection: PTreeSelection, + model: PPGtkTreeModel): PGList{.cdecl, + dynlib: lib, importc: "gtk_tree_selection_get_selected_rows".} +proc tree_selection_selected_foreach*(selection: PTreeSelection, + func_: TTreeSelectionForeachFunc, + data: gpointer){.cdecl, dynlib: lib, + importc: "gtk_tree_selection_selected_foreach".} +proc tree_selection_select_path*(selection: PTreeSelection, path: PTreePath){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_select_path".} +proc tree_selection_unselect_path*(selection: PTreeSelection, path: PTreePath){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_unselect_path".} +proc tree_selection_select_iter*(selection: PTreeSelection, iter: PTreeIter){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_select_iter".} +proc tree_selection_unselect_iter*(selection: PTreeSelection, iter: PTreeIter){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_unselect_iter".} +proc tree_selection_path_is_selected*(selection: PTreeSelection, path: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_selection_path_is_selected".} +proc tree_selection_iter_is_selected*(selection: PTreeSelection, iter: PTreeIter): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_selection_iter_is_selected".} +proc tree_selection_select_all*(selection: PTreeSelection){.cdecl, dynlib: lib, + importc: "gtk_tree_selection_select_all".} +proc tree_selection_unselect_all*(selection: PTreeSelection){.cdecl, + dynlib: lib, importc: "gtk_tree_selection_unselect_all".} +proc tree_selection_select_range*(selection: PTreeSelection, + start_path: PTreePath, end_path: PTreePath){. + cdecl, dynlib: lib, importc: "gtk_tree_selection_select_range".} +const + bm_TGtkTreeStore_columns_dirty* = 0x0001'i16 + bp_TGtkTreeStore_columns_dirty* = 0'i16 + +proc TYPE_TREE_STORE*(): GType +proc TREE_STORE*(obj: pointer): PTreeStore +proc TREE_STORE_CLASS*(klass: pointer): PTreeStoreClass +proc IS_TREE_STORE*(obj: pointer): bool +proc IS_TREE_STORE_CLASS*(klass: pointer): bool +proc TREE_STORE_GET_CLASS*(obj: pointer): PTreeStoreClass +proc columns_dirty*(a: var TTreeStore): guint +proc set_columns_dirty*(a: var TTreeStore, `columns_dirty`: guint) +proc tree_store_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_store_get_type".} +proc tree_store_newv*(n_columns: gint, types: PGType): PTreeStore{.cdecl, + dynlib: lib, importc: "gtk_tree_store_newv".} +proc tree_store_set_column_types*(tree_store: PTreeStore, n_columns: gint, + types: PGType){.cdecl, dynlib: lib, + importc: "gtk_tree_store_set_column_types".} +proc tree_store_set_value*(tree_store: PTreeStore, iter: PTreeIter, + column: gint, value: PGValue){.cdecl, dynlib: lib, + importc: "gtk_tree_store_set_value".} +proc tree_store_remove*(tree_store: PTreeStore, iter: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_tree_store_remove".} +proc tree_store_insert*(tree_store: PTreeStore, iter: PTreeIter, + parent: PTreeIter, position: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_store_insert".} +proc tree_store_insert_before*(tree_store: PTreeStore, iter: PTreeIter, + parent: PTreeIter, sibling: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_tree_store_insert_before".} +proc tree_store_insert_after*(tree_store: PTreeStore, iter: PTreeIter, + parent: PTreeIter, sibling: PTreeIter){.cdecl, + dynlib: lib, importc: "gtk_tree_store_insert_after".} +proc tree_store_prepend*(tree_store: PTreeStore, iter: PTreeIter, + parent: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_store_prepend".} +proc tree_store_append*(tree_store: PTreeStore, iter: PTreeIter, + parent: PTreeIter){.cdecl, dynlib: lib, + importc: "gtk_tree_store_append".} +proc tree_store_is_ancestor*(tree_store: PTreeStore, iter: PTreeIter, + descendant: PTreeIter): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_store_is_ancestor".} +proc tree_store_iter_depth*(tree_store: PTreeStore, iter: PTreeIter): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_store_iter_depth".} +proc tree_store_clear*(tree_store: PTreeStore){.cdecl, dynlib: lib, + importc: "gtk_tree_store_clear".} +const + bm_TGtkTreeViewColumn_visible* = 0x0001'i16 + bp_TGtkTreeViewColumn_visible* = 0'i16 + bm_TGtkTreeViewColumn_resizable* = 0x0002'i16 + bp_TGtkTreeViewColumn_resizable* = 1'i16 + bm_TGtkTreeViewColumn_clickable* = 0x0004'i16 + bp_TGtkTreeViewColumn_clickable* = 2'i16 + bm_TGtkTreeViewColumn_dirty* = 0x0008'i16 + bp_TGtkTreeViewColumn_dirty* = 3'i16 + bm_TGtkTreeViewColumn_show_sort_indicator* = 0x0010'i16 + bp_TGtkTreeViewColumn_show_sort_indicator* = 4'i16 + bm_TGtkTreeViewColumn_maybe_reordered* = 0x0020'i16 + bp_TGtkTreeViewColumn_maybe_reordered* = 5'i16 + bm_TGtkTreeViewColumn_reorderable* = 0x0040'i16 + bp_TGtkTreeViewColumn_reorderable* = 6'i16 + bm_TGtkTreeViewColumn_use_resized_width* = 0x0080'i16 + bp_TGtkTreeViewColumn_use_resized_width* = 7'i16 + +proc TYPE_TREE_VIEW_COLUMN*(): GType +proc TREE_VIEW_COLUMN*(obj: pointer): PTreeViewColumn +proc TREE_VIEW_COLUMN_CLASS*(klass: pointer): PTreeViewColumnClass +proc IS_TREE_VIEW_COLUMN*(obj: pointer): bool +proc IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool +proc TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PTreeViewColumnClass +proc visible*(a: var TTreeViewColumn): guint +proc set_visible*(a: var TTreeViewColumn, `visible`: guint) +proc resizable*(a: var TTreeViewColumn): guint +proc set_resizable*(a: var TTreeViewColumn, `resizable`: guint) +proc clickable*(a: var TTreeViewColumn): guint +proc set_clickable*(a: var TTreeViewColumn, `clickable`: guint) +proc dirty*(a: var TTreeViewColumn): guint +proc set_dirty*(a: var TTreeViewColumn, `dirty`: guint) +proc show_sort_indicator*(a: var TTreeViewColumn): guint +proc set_show_sort_indicator*(a: var TTreeViewColumn, + `show_sort_indicator`: guint) +proc maybe_reordered*(a: var TTreeViewColumn): guint +proc set_maybe_reordered*(a: var TTreeViewColumn, `maybe_reordered`: guint) +proc reorderable*(a: var TTreeViewColumn): guint +proc set_reorderable*(a: var TTreeViewColumn, `reorderable`: guint) +proc use_resized_width*(a: var TTreeViewColumn): guint +proc set_use_resized_width*(a: var TTreeViewColumn, `use_resized_width`: guint) +proc tree_view_column_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_get_type".} +proc tree_view_column_new*(): PTreeViewColumn{.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_new".} +proc tree_view_column_pack_start*(tree_column: PTreeViewColumn, + cell: PCellRenderer, expand: gboolean){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_pack_start".} +proc tree_view_column_pack_end*(tree_column: PTreeViewColumn, + cell: PCellRenderer, expand: gboolean){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_pack_end".} +proc tree_view_column_clear*(tree_column: PTreeViewColumn){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_clear".} +proc tree_view_column_get_cell_renderers*(tree_column: PTreeViewColumn): PGList{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_cell_renderers".} +proc tree_view_column_add_attribute*(tree_column: PTreeViewColumn, + cell_renderer: PCellRenderer, + attribute: cstring, column: gint){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_add_attribute".} +proc tree_view_column_set_cell_data_func*(tree_column: PTreeViewColumn, + cell_renderer: PCellRenderer, func_: TTreeCellDataFunc, func_data: gpointer, + destroy: TDestroyNotify){.cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_cell_data_func".} +proc tree_view_column_clear_attributes*(tree_column: PTreeViewColumn, + cell_renderer: PCellRenderer){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_clear_attributes".} +proc tree_view_column_set_spacing*(tree_column: PTreeViewColumn, spacing: gint){. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_spacing".} +proc tree_view_column_get_spacing*(tree_column: PTreeViewColumn): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_spacing".} +proc tree_view_column_set_visible*(tree_column: PTreeViewColumn, + visible: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_visible".} +proc tree_view_column_get_visible*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_visible".} +proc tree_view_column_set_resizable*(tree_column: PTreeViewColumn, + resizable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_resizable".} +proc tree_view_column_get_resizable*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_resizable".} +proc tree_view_column_set_sizing*(tree_column: PTreeViewColumn, + thetype: TTreeViewColumnSizing){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_set_sizing".} +proc tree_view_column_get_sizing*(tree_column: PTreeViewColumn): TTreeViewColumnSizing{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sizing".} +proc tree_view_column_get_width*(tree_column: PTreeViewColumn): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_width".} +proc tree_view_column_get_fixed_width*(tree_column: PTreeViewColumn): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_fixed_width".} +proc tree_view_column_set_fixed_width*(tree_column: PTreeViewColumn, + fixed_width: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_fixed_width".} +proc tree_view_column_set_min_width*(tree_column: PTreeViewColumn, + min_width: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_min_width".} +proc tree_view_column_get_min_width*(tree_column: PTreeViewColumn): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_min_width".} +proc tree_view_column_set_max_width*(tree_column: PTreeViewColumn, + max_width: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_max_width".} +proc tree_view_column_get_max_width*(tree_column: PTreeViewColumn): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_max_width".} +proc tree_view_column_clicked*(tree_column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_clicked".} +proc tree_view_column_set_title*(tree_column: PTreeViewColumn, title: cstring){. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_title".} +proc tree_view_column_get_title*(tree_column: PTreeViewColumn): cstring{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_title".} +proc tree_view_column_set_clickable*(tree_column: PTreeViewColumn, + clickable: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_clickable".} +proc tree_view_column_get_clickable*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_clickable".} +proc tree_view_column_set_widget*(tree_column: PTreeViewColumn, widget: PWidget){. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_widget".} +proc tree_view_column_get_widget*(tree_column: PTreeViewColumn): PWidget{.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_get_widget".} +proc tree_view_column_set_alignment*(tree_column: PTreeViewColumn, + xalign: gfloat){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_alignment".} +proc tree_view_column_get_alignment*(tree_column: PTreeViewColumn): gfloat{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_alignment".} +proc tree_view_column_set_reorderable*(tree_column: PTreeViewColumn, + reorderable: gboolean){.cdecl, + dynlib: lib, importc: "gtk_tree_view_column_set_reorderable".} +proc tree_view_column_get_reorderable*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_reorderable".} +proc tree_view_column_set_sort_column_id*(tree_column: PTreeViewColumn, + sort_column_id: gint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_sort_column_id".} +proc tree_view_column_get_sort_column_id*(tree_column: PTreeViewColumn): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_column_id".} +proc tree_view_column_set_sort_indicator*(tree_column: PTreeViewColumn, + setting: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_sort_indicator".} +proc tree_view_column_get_sort_indicator*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_indicator".} +proc tree_view_column_set_sort_order*(tree_column: PTreeViewColumn, + order: TSortType){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_set_sort_order".} +proc tree_view_column_get_sort_order*(tree_column: PTreeViewColumn): TSortType{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_sort_order".} +proc tree_view_column_cell_set_cell_data*(tree_column: PTreeViewColumn, + tree_model: PTreeModel, iter: PTreeIter, is_expander: gboolean, + is_expanded: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_cell_set_cell_data".} +proc tree_view_column_cell_get_size*(tree_column: PTreeViewColumn, + cell_area: PGdkRectangle, x_offset: Pgint, + y_offset: Pgint, width: Pgint, + height: Pgint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_cell_get_size".} +proc tree_view_column_cell_is_visible*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_cell_is_visible".} +proc tree_view_column_focus_cell*(tree_column: PTreeViewColumn, + cell: PCellRenderer){.cdecl, dynlib: lib, + importc: "gtk_tree_view_column_focus_cell".} +proc tree_view_column_set_expand*(tree_column: PTreeViewColumn, Expand: gboolean){. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_set_expand".} +proc tree_view_column_get_expand*(tree_column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_column_get_expand".} +const + RBNODE_BLACK* = 1 shl 0 + RBNODE_RED* = 1 shl 1 + RBNODE_IS_PARENT* = 1 shl 2 + RBNODE_IS_SELECTED* = 1 shl 3 + RBNODE_IS_PRELIT* = 1 shl 4 + RBNODE_IS_SEMI_COLLAPSED* = 1 shl 5 + RBNODE_IS_SEMI_EXPANDED* = 1 shl 6 + RBNODE_INVALID* = 1 shl 7 + RBNODE_COLUMN_INVALID* = 1 shl 8 + RBNODE_DESCENDANTS_INVALID* = 1 shl 9 + RBNODE_NON_COLORS* = RBNODE_IS_PARENT or RBNODE_IS_SELECTED or + RBNODE_IS_PRELIT or RBNODE_IS_SEMI_COLLAPSED or RBNODE_IS_SEMI_EXPANDED or + RBNODE_INVALID or RBNODE_COLUMN_INVALID or RBNODE_DESCENDANTS_INVALID + +const + bm_TGtkRBNode_flags* = 0x3FFF'i16 + bp_TGtkRBNode_flags* = 0'i16 + bm_TGtkRBNode_parity* = 0x4000'i16 + bp_TGtkRBNode_parity* = 14'i16 + +proc flags*(a: PRBNode): guint +proc set_flags*(a: PRBNode, `flags`: guint) +proc parity*(a: PRBNode): guint +proc set_parity*(a: PRBNode, `parity`: guint) +proc RBNODE_GET_COLOR*(node_: PRBNode): guint +proc RBNODE_SET_COLOR*(node_: PRBNode, color: guint) +proc RBNODE_GET_HEIGHT*(node_: PRBNode): gint +proc RBNODE_SET_FLAG*(node_: PRBNode, flag: guint16) +proc RBNODE_UNSET_FLAG*(node_: PRBNode, flag: guint16) +proc RBNODE_FLAG_SET*(node_: PRBNode, flag: guint): bool +proc rbtree_push_allocator*(allocator: PGAllocator){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_push_allocator".} +proc rbtree_pop_allocator*(){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_pop_allocator".} +proc rbtree_new*(): PRBTree{.cdecl, dynlib: lib, importc: "_gtk_rbtree_new".} +proc rbtree_free*(tree: PRBTree){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_free".} +proc rbtree_remove*(tree: PRBTree){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_remove".} +proc rbtree_destroy*(tree: PRBTree){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_destroy".} +proc rbtree_insert_before*(tree: PRBTree, node_: PRBNode, height: gint, + valid: gboolean): PRBNode{.cdecl, dynlib: lib, + importc: "_gtk_rbtree_insert_before".} +proc rbtree_insert_after*(tree: PRBTree, node_: PRBNode, height: gint, + valid: gboolean): PRBNode{.cdecl, dynlib: lib, + importc: "_gtk_rbtree_insert_after".} +proc rbtree_remove_node*(tree: PRBTree, node_: PRBNode){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_remove_node".} +proc rbtree_reorder*(tree: PRBTree, new_order: Pgint, length: gint){.cdecl, + dynlib: lib, importc: "_gtk_rbtree_reorder".} +proc rbtree_find_count*(tree: PRBTree, count: gint): PRBNode{.cdecl, + dynlib: lib, importc: "_gtk_rbtree_find_count".} +proc rbtree_node_set_height*(tree: PRBTree, node_: PRBNode, height: gint){. + cdecl, dynlib: lib, importc: "_gtk_rbtree_node_set_height".} +proc rbtree_node_mark_invalid*(tree: PRBTree, node_: PRBNode){.cdecl, + dynlib: lib, importc: "_gtk_rbtree_node_mark_invalid".} +proc rbtree_node_mark_valid*(tree: PRBTree, node_: PRBNode){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_node_mark_valid".} +proc rbtree_column_invalid*(tree: PRBTree){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_column_invalid".} +proc rbtree_mark_invalid*(tree: PRBTree){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_mark_invalid".} +proc rbtree_set_fixed_height*(tree: PRBTree, height: gint){.cdecl, dynlib: lib, + importc: "_gtk_rbtree_set_fixed_height".} +proc rbtree_node_find_offset*(tree: PRBTree, node_: PRBNode): gint{.cdecl, + dynlib: lib, importc: "_gtk_rbtree_node_find_offset".} +proc rbtree_node_find_parity*(tree: PRBTree, node_: PRBNode): gint{.cdecl, + dynlib: lib, importc: "_gtk_rbtree_node_find_parity".} +proc rbtree_traverse*(tree: PRBTree, node_: PRBNode, order: TGTraverseType, + func_: TRBTreeTraverseFunc, data: gpointer){.cdecl, + dynlib: lib, importc: "_gtk_rbtree_traverse".} +proc rbtree_next*(tree: PRBTree, node_: PRBNode): PRBNode{.cdecl, dynlib: lib, + importc: "_gtk_rbtree_next".} +proc rbtree_prev*(tree: PRBTree, node_: PRBNode): PRBNode{.cdecl, dynlib: lib, + importc: "_gtk_rbtree_prev".} +proc rbtree_get_depth*(tree: PRBTree): gint{.cdecl, dynlib: lib, + importc: "_gtk_rbtree_get_depth".} +const + TREE_VIEW_DRAG_WIDTH* = 6 + TREE_VIEW_IS_LIST* = 1 shl 0 + TREE_VIEW_SHOW_EXPANDERS* = 1 shl 1 + TREE_VIEW_IN_COLUMN_RESIZE* = 1 shl 2 + TREE_VIEW_ARROW_PRELIT* = 1 shl 3 + TREE_VIEW_HEADERS_VISIBLE* = 1 shl 4 + TREE_VIEW_DRAW_KEYFOCUS* = 1 shl 5 + TREE_VIEW_MODEL_SETUP* = 1 shl 6 + TREE_VIEW_IN_COLUMN_DRAG* = 1 shl 7 + DRAG_COLUMN_WINDOW_STATE_UNSET* = 0 + DRAG_COLUMN_WINDOW_STATE_ORIGINAL* = 1 + DRAG_COLUMN_WINDOW_STATE_ARROW* = 2 + DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT* = 3 + DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT* = 4 + +proc TREE_VIEW_SET_FLAG*(tree_view: PTreeView, flag: guint) +proc TREE_VIEW_UNSET_FLAG*(tree_view: PTreeView, flag: guint) +proc TREE_VIEW_FLAG_SET*(tree_view: PTreeView, flag: guint): bool +proc TREE_VIEW_HEADER_HEIGHT*(tree_view: PTreeView): int32 +proc TREE_VIEW_COLUMN_REQUESTED_WIDTH*(column: PTreeViewColumn): int32 +proc TREE_VIEW_DRAW_EXPANDERS*(tree_view: PTreeView): bool +proc TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PTreeView): int32 +const + bm_TGtkTreeViewPrivate_scroll_to_use_align* = 0x0001'i16 + bp_TGtkTreeViewPrivate_scroll_to_use_align* = 0'i16 + bm_TGtkTreeViewPrivate_fixed_height_check* = 0x0002'i16 + bp_TGtkTreeViewPrivate_fixed_height_check* = 1'i16 + bm_TGtkTreeViewPrivate_reorderable* = 0x0004'i16 + bp_TGtkTreeViewPrivate_reorderable* = 2'i16 + bm_TGtkTreeViewPrivate_header_has_focus* = 0x0008'i16 + bp_TGtkTreeViewPrivate_header_has_focus* = 3'i16 + bm_TGtkTreeViewPrivate_drag_column_window_state* = 0x0070'i16 + bp_TGtkTreeViewPrivate_drag_column_window_state* = 4'i16 + bm_TGtkTreeViewPrivate_has_rules* = 0x0080'i16 + bp_TGtkTreeViewPrivate_has_rules* = 7'i16 + bm_TGtkTreeViewPrivate_mark_rows_col_dirty* = 0x0100'i16 + bp_TGtkTreeViewPrivate_mark_rows_col_dirty* = 8'i16 + bm_TGtkTreeViewPrivate_enable_search* = 0x0200'i16 + bp_TGtkTreeViewPrivate_enable_search* = 9'i16 + bm_TGtkTreeViewPrivate_disable_popdown* = 0x0400'i16 + bp_TGtkTreeViewPrivate_disable_popdown* = 10'i16 + +proc scroll_to_use_align*(a: var TTreeViewPrivate): guint +proc set_scroll_to_use_align*(a: var TTreeViewPrivate, + `scroll_to_use_align`: guint) +proc fixed_height_check*(a: var TTreeViewPrivate): guint +proc set_fixed_height_check*(a: var TTreeViewPrivate, + `fixed_height_check`: guint) +proc reorderable*(a: var TTreeViewPrivate): guint +proc set_reorderable*(a: var TTreeViewPrivate, `reorderable`: guint) +proc header_has_focus*(a: var TTreeViewPrivate): guint +proc set_header_has_focus*(a: var TTreeViewPrivate, `header_has_focus`: guint) +proc drag_column_window_state*(a: var TTreeViewPrivate): guint +proc set_drag_column_window_state*(a: var TTreeViewPrivate, + `drag_column_window_state`: guint) +proc has_rules*(a: var TTreeViewPrivate): guint +proc set_has_rules*(a: var TTreeViewPrivate, `has_rules`: guint) +proc mark_rows_col_dirty*(a: var TTreeViewPrivate): guint +proc set_mark_rows_col_dirty*(a: var TTreeViewPrivate, + `mark_rows_col_dirty`: guint) +proc enable_search*(a: var TTreeViewPrivate): guint +proc set_enable_search*(a: var TTreeViewPrivate, `enable_search`: guint) +proc disable_popdown*(a: var TTreeViewPrivate): guint +proc set_disable_popdown*(a: var TTreeViewPrivate, `disable_popdown`: guint) +proc tree_selection_internal_select_node*(selection: PTreeSelection, + node_: PRBNode, tree: PRBTree, path: PTreePath, state: TGdkModifierType, + override_browse_mode: gboolean){.cdecl, dynlib: lib, importc: "_gtk_tree_selection_internal_select_node".} +proc tree_view_find_node*(tree_view: PTreeView, path: PTreePath, + tree: var PRBTree, node_: var PRBNode): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_find_node".} +proc tree_view_find_path*(tree_view: PTreeView, tree: PRBTree, node_: PRBNode): PTreePath{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_find_path".} +proc tree_view_child_move_resize*(tree_view: PTreeView, widget: PWidget, + x: gint, y: gint, width: gint, height: gint){. + cdecl, dynlib: lib, importc: "_gtk_tree_view_child_move_resize".} +proc tree_view_queue_draw_node*(tree_view: PTreeView, tree: PRBTree, + node_: PRBNode, clip_rect: PGdkRectangle){. + cdecl, dynlib: lib, importc: "_gtk_tree_view_queue_draw_node".} +proc tree_view_column_realize_button*(column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_realize_button".} +proc tree_view_column_unrealize_button*(column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_unrealize_button".} +proc tree_view_column_set_tree_view*(column: PTreeViewColumn, + tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "_gtk_tree_view_column_set_tree_view".} +proc tree_view_column_unset_tree_view*(column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_unset_tree_view".} +proc tree_view_column_set_width*(column: PTreeViewColumn, width: gint){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_set_width".} +proc tree_view_column_start_drag*(tree_view: PTreeView, column: PTreeViewColumn){. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_start_drag".} +proc tree_view_column_start_editing*(tree_column: PTreeViewColumn, + editable_widget: PCellEditable){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_start_editing".} +proc tree_view_column_stop_editing*(tree_column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_stop_editing".} +proc tree_view_install_mark_rows_col_dirty*(tree_view: PTreeView){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_install_mark_rows_col_dirty".} +proc DOgtk_tree_view_column_autosize*(tree_view: PTreeView, + column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_autosize".} +proc tree_view_column_has_editable_cell*(column: PTreeViewColumn): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_has_editable_cell".} +proc tree_view_column_get_edited_cell*(column: PTreeViewColumn): PCellRenderer{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_get_edited_cell".} +proc tree_view_column_count_special_cells*(column: PTreeViewColumn): gint{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_count_special_cells".} +proc tree_view_column_get_cell_at_pos*(column: PTreeViewColumn, x: gint): PCellRenderer{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_get_cell_at_pos".} +proc tree_selection_new*(): PTreeSelection{.cdecl, dynlib: lib, + importc: "_gtk_tree_selection_new".} +proc tree_selection_new_with_tree_view*(tree_view: PTreeView): PTreeSelection{. + cdecl, dynlib: lib, importc: "_gtk_tree_selection_new_with_tree_view".} +proc tree_selection_set_tree_view*(selection: PTreeSelection, + tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "_gtk_tree_selection_set_tree_view".} +proc tree_view_column_cell_render*(tree_column: PTreeViewColumn, + window: PGdkWindow, + background_area: PGdkRectangle, + cell_area: PGdkRectangle, + expose_area: PGdkRectangle, flags: guint){. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_render".} +proc tree_view_column_cell_focus*(tree_column: PTreeViewColumn, direction: gint, + left: gboolean, right: gboolean): gboolean{. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_focus".} +proc tree_view_column_cell_draw_focus*(tree_column: PTreeViewColumn, + window: PGdkWindow, + background_area: PGdkRectangle, + cell_area: PGdkRectangle, + expose_area: PGdkRectangle, flags: guint){. + cdecl, dynlib: lib, importc: "_gtk_tree_view_column_cell_draw_focus".} +proc tree_view_column_cell_set_dirty*(tree_column: PTreeViewColumn, + install_handler: gboolean){.cdecl, + dynlib: lib, importc: "_gtk_tree_view_column_cell_set_dirty".} +proc tree_view_column_get_neighbor_sizes*(column: PTreeViewColumn, + cell: PCellRenderer, left: Pgint, right: Pgint){.cdecl, dynlib: lib, + importc: "_gtk_tree_view_column_get_neighbor_sizes".} +proc TYPE_TREE_VIEW*(): GType +proc TREE_VIEW*(obj: pointer): PTreeView +proc TREE_VIEW_CLASS*(klass: pointer): PTreeViewClass +proc IS_TREE_VIEW*(obj: pointer): bool +proc IS_TREE_VIEW_CLASS*(klass: pointer): bool +proc TREE_VIEW_GET_CLASS*(obj: pointer): PTreeViewClass +proc tree_view_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_tree_view_get_type".} +proc tree_view_new*(): PTreeView{.cdecl, dynlib: lib, + importc: "gtk_tree_view_new".} +proc tree_view_new_with_model*(model: PTreeModel): PTreeView{.cdecl, + dynlib: lib, importc: "gtk_tree_view_new_with_model".} +proc tree_view_get_model*(tree_view: PTreeView): PTreeModel{.cdecl, dynlib: lib, + importc: "gtk_tree_view_get_model".} +proc tree_view_set_model*(tree_view: PTreeView, model: PTreeModel){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_model".} +proc tree_view_get_selection*(tree_view: PTreeView): PTreeSelection{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_selection".} +proc tree_view_get_hadjustment*(tree_view: PTreeView): PAdjustment{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_hadjustment".} +proc tree_view_set_hadjustment*(tree_view: PTreeView, adjustment: PAdjustment){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_hadjustment".} +proc tree_view_get_vadjustment*(tree_view: PTreeView): PAdjustment{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_vadjustment".} +proc tree_view_set_vadjustment*(tree_view: PTreeView, adjustment: PAdjustment){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_vadjustment".} +proc tree_view_get_headers_visible*(tree_view: PTreeView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_headers_visible".} +proc tree_view_set_headers_visible*(tree_view: PTreeView, + headers_visible: gboolean){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_headers_visible".} +proc tree_view_columns_autosize*(tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "gtk_tree_view_columns_autosize".} +proc tree_view_set_headers_clickable*(tree_view: PTreeView, setting: gboolean){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_headers_clickable".} +proc tree_view_set_rules_hint*(tree_view: PTreeView, setting: gboolean){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_rules_hint".} +proc tree_view_get_rules_hint*(tree_view: PTreeView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_rules_hint".} +proc tree_view_append_column*(tree_view: PTreeView, column: PTreeViewColumn): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_view_append_column".} +proc tree_view_remove_column*(tree_view: PTreeView, column: PTreeViewColumn): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_view_remove_column".} +proc tree_view_insert_column*(tree_view: PTreeView, column: PTreeViewColumn, + position: gint): gint{.cdecl, dynlib: lib, + importc: "gtk_tree_view_insert_column".} +proc tree_view_insert_column_with_data_func*(tree_view: PTreeView, + position: gint, title: cstring, cell: PCellRenderer, + func_: TTreeCellDataFunc, data: gpointer, dnotify: TGDestroyNotify): gint{. + cdecl, dynlib: lib, importc: "gtk_tree_view_insert_column_with_data_func".} +proc tree_view_get_column*(tree_view: PTreeView, n: gint): PTreeViewColumn{. + cdecl, dynlib: lib, importc: "gtk_tree_view_get_column".} +proc tree_view_get_columns*(tree_view: PTreeView): PGList{.cdecl, dynlib: lib, + importc: "gtk_tree_view_get_columns".} +proc tree_view_move_column_after*(tree_view: PTreeView, column: PTreeViewColumn, + base_column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "gtk_tree_view_move_column_after".} +proc tree_view_set_expander_column*(tree_view: PTreeView, + column: PTreeViewColumn){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_expander_column".} +proc tree_view_get_expander_column*(tree_view: PTreeView): PTreeViewColumn{. + cdecl, dynlib: lib, importc: "gtk_tree_view_get_expander_column".} +proc tree_view_set_column_drag_function*(tree_view: PTreeView, + func_: TTreeViewColumnDropFunc, user_data: gpointer, destroy: TDestroyNotify){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_column_drag_function".} +proc tree_view_scroll_to_point*(tree_view: PTreeView, tree_x: gint, tree_y: gint){. + cdecl, dynlib: lib, importc: "gtk_tree_view_scroll_to_point".} +proc tree_view_scroll_to_cell*(tree_view: PTreeView, path: PTreePath, + column: PTreeViewColumn, use_align: gboolean, + row_align: gfloat, col_align: gfloat){.cdecl, + dynlib: lib, importc: "gtk_tree_view_scroll_to_cell".} +proc tree_view_row_activated*(tree_view: PTreeView, path: PTreePath, + column: PTreeViewColumn){.cdecl, dynlib: lib, + importc: "gtk_tree_view_row_activated".} +proc tree_view_expand_all*(tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "gtk_tree_view_expand_all".} +proc tree_view_collapse_all*(tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "gtk_tree_view_collapse_all".} +proc tree_view_expand_row*(tree_view: PTreeView, path: PTreePath, + open_all: gboolean): gboolean{.cdecl, dynlib: lib, + importc: "gtk_tree_view_expand_row".} +proc tree_view_collapse_row*(tree_view: PTreeView, path: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_collapse_row".} +proc tree_view_map_expanded_rows*(tree_view: PTreeView, + func_: TTreeViewMappingFunc, data: gpointer){. + cdecl, dynlib: lib, importc: "gtk_tree_view_map_expanded_rows".} +proc tree_view_row_expanded*(tree_view: PTreeView, path: PTreePath): gboolean{. + cdecl, dynlib: lib, importc: "gtk_tree_view_row_expanded".} +proc tree_view_set_reorderable*(tree_view: PTreeView, reorderable: gboolean){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_reorderable".} +proc tree_view_get_reorderable*(tree_view: PTreeView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_reorderable".} +proc tree_view_set_cursor*(tree_view: PTreeView, path: PTreePath, + focus_column: PTreeViewColumn, + start_editing: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_set_cursor".} +proc tree_view_set_cursor_on_cell*(tree_view: PTreeView, path: PTreePath, + focus_column: PTreeViewColumn, + focus_cell: PCellRenderer, + start_editing: gboolean){.cdecl, dynlib: lib, + importc: "gtk_tree_view_set_cursor_on_cell".} +proc tree_view_get_bin_window*(tree_view: PTreeView): PGdkWindow{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_bin_window".} +proc tree_view_get_cell_area*(tree_view: PTreeView, path: PTreePath, + column: PTreeViewColumn, rect: PGdkRectangle){. + cdecl, dynlib: lib, importc: "gtk_tree_view_get_cell_area".} +proc tree_view_get_background_area*(tree_view: PTreeView, path: PTreePath, + column: PTreeViewColumn, rect: PGdkRectangle){. + cdecl, dynlib: lib, importc: "gtk_tree_view_get_background_area".} +proc tree_view_get_visible_rect*(tree_view: PTreeView, + visible_rect: PGdkRectangle){.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_visible_rect".} +proc tree_view_widget_to_tree_coords*(tree_view: PTreeView, wx: gint, wy: gint, + tx: Pgint, ty: Pgint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_widget_to_tree_coords".} +proc tree_view_tree_to_widget_coords*(tree_view: PTreeView, tx: gint, ty: gint, + wx: Pgint, wy: Pgint){.cdecl, dynlib: lib, + importc: "gtk_tree_view_tree_to_widget_coords".} +proc tree_view_enable_model_drag_source*(tree_view: PTreeView, + start_button_mask: TGdkModifierType, targets: PTargetEntry, n_targets: gint, + actions: TGdkDragAction){.cdecl, dynlib: lib, + importc: "gtk_tree_view_enable_model_drag_source".} +proc tree_view_enable_model_drag_dest*(tree_view: PTreeView, + targets: PTargetEntry, n_targets: gint, + actions: TGdkDragAction){.cdecl, + dynlib: lib, importc: "gtk_tree_view_enable_model_drag_dest".} +proc tree_view_unset_rows_drag_source*(tree_view: PTreeView){.cdecl, + dynlib: lib, importc: "gtk_tree_view_unset_rows_drag_source".} +proc tree_view_unset_rows_drag_dest*(tree_view: PTreeView){.cdecl, dynlib: lib, + importc: "gtk_tree_view_unset_rows_drag_dest".} +proc tree_view_set_drag_dest_row*(tree_view: PTreeView, path: PTreePath, + pos: TTreeViewDropPosition){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_drag_dest_row".} +proc tree_view_create_row_drag_icon*(tree_view: PTreeView, path: PTreePath): PGdkPixmap{. + cdecl, dynlib: lib, importc: "gtk_tree_view_create_row_drag_icon".} +proc tree_view_set_enable_search*(tree_view: PTreeView, enable_search: gboolean){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_enable_search".} +proc tree_view_get_enable_search*(tree_view: PTreeView): gboolean{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_enable_search".} +proc tree_view_get_search_column*(tree_view: PTreeView): gint{.cdecl, + dynlib: lib, importc: "gtk_tree_view_get_search_column".} +proc tree_view_set_search_column*(tree_view: PTreeView, column: gint){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_search_column".} +proc tree_view_get_search_equal_func*(tree_view: PTreeView): TTreeViewSearchEqualFunc{. + cdecl, dynlib: lib, importc: "gtk_tree_view_get_search_equal_func".} +proc tree_view_set_search_equal_func*(tree_view: PTreeView, search_equal_func: TTreeViewSearchEqualFunc, + search_user_data: gpointer, + search_destroy: TDestroyNotify){.cdecl, + dynlib: lib, importc: "gtk_tree_view_set_search_equal_func".} +proc tree_view_set_destroy_count_func*(tree_view: PTreeView, + func_: TTreeDestroyCountFunc, + data: gpointer, destroy: TDestroyNotify){. + cdecl, dynlib: lib, importc: "gtk_tree_view_set_destroy_count_func".} +proc TYPE_VBUTTON_BOX*(): GType +proc VBUTTON_BOX*(obj: pointer): PVButtonBox +proc VBUTTON_BOX_CLASS*(klass: pointer): PVButtonBoxClass +proc IS_VBUTTON_BOX*(obj: pointer): bool +proc IS_VBUTTON_BOX_CLASS*(klass: pointer): bool +proc VBUTTON_BOX_GET_CLASS*(obj: pointer): PVButtonBoxClass +proc vbutton_box_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vbutton_box_get_type".} +proc vbutton_box_new*(): PVButtonBox{.cdecl, dynlib: lib, + importc: "gtk_vbutton_box_new".} +proc TYPE_VIEWPORT*(): GType +proc VIEWPORT*(obj: pointer): PViewport +proc VIEWPORT_CLASS*(klass: pointer): PViewportClass +proc IS_VIEWPORT*(obj: pointer): bool +proc IS_VIEWPORT_CLASS*(klass: pointer): bool +proc VIEWPORT_GET_CLASS*(obj: pointer): PViewportClass +proc viewport_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_viewport_get_type".} +proc viewport_new*(hadjustment: PAdjustment, vadjustment: PAdjustment): PViewport{. + cdecl, dynlib: lib, importc: "gtk_viewport_new".} +proc viewport_get_hadjustment*(viewport: PViewport): PAdjustment{.cdecl, + dynlib: lib, importc: "gtk_viewport_get_hadjustment".} +proc viewport_get_vadjustment*(viewport: PViewport): PAdjustment{.cdecl, + dynlib: lib, importc: "gtk_viewport_get_vadjustment".} +proc viewport_set_hadjustment*(viewport: PViewport, adjustment: PAdjustment){. + cdecl, dynlib: lib, importc: "gtk_viewport_set_hadjustment".} +proc viewport_set_vadjustment*(viewport: PViewport, adjustment: PAdjustment){. + cdecl, dynlib: lib, importc: "gtk_viewport_set_vadjustment".} +proc viewport_set_shadow_type*(viewport: PViewport, thetype: TShadowType){. + cdecl, dynlib: lib, importc: "gtk_viewport_set_shadow_type".} +proc viewport_get_shadow_type*(viewport: PViewport): TShadowType{.cdecl, + dynlib: lib, importc: "gtk_viewport_get_shadow_type".} +proc TYPE_VPANED*(): GType +proc VPANED*(obj: pointer): PVPaned +proc VPANED_CLASS*(klass: pointer): PVPanedClass +proc IS_VPANED*(obj: pointer): bool +proc IS_VPANED_CLASS*(klass: pointer): bool +proc VPANED_GET_CLASS*(obj: pointer): PVPanedClass +proc vpaned_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vpaned_get_type".} +proc vpaned_new*(): PVPaned{.cdecl, dynlib: lib, importc: "gtk_vpaned_new".} +proc TYPE_VRULER*(): GType +proc VRULER*(obj: pointer): PVRuler +proc VRULER_CLASS*(klass: pointer): PVRulerClass +proc IS_VRULER*(obj: pointer): bool +proc IS_VRULER_CLASS*(klass: pointer): bool +proc VRULER_GET_CLASS*(obj: pointer): PVRulerClass +proc vruler_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vruler_get_type".} +proc vruler_new*(): PVRuler{.cdecl, dynlib: lib, importc: "gtk_vruler_new".} +proc TYPE_VSCALE*(): GType +proc VSCALE*(obj: pointer): PVScale +proc VSCALE_CLASS*(klass: pointer): PVScaleClass +proc IS_VSCALE*(obj: pointer): bool +proc IS_VSCALE_CLASS*(klass: pointer): bool +proc VSCALE_GET_CLASS*(obj: pointer): PVScaleClass +proc vscale_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vscale_get_type".} +proc vscale_new*(adjustment: PAdjustment): PVScale{.cdecl, dynlib: lib, + importc: "gtk_vscale_new".} +proc vscale_new_with_range*(min: gdouble, max: gdouble, step: gdouble): PVScale{. + cdecl, dynlib: lib, importc: "gtk_vscale_new_with_range".} +proc TYPE_VSCROLLBAR*(): GType +proc VSCROLLBAR*(obj: pointer): PVScrollbar +proc VSCROLLBAR_CLASS*(klass: pointer): PVScrollbarClass +proc IS_VSCROLLBAR*(obj: pointer): bool +proc IS_VSCROLLBAR_CLASS*(klass: pointer): bool +proc VSCROLLBAR_GET_CLASS*(obj: pointer): PVScrollbarClass +proc vscrollbar_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vscrollbar_get_type".} +proc vscrollbar_new*(adjustment: PAdjustment): PVScrollbar{.cdecl, dynlib: lib, + importc: "gtk_vscrollbar_new".} +proc TYPE_VSEPARATOR*(): GType +proc VSEPARATOR*(obj: pointer): PVSeparator +proc VSEPARATOR_CLASS*(klass: pointer): PVSeparatorClass +proc IS_VSEPARATOR*(obj: pointer): bool +proc IS_VSEPARATOR_CLASS*(klass: pointer): bool +proc VSEPARATOR_GET_CLASS*(obj: pointer): PVSeparatorClass +proc vseparator_get_type*(): TType{.cdecl, dynlib: lib, + importc: "gtk_vseparator_get_type".} +proc vseparator_new*(): PVSeparator{.cdecl, dynlib: lib, + importc: "gtk_vseparator_new".} +proc TYPE_OBJECT*(): GType = + result = object_get_type() + +proc CHECK_CAST*(instance: Pointer, g_type: GType): PGTypeInstance = + result = G_TYPE_CHECK_INSTANCE_CAST(instance, g_type) + +proc CHECK_CLASS_CAST*(g_class: pointer, g_type: GType): Pointer = + result = G_TYPE_CHECK_CLASS_CAST(g_class, g_type) + +proc CHECK_GET_CLASS*(instance: Pointer, g_type: GType): PGTypeClass = + result = G_TYPE_INSTANCE_GET_CLASS(instance, g_type) + +proc CHECK_TYPE*(instance: Pointer, g_type: GType): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(instance, g_type) + +proc CHECK_CLASS_TYPE*(g_class: pointer, g_type: GType): bool = + result = G_TYPE_CHECK_CLASS_TYPE(g_class, g_type) + +proc OBJECT*(anObject: pointer): PObject = + result = cast[PObject](CHECK_CAST(anObject, TYPE_OBJECT())) + +proc OBJECT_CLASS*(klass: pointer): PObjectClass = + result = cast[PObjectClass](CHECK_CLASS_CAST(klass, TYPE_OBJECT())) + +proc IS_OBJECT*(anObject: pointer): bool = + result = CHECK_TYPE(anObject, TYPE_OBJECT()) + +proc IS_OBJECT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_OBJECT()) + +proc OBJECT_GET_CLASS*(anObject: pointer): PObjectClass = + result = cast[PObjectClass](CHECK_GET_CLASS(anObject, TYPE_OBJECT())) + +proc OBJECT_TYPE*(anObject: pointer): GType = + result = G_TYPE_FROM_INSTANCE(anObject) + +proc OBJECT_TYPE_NAME*(anObject: pointer): cstring = + result = g_type_name(OBJECT_TYPE(anObject)) + +proc OBJECT_FLAGS*(obj: pointer): guint32 = + result = (OBJECT(obj)).flags + +proc OBJECT_FLOATING*(obj: pointer): gboolean = + result = ((OBJECT_FLAGS(obj)) and cint(FLOATING)) != 0'i32 + +proc OBJECT_SET_FLAGS*(obj: pointer, flag: guint32) = + OBJECT(obj).flags = OBJECT(obj).flags or flag + +proc OBJECT_UNSET_FLAGS*(obj: pointer, flag: guint32) = + OBJECT(obj).flags = OBJECT(obj).flags and not (flag) + +proc object_data_try_key*(`string`: cstring): TGQuark = + result = g_quark_try_string(`string`) + +proc object_data_force_id*(`string`: cstring): TGQuark = + result = g_quark_from_string(`string`) + +proc CLASS_NAME*(`class`: pointer): cstring = + result = g_type_name(G_TYPE_FROM_CLASS(`class`)) + +proc CLASS_TYPE*(`class`: pointer): GType = + result = G_TYPE_FROM_CLASS(`class`) + +proc TYPE_IS_OBJECT*(thetype: GType): gboolean = + result = g_type_is_a(thetype, TYPE_OBJECT()) + +proc TYPE_IDENTIFIER*(): GType = + result = identifier_get_type() + +proc SIGNAL_FUNC*(f: pointer): TSignalFunc = + result = cast[TSignalFunc](f) + +proc type_name*(thetype: GType): cstring = + result = g_type_name(thetype) + +proc type_from_name*(name: cstring): GType = + result = g_type_from_name(name) + +proc type_parent*(thetype: GType): GType = + result = g_type_parent(thetype) + +proc type_is_a*(thetype, is_a_type: GType): gboolean = + result = g_type_is_a(thetype, is_a_type) + +proc FUNDAMENTAL_TYPE*(thetype: GType): GType = + result = G_TYPE_FUNDAMENTAL(thetype) + +proc VALUE_CHAR*(a: TArg): gchar = + var a = a + Result = cast[ptr gchar](addr(a.d))^ + +proc VALUE_UCHAR*(a: TArg): guchar = + var a = a + Result = cast[ptr guchar](addr(a.d))^ + +proc VALUE_BOOL*(a: TArg): gboolean = + var a = a + Result = cast[ptr gboolean](addr(a.d))^ + +proc VALUE_INT*(a: TArg): gint = + var a = a + Result = cast[ptr gint](addr(a.d))^ + +proc VALUE_UINT*(a: TArg): guint = + var a = a + Result = cast[ptr guint](addr(a.d))^ + +proc VALUE_LONG*(a: TArg): glong = + var a = a + Result = cast[ptr glong](addr(a.d))^ + +proc VALUE_ULONG*(a: TArg): gulong = + var a = a + Result = cast[ptr gulong](addr(a.d))^ + +proc VALUE_FLOAT*(a: TArg): gfloat = + var a = a + Result = cast[ptr gfloat](addr(a.d))^ + +proc VALUE_DOUBLE*(a: TArg): gdouble = + var a = a + Result = cast[ptr gdouble](addr(a.d))^ + +proc VALUE_STRING*(a: TArg): cstring = + var a = a + Result = cast[ptr cstring](addr(a.d))^ + +proc VALUE_ENUM*(a: TArg): gint = + var a = a + Result = cast[ptr gint](addr(a.d))^ + +proc VALUE_FLAGS*(a: TArg): guint = + var a = a + Result = cast[ptr guint](addr(a.d))^ + +proc VALUE_BOXED*(a: TArg): gpointer = + var a = a + Result = cast[ptr gpointer](addr(a.d))^ + +proc VALUE_OBJECT*(a: TArg): PObject = + var a = a + Result = cast[ptr PObject](addr(a.d))^ + +proc VALUE_POINTER*(a: TArg): GPointer = + var a = a + Result = cast[ptr gpointer](addr(a.d))^ + +proc VALUE_SIGNAL*(a: TArg): TArgSignalData = + var a = a + Result = cast[ptr TArgSignalData](addr(a.d))^ + +proc RETLOC_CHAR*(a: TArg): cstring = + var a = a + Result = cast[ptr cstring](addr(a.d))^ + +proc RETLOC_UCHAR*(a: TArg): Pguchar = + var a = a + Result = cast[ptr pguchar](addr(a.d))^ + +proc RETLOC_BOOL*(a: TArg): Pgboolean = + var a = a + Result = cast[ptr pgboolean](addr(a.d))^ + +proc RETLOC_INT*(a: TArg): Pgint = + var a = a + Result = cast[ptr pgint](addr(a.d))^ + +proc RETLOC_UINT*(a: TArg): Pguint = + var a = a + Result = cast[ptr pguint](addr(a.d))^ + +proc RETLOC_LONG*(a: TArg): Pglong = + var a = a + Result = cast[ptr pglong](addr(a.d))^ + +proc RETLOC_ULONG*(a: TArg): Pgulong = + var a = a + Result = cast[ptr pgulong](addr(a.d))^ + +proc RETLOC_FLOAT*(a: TArg): Pgfloat = + var a = a + Result = cast[ptr pgfloat](addr(a.d))^ + +proc RETLOC_DOUBLE*(a: TArg): Pgdouble = + var a = a + Result = cast[ptr pgdouble](addr(a.d))^ + +proc RETLOC_STRING*(a: TArg): Ppgchar = + var a = a + Result = cast[ptr Ppgchar](addr(a.d))^ + +proc RETLOC_ENUM*(a: TArg): Pgint = + var a = a + Result = cast[ptr Pgint](addr(a.d))^ + +proc RETLOC_FLAGS*(a: TArg): Pguint = + var a = a + Result = cast[ptr pguint](addr(a.d))^ + +proc RETLOC_BOXED*(a: TArg): Pgpointer = + var a = a + Result = cast[ptr pgpointer](addr(a.d))^ + +proc RETLOC_OBJECT*(a: TArg): PPGtkObject = + var a = a + Result = cast[ptr ppgtkobject](addr(a.d))^ + +proc RETLOC_POINTER*(a: TArg): Pgpointer = + var a = a + Result = cast[ptr pgpointer](addr(a.d))^ + +proc TYPE_WIDGET*(): GType = + result = widget_get_type() + +proc WIDGET*(widget: pointer): PWidget = + result = cast[PWidget](CHECK_CAST(widget, TYPE_WIDGET())) + +proc WIDGET_CLASS*(klass: pointer): PWidgetClass = + result = cast[PWidgetClass](CHECK_CLASS_CAST(klass, TYPE_WIDGET())) + +proc IS_WIDGET*(widget: pointer): bool = + result = CHECK_TYPE(widget, TYPE_WIDGET()) + +proc IS_WIDGET_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_WIDGET()) + +proc WIDGET_GET_CLASS*(obj: pointer): PWidgetClass = + result = cast[PWidgetClass](CHECK_GET_CLASS(obj, TYPE_WIDGET())) + +proc WIDGET_TYPE*(wid: pointer): GType = + result = OBJECT_TYPE(wid) + +proc WIDGET_STATE*(wid: pointer): int32 = + result = (WIDGET(wid)).state + +proc WIDGET_SAVED_STATE*(wid: pointer): int32 = + result = (WIDGET(wid)).saved_state + +proc WIDGET_FLAGS*(wid: pointer): guint32 = + result = OBJECT_FLAGS(wid) + +proc WIDGET_TOPLEVEL*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(TOPLEVEL)) != 0'i32 + +proc WIDGET_NO_WINDOW*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(NO_WINDOW)) != 0'i32 + +proc WIDGET_REALIZED*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(REALIZED)) != 0'i32 + +proc WIDGET_MAPPED*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(MAPPED)) != 0'i32 + +proc WIDGET_VISIBLE*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(VISIBLE)) != 0'i32 + +proc WIDGET_DRAWABLE*(wid: pointer): gboolean = + result = (WIDGET_VISIBLE(wid)) and (WIDGET_MAPPED(wid)) + +proc WIDGET_SENSITIVE*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(SENSITIVE)) != 0'i32 + +proc WIDGET_PARENT_SENSITIVE*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(PARENT_SENSITIVE)) != 0'i32 + +proc WIDGET_IS_SENSITIVE*(wid: pointer): gboolean = + result = (WIDGET_SENSITIVE(wid)) and (WIDGET_PARENT_SENSITIVE(wid)) + +proc WIDGET_CAN_FOCUS*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(CAN_FOCUS)) != 0'i32 + +proc WIDGET_HAS_FOCUS*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(HAS_FOCUS)) != 0'i32 + +proc WIDGET_CAN_DEFAULT*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(CAN_DEFAULT)) != 0'i32 + +proc WIDGET_HAS_DEFAULT*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(HAS_DEFAULT)) != 0'i32 + +proc WIDGET_HAS_GRAB*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(HAS_GRAB)) != 0'i32 + +proc WIDGET_RC_STYLE*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(RC_STYLE)) != 0'i32 + +proc WIDGET_COMPOSITE_CHILD*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(COMPOSITE_CHILD)) != 0'i32 + +proc WIDGET_APP_PAINTABLE*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(APP_PAINTABLE)) != 0'i32 + +proc WIDGET_RECEIVES_DEFAULT*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(RECEIVES_DEFAULT)) != 0'i32 + +proc WIDGET_DOUBLE_BUFFERED*(wid: pointer): gboolean = + result = ((WIDGET_FLAGS(wid)) and cint(DOUBLE_BUFFERED)) != 0'i32 + +proc TYPE_REQUISITION*(): GType = + result = requisition_get_type() + +proc x_set*(a: var TWidgetAuxInfo): guint = + result = (a.flag0 and bm_TGtkWidgetAuxInfo_x_set) shr + bp_TGtkWidgetAuxInfo_x_set + +proc set_x_set*(a: var TWidgetAuxInfo, `x_set`: guint) = + a.flag0 = a.flag0 or + (int16(`x_set` shl bp_TGtkWidgetAuxInfo_x_set) and + bm_TGtkWidgetAuxInfo_x_set) + +proc y_set*(a: var TWidgetAuxInfo): guint = + result = (a.flag0 and bm_TGtkWidgetAuxInfo_y_set) shr + bp_TGtkWidgetAuxInfo_y_set + +proc set_y_set*(a: var TWidgetAuxInfo, `y_set`: guint) = + a.flag0 = a.flag0 or + (int16(`y_set` shl bp_TGtkWidgetAuxInfo_y_set) and + bm_TGtkWidgetAuxInfo_y_set) + +proc widget_set_visual*(widget, visual: pointer) = + if (Widget != nil) and (visual != nil): nil + +proc widget_push_visual*(visual: pointer) = + if (visual != nil): nil + +proc widget_pop_visual*() = + nil + +proc widget_set_default_visual*(visual: pointer) = + if (visual != nil): nil + +proc widget_set_rc_style*(widget: pointer) = + widget_set_style(cast[PWidget](widget), nil) + +proc widget_restore_default_style*(widget: pointer) = + widget_set_style(cast[PWidget](widget), nil) + +proc WIDGET_SET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags = + cast[pObject](wid).flags = cast[pObject](wid).flags or (flags) + result = cast[pObject](wid).flags + +proc WIDGET_UNSET_FLAGS*(wid: PWidget, flags: TWidgetFlags): TWidgetFlags = + cast[pObject](wid).flags = cast[pObject](wid).flags and (not (flags)) + result = cast[pObject](wid).flags + +proc TYPE_MISC*(): GType = + result = misc_get_type() + +proc MISC*(obj: pointer): PMisc = + result = cast[PMisc](CHECK_CAST(obj, TYPE_MISC())) + +proc MISC_CLASS*(klass: pointer): PMiscClass = + result = cast[PMiscClass](CHECK_CLASS_CAST(klass, TYPE_MISC())) + +proc IS_MISC*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MISC()) + +proc IS_MISC_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MISC()) + +proc MISC_GET_CLASS*(obj: pointer): PMiscClass = + result = cast[PMiscClass](CHECK_GET_CLASS(obj, TYPE_MISC())) + +proc TYPE_ACCEL_GROUP*(): GType = + result = accel_group_get_type() + +proc ACCEL_GROUP*(anObject: pointer): PAccelGroup = + result = cast[PAccelGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject, + TYPE_ACCEL_GROUP())) + +proc ACCEL_GROUP_CLASS*(klass: pointer): PAccelGroupClass = + result = cast[PAccelGroupClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_ACCEL_GROUP())) + +proc IS_ACCEL_GROUP*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_ACCEL_GROUP()) + +proc IS_ACCEL_GROUP_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_ACCEL_GROUP()) + +proc ACCEL_GROUP_GET_CLASS*(obj: pointer): PAccelGroupClass = + result = cast[PAccelGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_ACCEL_GROUP())) + +proc accel_flags*(a: var TAccelKey): guint = + result = (a.flag0 and bm_TGtkAccelKey_accel_flags) shr + bp_TGtkAccelKey_accel_flags + +proc set_accel_flags*(a: var TAccelKey, `accel_flags`: guint) = + a.flag0 = a.flag0 or + (int16(`accel_flags` shl bp_TGtkAccelKey_accel_flags) and + bm_TGtkAccelKey_accel_flags) + +proc accel_group_ref*(AccelGroup: PAccelGroup) = + discard g_object_ref(AccelGroup) + +proc accel_group_unref*(AccelGroup: PAccelGroup) = + g_object_unref(AccelGroup) + +proc TYPE_CONTAINER*(): GType = + result = container_get_type() + +proc CONTAINER*(obj: pointer): PContainer = + result = cast[PContainer](CHECK_CAST(obj, TYPE_CONTAINER())) + +proc CONTAINER_CLASS*(klass: pointer): PContainerClass = + result = cast[PContainerClass](CHECK_CLASS_CAST(klass, TYPE_CONTAINER())) + +proc IS_CONTAINER*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CONTAINER()) + +proc IS_CONTAINER_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CONTAINER()) + +proc CONTAINER_GET_CLASS*(obj: pointer): PContainerClass = + result = cast[PContainerClass](CHECK_GET_CLASS(obj, TYPE_CONTAINER())) + +proc IS_RESIZE_CONTAINER*(widget: pointer): bool = + result = (IS_CONTAINER(widget)) and + ((resize_mode(cast[PContainer](widget))) != cint(RESIZE_PARENT)) + +proc border_width*(a: var TContainer): guint = + result = (a.Container_flag0 and bm_TGtkContainer_border_width) shr + bp_TGtkContainer_border_width + +proc set_border_width*(a: var TContainer, `border_width`: guint) = + a.Container_flag0 = a.Container_flag0 or + ((`border_width` shl bp_TGtkContainer_border_width) and + bm_TGtkContainer_border_width) + +proc need_resize*(a: var TContainer): guint = + result = (a.Container_flag0 and bm_TGtkContainer_need_resize) shr + bp_TGtkContainer_need_resize + +proc set_need_resize*(a: var TContainer, `need_resize`: guint) = + a.Container_flag0 = a.Container_flag0 or + ((`need_resize` shl bp_TGtkContainer_need_resize) and + bm_TGtkContainer_need_resize) + +proc resize_mode*(a: PContainer): guint = + result = (a.Container_flag0 and bm_TGtkContainer_resize_mode) shr + bp_TGtkContainer_resize_mode + +proc set_resize_mode*(a: var TContainer, `resize_mode`: guint) = + a.Containerflag0 = a.Containerflag0 or + ((`resize_mode` shl bp_TGtkContainer_resize_mode) and + bm_TGtkContainer_resize_mode) + +proc reallocate_redraws*(a: var TContainer): guint = + result = (a.Containerflag0 and bm_TGtkContainer_reallocate_redraws) shr + bp_TGtkContainer_reallocate_redraws + +proc set_reallocate_redraws*(a: var TContainer, `reallocate_redraws`: guint) = + a.Containerflag0 = a.Containerflag0 or + ((`reallocate_redraws` shl bp_TGtkContainer_reallocate_redraws) and + bm_TGtkContainer_reallocate_redraws) + +proc has_focus_chain*(a: var TContainer): guint = + result = (a.Containerflag0 and bm_TGtkContainer_has_focus_chain) shr + bp_TGtkContainer_has_focus_chain + +proc set_has_focus_chain*(a: var TContainer, `has_focus_chain`: guint) = + a.Containerflag0 = a.Containerflag0 or + ((`has_focus_chain` shl bp_TGtkContainer_has_focus_chain) and + bm_TGtkContainer_has_focus_chain) + +proc CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID*(anObject: pointer, + property_id: guint, pspec: pointer) = + write(stdout, "WARNING: invalid child property id\x0A") + +proc TYPE_BIN*(): GType = + result = bin_get_type() + +proc BIN*(obj: pointer): PBin = + result = cast[PBin](CHECK_CAST(obj, TYPE_BIN())) + +proc BIN_CLASS*(klass: pointer): PBinClass = + result = cast[PBinClass](CHECK_CLASS_CAST(klass, TYPE_BIN())) + +proc IS_BIN*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_BIN()) + +proc IS_BIN_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_BIN()) + +proc BIN_GET_CLASS*(obj: pointer): PBinClass = + result = cast[PBinClass](CHECK_GET_CLASS(obj, TYPE_BIN())) + +proc TYPE_WINDOW*(): GType = + result = window_get_type() + +proc WINDOW*(obj: pointer): PWindow = + result = cast[PWindow](CHECK_CAST(obj, TYPE_WINDOW())) + +proc WINDOW_CLASS*(klass: pointer): PWindowClass = + result = cast[PWindowClass](CHECK_CLASS_CAST(klass, TYPE_WINDOW())) + +proc IS_WINDOW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_WINDOW()) + +proc IS_WINDOW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_WINDOW()) + +proc WINDOW_GET_CLASS*(obj: pointer): PWindowClass = + result = cast[PWindowClass](CHECK_GET_CLASS(obj, TYPE_WINDOW())) + +proc allow_shrink*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_allow_shrink) shr + bp_TGtkWindow_allow_shrink + +proc set_allow_shrink*(a: var TWindow, `allow_shrink`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`allow_shrink` shl bp_TGtkWindow_allow_shrink) and + bm_TGtkWindow_allow_shrink) + +proc allow_grow*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_allow_grow) shr + bp_TGtkWindow_allow_grow + +proc set_allow_grow*(a: var TWindow, `allow_grow`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`allow_grow` shl bp_TGtkWindow_allow_grow) and + bm_TGtkWindow_allow_grow) + +proc configure_notify_received*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_configure_notify_received) shr + bp_TGtkWindow_configure_notify_received + +proc set_configure_notify_received*(a: var TWindow, + `configure_notify_received`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`configure_notify_received` shl + bp_TGtkWindow_configure_notify_received) and + bm_TGtkWindow_configure_notify_received) + +proc need_default_position*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_need_default_position) shr + bp_TGtkWindow_need_default_position + +proc set_need_default_position*(a: var TWindow, `need_default_position`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`need_default_position` shl bp_TGtkWindow_need_default_position) and + bm_TGtkWindow_need_default_position) + +proc need_default_size*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_need_default_size) shr + bp_TGtkWindow_need_default_size + +proc set_need_default_size*(a: var TWindow, `need_default_size`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`need_default_size` shl bp_TGtkWindow_need_default_size) and + bm_TGtkWindow_need_default_size) + +proc position*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_position) shr + bp_TGtkWindow_position + +proc set_position*(a: var TWindow, `position`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`position` shl bp_TGtkWindow_position) and bm_TGtkWindow_position) + +proc get_type*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_type) shr bp_TGtkWindow_type + +proc set_type*(a: var TWindow, `type`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`type` shl bp_TGtkWindow_type) and bm_TGtkWindow_type) + +proc has_user_ref_count*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_has_user_ref_count) shr + bp_TGtkWindow_has_user_ref_count + +proc set_has_user_ref_count*(a: var TWindow, `has_user_ref_count`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`has_user_ref_count` shl bp_TGtkWindow_has_user_ref_count) and + bm_TGtkWindow_has_user_ref_count) + +proc has_focus*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_has_focus) shr + bp_TGtkWindow_has_focus + +proc set_has_focus*(a: var TWindow, `has_focus`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`has_focus` shl bp_TGtkWindow_has_focus) and bm_TGtkWindow_has_focus) + +proc modal*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_modal) shr bp_TGtkWindow_modal + +proc set_modal*(a: var TWindow, `modal`: guint) = + a.Window_flag0 = a.Window_flag0 or + ((`modal` shl bp_TGtkWindow_modal) and bm_TGtkWindow_modal) + +proc destroy_with_parent*(a: var TWindow): guint = + result = (a.Window_flag0 and bm_TGtkWindow_destroy_with_parent) shr + bp_TGtkWindow_destroy_with_parent + +proc set_destroy_with_parent*(a: var TWindow, `destroy_with_parent`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`destroy_with_parent` shl bp_TGtkWindow_destroy_with_parent) and + bm_TGtkWindow_destroy_with_parent) + +proc has_frame*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_has_frame) shr + bp_TGtkWindow_has_frame + +proc set_has_frame*(a: var TWindow, `has_frame`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`has_frame` shl bp_TGtkWindow_has_frame) and bm_TGtkWindow_has_frame) + +proc iconify_initially*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_iconify_initially) shr + bp_TGtkWindow_iconify_initially + +proc set_iconify_initially*(a: var TWindow, `iconify_initially`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`iconify_initially` shl bp_TGtkWindow_iconify_initially) and + bm_TGtkWindow_iconify_initially) + +proc stick_initially*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_stick_initially) shr + bp_TGtkWindow_stick_initially + +proc set_stick_initially*(a: var TWindow, `stick_initially`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`stick_initially` shl bp_TGtkWindow_stick_initially) and + bm_TGtkWindow_stick_initially) + +proc maximize_initially*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_maximize_initially) shr + bp_TGtkWindow_maximize_initially + +proc set_maximize_initially*(a: var TWindow, `maximize_initially`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`maximize_initially` shl bp_TGtkWindow_maximize_initially) and + bm_TGtkWindow_maximize_initially) + +proc decorated*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_decorated) shr + bp_TGtkWindow_decorated + +proc set_decorated*(a: var TWindow, `decorated`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`decorated` shl bp_TGtkWindow_decorated) and bm_TGtkWindow_decorated) + +proc type_hint*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_type_hint) shr + bp_TGtkWindow_type_hint + +proc set_type_hint*(a: var TWindow, `type_hint`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`type_hint` shl bp_TGtkWindow_type_hint) and bm_TGtkWindow_type_hint) + +proc gravity*(a: var TWindow): guint = + result = (a.Windowflag0 and bm_TGtkWindow_gravity) shr + bp_TGtkWindow_gravity + +proc set_gravity*(a: var TWindow, `gravity`: guint) = + a.Windowflag0 = a.Windowflag0 or + ((`gravity` shl bp_TGtkWindow_gravity) and bm_TGtkWindow_gravity) + +proc TYPE_WINDOW_GROUP*(): GType = + result = window_group_get_type() + +proc WINDOW_GROUP*(anObject: pointer): PWindowGroup = + result = cast[PWindowGroup](G_TYPE_CHECK_INSTANCE_CAST(anObject, + TYPE_WINDOW_GROUP())) + +proc WINDOW_GROUP_CLASS*(klass: pointer): PWindowGroupClass = + result = cast[PWindowGroupClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_WINDOW_GROUP())) + +proc IS_WINDOW_GROUP*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_WINDOW_GROUP()) + +proc IS_WINDOW_GROUP_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_WINDOW_GROUP()) + +proc WINDOW_GROUP_GET_CLASS*(obj: pointer): PWindowGroupClass = + result = cast[PWindowGroupClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_WINDOW_GROUP())) + +proc window_position*(window: PWindow, position: TWindowPosition) = + window_set_position(window, position) + +proc TYPE_LABEL*(): GType = + result = label_get_type() + +proc LABEL*(obj: pointer): PLabel = + result = cast[PLabel](CHECK_CAST(obj, TYPE_LABEL())) + +proc LABEL_CLASS*(klass: pointer): PLabelClass = + result = cast[PLabelClass](CHECK_CLASS_CAST(klass, TYPE_LABEL())) + +proc IS_LABEL*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_LABEL()) + +proc IS_LABEL_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_LABEL()) + +proc LABEL_GET_CLASS*(obj: pointer): PLabelClass = + result = cast[PLabelClass](CHECK_GET_CLASS(obj, TYPE_LABEL())) + +proc jtype*(a: var TLabel): guint = + result = (a.Labelflag0 and bm_TGtkLabel_jtype) shr bp_TGtkLabel_jtype + +proc set_jtype*(a: var TLabel, `jtype`: guint) = + a.Labelflag0 = a.Labelflag0 or + (int16(`jtype` shl bp_TGtkLabel_jtype) and bm_TGtkLabel_jtype) + +proc wrap*(a: var TLabel): guint = + result = (a.Labelflag0 and bm_TGtkLabel_wrap) shr bp_TGtkLabel_wrap + +proc set_wrap*(a: var TLabel, `wrap`: guint) = + a.Labelflag0 = a.Labelflag0 or + (int16(`wrap` shl bp_TGtkLabel_wrap) and bm_TGtkLabel_wrap) + +proc use_underline*(a: var TLabel): guint = + result = (a.Labelflag0 and bm_TGtkLabel_use_underline) shr + bp_TGtkLabel_use_underline + +proc set_use_underline*(a: var TLabel, `use_underline`: guint) = + a.Labelflag0 = a.Labelflag0 or + (int16(`use_underline` shl bp_TGtkLabel_use_underline) and + bm_TGtkLabel_use_underline) + +proc use_markup*(a: var TLabel): guint = + result = (a.Labelflag0 and bm_TGtkLabel_use_markup) shr + bp_TGtkLabel_use_markup + +proc set_use_markup*(a: var TLabel, `use_markup`: guint) = + a.Labelflag0 = a.Labelflag0 or + (int16(`use_markup` shl bp_TGtkLabel_use_markup) and + bm_TGtkLabel_use_markup) + +proc TYPE_ACCEL_LABEL*(): GType = + result = accel_label_get_type() + +proc ACCEL_LABEL*(obj: pointer): PAccelLabel = + result = cast[PAccelLabel](CHECK_CAST(obj, TYPE_ACCEL_LABEL())) + +proc ACCEL_LABEL_CLASS*(klass: pointer): PAccelLabelClass = + result = cast[PAccelLabelClass](CHECK_CLASS_CAST(klass, TYPE_ACCEL_LABEL())) + +proc IS_ACCEL_LABEL*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ACCEL_LABEL()) + +proc IS_ACCEL_LABEL_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ACCEL_LABEL()) + +proc ACCEL_LABEL_GET_CLASS*(obj: pointer): PAccelLabelClass = + result = cast[PAccelLabelClass](CHECK_GET_CLASS(obj, TYPE_ACCEL_LABEL())) + +proc latin1_to_char*(a: var TAccelLabelClass): guint = + result = (a.AccelLabelClassflag0 and bm_TGtkAccelLabelClass_latin1_to_char) shr + bp_TGtkAccelLabelClass_latin1_to_char + +proc set_latin1_to_char*(a: var TAccelLabelClass, `latin1_to_char`: guint) = + a.AccelLabelClassflag0 = a.AccelLabelClassflag0 or + (int16(`latin1_to_char` shl bp_TGtkAccelLabelClass_latin1_to_char) and + bm_TGtkAccelLabelClass_latin1_to_char) + +proc accel_label_accelerator_width*(accel_label: PAccelLabel): guint = + result = accel_label_get_accel_width(accel_label) + +proc TYPE_ACCESSIBLE*(): GType = + result = accessible_get_type() + +proc ACCESSIBLE*(obj: pointer): PAccessible = + result = cast[PAccessible](CHECK_CAST(obj, TYPE_ACCESSIBLE())) + +proc ACCESSIBLE_CLASS*(klass: pointer): PAccessibleClass = + result = cast[PAccessibleClass](CHECK_CLASS_CAST(klass, TYPE_ACCESSIBLE())) + +proc IS_ACCESSIBLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ACCESSIBLE()) + +proc IS_ACCESSIBLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ACCESSIBLE()) + +proc ACCESSIBLE_GET_CLASS*(obj: pointer): PAccessibleClass = + result = cast[PAccessibleClass](CHECK_GET_CLASS(obj, TYPE_ACCESSIBLE())) + +proc TYPE_ADJUSTMENT*(): GType = + result = adjustment_get_type() + +proc ADJUSTMENT*(obj: pointer): PAdjustment = + result = cast[PAdjustment](CHECK_CAST(obj, TYPE_ADJUSTMENT())) + +proc ADJUSTMENT_CLASS*(klass: pointer): PAdjustmentClass = + result = cast[PAdjustmentClass](CHECK_CLASS_CAST(klass, TYPE_ADJUSTMENT())) + +proc IS_ADJUSTMENT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ADJUSTMENT()) + +proc IS_ADJUSTMENT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ADJUSTMENT()) + +proc ADJUSTMENT_GET_CLASS*(obj: pointer): PAdjustmentClass = + result = cast[PAdjustmentClass](CHECK_GET_CLASS(obj, TYPE_ADJUSTMENT())) + +proc TYPE_ALIGNMENT*(): GType = + result = alignment_get_type() + +proc ALIGNMENT*(obj: pointer): PAlignment = + result = cast[PAlignment](CHECK_CAST(obj, TYPE_ALIGNMENT())) + +proc ALIGNMENT_CLASS*(klass: pointer): PAlignmentClass = + result = cast[PAlignmentClass](CHECK_CLASS_CAST(klass, TYPE_ALIGNMENT())) + +proc IS_ALIGNMENT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ALIGNMENT()) + +proc IS_ALIGNMENT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ALIGNMENT()) + +proc ALIGNMENT_GET_CLASS*(obj: pointer): PAlignmentClass = + result = cast[PAlignmentClass](CHECK_GET_CLASS(obj, TYPE_ALIGNMENT())) + +proc TYPE_FRAME*(): GType = + result = frame_get_type() + +proc FRAME*(obj: pointer): PFrame = + result = cast[PFrame](CHECK_CAST(obj, TYPE_FRAME())) + +proc FRAME_CLASS*(klass: pointer): PFrameClass = + result = cast[PFrameClass](CHECK_CLASS_CAST(klass, TYPE_FRAME())) + +proc IS_FRAME*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_FRAME()) + +proc IS_FRAME_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_FRAME()) + +proc FRAME_GET_CLASS*(obj: pointer): PFrameClass = + result = cast[PFrameClass](CHECK_GET_CLASS(obj, TYPE_FRAME())) + +proc TYPE_ASPECT_FRAME*(): GType = + result = aspect_frame_get_type() + +proc ASPECT_FRAME*(obj: pointer): PAspectFrame = + result = cast[PAspectFrame](CHECK_CAST(obj, TYPE_ASPECT_FRAME())) + +proc ASPECT_FRAME_CLASS*(klass: pointer): PAspectFrameClass = + result = cast[PAspectFrameClass](CHECK_CLASS_CAST(klass, TYPE_ASPECT_FRAME())) + +proc IS_ASPECT_FRAME*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ASPECT_FRAME()) + +proc IS_ASPECT_FRAME_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ASPECT_FRAME()) + +proc ASPECT_FRAME_GET_CLASS*(obj: pointer): PAspectFrameClass = + result = cast[PAspectFrameClass](CHECK_GET_CLASS(obj, TYPE_ASPECT_FRAME())) + +proc TYPE_ARROW*(): GType = + result = arrow_get_type() + +proc ARROW*(obj: pointer): PArrow = + result = cast[PArrow](CHECK_CAST(obj, TYPE_ARROW())) + +proc ARROW_CLASS*(klass: pointer): PArrowClass = + result = cast[PArrowClass](CHECK_CLASS_CAST(klass, TYPE_ARROW())) + +proc IS_ARROW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ARROW()) + +proc IS_ARROW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ARROW()) + +proc ARROW_GET_CLASS*(obj: pointer): PArrowClass = + result = cast[PArrowClass](CHECK_GET_CLASS(obj, TYPE_ARROW())) + +proc parsed*(a: var TBindingSet): guint = + result = (a.flag0 and bm_TGtkBindingSet_parsed) shr + bp_TGtkBindingSet_parsed + +proc set_parsed*(a: var TBindingSet, `parsed`: guint) = + a.flag0 = a.flag0 or + (int16(`parsed` shl bp_TGtkBindingSet_parsed) and + bm_TGtkBindingSet_parsed) + +proc destroyed*(a: var TBindingEntry): guint = + result = (a.flag0 and bm_TGtkBindingEntry_destroyed) shr + bp_TGtkBindingEntry_destroyed + +proc set_destroyed*(a: var TBindingEntry, `destroyed`: guint) = + a.flag0 = a.flag0 or + (int16(`destroyed` shl bp_TGtkBindingEntry_destroyed) and + bm_TGtkBindingEntry_destroyed) + +proc in_emission*(a: var TBindingEntry): guint = + result = (a.flag0 and bm_TGtkBindingEntry_in_emission) shr + bp_TGtkBindingEntry_in_emission + +proc set_in_emission*(a: var TBindingEntry, `in_emission`: guint) = + a.flag0 = a.flag0 or + (int16(`in_emission` shl bp_TGtkBindingEntry_in_emission) and + bm_TGtkBindingEntry_in_emission) + +proc binding_entry_add*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType) = + binding_entry_clear(binding_set, keyval, modifiers) + +proc TYPE_BOX*(): GType = + result = box_get_type() + +proc BOX*(obj: pointer): PBox = + result = cast[PBox](CHECK_CAST(obj, TYPE_BOX())) + +proc BOX_CLASS*(klass: pointer): PBoxClass = + result = cast[PBoxClass](CHECK_CLASS_CAST(klass, TYPE_BOX())) + +proc IS_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_BOX()) + +proc IS_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_BOX()) + +proc BOX_GET_CLASS*(obj: pointer): PBoxClass = + result = cast[PBoxClass](CHECK_GET_CLASS(obj, TYPE_BOX())) + +proc homogeneous*(a: var TBox): guint = + result = (a.Boxflag0 and bm_TGtkBox_homogeneous) shr bp_TGtkBox_homogeneous + +proc set_homogeneous*(a: var TBox, `homogeneous`: guint) = + a.Boxflag0 = a.Boxflag0 or + (int16(`homogeneous` shl bp_TGtkBox_homogeneous) and + bm_TGtkBox_homogeneous) + +proc expand*(a: var TBoxChild): guint = + result = (a.flag0 and bm_TGtkBoxChild_expand) shr bp_TGtkBoxChild_expand + +proc set_expand*(a: var TBoxChild, `expand`: guint) = + a.flag0 = a.flag0 or + (int16(`expand` shl bp_TGtkBoxChild_expand) and bm_TGtkBoxChild_expand) + +proc fill*(a: var TBoxChild): guint = + result = (a.flag0 and bm_TGtkBoxChild_fill) shr bp_TGtkBoxChild_fill + +proc set_fill*(a: var TBoxChild, `fill`: guint) = + a.flag0 = a.flag0 or + (int16(`fill` shl bp_TGtkBoxChild_fill) and bm_TGtkBoxChild_fill) + +proc pack*(a: var TBoxChild): guint = + result = (a.flag0 and bm_TGtkBoxChild_pack) shr bp_TGtkBoxChild_pack + +proc set_pack*(a: var TBoxChild, `pack`: guint) = + a.flag0 = a.flag0 or + (int16(`pack` shl bp_TGtkBoxChild_pack) and bm_TGtkBoxChild_pack) + +proc is_secondary*(a: var TBoxChild): guint = + result = (a.flag0 and bm_TGtkBoxChild_is_secondary) shr + bp_TGtkBoxChild_is_secondary + +proc set_is_secondary*(a: var TBoxChild, `is_secondary`: guint) = + a.flag0 = a.flag0 or + (int16(`is_secondary` shl bp_TGtkBoxChild_is_secondary) and + bm_TGtkBoxChild_is_secondary) + +proc TYPE_BUTTON_BOX*(): GType = + result = button_box_get_type() + +proc BUTTON_BOX*(obj: pointer): PButtonBox = + result = cast[PButtonBox](CHECK_CAST(obj, TYPE_BUTTON_BOX())) + +proc BUTTON_BOX_CLASS*(klass: pointer): PButtonBoxClass = + result = cast[PButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_BUTTON_BOX())) + +proc IS_BUTTON_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_BUTTON_BOX()) + +proc IS_BUTTON_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_BUTTON_BOX()) + +proc BUTTON_BOX_GET_CLASS*(obj: pointer): PButtonBoxClass = + result = cast[PButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_BUTTON_BOX())) + +proc button_box_set_spacing*(b: pointer, s: gint) = + box_set_spacing(BOX(b), s) + +proc button_box_get_spacing*(b: pointer): gint = + result = box_get_spacing(BOX(b)) + +proc TYPE_BUTTON*(): GType = + result = button_get_type() + +proc BUTTON*(obj: pointer): PButton = + result = cast[PButton](CHECK_CAST(obj, TYPE_BUTTON())) + +proc BUTTON_CLASS*(klass: pointer): PButtonClass = + result = cast[PButtonClass](CHECK_CLASS_CAST(klass, TYPE_BUTTON())) + +proc IS_BUTTON*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_BUTTON()) + +proc IS_BUTTON_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_BUTTON()) + +proc BUTTON_GET_CLASS*(obj: pointer): PButtonClass = + result = cast[PButtonClass](CHECK_GET_CLASS(obj, TYPE_BUTTON())) + +proc constructed*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_constructed) shr + bp_TGtkButton_constructed + +proc set_constructed*(a: var TButton, `constructed`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`constructed` shl bp_TGtkButton_constructed) and + bm_TGtkButton_constructed) + +proc in_button*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_in_button) shr + bp_TGtkButton_in_button + +proc set_in_button*(a: var TButton, `in_button`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`in_button` shl bp_TGtkButton_in_button) and + bm_TGtkButton_in_button) + +proc button_down*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_button_down) shr + bp_TGtkButton_button_down + +proc set_button_down*(a: var TButton, `button_down`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`button_down` shl bp_TGtkButton_button_down) and + bm_TGtkButton_button_down) + +proc relief*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_relief) shr bp_TGtkButton_relief + +proc set_relief*(a: var TButton, `relief`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`relief` shl bp_TGtkButton_relief) and bm_TGtkButton_relief) + +proc use_underline*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_use_underline) shr + bp_TGtkButton_use_underline + +proc set_use_underline*(a: var TButton, `use_underline`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`use_underline` shl bp_TGtkButton_use_underline) and + bm_TGtkButton_use_underline) + +proc use_stock*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_use_stock) shr + bp_TGtkButton_use_stock + +proc set_use_stock*(a: var TButton, `use_stock`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`use_stock` shl bp_TGtkButton_use_stock) and + bm_TGtkButton_use_stock) + +proc depressed*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_depressed) shr + bp_TGtkButton_depressed + +proc set_depressed*(a: var TButton, `depressed`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`depressed` shl bp_TGtkButton_depressed) and + bm_TGtkButton_depressed) + +proc depress_on_activate*(a: var TButton): guint = + result = (a.Buttonflag0 and bm_TGtkButton_depress_on_activate) shr + bp_TGtkButton_depress_on_activate + +proc set_depress_on_activate*(a: var TButton, `depress_on_activate`: guint) = + a.Buttonflag0 = a.Buttonflag0 or + (int16(`depress_on_activate` shl bp_TGtkButton_depress_on_activate) and + bm_TGtkButton_depress_on_activate) + +proc TYPE_CALENDAR*(): GType = + result = calendar_get_type() + +proc CALENDAR*(obj: pointer): PCalendar = + result = cast[PCalendar](CHECK_CAST(obj, TYPE_CALENDAR())) + +proc CALENDAR_CLASS*(klass: pointer): PCalendarClass = + result = cast[PCalendarClass](CHECK_CLASS_CAST(klass, TYPE_CALENDAR())) + +proc IS_CALENDAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CALENDAR()) + +proc IS_CALENDAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CALENDAR()) + +proc CALENDAR_GET_CLASS*(obj: pointer): PCalendarClass = + result = cast[PCalendarClass](CHECK_GET_CLASS(obj, TYPE_CALENDAR())) + +proc TYPE_CELL_EDITABLE*(): GType = + result = cell_editable_get_type() + +proc CELL_EDITABLE*(obj: pointer): PCellEditable = + result = cast[PCellEditable](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_CELL_EDITABLE())) + +proc CELL_EDITABLE_CLASS*(obj: pointer): PCellEditableIface = + result = cast[PCellEditableIface](G_TYPE_CHECK_CLASS_CAST(obj, + TYPE_CELL_EDITABLE())) + +proc IS_CELL_EDITABLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_CELL_EDITABLE()) + +proc CELL_EDITABLE_GET_IFACE*(obj: pointer): PCellEditableIface = + result = cast[PCellEditableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_CELL_EDITABLE())) + +proc TYPE_CELL_RENDERER*(): GType = + result = cell_renderer_get_type() + +proc CELL_RENDERER*(obj: pointer): PCellRenderer = + result = cast[PCellRenderer](CHECK_CAST(obj, TYPE_CELL_RENDERER())) + +proc CELL_RENDERER_CLASS*(klass: pointer): PCellRendererClass = + result = cast[PCellRendererClass](CHECK_CLASS_CAST(klass, TYPE_CELL_RENDERER())) + +proc IS_CELL_RENDERER*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CELL_RENDERER()) + +proc IS_CELL_RENDERER_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER()) + +proc CELL_RENDERER_GET_CLASS*(obj: pointer): PCellRendererClass = + result = cast[PCellRendererClass](CHECK_GET_CLASS(obj, TYPE_CELL_RENDERER())) + +proc mode*(a: var TCellRenderer): guint = + result = (a.CellRendererflag0 and bm_TGtkCellRenderer_mode) shr + bp_TGtkCellRenderer_mode + +proc set_mode*(a: var TCellRenderer, `mode`: guint) = + a.CellRendererflag0 = a.CellRendererflag0 or + (int16(`mode` shl bp_TGtkCellRenderer_mode) and + bm_TGtkCellRenderer_mode) + +proc visible*(a: var TCellRenderer): guint = + result = (a.CellRendererflag0 and bm_TGtkCellRenderer_visible) shr + bp_TGtkCellRenderer_visible + +proc set_visible*(a: var TCellRenderer, `visible`: guint) = + a.CellRendererflag0 = a.CellRendererflag0 or + (int16(`visible` shl bp_TGtkCellRenderer_visible) and + bm_TGtkCellRenderer_visible) + +proc is_expander*(a: var TCellRenderer): guint = + result = (a.CellRendererflag0 and bm_TGtkCellRenderer_is_expander) shr + bp_TGtkCellRenderer_is_expander + +proc set_is_expander*(a: var TCellRenderer, `is_expander`: guint) = + a.CellRendererflag0 = a.CellRendererflag0 or + (int16(`is_expander` shl bp_TGtkCellRenderer_is_expander) and + bm_TGtkCellRenderer_is_expander) + +proc is_expanded*(a: var TCellRenderer): guint = + result = (a.CellRendererflag0 and bm_TGtkCellRenderer_is_expanded) shr + bp_TGtkCellRenderer_is_expanded + +proc set_is_expanded*(a: var TCellRenderer, `is_expanded`: guint) = + a.CellRendererflag0 = a.CellRendererflag0 or + (int16(`is_expanded` shl bp_TGtkCellRenderer_is_expanded) and + bm_TGtkCellRenderer_is_expanded) + +proc cell_background_set*(a: var TCellRenderer): guint = + result = (a.CellRendererflag0 and bm_TGtkCellRenderer_cell_background_set) shr + bp_TGtkCellRenderer_cell_background_set + +proc set_cell_background_set*(a: var TCellRenderer, `cell_background_set`: guint) = + a.CellRendererflag0 = a.CellRendererflag0 or + (int16(`cell_background_set` shl + bp_TGtkCellRenderer_cell_background_set) and + bm_TGtkCellRenderer_cell_background_set) + +proc TYPE_CELL_RENDERER_TEXT*(): GType = + result = cell_renderer_text_get_type() + +proc CELL_RENDERER_TEXT*(obj: pointer): PCellRendererText = + result = cast[PCellRendererText](CHECK_CAST(obj, TYPE_CELL_RENDERER_TEXT())) + +proc CELL_RENDERER_TEXT_CLASS*(klass: pointer): PCellRendererTextClass = + result = cast[PCellRendererTextClass](CHECK_CLASS_CAST(klass, + TYPE_CELL_RENDERER_TEXT())) + +proc IS_CELL_RENDERER_TEXT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_TEXT()) + +proc IS_CELL_RENDERER_TEXT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_TEXT()) + +proc CELL_RENDERER_TEXT_GET_CLASS*(obj: pointer): PCellRendererTextClass = + result = cast[PCellRendererTextClass](CHECK_GET_CLASS(obj, + TYPE_CELL_RENDERER_TEXT())) + +proc strikethrough*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_strikethrough) shr + bp_TGtkCellRendererText_strikethrough + +proc set_strikethrough*(a: var TCellRendererText, `strikethrough`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`strikethrough` shl bp_TGtkCellRendererText_strikethrough) and + bm_TGtkCellRendererText_strikethrough) + +proc editable*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_editable) shr + bp_TGtkCellRendererText_editable + +proc set_editable*(a: var TCellRendererText, `editable`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`editable` shl bp_TGtkCellRendererText_editable) and + bm_TGtkCellRendererText_editable) + +proc scale_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_scale_set) shr + bp_TGtkCellRendererText_scale_set + +proc set_scale_set*(a: var TCellRendererText, `scale_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`scale_set` shl bp_TGtkCellRendererText_scale_set) and + bm_TGtkCellRendererText_scale_set) + +proc foreground_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and + bm_TGtkCellRendererText_foreground_set) shr + bp_TGtkCellRendererText_foreground_set + +proc set_foreground_set*(a: var TCellRendererText, `foreground_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`foreground_set` shl bp_TGtkCellRendererText_foreground_set) and + bm_TGtkCellRendererText_foreground_set) + +proc background_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and + bm_TGtkCellRendererText_background_set) shr + bp_TGtkCellRendererText_background_set + +proc set_background_set*(a: var TCellRendererText, `background_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`background_set` shl bp_TGtkCellRendererText_background_set) and + bm_TGtkCellRendererText_background_set) + +proc underline_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_underline_set) shr + bp_TGtkCellRendererText_underline_set + +proc set_underline_set*(a: var TCellRendererText, `underline_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`underline_set` shl bp_TGtkCellRendererText_underline_set) and + bm_TGtkCellRendererText_underline_set) + +proc rise_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_rise_set) shr + bp_TGtkCellRendererText_rise_set + +proc set_rise_set*(a: var TCellRendererText, `rise_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`rise_set` shl bp_TGtkCellRendererText_rise_set) and + bm_TGtkCellRendererText_rise_set) + +proc strikethrough_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and + bm_TGtkCellRendererText_strikethrough_set) shr + bp_TGtkCellRendererText_strikethrough_set + +proc set_strikethrough_set*(a: var TCellRendererText, `strikethrough_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`strikethrough_set` shl + bp_TGtkCellRendererText_strikethrough_set) and + bm_TGtkCellRendererText_strikethrough_set) + +proc editable_set*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and bm_TGtkCellRendererText_editable_set) shr + bp_TGtkCellRendererText_editable_set + +proc set_editable_set*(a: var TCellRendererText, `editable_set`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`editable_set` shl bp_TGtkCellRendererText_editable_set) and + bm_TGtkCellRendererText_editable_set) + +proc calc_fixed_height*(a: var TCellRendererText): guint = + result = (a.CellRendererTextflag0 and + bm_TGtkCellRendererText_calc_fixed_height) shr + bp_TGtkCellRendererText_calc_fixed_height + +proc set_calc_fixed_height*(a: var TCellRendererText, `calc_fixed_height`: guint) = + a.CellRendererTextflag0 = a.CellRendererTextflag0 or + (int16(`calc_fixed_height` shl + bp_TGtkCellRendererText_calc_fixed_height) and + bm_TGtkCellRendererText_calc_fixed_height) + +proc TYPE_CELL_RENDERER_TOGGLE*(): GType = + result = cell_renderer_toggle_get_type() + +proc CELL_RENDERER_TOGGLE*(obj: pointer): PCellRendererToggle = + result = cast[PCellRendererToggle](CHECK_CAST(obj, TYPE_CELL_RENDERER_TOGGLE())) + +proc CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): PCellRendererToggleClass = + result = cast[PCellRendererToggleClass](CHECK_CLASS_CAST(klass, + TYPE_CELL_RENDERER_TOGGLE())) + +proc IS_CELL_RENDERER_TOGGLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_TOGGLE()) + +proc IS_CELL_RENDERER_TOGGLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_TOGGLE()) + +proc CELL_RENDERER_TOGGLE_GET_CLASS*(obj: pointer): PCellRendererToggleClass = + result = cast[PCellRendererToggleClass](CHECK_GET_CLASS(obj, + TYPE_CELL_RENDERER_TOGGLE())) + +proc active*(a: var TCellRendererToggle): guint = + result = (a.CellRendererToggleflag0 and bm_TGtkCellRendererToggle_active) shr + bp_TGtkCellRendererToggle_active + +proc set_active*(a: var TCellRendererToggle, `active`: guint) = + a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or + (int16(`active` shl bp_TGtkCellRendererToggle_active) and + bm_TGtkCellRendererToggle_active) + +proc activatable*(a: var TCellRendererToggle): guint = + result = (a.CellRendererToggleflag0 and + bm_TGtkCellRendererToggle_activatable) shr + bp_TGtkCellRendererToggle_activatable + +proc set_activatable*(a: var TCellRendererToggle, `activatable`: guint) = + a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or + (int16(`activatable` shl bp_TGtkCellRendererToggle_activatable) and + bm_TGtkCellRendererToggle_activatable) + +proc radio*(a: var TCellRendererToggle): guint = + result = (a.CellRendererToggleflag0 and bm_TGtkCellRendererToggle_radio) shr + bp_TGtkCellRendererToggle_radio + +proc set_radio*(a: var TCellRendererToggle, `radio`: guint) = + a.CellRendererToggleflag0 = a.CellRendererToggleflag0 or + (int16(`radio` shl bp_TGtkCellRendererToggle_radio) and + bm_TGtkCellRendererToggle_radio) + +proc TYPE_CELL_RENDERER_PIXBUF*(): GType = + result = cell_renderer_pixbuf_get_type() + +proc CELL_RENDERER_PIXBUF*(obj: pointer): PCellRendererPixbuf = + result = cast[PCellRendererPixbuf](CHECK_CAST(obj, TYPE_CELL_RENDERER_PIXBUF())) + +proc CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): PCellRendererPixbufClass = + result = cast[PCellRendererPixbufClass](CHECK_CLASS_CAST(klass, + TYPE_CELL_RENDERER_PIXBUF())) + +proc IS_CELL_RENDERER_PIXBUF*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CELL_RENDERER_PIXBUF()) + +proc IS_CELL_RENDERER_PIXBUF_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CELL_RENDERER_PIXBUF()) + +proc CELL_RENDERER_PIXBUF_GET_CLASS*(obj: pointer): PCellRendererPixbufClass = + result = cast[PCellRendererPixbufClass](CHECK_GET_CLASS(obj, + TYPE_CELL_RENDERER_PIXBUF())) + +proc TYPE_ITEM*(): GType = + result = item_get_type() + +proc ITEM*(obj: pointer): PItem = + result = cast[PItem](CHECK_CAST(obj, TYPE_ITEM())) + +proc ITEM_CLASS*(klass: pointer): PItemClass = + result = cast[PItemClass](CHECK_CLASS_CAST(klass, TYPE_ITEM())) + +proc IS_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ITEM()) + +proc IS_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ITEM()) + +proc ITEM_GET_CLASS*(obj: pointer): PItemClass = + result = cast[PItemClass](CHECK_GET_CLASS(obj, TYPE_ITEM())) + +proc TYPE_MENU_ITEM*(): GType = + result = menu_item_get_type() + +proc MENU_ITEM*(obj: pointer): PMenuItem = + result = cast[PMenuItem](CHECK_CAST(obj, TYPE_MENU_ITEM())) + +proc MENU_ITEM_CLASS*(klass: pointer): PMenuItemClass = + result = cast[PMenuItemClass](CHECK_CLASS_CAST(klass, TYPE_MENU_ITEM())) + +proc IS_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MENU_ITEM()) + +proc IS_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MENU_ITEM()) + +proc MENU_ITEM_GET_CLASS*(obj: pointer): PMenuItemClass = + result = cast[PMenuItemClass](CHECK_GET_CLASS(obj, TYPE_MENU_ITEM())) + +proc show_submenu_indicator*(a: var TMenuItem): guint = + result = (a.MenuItemflag0 and bm_TGtkMenuItem_show_submenu_indicator) shr + bp_TGtkMenuItem_show_submenu_indicator + +proc set_show_submenu_indicator*(a: var TMenuItem, + `show_submenu_indicator`: guint) = + a.MenuItemflag0 = a.MenuItemflag0 or + (int16(`show_submenu_indicator` shl + bp_TGtkMenuItem_show_submenu_indicator) and + bm_TGtkMenuItem_show_submenu_indicator) + +proc submenu_placement*(a: var TMenuItem): guint = + result = (a.MenuItemflag0 and bm_TGtkMenuItem_submenu_placement) shr + bp_TGtkMenuItem_submenu_placement + +proc set_submenu_placement*(a: var TMenuItem, `submenu_placement`: guint) = + a.MenuItemflag0 = a.MenuItemflag0 or + (int16(`submenu_placement` shl bp_TGtkMenuItem_submenu_placement) and + bm_TGtkMenuItem_submenu_placement) + +proc submenu_direction*(a: var TMenuItem): guint = + result = (a.MenuItemflag0 and bm_TGtkMenuItem_submenu_direction) shr + bp_TGtkMenuItem_submenu_direction + +proc set_submenu_direction*(a: var TMenuItem, `submenu_direction`: guint) = + a.MenuItemflag0 = a.MenuItemflag0 or + (int16(`submenu_direction` shl bp_TGtkMenuItem_submenu_direction) and + bm_TGtkMenuItem_submenu_direction) + +proc right_justify*(a: var TMenuItem): guint = + result = (a.MenuItemflag0 and bm_TGtkMenuItem_right_justify) shr + bp_TGtkMenuItem_right_justify + +proc set_right_justify*(a: var TMenuItem, `right_justify`: guint) = + a.MenuItemflag0 = a.MenuItemflag0 or + (int16(`right_justify` shl bp_TGtkMenuItem_right_justify) and + bm_TGtkMenuItem_right_justify) + +proc timer_from_keypress*(a: var TMenuItem): guint = + result = (a.MenuItemflag0 and bm_TGtkMenuItem_timer_from_keypress) shr + bp_TGtkMenuItem_timer_from_keypress + +proc set_timer_from_keypress*(a: var TMenuItem, `timer_from_keypress`: guint) = + a.MenuItemflag0 = a.MenuItemflag0 or + (int16(`timer_from_keypress` shl bp_TGtkMenuItem_timer_from_keypress) and + bm_TGtkMenuItem_timer_from_keypress) + +proc hide_on_activate*(a: var TMenuItemClass): guint = + result = (a.MenuItemClassflag0 and bm_TGtkMenuItemClass_hide_on_activate) shr + bp_TGtkMenuItemClass_hide_on_activate + +proc set_hide_on_activate*(a: var TMenuItemClass, `hide_on_activate`: guint) = + a.MenuItemClassflag0 = a.MenuItemClassflag0 or + (int16(`hide_on_activate` shl bp_TGtkMenuItemClass_hide_on_activate) and + bm_TGtkMenuItemClass_hide_on_activate) + +proc menu_item_right_justify*(menu_item: PMenuItem) = + menu_item_set_right_justified(menu_item, true) + +proc TYPE_TOGGLE_BUTTON*(): GType = + result = toggle_button_get_type() + +proc TOGGLE_BUTTON*(obj: pointer): PToggleButton = + result = cast[PToggleButton](CHECK_CAST(obj, TYPE_TOGGLE_BUTTON())) + +proc TOGGLE_BUTTON_CLASS*(klass: pointer): PToggleButtonClass = + result = cast[PToggleButtonClass](CHECK_CLASS_CAST(klass, TYPE_TOGGLE_BUTTON())) + +proc IS_TOGGLE_BUTTON*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TOGGLE_BUTTON()) + +proc IS_TOGGLE_BUTTON_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TOGGLE_BUTTON()) + +proc TOGGLE_BUTTON_GET_CLASS*(obj: pointer): PToggleButtonClass = + result = cast[PToggleButtonClass](CHECK_GET_CLASS(obj, TYPE_TOGGLE_BUTTON())) + +proc active*(a: var TToggleButton): guint = + result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_active) shr + bp_TGtkToggleButton_active + +proc set_active*(a: var TToggleButton, `active`: guint) = + a.ToggleButtonflag0 = a.ToggleButtonflag0 or + (int16(`active` shl bp_TGtkToggleButton_active) and + bm_TGtkToggleButton_active) + +proc draw_indicator*(a: var TToggleButton): guint = + result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_draw_indicator) shr + bp_TGtkToggleButton_draw_indicator + +proc set_draw_indicator*(a: var TToggleButton, `draw_indicator`: guint) = + a.ToggleButtonflag0 = a.ToggleButtonflag0 or + (int16(`draw_indicator` shl bp_TGtkToggleButton_draw_indicator) and + bm_TGtkToggleButton_draw_indicator) + +proc inconsistent*(a: var TToggleButton): guint = + result = (a.ToggleButtonflag0 and bm_TGtkToggleButton_inconsistent) shr + bp_TGtkToggleButton_inconsistent + +proc set_inconsistent*(a: var TToggleButton, `inconsistent`: guint) = + a.ToggleButtonflag0 = a.ToggleButtonflag0 or + (int16(`inconsistent` shl bp_TGtkToggleButton_inconsistent) and + bm_TGtkToggleButton_inconsistent) + +proc TYPE_CHECK_BUTTON*(): GType = + result = check_button_get_type() + +proc CHECK_BUTTON*(obj: pointer): PCheckButton = + result = cast[PCheckButton](CHECK_CAST(obj, TYPE_CHECK_BUTTON())) + +proc CHECK_BUTTON_CLASS*(klass: pointer): PCheckButtonClass = + result = cast[PCheckButtonClass](CHECK_CLASS_CAST(klass, TYPE_CHECK_BUTTON())) + +proc IS_CHECK_BUTTON*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CHECK_BUTTON()) + +proc IS_CHECK_BUTTON_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CHECK_BUTTON()) + +proc CHECK_BUTTON_GET_CLASS*(obj: pointer): PCheckButtonClass = + result = cast[PCheckButtonClass](CHECK_GET_CLASS(obj, TYPE_CHECK_BUTTON())) + +proc TYPE_CHECK_MENU_ITEM*(): GType = + result = check_menu_item_get_type() + +proc CHECK_MENU_ITEM*(obj: pointer): PCheckMenuItem = + result = cast[PCheckMenuItem](CHECK_CAST(obj, TYPE_CHECK_MENU_ITEM())) + +proc CHECK_MENU_ITEM_CLASS*(klass: pointer): PCheckMenuItemClass = + result = cast[PCheckMenuItemClass](CHECK_CLASS_CAST(klass, + TYPE_CHECK_MENU_ITEM())) + +proc IS_CHECK_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CHECK_MENU_ITEM()) + +proc IS_CHECK_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CHECK_MENU_ITEM()) + +proc CHECK_MENU_ITEM_GET_CLASS*(obj: pointer): PCheckMenuItemClass = + result = cast[PCheckMenuItemClass](CHECK_GET_CLASS(obj, TYPE_CHECK_MENU_ITEM())) + +proc active*(a: var TCheckMenuItem): guint = + result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_active) shr + bp_TGtkCheckMenuItem_active + +proc set_active*(a: var TCheckMenuItem, `active`: guint) = + a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or + (int16(`active` shl bp_TGtkCheckMenuItem_active) and + bm_TGtkCheckMenuItem_active) + +proc always_show_toggle*(a: var TCheckMenuItem): guint = + result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_always_show_toggle) shr + bp_TGtkCheckMenuItem_always_show_toggle + +proc set_always_show_toggle*(a: var TCheckMenuItem, `always_show_toggle`: guint) = + a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or + (int16(`always_show_toggle` shl bp_TGtkCheckMenuItem_always_show_toggle) and + bm_TGtkCheckMenuItem_always_show_toggle) + +proc inconsistent*(a: var TCheckMenuItem): guint = + result = (a.CheckMenuItemflag0 and bm_TGtkCheckMenuItem_inconsistent) shr + bp_TGtkCheckMenuItem_inconsistent + +proc set_inconsistent*(a: var TCheckMenuItem, `inconsistent`: guint) = + a.CheckMenuItemflag0 = a.CheckMenuItemflag0 or + (int16(`inconsistent` shl bp_TGtkCheckMenuItem_inconsistent) and + bm_TGtkCheckMenuItem_inconsistent) + +proc TYPE_CLIST*(): GType = + result = clist_get_type() + +proc CLIST*(obj: pointer): PCList = + result = cast[PCList](CHECK_CAST(obj, TYPE_CLIST())) + +proc CLIST_CLASS*(klass: pointer): PCListClass = + result = cast[PCListClass](CHECK_CLASS_CAST(klass, TYPE_CLIST())) + +proc IS_CLIST*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CLIST()) + +proc IS_CLIST_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CLIST()) + +proc CLIST_GET_CLASS*(obj: pointer): PCListClass = + result = cast[PCListClass](CHECK_GET_CLASS(obj, TYPE_CLIST())) + +proc CLIST_FLAGS*(clist: pointer): guint16 = + result = toU16(CLIST(clist).flags) + +proc CLIST_SET_FLAG*(clist: PCList, flag: guint16) = + clist.flags = CLIST(clist).flags or (flag) + +proc CLIST_UNSET_FLAG*(clist: PCList, flag: guint16) = + clist.flags = CLIST(clist).flags and not (flag) + +proc CLIST_IN_DRAG_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_IN_DRAG)) != 0'i32 + +proc CLIST_ROW_HEIGHT_SET_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_ROW_HEIGHT_SET)) != 0'i32 + +proc CLIST_SHOW_TITLES_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_SHOW_TITLES)) != 0'i32 + +proc CLIST_ADD_MODE_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_ADD_MODE)) != 0'i32 + +proc CLIST_AUTO_SORT_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_AUTO_SORT)) != 0'i32 + +proc CLIST_AUTO_RESIZE_BLOCKED_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_AUTO_RESIZE_BLOCKED)) != 0'i32 + +proc CLIST_REORDERABLE_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_REORDERABLE)) != 0'i32 + +proc CLIST_USE_DRAG_ICONS_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_USE_DRAG_ICONS)) != 0'i32 + +proc CLIST_DRAW_DRAG_LINE_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_DRAW_DRAG_LINE)) != 0'i32 + +proc CLIST_DRAW_DRAG_RECT_get*(clist: pointer): bool = + result = ((CLIST_FLAGS(clist)) and cint(CLIST_DRAW_DRAG_RECT)) != 0'i32 + +proc CLIST_ROW_get*(`glist_`: PGList): PCListRow = + result = cast[PCListRow](`glist_`.data) + +when false: + proc CELL_TEXT_get*(cell: pointer): PCellText = + result = cast[PCellText](addr((cell))) + + proc CELL_PIXMAP_get*(cell: pointer): PCellPixmap = + result = cast[PCellPixmap](addr((cell))) + + proc CELL_PIXTEXT_get*(cell: pointer): PCellPixText = + result = cast[PCellPixText](addr((cell))) + + proc CELL_WIDGET_get*(cell: pointer): PCellWidget = + result = cast[PCellWidget](addr((cell))) + +proc visible*(a: var TCListColumn): guint = + result = (a.flag0 and bm_TGtkCListColumn_visible) shr + bp_TGtkCListColumn_visible + +proc set_visible*(a: var TCListColumn, `visible`: guint) = + a.flag0 = a.flag0 or + (int16(`visible` shl bp_TGtkCListColumn_visible) and + bm_TGtkCListColumn_visible) + +proc width_set*(a: var TCListColumn): guint = + result = (a.flag0 and bm_TGtkCListColumn_width_set) shr + bp_TGtkCListColumn_width_set + +proc set_width_set*(a: var TCListColumn, `width_set`: guint) = + a.flag0 = a.flag0 or + (int16(`width_set` shl bp_TGtkCListColumn_width_set) and + bm_TGtkCListColumn_width_set) + +proc resizeable*(a: var TCListColumn): guint = + result = (a.flag0 and bm_TGtkCListColumn_resizeable) shr + bp_TGtkCListColumn_resizeable + +proc set_resizeable*(a: var TCListColumn, `resizeable`: guint) = + a.flag0 = a.flag0 or + (int16(`resizeable` shl bp_TGtkCListColumn_resizeable) and + bm_TGtkCListColumn_resizeable) + +proc auto_resize*(a: var TCListColumn): guint = + result = (a.flag0 and bm_TGtkCListColumn_auto_resize) shr + bp_TGtkCListColumn_auto_resize + +proc set_auto_resize*(a: var TCListColumn, `auto_resize`: guint) = + a.flag0 = a.flag0 or + (int16(`auto_resize` shl bp_TGtkCListColumn_auto_resize) and + bm_TGtkCListColumn_auto_resize) + +proc button_passive*(a: var TCListColumn): guint = + result = (a.flag0 and bm_TGtkCListColumn_button_passive) shr + bp_TGtkCListColumn_button_passive + +proc set_button_passive*(a: var TCListColumn, `button_passive`: guint) = + a.flag0 = a.flag0 or + (int16(`button_passive` shl bp_TGtkCListColumn_button_passive) and + bm_TGtkCListColumn_button_passive) + +proc fg_set*(a: var TCListRow): guint = + result = (a.flag0 and bm_TGtkCListRow_fg_set) shr bp_TGtkCListRow_fg_set + +proc set_fg_set*(a: var TCListRow, `fg_set`: guint) = + a.flag0 = a.flag0 or + (int16(`fg_set` shl bp_TGtkCListRow_fg_set) and bm_TGtkCListRow_fg_set) + +proc bg_set*(a: var TCListRow): guint = + result = (a.flag0 and bm_TGtkCListRow_bg_set) shr bp_TGtkCListRow_bg_set + +proc set_bg_set*(a: var TCListRow, `bg_set`: guint) = + a.flag0 = a.flag0 or + (int16(`bg_set` shl bp_TGtkCListRow_bg_set) and bm_TGtkCListRow_bg_set) + +proc selectable*(a: var TCListRow): guint = + result = (a.flag0 and bm_TGtkCListRow_selectable) shr + bp_TGtkCListRow_selectable + +proc set_selectable*(a: var TCListRow, `selectable`: guint) = + a.flag0 = a.flag0 or + (int16(`selectable` shl bp_TGtkCListRow_selectable) and + bm_TGtkCListRow_selectable) + +proc TYPE_DIALOG*(): GType = + result = dialog_get_type() + +proc DIALOG*(obj: pointer): PDialog = + result = cast[PDialog](CHECK_CAST(obj, TYPE_DIALOG())) + +proc DIALOG_CLASS*(klass: pointer): PDialogClass = + result = cast[PDialogClass](CHECK_CLASS_CAST(klass, TYPE_DIALOG())) + +proc IS_DIALOG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_DIALOG()) + +proc IS_DIALOG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_DIALOG()) + +proc DIALOG_GET_CLASS*(obj: pointer): PDialogClass = + result = cast[PDialogClass](CHECK_GET_CLASS(obj, TYPE_DIALOG())) + +proc TYPE_VBOX*(): GType = + result = vbox_get_type() + +proc VBOX*(obj: pointer): PVBox = + result = cast[PVBox](CHECK_CAST(obj, TYPE_VBOX())) + +proc VBOX_CLASS*(klass: pointer): PVBoxClass = + result = cast[PVBoxClass](CHECK_CLASS_CAST(klass, TYPE_VBOX())) + +proc IS_VBOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VBOX()) + +proc IS_VBOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VBOX()) + +proc VBOX_GET_CLASS*(obj: pointer): PVBoxClass = + result = cast[PVBoxClass](CHECK_GET_CLASS(obj, TYPE_VBOX())) + +proc TYPE_COLOR_SELECTION*(): GType = + result = color_selection_get_type() + +proc COLOR_SELECTION*(obj: pointer): PColorSelection = + result = cast[PColorSelection](CHECK_CAST(obj, TYPE_COLOR_SELECTION())) + +proc COLOR_SELECTION_CLASS*(klass: pointer): PColorSelectionClass = + result = cast[PColorSelectionClass](CHECK_CLASS_CAST(klass, + TYPE_COLOR_SELECTION())) + +proc IS_COLOR_SELECTION*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_COLOR_SELECTION()) + +proc IS_COLOR_SELECTION_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_COLOR_SELECTION()) + +proc COLOR_SELECTION_GET_CLASS*(obj: pointer): PColorSelectionClass = + result = cast[PColorSelectionClass](CHECK_GET_CLASS(obj, + TYPE_COLOR_SELECTION())) + +proc TYPE_COLOR_SELECTION_DIALOG*(): GType = + result = color_selection_dialog_get_type() + +proc COLOR_SELECTION_DIALOG*(obj: pointer): PColorSelectionDialog = + result = cast[PColorSelectionDialog](CHECK_CAST(obj, + TYPE_COLOR_SELECTION_DIALOG())) + +proc COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): PColorSelectionDialogClass = + result = cast[PColorSelectionDialogClass](CHECK_CLASS_CAST(klass, + TYPE_COLOR_SELECTION_DIALOG())) + +proc IS_COLOR_SELECTION_DIALOG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_COLOR_SELECTION_DIALOG()) + +proc IS_COLOR_SELECTION_DIALOG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_COLOR_SELECTION_DIALOG()) + +proc COLOR_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PColorSelectionDialogClass = + result = cast[PColorSelectionDialogClass](CHECK_GET_CLASS(obj, + TYPE_COLOR_SELECTION_DIALOG())) + +proc TYPE_HBOX*(): GType = + result = hbox_get_type() + +proc HBOX*(obj: pointer): PHBox = + result = cast[PHBox](CHECK_CAST(obj, TYPE_HBOX())) + +proc HBOX_CLASS*(klass: pointer): PHBoxClass = + result = cast[PHBoxClass](CHECK_CLASS_CAST(klass, TYPE_HBOX())) + +proc IS_HBOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HBOX()) + +proc IS_HBOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HBOX()) + +proc HBOX_GET_CLASS*(obj: pointer): PHBoxClass = + result = cast[PHBoxClass](CHECK_GET_CLASS(obj, TYPE_HBOX())) + +proc TYPE_COMBO*(): GType = + result = combo_get_type() + +proc COMBO*(obj: pointer): PCombo = + result = cast[PCombo](CHECK_CAST(obj, TYPE_COMBO())) + +proc COMBO_CLASS*(klass: pointer): PComboClass = + result = cast[PComboClass](CHECK_CLASS_CAST(klass, TYPE_COMBO())) + +proc IS_COMBO*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_COMBO()) + +proc IS_COMBO_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_COMBO()) + +proc COMBO_GET_CLASS*(obj: pointer): PComboClass = + result = cast[PComboClass](CHECK_GET_CLASS(obj, TYPE_COMBO())) + +proc value_in_list*(a: var TCombo): guint = + result = (a.Comboflag0 and bm_TGtkCombo_value_in_list) shr + bp_TGtkCombo_value_in_list + +proc set_value_in_list*(a: var TCombo, `value_in_list`: guint) = + a.Comboflag0 = a.Comboflag0 or + (int16(`value_in_list` shl bp_TGtkCombo_value_in_list) and + bm_TGtkCombo_value_in_list) + +proc ok_if_empty*(a: var TCombo): guint = + result = (a.Comboflag0 and bm_TGtkCombo_ok_if_empty) shr + bp_TGtkCombo_ok_if_empty + +proc set_ok_if_empty*(a: var TCombo, `ok_if_empty`: guint) = + a.Comboflag0 = a.Comboflag0 or + (int16(`ok_if_empty` shl bp_TGtkCombo_ok_if_empty) and + bm_TGtkCombo_ok_if_empty) + +proc case_sensitive*(a: var TCombo): guint = + result = (a.Comboflag0 and bm_TGtkCombo_case_sensitive) shr + bp_TGtkCombo_case_sensitive + +proc set_case_sensitive*(a: var TCombo, `case_sensitive`: guint) = + a.Comboflag0 = a.Comboflag0 or + (int16(`case_sensitive` shl bp_TGtkCombo_case_sensitive) and + bm_TGtkCombo_case_sensitive) + +proc use_arrows*(a: var TCombo): guint = + result = (a.Comboflag0 and bm_TGtkCombo_use_arrows) shr + bp_TGtkCombo_use_arrows + +proc set_use_arrows*(a: var TCombo, `use_arrows`: guint) = + a.Comboflag0 = a.Comboflag0 or + (int16(`use_arrows` shl bp_TGtkCombo_use_arrows) and + bm_TGtkCombo_use_arrows) + +proc use_arrows_always*(a: var TCombo): guint = + result = (a.Comboflag0 and bm_TGtkCombo_use_arrows_always) shr + bp_TGtkCombo_use_arrows_always + +proc set_use_arrows_always*(a: var TCombo, `use_arrows_always`: guint) = + a.Comboflag0 = a.Comboflag0 or + (int16(`use_arrows_always` shl bp_TGtkCombo_use_arrows_always) and + bm_TGtkCombo_use_arrows_always) + +proc TYPE_CTREE*(): GType = + result = ctree_get_type() + +proc CTREE*(obj: pointer): PCTree = + result = cast[PCTree](CHECK_CAST(obj, TYPE_CTREE())) + +proc CTREE_CLASS*(klass: pointer): PCTreeClass = + result = cast[PCTreeClass](CHECK_CLASS_CAST(klass, TYPE_CTREE())) + +proc IS_CTREE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CTREE()) + +proc IS_CTREE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CTREE()) + +proc CTREE_GET_CLASS*(obj: pointer): PCTreeClass = + result = cast[PCTreeClass](CHECK_GET_CLASS(obj, TYPE_CTREE())) + +proc CTREE_ROW*(`node_`: TAddress): PCTreeRow = + result = cast[PCTreeRow]((cast[PGList](`node_`)).data) + +proc CTREE_NODE*(`node_`: TAddress): PCTreeNode = + result = cast[PCTreeNode](`node_`) + +proc CTREE_NODE_NEXT*(`nnode_`: TAddress): PCTreeNode = + result = cast[PCTreeNode]((cast[PGList](`nnode_`)).next) + +proc CTREE_NODE_PREV*(`pnode_`: TAddress): PCTreeNode = + result = cast[PCTreeNode]((cast[PGList](`pnode_`)).prev) + +proc CTREE_FUNC*(`func_`: TAddress): TCTreeFunc = + result = cast[TCTreeFunc](`func_`) + +proc TYPE_CTREE_NODE*(): GType = + result = ctree_node_get_type() + +proc line_style*(a: var TCTree): guint = + result = (a.CTreeflag0 and bm_TGtkCTree_line_style) shr + bp_TGtkCTree_line_style + +proc set_line_style*(a: var TCTree, `line_style`: guint) = + a.CTreeflag0 = a.CTreeflag0 or + (int16(`line_style` shl bp_TGtkCTree_line_style) and + bm_TGtkCTree_line_style) + +proc expander_style*(a: var TCTree): guint = + result = (a.CTreeflag0 and bm_TGtkCTree_expander_style) shr + bp_TGtkCTree_expander_style + +proc set_expander_style*(a: var TCTree, `expander_style`: guint) = + a.CTreeflag0 = a.CTreeflag0 or + (int16(`expander_style` shl bp_TGtkCTree_expander_style) and + bm_TGtkCTree_expander_style) + +proc show_stub*(a: var TCTree): guint = + result = (a.CTreeflag0 and bm_TGtkCTree_show_stub) shr + bp_TGtkCTree_show_stub + +proc set_show_stub*(a: var TCTree, `show_stub`: guint) = + a.CTreeflag0 = a.CTreeflag0 or + (int16(`show_stub` shl bp_TGtkCTree_show_stub) and + bm_TGtkCTree_show_stub) + +proc is_leaf*(a: var TCTreeRow): guint = + result = (a.CTreeRow_flag0 and bm_TGtkCTreeRow_is_leaf) shr + bp_TGtkCTreeRow_is_leaf + +proc set_is_leaf*(a: var TCTreeRow, `is_leaf`: guint) = + a.CTreeRow_flag0 = a.CTreeRow_flag0 or + (int16(`is_leaf` shl bp_TGtkCTreeRow_is_leaf) and + bm_TGtkCTreeRow_is_leaf) + +proc expanded*(a: var TCTreeRow): guint = + result = (a.CTreeRow_flag0 and bm_TGtkCTreeRow_expanded) shr + bp_TGtkCTreeRow_expanded + +proc set_expanded*(a: var TCTreeRow, `expanded`: guint) = + a.CTreeRow_flag0 = a.CTreeRowflag0 or + (int16(`expanded` shl bp_TGtkCTreeRow_expanded) and + bm_TGtkCTreeRow_expanded) + +proc ctree_set_reorderable*(t: pointer, r: bool) = + clist_set_reorderable(cast[PCList](t), r) + +proc TYPE_DRAWING_AREA*(): GType = + result = drawing_area_get_type() + +proc DRAWING_AREA*(obj: pointer): PDrawingArea = + result = cast[PDrawingArea](CHECK_CAST(obj, TYPE_DRAWING_AREA())) + +proc DRAWING_AREA_CLASS*(klass: pointer): PDrawingAreaClass = + result = cast[PDrawingAreaClass](CHECK_CLASS_CAST(klass, TYPE_DRAWING_AREA())) + +proc IS_DRAWING_AREA*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_DRAWING_AREA()) + +proc IS_DRAWING_AREA_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_DRAWING_AREA()) + +proc DRAWING_AREA_GET_CLASS*(obj: pointer): PDrawingAreaClass = + result = cast[PDrawingAreaClass](CHECK_GET_CLASS(obj, TYPE_DRAWING_AREA())) + +proc TYPE_CURVE*(): GType = + result = curve_get_type() + +proc CURVE*(obj: pointer): PCurve = + result = cast[PCurve](CHECK_CAST(obj, TYPE_CURVE())) + +proc CURVE_CLASS*(klass: pointer): PCurveClass = + result = cast[PCurveClass](CHECK_CLASS_CAST(klass, TYPE_CURVE())) + +proc IS_CURVE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_CURVE()) + +proc IS_CURVE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_CURVE()) + +proc CURVE_GET_CLASS*(obj: pointer): PCurveClass = + result = cast[PCurveClass](CHECK_GET_CLASS(obj, TYPE_CURVE())) + +proc TYPE_EDITABLE*(): GType = + result = editable_get_type() + +proc EDITABLE*(obj: pointer): PEditable = + result = cast[PEditable](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_EDITABLE())) + +proc EDITABLE_CLASS*(vtable: pointer): PEditableClass = + result = cast[PEditableClass](G_TYPE_CHECK_CLASS_CAST(vtable, TYPE_EDITABLE())) + +proc IS_EDITABLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_EDITABLE()) + +proc IS_EDITABLE_CLASS*(vtable: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(vtable, TYPE_EDITABLE()) + +proc EDITABLE_GET_CLASS*(inst: pointer): PEditableClass = + result = cast[PEditableClass](G_TYPE_INSTANCE_GET_INTERFACE(inst, + TYPE_EDITABLE())) + +proc TYPE_IM_CONTEXT*(): GType = + result = im_context_get_type() + +proc IM_CONTEXT*(obj: pointer): PIMContext = + result = cast[PIMContext](CHECK_CAST(obj, TYPE_IM_CONTEXT())) + +proc IM_CONTEXT_CLASS*(klass: pointer): PIMContextClass = + result = cast[PIMContextClass](CHECK_CLASS_CAST(klass, TYPE_IM_CONTEXT())) + +proc IS_IM_CONTEXT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_IM_CONTEXT()) + +proc IS_IM_CONTEXT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_IM_CONTEXT()) + +proc IM_CONTEXT_GET_CLASS*(obj: pointer): PIMContextClass = + result = cast[PIMContextClass](CHECK_GET_CLASS(obj, TYPE_IM_CONTEXT())) + +proc TYPE_MENU_SHELL*(): GType = + result = menu_shell_get_type() + +proc MENU_SHELL*(obj: pointer): PMenuShell = + result = cast[PMenuShell](CHECK_CAST(obj, TYPE_MENU_SHELL())) + +proc MENU_SHELL_CLASS*(klass: pointer): PMenuShellClass = + result = cast[PMenuShellClass](CHECK_CLASS_CAST(klass, TYPE_MENU_SHELL())) + +proc IS_MENU_SHELL*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MENU_SHELL()) + +proc IS_MENU_SHELL_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MENU_SHELL()) + +proc MENU_SHELL_GET_CLASS*(obj: pointer): PMenuShellClass = + result = cast[PMenuShellClass](CHECK_GET_CLASS(obj, TYPE_MENU_SHELL())) + +proc active*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_active) shr + bp_TGtkMenuShell_active + +proc set_active*(a: var TMenuShell, `active`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`active` shl bp_TGtkMenuShell_active) and + bm_TGtkMenuShell_active) + +proc have_grab*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_have_grab) shr + bp_TGtkMenuShell_have_grab + +proc set_have_grab*(a: var TMenuShell, `have_grab`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`have_grab` shl bp_TGtkMenuShell_have_grab) and + bm_TGtkMenuShell_have_grab) + +proc have_xgrab*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_have_xgrab) shr + bp_TGtkMenuShell_have_xgrab + +proc set_have_xgrab*(a: var TMenuShell, `have_xgrab`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`have_xgrab` shl bp_TGtkMenuShell_have_xgrab) and + bm_TGtkMenuShell_have_xgrab) + +proc ignore_leave*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_ignore_leave) shr + bp_TGtkMenuShell_ignore_leave + +proc set_ignore_leave*(a: var TMenuShell, `ignore_leave`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`ignore_leave` shl bp_TGtkMenuShell_ignore_leave) and + bm_TGtkMenuShell_ignore_leave) + +proc menu_flag*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_menu_flag) shr + bp_TGtkMenuShell_menu_flag + +proc set_menu_flag*(a: var TMenuShell, `menu_flag`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`menu_flag` shl bp_TGtkMenuShell_menu_flag) and + bm_TGtkMenuShell_menu_flag) + +proc ignore_enter*(a: var TMenuShell): guint = + result = (a.MenuShellflag0 and bm_TGtkMenuShell_ignore_enter) shr + bp_TGtkMenuShell_ignore_enter + +proc set_ignore_enter*(a: var TMenuShell, `ignore_enter`: guint) = + a.MenuShellflag0 = a.MenuShellflag0 or + (int16(`ignore_enter` shl bp_TGtkMenuShell_ignore_enter) and + bm_TGtkMenuShell_ignore_enter) + +proc submenu_placement*(a: var TMenuShellClass): guint = + result = (a.MenuShellClassflag0 and bm_TGtkMenuShellClass_submenu_placement) shr + bp_TGtkMenuShellClass_submenu_placement + +proc set_submenu_placement*(a: var TMenuShellClass, `submenu_placement`: guint) = + a.MenuShellClassflag0 = a.MenuShellClassflag0 or + (int16(`submenu_placement` shl bp_TGtkMenuShellClass_submenu_placement) and + bm_TGtkMenuShellClass_submenu_placement) + +proc TYPE_MENU*(): GType = + result = menu_get_type() + +proc MENU*(obj: pointer): PMenu = + result = cast[PMenu](CHECK_CAST(obj, TYPE_MENU())) + +proc MENU_CLASS*(klass: pointer): PMenuClass = + result = cast[PMenuClass](CHECK_CLASS_CAST(klass, TYPE_MENU())) + +proc IS_MENU*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MENU()) + +proc IS_MENU_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MENU()) + +proc MENU_GET_CLASS*(obj: pointer): PMenuClass = + result = cast[PMenuClass](CHECK_GET_CLASS(obj, TYPE_MENU())) + +proc needs_destruction_ref_count*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_needs_destruction_ref_count) shr + bp_TGtkMenu_needs_destruction_ref_count + +proc set_needs_destruction_ref_count*(a: var TMenu, + `needs_destruction_ref_count`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`needs_destruction_ref_count` shl + bp_TGtkMenu_needs_destruction_ref_count) and + bm_TGtkMenu_needs_destruction_ref_count) + +proc torn_off*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_torn_off) shr bp_TGtkMenu_torn_off + +proc set_torn_off*(a: var TMenu, `torn_off`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`torn_off` shl bp_TGtkMenu_torn_off) and bm_TGtkMenu_torn_off) + +proc tearoff_active*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_tearoff_active) shr + bp_TGtkMenu_tearoff_active + +proc set_tearoff_active*(a: var TMenu, `tearoff_active`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`tearoff_active` shl bp_TGtkMenu_tearoff_active) and + bm_TGtkMenu_tearoff_active) + +proc scroll_fast*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_scroll_fast) shr + bp_TGtkMenu_scroll_fast + +proc set_scroll_fast*(a: var TMenu, `scroll_fast`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`scroll_fast` shl bp_TGtkMenu_scroll_fast) and + bm_TGtkMenu_scroll_fast) + +proc upper_arrow_visible*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_upper_arrow_visible) shr + bp_TGtkMenu_upper_arrow_visible + +proc set_upper_arrow_visible*(a: var TMenu, `upper_arrow_visible`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`upper_arrow_visible` shl bp_TGtkMenu_upper_arrow_visible) and + bm_TGtkMenu_upper_arrow_visible) + +proc lower_arrow_visible*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_lower_arrow_visible) shr + bp_TGtkMenu_lower_arrow_visible + +proc set_lower_arrow_visible*(a: var TMenu, `lower_arrow_visible`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`lower_arrow_visible` shl bp_TGtkMenu_lower_arrow_visible) and + bm_TGtkMenu_lower_arrow_visible) + +proc upper_arrow_prelight*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_upper_arrow_prelight) shr + bp_TGtkMenu_upper_arrow_prelight + +proc set_upper_arrow_prelight*(a: var TMenu, `upper_arrow_prelight`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`upper_arrow_prelight` shl bp_TGtkMenu_upper_arrow_prelight) and + bm_TGtkMenu_upper_arrow_prelight) + +proc lower_arrow_prelight*(a: var TMenu): guint = + result = (a.Menuflag0 and bm_TGtkMenu_lower_arrow_prelight) shr + bp_TGtkMenu_lower_arrow_prelight + +proc set_lower_arrow_prelight*(a: var TMenu, `lower_arrow_prelight`: guint) = + a.Menuflag0 = a.Menuflag0 or + (int16(`lower_arrow_prelight` shl bp_TGtkMenu_lower_arrow_prelight) and + bm_TGtkMenu_lower_arrow_prelight) + +proc menu_append*(menu, child: PWidget) = + menu_shell_append(cast[PMenuShell](menu), child) + +proc menu_prepend*(menu, child: PWidget) = + menu_shell_prepend(cast[PMenuShell](menu), child) + +proc menu_insert*(menu, child: PWidget, pos: gint) = + menu_shell_insert(cast[PMenuShell](menu), child, pos) + +proc TYPE_ENTRY*(): GType = + result = entry_get_type() + +proc ENTRY*(obj: pointer): PEntry = + result = cast[PEntry](CHECK_CAST(obj, TYPE_ENTRY())) + +proc ENTRY_CLASS*(klass: pointer): PEntryClass = + result = cast[PEntryClass](CHECK_CLASS_CAST(klass, TYPE_ENTRY())) + +proc IS_ENTRY*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_ENTRY()) + +proc IS_ENTRY_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ENTRY()) + +proc ENTRY_GET_CLASS*(obj: pointer): PEntryClass = + result = cast[PEntryClass](CHECK_GET_CLASS(obj, TYPE_ENTRY())) + +proc editable*(a: var TEntry): guint = + result = (a.Entryflag0 and bm_TGtkEntry_editable) shr bp_TGtkEntry_editable + +proc set_editable*(a: var TEntry, `editable`: guint) = + a.Entryflag0 = a.Entryflag0 or + (int16(`editable` shl bp_TGtkEntry_editable) and bm_TGtkEntry_editable) + +proc visible*(a: var TEntry): guint = + result = (a.Entryflag0 and bm_TGtkEntry_visible) shr bp_TGtkEntry_visible + +proc set_visible*(a: var TEntry, `visible`: guint) = + a.Entryflag0 = a.Entryflag0 or + (int16(`visible` shl bp_TGtkEntry_visible) and bm_TGtkEntry_visible) + +proc overwrite_mode*(a: var TEntry): guint = + result = (a.Entryflag0 and bm_TGtkEntry_overwrite_mode) shr + bp_TGtkEntry_overwrite_mode + +proc set_overwrite_mode*(a: var TEntry, `overwrite_mode`: guint) = + a.Entryflag0 = a.Entryflag0 or + (int16(`overwrite_mode` shl bp_TGtkEntry_overwrite_mode) and + bm_TGtkEntry_overwrite_mode) + +proc in_drag*(a: var TEntry): guint = + result = (a.Entryflag0 and bm_TGtkEntry_in_drag) shr bp_TGtkEntry_in_drag + +proc set_in_drag*(a: var TEntry, `in_drag`: guint) = + a.Entryflag0 = a.Entryflag0 or + (int16(`in_drag` shl bp_TGtkEntry_in_drag) and bm_TGtkEntry_in_drag) + +proc cache_includes_preedit*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_cache_includes_preedit) shr + bp_TGtkEntry_cache_includes_preedit + +proc set_cache_includes_preedit*(a: var TEntry, `cache_includes_preedit`: guint) = + a.flag1 = a.flag1 or + (int16(`cache_includes_preedit` shl bp_TGtkEntry_cache_includes_preedit) and + bm_TGtkEntry_cache_includes_preedit) + +proc need_im_reset*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_need_im_reset) shr + bp_TGtkEntry_need_im_reset + +proc set_need_im_reset*(a: var TEntry, `need_im_reset`: guint) = + a.flag1 = a.flag1 or + (int16(`need_im_reset` shl bp_TGtkEntry_need_im_reset) and + bm_TGtkEntry_need_im_reset) + +proc has_frame*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_has_frame) shr bp_TGtkEntry_has_frame + +proc set_has_frame*(a: var TEntry, `has_frame`: guint) = + a.flag1 = a.flag1 or + (int16(`has_frame` shl bp_TGtkEntry_has_frame) and + bm_TGtkEntry_has_frame) + +proc activates_default*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_activates_default) shr + bp_TGtkEntry_activates_default + +proc set_activates_default*(a: var TEntry, `activates_default`: guint) = + a.flag1 = a.flag1 or + (int16(`activates_default` shl bp_TGtkEntry_activates_default) and + bm_TGtkEntry_activates_default) + +proc cursor_visible*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_cursor_visible) shr + bp_TGtkEntry_cursor_visible + +proc set_cursor_visible*(a: var TEntry, `cursor_visible`: guint) = + a.flag1 = a.flag1 or + (int16(`cursor_visible` shl bp_TGtkEntry_cursor_visible) and + bm_TGtkEntry_cursor_visible) + +proc in_click*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_in_click) shr bp_TGtkEntry_in_click + +proc set_in_click*(a: var TEntry, `in_click`: guint) = + a.flag1 = a.flag1 or + (int16(`in_click` shl bp_TGtkEntry_in_click) and bm_TGtkEntry_in_click) + +proc is_cell_renderer*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_is_cell_renderer) shr + bp_TGtkEntry_is_cell_renderer + +proc set_is_cell_renderer*(a: var TEntry, `is_cell_renderer`: guint) = + a.flag1 = a.flag1 or + (int16(`is_cell_renderer` shl bp_TGtkEntry_is_cell_renderer) and + bm_TGtkEntry_is_cell_renderer) + +proc editing_canceled*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_editing_canceled) shr + bp_TGtkEntry_editing_canceled + +proc set_editing_canceled*(a: var TEntry, `editing_canceled`: guint) = + a.flag1 = a.flag1 or + (int16(`editing_canceled` shl bp_TGtkEntry_editing_canceled) and + bm_TGtkEntry_editing_canceled) + +proc mouse_cursor_obscured*(a: var TEntry): guint = + result = (a.flag1 and bm_TGtkEntry_mouse_cursor_obscured) shr + bp_TGtkEntry_mouse_cursor_obscured + +proc set_mouse_cursor_obscured*(a: var TEntry, `mouse_cursor_obscured`: guint) = + a.flag1 = a.flag1 or + (int16(`mouse_cursor_obscured` shl bp_TGtkEntry_mouse_cursor_obscured) and + bm_TGtkEntry_mouse_cursor_obscured) + +proc TYPE_EVENT_BOX*(): GType = + result = event_box_get_type() + +proc EVENT_BOX*(obj: pointer): PEventBox = + result = cast[PEventBox](CHECK_CAST(obj, TYPE_EVENT_BOX())) + +proc EVENT_BOX_CLASS*(klass: pointer): PEventBoxClass = + result = cast[PEventBoxClass](CHECK_CLASS_CAST(klass, TYPE_EVENT_BOX())) + +proc IS_EVENT_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_EVENT_BOX()) + +proc IS_EVENT_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_EVENT_BOX()) + +proc EVENT_BOX_GET_CLASS*(obj: pointer): PEventBoxClass = + result = cast[PEventBoxClass](CHECK_GET_CLASS(obj, TYPE_EVENT_BOX())) + +proc TYPE_FILE_SELECTION*(): GType = + result = file_selection_get_type() + +proc FILE_SELECTION*(obj: pointer): PFileSelection = + result = cast[PFileSelection](CHECK_CAST(obj, TYPE_FILE_SELECTION())) + +proc FILE_SELECTION_CLASS*(klass: pointer): PFileSelectionClass = + result = cast[PFileSelectionClass](CHECK_CLASS_CAST(klass, + TYPE_FILE_SELECTION())) + +proc IS_FILE_SELECTION*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_FILE_SELECTION()) + +proc IS_FILE_SELECTION_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_FILE_SELECTION()) + +proc FILE_SELECTION_GET_CLASS*(obj: pointer): PFileSelectionClass = + result = cast[PFileSelectionClass](CHECK_GET_CLASS(obj, TYPE_FILE_SELECTION())) + +proc TYPE_FIXED*(): GType = + result = fixed_get_type() + +proc FIXED*(obj: pointer): PFixed = + result = cast[PFixed](CHECK_CAST(obj, TYPE_FIXED())) + +proc FIXED_CLASS*(klass: pointer): PFixedClass = + result = cast[PFixedClass](CHECK_CLASS_CAST(klass, TYPE_FIXED())) + +proc IS_FIXED*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_FIXED()) + +proc IS_FIXED_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_FIXED()) + +proc FIXED_GET_CLASS*(obj: pointer): PFixedClass = + result = cast[PFixedClass](CHECK_GET_CLASS(obj, TYPE_FIXED())) + +proc TYPE_FONT_SELECTION*(): GType = + result = font_selection_get_type() + +proc FONT_SELECTION*(obj: pointer): PFontSelection = + result = cast[PFontSelection](CHECK_CAST(obj, TYPE_FONT_SELECTION())) + +proc FONT_SELECTION_CLASS*(klass: pointer): PFontSelectionClass = + result = cast[PFontSelectionClass](CHECK_CLASS_CAST(klass, + TYPE_FONT_SELECTION())) + +proc IS_FONT_SELECTION*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_FONT_SELECTION()) + +proc IS_FONT_SELECTION_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_FONT_SELECTION()) + +proc FONT_SELECTION_GET_CLASS*(obj: pointer): PFontSelectionClass = + result = cast[PFontSelectionClass](CHECK_GET_CLASS(obj, TYPE_FONT_SELECTION())) + +proc TYPE_FONT_SELECTION_DIALOG*(): GType = + result = font_selection_dialog_get_type() + +proc FONT_SELECTION_DIALOG*(obj: pointer): PFontSelectionDialog = + result = cast[PFontSelectionDialog](CHECK_CAST(obj, + TYPE_FONT_SELECTION_DIALOG())) + +proc FONT_SELECTION_DIALOG_CLASS*(klass: pointer): PFontSelectionDialogClass = + result = cast[PFontSelectionDialogClass](CHECK_CLASS_CAST(klass, + TYPE_FONT_SELECTION_DIALOG())) + +proc IS_FONT_SELECTION_DIALOG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_FONT_SELECTION_DIALOG()) + +proc IS_FONT_SELECTION_DIALOG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_FONT_SELECTION_DIALOG()) + +proc FONT_SELECTION_DIALOG_GET_CLASS*(obj: pointer): PFontSelectionDialogClass = + result = cast[PFontSelectionDialogClass](CHECK_GET_CLASS(obj, + TYPE_FONT_SELECTION_DIALOG())) + +proc TYPE_GAMMA_CURVE*(): GType = + result = gamma_curve_get_type() + +proc GAMMA_CURVE*(obj: pointer): PGammaCurve = + result = cast[PGammaCurve](CHECK_CAST(obj, TYPE_GAMMA_CURVE())) + +proc GAMMA_CURVE_CLASS*(klass: pointer): PGammaCurveClass = + result = cast[PGammaCurveClass](CHECK_CLASS_CAST(klass, TYPE_GAMMA_CURVE())) + +proc IS_GAMMA_CURVE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_GAMMA_CURVE()) + +proc IS_GAMMA_CURVE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_GAMMA_CURVE()) + +proc GAMMA_CURVE_GET_CLASS*(obj: pointer): PGammaCurveClass = + result = cast[PGammaCurveClass](CHECK_GET_CLASS(obj, TYPE_GAMMA_CURVE())) + +proc TYPE_HANDLE_BOX*(): GType = + result = handle_box_get_type() + +proc HANDLE_BOX*(obj: pointer): PHandleBox = + result = cast[PHandleBox](CHECK_CAST(obj, TYPE_HANDLE_BOX())) + +proc HANDLE_BOX_CLASS*(klass: pointer): PHandleBoxClass = + result = cast[PHandleBoxClass](CHECK_CLASS_CAST(klass, TYPE_HANDLE_BOX())) + +proc IS_HANDLE_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HANDLE_BOX()) + +proc IS_HANDLE_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HANDLE_BOX()) + +proc HANDLE_BOX_GET_CLASS*(obj: pointer): PHandleBoxClass = + result = cast[PHandleBoxClass](CHECK_GET_CLASS(obj, TYPE_HANDLE_BOX())) + +proc handle_position*(a: var THandleBox): guint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_handle_position) shr + bp_TGtkHandleBox_handle_position + +proc set_handle_position*(a: var THandleBox, `handle_position`: guint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`handle_position` shl bp_TGtkHandleBox_handle_position) and + bm_TGtkHandleBox_handle_position) + +proc float_window_mapped*(a: var THandleBox): guint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_float_window_mapped) shr + bp_TGtkHandleBox_float_window_mapped + +proc set_float_window_mapped*(a: var THandleBox, `float_window_mapped`: guint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`float_window_mapped` shl bp_TGtkHandleBox_float_window_mapped) and + bm_TGtkHandleBox_float_window_mapped) + +proc child_detached*(a: var THandleBox): guint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_child_detached) shr + bp_TGtkHandleBox_child_detached + +proc set_child_detached*(a: var THandleBox, `child_detached`: guint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`child_detached` shl bp_TGtkHandleBox_child_detached) and + bm_TGtkHandleBox_child_detached) + +proc in_drag*(a: var THandleBox): guint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_in_drag) shr + bp_TGtkHandleBox_in_drag + +proc set_in_drag*(a: var THandleBox, `in_drag`: guint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`in_drag` shl bp_TGtkHandleBox_in_drag) and + bm_TGtkHandleBox_in_drag) + +proc shrink_on_detach*(a: var THandleBox): guint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_shrink_on_detach) shr + bp_TGtkHandleBox_shrink_on_detach + +proc set_shrink_on_detach*(a: var THandleBox, `shrink_on_detach`: guint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`shrink_on_detach` shl bp_TGtkHandleBox_shrink_on_detach) and + bm_TGtkHandleBox_shrink_on_detach) + +proc snap_edge*(a: var THandleBox): gint = + result = (a.HandleBoxflag0 and bm_TGtkHandleBox_snap_edge) shr + bp_TGtkHandleBox_snap_edge + +proc set_snap_edge*(a: var THandleBox, `snap_edge`: gint) = + a.HandleBoxflag0 = a.HandleBoxflag0 or + (int16(`snap_edge` shl bp_TGtkHandleBox_snap_edge) and + bm_TGtkHandleBox_snap_edge) + +proc TYPE_PANED*(): GType = + result = paned_get_type() + +proc PANED*(obj: pointer): PPaned = + result = cast[PPaned](CHECK_CAST(obj, TYPE_PANED())) + +proc PANED_CLASS*(klass: pointer): PPanedClass = + result = cast[PPanedClass](CHECK_CLASS_CAST(klass, TYPE_PANED())) + +proc IS_PANED*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PANED()) + +proc IS_PANED_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PANED()) + +proc PANED_GET_CLASS*(obj: pointer): PPanedClass = + result = cast[PPanedClass](CHECK_GET_CLASS(obj, TYPE_PANED())) + +proc position_set*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_position_set) shr + bp_TGtkPaned_position_set + +proc set_position_set*(a: var TPaned, `position_set`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`position_set` shl bp_TGtkPaned_position_set) and + bm_TGtkPaned_position_set) + +proc in_drag*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_in_drag) shr bp_TGtkPaned_in_drag + +proc set_in_drag*(a: var TPaned, `in_drag`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`in_drag` shl bp_TGtkPaned_in_drag) and bm_TGtkPaned_in_drag) + +proc child1_shrink*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_child1_shrink) shr + bp_TGtkPaned_child1_shrink + +proc set_child1_shrink*(a: var TPaned, `child1_shrink`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`child1_shrink` shl bp_TGtkPaned_child1_shrink) and + bm_TGtkPaned_child1_shrink) + +proc child1_resize*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_child1_resize) shr + bp_TGtkPaned_child1_resize + +proc set_child1_resize*(a: var TPaned, `child1_resize`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`child1_resize` shl bp_TGtkPaned_child1_resize) and + bm_TGtkPaned_child1_resize) + +proc child2_shrink*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_child2_shrink) shr + bp_TGtkPaned_child2_shrink + +proc set_child2_shrink*(a: var TPaned, `child2_shrink`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`child2_shrink` shl bp_TGtkPaned_child2_shrink) and + bm_TGtkPaned_child2_shrink) + +proc child2_resize*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_child2_resize) shr + bp_TGtkPaned_child2_resize + +proc set_child2_resize*(a: var TPaned, `child2_resize`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`child2_resize` shl bp_TGtkPaned_child2_resize) and + bm_TGtkPaned_child2_resize) + +proc orientation*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_orientation) shr + bp_TGtkPaned_orientation + +proc set_orientation*(a: var TPaned, `orientation`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`orientation` shl bp_TGtkPaned_orientation) and + bm_TGtkPaned_orientation) + +proc in_recursion*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_in_recursion) shr + bp_TGtkPaned_in_recursion + +proc set_in_recursion*(a: var TPaned, `in_recursion`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`in_recursion` shl bp_TGtkPaned_in_recursion) and + bm_TGtkPaned_in_recursion) + +proc handle_prelit*(a: var TPaned): guint = + result = (a.Panedflag0 and bm_TGtkPaned_handle_prelit) shr + bp_TGtkPaned_handle_prelit + +proc set_handle_prelit*(a: var TPaned, `handle_prelit`: guint) = + a.Panedflag0 = a.Panedflag0 or + (int16(`handle_prelit` shl bp_TGtkPaned_handle_prelit) and + bm_TGtkPaned_handle_prelit) + +proc paned_gutter_size*(p: pointer, s: gint) = + if (p != nil) and (s != 0'i32): nil + +proc paned_set_gutter_size*(p: pointer, s: gint) = + if (p != nil) and (s != 0'i32): nil + +proc TYPE_HBUTTON_BOX*(): GType = + result = hbutton_box_get_type() + +proc HBUTTON_BOX*(obj: pointer): PHButtonBox = + result = cast[PHButtonBox](CHECK_CAST(obj, TYPE_HBUTTON_BOX())) + +proc HBUTTON_BOX_CLASS*(klass: pointer): PHButtonBoxClass = + result = cast[PHButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_HBUTTON_BOX())) + +proc IS_HBUTTON_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HBUTTON_BOX()) + +proc IS_HBUTTON_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HBUTTON_BOX()) + +proc HBUTTON_BOX_GET_CLASS*(obj: pointer): PHButtonBoxClass = + result = cast[PHButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_HBUTTON_BOX())) + +proc TYPE_HPANED*(): GType = + result = hpaned_get_type() + +proc HPANED*(obj: pointer): PHPaned = + result = cast[PHPaned](CHECK_CAST(obj, TYPE_HPANED())) + +proc HPANED_CLASS*(klass: pointer): PHPanedClass = + result = cast[PHPanedClass](CHECK_CLASS_CAST(klass, TYPE_HPANED())) + +proc IS_HPANED*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HPANED()) + +proc IS_HPANED_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HPANED()) + +proc HPANED_GET_CLASS*(obj: pointer): PHPanedClass = + result = cast[PHPanedClass](CHECK_GET_CLASS(obj, TYPE_HPANED())) + +proc TYPE_RULER*(): GType = + result = ruler_get_type() + +proc RULER*(obj: pointer): PRuler = + result = cast[PRuler](CHECK_CAST(obj, TYPE_RULER())) + +proc RULER_CLASS*(klass: pointer): PRulerClass = + result = cast[PRulerClass](CHECK_CLASS_CAST(klass, TYPE_RULER())) + +proc IS_RULER*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_RULER()) + +proc IS_RULER_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_RULER()) + +proc RULER_GET_CLASS*(obj: pointer): PRulerClass = + result = cast[PRulerClass](CHECK_GET_CLASS(obj, TYPE_RULER())) + +proc TYPE_HRULER*(): GType = + result = hruler_get_type() + +proc HRULER*(obj: pointer): PHRuler = + result = cast[PHRuler](CHECK_CAST(obj, TYPE_HRULER())) + +proc HRULER_CLASS*(klass: pointer): PHRulerClass = + result = cast[PHRulerClass](CHECK_CLASS_CAST(klass, TYPE_HRULER())) + +proc IS_HRULER*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HRULER()) + +proc IS_HRULER_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HRULER()) + +proc HRULER_GET_CLASS*(obj: pointer): PHRulerClass = + result = cast[PHRulerClass](CHECK_GET_CLASS(obj, TYPE_HRULER())) + +proc TYPE_SETTINGS*(): GType = + result = settings_get_type() + +proc SETTINGS*(obj: pointer): PSettings = + result = cast[PSettings](CHECK_CAST(obj, TYPE_SETTINGS())) + +proc SETTINGS_CLASS*(klass: pointer): PSettingsClass = + result = cast[PSettingsClass](CHECK_CLASS_CAST(klass, TYPE_SETTINGS())) + +proc IS_SETTINGS*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SETTINGS()) + +proc IS_SETTINGS_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SETTINGS()) + +proc SETTINGS_GET_CLASS*(obj: pointer): PSettingsClass = + result = cast[PSettingsClass](CHECK_GET_CLASS(obj, TYPE_SETTINGS())) + +proc TYPE_RC_STYLE*(): GType = + result = rc_style_get_type() + +proc RC_STYLE_get*(anObject: pointer): PRcStyle = + result = cast[PRcStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_RC_STYLE())) + +proc RC_STYLE_CLASS*(klass: pointer): PRcStyleClass = + result = cast[PRcStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_RC_STYLE())) + +proc IS_RC_STYLE*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_RC_STYLE()) + +proc IS_RC_STYLE_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_RC_STYLE()) + +proc RC_STYLE_GET_CLASS*(obj: pointer): PRcStyleClass = + result = cast[PRcStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_RC_STYLE())) + +proc engine_specified*(a: var TRcStyle): guint = + result = (a.RcStyleflag0 and bm_TGtkRcStyle_engine_specified) shr + bp_TGtkRcStyle_engine_specified + +proc set_engine_specified*(a: var TRcStyle, `engine_specified`: guint) = + a.RcStyleflag0 = a.RcStyleflag0 or + (int16(`engine_specified` shl bp_TGtkRcStyle_engine_specified) and + bm_TGtkRcStyle_engine_specified) + +proc TYPE_STYLE*(): GType = + result = style_get_type() + +proc STYLE*(anObject: pointer): PStyle = + result = cast[PStyle](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_STYLE())) + +proc STYLE_CLASS*(klass: pointer): PStyleClass = + result = cast[PStyleClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_STYLE())) + +proc IS_STYLE*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_STYLE()) + +proc IS_STYLE_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_STYLE()) + +proc STYLE_GET_CLASS*(obj: pointer): PStyleClass = + result = cast[PStyleClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_STYLE())) + +proc TYPE_BORDER*(): GType = + result = border_get_type() + +proc STYLE_ATTACHED*(style: pointer): bool = + result = ((STYLE(style)).attach_count) > 0'i32 + +proc style_apply_default_pixmap*(style: PStyle, window: PGdkWindow, + state_type: TStateType, area: PGdkRectangle, + x: gint, y: gint, width: gint, height: gint) = + style_apply_default_background(style, window, true, state_type, area, x, y, + width, height) + +proc TYPE_RANGE*(): GType = + result = range_get_type() + +proc RANGE*(obj: pointer): PRange = + result = cast[PRange](CHECK_CAST(obj, TYPE_RANGE())) + +proc RANGE_CLASS*(klass: pointer): PRangeClass = + result = cast[PRangeClass](CHECK_CLASS_CAST(klass, TYPE_RANGE())) + +proc IS_RANGE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_RANGE()) + +proc IS_RANGE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_RANGE()) + +proc RANGE_GET_CLASS*(obj: pointer): PRangeClass = + result = cast[PRangeClass](CHECK_GET_CLASS(obj, TYPE_RANGE())) + +proc inverted*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_inverted) shr bp_TGtkRange_inverted + +proc set_inverted*(a: var TRange, `inverted`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`inverted` shl bp_TGtkRange_inverted) and bm_TGtkRange_inverted) + +proc flippable*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_flippable) shr + bp_TGtkRange_flippable + +proc set_flippable*(a: var TRange, `flippable`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`flippable` shl bp_TGtkRange_flippable) and + bm_TGtkRange_flippable) + +proc has_stepper_a*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_a) shr + bp_TGtkRange_has_stepper_a + +proc set_has_stepper_a*(a: var TRange, `has_stepper_a`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`has_stepper_a` shl bp_TGtkRange_has_stepper_a) and + bm_TGtkRange_has_stepper_a) + +proc has_stepper_b*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_b) shr + bp_TGtkRange_has_stepper_b + +proc set_has_stepper_b*(a: var TRange, `has_stepper_b`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`has_stepper_b` shl bp_TGtkRange_has_stepper_b) and + bm_TGtkRange_has_stepper_b) + +proc has_stepper_c*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_c) shr + bp_TGtkRange_has_stepper_c + +proc set_has_stepper_c*(a: var TRange, `has_stepper_c`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`has_stepper_c` shl bp_TGtkRange_has_stepper_c) and + bm_TGtkRange_has_stepper_c) + +proc has_stepper_d*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_has_stepper_d) shr + bp_TGtkRange_has_stepper_d + +proc set_has_stepper_d*(a: var TRange, `has_stepper_d`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`has_stepper_d` shl bp_TGtkRange_has_stepper_d) and + bm_TGtkRange_has_stepper_d) + +proc need_recalc*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_need_recalc) shr + bp_TGtkRange_need_recalc + +proc set_need_recalc*(a: var TRange, `need_recalc`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`need_recalc` shl bp_TGtkRange_need_recalc) and + bm_TGtkRange_need_recalc) + +proc slider_size_fixed*(a: var TRange): guint = + result = (a.Rangeflag0 and bm_TGtkRange_slider_size_fixed) shr + bp_TGtkRange_slider_size_fixed + +proc set_slider_size_fixed*(a: var TRange, `slider_size_fixed`: guint) = + a.Rangeflag0 = a.Rangeflag0 or + (int16(`slider_size_fixed` shl bp_TGtkRange_slider_size_fixed) and + bm_TGtkRange_slider_size_fixed) + +proc trough_click_forward*(a: var TRange): guint = + result = (a.flag1 and bm_TGtkRange_trough_click_forward) shr + bp_TGtkRange_trough_click_forward + +proc set_trough_click_forward*(a: var TRange, `trough_click_forward`: guint) = + a.flag1 = a.flag1 or + (int16(`trough_click_forward` shl bp_TGtkRange_trough_click_forward) and + bm_TGtkRange_trough_click_forward) + +proc update_pending*(a: var TRange): guint = + result = (a.flag1 and bm_TGtkRange_update_pending) shr + bp_TGtkRange_update_pending + +proc set_update_pending*(a: var TRange, `update_pending`: guint) = + a.flag1 = a.flag1 or + (int16(`update_pending` shl bp_TGtkRange_update_pending) and + bm_TGtkRange_update_pending) + +proc TYPE_SCALE*(): GType = + result = scale_get_type() + +proc SCALE*(obj: pointer): PScale = + result = cast[PScale](CHECK_CAST(obj, TYPE_SCALE())) + +proc SCALE_CLASS*(klass: pointer): PScaleClass = + result = cast[PScaleClass](CHECK_CLASS_CAST(klass, TYPE_SCALE())) + +proc IS_SCALE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SCALE()) + +proc IS_SCALE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SCALE()) + +proc SCALE_GET_CLASS*(obj: pointer): PScaleClass = + result = cast[PScaleClass](CHECK_GET_CLASS(obj, TYPE_SCALE())) + +proc draw_value*(a: var TScale): guint = + result = (a.Scaleflag0 and bm_TGtkScale_draw_value) shr + bp_TGtkScale_draw_value + +proc set_draw_value*(a: var TScale, `draw_value`: guint) = + a.Scaleflag0 = a.Scaleflag0 or + (int16(`draw_value` shl bp_TGtkScale_draw_value) and + bm_TGtkScale_draw_value) + +proc value_pos*(a: var TScale): guint = + result = (a.Scaleflag0 and bm_TGtkScale_value_pos) shr + bp_TGtkScale_value_pos + +proc set_value_pos*(a: var TScale, `value_pos`: guint) = + a.Scaleflag0 = a.Scaleflag0 or + (int16(`value_pos` shl bp_TGtkScale_value_pos) and + bm_TGtkScale_value_pos) + +proc TYPE_HSCALE*(): GType = + result = hscale_get_type() + +proc HSCALE*(obj: pointer): PHScale = + result = cast[PHScale](CHECK_CAST(obj, TYPE_HSCALE())) + +proc HSCALE_CLASS*(klass: pointer): PHScaleClass = + result = cast[PHScaleClass](CHECK_CLASS_CAST(klass, TYPE_HSCALE())) + +proc IS_HSCALE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HSCALE()) + +proc IS_HSCALE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HSCALE()) + +proc HSCALE_GET_CLASS*(obj: pointer): PHScaleClass = + result = cast[PHScaleClass](CHECK_GET_CLASS(obj, TYPE_HSCALE())) + +proc TYPE_SCROLLBAR*(): GType = + result = scrollbar_get_type() + +proc SCROLLBAR*(obj: pointer): PScrollbar = + result = cast[PScrollbar](CHECK_CAST(obj, TYPE_SCROLLBAR())) + +proc SCROLLBAR_CLASS*(klass: pointer): PScrollbarClass = + result = cast[PScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_SCROLLBAR())) + +proc IS_SCROLLBAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SCROLLBAR()) + +proc IS_SCROLLBAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SCROLLBAR()) + +proc SCROLLBAR_GET_CLASS*(obj: pointer): PScrollbarClass = + result = cast[PScrollbarClass](CHECK_GET_CLASS(obj, TYPE_SCROLLBAR())) + +proc TYPE_HSCROLLBAR*(): GType = + result = hscrollbar_get_type() + +proc HSCROLLBAR*(obj: pointer): PHScrollbar = + result = cast[PHScrollbar](CHECK_CAST(obj, TYPE_HSCROLLBAR())) + +proc HSCROLLBAR_CLASS*(klass: pointer): PHScrollbarClass = + result = cast[PHScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_HSCROLLBAR())) + +proc IS_HSCROLLBAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HSCROLLBAR()) + +proc IS_HSCROLLBAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HSCROLLBAR()) + +proc HSCROLLBAR_GET_CLASS*(obj: pointer): PHScrollbarClass = + result = cast[PHScrollbarClass](CHECK_GET_CLASS(obj, TYPE_HSCROLLBAR())) + +proc TYPE_SEPARATOR*(): GType = + result = separator_get_type() + +proc SEPARATOR*(obj: pointer): PSeparator = + result = cast[PSeparator](CHECK_CAST(obj, TYPE_SEPARATOR())) + +proc SEPARATOR_CLASS*(klass: pointer): PSeparatorClass = + result = cast[PSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_SEPARATOR())) + +proc IS_SEPARATOR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SEPARATOR()) + +proc IS_SEPARATOR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SEPARATOR()) + +proc SEPARATOR_GET_CLASS*(obj: pointer): PSeparatorClass = + result = cast[PSeparatorClass](CHECK_GET_CLASS(obj, TYPE_SEPARATOR())) + +proc TYPE_HSEPARATOR*(): GType = + result = hseparator_get_type() + +proc HSEPARATOR*(obj: pointer): PHSeparator = + result = cast[PHSeparator](CHECK_CAST(obj, TYPE_HSEPARATOR())) + +proc HSEPARATOR_CLASS*(klass: pointer): PHSeparatorClass = + result = cast[PHSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_HSEPARATOR())) + +proc IS_HSEPARATOR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_HSEPARATOR()) + +proc IS_HSEPARATOR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_HSEPARATOR()) + +proc HSEPARATOR_GET_CLASS*(obj: pointer): PHSeparatorClass = + result = cast[PHSeparatorClass](CHECK_GET_CLASS(obj, TYPE_HSEPARATOR())) + +proc TYPE_ICON_FACTORY*(): GType = + result = icon_factory_get_type() + +proc ICON_FACTORY*(anObject: pointer): PIconFactory = + result = cast[PIconFactory](G_TYPE_CHECK_INSTANCE_CAST(anObject, + TYPE_ICON_FACTORY())) + +proc ICON_FACTORY_CLASS*(klass: pointer): PIconFactoryClass = + result = cast[PIconFactoryClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_ICON_FACTORY())) + +proc IS_ICON_FACTORY*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_ICON_FACTORY()) + +proc IS_ICON_FACTORY_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_ICON_FACTORY()) + +proc ICON_FACTORY_GET_CLASS*(obj: pointer): PIconFactoryClass = + result = cast[PIconFactoryClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_ICON_FACTORY())) + +proc TYPE_ICON_SET*(): GType = + result = icon_set_get_type() + +proc TYPE_ICON_SOURCE*(): GType = + result = icon_source_get_type() + +proc TYPE_IMAGE*(): GType = + result = image_get_type() + +proc IMAGE*(obj: pointer): PImage = + result = cast[PImage](CHECK_CAST(obj, TYPE_IMAGE())) + +proc IMAGE_CLASS*(klass: pointer): PImageClass = + result = cast[PImageClass](CHECK_CLASS_CAST(klass, TYPE_IMAGE())) + +proc IS_IMAGE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_IMAGE()) + +proc IS_IMAGE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_IMAGE()) + +proc IMAGE_GET_CLASS*(obj: pointer): PImageClass = + result = cast[PImageClass](CHECK_GET_CLASS(obj, TYPE_IMAGE())) + +proc TYPE_IMAGE_MENU_ITEM*(): GType = + result = image_menu_item_get_type() + +proc IMAGE_MENU_ITEM*(obj: pointer): PImageMenuItem = + result = cast[PImageMenuItem](CHECK_CAST(obj, TYPE_IMAGE_MENU_ITEM())) + +proc IMAGE_MENU_ITEM_CLASS*(klass: pointer): PImageMenuItemClass = + result = cast[PImageMenuItemClass](CHECK_CLASS_CAST(klass, + TYPE_IMAGE_MENU_ITEM())) + +proc IS_IMAGE_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_IMAGE_MENU_ITEM()) + +proc IS_IMAGE_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_IMAGE_MENU_ITEM()) + +proc IMAGE_MENU_ITEM_GET_CLASS*(obj: pointer): PImageMenuItemClass = + result = cast[PImageMenuItemClass](CHECK_GET_CLASS(obj, TYPE_IMAGE_MENU_ITEM())) + +proc TYPE_IM_CONTEXT_SIMPLE*(): GType = + result = im_context_simple_get_type() + +proc IM_CONTEXT_SIMPLE*(obj: pointer): PIMContextSimple = + result = cast[PIMContextSimple](CHECK_CAST(obj, TYPE_IM_CONTEXT_SIMPLE())) + +proc IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): PIMContextSimpleClass = + result = cast[PIMContextSimpleClass](CHECK_CLASS_CAST(klass, + TYPE_IM_CONTEXT_SIMPLE())) + +proc IS_IM_CONTEXT_SIMPLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_IM_CONTEXT_SIMPLE()) + +proc IS_IM_CONTEXT_SIMPLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_IM_CONTEXT_SIMPLE()) + +proc IM_CONTEXT_SIMPLE_GET_CLASS*(obj: pointer): PIMContextSimpleClass = + result = cast[PIMContextSimpleClass](CHECK_GET_CLASS(obj, + TYPE_IM_CONTEXT_SIMPLE())) + +proc in_hex_sequence*(a: var TIMContextSimple): guint = + result = (a.IMContextSimpleflag0 and bm_TGtkIMContextSimple_in_hex_sequence) shr + bp_TGtkIMContextSimple_in_hex_sequence + +proc set_in_hex_sequence*(a: var TIMContextSimple, `in_hex_sequence`: guint) = + a.IMContextSimpleflag0 = a.IMContextSimpleflag0 or + (int16(`in_hex_sequence` shl bp_TGtkIMContextSimple_in_hex_sequence) and + bm_TGtkIMContextSimple_in_hex_sequence) + +proc TYPE_IM_MULTICONTEXT*(): GType = + result = im_multicontext_get_type() + +proc IM_MULTICONTEXT*(obj: pointer): PIMMulticontext = + result = cast[PIMMulticontext](CHECK_CAST(obj, TYPE_IM_MULTICONTEXT())) + +proc IM_MULTICONTEXT_CLASS*(klass: pointer): PIMMulticontextClass = + result = cast[PIMMulticontextClass](CHECK_CLASS_CAST(klass, + TYPE_IM_MULTICONTEXT())) + +proc IS_IM_MULTICONTEXT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_IM_MULTICONTEXT()) + +proc IS_IM_MULTICONTEXT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_IM_MULTICONTEXT()) + +proc IM_MULTICONTEXT_GET_CLASS*(obj: pointer): PIMMulticontextClass = + result = cast[PIMMulticontextClass](CHECK_GET_CLASS(obj, + TYPE_IM_MULTICONTEXT())) + +proc TYPE_INPUT_DIALOG*(): GType = + result = input_dialog_get_type() + +proc INPUT_DIALOG*(obj: pointer): PInputDialog = + result = cast[PInputDialog](CHECK_CAST(obj, TYPE_INPUT_DIALOG())) + +proc INPUT_DIALOG_CLASS*(klass: pointer): PInputDialogClass = + result = cast[PInputDialogClass](CHECK_CLASS_CAST(klass, TYPE_INPUT_DIALOG())) + +proc IS_INPUT_DIALOG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_INPUT_DIALOG()) + +proc IS_INPUT_DIALOG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_INPUT_DIALOG()) + +proc INPUT_DIALOG_GET_CLASS*(obj: pointer): PInputDialogClass = + result = cast[PInputDialogClass](CHECK_GET_CLASS(obj, TYPE_INPUT_DIALOG())) + +proc TYPE_INVISIBLE*(): GType = + result = invisible_get_type() + +proc INVISIBLE*(obj: pointer): PInvisible = + result = cast[PInvisible](CHECK_CAST(obj, TYPE_INVISIBLE())) + +proc INVISIBLE_CLASS*(klass: pointer): PInvisibleClass = + result = cast[PInvisibleClass](CHECK_CLASS_CAST(klass, TYPE_INVISIBLE())) + +proc IS_INVISIBLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_INVISIBLE()) + +proc IS_INVISIBLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_INVISIBLE()) + +proc INVISIBLE_GET_CLASS*(obj: pointer): PInvisibleClass = + result = cast[PInvisibleClass](CHECK_GET_CLASS(obj, TYPE_INVISIBLE())) + +proc TYPE_ITEM_FACTORY*(): GType = + result = item_factory_get_type() + +proc ITEM_FACTORY*(anObject: pointer): PItemFactory = + result = cast[PItemFactory](CHECK_CAST(anObject, TYPE_ITEM_FACTORY())) + +proc ITEM_FACTORY_CLASS*(klass: pointer): PItemFactoryClass = + result = cast[PItemFactoryClass](CHECK_CLASS_CAST(klass, TYPE_ITEM_FACTORY())) + +proc IS_ITEM_FACTORY*(anObject: pointer): bool = + result = CHECK_TYPE(anObject, TYPE_ITEM_FACTORY()) + +proc IS_ITEM_FACTORY_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_ITEM_FACTORY()) + +proc ITEM_FACTORY_GET_CLASS*(obj: pointer): PItemFactoryClass = + result = cast[PItemFactoryClass](CHECK_GET_CLASS(obj, TYPE_ITEM_FACTORY())) + +proc TYPE_LAYOUT*(): GType = + result = layout_get_type() + +proc LAYOUT*(obj: pointer): PLayout = + result = cast[PLayout](CHECK_CAST(obj, TYPE_LAYOUT())) + +proc LAYOUT_CLASS*(klass: pointer): PLayoutClass = + result = cast[PLayoutClass](CHECK_CLASS_CAST(klass, TYPE_LAYOUT())) + +proc IS_LAYOUT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_LAYOUT()) + +proc IS_LAYOUT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_LAYOUT()) + +proc LAYOUT_GET_CLASS*(obj: pointer): PLayoutClass = + result = cast[PLayoutClass](CHECK_GET_CLASS(obj, TYPE_LAYOUT())) + +proc TYPE_LIST*(): GType = + result = list_get_type() + +proc LIST*(obj: pointer): PList = + result = cast[PList](CHECK_CAST(obj, TYPE_LIST())) + +proc LIST_CLASS*(klass: pointer): PListClass = + result = cast[PListClass](CHECK_CLASS_CAST(klass, TYPE_LIST())) + +proc IS_LIST*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_LIST()) + +proc IS_LIST_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_LIST()) + +proc LIST_GET_CLASS*(obj: pointer): PListClass = + result = cast[PListClass](CHECK_GET_CLASS(obj, TYPE_LIST())) + +proc selection_mode*(a: var TList): guint = + result = (a.Listflag0 and bm_TGtkList_selection_mode) shr + bp_TGtkList_selection_mode + +proc set_selection_mode*(a: var TList, `selection_mode`: guint) = + a.Listflag0 = a.Listflag0 or + (int16(`selection_mode` shl bp_TGtkList_selection_mode) and + bm_TGtkList_selection_mode) + +proc drag_selection*(a: var TList): guint = + result = (a.Listflag0 and bm_TGtkList_drag_selection) shr + bp_TGtkList_drag_selection + +proc set_drag_selection*(a: var TList, `drag_selection`: guint) = + a.Listflag0 = a.Listflag0 or + (int16(`drag_selection` shl bp_TGtkList_drag_selection) and + bm_TGtkList_drag_selection) + +proc add_mode*(a: var TList): guint = + result = (a.Listflag0 and bm_TGtkList_add_mode) shr bp_TGtkList_add_mode + +proc set_add_mode*(a: var TList, `add_mode`: guint) = + a.Listflag0 = a.Listflag0 or + (int16(`add_mode` shl bp_TGtkList_add_mode) and bm_TGtkList_add_mode) + +proc list_item_get_type(): GType{.importc: "gtk_list_item_get_type", cdecl, + dynlib: lib.} +proc TYPE_LIST_ITEM*(): GType = + result = list_item_get_type() + +type + TListItem = object of TItem + TListItemClass = object of TItemClass + PListItem = ptr TListItem + PListItemClass = ptr TListItemClass + +proc LIST_ITEM*(obj: pointer): PListItem = + result = cast[PListItem](CHECK_CAST(obj, TYPE_LIST_ITEM())) + +proc LIST_ITEM_CLASS*(klass: pointer): PListItemClass = + result = cast[PListItemClass](CHECK_CLASS_CAST(klass, TYPE_LIST_ITEM())) + +proc IS_LIST_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_LIST_ITEM()) + +proc IS_LIST_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_LIST_ITEM()) + +proc LIST_ITEM_GET_CLASS*(obj: pointer): PListItemClass = + #proc gtk_tree_model_get_type(): GType {.importc, cdecl, dynlib: gtklib.} + result = cast[PListItemClass](CHECK_GET_CLASS(obj, TYPE_LIST_ITEM())) + +proc TYPE_TREE_MODEL*(): GType = + result = tree_model_get_type() + +proc TREE_MODEL*(obj: pointer): PTreeModel = + result = cast[PTreeModel](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TREE_MODEL())) + +proc IS_TREE_MODEL*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_MODEL()) + +proc TREE_MODEL_GET_IFACE*(obj: pointer): PTreeModelIface = + result = cast[PTreeModelIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_TREE_MODEL())) + +proc TYPE_TREE_ITER*(): GType = + result = tree_iter_get_type() + +proc TYPE_TREE_PATH*(): GType = + result = tree_path_get_type() + +proc tree_path_new_root*(): PTreePath = + result = tree_path_new_first() + +proc tree_model_get_iter_root*(tree_model: PTreeModel, iter: PTreeIter): gboolean = + result = tree_model_get_iter_first(tree_model, iter) + +proc TYPE_TREE_SORTABLE*(): GType = + result = tree_sortable_get_type() + +proc TREE_SORTABLE*(obj: pointer): PTreeSortable = + result = cast[PTreeSortable](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_TREE_SORTABLE())) + +proc TREE_SORTABLE_CLASS*(obj: pointer): PTreeSortableIface = + result = cast[PTreeSortableIface](G_TYPE_CHECK_CLASS_CAST(obj, + TYPE_TREE_SORTABLE())) + +proc IS_TREE_SORTABLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_SORTABLE()) + +proc TREE_SORTABLE_GET_IFACE*(obj: pointer): PTreeSortableIface = + result = cast[PTreeSortableIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_TREE_SORTABLE())) + +proc TYPE_TREE_MODEL_SORT*(): GType = + result = tree_model_sort_get_type() + +proc TREE_MODEL_SORT*(obj: pointer): PTreeModelSort = + result = cast[PTreeModelSort](CHECK_CAST(obj, TYPE_TREE_MODEL_SORT())) + +proc TREE_MODEL_SORT_CLASS*(klass: pointer): PTreeModelSortClass = + result = cast[PTreeModelSortClass](CHECK_CLASS_CAST(klass, + TYPE_TREE_MODEL_SORT())) + +proc IS_TREE_MODEL_SORT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_MODEL_SORT()) + +proc IS_TREE_MODEL_SORT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_MODEL_SORT()) + +proc TREE_MODEL_SORT_GET_CLASS*(obj: pointer): PTreeModelSortClass = + result = cast[PTreeModelSortClass](CHECK_GET_CLASS(obj, TYPE_TREE_MODEL_SORT())) + +proc TYPE_LIST_STORE*(): GType = + result = list_store_get_type() + +proc LIST_STORE*(obj: pointer): PListStore = + result = cast[PListStore](CHECK_CAST(obj, TYPE_LIST_STORE())) + +proc LIST_STORE_CLASS*(klass: pointer): PListStoreClass = + result = cast[PListStoreClass](CHECK_CLASS_CAST(klass, TYPE_LIST_STORE())) + +proc IS_LIST_STORE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_LIST_STORE()) + +proc IS_LIST_STORE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_LIST_STORE()) + +proc LIST_STORE_GET_CLASS*(obj: pointer): PListStoreClass = + result = cast[PListStoreClass](CHECK_GET_CLASS(obj, TYPE_LIST_STORE())) + +proc columns_dirty*(a: var TListStore): guint = + result = (a.ListStoreflag0 and bm_TGtkListStore_columns_dirty) shr + bp_TGtkListStore_columns_dirty + +proc set_columns_dirty*(a: var TListStore, `columns_dirty`: guint) = + a.ListStoreflag0 = a.ListStoreflag0 or + (int16(`columns_dirty` shl bp_TGtkListStore_columns_dirty) and + bm_TGtkListStore_columns_dirty) + +proc TYPE_MENU_BAR*(): GType = + result = menu_bar_get_type() + +proc MENU_BAR*(obj: pointer): PMenuBar = + result = cast[PMenuBar](CHECK_CAST(obj, TYPE_MENU_BAR())) + +proc MENU_BAR_CLASS*(klass: pointer): PMenuBarClass = + result = cast[PMenuBarClass](CHECK_CLASS_CAST(klass, TYPE_MENU_BAR())) + +proc IS_MENU_BAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MENU_BAR()) + +proc IS_MENU_BAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MENU_BAR()) + +proc MENU_BAR_GET_CLASS*(obj: pointer): PMenuBarClass = + result = cast[PMenuBarClass](CHECK_GET_CLASS(obj, TYPE_MENU_BAR())) + +proc menu_bar_append*(menu, child: PWidget) = + menu_shell_append(cast[PMenuShell](menu), child) + +proc menu_bar_prepend*(menu, child: PWidget) = + menu_shell_prepend(cast[PMenuShell](menu), child) + +proc menu_bar_insert*(menu, child: PWidget, pos: gint) = + menu_shell_insert(cast[PMenuShell](menu), child, pos) + +proc TYPE_MESSAGE_DIALOG*(): GType = + result = message_dialog_get_type() + +proc MESSAGE_DIALOG*(obj: pointer): PMessageDialog = + result = cast[PMessageDialog](CHECK_CAST(obj, TYPE_MESSAGE_DIALOG())) + +proc MESSAGE_DIALOG_CLASS*(klass: pointer): PMessageDialogClass = + result = cast[PMessageDialogClass](CHECK_CLASS_CAST(klass, + TYPE_MESSAGE_DIALOG())) + +proc IS_MESSAGE_DIALOG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_MESSAGE_DIALOG()) + +proc IS_MESSAGE_DIALOG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_MESSAGE_DIALOG()) + +proc MESSAGE_DIALOG_GET_CLASS*(obj: pointer): PMessageDialogClass = + result = cast[PMessageDialogClass](CHECK_GET_CLASS(obj, TYPE_MESSAGE_DIALOG())) + +proc TYPE_NOTEBOOK*(): GType = + result = notebook_get_type() + +proc NOTEBOOK*(obj: pointer): PNotebook = + result = cast[PNotebook](CHECK_CAST(obj, TYPE_NOTEBOOK())) + +proc NOTEBOOK_CLASS*(klass: pointer): PNotebookClass = + result = cast[PNotebookClass](CHECK_CLASS_CAST(klass, TYPE_NOTEBOOK())) + +proc IS_NOTEBOOK*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_NOTEBOOK()) + +proc IS_NOTEBOOK_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_NOTEBOOK()) + +proc NOTEBOOK_GET_CLASS*(obj: pointer): PNotebookClass = + result = cast[PNotebookClass](CHECK_GET_CLASS(obj, TYPE_NOTEBOOK())) + +proc show_tabs*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_show_tabs) shr + bp_TGtkNotebook_show_tabs + +proc set_show_tabs*(a: var TNotebook, `show_tabs`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`show_tabs` shl bp_TGtkNotebook_show_tabs) and + bm_TGtkNotebook_show_tabs) + +proc homogeneous*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_homogeneous) shr + bp_TGtkNotebook_homogeneous + +proc set_homogeneous*(a: var TNotebook, `homogeneous`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`homogeneous` shl bp_TGtkNotebook_homogeneous) and + bm_TGtkNotebook_homogeneous) + +proc show_border*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_show_border) shr + bp_TGtkNotebook_show_border + +proc set_show_border*(a: var TNotebook, `show_border`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`show_border` shl bp_TGtkNotebook_show_border) and + bm_TGtkNotebook_show_border) + +proc tab_pos*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_tab_pos) shr + bp_TGtkNotebook_tab_pos + +proc set_tab_pos*(a: var TNotebook, `tab_pos`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`tab_pos` shl bp_TGtkNotebook_tab_pos) and + bm_TGtkNotebook_tab_pos) + +proc scrollable*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_scrollable) shr + bp_TGtkNotebook_scrollable + +proc set_scrollable*(a: var TNotebook, `scrollable`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`scrollable` shl bp_TGtkNotebook_scrollable) and + bm_TGtkNotebook_scrollable) + +proc in_child*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_in_child) shr + bp_TGtkNotebook_in_child + +proc set_in_child*(a: var TNotebook, `in_child`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`in_child` shl bp_TGtkNotebook_in_child) and + bm_TGtkNotebook_in_child) + +proc click_child*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_click_child) shr + bp_TGtkNotebook_click_child + +proc set_click_child*(a: var TNotebook, `click_child`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`click_child` shl bp_TGtkNotebook_click_child) and + bm_TGtkNotebook_click_child) + +proc button*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_button) shr + bp_TGtkNotebook_button + +proc set_button*(a: var TNotebook, `button`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`button` shl bp_TGtkNotebook_button) and bm_TGtkNotebook_button) + +proc need_timer*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_need_timer) shr + bp_TGtkNotebook_need_timer + +proc set_need_timer*(a: var TNotebook, `need_timer`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`need_timer` shl bp_TGtkNotebook_need_timer) and + bm_TGtkNotebook_need_timer) + +proc child_has_focus*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_child_has_focus) shr + bp_TGtkNotebook_child_has_focus + +proc set_child_has_focus*(a: var TNotebook, `child_has_focus`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`child_has_focus` shl bp_TGtkNotebook_child_has_focus) and + bm_TGtkNotebook_child_has_focus) + +proc have_visible_child*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_have_visible_child) shr + bp_TGtkNotebook_have_visible_child + +proc set_have_visible_child*(a: var TNotebook, `have_visible_child`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`have_visible_child` shl bp_TGtkNotebook_have_visible_child) and + bm_TGtkNotebook_have_visible_child) + +proc focus_out*(a: var TNotebook): guint = + result = (a.Notebookflag0 and bm_TGtkNotebook_focus_out) shr + bp_TGtkNotebook_focus_out + +proc set_focus_out*(a: var TNotebook, `focus_out`: guint) = + a.Notebookflag0 = a.Notebookflag0 or + (int16(`focus_out` shl bp_TGtkNotebook_focus_out) and + bm_TGtkNotebook_focus_out) + +proc TYPE_OLD_EDITABLE*(): GType = + result = old_editable_get_type() + +proc OLD_EDITABLE*(obj: pointer): POldEditable = + result = cast[POldEditable](CHECK_CAST(obj, TYPE_OLD_EDITABLE())) + +proc OLD_EDITABLE_CLASS*(klass: pointer): POldEditableClass = + result = cast[POldEditableClass](CHECK_CLASS_CAST(klass, TYPE_OLD_EDITABLE())) + +proc IS_OLD_EDITABLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_OLD_EDITABLE()) + +proc IS_OLD_EDITABLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_OLD_EDITABLE()) + +proc OLD_EDITABLE_GET_CLASS*(obj: pointer): POldEditableClass = + result = cast[POldEditableClass](CHECK_GET_CLASS(obj, TYPE_OLD_EDITABLE())) + +proc has_selection*(a: var TOldEditable): guint = + result = (a.OldEditableflag0 and bm_TGtkOldEditable_has_selection) shr + bp_TGtkOldEditable_has_selection + +proc set_has_selection*(a: var TOldEditable, `has_selection`: guint) = + a.OldEditableflag0 = a.OldEditableflag0 or + (int16(`has_selection` shl bp_TGtkOldEditable_has_selection) and + bm_TGtkOldEditable_has_selection) + +proc editable*(a: var TOldEditable): guint = + result = (a.OldEditableflag0 and bm_TGtkOldEditable_editable) shr + bp_TGtkOldEditable_editable + +proc set_editable*(a: var TOldEditable, `editable`: guint) = + a.OldEditableflag0 = a.OldEditableflag0 or + (int16(`editable` shl bp_TGtkOldEditable_editable) and + bm_TGtkOldEditable_editable) + +proc visible*(a: var TOldEditable): guint = + result = (a.OldEditableflag0 and bm_TGtkOldEditable_visible) shr + bp_TGtkOldEditable_visible + +proc set_visible*(a: var TOldEditable, `visible`: guint) = + a.OldEditableflag0 = a.OldEditableflag0 or + (int16(`visible` shl bp_TGtkOldEditable_visible) and + bm_TGtkOldEditable_visible) + +proc TYPE_OPTION_MENU*(): GType = + result = option_menu_get_type() + +proc OPTION_MENU*(obj: pointer): POptionMenu = + result = cast[POptionMenu](CHECK_CAST(obj, TYPE_OPTION_MENU())) + +proc OPTION_MENU_CLASS*(klass: pointer): POptionMenuClass = + result = cast[POptionMenuClass](CHECK_CLASS_CAST(klass, TYPE_OPTION_MENU())) + +proc IS_OPTION_MENU*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_OPTION_MENU()) + +proc IS_OPTION_MENU_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_OPTION_MENU()) + +proc OPTION_MENU_GET_CLASS*(obj: pointer): POptionMenuClass = + result = cast[POptionMenuClass](CHECK_GET_CLASS(obj, TYPE_OPTION_MENU())) + +proc TYPE_PIXMAP*(): GType = + result = pixmap_get_type() + +proc PIXMAP*(obj: pointer): PPixmap = + result = cast[PPixmap](CHECK_CAST(obj, TYPE_PIXMAP())) + +proc PIXMAP_CLASS*(klass: pointer): PPixmapClass = + result = cast[PPixmapClass](CHECK_CLASS_CAST(klass, TYPE_PIXMAP())) + +proc IS_PIXMAP*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PIXMAP()) + +proc IS_PIXMAP_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PIXMAP()) + +proc PIXMAP_GET_CLASS*(obj: pointer): PPixmapClass = + result = cast[PPixmapClass](CHECK_GET_CLASS(obj, TYPE_PIXMAP())) + +proc build_insensitive*(a: var TPixmap): guint = + result = (a.Pixmapflag0 and bm_TGtkPixmap_build_insensitive) shr + bp_TGtkPixmap_build_insensitive + +proc set_build_insensitive*(a: var TPixmap, `build_insensitive`: guint) = + a.Pixmapflag0 = a.Pixmapflag0 or + (int16(`build_insensitive` shl bp_TGtkPixmap_build_insensitive) and + bm_TGtkPixmap_build_insensitive) + +proc TYPE_PLUG*(): GType = + result = plug_get_type() + +proc PLUG*(obj: pointer): PPlug = + result = cast[PPlug](CHECK_CAST(obj, TYPE_PLUG())) + +proc PLUG_CLASS*(klass: pointer): PPlugClass = + result = cast[PPlugClass](CHECK_CLASS_CAST(klass, TYPE_PLUG())) + +proc IS_PLUG*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PLUG()) + +proc IS_PLUG_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PLUG()) + +proc PLUG_GET_CLASS*(obj: pointer): PPlugClass = + result = cast[PPlugClass](CHECK_GET_CLASS(obj, TYPE_PLUG())) + +proc same_app*(a: var TPlug): guint = + result = (a.Plugflag0 and bm_TGtkPlug_same_app) shr bp_TGtkPlug_same_app + +proc set_same_app*(a: var TPlug, `same_app`: guint) = + a.Plugflag0 = a.Plugflag0 or + (int16(`same_app` shl bp_TGtkPlug_same_app) and bm_TGtkPlug_same_app) + +proc TYPE_PREVIEW*(): GType = + result = preview_get_type() + +proc PREVIEW*(obj: pointer): PPreview = + result = cast[PPreview](CHECK_CAST(obj, TYPE_PREVIEW())) + +proc PREVIEW_CLASS*(klass: pointer): PPreviewClass = + result = cast[PPreviewClass](CHECK_CLASS_CAST(klass, TYPE_PREVIEW())) + +proc IS_PREVIEW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PREVIEW()) + +proc IS_PREVIEW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PREVIEW()) + +proc PREVIEW_GET_CLASS*(obj: pointer): PPreviewClass = + result = cast[PPreviewClass](CHECK_GET_CLASS(obj, TYPE_PREVIEW())) + +proc get_type*(a: var TPreview): guint = + result = (a.Previewflag0 and bm_TGtkPreview_type) shr bp_TGtkPreview_type + +proc set_type*(a: var TPreview, `type`: guint) = + a.Previewflag0 = a.Previewflag0 or + (int16(`type` shl bp_TGtkPreview_type) and bm_TGtkPreview_type) + +proc get_expand*(a: var TPreview): guint = + result = (a.Previewflag0 and bm_TGtkPreview_expand) shr + bp_TGtkPreview_expand + +proc set_expand*(a: var TPreview, `expand`: guint) = + a.Previewflag0 = a.Previewflag0 or + (int16(`expand` shl bp_TGtkPreview_expand) and bm_TGtkPreview_expand) + +proc progress_get_type(): GType{.importc: "gtk_progress_get_type", cdecl, + dynlib: lib.} +proc TYPE_PROGRESS*(): GType = + result = progress_get_type() + +proc PROGRESS*(obj: pointer): PProgress = + result = cast[PProgress](CHECK_CAST(obj, TYPE_PROGRESS())) + +proc PROGRESS_CLASS*(klass: pointer): PProgressClass = + result = cast[PProgressClass](CHECK_CLASS_CAST(klass, TYPE_PROGRESS())) + +proc IS_PROGRESS*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PROGRESS()) + +proc IS_PROGRESS_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PROGRESS()) + +proc PROGRESS_GET_CLASS*(obj: pointer): PProgressClass = + result = cast[PProgressClass](CHECK_GET_CLASS(obj, TYPE_PROGRESS())) + +proc show_text*(a: var TProgress): guint = + result = (a.Progressflag0 and bm_TGtkProgress_show_text) shr + bp_TGtkProgress_show_text + +proc set_show_text*(a: var TProgress, `show_text`: guint) = + a.Progressflag0 = a.Progressflag0 or + (int16(`show_text` shl bp_TGtkProgress_show_text) and + bm_TGtkProgress_show_text) + +proc activity_mode*(a: var TProgress): guint = + result = (a.Progressflag0 and bm_TGtkProgress_activity_mode) shr + bp_TGtkProgress_activity_mode + +proc set_activity_mode*(a: var TProgress, `activity_mode`: guint) = + a.Progressflag0 = a.Progressflag0 or + (int16(`activity_mode` shl bp_TGtkProgress_activity_mode) and + bm_TGtkProgress_activity_mode) + +proc use_text_format*(a: var TProgress): guint = + result = (a.Progressflag0 and bm_TGtkProgress_use_text_format) shr + bp_TGtkProgress_use_text_format + +proc set_use_text_format*(a: var TProgress, `use_text_format`: guint) = + a.Progressflag0 = a.Progressflag0 or + (int16(`use_text_format` shl bp_TGtkProgress_use_text_format) and + bm_TGtkProgress_use_text_format) + +proc TYPE_PROGRESS_BAR*(): GType = + result = progress_bar_get_type() + +proc PROGRESS_BAR*(obj: pointer): PProgressBar = + result = cast[PProgressBar](CHECK_CAST(obj, TYPE_PROGRESS_BAR())) + +proc PROGRESS_BAR_CLASS*(klass: pointer): PProgressBarClass = + result = cast[PProgressBarClass](CHECK_CLASS_CAST(klass, TYPE_PROGRESS_BAR())) + +proc IS_PROGRESS_BAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_PROGRESS_BAR()) + +proc IS_PROGRESS_BAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_PROGRESS_BAR()) + +proc PROGRESS_BAR_GET_CLASS*(obj: pointer): PProgressBarClass = + result = cast[PProgressBarClass](CHECK_GET_CLASS(obj, TYPE_PROGRESS_BAR())) + +proc activity_dir*(a: var TProgressBar): guint = + result = (a.ProgressBarflag0 and bm_TGtkProgressBar_activity_dir) shr + bp_TGtkProgressBar_activity_dir + +proc set_activity_dir*(a: var TProgressBar, `activity_dir`: guint) = + a.ProgressBarflag0 = a.ProgressBarflag0 or + (int16(`activity_dir` shl bp_TGtkProgressBar_activity_dir) and + bm_TGtkProgressBar_activity_dir) + +proc TYPE_RADIO_BUTTON*(): GType = + result = radio_button_get_type() + +proc RADIO_BUTTON*(obj: pointer): PRadioButton = + result = cast[PRadioButton](CHECK_CAST(obj, TYPE_RADIO_BUTTON())) + +proc RADIO_BUTTON_CLASS*(klass: pointer): PRadioButtonClass = + result = cast[PRadioButtonClass](CHECK_CLASS_CAST(klass, TYPE_RADIO_BUTTON())) + +proc IS_RADIO_BUTTON*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_RADIO_BUTTON()) + +proc IS_RADIO_BUTTON_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_RADIO_BUTTON()) + +proc RADIO_BUTTON_GET_CLASS*(obj: pointer): PRadioButtonClass = + result = cast[PRadioButtonClass](CHECK_GET_CLASS(obj, TYPE_RADIO_BUTTON())) + +proc TYPE_RADIO_MENU_ITEM*(): GType = + result = radio_menu_item_get_type() + +proc RADIO_MENU_ITEM*(obj: pointer): PRadioMenuItem = + result = cast[PRadioMenuItem](CHECK_CAST(obj, TYPE_RADIO_MENU_ITEM())) + +proc RADIO_MENU_ITEM_CLASS*(klass: pointer): PRadioMenuItemClass = + result = cast[PRadioMenuItemClass](CHECK_CLASS_CAST(klass, + TYPE_RADIO_MENU_ITEM())) + +proc IS_RADIO_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_RADIO_MENU_ITEM()) + +proc IS_RADIO_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_RADIO_MENU_ITEM()) + +proc RADIO_MENU_ITEM_GET_CLASS*(obj: pointer): PRadioMenuItemClass = + result = cast[PRadioMenuItemClass](CHECK_GET_CLASS(obj, TYPE_RADIO_MENU_ITEM())) + +proc TYPE_SCROLLED_WINDOW*(): GType = + result = scrolled_window_get_type() + +proc SCROLLED_WINDOW*(obj: pointer): PScrolledWindow = + result = cast[PScrolledWindow](CHECK_CAST(obj, TYPE_SCROLLED_WINDOW())) + +proc SCROLLED_WINDOW_CLASS*(klass: pointer): PScrolledWindowClass = + result = cast[PScrolledWindowClass](CHECK_CLASS_CAST(klass, + TYPE_SCROLLED_WINDOW())) + +proc IS_SCROLLED_WINDOW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SCROLLED_WINDOW()) + +proc IS_SCROLLED_WINDOW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SCROLLED_WINDOW()) + +proc SCROLLED_WINDOW_GET_CLASS*(obj: pointer): PScrolledWindowClass = + result = cast[PScrolledWindowClass](CHECK_GET_CLASS(obj, + TYPE_SCROLLED_WINDOW())) + +proc hscrollbar_policy*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_hscrollbar_policy) shr + bp_TGtkScrolledWindow_hscrollbar_policy + +proc set_hscrollbar_policy*(a: var TScrolledWindow, `hscrollbar_policy`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + (int16(`hscrollbar_policy` shl bp_TGtkScrolledWindow_hscrollbar_policy) and + bm_TGtkScrolledWindow_hscrollbar_policy) + +proc vscrollbar_policy*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_vscrollbar_policy) shr + bp_TGtkScrolledWindow_vscrollbar_policy + +proc set_vscrollbar_policy*(a: var TScrolledWindow, `vscrollbar_policy`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + (int16(`vscrollbar_policy` shl bp_TGtkScrolledWindow_vscrollbar_policy) and + bm_TGtkScrolledWindow_vscrollbar_policy) + +proc hscrollbar_visible*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and + bm_TGtkScrolledWindow_hscrollbar_visible) shr + bp_TGtkScrolledWindow_hscrollbar_visible + +proc set_hscrollbar_visible*(a: var TScrolledWindow, `hscrollbar_visible`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + (int16(`hscrollbar_visible` shl + bp_TGtkScrolledWindow_hscrollbar_visible) and + bm_TGtkScrolledWindow_hscrollbar_visible) + +proc vscrollbar_visible*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and + bm_TGtkScrolledWindow_vscrollbar_visible) shr + bp_TGtkScrolledWindow_vscrollbar_visible + +proc set_vscrollbar_visible*(a: var TScrolledWindow, `vscrollbar_visible`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + int16((`vscrollbar_visible` shl + bp_TGtkScrolledWindow_vscrollbar_visible) and + bm_TGtkScrolledWindow_vscrollbar_visible) + +proc window_placement*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_window_placement) shr + bp_TGtkScrolledWindow_window_placement + +proc set_window_placement*(a: var TScrolledWindow, `window_placement`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + (int16(`window_placement` shl bp_TGtkScrolledWindow_window_placement) and + bm_TGtkScrolledWindow_window_placement) + +proc focus_out*(a: var TScrolledWindow): guint = + result = (a.ScrolledWindowflag0 and bm_TGtkScrolledWindow_focus_out) shr + bp_TGtkScrolledWindow_focus_out + +proc set_focus_out*(a: var TScrolledWindow, `focus_out`: guint) = + a.ScrolledWindowflag0 = a.ScrolledWindowflag0 or + (int16(`focus_out` shl bp_TGtkScrolledWindow_focus_out) and + bm_TGtkScrolledWindow_focus_out) + +proc TYPE_SELECTION_DATA*(): GType = + result = selection_data_get_type() + +proc TYPE_SEPARATOR_MENU_ITEM*(): GType = + result = separator_menu_item_get_type() + +proc SEPARATOR_MENU_ITEM*(obj: pointer): PSeparatorMenuItem = + result = cast[PSeparatorMenuItem](CHECK_CAST(obj, TYPE_SEPARATOR_MENU_ITEM())) + +proc SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): PSeparatorMenuItemClass = + result = cast[PSeparatorMenuItemClass](CHECK_CLASS_CAST(klass, + TYPE_SEPARATOR_MENU_ITEM())) + +proc IS_SEPARATOR_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SEPARATOR_MENU_ITEM()) + +proc IS_SEPARATOR_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SEPARATOR_MENU_ITEM()) + +proc SEPARATOR_MENU_ITEM_GET_CLASS*(obj: pointer): PSeparatorMenuItemClass = + result = cast[PSeparatorMenuItemClass](CHECK_GET_CLASS(obj, + TYPE_SEPARATOR_MENU_ITEM())) + +proc signal_lookup*(name: cstring, object_type: GType): guint = + result = g_signal_lookup(name, object_type) + +proc signal_name*(signal_id: guint): cstring = + result = g_signal_name(signal_id) + +proc signal_emit_stop*(instance: gpointer, signal_id: guint, detail: TGQuark) = + if detail != 0'i32: g_signal_stop_emission(instance, signal_id, 0) + +proc signal_connect_full*(anObject: PObject, name: cstring, func_: TSignalFunc, + unknown1: pointer, func_data: gpointer, + unknown2: pointer, unknown3, unknown4: int): gulong{. + importc: "gtk_signal_connect_full", cdecl, dynlib: lib.} +proc signal_compat_matched*(anObject: PObject, func_: TSignalFunc, + data: gpointer, m: TGSignalMatchType, u: int){. + importc: "gtk_signal_compat_matched", cdecl, dynlib: lib.} +proc signal_connect*(anObject: PObject, name: cstring, func_: TSignalFunc, + func_data: gpointer): gulong = + result = signal_connect_full(anObject, name, func_, nil, func_data, nil, 0, 0) + +proc signal_connect_after*(anObject: PObject, name: cstring, func_: TSignalFunc, + func_data: gpointer): gulong = + result = signal_connect_full(anObject, name, func_, nil, func_data, nil, 0, 1) + +proc signal_connect_object*(anObject: PObject, name: cstring, + func_: TSignalFunc, slot_object: gpointer): gulong = + result = signal_connect_full(anObject, name, func_, nil, slot_object, nil, 1, + 0) + +proc signal_connect_object_after*(anObject: PObject, name: cstring, + func_: TSignalFunc, slot_object: gpointer): gulong = + result = signal_connect_full(anObject, name, func_, nil, slot_object, nil, 1, + 1) + +proc signal_disconnect*(anObject: gpointer, handler_id: gulong) = + g_signal_handler_disconnect(anObject, handler_id) + +proc signal_handler_block*(anObject: gpointer, handler_id: gulong) = + g_signal_handler_block(anObject, handler_id) + +proc signal_handler_unblock*(anObject: gpointer, handler_id: gulong) = + g_signal_handler_unblock(anObject, handler_id) + +proc signal_disconnect_by_data*(anObject: PObject, data: gpointer) = + signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 0) + +proc signal_disconnect_by_func*(anObject: PObject, func_: TSignalFunc, + data: gpointer) = + signal_compat_matched(anObject, func_, data, cast[TGSignalMatchType](G_SIGNAL_MATCH_FUNC or + G_SIGNAL_MATCH_DATA), 0) + +proc signal_handler_block_by_func*(anObject: PObject, func_: TSignalFunc, + data: gpointer) = + signal_compat_matched(anObject, func_, data, TGSignalMatchType( + G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA), 0) + +proc signal_handler_block_by_data*(anObject: PObject, data: gpointer) = + signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 1) + +proc signal_handler_unblock_by_func*(anObject: PObject, func_: TSignalFunc, + data: gpointer) = + signal_compat_matched(anObject, func_, data, cast[TGSignalMatchType](G_SIGNAL_MATCH_FUNC or + G_SIGNAL_MATCH_DATA), 0) + +proc signal_handler_unblock_by_data*(anObject: PObject, data: gpointer) = + signal_compat_matched(anObject, nil, data, G_SIGNAL_MATCH_DATA, 2) + +proc signal_handler_pending*(anObject: PObject, signal_id: guint, + may_be_blocked: gboolean): gboolean = + Result = g_signal_has_handler_pending(anObject, signal_id, 0, may_be_blocked) + +proc signal_handler_pending_by_func*(anObject: PObject, signal_id: guint, + may_be_blocked: gboolean, + func_: TSignalFunc, data: gpointer): gboolean = + var t: TGSignalMatchType + t = cast[TGSignalMatchType](G_SIGNAL_MATCH_ID or G_SIGNAL_MATCH_FUNC or + G_SIGNAL_MATCH_DATA) + if not may_be_blocked: + t = t or cast[TGSignalMatchType](G_SIGNAL_MATCH_UNBLOCKED) + Result = g_signal_handler_find(anObject, t, signal_id, 0, nil, func_, data) != + 0 + +proc TYPE_SIZE_GROUP*(): GType = + result = size_group_get_type() + +proc SIZE_GROUP*(obj: pointer): PSizeGroup = + result = cast[PSizeGroup](CHECK_CAST(obj, TYPE_SIZE_GROUP())) + +proc SIZE_GROUP_CLASS*(klass: pointer): PSizeGroupClass = + result = cast[PSizeGroupClass](CHECK_CLASS_CAST(klass, TYPE_SIZE_GROUP())) + +proc IS_SIZE_GROUP*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SIZE_GROUP()) + +proc IS_SIZE_GROUP_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SIZE_GROUP()) + +proc SIZE_GROUP_GET_CLASS*(obj: pointer): PSizeGroupClass = + result = cast[PSizeGroupClass](CHECK_GET_CLASS(obj, TYPE_SIZE_GROUP())) + +proc have_width*(a: var TSizeGroup): guint = + result = (a.SizeGroupflag0 and bm_TGtkSizeGroup_have_width) shr + bp_TGtkSizeGroup_have_width + +proc set_have_width*(a: var TSizeGroup, `have_width`: guint) = + a.SizeGroupflag0 = a.SizeGroupflag0 or + (int16(`have_width` shl bp_TGtkSizeGroup_have_width) and + bm_TGtkSizeGroup_have_width) + +proc have_height*(a: var TSizeGroup): guint = + result = (a.SizeGroupflag0 and bm_TGtkSizeGroup_have_height) shr + bp_TGtkSizeGroup_have_height + +proc set_have_height*(a: var TSizeGroup, `have_height`: guint) = + a.SizeGroupflag0 = a.SizeGroupflag0 or + (int16(`have_height` shl bp_TGtkSizeGroup_have_height) and + bm_TGtkSizeGroup_have_height) + +proc TYPE_SOCKET*(): GType = + result = socket_get_type() + +proc SOCKET*(obj: pointer): PSocket = + result = cast[PSocket](CHECK_CAST(obj, TYPE_SOCKET())) + +proc SOCKET_CLASS*(klass: pointer): PSocketClass = + result = cast[PSocketClass](CHECK_CLASS_CAST(klass, TYPE_SOCKET())) + +proc IS_SOCKET*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SOCKET()) + +proc IS_SOCKET_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SOCKET()) + +proc SOCKET_GET_CLASS*(obj: pointer): PSocketClass = + result = cast[PSocketClass](CHECK_GET_CLASS(obj, TYPE_SOCKET())) + +proc same_app*(a: var TSocket): guint = + result = (a.Socketflag0 and bm_TGtkSocket_same_app) shr + bp_TGtkSocket_same_app + +proc set_same_app*(a: var TSocket, `same_app`: guint) = + a.Socketflag0 = a.Socketflag0 or + (int16(`same_app` shl bp_TGtkSocket_same_app) and + bm_TGtkSocket_same_app) + +proc focus_in*(a: var TSocket): guint = + result = (a.Socketflag0 and bm_TGtkSocket_focus_in) shr + bp_TGtkSocket_focus_in + +proc set_focus_in*(a: var TSocket, `focus_in`: guint) = + a.Socketflag0 = a.Socketflag0 or + (int16(`focus_in` shl bp_TGtkSocket_focus_in) and + bm_TGtkSocket_focus_in) + +proc have_size*(a: var TSocket): guint = + result = (a.Socketflag0 and bm_TGtkSocket_have_size) shr + bp_TGtkSocket_have_size + +proc set_have_size*(a: var TSocket, `have_size`: guint) = + a.Socketflag0 = a.Socketflag0 or + (int16(`have_size` shl bp_TGtkSocket_have_size) and + bm_TGtkSocket_have_size) + +proc need_map*(a: var TSocket): guint = + result = (a.Socketflag0 and bm_TGtkSocket_need_map) shr + bp_TGtkSocket_need_map + +proc set_need_map*(a: var TSocket, `need_map`: guint) = + a.Socketflag0 = a.Socketflag0 or + (int16(`need_map` shl bp_TGtkSocket_need_map) and + bm_TGtkSocket_need_map) + +proc is_mapped*(a: var TSocket): guint = + result = (a.Socketflag0 and bm_TGtkSocket_is_mapped) shr + bp_TGtkSocket_is_mapped + +proc set_is_mapped*(a: var TSocket, `is_mapped`: guint) = + a.Socketflag0 = a.Socketflag0 or + (int16(`is_mapped` shl bp_TGtkSocket_is_mapped) and + bm_TGtkSocket_is_mapped) + +proc TYPE_SPIN_BUTTON*(): GType = + result = spin_button_get_type() + +proc SPIN_BUTTON*(obj: pointer): PSpinButton = + result = cast[PSpinButton](CHECK_CAST(obj, TYPE_SPIN_BUTTON())) + +proc SPIN_BUTTON_CLASS*(klass: pointer): PSpinButtonClass = + result = cast[PSpinButtonClass](CHECK_CLASS_CAST(klass, TYPE_SPIN_BUTTON())) + +proc IS_SPIN_BUTTON*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_SPIN_BUTTON()) + +proc IS_SPIN_BUTTON_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_SPIN_BUTTON()) + +proc SPIN_BUTTON_GET_CLASS*(obj: pointer): PSpinButtonClass = + result = cast[PSpinButtonClass](CHECK_GET_CLASS(obj, TYPE_SPIN_BUTTON())) + +proc in_child*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_in_child) shr + bp_TGtkSpinButton_in_child + +proc set_in_child*(a: var TSpinButton, `in_child`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`in_child` shl bp_TGtkSpinButton_in_child) and + bm_TGtkSpinButton_in_child) + +proc click_child*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_click_child) shr + bp_TGtkSpinButton_click_child + +proc set_click_child*(a: var TSpinButton, `click_child`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`click_child` shl bp_TGtkSpinButton_click_child) and + bm_TGtkSpinButton_click_child) + +proc button*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_button) shr + bp_TGtkSpinButton_button + +proc set_button*(a: var TSpinButton, `button`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`button` shl bp_TGtkSpinButton_button) and bm_TGtkSpinButton_button) + +proc need_timer*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_need_timer) shr + bp_TGtkSpinButton_need_timer + +proc set_need_timer*(a: var TSpinButton, `need_timer`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`need_timer` shl bp_TGtkSpinButton_need_timer) and + bm_TGtkSpinButton_need_timer) + +proc timer_calls*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_timer_calls) shr + bp_TGtkSpinButton_timer_calls + +proc set_timer_calls*(a: var TSpinButton, `timer_calls`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`timer_calls` shl bp_TGtkSpinButton_timer_calls) and + bm_TGtkSpinButton_timer_calls) + +proc digits*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_digits) shr + bp_TGtkSpinButton_digits + +proc set_digits*(a: var TSpinButton, `digits`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`digits` shl bp_TGtkSpinButton_digits) and bm_TGtkSpinButton_digits) + +proc numeric*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_numeric) shr + bp_TGtkSpinButton_numeric + +proc set_numeric*(a: var TSpinButton, `numeric`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`numeric` shl bp_TGtkSpinButton_numeric) and + bm_TGtkSpinButton_numeric) + +proc wrap*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_wrap) shr + bp_TGtkSpinButton_wrap + +proc set_wrap*(a: var TSpinButton, `wrap`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`wrap` shl bp_TGtkSpinButton_wrap) and bm_TGtkSpinButton_wrap) + +proc snap_to_ticks*(a: var TSpinButton): guint = + result = (a.SpinButtonflag0 and bm_TGtkSpinButton_snap_to_ticks) shr + bp_TGtkSpinButton_snap_to_ticks + +proc set_snap_to_ticks*(a: var TSpinButton, `snap_to_ticks`: guint) = + a.SpinButtonflag0 = a.SpinButtonflag0 or + ((`snap_to_ticks` shl bp_TGtkSpinButton_snap_to_ticks) and + bm_TGtkSpinButton_snap_to_ticks) + +proc TYPE_STATUSBAR*(): GType = + result = statusbar_get_type() + +proc STATUSBAR*(obj: pointer): PStatusbar = + result = cast[PStatusbar](CHECK_CAST(obj, TYPE_STATUSBAR())) + +proc STATUSBAR_CLASS*(klass: pointer): PStatusbarClass = + result = cast[PStatusbarClass](CHECK_CLASS_CAST(klass, TYPE_STATUSBAR())) + +proc IS_STATUSBAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_STATUSBAR()) + +proc IS_STATUSBAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_STATUSBAR()) + +proc STATUSBAR_GET_CLASS*(obj: pointer): PStatusbarClass = + result = cast[PStatusbarClass](CHECK_GET_CLASS(obj, TYPE_STATUSBAR())) + +proc has_resize_grip*(a: var TStatusbar): guint = + result = (a.Statusbarflag0 and bm_TGtkStatusbar_has_resize_grip) shr + bp_TGtkStatusbar_has_resize_grip + +proc set_has_resize_grip*(a: var TStatusbar, `has_resize_grip`: guint) = + a.Statusbarflag0 = a.Statusbarflag0 or + (int16(`has_resize_grip` shl bp_TGtkStatusbar_has_resize_grip) and + bm_TGtkStatusbar_has_resize_grip) + +proc TYPE_TABLE*(): GType = + result = table_get_type() + +proc TABLE*(obj: pointer): PTable = + result = cast[PTable](CHECK_CAST(obj, TYPE_TABLE())) + +proc TABLE_CLASS*(klass: pointer): PTableClass = + result = cast[PTableClass](CHECK_CLASS_CAST(klass, TYPE_TABLE())) + +proc IS_TABLE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TABLE()) + +proc IS_TABLE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TABLE()) + +proc TABLE_GET_CLASS*(obj: pointer): PTableClass = + result = cast[PTableClass](CHECK_GET_CLASS(obj, TYPE_TABLE())) + +proc homogeneous*(a: var TTable): guint = + result = (a.Tableflag0 and bm_TGtkTable_homogeneous) shr + bp_TGtkTable_homogeneous + +proc set_homogeneous*(a: var TTable, `homogeneous`: guint) = + a.Tableflag0 = a.Tableflag0 or + (int16(`homogeneous` shl bp_TGtkTable_homogeneous) and + bm_TGtkTable_homogeneous) + +proc xexpand*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_xexpand) shr + bp_TGtkTableChild_xexpand + +proc set_xexpand*(a: var TTableChild, `xexpand`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`xexpand` shl bp_TGtkTableChild_xexpand) and + bm_TGtkTableChild_xexpand) + +proc yexpand*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_yexpand) shr + bp_TGtkTableChild_yexpand + +proc set_yexpand*(a: var TTableChild, `yexpand`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`yexpand` shl bp_TGtkTableChild_yexpand) and + bm_TGtkTableChild_yexpand) + +proc xshrink*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_xshrink) shr + bp_TGtkTableChild_xshrink + +proc set_xshrink*(a: var TTableChild, `xshrink`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`xshrink` shl bp_TGtkTableChild_xshrink) and + bm_TGtkTableChild_xshrink) + +proc yshrink*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_yshrink) shr + bp_TGtkTableChild_yshrink + +proc set_yshrink*(a: var TTableChild, `yshrink`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`yshrink` shl bp_TGtkTableChild_yshrink) and + bm_TGtkTableChild_yshrink) + +proc xfill*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_xfill) shr + bp_TGtkTableChild_xfill + +proc set_xfill*(a: var TTableChild, `xfill`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`xfill` shl bp_TGtkTableChild_xfill) and bm_TGtkTableChild_xfill) + +proc yfill*(a: var TTableChild): guint = + result = (a.TableChildflag0 and bm_TGtkTableChild_yfill) shr + bp_TGtkTableChild_yfill + +proc set_yfill*(a: var TTableChild, `yfill`: guint) = + a.TableChildflag0 = a.TableChildflag0 or + (int16(`yfill` shl bp_TGtkTableChild_yfill) and bm_TGtkTableChild_yfill) + +proc need_expand*(a: var TTableRowCol): guint = + result = (a.flag0 and bm_TGtkTableRowCol_need_expand) shr + bp_TGtkTableRowCol_need_expand + +proc set_need_expand*(a: var TTableRowCol, `need_expand`: guint) = + a.flag0 = a.flag0 or + (int16(`need_expand` shl bp_TGtkTableRowCol_need_expand) and + bm_TGtkTableRowCol_need_expand) + +proc need_shrink*(a: var TTableRowCol): guint = + result = (a.flag0 and bm_TGtkTableRowCol_need_shrink) shr + bp_TGtkTableRowCol_need_shrink + +proc set_need_shrink*(a: var TTableRowCol, `need_shrink`: guint) = + a.flag0 = a.flag0 or + (int16(`need_shrink` shl bp_TGtkTableRowCol_need_shrink) and + bm_TGtkTableRowCol_need_shrink) + +proc expand*(a: var TTableRowCol): guint = + result = (a.flag0 and bm_TGtkTableRowCol_expand) shr + bp_TGtkTableRowCol_expand + +proc set_expand*(a: var TTableRowCol, `expand`: guint) = + a.flag0 = a.flag0 or + (int16(`expand` shl bp_TGtkTableRowCol_expand) and + bm_TGtkTableRowCol_expand) + +proc shrink*(a: var TTableRowCol): guint = + result = (a.flag0 and bm_TGtkTableRowCol_shrink) shr + bp_TGtkTableRowCol_shrink + +proc set_shrink*(a: var TTableRowCol, `shrink`: guint) = + a.flag0 = a.flag0 or + (int16(`shrink` shl bp_TGtkTableRowCol_shrink) and + bm_TGtkTableRowCol_shrink) + +proc empty*(a: var TTableRowCol): guint = + result = (a.flag0 and bm_TGtkTableRowCol_empty) shr + bp_TGtkTableRowCol_empty + +proc set_empty*(a: var TTableRowCol, `empty`: guint) = + a.flag0 = a.flag0 or + (int16(`empty` shl bp_TGtkTableRowCol_empty) and + bm_TGtkTableRowCol_empty) + +proc TYPE_TEAROFF_MENU_ITEM*(): GType = + result = tearoff_menu_item_get_type() + +proc TEAROFF_MENU_ITEM*(obj: pointer): PTearoffMenuItem = + result = cast[PTearoffMenuItem](CHECK_CAST(obj, TYPE_TEAROFF_MENU_ITEM())) + +proc TEAROFF_MENU_ITEM_CLASS*(klass: pointer): PTearoffMenuItemClass = + result = cast[PTearoffMenuItemClass](CHECK_CLASS_CAST(klass, + TYPE_TEAROFF_MENU_ITEM())) + +proc IS_TEAROFF_MENU_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TEAROFF_MENU_ITEM()) + +proc IS_TEAROFF_MENU_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TEAROFF_MENU_ITEM()) + +proc TEAROFF_MENU_ITEM_GET_CLASS*(obj: pointer): PTearoffMenuItemClass = + result = cast[PTearoffMenuItemClass](CHECK_GET_CLASS(obj, + TYPE_TEAROFF_MENU_ITEM())) + +proc torn_off*(a: var TTearoffMenuItem): guint = + result = (a.TearoffMenuItemflag0 and bm_TGtkTearoffMenuItem_torn_off) shr + bp_TGtkTearoffMenuItem_torn_off + +proc set_torn_off*(a: var TTearoffMenuItem, `torn_off`: guint) = + a.TearoffMenuItemflag0 = a.TearoffMenuItemflag0 or + (int16(`torn_off` shl bp_TGtkTearoffMenuItem_torn_off) and + bm_TGtkTearoffMenuItem_torn_off) + +proc TYPE_TEXT*(): GType = + result = text_get_type() + +proc TEXT*(obj: pointer): PText = + result = cast[PText](CHECK_CAST(obj, TYPE_TEXT())) + +proc TEXT_CLASS*(klass: pointer): PTextClass = + result = cast[PTextClass](CHECK_CLASS_CAST(klass, TYPE_TEXT())) + +proc IS_TEXT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TEXT()) + +proc IS_TEXT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TEXT()) + +proc TEXT_GET_CLASS*(obj: pointer): PTextClass = + result = cast[PTextClass](CHECK_GET_CLASS(obj, TYPE_TEXT())) + +proc line_wrap*(a: PText): guint = + result = (a.Textflag0 and bm_TGtkText_line_wrap) shr bp_TGtkText_line_wrap + +proc set_line_wrap*(a: PText, `line_wrap`: guint) = + a.Textflag0 = a.Textflag0 or + (int16(`line_wrap` shl bp_TGtkText_line_wrap) and bm_TGtkText_line_wrap) + +proc word_wrap*(a: PText): guint = + result = (a.Textflag0 and bm_TGtkText_word_wrap) shr bp_TGtkText_word_wrap + +proc set_word_wrap*(a: PText, `word_wrap`: guint) = + a.Textflag0 = a.Textflag0 or + (int16(`word_wrap` shl bp_TGtkText_word_wrap) and bm_TGtkText_word_wrap) + +proc use_wchar*(a: PText): gboolean = + result = ((a.Textflag0 and bm_TGtkText_use_wchar) shr bp_TGtkText_use_wchar) > + 0'i16 + +proc set_use_wchar*(a: PText, `use_wchar`: gboolean) = + if `use_wchar`: + a.Textflag0 = a.Textflag0 or bm_TGtkText_use_wchar + else: + a.Textflag0 = a.Textflag0 and not bm_TGtkText_use_wchar + +proc TEXT_INDEX_WCHAR*(t: PText, index: guint): guint32 = + nil + +proc TEXT_INDEX_UCHAR*(t: PText, index: guint): GUChar = + nil + +proc TYPE_TEXT_ITER*(): GType = + result = text_iter_get_type() + +proc TYPE_TEXT_TAG*(): GType = + result = text_tag_get_type() + +proc TEXT_TAG*(obj: pointer): PTextTag = + result = cast[PTextTag](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_TAG())) + +proc TEXT_TAG_CLASS*(klass: pointer): PTextTagClass = + result = cast[PTextTagClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_TEXT_TAG())) + +proc IS_TEXT_TAG*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_TAG()) + +proc IS_TEXT_TAG_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_TAG()) + +proc TEXT_TAG_GET_CLASS*(obj: pointer): PTextTagClass = + result = cast[PTextTagClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_TEXT_TAG())) + +proc TYPE_TEXT_ATTRIBUTES*(): GType = + result = text_attributes_get_type() + +proc bg_color_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_bg_color_set) shr + bp_TGtkTextTag_bg_color_set + +proc set_bg_color_set*(a: var TTextTag, `bg_color_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`bg_color_set` shl bp_TGtkTextTag_bg_color_set) and + bm_TGtkTextTag_bg_color_set) + +proc bg_stipple_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_bg_stipple_set) shr + bp_TGtkTextTag_bg_stipple_set + +proc set_bg_stipple_set*(a: var TTextTag, `bg_stipple_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`bg_stipple_set` shl bp_TGtkTextTag_bg_stipple_set) and + bm_TGtkTextTag_bg_stipple_set) + +proc fg_color_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_fg_color_set) shr + bp_TGtkTextTag_fg_color_set + +proc set_fg_color_set*(a: var TTextTag, `fg_color_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`fg_color_set` shl bp_TGtkTextTag_fg_color_set) and + bm_TGtkTextTag_fg_color_set) + +proc scale_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_scale_set) shr + bp_TGtkTextTag_scale_set + +proc set_scale_set*(a: var TTextTag, `scale_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`scale_set` shl bp_TGtkTextTag_scale_set) and + bm_TGtkTextTag_scale_set) + +proc fg_stipple_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_fg_stipple_set) shr + bp_TGtkTextTag_fg_stipple_set + +proc set_fg_stipple_set*(a: var TTextTag, `fg_stipple_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`fg_stipple_set` shl bp_TGtkTextTag_fg_stipple_set) and + bm_TGtkTextTag_fg_stipple_set) + +proc justification_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_justification_set) shr + bp_TGtkTextTag_justification_set + +proc set_justification_set*(a: var TTextTag, `justification_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`justification_set` shl bp_TGtkTextTag_justification_set) and + bm_TGtkTextTag_justification_set) + +proc left_margin_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_left_margin_set) shr + bp_TGtkTextTag_left_margin_set + +proc set_left_margin_set*(a: var TTextTag, `left_margin_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`left_margin_set` shl bp_TGtkTextTag_left_margin_set) and + bm_TGtkTextTag_left_margin_set) + +proc indent_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_indent_set) shr + bp_TGtkTextTag_indent_set + +proc set_indent_set*(a: var TTextTag, `indent_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`indent_set` shl bp_TGtkTextTag_indent_set) and + bm_TGtkTextTag_indent_set) + +proc rise_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_rise_set) shr + bp_TGtkTextTag_rise_set + +proc set_rise_set*(a: var TTextTag, `rise_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`rise_set` shl bp_TGtkTextTag_rise_set) and bm_TGtkTextTag_rise_set) + +proc strikethrough_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_strikethrough_set) shr + bp_TGtkTextTag_strikethrough_set + +proc set_strikethrough_set*(a: var TTextTag, `strikethrough_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`strikethrough_set` shl bp_TGtkTextTag_strikethrough_set) and + bm_TGtkTextTag_strikethrough_set) + +proc right_margin_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_right_margin_set) shr + bp_TGtkTextTag_right_margin_set + +proc set_right_margin_set*(a: var TTextTag, `right_margin_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`right_margin_set` shl bp_TGtkTextTag_right_margin_set) and + bm_TGtkTextTag_right_margin_set) + +proc pixels_above_lines_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_above_lines_set) shr + bp_TGtkTextTag_pixels_above_lines_set + +proc set_pixels_above_lines_set*(a: var TTextTag, + `pixels_above_lines_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pixels_above_lines_set` shl bp_TGtkTextTag_pixels_above_lines_set) and + bm_TGtkTextTag_pixels_above_lines_set) + +proc pixels_below_lines_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_below_lines_set) shr + bp_TGtkTextTag_pixels_below_lines_set + +proc set_pixels_below_lines_set*(a: var TTextTag, + `pixels_below_lines_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pixels_below_lines_set` shl bp_TGtkTextTag_pixels_below_lines_set) and + bm_TGtkTextTag_pixels_below_lines_set) + +proc pixels_inside_wrap_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pixels_inside_wrap_set) shr + bp_TGtkTextTag_pixels_inside_wrap_set + +proc set_pixels_inside_wrap_set*(a: var TTextTag, + `pixels_inside_wrap_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pixels_inside_wrap_set` shl bp_TGtkTextTag_pixels_inside_wrap_set) and + bm_TGtkTextTag_pixels_inside_wrap_set) + +proc tabs_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_tabs_set) shr + bp_TGtkTextTag_tabs_set + +proc set_tabs_set*(a: var TTextTag, `tabs_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`tabs_set` shl bp_TGtkTextTag_tabs_set) and bm_TGtkTextTag_tabs_set) + +proc underline_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_underline_set) shr + bp_TGtkTextTag_underline_set + +proc set_underline_set*(a: var TTextTag, `underline_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`underline_set` shl bp_TGtkTextTag_underline_set) and + bm_TGtkTextTag_underline_set) + +proc wrap_mode_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_wrap_mode_set) shr + bp_TGtkTextTag_wrap_mode_set + +proc set_wrap_mode_set*(a: var TTextTag, `wrap_mode_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`wrap_mode_set` shl bp_TGtkTextTag_wrap_mode_set) and + bm_TGtkTextTag_wrap_mode_set) + +proc bg_full_height_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_bg_full_height_set) shr + bp_TGtkTextTag_bg_full_height_set + +proc set_bg_full_height_set*(a: var TTextTag, `bg_full_height_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`bg_full_height_set` shl bp_TGtkTextTag_bg_full_height_set) and + bm_TGtkTextTag_bg_full_height_set) + +proc invisible_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_invisible_set) shr + bp_TGtkTextTag_invisible_set + +proc set_invisible_set*(a: var TTextTag, `invisible_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`invisible_set` shl bp_TGtkTextTag_invisible_set) and + bm_TGtkTextTag_invisible_set) + +proc editable_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_editable_set) shr + bp_TGtkTextTag_editable_set + +proc set_editable_set*(a: var TTextTag, `editable_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`editable_set` shl bp_TGtkTextTag_editable_set) and + bm_TGtkTextTag_editable_set) + +proc language_set*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_language_set) shr + bp_TGtkTextTag_language_set + +proc set_language_set*(a: var TTextTag, `language_set`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`language_set` shl bp_TGtkTextTag_language_set) and + bm_TGtkTextTag_language_set) + +proc pad1*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pad1) shr bp_TGtkTextTag_pad1 + +proc set_pad1*(a: var TTextTag, `pad1`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pad1` shl bp_TGtkTextTag_pad1) and bm_TGtkTextTag_pad1) + +proc pad2*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pad2) shr bp_TGtkTextTag_pad2 + +proc set_pad2*(a: var TTextTag, `pad2`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pad2` shl bp_TGtkTextTag_pad2) and bm_TGtkTextTag_pad2) + +proc pad3*(a: var TTextTag): guint = + result = (a.TextTagflag0 and bm_TGtkTextTag_pad3) shr bp_TGtkTextTag_pad3 + +proc set_pad3*(a: var TTextTag, `pad3`: guint) = + a.TextTagflag0 = a.TextTagflag0 or + ((`pad3` shl bp_TGtkTextTag_pad3) and bm_TGtkTextTag_pad3) + +proc underline*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_underline) shr + bp_TGtkTextAppearance_underline + +proc set_underline*(a: var TTextAppearance, `underline`: guint) = + a.flag0 = a.flag0 or + (int16(`underline` shl bp_TGtkTextAppearance_underline) and + bm_TGtkTextAppearance_underline) + +proc strikethrough*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_strikethrough) shr + bp_TGtkTextAppearance_strikethrough + +proc set_strikethrough*(a: var TTextAppearance, `strikethrough`: guint) = + a.flag0 = a.flag0 or + (int16(`strikethrough` shl bp_TGtkTextAppearance_strikethrough) and + bm_TGtkTextAppearance_strikethrough) + +proc draw_bg*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_draw_bg) shr + bp_TGtkTextAppearance_draw_bg + +proc set_draw_bg*(a: var TTextAppearance, `draw_bg`: guint) = + a.flag0 = a.flag0 or + (int16(`draw_bg` shl bp_TGtkTextAppearance_draw_bg) and + bm_TGtkTextAppearance_draw_bg) + +proc inside_selection*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_inside_selection) shr + bp_TGtkTextAppearance_inside_selection + +proc set_inside_selection*(a: var TTextAppearance, `inside_selection`: guint) = + a.flag0 = a.flag0 or + (int16(`inside_selection` shl bp_TGtkTextAppearance_inside_selection) and + bm_TGtkTextAppearance_inside_selection) + +proc is_text*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_is_text) shr + bp_TGtkTextAppearance_is_text + +proc set_is_text*(a: var TTextAppearance, `is_text`: guint) = + a.flag0 = a.flag0 or + (int16(`is_text` shl bp_TGtkTextAppearance_is_text) and + bm_TGtkTextAppearance_is_text) + +proc pad1*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_pad1) shr + bp_TGtkTextAppearance_pad1 + +proc set_pad1*(a: var TTextAppearance, `pad1`: guint) = + a.flag0 = a.flag0 or + (int16(`pad1` shl bp_TGtkTextAppearance_pad1) and + bm_TGtkTextAppearance_pad1) + +proc pad2*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_pad2) shr + bp_TGtkTextAppearance_pad2 + +proc set_pad2*(a: var TTextAppearance, `pad2`: guint) = + a.flag0 = a.flag0 or + (int16(`pad2` shl bp_TGtkTextAppearance_pad2) and + bm_TGtkTextAppearance_pad2) + +proc pad3*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_pad3) shr + bp_TGtkTextAppearance_pad3 + +proc set_pad3*(a: var TTextAppearance, `pad3`: guint) = + a.flag0 = a.flag0 or + (int16(`pad3` shl bp_TGtkTextAppearance_pad3) and + bm_TGtkTextAppearance_pad3) + +proc pad4*(a: var TTextAppearance): guint = + result = (a.flag0 and bm_TGtkTextAppearance_pad4) shr + bp_TGtkTextAppearance_pad4 + +proc set_pad4*(a: var TTextAppearance, `pad4`: guint) = + a.flag0 = a.flag0 or + (int16(`pad4` shl bp_TGtkTextAppearance_pad4) and + bm_TGtkTextAppearance_pad4) + +proc invisible*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_invisible) shr + bp_TGtkTextAttributes_invisible + +proc set_invisible*(a: var TTextAttributes, `invisible`: guint) = + a.flag0 = a.flag0 or + (int16(`invisible` shl bp_TGtkTextAttributes_invisible) and + bm_TGtkTextAttributes_invisible) + +proc bg_full_height*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_bg_full_height) shr + bp_TGtkTextAttributes_bg_full_height + +proc set_bg_full_height*(a: var TTextAttributes, `bg_full_height`: guint) = + a.flag0 = a.flag0 or + (int16(`bg_full_height` shl bp_TGtkTextAttributes_bg_full_height) and + bm_TGtkTextAttributes_bg_full_height) + +proc editable*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_editable) shr + bp_TGtkTextAttributes_editable + +proc set_editable*(a: var TTextAttributes, `editable`: guint) = + a.flag0 = a.flag0 or + (int16(`editable` shl bp_TGtkTextAttributes_editable) and + bm_TGtkTextAttributes_editable) + +proc realized*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_realized) shr + bp_TGtkTextAttributes_realized + +proc set_realized*(a: var TTextAttributes, `realized`: guint) = + a.flag0 = a.flag0 or + (int16(`realized` shl bp_TGtkTextAttributes_realized) and + bm_TGtkTextAttributes_realized) + +proc pad1*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_pad1) shr + bp_TGtkTextAttributes_pad1 + +proc set_pad1*(a: var TTextAttributes, `pad1`: guint) = + a.flag0 = a.flag0 or + (int16(`pad1` shl bp_TGtkTextAttributes_pad1) and + bm_TGtkTextAttributes_pad1) + +proc pad2*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_pad2) shr + bp_TGtkTextAttributes_pad2 + +proc set_pad2*(a: var TTextAttributes, `pad2`: guint) = + a.flag0 = a.flag0 or + (int16(`pad2` shl bp_TGtkTextAttributes_pad2) and + bm_TGtkTextAttributes_pad2) + +proc pad3*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_pad3) shr + bp_TGtkTextAttributes_pad3 + +proc set_pad3*(a: var TTextAttributes, `pad3`: guint) = + a.flag0 = a.flag0 or + (int16(`pad3` shl bp_TGtkTextAttributes_pad3) and + bm_TGtkTextAttributes_pad3) + +proc pad4*(a: var TTextAttributes): guint = + result = (a.flag0 and bm_TGtkTextAttributes_pad4) shr + bp_TGtkTextAttributes_pad4 + +proc set_pad4*(a: var TTextAttributes, `pad4`: guint) = + a.flag0 = a.flag0 or + (int16(`pad4` shl bp_TGtkTextAttributes_pad4) and + bm_TGtkTextAttributes_pad4) + +proc TYPE_TEXT_TAG_TABLE*(): GType = + result = text_tag_table_get_type() + +proc TEXT_TAG_TABLE*(obj: pointer): PTextTagTable = + result = cast[PTextTagTable](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_TEXT_TAG_TABLE())) + +proc TEXT_TAG_TABLE_CLASS*(klass: pointer): PTextTagTableClass = + result = cast[PTextTagTableClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_TEXT_TAG_TABLE())) + +proc IS_TEXT_TAG_TABLE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_TAG_TABLE()) + +proc IS_TEXT_TAG_TABLE_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_TAG_TABLE()) + +proc TEXT_TAG_TABLE_GET_CLASS*(obj: pointer): PTextTagTableClass = + result = cast[PTextTagTableClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_TEXT_TAG_TABLE())) + +proc TYPE_TEXT_MARK*(): GType = + result = text_mark_get_type() + +proc TEXT_MARK*(anObject: pointer): PTextMark = + result = cast[PTextMark](G_TYPE_CHECK_INSTANCE_CAST(anObject, TYPE_TEXT_MARK())) + +proc TEXT_MARK_CLASS*(klass: pointer): PTextMarkClass = + result = cast[PTextMarkClass](G_TYPE_CHECK_CLASS_CAST(klass, TYPE_TEXT_MARK())) + +proc IS_TEXT_MARK*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_TEXT_MARK()) + +proc IS_TEXT_MARK_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_MARK()) + +proc TEXT_MARK_GET_CLASS*(obj: pointer): PTextMarkClass = + result = cast[PTextMarkClass](G_TYPE_INSTANCE_GET_CLASS(obj, TYPE_TEXT_MARK())) + +proc visible*(a: var TTextMarkBody): guint = + result = (a.flag0 and bm_TGtkTextMarkBody_visible) shr + bp_TGtkTextMarkBody_visible + +proc set_visible*(a: var TTextMarkBody, `visible`: guint) = + a.flag0 = a.flag0 or + (int16(`visible` shl bp_TGtkTextMarkBody_visible) and + bm_TGtkTextMarkBody_visible) + +proc not_deleteable*(a: var TTextMarkBody): guint = + result = (a.flag0 and bm_TGtkTextMarkBody_not_deleteable) shr + bp_TGtkTextMarkBody_not_deleteable + +proc set_not_deleteable*(a: var TTextMarkBody, `not_deleteable`: guint) = + a.flag0 = a.flag0 or + (int16(`not_deleteable` shl bp_TGtkTextMarkBody_not_deleteable) and + bm_TGtkTextMarkBody_not_deleteable) + +proc TYPE_TEXT_CHILD_ANCHOR*(): GType = + result = text_child_anchor_get_type() + +proc TEXT_CHILD_ANCHOR*(anObject: pointer): PTextChildAnchor = + result = cast[PTextChildAnchor](G_TYPE_CHECK_INSTANCE_CAST(anObject, + TYPE_TEXT_CHILD_ANCHOR())) + +proc TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): PTextChildAnchorClass = + result = cast[PTextChildAnchorClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_TEXT_CHILD_ANCHOR())) + +proc IS_TEXT_CHILD_ANCHOR*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, TYPE_TEXT_CHILD_ANCHOR()) + +proc IS_TEXT_CHILD_ANCHOR_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_CHILD_ANCHOR()) + +proc TEXT_CHILD_ANCHOR_GET_CLASS*(obj: pointer): PTextChildAnchorClass = + result = cast[PTextChildAnchorClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_TEXT_CHILD_ANCHOR())) + +proc width*(a: PTextLineData): gint = + result = a.flag0 and bm_TGtkTextLineData_width + +proc set_width*(a: PTextLineData, NewWidth: gint) = + a.flag0 = (bm_TGtkTextLineData_width and NewWidth) or a.flag0 + +proc valid*(a: PTextLineData): gint = + result = (a.flag0 and bm_TGtkTextLineData_valid) shr + bp_TGtkTextLineData_valid + +proc set_valid*(a: PTextLineData, `valid`: gint) = + a.flag0 = a.flag0 or + ((`valid` shl bp_TGtkTextLineData_valid) and bm_TGtkTextLineData_valid) + +proc TYPE_TEXT_BUFFER*(): GType = + result = text_buffer_get_type() + +proc TEXT_BUFFER*(obj: pointer): PTextBuffer = + result = cast[PTextBuffer](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_BUFFER())) + +proc TEXT_BUFFER_CLASS*(klass: pointer): PTextBufferClass = + result = cast[PTextBufferClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_TEXT_BUFFER())) + +proc IS_TEXT_BUFFER*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_BUFFER()) + +proc IS_TEXT_BUFFER_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_BUFFER()) + +proc TEXT_BUFFER_GET_CLASS*(obj: pointer): PTextBufferClass = + result = cast[PTextBufferClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_TEXT_BUFFER())) + +proc modified*(a: var TTextBuffer): guint = + result = (a.TextBufferflag0 and bm_TGtkTextBuffer_modified) shr + bp_TGtkTextBuffer_modified + +proc set_modified*(a: var TTextBuffer, `modified`: guint) = + a.TextBufferflag0 = a.TextBufferflag0 or + (int16(`modified` shl bp_TGtkTextBuffer_modified) and + bm_TGtkTextBuffer_modified) + +proc TYPE_TEXT_LAYOUT*(): GType = + result = text_layout_get_type() + +proc TEXT_LAYOUT*(obj: pointer): PTextLayout = + result = cast[PTextLayout](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_TEXT_LAYOUT())) + +proc TEXT_LAYOUT_CLASS*(klass: pointer): PTextLayoutClass = + result = cast[PTextLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass, + TYPE_TEXT_LAYOUT())) + +proc IS_TEXT_LAYOUT*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TEXT_LAYOUT()) + +proc IS_TEXT_LAYOUT_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, TYPE_TEXT_LAYOUT()) + +proc TEXT_LAYOUT_GET_CLASS*(obj: pointer): PTextLayoutClass = + result = cast[PTextLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj, + TYPE_TEXT_LAYOUT())) + +proc cursor_visible*(a: var TTextLayout): guint = + result = (a.TextLayoutflag0 and bm_TGtkTextLayout_cursor_visible) shr + bp_TGtkTextLayout_cursor_visible + +proc set_cursor_visible*(a: var TTextLayout, `cursor_visible`: guint) = + a.TextLayoutflag0 = a.TextLayoutflag0 or + (int16(`cursor_visible` shl bp_TGtkTextLayout_cursor_visible) and + bm_TGtkTextLayout_cursor_visible) + +proc cursor_direction*(a: var TTextLayout): gint = + result = (a.TextLayoutflag0 and bm_TGtkTextLayout_cursor_direction) shr + bp_TGtkTextLayout_cursor_direction + +proc set_cursor_direction*(a: var TTextLayout, `cursor_direction`: gint) = + a.TextLayoutflag0 = a.TextLayoutflag0 or + (int16(`cursor_direction` shl bp_TGtkTextLayout_cursor_direction) and + bm_TGtkTextLayout_cursor_direction) + +proc is_strong*(a: var TTextCursorDisplay): guint = + result = (a.flag0 and bm_TGtkTextCursorDisplay_is_strong) shr + bp_TGtkTextCursorDisplay_is_strong + +proc set_is_strong*(a: var TTextCursorDisplay, `is_strong`: guint) = + a.flag0 = a.flag0 or + (int16(`is_strong` shl bp_TGtkTextCursorDisplay_is_strong) and + bm_TGtkTextCursorDisplay_is_strong) + +proc is_weak*(a: var TTextCursorDisplay): guint = + result = (a.flag0 and bm_TGtkTextCursorDisplay_is_weak) shr + bp_TGtkTextCursorDisplay_is_weak + +proc set_is_weak*(a: var TTextCursorDisplay, `is_weak`: guint) = + a.flag0 = a.flag0 or + (int16(`is_weak` shl bp_TGtkTextCursorDisplay_is_weak) and + bm_TGtkTextCursorDisplay_is_weak) + +proc TYPE_TEXT_VIEW*(): GType = + result = text_view_get_type() + +proc TEXT_VIEW*(obj: pointer): PTextView = + result = cast[PTextView](CHECK_CAST(obj, TYPE_TEXT_VIEW())) + +proc TEXT_VIEW_CLASS*(klass: pointer): PTextViewClass = + result = cast[PTextViewClass](CHECK_CLASS_CAST(klass, TYPE_TEXT_VIEW())) + +proc IS_TEXT_VIEW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TEXT_VIEW()) + +proc IS_TEXT_VIEW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TEXT_VIEW()) + +proc TEXT_VIEW_GET_CLASS*(obj: pointer): PTextViewClass = + result = cast[PTextViewClass](CHECK_GET_CLASS(obj, TYPE_TEXT_VIEW())) + +proc editable*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_editable) shr + bp_TGtkTextView_editable + +proc set_editable*(a: var TTextView, `editable`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`editable` shl bp_TGtkTextView_editable) and + bm_TGtkTextView_editable) + +proc overwrite_mode*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_overwrite_mode) shr + bp_TGtkTextView_overwrite_mode + +proc set_overwrite_mode*(a: var TTextView, `overwrite_mode`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`overwrite_mode` shl bp_TGtkTextView_overwrite_mode) and + bm_TGtkTextView_overwrite_mode) + +proc cursor_visible*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_cursor_visible) shr + bp_TGtkTextView_cursor_visible + +proc set_cursor_visible*(a: var TTextView, `cursor_visible`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`cursor_visible` shl bp_TGtkTextView_cursor_visible) and + bm_TGtkTextView_cursor_visible) + +proc need_im_reset*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_need_im_reset) shr + bp_TGtkTextView_need_im_reset + +proc set_need_im_reset*(a: var TTextView, `need_im_reset`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`need_im_reset` shl bp_TGtkTextView_need_im_reset) and + bm_TGtkTextView_need_im_reset) + +proc just_selected_element*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_just_selected_element) shr + bp_TGtkTextView_just_selected_element + +proc set_just_selected_element*(a: var TTextView, `just_selected_element`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`just_selected_element` shl + bp_TGtkTextView_just_selected_element) and + bm_TGtkTextView_just_selected_element) + +proc disable_scroll_on_focus*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_disable_scroll_on_focus) shr + bp_TGtkTextView_disable_scroll_on_focus + +proc set_disable_scroll_on_focus*(a: var TTextView, + `disable_scroll_on_focus`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`disable_scroll_on_focus` shl + bp_TGtkTextView_disable_scroll_on_focus) and + bm_TGtkTextView_disable_scroll_on_focus) + +proc onscreen_validated*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_onscreen_validated) shr + bp_TGtkTextView_onscreen_validated + +proc set_onscreen_validated*(a: var TTextView, `onscreen_validated`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`onscreen_validated` shl bp_TGtkTextView_onscreen_validated) and + bm_TGtkTextView_onscreen_validated) + +proc mouse_cursor_obscured*(a: var TTextView): guint = + result = (a.TextViewflag0 and bm_TGtkTextView_mouse_cursor_obscured) shr + bp_TGtkTextView_mouse_cursor_obscured + +proc set_mouse_cursor_obscured*(a: var TTextView, `mouse_cursor_obscured`: guint) = + a.TextViewflag0 = a.TextViewflag0 or + (int16(`mouse_cursor_obscured` shl + bp_TGtkTextView_mouse_cursor_obscured) and + bm_TGtkTextView_mouse_cursor_obscured) + +proc TYPE_TIPS_QUERY*(): GType = + result = tips_query_get_type() + +proc TIPS_QUERY*(obj: pointer): PTipsQuery = + result = cast[PTipsQuery](CHECK_CAST(obj, TYPE_TIPS_QUERY())) + +proc TIPS_QUERY_CLASS*(klass: pointer): PTipsQueryClass = + result = cast[PTipsQueryClass](CHECK_CLASS_CAST(klass, TYPE_TIPS_QUERY())) + +proc IS_TIPS_QUERY*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TIPS_QUERY()) + +proc IS_TIPS_QUERY_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TIPS_QUERY()) + +proc TIPS_QUERY_GET_CLASS*(obj: pointer): PTipsQueryClass = + result = cast[PTipsQueryClass](CHECK_GET_CLASS(obj, TYPE_TIPS_QUERY())) + +proc emit_always*(a: var TTipsQuery): guint = + result = (a.TipsQueryflag0 and bm_TGtkTipsQuery_emit_always) shr + bp_TGtkTipsQuery_emit_always + +proc set_emit_always*(a: var TTipsQuery, `emit_always`: guint) = + a.TipsQueryflag0 = a.TipsQueryflag0 or + (int16(`emit_always` shl bp_TGtkTipsQuery_emit_always) and + bm_TGtkTipsQuery_emit_always) + +proc in_query*(a: var TTipsQuery): guint = + result = (a.TipsQueryflag0 and bm_TGtkTipsQuery_in_query) shr + bp_TGtkTipsQuery_in_query + +proc set_in_query*(a: var TTipsQuery, `in_query`: guint) = + a.TipsQueryflag0 = a.TipsQueryflag0 or + (int16(`in_query` shl bp_TGtkTipsQuery_in_query) and + bm_TGtkTipsQuery_in_query) + +proc TYPE_TOOLTIPS*(): GType = + result = tooltips_get_type() + +proc TOOLTIPS*(obj: pointer): PTooltips = + result = cast[PTooltips](CHECK_CAST(obj, TYPE_TOOLTIPS())) + +proc TOOLTIPS_CLASS*(klass: pointer): PTooltipsClass = + result = cast[PTooltipsClass](CHECK_CLASS_CAST(klass, TYPE_TOOLTIPS())) + +proc IS_TOOLTIPS*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TOOLTIPS()) + +proc IS_TOOLTIPS_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TOOLTIPS()) + +proc TOOLTIPS_GET_CLASS*(obj: pointer): PTooltipsClass = + result = cast[PTooltipsClass](CHECK_GET_CLASS(obj, TYPE_TOOLTIPS())) + +proc delay*(a: var TTooltips): guint = + result = (a.Tooltipsflag0 and bm_TGtkTooltips_delay) shr + bp_TGtkTooltips_delay + +proc set_delay*(a: var TTooltips, `delay`: guint) = + a.Tooltipsflag0 = a.Tooltipsflag0 or + ((`delay` shl bp_TGtkTooltips_delay) and bm_TGtkTooltips_delay) + +proc enabled*(a: var TTooltips): guint = + result = (a.Tooltipsflag0 and bm_TGtkTooltips_enabled) shr + bp_TGtkTooltips_enabled + +proc set_enabled*(a: var TTooltips, `enabled`: guint) = + a.Tooltipsflag0 = a.Tooltipsflag0 or + ((`enabled` shl bp_TGtkTooltips_enabled) and bm_TGtkTooltips_enabled) + +proc have_grab*(a: var TTooltips): guint = + result = (a.Tooltipsflag0 and bm_TGtkTooltips_have_grab) shr + bp_TGtkTooltips_have_grab + +proc set_have_grab*(a: var TTooltips, `have_grab`: guint) = + a.Tooltipsflag0 = a.Tooltipsflag0 or + ((`have_grab` shl bp_TGtkTooltips_have_grab) and + bm_TGtkTooltips_have_grab) + +proc use_sticky_delay*(a: var TTooltips): guint = + result = (a.Tooltipsflag0 and bm_TGtkTooltips_use_sticky_delay) shr + bp_TGtkTooltips_use_sticky_delay + +proc set_use_sticky_delay*(a: var TTooltips, `use_sticky_delay`: guint) = + a.Tooltipsflag0 = a.Tooltipsflag0 or + ((`use_sticky_delay` shl bp_TGtkTooltips_use_sticky_delay) and + bm_TGtkTooltips_use_sticky_delay) + +proc TYPE_TOOLBAR*(): GType = + result = toolbar_get_type() + +proc TOOLBAR*(obj: pointer): PToolbar = + result = cast[PToolbar](CHECK_CAST(obj, TYPE_TOOLBAR())) + +proc TOOLBAR_CLASS*(klass: pointer): PToolbarClass = + result = cast[PToolbarClass](CHECK_CLASS_CAST(klass, TYPE_TOOLBAR())) + +proc IS_TOOLBAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TOOLBAR()) + +proc IS_TOOLBAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TOOLBAR()) + +proc TOOLBAR_GET_CLASS*(obj: pointer): PToolbarClass = + result = cast[PToolbarClass](CHECK_GET_CLASS(obj, TYPE_TOOLBAR())) + +proc style_set*(a: var TToolbar): guint = + result = (a.Toolbarflag0 and bm_TGtkToolbar_style_set) shr + bp_TGtkToolbar_style_set + +proc set_style_set*(a: var TToolbar, `style_set`: guint) = + a.Toolbarflag0 = a.Toolbarflag0 or + (int16(`style_set` shl bp_TGtkToolbar_style_set) and + bm_TGtkToolbar_style_set) + +proc icon_size_set*(a: var TToolbar): guint = + result = (a.Toolbarflag0 and bm_TGtkToolbar_icon_size_set) shr + bp_TGtkToolbar_icon_size_set + +proc set_icon_size_set*(a: var TToolbar, `icon_size_set`: guint) = + a.Toolbarflag0 = a.Toolbarflag0 or + (int16(`icon_size_set` shl bp_TGtkToolbar_icon_size_set) and + bm_TGtkToolbar_icon_size_set) + +proc TYPE_TREE*(): GType = + result = tree_get_type() + +proc TREE*(obj: pointer): PTree = + result = cast[PTree](CHECK_CAST(obj, TYPE_TREE())) + +proc TREE_CLASS*(klass: pointer): PTreeClass = + result = cast[PTreeClass](CHECK_CLASS_CAST(klass, TYPE_TREE())) + +proc IS_TREE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE()) + +proc IS_TREE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE()) + +proc TREE_GET_CLASS*(obj: pointer): PTreeClass = + result = cast[PTreeClass](CHECK_GET_CLASS(obj, TYPE_TREE())) + +proc IS_ROOT_TREE*(obj: pointer): bool = + result = (cast[PObject]((TREE(obj)).root_tree)) == (cast[PObject](obj)) + +proc TREE_ROOT_TREE*(obj: pointer): PTree = + result = TREE(obj).root_tree + +proc TREE_SELECTION_OLD*(obj: pointer): PGList = + result = (TREE_ROOT_TREE(obj)).selection + +proc selection_mode*(a: var TTree): guint = + result = (a.Treeflag0 and bm_TGtkTree_selection_mode) shr + bp_TGtkTree_selection_mode + +proc set_selection_mode*(a: var TTree, `selection_mode`: guint) = + a.Treeflag0 = a.Treeflag0 or + (int16(`selection_mode` shl bp_TGtkTree_selection_mode) and + bm_TGtkTree_selection_mode) + +proc view_mode*(a: var TTree): guint = + result = (a.Treeflag0 and bm_TGtkTree_view_mode) shr bp_TGtkTree_view_mode + +proc set_view_mode*(a: var TTree, `view_mode`: guint) = + a.Treeflag0 = a.Treeflag0 or + (int16(`view_mode` shl bp_TGtkTree_view_mode) and bm_TGtkTree_view_mode) + +proc view_line*(a: var TTree): guint = + result = (a.Treeflag0 and bm_TGtkTree_view_line) shr bp_TGtkTree_view_line + +proc set_view_line*(a: var TTree, `view_line`: guint) = + a.Treeflag0 = a.Treeflag0 or + (int16(`view_line` shl bp_TGtkTree_view_line) and bm_TGtkTree_view_line) + +proc TYPE_TREE_DRAG_SOURCE*(): GType = + result = tree_drag_source_get_type() + +proc TREE_DRAG_SOURCE*(obj: pointer): PTreeDragSource = + result = cast[PTreeDragSource](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_TREE_DRAG_SOURCE())) + +proc IS_TREE_DRAG_SOURCE*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_DRAG_SOURCE()) + +proc TREE_DRAG_SOURCE_GET_IFACE*(obj: pointer): PTreeDragSourceIface = + result = cast[PTreeDragSourceIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_TREE_DRAG_SOURCE())) + +proc TYPE_TREE_DRAG_DEST*(): GType = + result = tree_drag_dest_get_type() + +proc TREE_DRAG_DEST*(obj: pointer): PTreeDragDest = + result = cast[PTreeDragDest](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_TREE_DRAG_DEST())) + +proc IS_TREE_DRAG_DEST*(obj: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_TREE_DRAG_DEST()) + +proc TREE_DRAG_DEST_GET_IFACE*(obj: pointer): PTreeDragDestIface = + result = cast[PTreeDragDestIface](G_TYPE_INSTANCE_GET_INTERFACE(obj, + TYPE_TREE_DRAG_DEST())) + +proc TYPE_TREE_ITEM*(): GType = + result = tree_item_get_type() + +proc TREE_ITEM*(obj: pointer): PTreeItem = + result = cast[PTreeItem](CHECK_CAST(obj, TYPE_TREE_ITEM())) + +proc TREE_ITEM_CLASS*(klass: pointer): PTreeItemClass = + result = cast[PTreeItemClass](CHECK_CLASS_CAST(klass, TYPE_TREE_ITEM())) + +proc IS_TREE_ITEM*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_ITEM()) + +proc IS_TREE_ITEM_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_ITEM()) + +proc TREE_ITEM_GET_CLASS*(obj: pointer): PTreeItemClass = + result = cast[PTreeItemClass](CHECK_GET_CLASS(obj, TYPE_TREE_ITEM())) + +proc TREE_ITEM_SUBTREE*(obj: pointer): PWidget = + result = (TREE_ITEM(obj)).subtree + +proc expanded*(a: var TTreeItem): guint = + result = (a.TreeItemflag0 and bm_TGtkTreeItem_expanded) shr + bp_TGtkTreeItem_expanded + +proc set_expanded*(a: var TTreeItem, `expanded`: guint) = + a.TreeItemflag0 = a.TreeItemflag0 or + (int16(`expanded` shl bp_TGtkTreeItem_expanded) and + bm_TGtkTreeItem_expanded) + +proc TYPE_TREE_SELECTION*(): GType = + result = tree_selection_get_type() + +proc TREE_SELECTION*(obj: pointer): PTreeSelection = + result = cast[PTreeSelection](CHECK_CAST(obj, TYPE_TREE_SELECTION())) + +proc TREE_SELECTION_CLASS*(klass: pointer): PTreeSelectionClass = + result = cast[PTreeSelectionClass](CHECK_CLASS_CAST(klass, + TYPE_TREE_SELECTION())) + +proc IS_TREE_SELECTION*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_SELECTION()) + +proc IS_TREE_SELECTION_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_SELECTION()) + +proc TREE_SELECTION_GET_CLASS*(obj: pointer): PTreeSelectionClass = + result = cast[PTreeSelectionClass](CHECK_GET_CLASS(obj, TYPE_TREE_SELECTION())) + +proc TYPE_TREE_STORE*(): GType = + result = tree_store_get_type() + +proc TREE_STORE*(obj: pointer): PTreeStore = + result = cast[PTreeStore](CHECK_CAST(obj, TYPE_TREE_STORE())) + +proc TREE_STORE_CLASS*(klass: pointer): PTreeStoreClass = + result = cast[PTreeStoreClass](CHECK_CLASS_CAST(klass, TYPE_TREE_STORE())) + +proc IS_TREE_STORE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_STORE()) + +proc IS_TREE_STORE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_STORE()) + +proc TREE_STORE_GET_CLASS*(obj: pointer): PTreeStoreClass = + result = cast[PTreeStoreClass](CHECK_GET_CLASS(obj, TYPE_TREE_STORE())) + +proc columns_dirty*(a: var TTreeStore): guint = + result = (a.TreeStoreflag0 and bm_TGtkTreeStore_columns_dirty) shr + bp_TGtkTreeStore_columns_dirty + +proc set_columns_dirty*(a: var TTreeStore, `columns_dirty`: guint) = + a.TreeStoreflag0 = a.TreeStoreflag0 or + (int16(`columns_dirty` shl bp_TGtkTreeStore_columns_dirty) and + bm_TGtkTreeStore_columns_dirty) + +proc TYPE_TREE_VIEW_COLUMN*(): GType = + result = tree_view_column_get_type() + +proc TREE_VIEW_COLUMN*(obj: pointer): PTreeViewColumn = + result = cast[PTreeViewColumn](CHECK_CAST(obj, TYPE_TREE_VIEW_COLUMN())) + +proc TREE_VIEW_COLUMN_CLASS*(klass: pointer): PTreeViewColumnClass = + result = cast[PTreeViewColumnClass](CHECK_CLASS_CAST(klass, + TYPE_TREE_VIEW_COLUMN())) + +proc IS_TREE_VIEW_COLUMN*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_VIEW_COLUMN()) + +proc IS_TREE_VIEW_COLUMN_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_VIEW_COLUMN()) + +proc TREE_VIEW_COLUMN_GET_CLASS*(obj: pointer): PTreeViewColumnClass = + result = cast[PTreeViewColumnClass](CHECK_GET_CLASS(obj, + TYPE_TREE_VIEW_COLUMN())) + +proc visible*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_visible) shr + bp_TGtkTreeViewColumn_visible + +proc set_visible*(a: var TTreeViewColumn, `visible`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`visible` shl bp_TGtkTreeViewColumn_visible) and + bm_TGtkTreeViewColumn_visible) + +proc resizable*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_resizable) shr + bp_TGtkTreeViewColumn_resizable + +proc set_resizable*(a: var TTreeViewColumn, `resizable`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`resizable` shl bp_TGtkTreeViewColumn_resizable) and + bm_TGtkTreeViewColumn_resizable) + +proc clickable*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_clickable) shr + bp_TGtkTreeViewColumn_clickable + +proc set_clickable*(a: var TTreeViewColumn, `clickable`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`clickable` shl bp_TGtkTreeViewColumn_clickable) and + bm_TGtkTreeViewColumn_clickable) + +proc dirty*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_dirty) shr + bp_TGtkTreeViewColumn_dirty + +proc set_dirty*(a: var TTreeViewColumn, `dirty`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`dirty` shl bp_TGtkTreeViewColumn_dirty) and + bm_TGtkTreeViewColumn_dirty) + +proc show_sort_indicator*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and + bm_TGtkTreeViewColumn_show_sort_indicator) shr + bp_TGtkTreeViewColumn_show_sort_indicator + +proc set_show_sort_indicator*(a: var TTreeViewColumn, + `show_sort_indicator`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`show_sort_indicator` shl + bp_TGtkTreeViewColumn_show_sort_indicator) and + bm_TGtkTreeViewColumn_show_sort_indicator) + +proc maybe_reordered*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_maybe_reordered) shr + bp_TGtkTreeViewColumn_maybe_reordered + +proc set_maybe_reordered*(a: var TTreeViewColumn, `maybe_reordered`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`maybe_reordered` shl bp_TGtkTreeViewColumn_maybe_reordered) and + bm_TGtkTreeViewColumn_maybe_reordered) + +proc reorderable*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_reorderable) shr + bp_TGtkTreeViewColumn_reorderable + +proc set_reorderable*(a: var TTreeViewColumn, `reorderable`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`reorderable` shl bp_TGtkTreeViewColumn_reorderable) and + bm_TGtkTreeViewColumn_reorderable) + +proc use_resized_width*(a: var TTreeViewColumn): guint = + result = (a.TreeViewColumnflag0 and bm_TGtkTreeViewColumn_use_resized_width) shr + bp_TGtkTreeViewColumn_use_resized_width + +proc set_use_resized_width*(a: var TTreeViewColumn, `use_resized_width`: guint) = + a.TreeViewColumnflag0 = a.TreeViewColumnflag0 or + (int16(`use_resized_width` shl bp_TGtkTreeViewColumn_use_resized_width) and + bm_TGtkTreeViewColumn_use_resized_width) + +proc flags*(a: PRBNode): guint = + result = (a.flag0 and bm_TGtkRBNode_flags) shr bp_TGtkRBNode_flags + +proc set_flags*(a: PRBNode, `flags`: guint) = + a.flag0 = a.flag0 or + (int16(`flags` shl bp_TGtkRBNode_flags) and bm_TGtkRBNode_flags) + +proc parity*(a: PRBNode): guint = + result = (a.flag0 and bm_TGtkRBNode_parity) shr bp_TGtkRBNode_parity + +proc set_parity*(a: PRBNode, `parity`: guint) = + a.flag0 = a.flag0 or + (int16(`parity` shl bp_TGtkRBNode_parity) and bm_TGtkRBNode_parity) + +proc RBNODE_GET_COLOR*(node_: PRBNode): guint = + if node_ == nil: + Result = RBNODE_BLACK + elif (int(flags(node_)) and RBNODE_RED) == RBNODE_RED: + Result = RBNODE_RED + else: + Result = RBNODE_BLACK + +proc RBNODE_SET_COLOR*(node_: PRBNode, color: guint) = + if node_ == nil: + return + if ((flags(node_) and (color)) != color): + set_flags(node_, flags(node_) xor cint(RBNODE_RED or RBNODE_BLACK)) + +proc RBNODE_GET_HEIGHT*(node_: PRBNode): gint = + var if_local1: gint + if node_.children != nil: + if_local1 = node_.children.root.offset + else: + if_local1 = 0 + result = node_.offset - + ((node_.left.offset) + node_.right.offset + if_local1) + +proc RBNODE_FLAG_SET*(node_: PRBNode, flag: guint): bool = + result = (node_ != nil) and ((flags(node_) and (flag)) == flag) + +proc RBNODE_SET_FLAG*(node_: PRBNode, flag: guint16) = + set_flags(node_, (flag) or flags(node_)) + +proc RBNODE_UNSET_FLAG*(node_: PRBNode, flag: guint16) = + set_flags(node_, (not (flag)) and flags(node_)) + +proc TREE_VIEW_FLAG_SET*(tree_view: PTreeView, flag: guint): bool = + result = ((tree_view.priv.flags) and (flag)) == flag + +proc TREE_VIEW_HEADER_HEIGHT*(tree_view: PTreeView): int32 = + var if_local1: int32 + if TREE_VIEW_FLAG_SET(tree_view, TREE_VIEW_HEADERS_VISIBLE): + if_local1 = tree_view.priv.header_height + else: + if_local1 = 0 + result = if_local1 + +proc TREE_VIEW_COLUMN_REQUESTED_WIDTH*(column: PTreeViewColumn): int32 = + var MinWidth, MaxWidth: int + if column.min_width != - 1'i32: + MinWidth = column.min_width + else: + MinWidth = column.requested_width + if column.max_width != - 1'i32: + MaxWidth = column.max_width + else: + MaxWidth = column.requested_width + result = CLAMP(column.requested_width, MinWidth, MaxWidth) + +proc TREE_VIEW_DRAW_EXPANDERS*(tree_view: PTreeView): bool = + result = (not (TREE_VIEW_FLAG_SET(tree_view, TREE_VIEW_IS_LIST))) and + (TREE_VIEW_FLAG_SET(tree_view, TREE_VIEW_SHOW_EXPANDERS)) + +proc TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER*(tree_view: PTreeView): int32 = + result = 10'i32 * (TREE_VIEW_HEADER_HEIGHT(tree_view)) + +proc scroll_to_use_align*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_scroll_to_use_align) shr + bp_TGtkTreeViewPrivate_scroll_to_use_align + +proc set_scroll_to_use_align*(a: var TTreeViewPrivate, + `scroll_to_use_align`: guint) = + a.flag0 = a.flag0 or + (int16(`scroll_to_use_align` shl + bp_TGtkTreeViewPrivate_scroll_to_use_align) and + bm_TGtkTreeViewPrivate_scroll_to_use_align) + +proc fixed_height_check*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_fixed_height_check) shr + bp_TGtkTreeViewPrivate_fixed_height_check + +proc set_fixed_height_check*(a: var TTreeViewPrivate, + `fixed_height_check`: guint) = + a.flag0 = a.flag0 or + (int16(`fixed_height_check` shl + bp_TGtkTreeViewPrivate_fixed_height_check) and + bm_TGtkTreeViewPrivate_fixed_height_check) + +proc reorderable*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_reorderable) shr + bp_TGtkTreeViewPrivate_reorderable + +proc set_reorderable*(a: var TTreeViewPrivate, `reorderable`: guint) = + a.flag0 = a.flag0 or + (int16(`reorderable` shl bp_TGtkTreeViewPrivate_reorderable) and + bm_TGtkTreeViewPrivate_reorderable) + +proc header_has_focus*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_header_has_focus) shr + bp_TGtkTreeViewPrivate_header_has_focus + +proc set_header_has_focus*(a: var TTreeViewPrivate, `header_has_focus`: guint) = + a.flag0 = a.flag0 or + (int16(`header_has_focus` shl bp_TGtkTreeViewPrivate_header_has_focus) and + bm_TGtkTreeViewPrivate_header_has_focus) + +proc drag_column_window_state*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_drag_column_window_state) shr + bp_TGtkTreeViewPrivate_drag_column_window_state + +proc set_drag_column_window_state*(a: var TTreeViewPrivate, + `drag_column_window_state`: guint) = + a.flag0 = a.flag0 or + (int16(`drag_column_window_state` shl + bp_TGtkTreeViewPrivate_drag_column_window_state) and + bm_TGtkTreeViewPrivate_drag_column_window_state) + +proc has_rules*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_has_rules) shr + bp_TGtkTreeViewPrivate_has_rules + +proc set_has_rules*(a: var TTreeViewPrivate, `has_rules`: guint) = + a.flag0 = a.flag0 or + (int16(`has_rules` shl bp_TGtkTreeViewPrivate_has_rules) and + bm_TGtkTreeViewPrivate_has_rules) + +proc mark_rows_col_dirty*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_mark_rows_col_dirty) shr + bp_TGtkTreeViewPrivate_mark_rows_col_dirty + +proc set_mark_rows_col_dirty*(a: var TTreeViewPrivate, + `mark_rows_col_dirty`: guint) = + a.flag0 = a.flag0 or + (int16(`mark_rows_col_dirty` shl + bp_TGtkTreeViewPrivate_mark_rows_col_dirty) and + bm_TGtkTreeViewPrivate_mark_rows_col_dirty) + +proc enable_search*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_enable_search) shr + bp_TGtkTreeViewPrivate_enable_search + +proc set_enable_search*(a: var TTreeViewPrivate, `enable_search`: guint) = + a.flag0 = a.flag0 or + (int16(`enable_search` shl bp_TGtkTreeViewPrivate_enable_search) and + bm_TGtkTreeViewPrivate_enable_search) + +proc disable_popdown*(a: var TTreeViewPrivate): guint = + result = (a.flag0 and bm_TGtkTreeViewPrivate_disable_popdown) shr + bp_TGtkTreeViewPrivate_disable_popdown + +proc set_disable_popdown*(a: var TTreeViewPrivate, `disable_popdown`: guint) = + a.flag0 = a.flag0 or + (int16(`disable_popdown` shl bp_TGtkTreeViewPrivate_disable_popdown) and + bm_TGtkTreeViewPrivate_disable_popdown) + +proc TREE_VIEW_SET_FLAG*(tree_view: PTreeView, flag: guint) = + tree_view.priv.flags = tree_view.priv.flags or (flag) + +proc TREE_VIEW_UNSET_FLAG*(tree_view: PTreeView, flag: guint) = + tree_view.priv.flags = tree_view.priv.flags and not (flag) + +proc TYPE_TREE_VIEW*(): GType = + result = tree_view_get_type() + +proc TREE_VIEW*(obj: pointer): PTreeView = + result = cast[PTreeView](CHECK_CAST(obj, TYPE_TREE_VIEW())) + +proc TREE_VIEW_CLASS*(klass: pointer): PTreeViewClass = + result = cast[PTreeViewClass](CHECK_CLASS_CAST(klass, TYPE_TREE_VIEW())) + +proc IS_TREE_VIEW*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_TREE_VIEW()) + +proc IS_TREE_VIEW_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_TREE_VIEW()) + +proc TREE_VIEW_GET_CLASS*(obj: pointer): PTreeViewClass = + result = cast[PTreeViewClass](CHECK_GET_CLASS(obj, TYPE_TREE_VIEW())) + +proc TYPE_VBUTTON_BOX*(): GType = + result = vbutton_box_get_type() + +proc VBUTTON_BOX*(obj: pointer): PVButtonBox = + result = cast[PVButtonBox](CHECK_CAST(obj, TYPE_VBUTTON_BOX())) + +proc VBUTTON_BOX_CLASS*(klass: pointer): PVButtonBoxClass = + result = cast[PVButtonBoxClass](CHECK_CLASS_CAST(klass, TYPE_VBUTTON_BOX())) + +proc IS_VBUTTON_BOX*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VBUTTON_BOX()) + +proc IS_VBUTTON_BOX_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VBUTTON_BOX()) + +proc VBUTTON_BOX_GET_CLASS*(obj: pointer): PVButtonBoxClass = + result = cast[PVButtonBoxClass](CHECK_GET_CLASS(obj, TYPE_VBUTTON_BOX())) + +proc TYPE_VIEWPORT*(): GType = + result = viewport_get_type() + +proc VIEWPORT*(obj: pointer): PViewport = + result = cast[PViewport](CHECK_CAST(obj, TYPE_VIEWPORT())) + +proc VIEWPORT_CLASS*(klass: pointer): PViewportClass = + result = cast[PViewportClass](CHECK_CLASS_CAST(klass, TYPE_VIEWPORT())) + +proc IS_VIEWPORT*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VIEWPORT()) + +proc IS_VIEWPORT_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VIEWPORT()) + +proc VIEWPORT_GET_CLASS*(obj: pointer): PViewportClass = + result = cast[PViewportClass](CHECK_GET_CLASS(obj, TYPE_VIEWPORT())) + +proc TYPE_VPANED*(): GType = + result = vpaned_get_type() + +proc VPANED*(obj: pointer): PVPaned = + result = cast[PVPaned](CHECK_CAST(obj, TYPE_VPANED())) + +proc VPANED_CLASS*(klass: pointer): PVPanedClass = + result = cast[PVPanedClass](CHECK_CLASS_CAST(klass, TYPE_VPANED())) + +proc IS_VPANED*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VPANED()) + +proc IS_VPANED_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VPANED()) + +proc VPANED_GET_CLASS*(obj: pointer): PVPanedClass = + result = cast[PVPanedClass](CHECK_GET_CLASS(obj, TYPE_VPANED())) + +proc TYPE_VRULER*(): GType = + result = vruler_get_type() + +proc VRULER*(obj: pointer): PVRuler = + result = cast[PVRuler](CHECK_CAST(obj, TYPE_VRULER())) + +proc VRULER_CLASS*(klass: pointer): PVRulerClass = + result = cast[PVRulerClass](CHECK_CLASS_CAST(klass, TYPE_VRULER())) + +proc IS_VRULER*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VRULER()) + +proc IS_VRULER_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VRULER()) + +proc VRULER_GET_CLASS*(obj: pointer): PVRulerClass = + result = cast[PVRulerClass](CHECK_GET_CLASS(obj, TYPE_VRULER())) + +proc TYPE_VSCALE*(): GType = + result = vscale_get_type() + +proc VSCALE*(obj: pointer): PVScale = + result = cast[PVScale](CHECK_CAST(obj, TYPE_VSCALE())) + +proc VSCALE_CLASS*(klass: pointer): PVScaleClass = + result = cast[PVScaleClass](CHECK_CLASS_CAST(klass, TYPE_VSCALE())) + +proc IS_VSCALE*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VSCALE()) + +proc IS_VSCALE_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VSCALE()) + +proc VSCALE_GET_CLASS*(obj: pointer): PVScaleClass = + result = cast[PVScaleClass](CHECK_GET_CLASS(obj, TYPE_VSCALE())) + +proc TYPE_VSCROLLBAR*(): GType = + result = vscrollbar_get_type() + +proc VSCROLLBAR*(obj: pointer): PVScrollbar = + result = cast[PVScrollbar](CHECK_CAST(obj, TYPE_VSCROLLBAR())) + +proc VSCROLLBAR_CLASS*(klass: pointer): PVScrollbarClass = + result = cast[PVScrollbarClass](CHECK_CLASS_CAST(klass, TYPE_VSCROLLBAR())) + +proc IS_VSCROLLBAR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VSCROLLBAR()) + +proc IS_VSCROLLBAR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VSCROLLBAR()) + +proc VSCROLLBAR_GET_CLASS*(obj: pointer): PVScrollbarClass = + result = cast[PVScrollbarClass](CHECK_GET_CLASS(obj, TYPE_VSCROLLBAR())) + +proc TYPE_VSEPARATOR*(): GType = + result = vseparator_get_type() + +proc VSEPARATOR*(obj: pointer): PVSeparator = + result = cast[PVSeparator](CHECK_CAST(obj, TYPE_VSEPARATOR())) + +proc VSEPARATOR_CLASS*(klass: pointer): PVSeparatorClass = + result = cast[PVSeparatorClass](CHECK_CLASS_CAST(klass, TYPE_VSEPARATOR())) + +proc IS_VSEPARATOR*(obj: pointer): bool = + result = CHECK_TYPE(obj, TYPE_VSEPARATOR()) + +proc IS_VSEPARATOR_CLASS*(klass: pointer): bool = + result = CHECK_CLASS_TYPE(klass, TYPE_VSEPARATOR()) + +proc VSEPARATOR_GET_CLASS*(obj: pointer): PVSeparatorClass = + # these were missing: + result = cast[PVSeparatorClass](CHECK_GET_CLASS(obj, TYPE_VSEPARATOR())) + +type + PCellLayout* = pointer + PPGtkCellLayout* = ptr PCellLayout + PSignalRunType* = ptr TSignalRunType + TSignalRunType* = int32 + PFileChooserAction* = ptr TFileChooserAction + TFileChooserAction* = enum + FILE_CHOOSER_ACTION_OPEN, FILE_CHOOSER_ACTION_SAVE, + FILE_CHOOSER_ACTION_SELECT_FOLDER, FILE_CHOOSER_ACTION_CREATE_FOLDER + PFileChooserError* = ptr TFileChooserError + TFileChooserError* = enum + FILE_CHOOSER_ERROR_NONEXISTENT, FILE_CHOOSER_ERROR_BAD_FILENAME + +const + ARG_READWRITE* = ARG_READABLE or ARG_WRITABLE + +proc binding_entry_add_signal*(binding_set: PBindingSet, keyval: guint, + modifiers: TGdkModifierType, + signal_name: cstring, n_args: guint){.varargs, + importc: "gtk_binding_entry_add_signal", cdecl, dynlib: lib.} +proc clist_new_with_titles*(columns: gint): PCList{.varargs, cdecl, + importc: "gtk_clist_new_with_titles", dynlib: lib.} +proc clist_prepend*(clist: PCList): gint{.importc: "gtk_clist_prepend", varargs, + cdecl, dynlib: lib.} +proc clist_append*(clist: PCList): gint{.importc: "gtk_clist_append", varargs, + cdecl, dynlib: lib.} +proc clist_insert*(clist: PCList, row: gint): gint{.varargs, cdecl, + importc: "gtk_clist_insert", dynlib: lib.} +proc cell_layout_set_attributes*(cell_layout: PCellLayout, cell: PCellRenderer){. + cdecl, varargs, importc: "gtk_cell_layout_set_attributes", dynlib: lib, + importc: "gtk_cell_layout_set_attributes".} +proc container_add_with_properties*(container: PContainer, widget: PWidget, + first_prop_name: cstring){.varargs, + importc: "gtk_container_add_with_properties", cdecl, dynlib: lib.} +proc container_child_set*(container: PContainer, child: PWidget, + first_prop_name: cstring){.varargs, cdecl, + importc: "gtk_container_child_set", dynlib: lib.} +proc container_child_get*(container: PContainer, child: PWidget, + first_prop_name: cstring){.varargs, cdecl, + importc: "gtk_container_child_get", dynlib: lib.} +proc container_child_set_valist*(container: PContainer, child: PWidget, + first_property_name: cstring){.varargs, + importc: "gtk_container_child_set_valist", cdecl, dynlib: lib.} +proc container_child_get_valist*(container: PContainer, child: PWidget, + first_property_name: cstring){.varargs, + importc: "gtk_container_child_get_valist", cdecl, dynlib: lib.} +proc ctree_new_with_titles*(columns: gint, tree_column: gint): PCTree{. + importc: "gtk_ctree_new_with_titles", varargs, cdecl, dynlib: lib.} +proc curve_get_vector*(curve: PCurve, veclen: int32){.varargs, cdecl, + importc: "gtk_curve_get_vector", dynlib: lib.} +proc curve_set_vector*(curve: PCurve, veclen: int32){.varargs, cdecl, + importc: "gtk_curve_set_vector", dynlib: lib.} +proc dialog_add_buttons*(dialog: PDialog, first_button_text: cstring){.varargs, + cdecl, importc: "gtk_dialog_add_buttons", dynlib: lib.} +proc dialog_new_with_buttons*(title: cstring, parent: PWindow, + flags: TDialogFlags, first_button_text: cstring): PDialog{. + varargs, cdecl, importc: "gtk_dialog_new_with_buttons", dynlib: lib.} +proc list_store_new*(n_columns: gint): PListStore{.varargs, cdecl, + importc: "gtk_list_store_new", dynlib: lib.} +proc list_store_set*(list_store: PListStore, iter: PTreeIter){.varargs, cdecl, + importc: "gtk_list_store_set", dynlib: lib.} +proc list_store_set_valist*(list_store: PListStore, iter: PTreeIter){.varargs, + cdecl, importc: "gtk_list_store_set_valist", dynlib: lib.} +proc message_dialog_new*(parent: PWindow, flags: TDialogFlags, + thetype: TMessageType, buttons: TButtonsType, + message_format: cstring): PMessageDialog{.varargs, + cdecl, importc: "gtk_message_dialog_new", dynlib: lib.} +proc signal_new*(name: cstring, signal_flags: TSignalRunType, + object_type: TType, function_offset: guint, + marshaller: TSignalMarshaller, return_val: TType, n_args: guint): guint{. + varargs, importc: "gtk_signal_new", cdecl, dynlib: lib.} +proc signal_emit*(anObject: PObject, signal_id: guint){.varargs, cdecl, + importc: "gtk_signal_emit", dynlib: lib.} +proc signal_emit_by_name*(anObject: PObject, name: cstring){.varargs, cdecl, + importc: "gtk_signal_emit_by_name", dynlib: lib.} +proc text_buffer_insert_with_tags*(buffer: PTextBuffer, iter: PTextIter, + text: cstring, length: gint, + first_tag: PTextTag){.varargs, + importc: "gtk_text_buffer_insert_with_tags", cdecl, dynlib: lib.} +proc text_buffer_insert_with_tags_by_name*(buffer: PTextBuffer, iter: PTextIter, + text: cstring, length: gint, first_tag_name: cstring){.varargs, + importc: "gtk_text_buffer_insert_with_tags_by_name", cdecl, dynlib: lib.} +proc text_buffer_create_tag*(buffer: PTextBuffer, tag_name: cstring, + first_property_name: cstring): PTextTag{.varargs, + importc: "gtk_text_buffer_create_tag", cdecl, dynlib: lib.} +proc tree_model_get*(tree_model: PTreeModel, iter: PTreeIter){.varargs, + importc: "gtk_tree_model_get", cdecl, dynlib: lib.} +proc tree_model_get_valist*(tree_model: PTreeModel, iter: PTreeIter){.varargs, + importc: "gtk_tree_model_get_valist", cdecl, dynlib: lib.} +proc tree_store_new*(n_columns: gint): PTreeStore{.varargs, cdecl, + importc: "gtk_tree_store_new", dynlib: lib.} +proc tree_store_set*(tree_store: PTreeStore, iter: PTreeIter){.varargs, cdecl, + importc: "gtk_tree_store_set", dynlib: lib.} +proc tree_store_set_valist*(tree_store: PTreeStore, iter: PTreeIter){.varargs, + cdecl, importc: "gtk_tree_store_set_valist", dynlib: lib.} +proc tree_store_iter_is_valid*(tree_store: PTreeStore, iter: PTreeIter): gboolean{. + cdecl, importc: "gtk_tree_store_iter_is_valid", dynlib: lib.} +proc tree_store_reorder*(tree_store: PTreeStore, parent: PTreeIter, + new_order: pgint){.cdecl, + importc: "gtk_tree_store_reorder", dynlib: lib.} +proc tree_store_swap*(tree_store: PTreeStore, a: PTreeIter, b: PTreeIter){. + cdecl, importc: "gtk_tree_store_swap", dynlib: lib.} +proc tree_store_move_before*(tree_store: PTreeStore, iter: PTreeIter, + position: PTreeIter){.cdecl, + importc: "gtk_tree_store_move_before", dynlib: lib.} +proc tree_store_move_after*(tree_store: PTreeStore, iter: PTreeIter, + position: PTreeIter){.cdecl, + importc: "gtk_tree_store_move_after", dynlib: lib.} +proc tree_view_insert_column_with_attributes*(tree_view: PTreeView, + position: gint, title: cstring, cell: PCellRenderer): gint{.varargs, + importc: "gtk_tree_view_insert_column_with_attributes", cdecl, dynlib: lib.} +proc tree_view_column_new_with_attributes*(title: cstring, cell: PCellRenderer): PTreeViewColumn{. + importc: "gtk_tree_view_column_new_with_attributes", varargs, cdecl, + dynlib: lib.} +proc tree_view_column_set_attributes*(tree_column: PTreeViewColumn, + cell_renderer: PCellRenderer){. + importc: "gtk_tree_view_column_set_attributes", varargs, cdecl, dynlib: lib.} +proc widget_new*(thetype: TType, first_property_name: cstring): PWidget{. + importc: "gtk_widget_new", varargs, cdecl, dynlib: lib.} +proc widget_set*(widget: PWidget, first_property_name: cstring){.varargs, + importc: "gtk_widget_set", cdecl, dynlib: lib.} +proc widget_queue_clear*(widget: PWidget){.importc: "gtk_widget_queue_clear", + cdecl, dynlib: lib.} +proc widget_queue_clear_area*(widget: PWidget, x: gint, y: gint, width: gint, + height: gint){.cdecl, + importc: "gtk_widget_queue_clear_area", dynlib: lib.} +proc widget_draw*(widget: PWidget, area: PGdkRectangle){.cdecl, + importc: "gtk_widget_draw", dynlib: lib.} +proc widget_style_get_valist*(widget: PWidget, first_property_name: cstring){. + varargs, cdecl, importc: "gtk_widget_style_get_valist", dynlib: lib.} +proc widget_style_get*(widget: PWidget, first_property_name: cstring){.varargs, + cdecl, importc: "gtk_widget_style_get", dynlib: lib.} +proc file_chooser_dialog_new*(title: cstring, parent: PWindow, + action: TFileChooserAction, + first_button_text: cstring): PDialog{.cdecl, + varargs, dynlib: lib, importc: "gtk_file_chooser_dialog_new".} +proc file_chooser_dialog_new_with_backend*(title: cstring, parent: PWindow, + action: TFileChooserAction, backend: cstring, first_button_text: cstring): PDialog{. + varargs, cdecl, dynlib: lib, + importc: "gtk_file_chooser_dialog_new_with_backend".} +proc object_ref*(anObject: PObject): PObject{.cdecl, importc: "gtk_object_ref", + dynlib: lib.} +proc object_unref*(anObject: PObject){.cdecl, importc: "gtk_object_unref", + dynlib: lib.} +proc object_weakref*(anObject: PObject, notify: TDestroyNotify, data: gpointer){. + cdecl, importc: "gtk_object_weakref", dynlib: lib.} +proc object_weakunref*(anObject: PObject, notify: TDestroyNotify, data: gpointer){. + cdecl, importc: "gtk_object_weakunref", dynlib: lib.} +proc object_set_data*(anObject: PObject, key: cstring, data: gpointer){.cdecl, + importc: "gtk_object_set_data", dynlib: lib.} +proc object_set_data_full*(anObject: PObject, key: cstring, data: gpointer, + destroy: TDestroyNotify){. + importc: "gtk_object_set_data_full", cdecl, dynlib: lib.} +proc object_remove_data*(anObject: PObject, key: cstring){.cdecl, + importc: "gtk_object_remove_data", dynlib: lib.} +proc object_get_data*(anObject: PObject, key: cstring): gpointer{.cdecl, + importc: "gtk_object_get_data", dynlib: lib.} +proc object_remove_no_notify*(anObject: PObject, key: cstring){.cdecl, + importc: "gtk_object_remove_no_notify", dynlib: lib.} +proc object_set_user_data*(anObject: PObject, data: gpointer){.cdecl, + importc: "gtk_object_set_user_data", dynlib: lib.} +proc object_get_user_data*(anObject: PObject): gpointer{.cdecl, + importc: "gtk_object_get_user_data", dynlib: lib.} +proc object_set_data_by_id*(anObject: PObject, data_id: TGQuark, data: gpointer){. + cdecl, importc: "gtk_object_set_data_by_id", dynlib: lib.} +proc object_set_data_by_id_full*(anObject: PObject, data_id: TGQuark, + data: gpointer, destroy: TDestroyNotify){. + cdecl, importc: "gtk_object_set_data_by_id_full", dynlib: lib.} +proc object_get_data_by_id*(anObject: PObject, data_id: TGQuark): gpointer{. + cdecl, importc: "gtk_object_get_data_by_id", dynlib: lib.} +proc object_remove_data_by_id*(anObject: PObject, data_id: TGQuark){.cdecl, + importc: "gtk_object_remove_data_by_id", dynlib: lib.} +proc object_remove_no_notify_by_id*(anObject: PObject, key_id: TGQuark){.cdecl, + importc: "gtk_object_remove_no_notify_by_id", dynlib: lib.} +proc object_data_try_key*(str: cstring): TGQuark{.cdecl, + importc: "gtk_object_data_try_key", dynlib: lib.} +proc object_data_force_id*(str: cstring): TGQuark{.cdecl, + importc: "gtk_object_data_force_id", dynlib: lib.} +proc object_get*(anObject: PObject, first_property_name: cstring){.cdecl, + importc: "gtk_object_get", varargs, dynlib: lib.} +proc object_set*(anObject: PObject, first_property_name: cstring){.cdecl, + importc: "gtk_object_set", varargs, dynlib: lib.} +proc object_add_arg_type*(arg_name: cstring, arg_type: TType, arg_flags: guint, + arg_id: guint){.cdecl, + importc: "gtk_object_add_arg_type", dynlib: lib.} +type + PFileChooser* = pointer + PPGtkFileChooser* = ptr PFileChooser + +type + PFileFilter* = pointer + PPGtkFileFilter* = ref PFileFilter + PFileFilterFlags* = ref TFileFilterFlags + TFileFilterFlags* = enum + FILE_FILTER_FILENAME = 1 shl 0, FILE_FILTER_URI = 1 shl 1, + FILE_FILTER_DISPLAY_NAME = 1 shl 2, FILE_FILTER_MIME_TYPE = 1 shl 3 + PFileFilterInfo* = ref TFileFilterInfo + TFileFilterInfo*{.final, pure.} = object + contains*: TFileFilterFlags + filename*: cstring + uri*: cstring + display_name*: cstring + mime_type*: cstring + + TFileFilterFunc* = proc (filter_info: PFileFilterInfo, data: gpointer): gboolean{. + cdecl.} + +proc TYPE_FILE_FILTER*(): GType +proc FILE_FILTER*(obj: pointer): PFileFilter +proc IS_FILE_FILTER*(obj: pointer): gboolean +proc file_filter_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_file_filter_get_type".} +proc file_filter_new*(): PFileFilter{.cdecl, dynlib: lib, + importc: "gtk_file_filter_new".} +proc file_filter_set_name*(filter: PFileFilter, name: cstring){.cdecl, + dynlib: lib, importc: "gtk_file_filter_set_name".} +proc file_filter_get_name*(filter: PFileFilter): cstring{.cdecl, dynlib: lib, + importc: "gtk_file_filter_get_name".} +proc file_filter_add_mime_type*(filter: PFileFilter, mime_type: cstring){.cdecl, + dynlib: lib, importc: "gtk_file_filter_add_mime_type".} +proc file_filter_add_pattern*(filter: PFileFilter, pattern: cstring){.cdecl, + dynlib: lib, importc: "gtk_file_filter_add_pattern".} +proc file_filter_add_custom*(filter: PFileFilter, needed: TFileFilterFlags, + func: TFileFilterFunc, data: gpointer, + notify: TGDestroyNotify){.cdecl, dynlib: lib, + importc: "gtk_file_filter_add_custom".} +proc file_filter_get_needed*(filter: PFileFilter): TFileFilterFlags{.cdecl, + dynlib: lib, importc: "gtk_file_filter_get_needed".} +proc file_filter_filter*(filter: PFileFilter, filter_info: PFileFilterInfo): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_filter_filter".} +proc TYPE_FILE_FILTER(): GType = + result = file_filter_get_type() + +proc FILE_FILTER(obj: pointer): PFileFilter = + result = cast[PFileFilter](G_TYPE_CHECK_INSTANCE_CAST(obj, TYPE_FILE_FILTER())) + +proc IS_FILE_FILTER(obj: pointer): gboolean = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_FILE_FILTER()) + +proc file_chooser_get_type*(): GType{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_get_type".} +proc file_chooser_error_quark*(): TGQuark{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_error_quark".} +proc TYPE_FILE_CHOOSER*(): GType = + result = file_chooser_get_type() + +proc FILE_CHOOSER*(obj: pointer): PFileChooser = + result = cast[PFileChooser](G_TYPE_CHECK_INSTANCE_CAST(obj, + TYPE_FILE_CHOOSER())) + +proc IS_FILE_CHOOSER*(obj: pointer): gboolean = + result = G_TYPE_CHECK_INSTANCE_TYPE(obj, TYPE_FILE_CHOOSER()) + +proc file_chooser_set_action*(chooser: PFileChooser, action: TFileChooserAction){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_action".} +proc file_chooser_get_action*(chooser: PFileChooser): TFileChooserAction{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_action".} +proc file_chooser_set_local_only*(chooser: PFileChooser, local_only: gboolean){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_local_only".} +proc file_chooser_get_local_only*(chooser: PFileChooser): gboolean{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_local_only".} +proc file_chooser_set_select_multiple*(chooser: PFileChooser, + select_multiple: gboolean){.cdecl, + dynlib: lib, importc: "gtk_file_chooser_set_select_multiple".} +proc file_chooser_get_select_multiple*(chooser: PFileChooser): gboolean{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_select_multiple".} +proc file_chooser_set_current_name*(chooser: PFileChooser, name: cstring){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_name".} +proc file_chooser_get_filename*(chooser: PFileChooser): cstring{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_filename".} +proc file_chooser_set_filename*(chooser: PFileChooser, filename: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_filename".} +proc file_chooser_select_filename*(chooser: PFileChooser, filename: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_select_filename".} +proc file_chooser_unselect_filename*(chooser: PFileChooser, filename: cstring){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_unselect_filename".} +proc file_chooser_select_all*(chooser: PFileChooser){.cdecl, dynlib: lib, + importc: "gtk_file_chooser_select_all".} +proc file_chooser_unselect_all*(chooser: PFileChooser){.cdecl, dynlib: lib, + importc: "gtk_file_chooser_unselect_all".} +proc file_chooser_get_filenames*(chooser: PFileChooser): PGSList{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_filenames".} +proc file_chooser_set_current_folder*(chooser: PFileChooser, filename: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_folder".} +proc file_chooser_get_current_folder*(chooser: PFileChooser): cstring{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_current_folder".} +proc file_chooser_get_uri*(chooser: PFileChooser): cstring{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_get_uri".} +proc file_chooser_set_uri*(chooser: PFileChooser, uri: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_uri".} +proc file_chooser_select_uri*(chooser: PFileChooser, uri: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_select_uri".} +proc file_chooser_unselect_uri*(chooser: PFileChooser, uri: cstring){.cdecl, + dynlib: lib, importc: "gtk_file_chooser_unselect_uri".} +proc file_chooser_get_uris*(chooser: PFileChooser): PGSList{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_get_uris".} +proc file_chooser_set_current_folder_uri*(chooser: PFileChooser, uri: cstring): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_current_folder_uri".} +proc file_chooser_get_current_folder_uri*(chooser: PFileChooser): cstring{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_get_current_folder_uri".} +proc file_chooser_set_preview_widget*(chooser: PFileChooser, + preview_widget: PWidget){.cdecl, + dynlib: lib, importc: "gtk_file_chooser_set_preview_widget".} +proc file_chooser_get_preview_widget*(chooser: PFileChooser): PWidget{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_preview_widget".} +proc file_chooser_set_preview_widget_active*(chooser: PFileChooser, + active: gboolean){.cdecl, dynlib: lib, + importc: "gtk_file_chooser_set_preview_widget_active".} +proc file_chooser_get_preview_widget_active*(chooser: PFileChooser): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_get_preview_widget_active".} +proc file_chooser_set_use_preview_label*(chooser: PFileChooser, + use_label: gboolean){.cdecl, dynlib: lib, + importc: "gtk_file_chooser_set_use_preview_label".} +proc file_chooser_get_use_preview_label*(chooser: PFileChooser): gboolean{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_get_use_preview_label".} +proc file_chooser_get_preview_filename*(chooser: PFileChooser): cstring{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_preview_filename".} +proc file_chooser_get_preview_uri*(chooser: PFileChooser): cstring{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_preview_uri".} +proc file_chooser_set_extra_widget*(chooser: PFileChooser, extra_widget: PWidget){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_extra_widget".} +proc file_chooser_get_extra_widget*(chooser: PFileChooser): PWidget{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_extra_widget".} +proc file_chooser_add_filter*(chooser: PFileChooser, filter: PFileFilter){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_add_filter".} +proc file_chooser_remove_filter*(chooser: PFileChooser, filter: PFileFilter){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_remove_filter".} +proc file_chooser_list_filters*(chooser: PFileChooser): PGSList{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_list_filters".} +proc file_chooser_set_filter*(chooser: PFileChooser, filter: PFileFilter){. + cdecl, dynlib: lib, importc: "gtk_file_chooser_set_filter".} +proc file_chooser_get_filter*(chooser: PFileChooser): PFileFilter{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_get_filter".} +proc file_chooser_add_shortcut_folder*(chooser: PFileChooser, folder: cstring, + error: pointer): gboolean{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_add_shortcut_folder".} +proc file_chooser_remove_shortcut_folder*(chooser: PFileChooser, + folder: cstring, error: pointer): gboolean{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_remove_shortcut_folder".} +proc file_chooser_list_shortcut_folders*(chooser: PFileChooser): PGSList{.cdecl, + dynlib: lib, importc: "gtk_file_chooser_list_shortcut_folders".} +proc file_chooser_add_shortcut_folder_uri*(chooser: PFileChooser, uri: cstring, + error: pointer): gboolean{.cdecl, dynlib: lib, importc: "gtk_file_chooser_add_shortcut_folder_uri".} +proc file_chooser_remove_shortcut_folder_uri*(chooser: PFileChooser, + uri: cstring, error: pointer): gboolean{.cdecl, dynlib: lib, + importc: "gtk_file_chooser_remove_shortcut_folder_uri".} +proc file_chooser_list_shortcut_folder_uris*(chooser: PFileChooser): PGSList{. + cdecl, dynlib: lib, importc: "gtk_file_chooser_list_shortcut_folder_uris".} +proc file_chooser_set_do_overwrite_confirmation*(chooser: PFileChooser, + do_overwrite_confirmation: gboolean){.cdecl, dynlib: lib, + importc: "gtk_file_chooser_set_do_overwrite_confirmation".} +proc nimrod_init*() = + var + cmdLine{.importc: "cmdLine".}: array[0..255, cstring] + cmdCount{.importc: "cmdCount".}: cint + init(addr(cmdLine), addr(cmdCount)) diff --git a/lib/newwrap/gtk/gtkglext.nim b/lib/newwrap/gtk/gtkglext.nim new file mode 100644 index 000000000..779c78ee1 --- /dev/null +++ b/lib/newwrap/gtk/gtkglext.nim @@ -0,0 +1,48 @@ +{.deadCodeElim: on.} +import + Glib2, Gdk2, 2, GdkGLExt + +const + GLExtLib* = if defined(WIN32): "libgtkglext-win32-1.0-0.dll" else: "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: Plongint, argv: PPPChar): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gtk_gl_parse_args".} +proc gl_init_check*(argc: Plongint, argv: PPPChar): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gtk_gl_init_check".} +proc gl_init*(argc: Plongint, argv: PPPChar){.cdecl, dynlib: GLExtLib, + importc: "gtk_gl_init".} +proc widget_set_gl_capability*(widget: PWidget, glconfig: PGdkGLConfig, + share_list: PGdkGLContext, direct: gboolean, + render_type: int): gboolean{.cdecl, + dynlib: GLExtLib, importc: "gtk_widget_set_gl_capability".} +proc widget_is_gl_capable*(widget: PWidget): gboolean{.cdecl, dynlib: GLExtLib, + importc: "gtk_widget_is_gl_capable".} +proc widget_get_gl_config*(widget: PWidget): PGdkGLConfig{.cdecl, + dynlib: GLExtLib, importc: "gtk_widget_get_gl_config".} +proc widget_create_gl_context*(widget: PWidget, share_list: PGdkGLContext, + direct: gboolean, render_type: int): PGdkGLContext{. + cdecl, dynlib: GLExtLib, importc: "gtk_widget_create_gl_context".} +proc widget_get_gl_context*(widget: PWidget): PGdkGLContext{.cdecl, + dynlib: GLExtLib, importc: "gtk_widget_get_gl_context".} +proc widget_get_gl_window*(widget: PWidget): PGdkGLWindow{.cdecl, + dynlib: GLExtLib, importc: "gtk_widget_get_gl_window".} +proc widget_get_gl_drawable*(widget: PWidget): PGdkGLDrawable = + nil + +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 widget_get_gl_drawable*(widget: PWidget): PGdkGLDrawable = + result = GDK_GL_DRAWABLE(widget_get_gl_window(widget)) diff --git a/lib/newwrap/gtk/gtkhtml.nim b/lib/newwrap/gtk/gtkhtml.nim new file mode 100644 index 000000000..a71a24836 --- /dev/null +++ b/lib/newwrap/gtk/gtkhtml.nim @@ -0,0 +1,494 @@ +{.deadCodeElim: on.} +import + 2, glib2, atk, pango, gdk2pixbuf, gdk2 + +when defined(windows): + {.define: WINDOWING_WIN32.} + const + htmllib = "libgtkhtml-win32-2.0-0.dll" +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 + TDomBoolean* = gboolean + TDomException* = gushort + TDomTimeStamp* = guint64 + PDomNode* = ptr TDomNode + TDomNode* = object of TGObject + xmlnode*: pointer + style*: pointer + + 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*: xmlParserCtxtPtr + res*: int32 + chars*: array[0..9, char] + blocking*: gboolean + blocking_node*: PDomNode + + PHtmlParserClass* = ptr THtmlParserClass + THtmlParserClass* = object of 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: Pgchar, + 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: Pgchar, len: gint, + user_data: gpointer){.cdecl.} + PHtmlContext* = ptr THtmlContext + THtmlContext* = object of TGObject + documents*: PGSList + standard_font*: PHtmlFontSpecification + fixed_font*: PHtmlFontSpecification + debug_painting*: gboolean + + 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: Pgchar, + stream: PHtmlStream){.cdecl.} + link_clicked*: proc (document: PHtmlDocument, url: Pgchar){.cdecl.} + set_base*: proc (document: PHtmlDocument, url: Pgchar){.cdecl.} + title_changed*: proc (document: PHtmlDocument, new_title: Pgchar){.cdecl.} + submit*: proc (document: PHtmlDocument, `method`: Pgchar, url: Pgchar, + encoding: Pgchar){.cdecl.} + + PHtmlView* = ptr THtmlView + THtmlView* = object of 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*: pgchar + magnification*: gdouble + magnification_modified*: gboolean + on_url*: gboolean + + PHtmlViewClass* = ptr THtmlViewClass + THtmlViewClass* = object of TLayoutClass + move_cursor*: proc (html_view: PHtmlView, step: TMovementStep, count: gint, + extend_selection: gboolean){.cdecl.} + on_url*: proc (html_view: PHtmlView, url: Pgchar) + activate*: proc (html_view: PHtmlView) + move_focus_out*: proc (html_view: PHtmlView, direction: TDirectionType) + + +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 dom_Node__get_childNodes*(node: PDomNode): PDomNodeList{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_childNodes".} +proc dom_Node_removeChild*(node: PDomNode, oldChild: PDomNode, + exc: PDomException): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node_removeChild".} +proc dom_Node__get_nodeValue*(node: PDomNode, exc: PDomException): PDomString{. + cdecl, dynlib: htmllib, importc: "dom_Node__get_nodeValue".} +proc dom_Node__get_firstChild*(node: PDomNode): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_firstChild".} +proc dom_Node__get_nodeName*(node: PDomNode): PDomString{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_nodeName".} +proc dom_Node__get_attributes*(node: PDomNode): PDomNamedNodeMap{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_attributes".} +proc dom_Document__get_doctype*(doc: PDomDocument): PDomDocumentType{.cdecl, + dynlib: htmllib, importc: "dom_Document__get_doctype".} +proc dom_Node_hasChildNodes*(node: PDomNode): DomBoolean{.cdecl, + dynlib: htmllib, importc: "dom_Node_hasChildNodes".} +proc dom_Node__get_parentNode*(node: PDomNode): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_parentNode".} +proc dom_Node__get_nextSibling*(node: PDomNode): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_nextSibling".} +proc dom_Node__get_nodeType*(node: PDomNode): gushort{.cdecl, dynlib: htmllib, + importc: "dom_Node__get_nodeType".} +proc dom_Node_hasAttributes*(node: PDomNode): DomBoolean{.cdecl, + dynlib: htmllib, importc: "dom_Node_hasAttributes".} +proc dom_Node_cloneNode*(node: PDomNode, deep: DomBoolean): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node_cloneNode".} +proc dom_Node_appendChild*(node: PDomNode, newChild: PDomNode, + exc: PDomException): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node_appendChild".} +proc dom_Node__get_localName*(node: PDomNode): PDomString{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_localName".} +proc dom_Node__get_namespaceURI*(node: PDomNode): PDomString{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_namespaceURI".} +proc dom_Node__get_previousSibling*(node: PDomNode): PDomNode{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_previousSibling".} +proc dom_Node__get_lastChild*(node: PDomNode): PDomNode{.cdecl, dynlib: htmllib, + importc: "dom_Node__get_lastChild".} +proc dom_Node__set_nodeValue*(node: PDomNode, value: PDomString, + exc: PDomException){.cdecl, dynlib: htmllib, + importc: "dom_Node__set_nodeValue".} +proc dom_Node__get_ownerDocument*(node: PDomNode): PDomDocument{.cdecl, + dynlib: htmllib, importc: "dom_Node__get_ownerDocument".} +proc dom_Node_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 dom_Document__get_documentElement*(doc: PDomDocument): PDomElement +proc dom_Document_createElement*(doc: PDomDocument, tagName: PDomString): PDomElement +proc dom_Document_createTextNode*(doc: PDomDocument, data: PDomString): PDomText +proc dom_Document_createComment*(doc: PDomDocument, data: PDomString): PDomComment +proc dom_Document_importNode*(doc: PDomDocument, importedNode: PDomNode, + deep: DomBoolean, 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 html_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 html_stream_write*(stream: PHtmlStream, buffer: Pgchar, size: guint){. + cdecl, dynlib: htmllib, importc: "html_stream_write".} +proc html_stream_close*(stream: PHtmlStream){.cdecl, dynlib: htmllib, + importc: "html_stream_close".} +proc html_stream_destroy*(stream: PHtmlStream){.cdecl, dynlib: htmllib, + importc: "html_stream_destroy".} +proc html_stream_get_written*(stream: PHtmlStream): gint{.cdecl, + dynlib: htmllib, importc: "html_stream_get_written".} +proc html_stream_cancel*(stream: PHtmlStream){.cdecl, dynlib: htmllib, + importc: "html_stream_cancel".} +proc html_stream_set_cancel_func*(stream: PHtmlStream, + abort_func: THtmlStreamCancelFunc, + cancel_data: gpointer){.cdecl, + dynlib: htmllib, importc: "html_stream_set_cancel_func".} +proc html_stream_get_mime_type*(stream: PHtmlStream): cstring{.cdecl, + dynlib: htmllib, importc: "html_stream_get_mime_type".} +proc html_stream_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 html_event_mouse_move*(view: PHtmlView, event: PGdkEventMotion){.cdecl, + dynlib: htmllib, importc: "html_event_mouse_move".} +proc html_event_button_press*(view: PHtmlView, button: PGdkEventButton){.cdecl, + dynlib: htmllib, importc: "html_event_button_press".} +proc html_event_button_release*(view: PHtmlView, event: PGdkEventButton){.cdecl, + dynlib: htmllib, importc: "html_event_button_release".} +proc html_event_activate*(view: PHtmlView){.cdecl, dynlib: htmllib, + importc: "html_event_activate".} +proc html_event_key_press*(view: PHtmlView, event: PGdkEventKey): gboolean{. + cdecl, dynlib: htmllib, importc: "html_event_key_press".} +proc html_event_find_root_box*(self: PHtmlBox, x: gint, y: gint): PHtmlBox{. + cdecl, dynlib: htmllib, importc: "html_event_find_root_box".} +proc html_selection_start*(view: PHtmlView, event: PGdkEventButton){.cdecl, + dynlib: htmllib, importc: "html_selection_start".} +proc html_selection_end*(view: PHtmlView, event: PGdkEventButton){.cdecl, + dynlib: htmllib, importc: "html_selection_end".} +proc html_selection_update*(view: PHtmlView, event: PGdkEventMotion){.cdecl, + dynlib: htmllib, importc: "html_selection_update".} +proc html_selection_clear*(view: PHtmlView){.cdecl, dynlib: htmllib, + importc: "html_selection_clear".} +proc html_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 html_document_open_stream*(document: PHtmlDocument, mime_type: Pgchar): gboolean{. + cdecl, dynlib: htmllib, importc: "html_document_open_stream".} +proc html_document_write_stream*(document: PHtmlDocument, buffer: Pgchar, + len: gint){.cdecl, dynlib: htmllib, + importc: "html_document_write_stream".} +proc html_document_close_stream*(document: PHtmlDocument){.cdecl, + dynlib: htmllib, importc: "html_document_close_stream".} +proc html_document_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 html_view_set_document*(view: PHtmlView, document: PHtmlDocument){.cdecl, + dynlib: htmllib, importc: "html_view_set_document".} +proc html_view_jump_to_anchor*(view: PHtmlView, anchor: Pgchar){.cdecl, + dynlib: htmllib, importc: "html_view_jump_to_anchor".} +proc html_view_get_magnification*(view: PHtmlView): gdouble{.cdecl, + dynlib: htmllib, importc: "html_view_get_magnification".} +proc html_view_set_magnification*(view: PHtmlView, magnification: gdouble){. + cdecl, dynlib: htmllib, importc: "html_view_set_magnification".} +proc html_view_zoom_in*(view: PHtmlView){.cdecl, dynlib: htmllib, + importc: "html_view_zoom_in".} +proc html_view_zoom_out*(view: PHtmlView){.cdecl, dynlib: htmllib, + importc: "html_view_zoom_out".} +proc html_view_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(), TDomNode) + +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()) diff --git a/lib/newwrap/gtk/libglade2.nim b/lib/newwrap/gtk/libglade2.nim new file mode 100644 index 000000000..47e78e05e --- /dev/null +++ b/lib/newwrap/gtk/libglade2.nim @@ -0,0 +1,111 @@ +{.deadCodeElim: on.} +import + glib2, gtk2 + +when defined(win32): + const + LibGladeLib = "libglade-2.0-0.dll" +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 xml_construct*(self: PXML, fname: cstring, root: cstring, domain: cstring): gboolean{. + cdecl, dynlib: LibGladeLib, importc: "glade_xml_construct".} +proc xml_signal_connect*(self: PXML, handlername: cstring, func: TGCallback){. + cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect".} +proc xml_signal_connect_data*(self: PXML, handlername: cstring, + func: TGCallback, user_data: gpointer){.cdecl, + dynlib: LibGladeLib, importc: "glade_xml_signal_connect_data".} +proc xml_signal_autoconnect*(self: PXML){.cdecl, dynlib: LibGladeLib, + importc: "glade_xml_signal_autoconnect".} +proc xml_signal_connect_full*(self: PXML, handler_name: cstring, + func: TXMLConnectFunc, user_data: gpointer){. + cdecl, dynlib: LibGladeLib, importc: "glade_xml_signal_connect_full".} +proc xml_signal_autoconnect_full*(self: PXML, func: TXMLConnectFunc, + user_data: gpointer){.cdecl, + dynlib: LibGladeLib, importc: "glade_xml_signal_autoconnect_full".} +proc xml_get_widget*(self: PXML, name: cstring): PGtkWidget{.cdecl, + dynlib: LibGladeLib, importc: "glade_xml_get_widget".} +proc xml_get_widget_prefix*(self: PXML, name: cstring): PGList{.cdecl, + dynlib: LibGladeLib, importc: "glade_xml_get_widget_prefix".} +proc xml_relative_file*(self: PXML, filename: cstring): cstring{.cdecl, + dynlib: LibGladeLib, importc: "glade_xml_relative_file".} +proc get_widget_name*(widget: PGtkWidget): cstring{.cdecl, dynlib: LibGladeLib, + importc: "glade_get_widget_name".} +proc get_widget_tree*(widget: PGtkWidget): PXML{.cdecl, dynlib: LibGladeLib, + importc: "glade_get_widget_tree".} +type + PXMLCustomWidgetHandler* = ptr TXMLCustomWidgetHandler + TXMLCustomWidgetHandler* = TGtkWidget + +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_with_domain*(fname: cstring, root: cstring, domain: cstring): PXML = + result = xml_new(fname, root, domain) + +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())) diff --git a/lib/newwrap/gtk/pango.nim b/lib/newwrap/gtk/pango.nim new file mode 100644 index 000000000..1443aba1d --- /dev/null +++ b/lib/newwrap/gtk/pango.nim @@ -0,0 +1,1183 @@ +{.deadCodeElim: on.} +import + glib2 + +when defined(win32): + const + pangolib* = "libpango-1.0-0.dll" +else: + const + pangolib* = "libpango-1.0.so.0" +type + PFont* = pointer + PFontFamily* = pointer + PFontset* = pointer + PFontMetrics* = pointer + PFontFace* = pointer + PFontMap* = pointer + PFontsetClass* = pointer + PFontFamilyClass* = pointer + PFontFaceClass* = pointer + PFontClass* = pointer + PFontMapClass* = pointer + PFontDescription* = ptr TFontDescription + TFontDescription* = pointer + PAttrList* = ptr TAttrList + TAttrList* = pointer + PAttrIterator* = ptr TAttrIterator + TAttrIterator* = pointer + PLayout* = ptr TLayout + TLayout* = pointer + PLayoutClass* = ptr TLayoutClass + TLayoutClass* = pointer + PLayoutIter* = ptr TLayoutIter + TLayoutIter* = pointer + PContext* = ptr TContext + TContext* = pointer + PContextClass* = ptr TContextClass + TContextClass* = pointer + PFontsetSimple* = ptr TFontsetSimple + TFontsetSimple* = pointer + PTabArray* = ptr TTabArray + TTabArray* = pointer + PGlyphString* = ptr TGlyphString + PAnalysis* = ptr TAnalysis + PItem* = ptr TItem + PLanguage* = ptr TLanguage + TLanguage* = pointer + PGlyph* = ptr TGlyph + TGlyph* = guint32 + PRectangle* = ptr TRectangle + TRectangle*{.final, pure.} = object + x*: int32 + y*: int32 + width*: int32 + height*: int32 + + PDirection* = ptr TDirection + TDirection* = enum + PANGO_DIRECTION_LTR, PANGO_DIRECTION_RTL, PANGO_DIRECTION_TTB_LTR, + PANGO_DIRECTION_TTB_RTL + PColor* = ptr TColor + TColor*{.final, pure.} = object + red*: guint16 + green*: guint16 + blue*: guint16 + + PAttrType* = ptr TAttrType + TAttrType* = int32 + PUnderline* = ptr TUnderline + TUnderline* = int32 + PAttribute* = ptr TAttribute + PAttrClass* = ptr TAttrClass + TAttribute*{.final, pure.} = object + klass*: PAttrClass + start_index*: int + end_index*: int + + TAttrClass*{.final, pure.} = object + `type`*: TAttrType + copy*: proc (attr: PAttribute): PAttribute{.cdecl.} + destroy*: proc (attr: PAttribute){.cdecl.} + equal*: proc (attr1: PAttribute, attr2: PAttribute): gboolean{.cdecl.} + + PAttrString* = ptr TAttrString + TAttrString*{.final, pure.} = object + attr*: TAttribute + value*: cstring + + PAttrLanguage* = ptr TAttrLanguage + TAttrLanguage*{.final, pure.} = object + attr*: TAttribute + value*: PLanguage + + PAttrInt* = ptr TAttrInt + TAttrInt*{.final, pure.} = object + attr*: TAttribute + value*: int32 + + PAttrFloat* = ptr TAttrFloat + TAttrFloat*{.final, pure.} = object + attr*: TAttribute + value*: gdouble + + PAttrColor* = ptr TAttrColor + TAttrColor*{.final, pure.} = object + attr*: TAttribute + color*: TColor + + PAttrShape* = ptr TAttrShape + TAttrShape*{.final, pure.} = object + attr*: TAttribute + ink_rect*: TRectangle + logical_rect*: TRectangle + + PAttrFontDesc* = ptr TAttrFontDesc + TAttrFontDesc*{.final, pure.} = object + attr*: TAttribute + desc*: PFontDescription + + PLogAttr* = ptr TLogAttr + TLogAttr*{.final, pure.} = object + flag0*: guint16 + + PCoverageLevel* = ptr TCoverageLevel + TCoverageLevel* = enum + PANGO_COVERAGE_NONE, PANGO_COVERAGE_FALLBACK, PANGO_COVERAGE_APPROXIMATE, + PANGO_COVERAGE_EXACT + PBlockInfo* = ptr TBlockInfo + TBlockInfo*{.final, pure.} = object + data*: Pguchar + level*: TCoverageLevel + + PCoverage* = ptr TCoverage + TCoverage*{.final, pure.} = object + ref_count*: int + n_blocks*: int32 + data_size*: int32 + blocks*: PBlockInfo + + PEngineRange* = ptr TEngineRange + TEngineRange*{.final, pure.} = object + start*: int32 + theEnd*: int32 + langs*: cstring + + PEngineInfo* = ptr TEngineInfo + TEngineInfo*{.final, pure.} = object + id*: cstring + engine_type*: cstring + render_type*: cstring + ranges*: PEngineRange + n_ranges*: gint + + PEngine* = ptr TEngine + TEngine*{.final, pure.} = object + id*: cstring + `type`*: cstring + length*: gint + + TEngineLangScriptBreak* = proc (text: cstring, len: int32, + analysis: PAnalysis, attrs: PLogAttr, + attrs_len: int32){.cdecl.} + PEngineLang* = ptr TEngineLang + TEngineLang*{.final, pure.} = object + engine*: TEngine + script_break*: TEngineLangScriptBreak + + TEngineShapeScript* = proc (font: PFont, text: cstring, length: int32, + analysis: PAnalysis, glyphs: PGlyphString){.cdecl.} + TEngineShapeGetCoverage* = proc (font: PFont, language: PLanguage): PCoverage{. + cdecl.} + PEngineShape* = ptr TEngineShape + TEngineShape*{.final, pure.} = object + engine*: TEngine + script_shape*: TEngineShapeScript + get_coverage*: TEngineShapeGetCoverage + + PStyle* = ptr TStyle + TStyle* = gint + PVariant* = ptr TVariant + TVariant* = gint + PWeight* = ptr TWeight + TWeight* = gint + PStretch* = ptr TStretch + TStretch* = gint + PFontMask* = ptr TFontMask + TFontMask* = int32 + PGlyphUnit* = ptr TGlyphUnit + TGlyphUnit* = gint32 + PGlyphGeometry* = ptr TGlyphGeometry + TGlyphGeometry*{.final, pure.} = object + width*: TGlyphUnit + x_offset*: TGlyphUnit + y_offset*: TGlyphUnit + + PGlyphVisAttr* = ptr TGlyphVisAttr + TGlyphVisAttr*{.final, pure.} = object + flag0*: int16 + + PGlyphInfo* = ptr TGlyphInfo + TGlyphInfo*{.final, pure.} = object + glyph*: TGlyph + geometry*: TGlyphGeometry + attr*: TGlyphVisAttr + + TGlyphString*{.final, pure.} = object + num_glyphs*: gint + glyphs*: PGlyphInfo + log_clusters*: Pgint + space*: gint + + TAnalysis*{.final, pure.} = object + shape_engine*: PEngineShape + lang_engine*: PEngineLang + font*: PFont + level*: guint8 + language*: PLanguage + extra_attrs*: PGSList + + TItem*{.final, pure.} = object + offset*: gint + length*: gint + num_chars*: gint + analysis*: TAnalysis + + PAlignment* = ptr TAlignment + TAlignment* = enum + PANGO_ALIGN_LEFT, PANGO_ALIGN_CENTER, PANGO_ALIGN_RIGHT + PWrapMode* = ptr TWrapMode + TWrapMode* = enum + PANGO_WRAP_WORD, PANGO_WRAP_CHAR + PLayoutLine* = ptr TLayoutLine + TLayoutLine*{.final, pure.} = object + layout*: PLayout + start_index*: gint + length*: gint + runs*: PGSList + + PLayoutRun* = ptr TLayoutRun + TLayoutRun*{.final, pure.} = object + item*: PItem + glyphs*: PGlyphString + + PTabAlign* = ptr TTabAlign + TTabAlign* = enum + PANGO_TAB_LEFT + +const + PANGO_SCALE* = 1024 + +proc PANGO_PIXELS*(d: int): int +proc PANGO_ASCENT*(rect: TRectangle): int32 +proc PANGO_DESCENT*(rect: TRectangle): int32 +proc PANGO_LBEARING*(rect: TRectangle): int32 +proc PANGO_RBEARING*(rect: TRectangle): int32 +proc PANGO_TYPE_LANGUAGE*(): GType +proc pango_language_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_language_get_type".} +proc pango_language_from_string*(language: cstring): PLanguage{.cdecl, + dynlib: pangolib, importc: "pango_language_from_string".} +proc pango_language_to_string*(language: PLanguage): cstring +proc pango_language_matches*(language: PLanguage, range_list: cstring): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_language_matches".} +const + PANGO_ATTR_INVALID* = 0 + PANGO_ATTR_LANGUAGE* = 1 + PANGO_ATTR_FAMILY* = 2 + PANGO_ATTR_STYLE* = 3 + PANGO_ATTR_WEIGHT* = 4 + PANGO_ATTR_VARIANT* = 5 + PANGO_ATTR_STRETCH* = 6 + PANGO_ATTR_SIZE* = 7 + PANGO_ATTR_FONT_DESC* = 8 + PANGO_ATTR_FOREGROUND* = 9 + PANGO_ATTR_BACKGROUND* = 10 + PANGO_ATTR_UNDERLINE* = 11 + PANGO_ATTR_STRIKETHROUGH* = 12 + PANGO_ATTR_RISE* = 13 + PANGO_ATTR_SHAPE* = 14 + PANGO_ATTR_SCALE* = 15 + PANGO_UNDERLINE_NONE* = 0 + PANGO_UNDERLINE_SINGLE* = 1 + PANGO_UNDERLINE_DOUBLE* = 2 + PANGO_UNDERLINE_LOW* = 3 + +proc PANGO_TYPE_COLOR*(): GType +proc pango_color_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_color_get_type".} +proc pango_color_copy*(src: PColor): PColor{.cdecl, dynlib: pangolib, + importc: "pango_color_copy".} +proc pango_color_free*(color: PColor){.cdecl, dynlib: pangolib, + importc: "pango_color_free".} +proc pango_color_parse*(color: PColor, spec: cstring): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_color_parse".} +proc PANGO_TYPE_ATTR_LIST*(): GType +proc pango_attr_type_register*(name: cstring): TAttrType{.cdecl, + dynlib: pangolib, importc: "pango_attr_type_register".} +proc pango_attribute_copy*(attr: PAttribute): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attribute_copy".} +proc pango_attribute_destroy*(attr: PAttribute){.cdecl, dynlib: pangolib, + importc: "pango_attribute_destroy".} +proc pango_attribute_equal*(attr1: PAttribute, attr2: PAttribute): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_attribute_equal".} +proc pango_attr_language_new*(language: PLanguage): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_language_new".} +proc pango_attr_family_new*(family: cstring): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_family_new".} +proc pango_attr_foreground_new*(red: guint16, green: guint16, blue: guint16): PAttribute{. + cdecl, dynlib: pangolib, importc: "pango_attr_foreground_new".} +proc pango_attr_background_new*(red: guint16, green: guint16, blue: guint16): PAttribute{. + cdecl, dynlib: pangolib, importc: "pango_attr_background_new".} +proc pango_attr_size_new*(size: int32): PAttribute{.cdecl, dynlib: pangolib, + importc: "pango_attr_size_new".} +proc pango_attr_style_new*(style: TStyle): PAttribute{.cdecl, dynlib: pangolib, + importc: "pango_attr_style_new".} +proc pango_attr_weight_new*(weight: TWeight): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_weight_new".} +proc pango_attr_variant_new*(variant: TVariant): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_variant_new".} +proc pango_attr_stretch_new*(stretch: TStretch): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_stretch_new".} +proc pango_attr_font_desc_new*(desc: PFontDescription): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_font_desc_new".} +proc pango_attr_underline_new*(underline: TUnderline): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_underline_new".} +proc pango_attr_strikethrough_new*(strikethrough: gboolean): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_strikethrough_new".} +proc pango_attr_rise_new*(rise: int32): PAttribute{.cdecl, dynlib: pangolib, + importc: "pango_attr_rise_new".} +proc pango_attr_shape_new*(ink_rect: PRectangle, logical_rect: PRectangle): PAttribute{. + cdecl, dynlib: pangolib, importc: "pango_attr_shape_new".} +proc pango_attr_scale_new*(scale_factor: gdouble): PAttribute{.cdecl, + dynlib: pangolib, importc: "pango_attr_scale_new".} +proc pango_attr_list_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_attr_list_get_type".} +proc pango_attr_list_new*(): PAttrList{.cdecl, dynlib: pangolib, + importc: "pango_attr_list_new".} +proc pango_attr_list_ref*(list: PAttrList){.cdecl, dynlib: pangolib, + importc: "pango_attr_list_ref".} +proc pango_attr_list_unref*(list: PAttrList){.cdecl, dynlib: pangolib, + importc: "pango_attr_list_unref".} +proc pango_attr_list_copy*(list: PAttrList): PAttrList{.cdecl, dynlib: pangolib, + importc: "pango_attr_list_copy".} +proc pango_attr_list_insert*(list: PAttrList, attr: PAttribute){.cdecl, + dynlib: pangolib, importc: "pango_attr_list_insert".} +proc pango_attr_list_insert_before*(list: PAttrList, attr: PAttribute){.cdecl, + dynlib: pangolib, importc: "pango_attr_list_insert_before".} +proc pango_attr_list_change*(list: PAttrList, attr: PAttribute){.cdecl, + dynlib: pangolib, importc: "pango_attr_list_change".} +proc pango_attr_list_splice*(list: PAttrList, other: PAttrList, pos: gint, + len: gint){.cdecl, dynlib: pangolib, + importc: "pango_attr_list_splice".} +proc pango_attr_list_get_iterator*(list: PAttrList): PAttrIterator{.cdecl, + dynlib: pangolib, importc: "pango_attr_list_get_iterator".} +proc pango_attr_iterator_range*(`iterator`: PAttrIterator, start: Pgint, + theEnd: Pgint){.cdecl, dynlib: pangolib, + importc: "pango_attr_iterator_range".} +proc pango_attr_iterator_next*(`iterator`: PAttrIterator): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_attr_iterator_next".} +proc pango_attr_iterator_copy*(`iterator`: PAttrIterator): PAttrIterator{.cdecl, + dynlib: pangolib, importc: "pango_attr_iterator_copy".} +proc pango_attr_iterator_destroy*(`iterator`: PAttrIterator){.cdecl, + dynlib: pangolib, importc: "pango_attr_iterator_destroy".} +proc pango_attr_iterator_get*(`iterator`: PAttrIterator, `type`: TAttrType): PAttribute{. + cdecl, dynlib: pangolib, importc: "pango_attr_iterator_get".} +proc pango_attr_iterator_get_font*(`iterator`: PAttrIterator, + desc: PFontDescription, + language: var PLanguage, + extra_attrs: PPGSList){.cdecl, + dynlib: pangolib, importc: "pango_attr_iterator_get_font".} +proc pango_parse_markup*(markup_text: cstring, length: int32, + accel_marker: gunichar, attr_list: var PAttrList, + text: PPchar, accel_char: Pgunichar, error: pointer): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_parse_markup".} +const + bm_TPangoLogAttr_is_line_break* = 0x0001'i16 + bp_TPangoLogAttr_is_line_break* = 0'i16 + bm_TPangoLogAttr_is_mandatory_break* = 0x0002'i16 + bp_TPangoLogAttr_is_mandatory_break* = 1'i16 + bm_TPangoLogAttr_is_char_break* = 0x0004'i16 + bp_TPangoLogAttr_is_char_break* = 2'i16 + bm_TPangoLogAttr_is_white* = 0x0008'i16 + bp_TPangoLogAttr_is_white* = 3'i16 + bm_TPangoLogAttr_is_cursor_position* = 0x0010'i16 + bp_TPangoLogAttr_is_cursor_position* = 4'i16 + bm_TPangoLogAttr_is_word_start* = 0x0020'i16 + bp_TPangoLogAttr_is_word_start* = 5'i16 + bm_TPangoLogAttr_is_word_end* = 0x0040'i16 + bp_TPangoLogAttr_is_word_end* = 6'i16 + bm_TPangoLogAttr_is_sentence_boundary* = 0x0080'i16 + bp_TPangoLogAttr_is_sentence_boundary* = 7'i16 + bm_TPangoLogAttr_is_sentence_start* = 0x0100'i16 + bp_TPangoLogAttr_is_sentence_start* = 8'i16 + bm_TPangoLogAttr_is_sentence_end* = 0x0200'i16 + bp_TPangoLogAttr_is_sentence_end* = 9'i16 + +proc is_line_break*(a: var TLogAttr): guint +proc set_is_line_break*(a: var TLogAttr, `is_line_break`: guint) +proc is_mandatory_break*(a: var TLogAttr): guint +proc set_is_mandatory_break*(a: var TLogAttr, `is_mandatory_break`: guint) +proc is_char_break*(a: var TLogAttr): guint +proc set_is_char_break*(a: var TLogAttr, `is_char_break`: guint) +proc is_white*(a: var TLogAttr): guint +proc set_is_white*(a: var TLogAttr, `is_white`: guint) +proc is_cursor_position*(a: var TLogAttr): guint +proc set_is_cursor_position*(a: var TLogAttr, `is_cursor_position`: guint) +proc is_word_start*(a: var TLogAttr): guint +proc set_is_word_start*(a: var TLogAttr, `is_word_start`: guint) +proc is_word_end*(a: var TLogAttr): guint +proc set_is_word_end*(a: var TLogAttr, `is_word_end`: guint) +proc is_sentence_boundary*(a: var TLogAttr): guint +proc set_is_sentence_boundary*(a: var TLogAttr, `is_sentence_boundary`: guint) +proc is_sentence_start*(a: var TLogAttr): guint +proc set_is_sentence_start*(a: var TLogAttr, `is_sentence_start`: guint) +proc is_sentence_end*(a: var TLogAttr): guint +proc set_is_sentence_end*(a: var TLogAttr, `is_sentence_end`: guint) +proc pango_break*(text: cstring, length: int32, analysis: PAnalysis, + attrs: PLogAttr, attrs_len: int32){.cdecl, dynlib: pangolib, + importc: "pango_break".} +proc pango_find_paragraph_boundary*(text: cstring, length: gint, + paragraph_delimiter_index: Pgint, + next_paragraph_start: Pgint){.cdecl, + dynlib: pangolib, importc: "pango_find_paragraph_boundary".} +proc pango_get_log_attrs*(text: cstring, length: int32, level: int32, + language: PLanguage, log_attrs: PLogAttr, + attrs_len: int32){.cdecl, dynlib: pangolib, + importc: "pango_get_log_attrs".} +proc PANGO_TYPE_CONTEXT*(): GType +proc PANGO_CONTEXT*(anObject: pointer): PContext +proc PANGO_CONTEXT_CLASS*(klass: pointer): PContextClass +proc PANGO_IS_CONTEXT*(anObject: pointer): bool +proc PANGO_IS_CONTEXT_CLASS*(klass: pointer): bool +proc PANGO_CONTEXT_GET_CLASS*(obj: PContext): PContextClass +proc pango_context_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_context_get_type".} +proc pango_context_list_families*(context: PContext, + families: openarray[ptr PFontFamily]){.cdecl, + dynlib: pangolib, importc: "pango_context_list_families".} +proc pango_context_load_font*(context: PContext, desc: PFontDescription): PFont{. + cdecl, dynlib: pangolib, importc: "pango_context_load_font".} +proc pango_context_load_fontset*(context: PContext, desc: PFontDescription, + language: PLanguage): PFontset{.cdecl, + dynlib: pangolib, importc: "pango_context_load_fontset".} +proc pango_context_get_metrics*(context: PContext, desc: PFontDescription, + language: PLanguage): PFontMetrics{.cdecl, + dynlib: pangolib, importc: "pango_context_get_metrics".} +proc pango_context_set_font_description*(context: PContext, + desc: PFontDescription){.cdecl, dynlib: pangolib, + importc: "pango_context_set_font_description".} +proc pango_context_get_font_description*(context: PContext): PFontDescription{. + cdecl, dynlib: pangolib, importc: "pango_context_get_font_description".} +proc pango_context_get_language*(context: PContext): PLanguage{.cdecl, + dynlib: pangolib, importc: "pango_context_get_language".} +proc pango_context_set_language*(context: PContext, language: PLanguage){.cdecl, + dynlib: pangolib, importc: "pango_context_set_language".} +proc pango_context_set_base_dir*(context: PContext, direction: TDirection){. + cdecl, dynlib: pangolib, importc: "pango_context_set_base_dir".} +proc pango_context_get_base_dir*(context: PContext): TDirection{.cdecl, + dynlib: pangolib, importc: "pango_context_get_base_dir".} +proc pango_itemize*(context: PContext, text: cstring, start_index: int32, + length: int32, attrs: PAttrList, cached_iter: PAttrIterator): PGList{. + cdecl, dynlib: pangolib, importc: "pango_itemize".} +proc pango_coverage_new*(): PCoverage{.cdecl, dynlib: pangolib, + importc: "pango_coverage_new".} +proc pango_coverage_ref*(coverage: PCoverage): PCoverage{.cdecl, + dynlib: pangolib, importc: "pango_coverage_ref".} +proc pango_coverage_unref*(coverage: PCoverage){.cdecl, dynlib: pangolib, + importc: "pango_coverage_unref".} +proc pango_coverage_copy*(coverage: PCoverage): PCoverage{.cdecl, + dynlib: pangolib, importc: "pango_coverage_copy".} +proc pango_coverage_get*(coverage: PCoverage, index: int32): TCoverageLevel{. + cdecl, dynlib: pangolib, importc: "pango_coverage_get".} +proc pango_coverage_set*(coverage: PCoverage, index: int32, + level: TCoverageLevel){.cdecl, dynlib: pangolib, + importc: "pango_coverage_set".} +proc pango_coverage_max*(coverage: PCoverage, other: PCoverage){.cdecl, + dynlib: pangolib, importc: "pango_coverage_max".} +proc pango_coverage_to_bytes*(coverage: PCoverage, bytes: PPguchar, + n_bytes: var int32){.cdecl, dynlib: pangolib, + importc: "pango_coverage_to_bytes".} +proc pango_coverage_from_bytes*(bytes: Pguchar, n_bytes: int32): PCoverage{. + cdecl, dynlib: pangolib, importc: "pango_coverage_from_bytes".} +proc PANGO_TYPE_FONTSET*(): GType +proc PANGO_FONTSET*(anObject: pointer): PFontset +proc PANGO_IS_FONTSET*(anObject: pointer): bool +proc pango_fontset_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_fontset_get_type".} +proc pango_fontset_get_font*(fontset: PFontset, wc: guint): PFont{.cdecl, + dynlib: pangolib, importc: "pango_fontset_get_font".} +proc pango_fontset_get_metrics*(fontset: PFontset): PFontMetrics{.cdecl, + dynlib: pangolib, importc: "pango_fontset_get_metrics".} +const + PANGO_STYLE_NORMAL* = 0 + PANGO_STYLE_OBLIQUE* = 1 + PANGO_STYLE_ITALIC* = 2 + PANGO_VARIANT_NORMAL* = 0 + PANGO_VARIANT_SMALL_CAPS* = 1 + PANGO_WEIGHT_ULTRALIGHT* = 200 + PANGO_WEIGHT_LIGHT* = 300 + PANGO_WEIGHT_NORMAL* = 400 + PANGO_WEIGHT_BOLD* = 700 + PANGO_WEIGHT_ULTRABOLD* = 800 + PANGO_WEIGHT_HEAVY* = 900 + PANGO_STRETCH_ULTRA_CONDENSED* = 0 + PANGO_STRETCH_EXTRA_CONDENSED* = 1 + PANGO_STRETCH_CONDENSED* = 2 + PANGO_STRETCH_SEMI_CONDENSED* = 3 + PANGO_STRETCH_NORMAL* = 4 + PANGO_STRETCH_SEMI_EXPANDED* = 5 + PANGO_STRETCH_EXPANDED* = 6 + PANGO_STRETCH_EXTRA_EXPANDED* = 7 + PANGO_STRETCH_ULTRA_EXPANDED* = 8 + PANGO_FONT_MASK_FAMILY* = 1 shl 0 + PANGO_FONT_MASK_STYLE* = 1 shl 1 + PANGO_FONT_MASK_VARIANT* = 1 shl 2 + PANGO_FONT_MASK_WEIGHT* = 1 shl 3 + PANGO_FONT_MASK_STRETCH* = 1 shl 4 + PANGO_FONT_MASK_SIZE* = 1 shl 5 + PANGO_SCALE_XX_SMALL* = 0.578704 + PANGO_SCALE_X_SMALL* = 0.644444 + PANGO_SCALE_SMALL* = 0.833333 + PANGO_SCALE_MEDIUM* = 1.00000 + PANGO_SCALE_LARGE* = 1.20000 + PANGO_SCALE_X_LARGE* = 1.44000 + PANGO_SCALE_XX_LARGE* = 1.72800 + +proc PANGO_TYPE_FONT_DESCRIPTION*(): GType +proc pango_font_description_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_description_get_type".} +proc pango_font_description_new*(): PFontDescription{.cdecl, dynlib: pangolib, + importc: "pango_font_description_new".} +proc pango_font_description_copy*(desc: PFontDescription): PFontDescription{. + cdecl, dynlib: pangolib, importc: "pango_font_description_copy".} +proc pango_font_description_copy_static*(desc: PFontDescription): PFontDescription{. + cdecl, dynlib: pangolib, importc: "pango_font_description_copy_static".} +proc pango_font_description_hash*(desc: PFontDescription): guint{.cdecl, + dynlib: pangolib, importc: "pango_font_description_hash".} +proc pango_font_description_equal*(desc1: PFontDescription, + desc2: PFontDescription): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_font_description_equal".} +proc pango_font_description_free*(desc: PFontDescription){.cdecl, + dynlib: pangolib, importc: "pango_font_description_free".} +proc pango_font_descriptions_free*(descs: var PFontDescription, n_descs: int32){. + cdecl, dynlib: pangolib, importc: "pango_font_descriptions_free".} +proc pango_font_description_set_family*(desc: PFontDescription, family: cstring){. + cdecl, dynlib: pangolib, importc: "pango_font_description_set_family".} +proc pango_font_description_set_family_static*(desc: PFontDescription, + family: cstring){.cdecl, dynlib: pangolib, + importc: "pango_font_description_set_family_static".} +proc pango_font_description_get_family*(desc: PFontDescription): cstring{.cdecl, + dynlib: pangolib, importc: "pango_font_description_get_family".} +proc pango_font_description_set_style*(desc: PFontDescription, style: TStyle){. + cdecl, dynlib: pangolib, importc: "pango_font_description_set_style".} +proc pango_font_description_get_style*(desc: PFontDescription): TStyle{.cdecl, + dynlib: pangolib, importc: "pango_font_description_get_style".} +proc pango_font_description_set_variant*(desc: PFontDescription, + variant: TVariant){.cdecl, dynlib: pangolib, + importc: "pango_font_description_set_variant".} +proc pango_font_description_get_variant*(desc: PFontDescription): TVariant{. + cdecl, dynlib: pangolib, importc: "pango_font_description_get_variant".} +proc pango_font_description_set_weight*(desc: PFontDescription, weight: TWeight){. + cdecl, dynlib: pangolib, importc: "pango_font_description_set_weight".} +proc pango_font_description_get_weight*(desc: PFontDescription): TWeight{.cdecl, + dynlib: pangolib, importc: "pango_font_description_get_weight".} +proc pango_font_description_set_stretch*(desc: PFontDescription, + stretch: TStretch){.cdecl, dynlib: pangolib, + importc: "pango_font_description_set_stretch".} +proc pango_font_description_get_stretch*(desc: PFontDescription): TStretch{. + cdecl, dynlib: pangolib, importc: "pango_font_description_get_stretch".} +proc pango_font_description_set_size*(desc: PFontDescription, size: gint){. + cdecl, dynlib: pangolib, importc: "pango_font_description_set_size".} +proc pango_font_description_get_size*(desc: PFontDescription): gint{.cdecl, + dynlib: pangolib, importc: "pango_font_description_get_size".} +proc pango_font_description_set_absolute_size*(desc: PFontDescription, + size: float64){.cdecl, dynlib: pangolib, + importc: "pango_font_description_set_absolute_size".} +proc pango_font_description_get_size_is_absolute*(desc: PFontDescription, + size: float64): gboolean{.cdecl, dynlib: pangolib, importc: "pango_font_description_get_size_is_absolute".} +proc pango_font_description_get_set_fields*(desc: PFontDescription): TFontMask{. + cdecl, dynlib: pangolib, importc: "pango_font_description_get_set_fields".} +proc pango_font_description_unset_fields*(desc: PFontDescription, + to_unset: TFontMask){.cdecl, dynlib: pangolib, + importc: "pango_font_description_unset_fields".} +proc pango_font_description_merge*(desc: PFontDescription, + desc_to_merge: PFontDescription, + replace_existing: gboolean){.cdecl, + dynlib: pangolib, importc: "pango_font_description_merge".} +proc pango_font_description_merge_static*(desc: PFontDescription, + desc_to_merge: PFontDescription, replace_existing: gboolean){.cdecl, + dynlib: pangolib, importc: "pango_font_description_merge_static".} +proc pango_font_description_better_match*(desc: PFontDescription, + old_match: PFontDescription, new_match: PFontDescription): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_font_description_better_match".} +proc pango_font_description_from_string*(str: cstring): PFontDescription{.cdecl, + dynlib: pangolib, importc: "pango_font_description_from_string".} +proc pango_font_description_to_string*(desc: PFontDescription): cstring{.cdecl, + dynlib: pangolib, importc: "pango_font_description_to_string".} +proc pango_font_description_to_filename*(desc: PFontDescription): cstring{. + cdecl, dynlib: pangolib, importc: "pango_font_description_to_filename".} +proc PANGO_TYPE_FONT_METRICS*(): GType +proc pango_font_metrics_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_metrics_get_type".} +proc pango_font_metrics_ref*(metrics: PFontMetrics): PFontMetrics{.cdecl, + dynlib: pangolib, importc: "pango_font_metrics_ref".} +proc pango_font_metrics_unref*(metrics: PFontMetrics){.cdecl, dynlib: pangolib, + importc: "pango_font_metrics_unref".} +proc pango_font_metrics_get_ascent*(metrics: PFontMetrics): int32{.cdecl, + dynlib: pangolib, importc: "pango_font_metrics_get_ascent".} +proc pango_font_metrics_get_descent*(metrics: PFontMetrics): int32{.cdecl, + dynlib: pangolib, importc: "pango_font_metrics_get_descent".} +proc pango_font_metrics_get_approximate_char_width*(metrics: PFontMetrics): int32{. + cdecl, dynlib: pangolib, + importc: "pango_font_metrics_get_approximate_char_width".} +proc pango_font_metrics_get_approximate_digit_width*(metrics: PFontMetrics): int32{. + cdecl, dynlib: pangolib, + importc: "pango_font_metrics_get_approximate_digit_width".} +proc PANGO_TYPE_FONT_FAMILY*(): GType +proc PANGO_FONT_FAMILY*(anObject: Pointer): PFontFamily +proc PANGO_IS_FONT_FAMILY*(anObject: Pointer): bool +proc pango_font_family_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_family_get_type".} +proc pango_font_family_list_faces*(family: PFontFamily, + faces: var openarray[ptr PFontFace]){.cdecl, + dynlib: pangolib, importc: "pango_font_family_list_faces".} +proc pango_font_family_get_name*(family: PFontFamily): cstring{.cdecl, + dynlib: pangolib, importc: "pango_font_family_get_name".} +proc PANGO_TYPE_FONT_FACE*(): GType +proc PANGO_FONT_FACE*(anObject: pointer): PFontFace +proc PANGO_IS_FONT_FACE*(anObject: pointer): bool +proc pango_font_face_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_face_get_type".} +proc pango_font_face_describe*(face: PFontFace): PFontDescription{.cdecl, + dynlib: pangolib, importc: "pango_font_face_describe".} +proc pango_font_face_get_face_name*(face: PFontFace): cstring{.cdecl, + dynlib: pangolib, importc: "pango_font_face_get_face_name".} +proc PANGO_TYPE_FONT*(): GType +proc PANGO_FONT*(anObject: pointer): PFont +proc PANGO_IS_FONT*(anObject: pointer): bool +proc pango_font_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_get_type".} +proc pango_font_describe*(font: PFont): PFontDescription{.cdecl, + dynlib: pangolib, importc: "pango_font_describe".} +proc pango_font_get_coverage*(font: PFont, language: PLanguage): PCoverage{. + cdecl, dynlib: pangolib, importc: "pango_font_get_coverage".} +proc pango_font_find_shaper*(font: PFont, language: PLanguage, ch: guint32): PEngineShape{. + cdecl, dynlib: pangolib, importc: "pango_font_find_shaper".} +proc pango_font_get_metrics*(font: PFont, language: PLanguage): PFontMetrics{. + cdecl, dynlib: pangolib, importc: "pango_font_get_metrics".} +proc pango_font_get_glyph_extents*(font: PFont, glyph: TGlyph, + ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_font_get_glyph_extents".} +proc PANGO_TYPE_FONT_MAP*(): GType +proc PANGO_FONT_MAP*(anObject: pointer): PFontMap +proc PANGO_IS_FONT_MAP*(anObject: pointer): bool +proc pango_font_map_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_font_map_get_type".} +proc pango_font_map_load_font*(fontmap: PFontMap, context: PContext, + desc: PFontDescription): PFont{.cdecl, + dynlib: pangolib, importc: "pango_font_map_load_font".} +proc pango_font_map_load_fontset*(fontmap: PFontMap, context: PContext, + desc: PFontDescription, language: PLanguage): PFontset{. + cdecl, dynlib: pangolib, importc: "pango_font_map_load_fontset".} +proc pango_font_map_list_families*(fontmap: PFontMap, + families: var openarray[ptr PFontFamily]){. + cdecl, dynlib: pangolib, importc: "pango_font_map_list_families".} +const + bm_TPangoGlyphVisAttr_is_cluster_start* = 0x0001'i16 + bp_TPangoGlyphVisAttr_is_cluster_start* = 0'i16 + +proc is_cluster_start*(a: var TGlyphVisAttr): guint +proc set_is_cluster_start*(a: var TGlyphVisAttr, `is_cluster_start`: guint) +proc PANGO_TYPE_GLYPH_STRING*(): GType +proc pango_glyph_string_new*(): PGlyphString{.cdecl, dynlib: pangolib, + importc: "pango_glyph_string_new".} +proc pango_glyph_string_set_size*(`string`: PGlyphString, new_len: gint){.cdecl, + dynlib: pangolib, importc: "pango_glyph_string_set_size".} +proc pango_glyph_string_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_glyph_string_get_type".} +proc pango_glyph_string_copy*(`string`: PGlyphString): PGlyphString{.cdecl, + dynlib: pangolib, importc: "pango_glyph_string_copy".} +proc pango_glyph_string_free*(`string`: PGlyphString){.cdecl, dynlib: pangolib, + importc: "pango_glyph_string_free".} +proc pango_glyph_string_extents*(glyphs: PGlyphString, font: PFont, + ink_rect: PRectangle, logical_rect: PRectangle){. + cdecl, dynlib: pangolib, importc: "pango_glyph_string_extents".} +proc pango_glyph_string_extents_range*(glyphs: PGlyphString, start: int32, + theEnd: int32, font: PFont, + ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_glyph_string_extents_range".} +proc pango_glyph_string_get_logical_widths*(glyphs: PGlyphString, text: cstring, + length: int32, embedding_level: int32, logical_widths: var int32){.cdecl, + dynlib: pangolib, importc: "pango_glyph_string_get_logical_widths".} +proc pango_glyph_string_index_to_x*(glyphs: PGlyphString, text: cstring, + length: int32, analysis: PAnalysis, + index: int32, trailing: gboolean, + x_pos: var int32){.cdecl, dynlib: pangolib, + importc: "pango_glyph_string_index_to_x".} +proc pango_glyph_string_x_to_index*(glyphs: PGlyphString, text: cstring, + length: int32, analysis: PAnalysis, + x_pos: int32, index, trailing: var int32){. + cdecl, dynlib: pangolib, importc: "pango_glyph_string_x_to_index".} +proc pango_shape*(text: cstring, length: gint, analysis: PAnalysis, + glyphs: PGlyphString){.cdecl, dynlib: pangolib, + importc: "pango_shape".} +proc pango_reorder_items*(logical_items: PGList): PGList{.cdecl, + dynlib: pangolib, importc: "pango_reorder_items".} +proc pango_item_new*(): PItem{.cdecl, dynlib: pangolib, + importc: "pango_item_new".} +proc pango_item_copy*(item: PItem): PItem{.cdecl, dynlib: pangolib, + importc: "pango_item_copy".} +proc pango_item_free*(item: PItem){.cdecl, dynlib: pangolib, + importc: "pango_item_free".} +proc pango_item_split*(orig: PItem, split_index: int32, split_offset: int32): PItem{. + cdecl, dynlib: pangolib, importc: "pango_item_split".} +proc PANGO_TYPE_LAYOUT*(): GType +proc PANGO_LAYOUT*(anObject: pointer): PLayout +proc PANGO_LAYOUT_CLASS*(klass: pointer): PLayoutClass +proc PANGO_IS_LAYOUT*(anObject: pointer): bool +proc PANGO_IS_LAYOUT_CLASS*(klass: pointer): bool +proc PANGO_LAYOUT_GET_CLASS*(obj: PLayout): PLayoutClass +proc pango_layout_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_type".} +proc pango_layout_new*(context: PContext): PLayout{.cdecl, dynlib: pangolib, + importc: "pango_layout_new".} +proc pango_layout_copy*(src: PLayout): PLayout{.cdecl, dynlib: pangolib, + importc: "pango_layout_copy".} +proc pango_layout_get_context*(layout: PLayout): PContext{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_context".} +proc pango_layout_set_attributes*(layout: PLayout, attrs: PAttrList){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_attributes".} +proc pango_layout_get_attributes*(layout: PLayout): PAttrList{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_attributes".} +proc pango_layout_set_text*(layout: PLayout, text: cstring, length: int32){. + cdecl, dynlib: pangolib, importc: "pango_layout_set_text".} +proc pango_layout_get_text*(layout: PLayout): cstring{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_text".} +proc pango_layout_set_markup*(layout: PLayout, markup: cstring, length: int32){. + cdecl, dynlib: pangolib, importc: "pango_layout_set_markup".} +proc pango_layout_set_markup_with_accel*(layout: PLayout, markup: cstring, + length: int32, accel_marker: gunichar, accel_char: Pgunichar){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_markup_with_accel".} +proc pango_layout_set_font_description*(layout: PLayout, desc: PFontDescription){. + cdecl, dynlib: pangolib, importc: "pango_layout_set_font_description".} +proc pango_layout_set_width*(layout: PLayout, width: int32){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_width".} +proc pango_layout_get_width*(layout: PLayout): int32{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_width".} +proc pango_layout_set_wrap*(layout: PLayout, wrap: TWrapMode){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_wrap".} +proc pango_layout_get_wrap*(layout: PLayout): TWrapMode{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_wrap".} +proc pango_layout_set_indent*(layout: PLayout, indent: int32){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_indent".} +proc pango_layout_get_indent*(layout: PLayout): int32{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_indent".} +proc pango_layout_set_spacing*(layout: PLayout, spacing: int32){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_spacing".} +proc pango_layout_get_spacing*(layout: PLayout): int32{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_spacing".} +proc pango_layout_set_justify*(layout: PLayout, justify: gboolean){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_justify".} +proc pango_layout_get_justify*(layout: PLayout): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_justify".} +proc pango_layout_set_alignment*(layout: PLayout, alignment: TAlignment){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_alignment".} +proc pango_layout_get_alignment*(layout: PLayout): TAlignment{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_alignment".} +proc pango_layout_set_tabs*(layout: PLayout, tabs: PTabArray){.cdecl, + dynlib: pangolib, importc: "pango_layout_set_tabs".} +proc pango_layout_get_tabs*(layout: PLayout): PTabArray{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_tabs".} +proc pango_layout_set_single_paragraph_mode*(layout: PLayout, setting: gboolean){. + cdecl, dynlib: pangolib, importc: "pango_layout_set_single_paragraph_mode".} +proc pango_layout_get_single_paragraph_mode*(layout: PLayout): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_single_paragraph_mode".} +proc pango_layout_context_changed*(layout: PLayout){.cdecl, dynlib: pangolib, + importc: "pango_layout_context_changed".} +proc pango_layout_get_log_attrs*(layout: PLayout, attrs: var PLogAttr, + n_attrs: Pgint){.cdecl, dynlib: pangolib, + importc: "pango_layout_get_log_attrs".} +proc pango_layout_index_to_pos*(layout: PLayout, index: int32, pos: PRectangle){. + cdecl, dynlib: pangolib, importc: "pango_layout_index_to_pos".} +proc pango_layout_get_cursor_pos*(layout: PLayout, index: int32, + strong_pos: PRectangle, weak_pos: PRectangle){. + cdecl, dynlib: pangolib, importc: "pango_layout_get_cursor_pos".} +proc pango_layout_move_cursor_visually*(layout: PLayout, strong: gboolean, + old_index: int32, old_trailing: int32, + direction: int32, + new_index, new_trailing: var int32){. + cdecl, dynlib: pangolib, importc: "pango_layout_move_cursor_visually".} +proc pango_layout_xy_to_index*(layout: PLayout, x: int32, y: int32, + index, trailing: var int32): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_xy_to_index".} +proc pango_layout_get_extents*(layout: PLayout, ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_layout_get_extents".} +proc pango_layout_get_pixel_extents*(layout: PLayout, ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_layout_get_pixel_extents".} +proc pango_layout_get_size*(layout: PLayout, width: var int32, height: var int32){. + cdecl, dynlib: pangolib, importc: "pango_layout_get_size".} +proc pango_layout_get_pixel_size*(layout: PLayout, width: var int32, + height: var int32){.cdecl, dynlib: pangolib, + importc: "pango_layout_get_pixel_size".} +proc pango_layout_get_line_count*(layout: PLayout): int32{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_line_count".} +proc pango_layout_get_line*(layout: PLayout, line: int32): PLayoutLine{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_line".} +proc pango_layout_get_lines*(layout: PLayout): PGSList{.cdecl, dynlib: pangolib, + importc: "pango_layout_get_lines".} +proc pango_layout_line_ref*(line: PLayoutLine){.cdecl, dynlib: pangolib, + importc: "pango_layout_line_ref".} +proc pango_layout_line_unref*(line: PLayoutLine){.cdecl, dynlib: pangolib, + importc: "pango_layout_line_unref".} +proc pango_layout_line_x_to_index*(line: PLayoutLine, x_pos: int32, + index: var int32, trailing: var int32): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_layout_line_x_to_index".} +proc pango_layout_line_index_to_x*(line: PLayoutLine, index: int32, + trailing: gboolean, x_pos: var int32){.cdecl, + dynlib: pangolib, importc: "pango_layout_line_index_to_x".} +proc pango_layout_line_get_extents*(line: PLayoutLine, ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_layout_line_get_extents".} +proc pango_layout_line_get_pixel_extents*(layout_line: PLayoutLine, + ink_rect: PRectangle, logical_rect: PRectangle){.cdecl, dynlib: pangolib, + importc: "pango_layout_line_get_pixel_extents".} +proc pango_layout_get_iter*(layout: PLayout): PLayoutIter{.cdecl, + dynlib: pangolib, importc: "pango_layout_get_iter".} +proc pango_layout_iter_free*(iter: PLayoutIter){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_free".} +proc pango_layout_iter_get_index*(iter: PLayoutIter): int32{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_get_index".} +proc pango_layout_iter_get_run*(iter: PLayoutIter): PLayoutRun{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_get_run".} +proc pango_layout_iter_get_line*(iter: PLayoutIter): PLayoutLine{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_get_line".} +proc pango_layout_iter_at_last_line*(iter: PLayoutIter): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_at_last_line".} +proc pango_layout_iter_next_char*(iter: PLayoutIter): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_next_char".} +proc pango_layout_iter_next_cluster*(iter: PLayoutIter): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_next_cluster".} +proc pango_layout_iter_next_run*(iter: PLayoutIter): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_next_run".} +proc pango_layout_iter_next_line*(iter: PLayoutIter): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_next_line".} +proc pango_layout_iter_get_char_extents*(iter: PLayoutIter, + logical_rect: PRectangle){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_get_char_extents".} +proc pango_layout_iter_get_cluster_extents*(iter: PLayoutIter, + ink_rect: PRectangle, logical_rect: PRectangle){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_get_cluster_extents".} +proc pango_layout_iter_get_run_extents*(iter: PLayoutIter, ink_rect: PRectangle, + logical_rect: PRectangle){.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_get_run_extents".} +proc pango_layout_iter_get_line_extents*(iter: PLayoutIter, + ink_rect: PRectangle, logical_rect: PRectangle){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_get_line_extents".} +proc pango_layout_iter_get_line_yrange*(iter: PLayoutIter, y0: var int32, + y1: var int32){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_get_line_yrange".} +proc pango_layout_iter_get_layout_extents*(iter: PLayoutIter, + ink_rect: PRectangle, logical_rect: PRectangle){.cdecl, dynlib: pangolib, + importc: "pango_layout_iter_get_layout_extents".} +proc pango_layout_iter_get_baseline*(iter: PLayoutIter): int32{.cdecl, + dynlib: pangolib, importc: "pango_layout_iter_get_baseline".} +proc PANGO_TYPE_TAB_ARRAY*(): GType +proc pango_tab_array_new*(initial_size: gint, positions_in_pixels: gboolean): PTabArray{. + cdecl, dynlib: pangolib, importc: "pango_tab_array_new".} +proc pango_tab_array_get_type*(): GType{.cdecl, dynlib: pangolib, + importc: "pango_tab_array_get_type".} +proc pango_tab_array_copy*(src: PTabArray): PTabArray{.cdecl, dynlib: pangolib, + importc: "pango_tab_array_copy".} +proc pango_tab_array_free*(tab_array: PTabArray){.cdecl, dynlib: pangolib, + importc: "pango_tab_array_free".} +proc pango_tab_array_get_size*(tab_array: PTabArray): gint{.cdecl, + dynlib: pangolib, importc: "pango_tab_array_get_size".} +proc pango_tab_array_resize*(tab_array: PTabArray, new_size: gint){.cdecl, + dynlib: pangolib, importc: "pango_tab_array_resize".} +proc pango_tab_array_set_tab*(tab_array: PTabArray, tab_index: gint, + alignment: TTabAlign, location: gint){.cdecl, + dynlib: pangolib, importc: "pango_tab_array_set_tab".} +proc pango_tab_array_get_tab*(tab_array: PTabArray, tab_index: gint, + alignment: PTabAlign, location: Pgint){.cdecl, + dynlib: pangolib, importc: "pango_tab_array_get_tab".} +proc pango_tab_array_get_positions_in_pixels*(tab_array: PTabArray): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_tab_array_get_positions_in_pixels".} +proc PANGO_ASCENT*(rect: TRectangle): int32 = + result = - int(rect.y) + +proc PANGO_DESCENT*(rect: TRectangle): int32 = + result = int(rect.y) + int(rect.height) + +proc PANGO_LBEARING*(rect: TRectangle): int32 = + result = rect.x + +proc PANGO_RBEARING*(rect: TRectangle): int32 = + result = (rect.x) + (rect.width) + +proc PANGO_TYPE_LANGUAGE*(): GType = + result = pango_language_get_type() + +proc pango_language_to_string*(language: PLanguage): cstring = + result = cast[cstring](language) + +proc PANGO_PIXELS*(d: int): int = + if d >= 0: + result = (d + (PANGO_SCALE div 2)) div PANGO_SCALE + else: + result = (d - (PANGO_SCALE div 2)) div PANGO_SCALE + +proc PANGO_TYPE_COLOR*(): GType = + result = pango_color_get_type() + +proc PANGO_TYPE_ATTR_LIST*(): GType = + result = pango_attr_list_get_type() + +proc is_line_break*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_line_break) shr + bp_TPangoLogAttr_is_line_break + +proc set_is_line_break*(a: var TLogAttr, `is_line_break`: guint) = + a.flag0 = a.flag0 or + (int16(`is_line_break` shl bp_TPangoLogAttr_is_line_break) and + bm_TPangoLogAttr_is_line_break) + +proc is_mandatory_break*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_mandatory_break) shr + bp_TPangoLogAttr_is_mandatory_break + +proc set_is_mandatory_break*(a: var TLogAttr, `is_mandatory_break`: guint) = + a.flag0 = a.flag0 or + (int16(`is_mandatory_break` shl bp_TPangoLogAttr_is_mandatory_break) and + bm_TPangoLogAttr_is_mandatory_break) + +proc is_char_break*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_char_break) shr + bp_TPangoLogAttr_is_char_break + +proc set_is_char_break*(a: var TLogAttr, `is_char_break`: guint) = + a.flag0 = a.flag0 or + (int16(`is_char_break` shl bp_TPangoLogAttr_is_char_break) and + bm_TPangoLogAttr_is_char_break) + +proc is_white*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_white) shr + bp_TPangoLogAttr_is_white + +proc set_is_white*(a: var TLogAttr, `is_white`: guint) = + a.flag0 = a.flag0 or + (int16(`is_white` shl bp_TPangoLogAttr_is_white) and + bm_TPangoLogAttr_is_white) + +proc is_cursor_position*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_cursor_position) shr + bp_TPangoLogAttr_is_cursor_position + +proc set_is_cursor_position*(a: var TLogAttr, `is_cursor_position`: guint) = + a.flag0 = a.flag0 or + (int16(`is_cursor_position` shl bp_TPangoLogAttr_is_cursor_position) and + bm_TPangoLogAttr_is_cursor_position) + +proc is_word_start*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_word_start) shr + bp_TPangoLogAttr_is_word_start + +proc set_is_word_start*(a: var TLogAttr, `is_word_start`: guint) = + a.flag0 = a.flag0 or + (int16(`is_word_start` shl bp_TPangoLogAttr_is_word_start) and + bm_TPangoLogAttr_is_word_start) + +proc is_word_end*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_word_end) shr + bp_TPangoLogAttr_is_word_end + +proc set_is_word_end*(a: var TLogAttr, `is_word_end`: guint) = + a.flag0 = a.flag0 or + (int16(`is_word_end` shl bp_TPangoLogAttr_is_word_end) and + bm_TPangoLogAttr_is_word_end) + +proc is_sentence_boundary*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_sentence_boundary) shr + bp_TPangoLogAttr_is_sentence_boundary + +proc set_is_sentence_boundary*(a: var TLogAttr, `is_sentence_boundary`: guint) = + a.flag0 = a.flag0 or + (int16(`is_sentence_boundary` shl bp_TPangoLogAttr_is_sentence_boundary) and + bm_TPangoLogAttr_is_sentence_boundary) + +proc is_sentence_start*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_sentence_start) shr + bp_TPangoLogAttr_is_sentence_start + +proc set_is_sentence_start*(a: var TLogAttr, `is_sentence_start`: guint) = + a.flag0 = a.flag0 or + (int16(`is_sentence_start` shl bp_TPangoLogAttr_is_sentence_start) and + bm_TPangoLogAttr_is_sentence_start) + +proc is_sentence_end*(a: var TLogAttr): guint = + result = (a.flag0 and bm_TPangoLogAttr_is_sentence_end) shr + bp_TPangoLogAttr_is_sentence_end + +proc set_is_sentence_end*(a: var TLogAttr, `is_sentence_end`: guint) = + a.flag0 = a.flag0 or + (int16(`is_sentence_end` shl bp_TPangoLogAttr_is_sentence_end) and + bm_TPangoLogAttr_is_sentence_end) + +proc PANGO_TYPE_CONTEXT*(): GType = + result = pango_context_get_type() + +proc PANGO_CONTEXT*(anObject: pointer): PContext = + result = cast[PContext](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_CONTEXT())) + +proc PANGO_CONTEXT_CLASS*(klass: pointer): PContextClass = + result = cast[PContextClass](G_TYPE_CHECK_CLASS_CAST(klass, + PANGO_TYPE_CONTEXT())) + +proc PANGO_IS_CONTEXT*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_CONTEXT()) + +proc PANGO_IS_CONTEXT_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_CONTEXT()) + +proc PANGO_CONTEXT_GET_CLASS*(obj: PContext): PContextClass = + result = cast[PContextClass](G_TYPE_INSTANCE_GET_CLASS(obj, + PANGO_TYPE_CONTEXT())) + +proc PANGO_TYPE_FONTSET*(): GType = + result = pango_fontset_get_type() + +proc PANGO_FONTSET*(anObject: pointer): PFontset = + result = cast[PFontset](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_FONTSET())) + +proc PANGO_IS_FONTSET*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONTSET()) + +proc PANGO_FONTSET_CLASS*(klass: pointer): PFontsetClass = + result = cast[PFontsetClass](G_TYPE_CHECK_CLASS_CAST(klass, + PANGO_TYPE_FONTSET())) + +proc PANGO_IS_FONTSET_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONTSET()) + +proc PANGO_FONTSET_GET_CLASS*(obj: PFontset): PFontsetClass = + result = cast[PFontsetClass](G_TYPE_INSTANCE_GET_CLASS(obj, + PANGO_TYPE_FONTSET())) + +proc pango_fontset_simple_get_type(): GType{. + importc: "pango_fontset_simple_get_type", cdecl, dynlib: pangolib.} +proc PANGO_TYPE_FONTSET_SIMPLE*(): GType = + result = pango_fontset_simple_get_type() + +proc PANGO_FONTSET_SIMPLE*(anObject: pointer): PFontsetSimple = + result = cast[PFontsetSimple](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_FONTSET_SIMPLE())) + +proc PANGO_IS_FONTSET_SIMPLE*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONTSET_SIMPLE()) + +proc PANGO_TYPE_FONT_DESCRIPTION*(): GType = + result = pango_font_description_get_type() + +proc PANGO_TYPE_FONT_METRICS*(): GType = + result = pango_font_metrics_get_type() + +proc PANGO_TYPE_FONT_FAMILY*(): GType = + result = pango_font_family_get_type() + +proc PANGO_FONT_FAMILY*(anObject: pointer): PFontFamily = + result = cast[PFontFamily](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_FONT_FAMILY())) + +proc PANGO_IS_FONT_FAMILY*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_FAMILY()) + +proc PANGO_FONT_FAMILY_CLASS*(klass: Pointer): PFontFamilyClass = + result = cast[PFontFamilyClass](G_TYPE_CHECK_CLASS_CAST(klass, + PANGO_TYPE_FONT_FAMILY())) + +proc PANGO_IS_FONT_FAMILY_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_FAMILY()) + +proc PANGO_FONT_FAMILY_GET_CLASS*(obj: PFontFamily): PFontFamilyClass = + result = cast[PFontFamilyClass](G_TYPE_INSTANCE_GET_CLASS(obj, + PANGO_TYPE_FONT_FAMILY())) + +proc PANGO_TYPE_FONT_FACE*(): GType = + result = pango_font_face_get_type() + +proc PANGO_FONT_FACE*(anObject: Pointer): PFontFace = + result = cast[PFontFace](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_FONT_FACE())) + +proc PANGO_IS_FONT_FACE*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_FACE()) + +proc PANGO_FONT_FACE_CLASS*(klass: Pointer): PFontFaceClass = + result = cast[PFontFaceClass](G_TYPE_CHECK_CLASS_CAST(klass, + PANGO_TYPE_FONT_FACE())) + +proc PANGO_IS_FONT_FACE_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_FACE()) + +proc PANGO_FONT_FACE_GET_CLASS*(obj: Pointer): PFontFaceClass = + result = cast[PFontFaceClass](G_TYPE_INSTANCE_GET_CLASS(obj, + PANGO_TYPE_FONT_FACE())) + +proc PANGO_TYPE_FONT*(): GType = + result = pango_font_get_type() + +proc PANGO_FONT*(anObject: Pointer): PFont = + result = cast[PFont](G_TYPE_CHECK_INSTANCE_CAST(anObject, PANGO_TYPE_FONT())) + +proc PANGO_IS_FONT*(anObject: Pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT()) + +proc PANGO_FONT_CLASS*(klass: Pointer): PFontClass = + result = cast[PFontClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_FONT())) + +proc PANGO_IS_FONT_CLASS*(klass: Pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT()) + +proc PANGO_FONT_GET_CLASS*(obj: PFont): PFontClass = + result = cast[PFontClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_FONT())) + +proc PANGO_TYPE_FONT_MAP*(): GType = + result = pango_font_map_get_type() + +proc PANGO_FONT_MAP*(anObject: pointer): PFontmap = + result = cast[PFontmap](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_FONT_MAP())) + +proc PANGO_IS_FONT_MAP*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_FONT_MAP()) + +proc PANGO_FONT_MAP_CLASS*(klass: pointer): PFontMapClass = + result = cast[PFontMapClass](G_TYPE_CHECK_CLASS_CAST(klass, + PANGO_TYPE_FONT_MAP())) + +proc PANGO_IS_FONT_MAP_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_FONT_MAP()) + +proc PANGO_FONT_MAP_GET_CLASS*(obj: PFontMap): PFontMapClass = + result = cast[PFontMapClass](G_TYPE_INSTANCE_GET_CLASS(obj, + PANGO_TYPE_FONT_MAP())) + +proc is_cluster_start*(a: var TGlyphVisAttr): guint = + result = (a.flag0 and bm_TPangoGlyphVisAttr_is_cluster_start) shr + bp_TPangoGlyphVisAttr_is_cluster_start + +proc set_is_cluster_start*(a: var TGlyphVisAttr, `is_cluster_start`: guint) = + a.flag0 = a.flag0 or + (int16(`is_cluster_start` shl bp_TPangoGlyphVisAttr_is_cluster_start) and + bm_TPangoGlyphVisAttr_is_cluster_start) + +proc PANGO_TYPE_GLYPH_STRING*(): GType = + result = pango_glyph_string_get_type() + +proc PANGO_TYPE_LAYOUT*(): GType = + result = pango_layout_get_type() + +proc PANGO_LAYOUT*(anObject: pointer): PLayout = + result = cast[PLayout](G_TYPE_CHECK_INSTANCE_CAST(anObject, + PANGO_TYPE_LAYOUT())) + +proc PANGO_LAYOUT_CLASS*(klass: pointer): PLayoutClass = + result = cast[PLayoutClass](G_TYPE_CHECK_CLASS_CAST(klass, PANGO_TYPE_LAYOUT())) + +proc PANGO_IS_LAYOUT*(anObject: pointer): bool = + result = G_TYPE_CHECK_INSTANCE_TYPE(anObject, PANGO_TYPE_LAYOUT()) + +proc PANGO_IS_LAYOUT_CLASS*(klass: pointer): bool = + result = G_TYPE_CHECK_CLASS_TYPE(klass, PANGO_TYPE_LAYOUT()) + +proc PANGO_LAYOUT_GET_CLASS*(obj: PLayout): PLayoutClass = + result = cast[PLayoutClass](G_TYPE_INSTANCE_GET_CLASS(obj, PANGO_TYPE_LAYOUT())) + +proc PANGO_TYPE_TAB_ARRAY*(): GType = + result = pango_tab_array_get_type() diff --git a/lib/newwrap/gtk/pangoutils.nim b/lib/newwrap/gtk/pangoutils.nim new file mode 100644 index 000000000..552362b9a --- /dev/null +++ b/lib/newwrap/gtk/pangoutils.nim @@ -0,0 +1,45 @@ +{.deadCodeElim: on.} +import + glib2, pango + +type + pint32* = ptr int32 + +proc pango_split_file_list*(str: cstring): PPchar{.cdecl, dynlib: pangolib, + importc: "pango_split_file_list".} +proc pango_trim_string*(str: cstring): cstring{.cdecl, dynlib: pangolib, + importc: "pango_trim_string".} +proc pango_read_line*(stream: TFile, str: PGString): gint{.cdecl, + dynlib: pangolib, importc: "pango_read_line".} +proc pango_skip_space*(pos: PPchar): gboolean{.cdecl, dynlib: pangolib, + importc: "pango_skip_space".} +proc pango_scan_word*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_scan_word".} +proc pango_scan_string*(pos: PPchar, OutStr: PGString): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_scan_string".} +proc pango_scan_int*(pos: PPchar, OutInt: pint32): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_scan_int".} +proc pango_config_key_get(key: cstring): cstring{.cdecl, dynlib: pangolib, + importc: "pango_config_key_get".} +proc pango_lookup_aliases(fontname: cstring, families: PPPchar, + n_families: pint32){.cdecl, dynlib: pangolib, + importc: "pango_lookup_aliases".} +proc pango_parse_style*(str: cstring, style: PStyle, warn: gboolean): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_parse_style".} +proc pango_parse_variant*(str: cstring, variant: PVariant, warn: gboolean): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_parse_variant".} +proc pango_parse_weight*(str: cstring, weight: PWeight, warn: gboolean): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_parse_weight".} +proc pango_parse_stretch*(str: cstring, stretch: PStretch, warn: gboolean): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_parse_stretch".} +proc pango_get_sysconf_subdirectory(): cstring{.cdecl, dynlib: pangolib, + importc: "pango_get_sysconf_subdirectory".} +proc pango_get_lib_subdirectory(): cstring{.cdecl, dynlib: pangolib, + importc: "pango_get_lib_subdirectory".} +proc pango_log2vis_get_embedding_levels*(str: Pgunichar, len: int32, + pbase_dir: PDirection, embedding_level_list: Pguint8): gboolean{.cdecl, + dynlib: pangolib, importc: "pango_log2vis_get_embedding_levels".} +proc pango_get_mirror_char*(ch: gunichar, mirrored_ch: Pgunichar): gboolean{. + cdecl, dynlib: pangolib, importc: "pango_get_mirror_char".} +proc pango_language_get_sample_string*(language: PLanguage): cstring{.cdecl, + dynlib: pangolib, importc: "pango_language_get_sample_string".} \ No newline at end of file diff --git a/lib/newwrap/libcurl.nim b/lib/newwrap/libcurl.nim new file mode 100644 index 000000000..6dc61f112 --- /dev/null +++ b/lib/newwrap/libcurl.nim @@ -0,0 +1,491 @@ +# +# $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $ +# This file is part of the Free Pascal packages +# Copyright (c) 1999-2000 by the Free Pascal development team +# +# See the file COPYING.FPC, included in this distribution, +# for details about the copyright. +# +# 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. +# +# ********************************************************************** +# +# the curl library is governed by its own copyright, see the curl +# website for this. +# + +import + times + +when defined(windows): + const + libname = "libcurl.dll" +elif defined(macosx): + const + libname = "libcurl-7.19.3.dylib" +elif defined(unix): + const + libname = "libcurl.so.4" +type + Pcalloc_callback* = ptr Tcalloc_callback + Pclosepolicy* = ptr Tclosepolicy + Pforms* = ptr Tforms + Pftpauth* = ptr Tftpauth + Pftpmethod* = ptr Tftpmethod + Pftpssl* = ptr Tftpssl + PHTTP_VERSION* = ptr THTTP_VERSION + Phttppost* = ptr Thttppost + PPcurl_httppost* = ptr Phttppost + Pinfotype* = ptr Tinfotype + Plock_access* = ptr Tlock_access + Plock_data* = ptr Tlock_data + Pmalloc_callback* = ptr tmalloc_callback + PNETRC_OPTION* = ptr TNETRC_OPTION + Pproxytype* = ptr Tproxytype + Prealloc_callback* = ptr trealloc_callback + Pslist* = ptr Tslist + Psocket* = ptr Tsocket + PSSL_VERSION* = ptr TSSL_VERSION + Pstrdup_callback* = ptr Tstrdup_callback + PTIMECOND* = ptr TTIMECOND + Pversion_info_data* = ptr Tversion_info_data + Pcode* = ptr Tcode + PFORMcode* = ptr TFORMcode + Pformoption* = ptr Tformoption + PINFO* = ptr TINFO + Piocmd* = ptr Tiocmd + Pioerr* = ptr Tioerr + PM* = ptr TM + PMcode* = ptr TMcode + PMoption* = ptr TMoption + PMSG* = ptr TMSG + Poption* = ptr Toption + PSH* = ptr TSH + PSHcode* = ptr TSHcode + PSHoption* = ptr TSHoption + Pversion* = ptr Tversion + Pfd_set* = pointer + P* = ptr T + T* = pointer + Thttppost*{.final, pure.} = object + next*: Phttppost + name*: cstring + namelength*: int32 + contents*: cstring + contentslength*: int32 + buffer*: cstring + bufferlength*: int32 + contenttype*: cstring + contentheader*: Pslist + more*: Phttppost + flags*: int32 + showfilename*: cstring + + Tprogress_callback* = proc (clientp: pointer, dltotal: float64, + dlnow: float64, ultotal: float64, ulnow: float64): int32{. + cdecl.} + Twrite_callback* = proc (buffer: cstring, size: int, nitems: int, + outstream: pointer): int{.cdecl.} + Tread_callback* = proc (buffer: cstring, size: int, nitems: int, + instream: pointer): int{.cdecl.} + Tpasswd_callback* = proc (clientp: pointer, prompt: cstring, buffer: cstring, + buflen: int32): int32{.cdecl.} + Tioerr* = enum + IOE_OK, IOE_UNKNOWNCMD, IOE_FAILRESTART, IOE_LAST + Tiocmd* = enum + IOCMD_NOP, IOCMD_RESTARTREAD, IOCMD_LAST + Tioctl_callback* = proc (handle: P, cmd: int32, clientp: pointer): Tioerr{. + cdecl.} + Tmalloc_callback* = proc (size: int): pointer{.cdecl.} + Tfree_callback* = proc (p: pointer){.cdecl.} + Trealloc_callback* = proc (p: pointer, size: int): pointer{.cdecl.} + Tstrdup_callback* = proc (str: cstring): cstring{.cdecl.} + Tcalloc_callback* = proc (nmemb: int, size: int): pointer + Tinfotype* = enum + INFO_TEXT = 0, INFO_HEADER_IN, INFO_HEADER_OUT, INFO_DATA_IN, INFO_DATA_OUT, + INFO_SSL_DATA_IN, INFO_SSL_DATA_OUT, INFO_END + Tdebug_callback* = proc (handle: P, theType: Tinfotype, data: cstring, + size: int, userptr: pointer): int32{.cdecl.} + Tcode* = enum + E_OK = 0, E_UNSUPPORTED_PROTOCOL, E_FAILED_INIT, E_URL_MALFORMAT, + E_URL_MALFORMAT_USER, E_COULDNT_RESOLVE_PROXY, E_COULDNT_RESOLVE_HOST, + E_COULDNT_CONNECT, E_FTP_WEIRD_SERVER_REPLY, E_FTP_ACCESS_DENIED, + E_FTP_USER_PASSWORD_INCORRECT, E_FTP_WEIRD_PASS_REPLY, + E_FTP_WEIRD_USER_REPLY, E_FTP_WEIRD_PASV_REPLY, E_FTP_WEIRD_227_FORMAT, + E_FTP_CANT_GET_HOST, E_FTP_CANT_RECONNECT, E_FTP_COULDNT_SET_BINARY, + E_PARTIAL_FILE, E_FTP_COULDNT_RETR_FILE, E_FTP_WRITE_ERROR, + E_FTP_QUOTE_ERROR, E_HTTP_RETURNED_ERROR, E_WRITE_ERROR, E_MALFORMAT_USER, + E_FTP_COULDNT_STOR_FILE, E_READ_ERROR, E_OUT_OF_MEMORY, + E_OPERATION_TIMEOUTED, E_FTP_COULDNT_SET_ASCII, E_FTP_PORT_FAILED, + E_FTP_COULDNT_USE_REST, E_FTP_COULDNT_GET_SIZE, E_HTTP_RANGE_ERROR, + E_HTTP_POST_ERROR, E_SSL_CONNECT_ERROR, E_BAD_DOWNLOAD_RESUME, + E_FILE_COULDNT_READ_FILE, E_LDAP_CANNOT_BIND, E_LDAP_SEARCH_FAILED, + E_LIBRARY_NOT_FOUND, E_FUNCTION_NOT_FOUND, E_ABORTED_BY_CALLBACK, + E_BAD_FUNCTION_ARGUMENT, E_BAD_CALLING_ORDER, E_INTERFACE_FAILED, + E_BAD_PASSWORD_ENTERED, E_TOO_MANY_REDIRECTS, E_UNKNOWN_TELNET_OPTION, + E_TELNET_OPTION_SYNTAX, E_OBSOLETE, E_SSL_PEER_CERTIFICATE, E_GOT_NOTHING, + E_SSL_ENGINE_NOTFOUND, E_SSL_ENGINE_SETFAILED, E_SEND_ERROR, E_RECV_ERROR, + E_SHARE_IN_USE, E_SSL_CERTPROBLEM, E_SSL_CIPHER, E_SSL_CACERT, + E_BAD_CONTENT_ENCODING, E_LDAP_INVALID_URL, E_FILESIZE_EXCEEDED, + E_FTP_SSL_FAILED, E_SEND_FAIL_REWIND, E_SSL_ENGINE_INITFAILED, + E_LOGIN_DENIED, E_TFTP_NOTFOUND, E_TFTP_PERM, E_TFTP_DISKFULL, + E_TFTP_ILLEGAL, E_TFTP_UNKNOWNID, E_TFTP_EXISTS, E_TFTP_NOSUCHUSER, + E_CONV_FAILED, E_CONV_REQD, LAST + Tconv_callback* = proc (buffer: cstring, len: int): Tcode{.cdecl.} + Tssl_ctx_callback* = proc (: P, ssl_ctx, userptr: pointer): Tcode{.cdecl.} + Tproxytype* = enum + PROXY_HTTP = 0, PROXY_SOCKS4 = 4, PROXY_SOCKS5 = 5 + Tftpssl* = enum + FTPSSL_NONE, FTPSSL_TRY, FTPSSL_CONTROL, FTPSSL_ALL, FTPSSL_LAST + Tftpauth* = enum + FTPAUTH_DEFAULT, FTPAUTH_SSL, FTPAUTH_TLS, FTPAUTH_LAST + Tftpmethod* = enum + FTPMETHOD_DEFAULT, FTPMETHOD_MULTICWD, FTPMETHOD_NOCWD, FTPMETHOD_SINGLECWD, + FTPMETHOD_LAST + Toption* = enum + OPT_PORT = 0 + 3, OPT_TIMEOUT = 0 + 13, OPT_INFILESIZE = 0 + 14, + OPT_LOW_SPEED_LIMIT = 0 + 19, OPT_LOW_SPEED_TIME = 0 + 20, + OPT_RESUME_FROM = 0 + 21, OPT_CRLF = 0 + 27, OPT_SSLVERSION = 0 + 32, + OPT_TIMECONDITION = 0 + 33, OPT_TIMEVALUE = 0 + 34, OPT_VERBOSE = 0 + 41, + OPT_HEADER = 0 + 42, OPT_NOPROGRESS = 0 + 43, OPT_NOBODY = 0 + 44, + OPT_FAILONERROR = 0 + 45, OPT_UPLOAD = 0 + 46, OPT_POST = 0 + 47, + OPT_FTPLISTONLY = 0 + 48, OPT_FTPAPPEND = 0 + 50, OPT_NETRC = 0 + 51, + OPT_FOLLOWLOCATION = 0 + 52, OPT_TRANSFERTEXT = 0 + 53, OPT_PUT = 0 + 54, + OPT_AUTOREFERER = 0 + 58, OPT_PROXYPORT = 0 + 59, + OPT_POSTFIELDSIZE = 0 + 60, OPT_HTTPPROXYTUNNEL = 0 + 61, + OPT_SSL_VERIFYPEER = 0 + 64, OPT_MAXREDIRS = 0 + 68, OPT_FILETIME = 0 + 69, + OPT_MAXCONNECTS = 0 + 71, OPT_CLOSEPOLICY = 0 + 72, + OPT_FRESH_CONNECT = 0 + 74, OPT_FORBID_REUSE = 0 + 75, + OPT_CONNECTTIMEOUT = 0 + 78, OPT_HTTPGET = 0 + 80, + OPT_SSL_VERIFYHOST = 0 + 81, OPT_HTTP_VERSION = 0 + 84, + OPT_FTP_USE_EPSV = 0 + 85, OPT_SSLENGINE_DEFAULT = 0 + 90, + OPT_DNS_USE_GLOBAL_CACHE = 0 + 91, OPT_DNS_CACHE_TIMEOUT = 0 + 92, + OPT_COOKIESESSION = 0 + 96, OPT_BUFFERSIZE = 0 + 98, OPT_NOSIGNAL = 0 + 99, + OPT_PROXYTYPE = 0 + 101, OPT_UNRESTRICTED_AUTH = 0 + 105, + OPT_FTP_USE_EPRT = 0 + 106, OPT_HTTPAUTH = 0 + 107, + OPT_FTP_CREATE_MISSING_DIRS = 0 + 110, OPT_PROXYAUTH = 0 + 111, + OPT_FTP_RESPONSE_TIMEOUT = 0 + 112, OPT_IPRESOLVE = 0 + 113, + OPT_MAXFILESIZE = 0 + 114, OPT_FTP_SSL = 0 + 119, OPT_TCP_NODELAY = 0 + 121, + OPT_FTPSSLAUTH = 0 + 129, OPT_IGNORE_CONTENT_LENGTH = 0 + 136, + OPT_FTP_SKIP_PASV_IP = 0 + 137, OPT_FTP_FILEMETHOD = 0 + 138, + OPT_LOCALPORT = 0 + 139, OPT_LOCALPORTRANGE = 0 + 140, + OPT_CONNECT_ONLY = 0 + 141, OPT_FILE = 10000 + 1, OPT_URL = 10000 + 2, + OPT_PROXY = 10000 + 4, OPT_USERPWD = 10000 + 5, + OPT_PROXYUSERPWD = 10000 + 6, OPT_RANGE = 10000 + 7, OPT_INFILE = 10000 + 9, + OPT_ERRORBUFFER = 10000 + 10, OPT_POSTFIELDS = 10000 + 15, + OPT_REFERER = 10000 + 16, OPT_FTPPORT = 10000 + 17, + OPT_USERAGENT = 10000 + 18, OPT_COOKIE = 10000 + 22, + OPT_HTTPHEADER = 10000 + 23, OPT_HTTPPOST = 10000 + 24, + OPT_SSLCERT = 10000 + 25, OPT_SSLCERTPASSWD = 10000 + 26, + OPT_QUOTE = 10000 + 28, OPT_WRITEHEADER = 10000 + 29, + OPT_COOKIEFILE = 10000 + 31, OPT_CUSTOMREQUEST = 10000 + 36, + OPT_STDERR = 10000 + 37, OPT_POSTQUOTE = 10000 + 39, + OPT_WRITEINFO = 10000 + 40, OPT_PROGRESSDATA = 10000 + 57, + OPT_INTERFACE = 10000 + 62, OPT_KRB4LEVEL = 10000 + 63, + OPT_CAINFO = 10000 + 65, OPT_TELNETOPTIONS = 10000 + 70, + OPT_RANDOM_FILE = 10000 + 76, OPT_EGDSOCKET = 10000 + 77, + OPT_COOKIEJAR = 10000 + 82, OPT_SSL_CIPHER_LIST = 10000 + 83, + OPT_SSLCERTTYPE = 10000 + 86, OPT_SSLKEY = 10000 + 87, + OPT_SSLKEYTYPE = 10000 + 88, OPT_SSLENGINE = 10000 + 89, + OPT_PREQUOTE = 10000 + 93, OPT_DEBUGDATA = 10000 + 95, + OPT_CAPATH = 10000 + 97, OPT_SHARE = 10000 + 100, + OPT_ENCODING = 10000 + 102, OPT_PRIVATE = 10000 + 103, + OPT_HTTP200ALIASES = 10000 + 104, OPT_SSL_CTX_DATA = 10000 + 109, + OPT_NETRC_FILE = 10000 + 118, OPT_SOURCE_USERPWD = 10000 + 123, + OPT_SOURCE_PREQUOTE = 10000 + 127, OPT_SOURCE_POSTQUOTE = 10000 + 128, + OPT_IOCTLDATA = 10000 + 131, OPT_SOURCE_URL = 10000 + 132, + OPT_SOURCE_QUOTE = 10000 + 133, OPT_FTP_ACCOUNT = 10000 + 134, + OPT_COOKIELIST = 10000 + 135, OPT_FTP_ALTERNATIVE_TO_USER = 10000 + 147, + OPT_LASTENTRY = 10000 + 148, OPT_WRITEFUNCTION = 20000 + 11, + OPT_READFUNCTION = 20000 + 12, OPT_PROGRESSFUNCTION = 20000 + 56, + OPT_HEADERFUNCTION = 20000 + 79, OPT_DEBUGFUNCTION = 20000 + 94, + OPT_SSL_CTX_FUNCTION = 20000 + 108, OPT_IOCTLFUNCTION = 20000 + 130, + OPT_CONV_FROM_NETWORK_FUNCTION = 20000 + 142, + OPT_CONV_TO_NETWORK_FUNCTION = 20000 + 143, + OPT_CONV_FROM_UTF8_FUNCTION = 20000 + 144, + OPT_INFILESIZE_LARGE = 30000 + 115, OPT_RESUME_FROM_LARGE = 30000 + 116, + OPT_MAXFILESIZE_LARGE = 30000 + 117, OPT_POSTFIELDSIZE_LARGE = 30000 + 120, + OPT_MAX_SEND_SPEED_LARGE = 30000 + 145, + OPT_MAX_RECV_SPEED_LARGE = 30000 + 146 + THTTP_VERSION* = enum + HTTP_VERSION_NONE, HTTP_VERSION_1_0, HTTP_VERSION_1_1, HTTP_VERSION_LAST + TNETRC_OPTION* = enum + NETRC_IGNORED, NETRC_OPTIONAL, NETRC_REQUIRED, NETRC_LAST + TSSL_VERSION* = enum + SSLVERSION_DEFAULT, SSLVERSION_TLSv1, SSLVERSION_SSLv2, SSLVERSION_SSLv3, + SSLVERSION_LAST + TTIMECOND* = enum + TIMECOND_NONE, TIMECOND_IFMODSINCE, TIMECOND_IFUNMODSINCE, TIMECOND_LASTMOD, + TIMECOND_LAST + Tformoption* = enum + FORM_NOTHING, FORM_COPYNAME, FORM_PTRNAME, FORM_NAMELENGTH, + FORM_COPYCONTENTS, FORM_PTRCONTENTS, FORM_CONTENTSLENGTH, FORM_FILECONTENT, + FORM_ARRAY, FORM_OBSOLETE, FORM_FILE, FORM_BUFFER, FORM_BUFFERPTR, + FORM_BUFFERLENGTH, FORM_CONTENTTYPE, FORM_CONTENTHEADER, FORM_FILENAME, + FORM_END, FORM_OBSOLETE2, FORM_LASTENTRY + Tforms*{.pure, final.} = object + option*: Tformoption + value*: cstring + + TFORMcode* = enum + FORMADD_OK, FORMADD_MEMORY, FORMADD_OPTION_TWICE, FORMADD_NULL, + FORMADD_UNKNOWN_OPTION, FORMADD_INCOMPLETE, FORMADD_ILLEGAL_ARRAY, + FORMADD_DISABLED, FORMADD_LAST + Tformget_callback* = proc (arg: pointer, buf: cstring, length: int): int{. + cdecl.} + Tslist*{.pure, final.} = object + data*: cstring + next*: Pslist + + TINFO* = enum + INFO_NONE = 0, INFO_LASTONE = 30, INFO_EFFECTIVE_URL = 0x00100000 + 1, + INFO_CONTENT_TYPE = 0x00100000 + 18, INFO_PRIVATE = 0x00100000 + 21, + INFO_FTP_ENTRY_PATH = 0x00100000 + 30, INFO_RESPONSE_CODE = 0x00200000 + 2, + INFO_HEADER_SIZE = 0x00200000 + 11, INFO_REQUEST_SIZE = 0x00200000 + 12, + INFO_SSL_VERIFYRESULT = 0x00200000 + 13, INFO_FILETIME = 0x00200000 + 14, + INFO_REDIRECT_COUNT = 0x00200000 + 20, + INFO_HTTP_CONNECTCODE = 0x00200000 + 22, + INFO_HTTPAUTH_AVAIL = 0x00200000 + 23, + INFO_PROXYAUTH_AVAIL = 0x00200000 + 24, INFO_OS_ERRNO = 0x00200000 + 25, + INFO_NUM_CONNECTS = 0x00200000 + 26, INFO_LASTSOCKET = 0x00200000 + 29, + INFO_TOTAL_TIME = 0x00300000 + 3, INFO_NAMELOOKUP_TIME = 0x00300000 + 4, + INFO_CONNECT_TIME = 0x00300000 + 5, INFO_PRETRANSFER_TIME = 0x00300000 + 6, + INFO_SIZE_UPLOAD = 0x00300000 + 7, INFO_SIZE_DOWNLOAD = 0x00300000 + 8, + INFO_SPEED_DOWNLOAD = 0x00300000 + 9, INFO_SPEED_UPLOAD = 0x00300000 + 10, + INFO_CONTENT_LENGTH_DOWNLOAD = 0x00300000 + 15, + INFO_CONTENT_LENGTH_UPLOAD = 0x00300000 + 16, + INFO_STARTTRANSFER_TIME = 0x00300000 + 17, + INFO_REDIRECT_TIME = 0x00300000 + 19, INFO_SSL_ENGINES = 0x00400000 + 27, + INFO_COOKIELIST = 0x00400000 + 28 + Tclosepolicy* = enum + CLOSEPOLICY_NONE, CLOSEPOLICY_OLDEST, CLOSEPOLICY_LEAST_RECENTLY_USED, + CLOSEPOLICY_LEAST_TRAFFIC, CLOSEPOLICY_SLOWEST, CLOSEPOLICY_CALLBACK, + CLOSEPOLICY_LAST + Tlock_data* = enum + LOCK_DATA_NONE = 0, LOCK_DATA_SHARE, LOCK_DATA_COOKIE, LOCK_DATA_DNS, + LOCK_DATA_SSL_SESSION, LOCK_DATA_CONNECT, LOCK_DATA_LAST + Tlock_access* = enum + LOCK_ACCESS_NONE = 0, LOCK_ACCESS_SHARED = 1, LOCK_ACCESS_SINGLE = 2, + LOCK_ACCESS_LAST + Tlock_function* = proc (handle: P, data: Tlock_data, locktype: Tlock_access, + userptr: pointer){.cdecl.} + Tunlock_function* = proc (handle: P, data: Tlock_data, userptr: pointer){. + cdecl.} + TSH* = pointer + TSHcode* = enum + SHE_OK, SHE_BAD_OPTION, SHE_IN_USE, SHE_INVALID, SHE_NOMEM, SHE_LAST + TSHoption* = enum + SHOPT_NONE, SHOPT_SHARE, SHOPT_UNSHARE, SHOPT_LOCKFUNC, SHOPT_UNLOCKFUNC, + SHOPT_USERDATA, SHOPT_LAST + Tversion* = enum + VERSION_FIRST, VERSION_SECOND, VERSION_THIRD, VERSION_LAST + Tversion_info_data*{.pure, final.} = object + age*: Tversion + version*: cstring + version_num*: int32 + host*: cstring + features*: int32 + ssl_version*: cstring + ssl_version_num*: int32 + libz_version*: cstring + protocols*: cstringArray + ares*: cstring + ares_num*: int32 + libidn*: cstring + iconv_ver_num*: int32 + + TM* = pointer + Tsocket* = int32 + TMcode* = enum + M_CALL_MULTI_PERFORM = - 1, M_OK = 0, M_BAD_HANDLE, M_BAD_EASY_HANDLE, + M_OUT_OF_MEMORY, M_INTERNAL_ERROR, M_BAD_SOCKET, M_UNKNOWN_OPTION, M_LAST + TMSGEnum* = enum + MSG_NONE, MSG_DONE, MSG_LAST + TMsg*{.pure, final.} = object + msg*: TMSGEnum + easy_handle*: P + whatever*: Pointer #data : record + # case longint of + # 0 : ( whatever : pointer ); + # 1 : ( result : CURLcode ); + # end; + + Tsocket_callback* = proc (easy: P, s: Tsocket, what: int32, + userp, socketp: pointer): int32{.cdecl.} + TMoption* = enum + MOPT_SOCKETDATA = 10000 + 2, MOPT_LASTENTRY = 10000 + 3, + MOPT_SOCKETFUNCTION = 20000 + 1 + +const + OPT_SSLKEYPASSWD* = OPT_SSLCERTPASSWD + AUTH_ANY* = not (0) + AUTH_BASIC* = 1 shl 0 + AUTH_ANYSAFE* = not (AUTH_BASIC) + AUTH_DIGEST* = 1 shl 1 + AUTH_GSSNEGOTIATE* = 1 shl 2 + AUTH_NONE* = 0 + AUTH_NTLM* = 1 shl 3 + E_ALREADY_COMPLETE* = 99999 + E_FTP_BAD_DOWNLOAD_RESUME* = E_BAD_DOWNLOAD_RESUME + E_FTP_PARTIAL_FILE* = E_PARTIAL_FILE + E_HTTP_NOT_FOUND* = E_HTTP_RETURNED_ERROR + E_HTTP_PORT_FAILED* = E_INTERFACE_FAILED + E_OPERATION_TIMEDOUT* = E_OPERATION_TIMEOUTED + ERROR_SIZE* = 256 + FORMAT_OFF_T* = "%ld" + GLOBAL_NOTHING* = 0 + GLOBAL_SSL* = 1 shl 0 + GLOBAL_WIN32* = 1 shl 1 + GLOBAL_ALL* = GLOBAL_SSL or GLOBAL_WIN32 + GLOBAL_DEFAULT* = GLOBAL_ALL + INFO_DOUBLE* = 0x00300000 + INFO_HTTP_CODE* = INFO_RESPONSE_CODE + INFO_LONG* = 0x00200000 + INFO_MASK* = 0x000FFFFF + INFO_SLIST* = 0x00400000 + INFO_STRING* = 0x00100000 + INFO_TYPEMASK* = 0x00F00000 + IPRESOLVE_V4* = 1 + IPRESOLVE_V6* = 2 + IPRESOLVE_WHATEVER* = 0 + MAX_WRITE_SIZE* = 16384 + M_CALL_MULTI_SOCKET* = M_CALL_MULTI_PERFORM + OPT_CLOSEFUNCTION* = - (5) + OPT_FTPASCII* = OPT_TRANSFERTEXT + OPT_HEADERDATA* = OPT_WRITEHEADER + OPT_HTTPREQUEST* = - (1) + OPT_MUTE* = - (2) + OPT_PASSWDDATA* = - (4) + OPT_PASSWDFUNCTION* = - (3) + OPT_PASV_HOST* = - (9) + OPT_READDATA* = OPT_INFILE + OPT_SOURCE_HOST* = - (6) + OPT_SOURCE_PATH* = - (7) + OPT_SOURCE_PORT* = - (8) + OPTTYPE_FUNCTIONPOINT* = 20000 + OPTTYPE_LONG* = 0 + OPTTYPE_OBJECTPOINT* = 10000 + OPTTYPE_OFF_T* = 30000 + OPT_WRITEDATA* = OPT_FILE + POLL_IN* = 1 + POLL_INOUT* = 3 + POLL_NONE* = 0 + POLL_OUT* = 2 + POLL_REMOVE* = 4 + READFUNC_ABORT* = 0x10000000 + SOCKET_BAD* = - (1) + SOCKET_TIMEOUT* = SOCKET_BAD + VERSION_ASYNCHDNS* = 1 shl 7 + VERSION_CONV* = 1 shl 12 + VERSION_DEBUG* = 1 shl 6 + VERSION_GSSNEGOTIATE* = 1 shl 5 + VERSION_IDN* = 1 shl 10 + VERSION_IPV6* = 1 shl 0 + VERSION_KERBEROS4* = 1 shl 1 + VERSION_LARGEFILE* = 1 shl 9 + VERSION_LIBZ* = 1 shl 3 + VERSION_NOW* = VERSION_THIRD + VERSION_NTLM* = 1 shl 4 + VERSION_SPNEGO* = 1 shl 8 + VERSION_SSL* = 1 shl 2 + VERSION_SSPI* = 1 shl 11 + FILE_OFFSET_BITS* = 0 + FILESIZEBITS* = 0 + FUNCTIONPOINT* = OPTTYPE_FUNCTIONPOINT + HTTPPOST_BUFFER* = 1 shl 4 + HTTPPOST_FILENAME* = 1 shl 0 + HTTPPOST_PTRBUFFER* = 1 shl 5 + HTTPPOST_PTRCONTENTS* = 1 shl 3 + HTTPPOST_PTRNAME* = 1 shl 2 + HTTPPOST_READFILE* = 1 shl 1 + LIBCURL_VERSION* = "7.15.5" + LIBCURL_VERSION_MAJOR* = 7 + LIBCURL_VERSION_MINOR* = 15 + LIBCURL_VERSION_NUM* = 0x00070F05 + LIBCURL_VERSION_PATCH* = 5 + +proc strequal*(s1, s2: cstring): int32{.cdecl, dynlib: libname, + importc: "curl_strequal".} +proc strnequal*(s1, s2: cstring, n: int): int32{.cdecl, dynlib: libname, + importc: "curl_strnequal".} +proc formadd*(httppost, last_post: PPcurl_httppost): TFORMcode{.cdecl, varargs, + dynlib: libname, importc: "curl_formadd".} +proc formget*(form: Phttppost, arg: pointer, append: Tformget_callback): int32{. + cdecl, dynlib: libname, importc: "curl_formget".} +proc formfree*(form: Phttppost){.cdecl, dynlib: libname, + importc: "curl_formfree".} +proc getenv*(variable: cstring): cstring{.cdecl, dynlib: libname, + importc: "curl_getenv".} +proc version*(): cstring{.cdecl, dynlib: libname, importc: "curl_version".} +proc easy_escape*(handle: P, str: cstring, len: int32): cstring{.cdecl, + dynlib: libname, importc: "curl_easy_escape".} +proc escape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, + importc: "curl_escape".} +proc easy_unescape*(handle: P, str: cstring, len: int32, outlength: var int32): cstring{. + cdecl, dynlib: libname, importc: "curl_easy_unescape".} +proc unescape*(str: cstring, len: int32): cstring{.cdecl, dynlib: libname, + importc: "curl_unescape".} +proc free*(p: pointer){.cdecl, dynlib: libname, importc: "curl_free".} +proc global_init*(flags: int32): Tcode{.cdecl, dynlib: libname, + importc: "curl_global_init".} +proc global_init_mem*(flags: int32, m: Tmalloc_callback, f: Tfree_callback, + r: Trealloc_callback, s: Tstrdup_callback, + c: Tcalloc_callback): Tcode{.cdecl, dynlib: libname, + importc: "curl_global_init_mem".} +proc global_cleanup*(){.cdecl, dynlib: libname, importc: "curl_global_cleanup".} +proc slist_append*(slist: Pslist, P: cstring): Pslist{.cdecl, dynlib: libname, + importc: "curl_slist_append".} +proc slist_free_all*(para1: Pslist){.cdecl, dynlib: libname, + importc: "curl_slist_free_all".} +proc getdate*(p: cstring, unused: ptr TTime): TTime{.cdecl, dynlib: libname, + importc: "curl_getdate".} +proc share_init*(): PSH{.cdecl, dynlib: libname, importc: "curl_share_init".} +proc share_setopt*(para1: PSH, option: TSHoption): TSHcode{.cdecl, varargs, + dynlib: libname, importc: "curl_share_setopt".} +proc share_cleanup*(para1: PSH): TSHcode{.cdecl, dynlib: libname, + importc: "curl_share_cleanup".} +proc version_info*(para1: Tversion): Pversion_info_data{.cdecl, dynlib: libname, + importc: "curl_version_info".} +proc easy_strerror*(para1: Tcode): cstring{.cdecl, dynlib: libname, + importc: "curl_easy_strerror".} +proc share_strerror*(para1: TSHcode): cstring{.cdecl, dynlib: libname, + importc: "curl_share_strerror".} +proc easy_init*(): P{.cdecl, dynlib: libname, importc: "curl_easy_init".} +proc easy_setopt*(: P, option: Toption): Tcode{.cdecl, varargs, dynlib: libname, + importc: "curl_easy_setopt".} +proc easy_perform*(: P): Tcode{.cdecl, dynlib: libname, + importc: "curl_easy_perform".} +proc easy_cleanup*(: P){.cdecl, dynlib: libname, importc: "curl_easy_cleanup".} +proc easy_getinfo*(: P, info: TINFO): Tcode{.cdecl, varargs, dynlib: libname, + importc: "curl_easy_getinfo".} +proc easy_duphandle*(: P): P{.cdecl, dynlib: libname, + importc: "curl_easy_duphandle".} +proc easy_reset*(: P){.cdecl, dynlib: libname, importc: "curl_easy_reset".} +proc multi_init*(): PM{.cdecl, dynlib: libname, importc: "curl_multi_init".} +proc multi_add_handle*(multi_handle: PM, handle: P): TMcode{.cdecl, + dynlib: libname, importc: "curl_multi_add_handle".} +proc multi_remove_handle*(multi_handle: PM, handle: P): TMcode{.cdecl, + dynlib: libname, importc: "curl_multi_remove_handle".} +proc multi_fdset*(multi_handle: PM, read_fd_set: Pfd_set, write_fd_set: Pfd_set, + exc_fd_set: Pfd_set, max_fd: var int32): TMcode{.cdecl, + dynlib: libname, importc: "curl_multi_fdset".} +proc multi_perform*(multi_handle: PM, running_handles: var int32): TMcode{. + cdecl, dynlib: libname, importc: "curl_multi_perform".} +proc multi_cleanup*(multi_handle: PM): TMcode{.cdecl, dynlib: libname, + importc: "curl_multi_cleanup".} +proc multi_info_read*(multi_handle: PM, msgs_in_queue: var int32): PMsg{.cdecl, + dynlib: libname, importc: "curl_multi_info_read".} +proc multi_strerror*(para1: TMcode): cstring{.cdecl, dynlib: libname, + importc: "curl_multi_strerror".} +proc multi_socket*(multi_handle: PM, s: Tsocket, running_handles: var int32): TMcode{. + cdecl, dynlib: libname, importc: "curl_multi_socket".} +proc multi_socket_all*(multi_handle: PM, running_handles: var int32): TMcode{. + cdecl, dynlib: libname, importc: "curl_multi_socket_all".} +proc multi_timeout*(multi_handle: PM, milliseconds: var int32): TMcode{.cdecl, + dynlib: libname, importc: "curl_multi_timeout".} +proc multi_setopt*(multi_handle: PM, option: TMoption): TMcode{.cdecl, varargs, + dynlib: libname, importc: "curl_multi_setopt".} +proc multi_assign*(multi_handle: PM, sockfd: Tsocket, sockp: pointer): TMcode{. + cdecl, dynlib: libname, importc: "curl_multi_assign".} \ No newline at end of file diff --git a/lib/newwrap/lua/lauxlib.nim b/lib/newwrap/lua/lauxlib.nim new file mode 100644 index 000000000..13a473687 --- /dev/null +++ b/lib/newwrap/lua/lauxlib.nim @@ -0,0 +1,229 @@ +#***************************************************************************** +# * * +# * 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 lua_pushstring*(L: Plua_State, s: string) + # compatibilty macros +proc getn*(L: Plua_State, n: int): int + # calls lua_objlen +proc setn*(L: Plua_State, t, n: int) + # does nothing! +type + Treg*{.final.} = object + name*: cstring + func*: lua_CFunction + + Preg* = ptr Treg + +proc openlib*(L: Plua_State, libname: cstring, lr: Preg, nup: int){.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_openlib".} +proc register*(L: Plua_State, libname: cstring, lr: Preg){.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_register".} +proc getmetafield*(L: Plua_State, obj: int, e: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_getmetafield".} +proc callmeta*(L: Plua_State, obj: int, e: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_callmeta".} +proc typerror*(L: Plua_State, narg: int, tname: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_typerror".} +proc argerror*(L: Plua_State, numarg: int, extramsg: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_argerror".} +proc checklstring*(L: Plua_State, numArg: int, l_: Psize_t): cstring{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_checklstring".} +proc optlstring*(L: Plua_State, numArg: int, def: cstring, l_: Psize_t): cstring{. + cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_optlstring".} +proc checknumber*(L: Plua_State, numArg: int): lua_Number{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_checknumber".} +proc optnumber*(L: Plua_State, nArg: int, def: lua_Number): lua_Number{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_optnumber".} +proc checkinteger*(L: Plua_State, numArg: int): lua_Integer{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_checkinteger".} +proc optinteger*(L: Plua_State, nArg: int, def: lua_Integer): lua_Integer{. + cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_optinteger".} +proc checkstack*(L: Plua_State, sz: int, msg: cstring){.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_checkstack".} +proc checktype*(L: Plua_State, narg, t: int){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_checktype".} +proc checkany*(L: Plua_State, narg: int){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_checkany".} +proc newmetatable*(L: Plua_State, tname: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_newmetatable".} +proc checkudata*(L: Plua_State, ud: int, tname: cstring): Pointer{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_checkudata".} +proc where*(L: Plua_State, lvl: int){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_where".} +proc error*(L: Plua_State, fmt: cstring): int{.cdecl, varargs, + dynlib: LUA_LIB_NAME, importc: "luaL_error".} +proc checkoption*(L: Plua_State, narg: int, def: cstring, lst: cstringArray): int{. + cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_checkoption".} +proc ref*(L: Plua_State, t: int): int{.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_ref".} +proc unref*(L: Plua_State, t, theref: int){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_unref".} +proc loadfile*(L: Plua_State, filename: cstring): int{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_loadfile".} +proc loadbuffer*(L: Plua_State, buff: cstring, size: size_t, name: cstring): int{. + cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_loadbuffer".} +proc loadstring*(L: Plua_State, s: cstring): int{.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_loadstring".} +proc newstate*(): Plua_State{.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_newstate".} +proc lua_open*(): Plua_State + # compatibility; moved from unit lua to lauxlib because it needs luaL_newstate + # + #** =============================================================== + #** some useful macros + #** =============================================================== + # +proc argcheck*(L: Plua_State, cond: bool, numarg: int, extramsg: cstring) +proc checkstring*(L: Plua_State, n: int): cstring +proc optstring*(L: Plua_State, n: int, d: cstring): cstring +proc checkint*(L: Plua_State, n: int): int +proc checklong*(L: Plua_State, n: int): int32 +proc optint*(L: Plua_State, n: int, d: float64): int +proc optlong*(L: Plua_State, n: int, d: float64): int32 +proc typename*(L: Plua_State, i: int): cstring +proc lua_dofile*(L: Plua_State, filename: cstring): int +proc lua_dostring*(L: Plua_State, str: cstring): int +proc lua_Lgetmetatable*(L: Plua_State, 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*: int # number of strings in the stack (level) + L*: Plua_State + 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: int) +proc buffinit*(L: Plua_State, B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_buffinit".} +proc prepbuffer*(B: PBuffer): cstring{.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_prepbuffer".} +proc addlstring*(B: PBuffer, s: cstring, L: size_t){.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_addlstring".} +proc addstring*(B: PBuffer, s: cstring){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_addstring".} +proc addvalue*(B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_addvalue".} +proc pushresult*(B: PBuffer){.cdecl, dynlib: LUA_LIB_NAME, + importc: "luaL_pushresult".} +proc gsub*(L: Plua_State, s, p, r: cstring): cstring{.cdecl, + dynlib: LUA_LIB_NAME, importc: "luaL_gsub".} +proc findtable*(L: Plua_State, idx: int, fname: cstring, szhint: int): cstring{. + cdecl, dynlib: LUA_LIB_NAME, importc: "luaL_findtable".} + # compatibility with ref system + # pre-defined references +const + LUA_NOREF* = - 2 + LUA_REFNIL* = - 1 + +proc lua_unref*(L: Plua_State, theref: int) +proc lua_getref*(L: Plua_State, theref: int) + # + #** Compatibility macros and functions + # +# implementation + +proc lua_pushstring(L: Plua_State, s: string) = + lua_pushlstring(L, cstring(s), len(s)) + +proc getn(L: Plua_State, n: int): int = + Result = lua_objlen(L, n) + +proc setn(L: Plua_State, t, n: int) = + # does nothing as this operation is deprecated + nil + +proc lua_open(): Plua_State = + Result = newstate() + +proc typename(L: Plua_State, i: int): cstring = + Result = lua_typename(L, lua_type(L, i)) + +proc lua_dofile(L: Plua_State, filename: cstring): int = + Result = loadfile(L, filename) + if Result == 0: Result = lua_pcall(L, 0, LUA_MULTRET, 0) + +proc lua_dostring(L: Plua_State, str: cstring): int = + Result = loadstring(L, str) + if Result == 0: Result = lua_pcall(L, 0, LUA_MULTRET, 0) + +proc lua_Lgetmetatable(L: Plua_State, tname: cstring) = + lua_getfield(L, LUA_REGISTRYINDEX, tname) + +proc argcheck(L: Plua_State, cond: bool, numarg: int, extramsg: cstring) = + if not cond: + discard argerror(L, numarg, extramsg) + +proc checkstring(L: Plua_State, n: int): cstring = + Result = checklstring(L, n, nil) + +proc optstring(L: Plua_State, n: int, d: cstring): cstring = + Result = optlstring(L, n, d, nil) + +proc checkint(L: Plua_State, n: int): int = + Result = toInt(checknumber(L, n)) + +proc checklong(L: Plua_State, n: int): int32 = + Result = int32(ToInt(checknumber(L, n))) + +proc optint(L: Plua_State, n: int, d: float64): int = + Result = int(ToInt(optnumber(L, n, d))) + +proc optlong(L: Plua_State, n: int, d: float64): int32 = + 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: int) = + B.p = cast[cstring](cast[int](B.p) + n) + +proc lua_unref(L: Plua_State, theref: int) = + unref(L, LUA_REGISTRYINDEX, theref) + +proc lua_getref(L: Plua_State, theref: int) = + lua_rawgeti(L, LUA_REGISTRYINDEX, theref) diff --git a/lib/newwrap/lua/lua.nim b/lib/newwrap/lua/lua.nim new file mode 100644 index 000000000..b702e381c --- /dev/null +++ b/lib/newwrap/lua/lua.nim @@ -0,0 +1,401 @@ +#***************************************************************************** +# * * +# * 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(MACOSX): + const + NAME* = "liblua(|5.2|5.1|5.0).dylib" + LIB_NAME* = "liblua(|5.2|5.1|5.0).dylib" +elif defined(UNIX): + const + NAME* = "liblua(|5.2|5.1|5.0).so(|.0)" + LIB_NAME* = "liblua(|5.2|5.1|5.0).so(|.0)" +else: + const + NAME* = "lua(|5.2|5.1|5.0).dll" + LIB_NAME* = "lua(|5.2|5.1|5.0).dll" +type + size_t* = int + Psize_t* = ptr size_t + +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: int): int +const # thread status; 0 is OK + YIELD_* = 1 + ERRRUN* = 2 + ERRSYNTAX* = 3 + ERRMEM* = 4 + ERRERR* = 5 + +type + PState* = Pointer + CFunction* = proc (L: PState): int{.cdecl.} + +# +#** functions that read/write blocks when loading/dumping Lua chunks +# + +type + Reader* = proc (L: PState, ud: Pointer, sz: Psize_t): cstring{.cdecl.} + Writer* = proc (L: PState, p: Pointer, sz: size_t, ud: Pointer): int{.cdecl.} + Alloc* = proc (ud, theptr: Pointer, osize, nsize: size_t){.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* = int + +proc newstate*(f: Alloc, ud: Pointer): PState{.cdecl, dynlib: NAME, + importc: "lua_newstate".} +proc close*(L: PState){.cdecl, dynlib: NAME, importc: "lua_close".} +proc newthread*(L: PState): PState{.cdecl, dynlib: NAME, + importc: "lua_newthread".} +proc atpanic*(L: PState, panicf: CFunction): CFunction{.cdecl, dynlib: NAME, + importc: "lua_atpanic".} +proc gettop*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_gettop".} +proc settop*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_settop".} +proc pushvalue*(L: PState, Idx: int){.cdecl, dynlib: NAME, + importc: "lua_pushvalue".} +proc remove*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_remove".} +proc insert*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_insert".} +proc replace*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_replace".} +proc checkstack*(L: PState, sz: int): cint{.cdecl, dynlib: NAME, + importc: "lua_checkstack".} +proc xmove*(`from`, `to`: PState, n: int){.cdecl, dynlib: NAME, + importc: "lua_xmove".} +proc isnumber*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, + importc: "lua_isnumber".} +proc isstring*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, + importc: "lua_isstring".} +proc iscfunction*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, + importc: "lua_iscfunction".} +proc isuserdata*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, + importc: "lua_isuserdata".} +proc type*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_type".} +proc typename*(L: PState, tp: int): cstring{.cdecl, dynlib: NAME, + importc: "lua_typename".} +proc equal*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, + importc: "lua_equal".} +proc rawequal*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, + importc: "lua_rawequal".} +proc lessthan*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, + importc: "lua_lessthan".} +proc tonumber*(L: PState, idx: int): Number{.cdecl, dynlib: NAME, + importc: "lua_tonumber".} +proc tointeger*(L: PState, idx: int): Integer{.cdecl, dynlib: NAME, + importc: "lua_tointeger".} +proc toboolean*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, + importc: "lua_toboolean".} +proc tolstring*(L: PState, idx: int, length: Psize_t): cstring{.cdecl, + dynlib: NAME, importc: "lua_tolstring".} +proc objlen*(L: PState, idx: int): size_t{.cdecl, dynlib: NAME, + importc: "lua_objlen".} +proc tocfunction*(L: PState, idx: int): CFunction{.cdecl, dynlib: NAME, + importc: "lua_tocfunction".} +proc touserdata*(L: PState, idx: int): Pointer{.cdecl, dynlib: NAME, + importc: "lua_touserdata".} +proc tothread*(L: PState, idx: int): PState{.cdecl, dynlib: NAME, + importc: "lua_tothread".} +proc topointer*(L: PState, idx: int): Pointer{.cdecl, dynlib: NAME, + importc: "lua_topointer".} +proc pushnil*(L: PState){.cdecl, dynlib: NAME, importc: "lua_pushnil".} +proc pushnumber*(L: PState, n: Number){.cdecl, dynlib: NAME, + importc: "lua_pushnumber".} +proc pushinteger*(L: PState, n: Integer){.cdecl, dynlib: NAME, + importc: "lua_pushinteger".} +proc pushlstring*(L: PState, s: cstring, l_: size_t){.cdecl, dynlib: NAME, + importc: "lua_pushlstring".} +proc pushstring*(L: PState, s: cstring){.cdecl, dynlib: NAME, + importc: "lua_pushstring".} +proc pushvfstring*(L: PState, fmt: cstring, argp: Pointer): cstring{.cdecl, + dynlib: NAME, importc: "lua_pushvfstring".} +proc pushfstring*(L: PState, fmt: cstring): cstring{.cdecl, varargs, + dynlib: NAME, importc: "lua_pushfstring".} +proc pushcclosure*(L: PState, fn: CFunction, n: int){.cdecl, dynlib: NAME, + importc: "lua_pushcclosure".} +proc pushboolean*(L: PState, b: cint){.cdecl, dynlib: NAME, + importc: "lua_pushboolean".} +proc pushlightuserdata*(L: PState, p: Pointer){.cdecl, dynlib: NAME, + importc: "lua_pushlightuserdata".} +proc pushthread*(L: PState){.cdecl, dynlib: NAME, importc: "lua_pushthread".} +proc gettable*(L: PState, idx: int){.cdecl, dynlib: NAME, + importc: "lua_gettable".} +proc getfield*(L: Pstate, idx: int, k: cstring){.cdecl, dynlib: NAME, + importc: "lua_getfield".} +proc rawget*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_rawget".} +proc rawgeti*(L: PState, idx, n: int){.cdecl, dynlib: NAME, + importc: "lua_rawgeti".} +proc createtable*(L: PState, narr, nrec: int){.cdecl, dynlib: NAME, + importc: "lua_createtable".} +proc newuserdata*(L: PState, sz: size_t): Pointer{.cdecl, dynlib: NAME, + importc: "lua_newuserdata".} +proc getmetatable*(L: PState, objindex: int): int{.cdecl, dynlib: NAME, + importc: "lua_getmetatable".} +proc getfenv*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_getfenv".} +proc settable*(L: PState, idx: int){.cdecl, dynlib: NAME, + importc: "lua_settable".} +proc setfield*(L: PState, idx: int, k: cstring){.cdecl, dynlib: NAME, + importc: "lua_setfield".} +proc rawset*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_rawset".} +proc rawseti*(L: PState, idx, n: int){.cdecl, dynlib: NAME, + importc: "lua_rawseti".} +proc setmetatable*(L: PState, objindex: int): int{.cdecl, dynlib: NAME, + importc: "lua_setmetatable".} +proc setfenv*(L: PState, idx: int): int{.cdecl, dynlib: NAME, + importc: "lua_setfenv".} +proc call*(L: PState, nargs, nresults: int){.cdecl, dynlib: NAME, + importc: "lua_call".} +proc pcall*(L: PState, nargs, nresults, errf: int): int{.cdecl, dynlib: NAME, + importc: "lua_pcall".} +proc cpcall*(L: PState, func: CFunction, ud: Pointer): int{.cdecl, dynlib: NAME, + importc: "lua_cpcall".} +proc load*(L: PState, reader: Reader, dt: Pointer, chunkname: cstring): int{. + cdecl, dynlib: NAME, importc: "lua_load".} +proc dump*(L: PState, writer: Writer, data: Pointer): int{.cdecl, dynlib: NAME, + importc: "lua_dump".} +proc yield*(L: PState, nresults: int): int{.cdecl, dynlib: NAME, + importc: "lua_yield".} +proc resume*(L: PState, narg: int): int{.cdecl, dynlib: NAME, + importc: "lua_resume".} +proc status*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_status".} +proc gc*(L: PState, what, data: int): int{.cdecl, dynlib: NAME, + importc: "lua_gc".} +proc error*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_error".} +proc next*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_next".} +proc concat*(L: PState, n: int){.cdecl, dynlib: NAME, importc: "lua_concat".} +proc getallocf*(L: PState, ud: ptr Pointer): Alloc{.cdecl, dynlib: NAME, + importc: "lua_getallocf".} +proc setallocf*(L: PState, f: Alloc, ud: Pointer){.cdecl, dynlib: NAME, + importc: "lua_setallocf".} +# +#** 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: int) +proc newtable*(L: Pstate) +proc register*(L: PState, n: cstring, f: CFunction) +proc pushcfunction*(L: PState, f: CFunction) +proc strlen*(L: Pstate, i: int): size_t +proc isfunction*(L: PState, n: int): bool +proc istable*(L: PState, n: int): bool +proc islightuserdata*(L: PState, n: int): bool +proc isnil*(L: PState, n: int): bool +proc isboolean*(L: PState, n: int): bool +proc isthread*(L: PState, n: int): bool +proc isnone*(L: PState, n: int): bool +proc isnoneornil*(L: PState, n: int): bool +proc pushliteral*(L: PState, s: cstring) +proc setglobal*(L: PState, s: cstring) +proc getglobal*(L: PState, s: cstring) +proc tostring*(L: PState, i: int): cstring +# +#** compatibility macros and functions +# + +proc getregistry*(L: PState) +proc getgccount*(L: PState): int +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 + Debug*{.final.} = object # activation record + event*: int + name*: cstring # (n) + namewhat*: cstring # (n) `global', `local', `field', `method' + what*: cstring # (S) `Lua', `C', `main', `tail' + source*: cstring # (S) + currentline*: int # (l) + nups*: int # (u) number of upvalues + linedefined*: int # (S) + lastlinedefined*: int # (S) + short_src*: array[0..IDSIZE - 1, Char] # (S) + # private part + i_ci*: int # active function + + PDebug* = ptr Debug + Hook* = proc (L: PState, ar: PDebug){.cdecl.} + +# +#** ====================================================================== +#** Debug API +#** ====================================================================== +# + +proc getstack*(L: PState, level: int, ar: PDebug): int{.cdecl, dynlib: NAME, + importc: "lua_getstack".} +proc getinfo*(L: PState, what: cstring, ar: PDebug): int{.cdecl, dynlib: NAME, + importc: "lua_getinfo".} +proc getlocal*(L: PState, ar: PDebug, n: int): cstring{.cdecl, dynlib: NAME, + importc: "lua_getlocal".} +proc setlocal*(L: PState, ar: PDebug, n: int): cstring{.cdecl, dynlib: NAME, + importc: "lua_setlocal".} +proc getupvalue*(L: PState, funcindex: int, n: int): cstring{.cdecl, + dynlib: NAME, importc: "lua_getupvalue".} +proc setupvalue*(L: PState, funcindex: int, n: int): cstring{.cdecl, + dynlib: NAME, importc: "lua_setupvalue".} +proc sethook*(L: PState, func: Hook, mask: int, count: int): int{.cdecl, + dynlib: NAME, importc: "lua_sethook".} +proc gethook*(L: PState): Hook{.cdecl, dynlib: NAME, importc: "lua_gethook".} +proc gethookmask*(L: PState): int{.cdecl, dynlib: NAME, + importc: "lua_gethookmask".} +proc gethookcount*(L: PState): int{.cdecl, dynlib: NAME, + importc: "lua_gethookcount".} +# implementation + +proc upvalueindex(I: int): int = + Result = GLOBALSINDEX - i + +proc pop(L: PState, n: int) = + 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: int): size_t = + Result = objlen(L, i) + +proc isfunction(L: PState, n: int): bool = + Result = type(L, n) == TFUNCTION + +proc istable(L: PState, n: int): bool = + Result = type(L, n) == TTABLE + +proc islightuserdata(L: PState, n: int): bool = + Result = type(L, n) == TLIGHTUSERDATA + +proc isnil(L: PState, n: int): bool = + Result = type(L, n) == TNIL + +proc isboolean(L: PState, n: int): bool = + Result = type(L, n) == TBOOLEAN + +proc isthread(L: PState, n: int): bool = + Result = type(L, n) == TTHREAD + +proc isnone(L: PState, n: int): bool = + Result = type(L, n) == TNONE + +proc isnoneornil(L: PState, n: int): bool = + Result = type(L, n) <= 0 + +proc pushliteral(L: PState, s: cstring) = + pushlstring(L, s, len(s)) + +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: int): cstring = + Result = tolstring(L, i, nil) + +proc getregistry(L: PState) = + pushvalue(L, REGISTRYINDEX) + +proc getgccount(L: PState): int = + Result = gc(L, GCCOUNT, 0) diff --git a/lib/newwrap/lua/lualib.nim b/lib/newwrap/lua/lualib.nim new file mode 100644 index 000000000..c2c6cd97b --- /dev/null +++ b/lib/newwrap/lua/lualib.nim @@ -0,0 +1,74 @@ +#***************************************************************************** +# * * +# * 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 + + +const + COLIBNAME* = "coroutine" + TABLIBNAME* = "table" + IOLIBNAME* = "io" + OSLIBNAME* = "os" + STRLINAME* = "string" + MATHLIBNAME* = "math" + DBLIBNAME* = "debug" + LOADLIBNAME* = "package" + +proc open_base*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_base".} +proc open_table*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_table".} +proc open_io*(L: PState): cint{.cdecl, dynlib: LIB_NAME, importc: "luaopen_io".} +proc open_string*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_string".} +proc open_math*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_math".} +proc open_debug*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_debug".} +proc open_package*(L: PState): cint{.cdecl, dynlib: LIB_NAME, + importc: "luaopen_package".} +proc L_openlibs*(L: PState){.cdecl, dynlib: LIB_NAME, importc: "luaL_openlibs".} + # compatibility code +proc baselibopen*(L: PState): Bool +proc tablibopen*(L: PState): Bool +proc iolibopen*(L: PState): Bool +proc strlibopen*(L: PState): Bool +proc mathlibopen*(L: PState): Bool +proc dblibopen*(L: PState): Bool +# implementation + +proc baselibopen(L: PState): Bool = + Result = open_base(L) != 0'i32 + +proc tablibopen(L: PState): Bool = + Result = open_table(L) != 0'i32 + +proc iolibopen(L: PState): Bool = + Result = open_io(L) != 0'i32 + +proc strlibopen(L: PState): Bool = + Result = open_string(L) != 0'i32 + +proc mathlibopen(L: PState): Bool = + Result = open_math(L) != 0'i32 + +proc dblibopen(L: PState): Bool = + Result = open_debug(L) != 0'i32 diff --git a/lib/newwrap/mysql.nim b/lib/newwrap/mysql.nim new file mode 100644 index 000000000..5f6468faa --- /dev/null +++ b/lib/newwrap/mysql.nim @@ -0,0 +1,1082 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +{.deadCodeElim: on.} +when defined(Unix): + const + lib = "libmysqlclient.so.15" +when defined(Windows): + const + lib = "libmysql.dll" +type + my_bool* = bool + Pmy_bool* = ptr my_bool + PVIO* = Pointer + Pgptr* = ptr gptr + gptr* = cstring + Pmy_socket* = ptr my_socket + my_socket* = cint + PPByte* = pointer + cuint* = cint + +# ------------ Start of declaration in "mysql_com.h" --------------------- +# +# ** Common definition between mysql server & client +# +# Field/table name length + +const + NAME_LEN* = 64 + HOSTNAME_LENGTH* = 60 + USERNAME_LENGTH* = 16 + SERVER_VERSION_LENGTH* = 60 + SQLSTATE_LENGTH* = 5 + LOCAL_HOST* = "localhost" + LOCAL_HOST_NAMEDPIPE* = '.' + +const + NAMEDPIPE* = "MySQL" + SERVICENAME* = "MySQL" + +type + enum_server_command* = enum + COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, COM_CREATE_DB, + COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, COM_PROCESS_INFO, + COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, COM_TIME, + COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, COM_TABLE_DUMP, + COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_STMT_PREPARE, COM_STMT_EXECUTE, + COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, COM_STMT_RESET, COM_SET_OPTION, + COM_STMT_FETCH, COM_END + +const + SCRAMBLE_LENGTH* = 20 # Length of random string sent by server on handshake; + # this is also length of obfuscated password, + # recieved from client + SCRAMBLE_LENGTH_323* = 8 # length of password stored in the db: + # new passwords are preceeded with '*' + SCRAMBLED_PASSWORD_CHAR_LENGTH* = SCRAMBLE_LENGTH * 2 + 1 + SCRAMBLED_PASSWORD_CHAR_LENGTH_323* = SCRAMBLE_LENGTH_323 * 2 + NOT_NULL_FLAG* = 1 # Field can't be NULL + PRI_KEY_FLAG* = 2 # Field is part of a primary key + UNIQUE_KEY_FLAG* = 4 # Field is part of a unique key + MULTIPLE_KEY_FLAG* = 8 # Field is part of a key + BLOB_FLAG* = 16 # Field is a blob + UNSIGNED_FLAG* = 32 # Field is unsigned + ZEROFILL_FLAG* = 64 # Field is zerofill + BINARY_FLAG* = 128 # Field is binary + # The following are only sent to new clients + ENUM_FLAG* = 256 # field is an enum + AUTO_INCREMENT_FLAG* = 512 # field is a autoincrement field + TIMESTAMP_FLAG* = 1024 # Field is a timestamp + SET_FLAG* = 2048 # field is a set + NO_DEFAULT_VALUE_FLAG* = 4096 # Field doesn't have default value + NUM_FLAG* = 32768 # Field is num (for clients) + PART_KEY_FLAG* = 16384 # Intern; Part of some key + GROUP_FLAG* = 32768 # Intern: Group field + UNIQUE_FLAG* = 65536 # Intern: Used by sql_yacc + BINCMP_FLAG* = 131072 # Intern: Used by sql_yacc + REFRESH_GRANT* = 1 # Refresh grant tables + REFRESH_LOG* = 2 # Start on new log file + REFRESH_TABLES* = 4 # close all tables + REFRESH_HOSTS* = 8 # Flush host cache + REFRESH_STATUS* = 16 # Flush status variables + REFRESH_THREADS* = 32 # Flush thread cache + REFRESH_SLAVE* = 64 # Reset master info and restart slave thread + REFRESH_MASTER* = 128 # Remove all bin logs in the index and truncate the index + # The following can't be set with mysql_refresh() + REFRESH_READ_LOCK* = 16384 # Lock tables for read + REFRESH_FAST* = 32768 # Intern flag + REFRESH_QUERY_CACHE* = 65536 # RESET (remove all queries) from query cache + REFRESH_QUERY_CACHE_FREE* = 0x00020000 # pack query cache + REFRESH_DES_KEY_FILE* = 0x00040000 + REFRESH_USER_RESOURCES* = 0x00080000 + CLIENT_LONG_PASSWORD* = 1 # new more secure passwords + CLIENT_FOUND_ROWS* = 2 # Found instead of affected rows + CLIENT_LONG_FLAG* = 4 # Get all column flags + CLIENT_CONNECT_WITH_DB* = 8 # One can specify db on connect + CLIENT_NO_SCHEMA* = 16 # Don't allow database.table.column + CLIENT_COMPRESS* = 32 # Can use compression protocol + CLIENT_ODBC* = 64 # Odbc client + CLIENT_LOCAL_FILES* = 128 # Can use LOAD DATA LOCAL + CLIENT_IGNORE_SPACE* = 256 # Ignore spaces before '(' + CLIENT_PROTOCOL_41* = 512 # New 4.1 protocol + CLIENT_INTERACTIVE* = 1024 # This is an interactive client + CLIENT_SSL* = 2048 # Switch to SSL after handshake + CLIENT_IGNORE_SIGPIPE* = 4096 # IGNORE sigpipes + CLIENT_TRANSACTIONS* = 8192 # Client knows about transactions + CLIENT_RESERVED* = 16384 # Old flag for 4.1 protocol + CLIENT_SECURE_CONNECTION* = 32768 # New 4.1 authentication + CLIENT_MULTI_STATEMENTS* = 65536 # Enable/disable multi-stmt support + CLIENT_MULTI_RESULTS* = 131072 # Enable/disable multi-results + CLIENT_REMEMBER_OPTIONS*: int = 1 shl 31 + SERVER_STATUS_IN_TRANS* = 1 # Transaction has started + SERVER_STATUS_AUTOCOMMIT* = 2 # Server in auto_commit mode + SERVER_STATUS_MORE_RESULTS* = 4 # More results on server + SERVER_MORE_RESULTS_EXISTS* = 8 # Multi query - next query exists + SERVER_QUERY_NO_GOOD_INDEX_USED* = 16 + SERVER_QUERY_NO_INDEX_USED* = 32 # The server was able to fulfill the clients request and opened a + # read-only non-scrollable cursor for a query. This flag comes + # in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. + SERVER_STATUS_CURSOR_EXISTS* = 64 # This flag is sent when a read-only cursor is exhausted, in reply to + # COM_STMT_FETCH command. + SERVER_STATUS_LAST_ROW_SENT* = 128 + SERVER_STATUS_DB_DROPPED* = 256 # A database was dropped + SERVER_STATUS_NO_BACKSLASH_ESCAPES* = 512 + ERRMSG_SIZE* = 200 + NET_READ_TIMEOUT* = 30 # Timeout on read + NET_WRITE_TIMEOUT* = 60 # Timeout on write + NET_WAIT_TIMEOUT* = 8 * 60 * 60 # Wait for new query + ONLY_KILL_QUERY* = 1 + +const + MAX_TINYINT_WIDTH* = 3 # Max width for a TINY w.o. sign + MAX_SMALLINT_WIDTH* = 5 # Max width for a SHORT w.o. sign + MAX_MEDIUMINT_WIDTH* = 8 # Max width for a INT24 w.o. sign + MAX_INT_WIDTH* = 10 # Max width for a LONG w.o. sign + MAX_BIGINT_WIDTH* = 20 # Max width for a LONGLONG + MAX_CHAR_WIDTH* = 255 # Max length for a CHAR colum + MAX_BLOB_WIDTH* = 8192 # Default width for blob + +type + Pst_net* = ptr st_net + st_net*{.final.} = object + vio*: PVio + buff*: cstring + buff_end*: cstring + write_pos*: cstring + read_pos*: cstring + fd*: my_socket # For Perl DBI/dbd + max_packet*: int + max_packet_size*: int + pkt_nr*: cuint + compress_pkt_nr*: cuint + write_timeout*: cuint + read_timeout*: cuint + retry_count*: cuint + fcntl*: cint + compress*: my_bool # The following variable is set if we are doing several queries in one + # command ( as in LOAD TABLE ... FROM MASTER ), + # and do not want to confuse the client with OK at the wrong time + remain_in_buf*: int + len*: int + buf_length*: int + where_b*: int + return_status*: ptr cint + reading_or_writing*: char + save_char*: cchar + no_send_ok*: my_bool # For SPs and other things that do multiple stmts + no_send_eof*: my_bool # For SPs' first version read-only cursors + no_send_error*: my_bool # Set if OK packet is already sent, and + # we do not need to send error messages + # Pointer to query object in query cache, do not equal NULL (0) for + # queries in cache that have not stored its results yet + # $endif + last_error*: array[0..(ERRMSG_SIZE) - 1, char] + sqlstate*: array[0..(SQLSTATE_LENGTH + 1) - 1, char] + last_errno*: cuint + error*: char + query_cache_query*: gptr + report_error*: my_bool # We should report error (we have unreported error) + return_errno*: my_bool + + NET* = st_net + PNET* = ptr NET + +const + packet_error* = - 1 + +type + enum_field_types* = enum # For backward compatibility + TYPE_DECIMAL, TYPE_TINY, TYPE_SHORT, TYPE_LONG, TYPE_FLOAT, TYPE_DOUBLE, + TYPE_NULL, TYPE_TIMESTAMP, TYPE_LONGLONG, TYPE_INT24, TYPE_DATE, TYPE_TIME, + TYPE_DATETIME, TYPE_YEAR, TYPE_NEWDATE, TYPE_VARCHAR, TYPE_BIT, + TYPE_NEWDECIMAL = 246, TYPE_ENUM = 247, TYPE_SET = 248, + TYPE_TINY_BLOB = 249, TYPE_MEDIUM_BLOB = 250, TYPE_LONG_BLOB = 251, + TYPE_BLOB = 252, TYPE_VAR_STRING = 253, TYPE_STRING = 254, + TYPE_GEOMETRY = 255 + +const + CLIENT_MULTI_QUERIES* = CLIENT_MULTI_STATEMENTS + FIELD_TYPE_DECIMAL* = TYPE_DECIMAL + FIELD_TYPE_NEWDECIMAL* = TYPE_NEWDECIMAL + FIELD_TYPE_TINY* = TYPE_TINY + FIELD_TYPE_SHORT* = TYPE_SHORT + FIELD_TYPE_LONG* = TYPE_LONG + FIELD_TYPE_FLOAT* = TYPE_FLOAT + FIELD_TYPE_DOUBLE* = TYPE_DOUBLE + FIELD_TYPE_NULL* = TYPE_NULL + FIELD_TYPE_TIMESTAMP* = TYPE_TIMESTAMP + FIELD_TYPE_LONGLONG* = TYPE_LONGLONG + FIELD_TYPE_INT24* = TYPE_INT24 + FIELD_TYPE_DATE* = TYPE_DATE + FIELD_TYPE_TIME* = TYPE_TIME + FIELD_TYPE_DATETIME* = TYPE_DATETIME + FIELD_TYPE_YEAR* = TYPE_YEAR + FIELD_TYPE_NEWDATE* = TYPE_NEWDATE + FIELD_TYPE_ENUM* = TYPE_ENUM + FIELD_TYPE_SET* = TYPE_SET + FIELD_TYPE_TINY_BLOB* = TYPE_TINY_BLOB + FIELD_TYPE_MEDIUM_BLOB* = TYPE_MEDIUM_BLOB + FIELD_TYPE_LONG_BLOB* = TYPE_LONG_BLOB + FIELD_TYPE_BLOB* = TYPE_BLOB + FIELD_TYPE_VAR_STRING* = TYPE_VAR_STRING + FIELD_TYPE_STRING* = TYPE_STRING + FIELD_TYPE_CHAR* = TYPE_TINY + FIELD_TYPE_INTERVAL* = TYPE_ENUM + FIELD_TYPE_GEOMETRY* = TYPE_GEOMETRY + FIELD_TYPE_BIT* = TYPE_BIT # Shutdown/kill enums and constants + # Bits for THD::killable. + SHUTDOWN_KILLABLE_CONNECT* = chr(1 shl 0) + SHUTDOWN_KILLABLE_TRANS* = chr(1 shl 1) + SHUTDOWN_KILLABLE_LOCK_TABLE* = chr(1 shl 2) + SHUTDOWN_KILLABLE_UPDATE* = chr(1 shl 3) + +type + enum_shutdown_level* = enum + SHUTDOWN_DEFAULT = 0, SHUTDOWN_WAIT_CONNECTIONS = 1, + SHUTDOWN_WAIT_TRANSACTIONS = 2, SHUTDOWN_WAIT_UPDATES = 8, + SHUTDOWN_WAIT_ALL_BUFFERS = 16, SHUTDOWN_WAIT_CRITICAL_BUFFERS = 17, + KILL_QUERY = 254, KILL_CONNECTION = 255 + enum_cursor_type* = enum # options for mysql_set_option + CURSOR_TYPE_NO_CURSOR = 0, CURSOR_TYPE_READ_ONLY = 1, + CURSOR_TYPE_FOR_UPDATE = 2, CURSOR_TYPE_SCROLLABLE = 4 + enum_mysql_set_option* = enum + OPTION_MULTI_STATEMENTS_ON, OPTION_MULTI_STATEMENTS_OFF + +proc net_new_transaction*(net: st_net): st_net +proc my_net_init*(net: PNET, vio: PVio): my_bool{.cdecl, dynlib: lib, + importc: "my_net_init".} +proc my_net_local_init*(net: PNET){.cdecl, dynlib: lib, + importc: "my_net_local_init".} +proc net_end*(net: PNET){.cdecl, dynlib: lib, importc: "net_end".} +proc net_clear*(net: PNET){.cdecl, dynlib: lib, importc: "net_clear".} +proc net_realloc*(net: PNET, len: int): my_bool{.cdecl, dynlib: lib, + importc: "net_realloc".} +proc net_flush*(net: PNET): my_bool{.cdecl, dynlib: lib, importc: "net_flush".} +proc my_net_write*(net: PNET, packet: cstring, length: int): my_bool{.cdecl, + dynlib: lib, importc: "my_net_write".} +proc net_write_command*(net: PNET, command: char, header: cstring, + head_len: int, packet: cstring, length: int): my_bool{. + cdecl, dynlib: lib, importc: "net_write_command".} +proc net_real_write*(net: PNET, packet: cstring, length: int): cint{.cdecl, + dynlib: lib, importc: "net_real_write".} +proc my_net_read*(net: PNET): int{.cdecl, dynlib: lib, importc: "my_net_read".} + # The following function is not meant for normal usage + # Currently it's used internally by manager.c +type + Psockaddr* = ptr sockaddr + sockaddr*{.final.} = object # undefined structure + +proc my_connect*(s: my_socket, name: Psockaddr, namelen: cuint, timeout: cuint): cint{. + cdecl, dynlib: lib, importc: "my_connect".} +type + Prand_struct* = ptr rand_struct + rand_struct*{.final.} = object # The following is for user defined functions + seed1*: int + seed2*: int + max_value*: int + max_value_dbl*: cdouble + + Item_result* = enum + STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT + PItem_result* = ptr Item_result + Pst_udf_args* = ptr st_udf_args + st_udf_args*{.final.} = object + arg_count*: cuint # Number of arguments + arg_type*: PItem_result # Pointer to item_results + args*: cstringArray # Pointer to item_results + lengths*: ptr int # Length of string arguments + maybe_null*: cstring # Length of string arguments + attributes*: cstringArray # Pointer to attribute name + attribute_lengths*: ptr int # Length of attribute arguments + + UDF_ARGS* = st_udf_args + PUDF_ARGS* = ptr UDF_ARGS # This holds information about the result + Pst_udf_init* = ptr st_udf_init + st_udf_init*{.final.} = object + maybe_null*: my_bool # 1 if function can return NULL + decimals*: cuint # for real functions + max_length*: int # For string functions + theptr*: cstring # free pointer for function data + const_item*: my_bool # free pointer for function data + + UDF_INIT* = st_udf_init + PUDF_INIT* = ptr UDF_INIT # Constants when using compression + +const + NET_HEADER_SIZE* = 4 # standard header size + COMP_HEADER_SIZE* = 3 # compression header extra size + # Prototypes to password functions + # These functions are used for authentication by client and server and + # implemented in sql/password.c + +proc randominit*(para1: Prand_struct, seed1: int, seed2: int){.cdecl, + dynlib: lib, importc: "randominit".} +proc my_rnd*(para1: Prand_struct): cdouble{.cdecl, dynlib: lib, + importc: "my_rnd".} +proc create_random_string*(fto: cstring, len: cuint, rand_st: Prand_struct){. + cdecl, dynlib: lib, importc: "create_random_string".} +proc hash_password*(fto: int, password: cstring, password_len: cuint){.cdecl, + dynlib: lib, importc: "hash_password".} +proc make_scrambled_password_323*(fto: cstring, password: cstring){.cdecl, + dynlib: lib, importc: "make_scrambled_password_323".} +proc scramble_323*(fto: cstring, message: cstring, password: cstring){.cdecl, + dynlib: lib, importc: "scramble_323".} +proc check_scramble_323*(para1: cstring, message: cstring, salt: int): my_bool{. + cdecl, dynlib: lib, importc: "check_scramble_323".} +proc get_salt_from_password_323*(res: ptr int, password: cstring){.cdecl, + dynlib: lib, importc: "get_salt_from_password_323".} +proc make_password_from_salt_323*(fto: cstring, salt: ptr int){.cdecl, + dynlib: lib, importc: "make_password_from_salt_323".} +proc octet2hex*(fto: cstring, str: cstring, length: cuint): cstring{.cdecl, + dynlib: lib, importc: "octet2hex".} +proc make_scrambled_password*(fto: cstring, password: cstring){.cdecl, + dynlib: lib, importc: "make_scrambled_password".} +proc scramble*(fto: cstring, message: cstring, password: cstring){.cdecl, + dynlib: lib, importc: "scramble".} +proc check_scramble*(reply: cstring, message: cstring, hash_stage2: pointer): my_bool{. + cdecl, dynlib: lib, importc: "check_scramble".} +proc get_salt_from_password*(res: pointer, password: cstring){.cdecl, + dynlib: lib, importc: "get_salt_from_password".} +proc make_password_from_salt*(fto: cstring, hash_stage2: pointer){.cdecl, + dynlib: lib, importc: "make_password_from_salt".} + # end of password.c +proc get_tty_password*(opt_message: cstring): cstring{.cdecl, dynlib: lib, + importc: "get_tty_password".} +proc errno_to_sqlstate*(errno: cuint): cstring{.cdecl, dynlib: lib, + importc: "mysql_errno_to_sqlstate".} + # Some other useful functions +proc modify_defaults_file*(file_location: cstring, option: cstring, + option_value: cstring, section_name: cstring, + remove_option: cint): cint{.cdecl, dynlib: lib, + importc: "load_defaults".} +proc load_defaults*(conf_file: cstring, groups: cstringArray, argc: ptr cint, + argv: ptr cstringArray): cint{.cdecl, dynlib: lib, + importc: "load_defaults".} +proc my_init*(): my_bool{.cdecl, dynlib: lib, importc: "my_init".} +proc my_thread_init*(): my_bool{.cdecl, dynlib: lib, importc: "my_thread_init".} +proc my_thread_end*(){.cdecl, dynlib: lib, importc: "my_thread_end".} +const + NULL_LENGTH*: int = int(not (0)) # For net_store_length + +const + STMT_HEADER* = 4 + LONG_DATA_HEADER* = 6 # ------------ Stop of declaration in "mysql_com.h" ----------------------- + # $include "mysql_time.h" + # $include "mysql_version.h" + # $include "typelib.h" + # $include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ + # var + # mysql_port : cuint;cvar;external; + # mysql_unix_port : Pchar;cvar;external; + +const + CLIENT_NET_READ_TIMEOUT* = 365 * 24 * 3600 # Timeout on read + CLIENT_NET_WRITE_TIMEOUT* = 365 * 24 * 3600 # Timeout on write + +type + Pst_mysql_field* = ptr st_mysql_field + st_mysql_field*{.final.} = object + name*: cstring # Name of column + org_name*: cstring # Original column name, if an alias + table*: cstring # Table of column if column was a field + org_table*: cstring # Org table name, if table was an alias + db*: cstring # Database for table + catalog*: cstring # Catalog for table + def*: cstring # Default value (set by mysql_list_fields) + len*: int # Width of column (create length) + max_length*: int # Max width for selected set + name_length*: cuint + org_name_length*: cuint + table_length*: cuint + org_table_length*: cuint + db_length*: cuint + catalog_length*: cuint + def_length*: cuint + flags*: cuint # Div flags + decimals*: cuint # Number of decimals in field + charsetnr*: cuint # Character set + ftype*: enum_field_types # Type of field. See mysql_com.h for types + + FIELD* = st_mysql_field + PFIELD* = ptr FIELD + PROW* = ptr ROW # return data as array of strings + ROW* = cstringArray + PFIELD_OFFSET* = ptr FIELD_OFFSET # offset to current field + FIELD_OFFSET* = cuint + +proc IS_PRI_KEY*(n: int32): bool +proc IS_NOT_NULL*(n: int32): bool +proc IS_BLOB*(n: int32): bool +proc IS_NUM*(t: enum_field_types): bool +proc INTERNAL_NUM_FIELD*(f: Pst_mysql_field): bool +proc IS_NUM_FIELD*(f: Pst_mysql_field): bool +type + my_ulonglong* = int64 + Pmy_ulonglong* = ptr my_ulonglong + +const + COUNT_ERROR* = not (my_ulonglong(0)) + +type + Pst_mysql_rows* = ptr st_mysql_rows + st_mysql_rows*{.final.} = object + next*: Pst_mysql_rows # list of rows + data*: ROW + len*: int + + ROWS* = st_mysql_rows + PROWS* = ptr ROWS + PROW_OFFSET* = ptr ROW_OFFSET # offset to current row + ROW_OFFSET* = ROWS # ------------ Start of declaration in "my_alloc.h" -------------------- + # $include "my_alloc.h" + +const + ALLOC_MAX_BLOCK_TO_DROP* = 4096 + ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP* = 10 # struct for once_alloc (block) + +type + Pst_used_mem* = ptr st_used_mem + st_used_mem*{.final.} = object + next*: Pst_used_mem # Next block in use + left*: cuint # memory left in block + size*: cuint # size of block + + USED_MEM* = st_used_mem + PUSED_MEM* = ptr USED_MEM + Pst_mem_root* = ptr st_mem_root + st_mem_root*{.final.} = object + free*: PUSED_MEM # blocks with free memory in it + used*: PUSED_MEM # blocks almost without free memory + pre_alloc*: PUSED_MEM # preallocated block + min_malloc*: cuint # if block have less memory it will be put in 'used' list + block_size*: cuint # initial block size + block_num*: cuint # allocated blocks counter + # first free block in queue test counter (if it exceed + # MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) + first_block_usage*: cuint + error_handler*: proc (){.cdecl.} + + MEM_ROOT* = st_mem_root + PMEM_ROOT* = ptr MEM_ROOT # ------------ Stop of declaration in "my_alloc.h" ---------------------- + +type + Pst_mysql_data* = ptr st_mysql_data + st_mysql_data*{.final.} = object + rows*: my_ulonglong + fields*: cuint + data*: PROWS + alloc*: MEM_ROOT + prev_ptr*: ptr PROWS + + DATA* = st_mysql_data + PDATA* = ptr DATA + option* = enum + OPT_CONNECT_TIMEOUT, OPT_COMPRESS, OPT_NAMED_PIPE, INIT_COMMAND, + READ_DEFAULT_FILE, READ_DEFAULT_GROUP, SET_CHARSET_DIR, SET_CHARSET_NAME, + OPT_LOCAL_INFILE, OPT_PROTOCOL, SHARED_MEMORY_BASE_NAME, OPT_READ_TIMEOUT, + OPT_WRITE_TIMEOUT, OPT_USE_RESULT, OPT_USE_REMOTE_CONNECTION, + OPT_USE_EMBEDDED_CONNECTION, OPT_GUESS_CONNECTION, SET_CLIENT_IP, + SECURE_AUTH, REPORT_DATA_TRUNCATION, OPT_RECONNECT + +const + MAX_MYSQL_MANAGER_ERR* = 256 + MAX_MYSQL_MANAGER_MSG* = 256 + MANAGER_OK* = 200 + MANAGER_INFO* = 250 + MANAGER_ACCESS* = 401 + MANAGER_CLIENT_ERR* = 450 + MANAGER_INTERNAL_ERR* = 500 + +type + st_dynamic_array*{.final.} = object + buffer*: cstring + elements*: cuint + max_element*: cuint + alloc_increment*: cuint + size_of_element*: cuint + + DYNAMIC_ARRAY* = st_dynamic_array + Pst_dynamic_array* = ptr st_dynamic_array + Pst_mysql_options* = ptr st_mysql_options + st_mysql_options*{.final.} = object + connect_timeout*: cuint + read_timeout*: cuint + write_timeout*: cuint + port*: cuint + protocol*: cuint + client_flag*: int + host*: cstring + user*: cstring + password*: cstring + unix_socket*: cstring + db*: cstring + init_commands*: Pst_dynamic_array + my_cnf_file*: cstring + my_cnf_group*: cstring + charset_dir*: cstring + charset_name*: cstring + ssl_key*: cstring # PEM key file + ssl_cert*: cstring # PEM cert file + ssl_ca*: cstring # PEM CA file + ssl_capath*: cstring # PEM directory of CA-s? + ssl_cipher*: cstring # cipher to use + shared_memory_base_name*: cstring + max_allowed_packet*: int + use_ssl*: my_bool # if to use SSL or not + compress*: my_bool + named_pipe*: my_bool # On connect, find out the replication role of the server, and + # establish connections to all the peers + rpl_probe*: my_bool # Each call to mysql_real_query() will parse it to tell if it is a read + # or a write, and direct it to the slave or the master + rpl_parse*: my_bool # If set, never read from a master, only from slave, when doing + # a read that is replication-aware + no_master_reads*: my_bool + separate_thread*: my_bool + methods_to_use*: option + client_ip*: cstring + secure_auth*: my_bool # Refuse client connecting to server if it uses old (pre-4.1.1) protocol + report_data_truncation*: my_bool # 0 - never report, 1 - always report (default) + # function pointers for local infile support + local_infile_init*: proc (para1: var pointer, para2: cstring, para3: pointer): cint{. + cdecl.} + local_infile_read*: proc (para1: pointer, para2: cstring, para3: cuint): cint + local_infile_end*: proc (para1: pointer) + local_infile_error*: proc (para1: pointer, para2: cstring, para3: cuint): cint + local_infile_userdata*: pointer + + status* = enum + STATUS_READY, STATUS_GET_RESULT, STATUS_USE_RESULT + protocol_type* = enum # There are three types of queries - the ones that have to go to + # the master, the ones that go to a slave, and the adminstrative + # type which must happen on the pivot connectioin + PROTOCOL_DEFAULT, PROTOCOL_TCP, PROTOCOL_SOCKET, PROTOCOL_PIPE, + PROTOCOL_MEMORY + rpl_type* = enum + RPL_MASTER, RPL_SLAVE, RPL_ADMIN + charset_info_st*{.final.} = object + number*: cuint + primary_number*: cuint + binary_number*: cuint + state*: cuint + csname*: cstring + name*: cstring + comment*: cstring + tailoring*: cstring + ftype*: cstring + to_lower*: cstring + to_upper*: cstring + sort_order*: cstring + contractions*: ptr int16 + sort_order_big*: ptr ptr int16 + tab_to_uni*: ptr int16 + tab_from_uni*: pointer # was ^MY_UNI_IDX + state_map*: cstring + ident_map*: cstring + strxfrm_multiply*: cuint + mbminlen*: cuint + mbmaxlen*: cuint + min_sort_char*: int16 + max_sort_char*: int16 + escape_with_backslash_is_dangerous*: my_bool + cset*: pointer # was ^MY_CHARSET_HANDLER + coll*: pointer # was ^MY_COLLATION_HANDLER; + + CHARSET_INFO* = charset_info_st + Pcharset_info_st* = ptr charset_info_st + Pcharacter_set* = ptr character_set + character_set*{.final.} = object + number*: cuint + state*: cuint + csname*: cstring + name*: cstring + comment*: cstring + dir*: cstring + mbminlen*: cuint + mbmaxlen*: cuint + + MY_CHARSET_INFO* = character_set + PMY_CHARSET_INFO* = ptr MY_CHARSET_INFO + Pst_mysql_methods* = ptr st_mysql_methods + Pst_mysql* = ptr st_mysql + st_mysql*{.final.} = object + net*: NET # Communication parameters + connector_fd*: gptr # ConnectorFd for SSL + host*: cstring + user*: cstring + passwd*: cstring + unix_socket*: cstring + server_version*: cstring + host_info*: cstring + info*: cstring + db*: cstring + charset*: Pcharset_info_st + fields*: PFIELD + field_alloc*: MEM_ROOT + affected_rows*: my_ulonglong + insert_id*: my_ulonglong # id if insert on table with NEXTNR + extra_info*: my_ulonglong # Used by mysqlshow, not used by mysql 5.0 and up + thread_id*: int # Id for connection in server + packet_length*: int + port*: cuint + client_flag*: int + server_capabilities*: int + protocol_version*: cuint + field_count*: cuint + server_status*: cuint + server_language*: cuint + warning_count*: cuint + options*: st_mysql_options + status*: status + free_me*: my_bool # If free in mysql_close + reconnect*: my_bool # set to 1 if automatic reconnect + scramble*: array[0..(SCRAMBLE_LENGTH + 1) - 1, char] # session-wide random string + # Set if this is the original connection, not a master or a slave we have + # added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave() + rpl_pivot*: my_bool # Pointers to the master, and the next slave connections, points to + # itself if lone connection. + master*: Pst_mysql + next_slave*: Pst_mysql + last_used_slave*: Pst_mysql # needed for round-robin slave pick + last_used_con*: Pst_mysql # needed for send/read/store/use result to work correctly with replication + stmts*: Pointer # was PList, list of all statements + methods*: Pst_mysql_methods + thd*: pointer # Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag + # from mysql_stmt_close if close had to cancel result set of this object. + unbuffered_fetch_owner*: Pmy_bool + + * = st_mysql + P* = ptr + Pst_mysql_res* = ptr st_mysql_res + st_mysql_res*{.final.} = object + row_count*: my_ulonglong + fields*: PFIELD + data*: PDATA + data_cursor*: PROWS + lengths*: ptr int # column lengths of current row + handle*: P # for unbuffered reads + field_alloc*: MEM_ROOT + field_count*: cuint + current_field*: cuint + row*: ROW # If unbuffered read + current_row*: ROW # buffer to current row + eof*: my_bool # Used by mysql_fetch_row + unbuffered_fetch_cancelled*: my_bool # mysql_stmt_close() had to cancel this result + methods*: Pst_mysql_methods + + RES* = st_mysql_res + PRES* = ptr RES + Pst_mysql_stmt* = ptr st_mysql_stmt + PSTMT* = ptr STMT + st_mysql_methods*{.final.} = object + read_query_result*: proc (: P): my_bool{.cdecl.} + advanced_command*: proc (: P, command: enum_server_command, header: cstring, + header_length: int, arg: cstring, arg_length: int, + skip_check: my_bool): my_bool + read_rows*: proc (: P, fields: PFIELD, fields: cuint): PDATA + use_result*: proc (: P): PRES + fetch_lengths*: proc (fto: ptr int, column: ROW, field_count: cuint) + flush_use_result*: proc (: P) + list_fields*: proc (: P): PFIELD + read_prepare_result*: proc (: P, stmt: PSTMT): my_bool + stmt_execute*: proc (stmt: PSTMT): cint + read_binary_rows*: proc (stmt: PSTMT): cint + unbuffered_fetch*: proc (: P, row: cstringArray): cint + free_embedded_thd*: proc (: P) + read_statistics*: proc (: P): cstring + next_result*: proc (: P): my_bool + read_change_user_result*: proc (: P, buff: cstring, passwd: cstring): cint + read_rowsfrom_cursor*: proc (stmt: PSTMT): cint + + METHODS* = st_mysql_methods + PMETHODS* = ptr METHODS + Pst_mysql_manager* = ptr st_mysql_manager + st_mysql_manager*{.final.} = object + net*: NET + host*: cstring + user*: cstring + passwd*: cstring + port*: cuint + free_me*: my_bool + eof*: my_bool + cmd_status*: cint + last_errno*: cint + net_buf*: cstring + net_buf_pos*: cstring + net_data_end*: cstring + net_buf_size*: cint + last_error*: array[0..(MAX_MYSQL_MANAGER_ERR) - 1, char] + + MANAGER* = st_mysql_manager + PMANAGER* = ptr MANAGER + Pst_mysql_parameters* = ptr st_mysql_parameters + st_mysql_parameters*{.final.} = object + p_max_allowed_packet*: ptr int + p_net_buffer_length*: ptr int + + PARAMETERS* = st_mysql_parameters + PPARAMETERS* = ptr PARAMETERS + enum_mysql_stmt_state* = enum + STMT_INIT_DONE = 1, STMT_PREPARE_DONE, STMT_EXECUTE_DONE, STMT_FETCH_DONE + Pst_mysql_bind* = ptr st_mysql_bind + st_mysql_bind*{.final.} = object + len*: int # output length pointer + is_null*: Pmy_bool # Pointer to null indicator + buffer*: pointer # buffer to get/put data + error*: pmy_bool # set this if you want to track data truncations happened during fetch + buffer_type*: enum_field_types # buffer type + buffer_length*: int # buffer length, must be set for str/binary + # Following are for internal use. Set by mysql_stmt_bind_param + row_ptr*: ptr byte # for the current data position + offset*: int # offset position for char/binary fetch + length_value*: int # Used if length is 0 + param_number*: cuint # For null count and error messages + pack_length*: cuint # Internal length for packed data + error_value*: my_bool # used if error is 0 + is_unsigned*: my_bool # set if integer type is unsigned + long_data_used*: my_bool # If used with mysql_send_long_data + is_null_value*: my_bool # Used if is_null is 0 + store_param_func*: proc (net: PNET, param: Pst_mysql_bind){.cdecl.} + fetch_result*: proc (para1: Pst_mysql_bind, para2: PFIELD, row: PPbyte) + skip_result*: proc (para1: Pst_mysql_bind, para2: PFIELD, row: PPbyte) + + BIND* = st_mysql_bind + PBIND* = ptr BIND # statement handler + st_mysql_stmt*{.final.} = object + mem_root*: MEM_ROOT # root allocations + *: P # connection handle + params*: PBIND # input parameters + `bind`*: PBIND # input parameters + fields*: PFIELD # result set metadata + result*: DATA # cached result set + data_cursor*: PROWS # current row in cached result + affected_rows*: my_ulonglong # copy of mysql->affected_rows after statement execution + insert_id*: my_ulonglong + read_row_func*: proc (stmt: Pst_mysql_stmt, row: PPbyte): cint{.cdecl.} + stmt_id*: int # Id for prepared statement + flags*: int # i.e. type of cursor to open + prefetch_rows*: int # number of rows per one COM_FETCH + server_status*: cuint # Copied from mysql->server_status after execute/fetch to know + # server-side cursor status for this statement. + last_errno*: cuint # error code + param_count*: cuint # input parameter count + field_count*: cuint # number of columns in result set + state*: enum_mysql_stmt_state # statement state + last_error*: array[0..(ERRMSG_SIZE) - 1, char] # error message + sqlstate*: array[0..(SQLSTATE_LENGTH + 1) - 1, char] + send_types_to_server*: my_bool # Types of input parameters should be sent to server + bind_param_done*: my_bool # input buffers were supplied + bind_result_done*: char # output buffers were supplied + unbuffered_fetch_cancelled*: my_bool + update_max_length*: my_bool + + STMT* = st_mysql_stmt # When doing mysql_stmt_store_result calculate max_length attribute + # of statement metadata. This is to be consistent with the old API, + # where this was done automatically. + # In the new API we do that only by request because it slows down + # mysql_stmt_store_result sufficiently. + enum_stmt_attr_type* = enum + STMT_ATTR_UPDATE_MAX_LENGTH, STMT_ATTR_CURSOR_TYPE, STMT_ATTR_PREFETCH_ROWS + +proc server_init*(argc: cint, argv: cstringArray, groups: cstringArray): cint{. + cdecl, dynlib: lib, importc: "mysql_server_init".} +proc server_end*(){.cdecl, dynlib: lib, importc: "mysql_server_end".} + # mysql_server_init/end need to be called when using libmysqld or + # libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so + # you don't need to call it explicitely; but you need to call + # mysql_server_end() to free memory). The names are a bit misleading + # (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general + # names which suit well whether you're using libmysqld or libmysqlclient. We + # intend to promote these aliases over the mysql_server* ones. +proc library_init*(argc: cint, argv: cstringArray, groups: cstringArray): cint{. + cdecl, dynlib: lib, importc: "mysql_server_init".} +proc library_end*(){.cdecl, dynlib: lib, importc: "mysql_server_end".} +proc get_parameters*(): PPARAMETERS{.stdcall, dynlib: lib, + importc: "mysql_get_parameters".} + # Set up and bring down a thread; these function should be called + # for each thread in an application which opens at least one MySQL + # connection. All uses of the connection(s) should be between these + # function calls. +proc thread_init*(): my_bool{.stdcall, dynlib: lib, importc: "mysql_thread_init".} +proc thread_end*(){.stdcall, dynlib: lib, importc: "mysql_thread_end".} + # Functions to get information from the MYSQL and MYSQL_RES structures + # Should definitely be used if one uses shared libraries. +proc num_rows*(res: PRES): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_num_rows".} +proc num_fields*(res: PRES): cuint{.stdcall, dynlib: lib, + importc: "mysql_num_fields".} +proc eof*(res: PRES): my_bool{.stdcall, dynlib: lib, importc: "mysql_eof".} +proc fetch_field_direct*(res: PRES, fieldnr: cuint): PFIELD{.stdcall, + dynlib: lib, importc: "mysql_fetch_field_direct".} +proc fetch_fields*(res: PRES): PFIELD{.stdcall, dynlib: lib, + importc: "mysql_fetch_fields".} +proc row_tell*(res: PRES): ROW_OFFSET{.stdcall, dynlib: lib, + importc: "mysql_row_tell".} +proc field_tell*(res: PRES): FIELD_OFFSET{.stdcall, dynlib: lib, + importc: "mysql_field_tell".} +proc field_count*(: P): cuint{.stdcall, dynlib: lib, + importc: "mysql_field_count".} +proc affected_rows*(: P): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_affected_rows".} +proc insert_id*(: P): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_insert_id".} +proc errno*(: P): cuint{.stdcall, dynlib: lib, importc: "mysql_errno".} +proc error*(: P): cstring{.stdcall, dynlib: lib, importc: "mysql_error".} +proc sqlstate*(: P): cstring{.stdcall, dynlib: lib, importc: "mysql_sqlstate".} +proc warning_count*(: P): cuint{.stdcall, dynlib: lib, + importc: "mysql_warning_count".} +proc info*(: P): cstring{.stdcall, dynlib: lib, importc: "mysql_info".} +proc thread_id*(: P): int{.stdcall, dynlib: lib, importc: "mysql_thread_id".} +proc character_set_name*(: P): cstring{.stdcall, dynlib: lib, + importc: "mysql_character_set_name".} +proc set_character_set*(: P, csname: cstring): int32{.stdcall, dynlib: lib, + importc: "mysql_set_character_set".} +proc init*(: P): P{.stdcall, dynlib: lib, importc: "mysql_init".} +proc ssl_set*(: P, key: cstring, cert: cstring, ca: cstring, capath: cstring, + cipher: cstring): my_bool{.stdcall, dynlib: lib, + importc: "mysql_ssl_set".} +proc change_user*(: P, user: cstring, passwd: cstring, db: cstring): my_bool{. + stdcall, dynlib: lib, importc: "mysql_change_user".} +proc real_connect*(: P, host: cstring, user: cstring, passwd: cstring, + db: cstring, port: cuint, unix_socket: cstring, + clientflag: int): P{.stdcall, dynlib: lib, + importc: "mysql_real_connect".} +proc select_db*(: P, db: cstring): cint{.stdcall, dynlib: lib, + importc: "mysql_select_db".} +proc query*(: P, q: cstring): cint{.stdcall, dynlib: lib, importc: "mysql_query".} +proc send_query*(: P, q: cstring, len: int): cint{.stdcall, dynlib: lib, + importc: "mysql_send_query".} +proc real_query*(: P, q: cstring, len: int): cint{.stdcall, dynlib: lib, + importc: "mysql_real_query".} +proc store_result*(: P): PRES{.stdcall, dynlib: lib, + importc: "mysql_store_result".} +proc use_result*(: P): PRES{.stdcall, dynlib: lib, importc: "mysql_use_result".} + # perform query on master +proc master_query*(: P, q: cstring, len: int): my_bool{.stdcall, dynlib: lib, + importc: "mysql_master_query".} +proc master_send_query*(: P, q: cstring, len: int): my_bool{.stdcall, + dynlib: lib, importc: "mysql_master_send_query".} + # perform query on slave +proc slave_query*(: P, q: cstring, len: int): my_bool{.stdcall, dynlib: lib, + importc: "mysql_slave_query".} +proc slave_send_query*(: P, q: cstring, len: int): my_bool{.stdcall, + dynlib: lib, importc: "mysql_slave_send_query".} +proc get_character_set_info*(: P, charset: PMY_CHARSET_INFO){.stdcall, + dynlib: lib, importc: "mysql_get_character_set_info".} + # local infile support +const + LOCAL_INFILE_ERROR_LEN* = 512 + +# procedure mysql_set_local_infile_handler(mysql:PMYSQL; local_infile_init:function (para1:Ppointer; para2:Pchar; para3:pointer):longint; local_infile_read:function (para1:pointer; para2:Pchar; para3:dword):longint; local_infile_end:procedure (_pa +# para6:pointer);cdecl;external mysqllib name 'mysql_set_local_infile_handler'; + +proc set_local_infile_default*(: P){.cdecl, dynlib: lib, + importc: "mysql_set_local_infile_default".} + # enable/disable parsing of all queries to decide if they go on master or + # slave +proc enable_rpl_parse*(: P){.stdcall, dynlib: lib, + importc: "mysql_enable_rpl_parse".} +proc disable_rpl_parse*(: P){.stdcall, dynlib: lib, + importc: "mysql_disable_rpl_parse".} + # get the value of the parse flag +proc rpl_parse_enabled*(: P): cint{.stdcall, dynlib: lib, + importc: "mysql_rpl_parse_enabled".} + # enable/disable reads from master +proc enable_reads_from_master*(: P){.stdcall, dynlib: lib, + importc: "mysql_enable_reads_from_master".} +proc disable_reads_from_master*(: P){.stdcall, dynlib: lib, importc: "mysql_disable_reads_from_master".} + # get the value of the master read flag +proc reads_from_master_enabled*(: P): my_bool{.stdcall, dynlib: lib, + importc: "mysql_reads_from_master_enabled".} +proc rpl_query_type*(q: cstring, length: cint): rpl_type{.stdcall, dynlib: lib, + importc: "mysql_rpl_query_type".} + # discover the master and its slaves +proc rpl_probe*(: P): my_bool{.stdcall, dynlib: lib, importc: "mysql_rpl_probe".} + # set the master, close/free the old one, if it is not a pivot +proc set_master*(: P, host: cstring, port: cuint, user: cstring, passwd: cstring): cint{. + stdcall, dynlib: lib, importc: "mysql_set_master".} +proc add_slave*(: P, host: cstring, port: cuint, user: cstring, passwd: cstring): cint{. + stdcall, dynlib: lib, importc: "mysql_add_slave".} +proc shutdown*(: P, shutdown_level: enum_shutdown_level): cint{.stdcall, + dynlib: lib, importc: "mysql_shutdown".} +proc dump_debug_info*(: P): cint{.stdcall, dynlib: lib, + importc: "mysql_dump_debug_info".} +proc refresh*(: P, refresh_options: cuint): cint{.stdcall, dynlib: lib, + importc: "mysql_refresh".} +proc kill*(: P, pid: int): cint{.stdcall, dynlib: lib, importc: "mysql_kill".} +proc set_server_option*(: P, option: enum_mysql_set_option): cint{.stdcall, + dynlib: lib, importc: "mysql_set_server_option".} +proc ping*(: P): cint{.stdcall, dynlib: lib, importc: "mysql_ping".} +proc stat*(: P): cstring{.stdcall, dynlib: lib, importc: "mysql_stat".} +proc get_server_info*(: P): cstring{.stdcall, dynlib: lib, + importc: "mysql_get_server_info".} +proc get_client_info*(): cstring{.stdcall, dynlib: lib, + importc: "mysql_get_client_info".} +proc get_client_version*(): int{.stdcall, dynlib: lib, + importc: "mysql_get_client_version".} +proc get_host_info*(: P): cstring{.stdcall, dynlib: lib, + importc: "mysql_get_host_info".} +proc get_server_version*(: P): int{.stdcall, dynlib: lib, + importc: "mysql_get_server_version".} +proc get_proto_info*(: P): cuint{.stdcall, dynlib: lib, + importc: "mysql_get_proto_info".} +proc list_dbs*(: P, wild: cstring): PRES{.stdcall, dynlib: lib, + importc: "mysql_list_dbs".} +proc list_tables*(: P, wild: cstring): PRES{.stdcall, dynlib: lib, + importc: "mysql_list_tables".} +proc list_processes*(: P): PRES{.stdcall, dynlib: lib, + importc: "mysql_list_processes".} +proc options*(: P, option: option, arg: cstring): cint{.stdcall, dynlib: lib, + importc: "mysql_options".} +proc free_result*(result: PRES){.stdcall, dynlib: lib, + importc: "mysql_free_result".} +proc data_seek*(result: PRES, offset: my_ulonglong){.stdcall, dynlib: lib, + importc: "mysql_data_seek".} +proc row_seek*(result: PRES, offset: ROW_OFFSET): ROW_OFFSET{.stdcall, + dynlib: lib, importc: "mysql_row_seek".} +proc field_seek*(result: PRES, offset: FIELD_OFFSET): FIELD_OFFSET{.stdcall, + dynlib: lib, importc: "mysql_field_seek".} +proc fetch_row*(result: PRES): ROW{.stdcall, dynlib: lib, + importc: "mysql_fetch_row".} +proc fetch_lengths*(result: PRES): ptr int{.stdcall, dynlib: lib, + importc: "mysql_fetch_lengths".} +proc fetch_field*(result: PRES): PFIELD{.stdcall, dynlib: lib, + importc: "mysql_fetch_field".} +proc list_fields*(: P, table: cstring, wild: cstring): PRES{.stdcall, + dynlib: lib, importc: "mysql_list_fields".} +proc escape_string*(fto: cstring, `from`: cstring, from_length: int): int{. + stdcall, dynlib: lib, importc: "mysql_escape_string".} +proc hex_string*(fto: cstring, `from`: cstring, from_length: int): int{.stdcall, + dynlib: lib, importc: "mysql_hex_string".} +proc real_escape_string*(: P, fto: cstring, `from`: cstring, len: int): int{. + stdcall, dynlib: lib, importc: "mysql_real_escape_string".} +proc debug*(debug: cstring){.stdcall, dynlib: lib, importc: "mysql_debug".} + # function mysql_odbc_escape_string(mysql:PMYSQL; fto:Pchar; to_length:dword; from:Pchar; from_length:dword; + # param:pointer; extend_buffer:function (para1:pointer; to:Pchar; length:Pdword):Pchar):Pchar;stdcall;external mysqllib name 'mysql_odbc_escape_string'; +proc myodbc_remove_escape*(: P, name: cstring){.stdcall, dynlib: lib, + importc: "myodbc_remove_escape".} +proc thread_safe*(): cuint{.stdcall, dynlib: lib, importc: "mysql_thread_safe".} +proc embedded*(): my_bool{.stdcall, dynlib: lib, importc: "mysql_embedded".} +proc manager_init*(con: PMANAGER): PMANAGER{.stdcall, dynlib: lib, + importc: "mysql_manager_init".} +proc manager_connect*(con: PMANAGER, host: cstring, user: cstring, + passwd: cstring, port: cuint): PMANAGER{.stdcall, + dynlib: lib, importc: "mysql_manager_connect".} +proc manager_close*(con: PMANAGER){.stdcall, dynlib: lib, + importc: "mysql_manager_close".} +proc manager_command*(con: PMANAGER, cmd: cstring, cmd_len: cint): cint{. + stdcall, dynlib: lib, importc: "mysql_manager_command".} +proc manager_fetch_line*(con: PMANAGER, res_buf: cstring, res_buf_size: cint): cint{. + stdcall, dynlib: lib, importc: "mysql_manager_fetch_line".} +proc read_query_result*(: P): my_bool{.stdcall, dynlib: lib, + importc: "mysql_read_query_result".} +proc stmt_init*(: P): PSTMT{.stdcall, dynlib: lib, importc: "mysql_stmt_init".} +proc stmt_prepare*(stmt: PSTMT, query: cstring, len: int): cint{.stdcall, + dynlib: lib, importc: "mysql_stmt_prepare".} +proc stmt_execute*(stmt: PSTMT): cint{.stdcall, dynlib: lib, + importc: "mysql_stmt_execute".} +proc stmt_fetch*(stmt: PSTMT): cint{.stdcall, dynlib: lib, + importc: "mysql_stmt_fetch".} +proc stmt_fetch_column*(stmt: PSTMT, `bind`: PBIND, column: cuint, offset: int): cint{. + stdcall, dynlib: lib, importc: "mysql_stmt_fetch_column".} +proc stmt_store_result*(stmt: PSTMT): cint{.stdcall, dynlib: lib, + importc: "mysql_stmt_store_result".} +proc stmt_param_count*(stmt: PSTMT): int{.stdcall, dynlib: lib, + importc: "mysql_stmt_param_count".} +proc stmt_attr_set*(stmt: PSTMT, attr_type: enum_stmt_attr_type, attr: pointer): my_bool{. + stdcall, dynlib: lib, importc: "mysql_stmt_attr_set".} +proc stmt_attr_get*(stmt: PSTMT, attr_type: enum_stmt_attr_type, attr: pointer): my_bool{. + stdcall, dynlib: lib, importc: "mysql_stmt_attr_get".} +proc stmt_bind_param*(stmt: PSTMT, bnd: PBIND): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_bind_param".} +proc stmt_bind_result*(stmt: PSTMT, bnd: PBIND): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_bind_result".} +proc stmt_close*(stmt: PSTMT): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_close".} +proc stmt_reset*(stmt: PSTMT): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_reset".} +proc stmt_free_result*(stmt: PSTMT): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_free_result".} +proc stmt_send_long_data*(stmt: PSTMT, param_number: cuint, data: cstring, + len: int): my_bool{.stdcall, dynlib: lib, + importc: "mysql_stmt_send_long_data".} +proc stmt_result_metadata*(stmt: PSTMT): PRES{.stdcall, dynlib: lib, + importc: "mysql_stmt_result_metadata".} +proc stmt_param_metadata*(stmt: PSTMT): PRES{.stdcall, dynlib: lib, + importc: "mysql_stmt_param_metadata".} +proc stmt_errno*(stmt: PSTMT): cuint{.stdcall, dynlib: lib, + importc: "mysql_stmt_errno".} +proc stmt_error*(stmt: PSTMT): cstring{.stdcall, dynlib: lib, + importc: "mysql_stmt_error".} +proc stmt_sqlstate*(stmt: PSTMT): cstring{.stdcall, dynlib: lib, + importc: "mysql_stmt_sqlstate".} +proc stmt_row_seek*(stmt: PSTMT, offset: ROW_OFFSET): ROW_OFFSET{.stdcall, + dynlib: lib, importc: "mysql_stmt_row_seek".} +proc stmt_row_tell*(stmt: PSTMT): ROW_OFFSET{.stdcall, dynlib: lib, + importc: "mysql_stmt_row_tell".} +proc stmt_data_seek*(stmt: PSTMT, offset: my_ulonglong){.stdcall, dynlib: lib, + importc: "mysql_stmt_data_seek".} +proc stmt_num_rows*(stmt: PSTMT): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_stmt_num_rows".} +proc stmt_affected_rows*(stmt: PSTMT): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_stmt_affected_rows".} +proc stmt_insert_id*(stmt: PSTMT): my_ulonglong{.stdcall, dynlib: lib, + importc: "mysql_stmt_insert_id".} +proc stmt_field_count*(stmt: PSTMT): cuint{.stdcall, dynlib: lib, + importc: "mysql_stmt_field_count".} +proc commit*(: P): my_bool{.stdcall, dynlib: lib, importc: "mysql_commit".} +proc rollback*(: P): my_bool{.stdcall, dynlib: lib, importc: "mysql_rollback".} +proc autocommit*(: P, auto_mode: my_bool): my_bool{.stdcall, dynlib: lib, + importc: "mysql_autocommit".} +proc more_results*(: P): my_bool{.stdcall, dynlib: lib, + importc: "mysql_more_results".} +proc next_result*(: P): cint{.stdcall, dynlib: lib, importc: "mysql_next_result".} +proc close*(sock: P){.stdcall, dynlib: lib, importc: "mysql_close".} + # status return codes +const + NO_DATA* = 100 + DATA_TRUNCATED* = 101 + +proc reload*(: P): cint +when defined(USE_OLD_FUNCTIONS): + proc connect*(: P, host: cstring, user: cstring, passwd: cstring): P{.stdcall, + dynlib: External_library, importc: "mysql_connect".} + proc create_db*(: P, DB: cstring): cint{.stdcall, dynlib: External_library, + importc: "mysql_create_db".} + proc drop_db*(: P, DB: cstring): cint{.stdcall, dynlib: External_library, + importc: "mysql_drop_db".} +proc net_safe_read*(: P): cuint{.cdecl, dynlib: lib, importc: "net_safe_read".} +proc net_new_transaction(net: st_net): st_net = + assert false + #net.pkt_nr = 0 + result = net + +proc IS_PRI_KEY(n: int32): bool = + result = (n and PRI_KEY_FLAG) != 0 + +proc IS_NOT_NULL(n: int32): bool = + result = (n and NOT_NULL_FLAG) != 0 + +proc IS_BLOB(n: int32): bool = + result = (n and BLOB_FLAG) != 0 + +proc IS_NUM_FIELD(f: pst_mysql_field): bool = + result = (f.flags and NUM_FLAG) != 0 + +proc IS_NUM(t: enum_field_types): bool = + result = (t <= FIELD_TYPE_INT24) or (t == FIELD_TYPE_YEAR) or + (t == FIELD_TYPE_NEWDECIMAL) + +proc INTERNAL_NUM_FIELD(f: Pst_mysql_field): bool = + result = (f.ftype <= FIELD_TYPE_INT24) and + ((f.ftype != FIELD_TYPE_TIMESTAMP) or (f.len == 14) or (f.len == 8)) or + (f.ftype == FIELD_TYPE_YEAR) + +proc reload(: P): cint = + result = refresh(, REFRESH_GRANT) diff --git a/lib/newwrap/opengl/gl.nim b/lib/newwrap/opengl/gl.nim new file mode 100644 index 000000000..9387b5bc9 --- /dev/null +++ b/lib/newwrap/opengl/gl.nim @@ -0,0 +1,1536 @@ +# +# +# 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 +#****************************************************************************** + +when defined(windows): + {.push, callconv: stdcall.} +else: + {.push, callconv: cdecl.} +when defined(windows): + const + dllname* = "opengl32.dll" +elif defined(macosx): + const + dllname* = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib" +else: + const + dllname* = "libGL.so.1" +type + PGLenum* = ptr TGLenum + PGLboolean* = ptr TGLboolean + PGLbitfield* = ptr TGLbitfield + TGLbyte* = int8 + PGLbyte* = ptr TGlbyte + PGLshort* = ptr TGLshort + PGLint* = ptr TGLint + PGLsizei* = ptr TGLsizei + PGLubyte* = ptr TGLubyte + PGLushort* = ptr TGLushort + PGLuint* = ptr TGLuint + PGLfloat* = ptr TGLfloat + PGLclampf* = ptr TGLclampf + PGLdouble* = ptr TGLdouble + PGLclampd* = ptr TGLclampd + PGLvoid* = Pointer + PPGLvoid* = ptr PGLvoid + TGLenum* = cint + TGLboolean* = bool + TGLbitfield* = cint + TGLshort* = int16 + TGLint* = cint + TGLsizei* = int + TGLubyte* = int8 + TGLushort* = int16 + TGLuint* = cint + TGLfloat* = float32 + TGLclampf* = float32 + TGLdouble* = float + TGLclampd* = float + +const # Version + GL_VERSION_1_1* = 1 # AccumOp + constGL_ACCUM* = 0x00000100 + GL_LOAD* = 0x00000101 + GL_RETURN* = 0x00000102 + GL_MULT* = 0x00000103 + GL_ADD* = 0x00000104 # AlphaFunction + GL_NEVER* = 0x00000200 + GL_LESS* = 0x00000201 + GL_EQUAL* = 0x00000202 + GL_LEQUAL* = 0x00000203 + GL_GREATER* = 0x00000204 + GL_NOTEQUAL* = 0x00000205 + GL_GEQUAL* = 0x00000206 + GL_ALWAYS* = 0x00000207 # AttribMask + GL_CURRENT_BIT* = 0x00000001 + GL_POINT_BIT* = 0x00000002 + GL_LINE_BIT* = 0x00000004 + GL_POLYGON_BIT* = 0x00000008 + GL_POLYGON_STIPPLE_BIT* = 0x00000010 + GL_PIXEL_MODE_BIT* = 0x00000020 + GL_LIGHTING_BIT* = 0x00000040 + GL_FOG_BIT* = 0x00000080 + GL_DEPTH_BUFFER_BIT* = 0x00000100 + GL_ACCUM_BUFFER_BIT* = 0x00000200 + GL_STENCIL_BUFFER_BIT* = 0x00000400 + GL_VIEWPORT_BIT* = 0x00000800 + GL_TRANSFORM_BIT* = 0x00001000 + GL_ENABLE_BIT* = 0x00002000 + GL_COLOR_BUFFER_BIT* = 0x00004000 + GL_HINT_BIT* = 0x00008000 + GL_EVAL_BIT* = 0x00010000 + GL_LIST_BIT* = 0x00020000 + GL_TEXTURE_BIT* = 0x00040000 + GL_SCISSOR_BIT* = 0x00080000 + GL_ALL_ATTRIB_BITS* = 0x000FFFFF # BeginMode + GL_POINTS* = 0x00000000 + GL_LINES* = 0x00000001 + GL_LINE_LOOP* = 0x00000002 + GL_LINE_STRIP* = 0x00000003 + GL_TRIANGLES* = 0x00000004 + GL_TRIANGLE_STRIP* = 0x00000005 + GL_TRIANGLE_FAN* = 0x00000006 + GL_QUADS* = 0x00000007 + GL_QUAD_STRIP* = 0x00000008 + GL_POLYGON* = 0x00000009 # BlendingFactorDest + GL_ZERO* = 0 + GL_ONE* = 1 + GL_SRC_COLOR* = 0x00000300 + GL_ONE_MINUS_SRC_COLOR* = 0x00000301 + GL_SRC_ALPHA* = 0x00000302 + GL_ONE_MINUS_SRC_ALPHA* = 0x00000303 + GL_DST_ALPHA* = 0x00000304 + GL_ONE_MINUS_DST_ALPHA* = 0x00000305 # BlendingFactorSrc + # GL_ZERO + # GL_ONE + GL_DST_COLOR* = 0x00000306 + GL_ONE_MINUS_DST_COLOR* = 0x00000307 + GL_SRC_ALPHA_SATURATE* = 0x00000308 # GL_SRC_ALPHA + # GL_ONE_MINUS_SRC_ALPHA + # GL_DST_ALPHA + # GL_ONE_MINUS_DST_ALPHA + # Boolean + GL_TRUE* = 1 + GL_FALSE* = 0 # ClearBufferMask + # GL_COLOR_BUFFER_BIT + # GL_ACCUM_BUFFER_BIT + # GL_STENCIL_BUFFER_BIT + # GL_DEPTH_BUFFER_BIT + # ClientArrayType + # GL_VERTEX_ARRAY + # GL_NORMAL_ARRAY + # GL_COLOR_ARRAY + # GL_INDEX_ARRAY + # GL_TEXTURE_COORD_ARRAY + # GL_EDGE_FLAG_ARRAY + # ClipPlaneName + GL_CLIP_PLANE0* = 0x00003000 + GL_CLIP_PLANE1* = 0x00003001 + GL_CLIP_PLANE2* = 0x00003002 + GL_CLIP_PLANE3* = 0x00003003 + GL_CLIP_PLANE4* = 0x00003004 + GL_CLIP_PLANE5* = 0x00003005 # ColorMaterialFace + # GL_FRONT + # GL_BACK + # GL_FRONT_AND_BACK + # ColorMaterialParameter + # GL_AMBIENT + # GL_DIFFUSE + # GL_SPECULAR + # GL_EMISSION + # GL_AMBIENT_AND_DIFFUSE + # ColorPointerType + # GL_BYTE + # GL_UNSIGNED_BYTE + # GL_SHORT + # GL_UNSIGNED_SHORT + # GL_INT + # GL_UNSIGNED_INT + # GL_FLOAT + # GL_DOUBLE + # CullFaceMode + # GL_FRONT + # GL_BACK + # GL_FRONT_AND_BACK + # DataType + GL_BYTE* = 0x00001400 + GL_UNSIGNED_BYTE* = 0x00001401 + GL_SHORT* = 0x00001402 + GL_UNSIGNED_SHORT* = 0x00001403 + GL_INT* = 0x00001404 + GL_UNSIGNED_INT* = 0x00001405 + GL_FLOAT* = 0x00001406 + GL_2_BYTES* = 0x00001407 + GL_3_BYTES* = 0x00001408 + GL_4_BYTES* = 0x00001409 + GL_DOUBLE* = 0x0000140A # DepthFunction + # GL_NEVER + # GL_LESS + # GL_EQUAL + # GL_LEQUAL + # GL_GREATER + # GL_NOTEQUAL + # GL_GEQUAL + # GL_ALWAYS + # DrawBufferMode + GL_NONE* = 0 + GL_FRONT_LEFT* = 0x00000400 + GL_FRONT_RIGHT* = 0x00000401 + GL_BACK_LEFT* = 0x00000402 + GL_BACK_RIGHT* = 0x00000403 + GL_FRONT* = 0x00000404 + GL_BACK* = 0x00000405 + GL_LEFT* = 0x00000406 + GL_RIGHT* = 0x00000407 + GL_FRONT_AND_BACK* = 0x00000408 + GL_AUX0* = 0x00000409 + GL_AUX1* = 0x0000040A + GL_AUX2* = 0x0000040B + GL_AUX3* = 0x0000040C # Enable + # GL_FOG + # GL_LIGHTING + # GL_TEXTURE_1D + # GL_TEXTURE_2D + # GL_LINE_STIPPLE + # GL_POLYGON_STIPPLE + # GL_CULL_FACE + # GL_ALPHA_TEST + # GL_BLEND + # GL_INDEX_LOGIC_OP + # GL_COLOR_LOGIC_OP + # GL_DITHER + # GL_STENCIL_TEST + # GL_DEPTH_TEST + # GL_CLIP_PLANE0 + # GL_CLIP_PLANE1 + # GL_CLIP_PLANE2 + # GL_CLIP_PLANE3 + # GL_CLIP_PLANE4 + # GL_CLIP_PLANE5 + # GL_LIGHT0 + # GL_LIGHT1 + # GL_LIGHT2 + # GL_LIGHT3 + # GL_LIGHT4 + # GL_LIGHT5 + # GL_LIGHT6 + # GL_LIGHT7 + # GL_TEXTURE_GEN_S + # GL_TEXTURE_GEN_T + # GL_TEXTURE_GEN_R + # GL_TEXTURE_GEN_Q + # GL_MAP1_VERTEX_3 + # GL_MAP1_VERTEX_4 + # GL_MAP1_COLOR_4 + # GL_MAP1_INDEX + # GL_MAP1_NORMAL + # GL_MAP1_TEXTURE_COORD_1 + # GL_MAP1_TEXTURE_COORD_2 + # GL_MAP1_TEXTURE_COORD_3 + # GL_MAP1_TEXTURE_COORD_4 + # GL_MAP2_VERTEX_3 + # GL_MAP2_VERTEX_4 + # GL_MAP2_COLOR_4 + # GL_MAP2_INDEX + # GL_MAP2_NORMAL + # GL_MAP2_TEXTURE_COORD_1 + # GL_MAP2_TEXTURE_COORD_2 + # GL_MAP2_TEXTURE_COORD_3 + # GL_MAP2_TEXTURE_COORD_4 + # GL_POINT_SMOOTH + # GL_LINE_SMOOTH + # GL_POLYGON_SMOOTH + # GL_SCISSOR_TEST + # GL_COLOR_MATERIAL + # GL_NORMALIZE + # GL_AUTO_NORMAL + # GL_VERTEX_ARRAY + # GL_NORMAL_ARRAY + # GL_COLOR_ARRAY + # GL_INDEX_ARRAY + # GL_TEXTURE_COORD_ARRAY + # GL_EDGE_FLAG_ARRAY + # GL_POLYGON_OFFSET_POINT + # GL_POLYGON_OFFSET_LINE + # GL_POLYGON_OFFSET_FILL + # ErrorCode + GL_NO_ERROR* = 0 + GL_INVALID_ENUM* = 0x00000500 + GL_INVALID_VALUE* = 0x00000501 + GL_INVALID_OPERATION* = 0x00000502 + GL_STACK_OVERFLOW* = 0x00000503 + GL_STACK_UNDERFLOW* = 0x00000504 + GL_OUT_OF_MEMORY* = 0x00000505 # FeedBackMode + GL_2D* = 0x00000600 + GL_3D* = 0x00000601 + GL_3D_COLOR* = 0x00000602 + GL_3D_COLOR_TEXTURE* = 0x00000603 + GL_4D_COLOR_TEXTURE* = 0x00000604 # FeedBackToken + GL_PASS_THROUGH_TOKEN* = 0x00000700 + GL_POINT_TOKEN* = 0x00000701 + GL_LINE_TOKEN* = 0x00000702 + GL_POLYGON_TOKEN* = 0x00000703 + GL_BITMAP_TOKEN* = 0x00000704 + GL_DRAW_PIXEL_TOKEN* = 0x00000705 + GL_COPY_PIXEL_TOKEN* = 0x00000706 + GL_LINE_RESET_TOKEN* = 0x00000707 # FogMode + # GL_LINEAR + GL_EXP* = 0x00000800 + GL_EXP2* = 0x00000801 # FogParameter + # GL_FOG_COLOR + # GL_FOG_DENSITY + # GL_FOG_END + # GL_FOG_INDEX + # GL_FOG_MODE + # GL_FOG_START + # FrontFaceDirection + GL_CW* = 0x00000900 + GL_CCW* = 0x00000901 # GetMapTarget + GL_COEFF* = 0x00000A00 + GL_ORDER* = 0x00000A01 + GL_DOMAIN* = 0x00000A02 # GetPixelMap + # GL_PIXEL_MAP_I_TO_I + # GL_PIXEL_MAP_S_TO_S + # GL_PIXEL_MAP_I_TO_R + # GL_PIXEL_MAP_I_TO_G + # GL_PIXEL_MAP_I_TO_B + # GL_PIXEL_MAP_I_TO_A + # GL_PIXEL_MAP_R_TO_R + # GL_PIXEL_MAP_G_TO_G + # GL_PIXEL_MAP_B_TO_B + # GL_PIXEL_MAP_A_TO_A + # GetPointerTarget + # GL_VERTEX_ARRAY_POINTER + # GL_NORMAL_ARRAY_POINTER + # GL_COLOR_ARRAY_POINTER + # GL_INDEX_ARRAY_POINTER + # GL_TEXTURE_COORD_ARRAY_POINTER + # GL_EDGE_FLAG_ARRAY_POINTER + # GetTarget + GL_CURRENT_COLOR* = 0x00000B00 + GL_CURRENT_INDEX* = 0x00000B01 + GL_CURRENT_NORMAL* = 0x00000B02 + GL_CURRENT_TEXTURE_COORDS* = 0x00000B03 + GL_CURRENT_RASTER_COLOR* = 0x00000B04 + GL_CURRENT_RASTER_INDEX* = 0x00000B05 + GL_CURRENT_RASTER_TEXTURE_COORDS* = 0x00000B06 + GL_CURRENT_RASTER_POSITION* = 0x00000B07 + GL_CURRENT_RASTER_POSITION_VALID* = 0x00000B08 + GL_CURRENT_RASTER_DISTANCE* = 0x00000B09 + GL_POINT_SMOOTH* = 0x00000B10 + constGL_POINT_SIZE* = 0x00000B11 + GL_POINT_SIZE_RANGE* = 0x00000B12 + GL_POINT_SIZE_GRANULARITY* = 0x00000B13 + GL_LINE_SMOOTH* = 0x00000B20 + constGL_LINE_WIDTH* = 0x00000B21 + GL_LINE_WIDTH_RANGE* = 0x00000B22 + GL_LINE_WIDTH_GRANULARITY* = 0x00000B23 + constGL_LINE_STIPPLE* = 0x00000B24 + GL_LINE_STIPPLE_PATTERN* = 0x00000B25 + GL_LINE_STIPPLE_REPEAT* = 0x00000B26 + GL_LIST_MODE* = 0x00000B30 + GL_MAX_LIST_NESTING* = 0x00000B31 + constGL_LIST_BASE* = 0x00000B32 + GL_LIST_INDEX* = 0x00000B33 + constGL_POLYGON_MODE* = 0x00000B40 + GL_POLYGON_SMOOTH* = 0x00000B41 + constGL_POLYGON_STIPPLE* = 0x00000B42 + constGL_EDGE_FLAG* = 0x00000B43 + constGL_CULL_FACE* = 0x00000B44 + GL_CULL_FACE_MODE* = 0x00000B45 + constGL_FRONT_FACE* = 0x00000B46 + GL_LIGHTING* = 0x00000B50 + GL_LIGHT_MODEL_LOCAL_VIEWER* = 0x00000B51 + GL_LIGHT_MODEL_TWO_SIDE* = 0x00000B52 + GL_LIGHT_MODEL_AMBIENT* = 0x00000B53 + constGL_SHADE_MODEL* = 0x00000B54 + GL_COLOR_MATERIAL_FACE* = 0x00000B55 + GL_COLOR_MATERIAL_PARAMETER* = 0x00000B56 + constGL_COLOR_MATERIAL* = 0x00000B57 + GL_FOG* = 0x00000B60 + GL_FOG_INDEX* = 0x00000B61 + GL_FOG_DENSITY* = 0x00000B62 + GL_FOG_START* = 0x00000B63 + GL_FOG_END* = 0x00000B64 + GL_FOG_MODE* = 0x00000B65 + GL_FOG_COLOR* = 0x00000B66 + constGL_DEPTH_RANGE* = 0x00000B70 + GL_DEPTH_TEST* = 0x00000B71 + GL_DEPTH_WRITEMASK* = 0x00000B72 + GL_DEPTH_CLEAR_VALUE* = 0x00000B73 + constGL_DEPTH_FUNC* = 0x00000B74 + GL_ACCUM_CLEAR_VALUE* = 0x00000B80 + GL_STENCIL_TEST* = 0x00000B90 + GL_STENCIL_CLEAR_VALUE* = 0x00000B91 + constGL_STENCIL_FUNC* = 0x00000B92 + GL_STENCIL_VALUE_MASK* = 0x00000B93 + GL_STENCIL_FAIL* = 0x00000B94 + GL_STENCIL_PASS_DEPTH_FAIL* = 0x00000B95 + GL_STENCIL_PASS_DEPTH_PASS* = 0x00000B96 + GL_STENCIL_REF* = 0x00000B97 + GL_STENCIL_WRITEMASK* = 0x00000B98 + constGL_MATRIX_MODE* = 0x00000BA0 + GL_NORMALIZE* = 0x00000BA1 + constGL_VIEWPORT* = 0x00000BA2 + GL_MODELVIEW_STACK_DEPTH* = 0x00000BA3 + GL_PROJECTION_STACK_DEPTH* = 0x00000BA4 + GL_TEXTURE_STACK_DEPTH* = 0x00000BA5 + GL_MODELVIEW_MATRIX* = 0x00000BA6 + GL_PROJECTION_MATRIX* = 0x00000BA7 + GL_TEXTURE_MATRIX* = 0x00000BA8 + GL_ATTRIB_STACK_DEPTH* = 0x00000BB0 + GL_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000BB1 + GL_ALPHA_TEST* = 0x00000BC0 + GL_ALPHA_TEST_FUNC* = 0x00000BC1 + GL_ALPHA_TEST_REF* = 0x00000BC2 + GL_DITHER* = 0x00000BD0 + GL_BLEND_DST* = 0x00000BE0 + GL_BLEND_SRC* = 0x00000BE1 + GL_BLEND* = 0x00000BE2 + GL_LOGIC_OP_MODE* = 0x00000BF0 + GL_INDEX_LOGIC_OP* = 0x00000BF1 + GL_COLOR_LOGIC_OP* = 0x00000BF2 + GL_AUX_BUFFERS* = 0x00000C00 + constGL_DRAW_BUFFER* = 0x00000C01 + constGL_READ_BUFFER* = 0x00000C02 + GL_SCISSOR_BOX* = 0x00000C10 + GL_SCISSOR_TEST* = 0x00000C11 + GL_INDEX_CLEAR_VALUE* = 0x00000C20 + GL_INDEX_WRITEMASK* = 0x00000C21 + GL_COLOR_CLEAR_VALUE* = 0x00000C22 + GL_COLOR_WRITEMASK* = 0x00000C23 + GL_INDEX_MODE* = 0x00000C30 + GL_RGBA_MODE* = 0x00000C31 + GL_DOUBLEBUFFER* = 0x00000C32 + GL_STEREO* = 0x00000C33 + constGL_RENDER_MODE* = 0x00000C40 + GL_PERSPECTIVE_CORRECTION_HINT* = 0x00000C50 + GL_POINT_SMOOTH_HINT* = 0x00000C51 + GL_LINE_SMOOTH_HINT* = 0x00000C52 + GL_POLYGON_SMOOTH_HINT* = 0x00000C53 + GL_FOG_HINT* = 0x00000C54 + GL_TEXTURE_GEN_S* = 0x00000C60 + GL_TEXTURE_GEN_T* = 0x00000C61 + GL_TEXTURE_GEN_R* = 0x00000C62 + GL_TEXTURE_GEN_Q* = 0x00000C63 + GL_PIXEL_MAP_I_TO_I* = 0x00000C70 + GL_PIXEL_MAP_S_TO_S* = 0x00000C71 + GL_PIXEL_MAP_I_TO_R* = 0x00000C72 + GL_PIXEL_MAP_I_TO_G* = 0x00000C73 + GL_PIXEL_MAP_I_TO_B* = 0x00000C74 + GL_PIXEL_MAP_I_TO_A* = 0x00000C75 + GL_PIXEL_MAP_R_TO_R* = 0x00000C76 + GL_PIXEL_MAP_G_TO_G* = 0x00000C77 + GL_PIXEL_MAP_B_TO_B* = 0x00000C78 + GL_PIXEL_MAP_A_TO_A* = 0x00000C79 + GL_PIXEL_MAP_I_TO_I_SIZE* = 0x00000CB0 + GL_PIXEL_MAP_S_TO_S_SIZE* = 0x00000CB1 + GL_PIXEL_MAP_I_TO_R_SIZE* = 0x00000CB2 + GL_PIXEL_MAP_I_TO_G_SIZE* = 0x00000CB3 + GL_PIXEL_MAP_I_TO_B_SIZE* = 0x00000CB4 + GL_PIXEL_MAP_I_TO_A_SIZE* = 0x00000CB5 + GL_PIXEL_MAP_R_TO_R_SIZE* = 0x00000CB6 + GL_PIXEL_MAP_G_TO_G_SIZE* = 0x00000CB7 + GL_PIXEL_MAP_B_TO_B_SIZE* = 0x00000CB8 + GL_PIXEL_MAP_A_TO_A_SIZE* = 0x00000CB9 + GL_UNPACK_SWAP_BYTES* = 0x00000CF0 + GL_UNPACK_LSB_FIRST* = 0x00000CF1 + GL_UNPACK_ROW_LENGTH* = 0x00000CF2 + GL_UNPACK_SKIP_ROWS* = 0x00000CF3 + GL_UNPACK_SKIP_PIXELS* = 0x00000CF4 + GL_UNPACK_ALIGNMENT* = 0x00000CF5 + GL_PACK_SWAP_BYTES* = 0x00000D00 + GL_PACK_LSB_FIRST* = 0x00000D01 + GL_PACK_ROW_LENGTH* = 0x00000D02 + GL_PACK_SKIP_ROWS* = 0x00000D03 + GL_PACK_SKIP_PIXELS* = 0x00000D04 + GL_PACK_ALIGNMENT* = 0x00000D05 + GL_MAP_COLOR* = 0x00000D10 + GL_MAP_STENCIL* = 0x00000D11 + GL_INDEX_SHIFT* = 0x00000D12 + GL_INDEX_OFFSET* = 0x00000D13 + GL_RED_SCALE* = 0x00000D14 + GL_RED_BIAS* = 0x00000D15 + GL_ZOOM_X* = 0x00000D16 + GL_ZOOM_Y* = 0x00000D17 + GL_GREEN_SCALE* = 0x00000D18 + GL_GREEN_BIAS* = 0x00000D19 + GL_BLUE_SCALE* = 0x00000D1A + GL_BLUE_BIAS* = 0x00000D1B + GL_ALPHA_SCALE* = 0x00000D1C + GL_ALPHA_BIAS* = 0x00000D1D + GL_DEPTH_SCALE* = 0x00000D1E + GL_DEPTH_BIAS* = 0x00000D1F + GL_MAX_EVAL_ORDER* = 0x00000D30 + GL_MAX_LIGHTS* = 0x00000D31 + GL_MAX_CLIP_PLANES* = 0x00000D32 + GL_MAX_TEXTURE_SIZE* = 0x00000D33 + GL_MAX_PIXEL_MAP_TABLE* = 0x00000D34 + GL_MAX_ATTRIB_STACK_DEPTH* = 0x00000D35 + GL_MAX_MODELVIEW_STACK_DEPTH* = 0x00000D36 + GL_MAX_NAME_STACK_DEPTH* = 0x00000D37 + GL_MAX_PROJECTION_STACK_DEPTH* = 0x00000D38 + GL_MAX_TEXTURE_STACK_DEPTH* = 0x00000D39 + GL_MAX_VIEWPORT_DIMS* = 0x00000D3A + GL_MAX_CLIENT_ATTRIB_STACK_DEPTH* = 0x00000D3B + GL_SUBPIXEL_BITS* = 0x00000D50 + GL_INDEX_BITS* = 0x00000D51 + GL_RED_BITS* = 0x00000D52 + GL_GREEN_BITS* = 0x00000D53 + GL_BLUE_BITS* = 0x00000D54 + GL_ALPHA_BITS* = 0x00000D55 + GL_DEPTH_BITS* = 0x00000D56 + GL_STENCIL_BITS* = 0x00000D57 + GL_ACCUM_RED_BITS* = 0x00000D58 + GL_ACCUM_GREEN_BITS* = 0x00000D59 + GL_ACCUM_BLUE_BITS* = 0x00000D5A + GL_ACCUM_ALPHA_BITS* = 0x00000D5B + GL_NAME_STACK_DEPTH* = 0x00000D70 + GL_AUTO_NORMAL* = 0x00000D80 + GL_MAP1_COLOR_4* = 0x00000D90 + GL_MAP1_INDEX* = 0x00000D91 + GL_MAP1_NORMAL* = 0x00000D92 + GL_MAP1_TEXTURE_COORD_1* = 0x00000D93 + GL_MAP1_TEXTURE_COORD_2* = 0x00000D94 + GL_MAP1_TEXTURE_COORD_3* = 0x00000D95 + GL_MAP1_TEXTURE_COORD_4* = 0x00000D96 + GL_MAP1_VERTEX_3* = 0x00000D97 + GL_MAP1_VERTEX_4* = 0x00000D98 + GL_MAP2_COLOR_4* = 0x00000DB0 + GL_MAP2_INDEX* = 0x00000DB1 + GL_MAP2_NORMAL* = 0x00000DB2 + GL_MAP2_TEXTURE_COORD_1* = 0x00000DB3 + GL_MAP2_TEXTURE_COORD_2* = 0x00000DB4 + GL_MAP2_TEXTURE_COORD_3* = 0x00000DB5 + GL_MAP2_TEXTURE_COORD_4* = 0x00000DB6 + GL_MAP2_VERTEX_3* = 0x00000DB7 + GL_MAP2_VERTEX_4* = 0x00000DB8 + GL_MAP1_GRID_DOMAIN* = 0x00000DD0 + GL_MAP1_GRID_SEGMENTS* = 0x00000DD1 + GL_MAP2_GRID_DOMAIN* = 0x00000DD2 + GL_MAP2_GRID_SEGMENTS* = 0x00000DD3 + GL_TEXTURE_1D* = 0x00000DE0 + GL_TEXTURE_2D* = 0x00000DE1 + GL_FEEDBACK_BUFFER_POINTER* = 0x00000DF0 + GL_FEEDBACK_BUFFER_SIZE* = 0x00000DF1 + GL_FEEDBACK_BUFFER_TYPE* = 0x00000DF2 + GL_SELECTION_BUFFER_POINTER* = 0x00000DF3 + GL_SELECTION_BUFFER_SIZE* = 0x00000DF4 # GL_TEXTURE_BINDING_1D + # GL_TEXTURE_BINDING_2D + # GL_VERTEX_ARRAY + # GL_NORMAL_ARRAY + # GL_COLOR_ARRAY + # GL_INDEX_ARRAY + # GL_TEXTURE_COORD_ARRAY + # GL_EDGE_FLAG_ARRAY + # GL_VERTEX_ARRAY_SIZE + # GL_VERTEX_ARRAY_TYPE + # GL_VERTEX_ARRAY_STRIDE + # GL_NORMAL_ARRAY_TYPE + # GL_NORMAL_ARRAY_STRIDE + # GL_COLOR_ARRAY_SIZE + # GL_COLOR_ARRAY_TYPE + # GL_COLOR_ARRAY_STRIDE + # GL_INDEX_ARRAY_TYPE + # GL_INDEX_ARRAY_STRIDE + # GL_TEXTURE_COORD_ARRAY_SIZE + # GL_TEXTURE_COORD_ARRAY_TYPE + # GL_TEXTURE_COORD_ARRAY_STRIDE + # GL_EDGE_FLAG_ARRAY_STRIDE + # GL_POLYGON_OFFSET_FACTOR + # GL_POLYGON_OFFSET_UNITS + # GetTextureParameter + # GL_TEXTURE_MAG_FILTER + # GL_TEXTURE_MIN_FILTER + # GL_TEXTURE_WRAP_S + # GL_TEXTURE_WRAP_T + GL_TEXTURE_WIDTH* = 0x00001000 + GL_TEXTURE_HEIGHT* = 0x00001001 + GL_TEXTURE_INTERNAL_FORMAT* = 0x00001003 + GL_TEXTURE_BORDER_COLOR* = 0x00001004 + GL_TEXTURE_BORDER* = 0x00001005 # GL_TEXTURE_RED_SIZE + # GL_TEXTURE_GREEN_SIZE + # GL_TEXTURE_BLUE_SIZE + # GL_TEXTURE_ALPHA_SIZE + # GL_TEXTURE_LUMINANCE_SIZE + # GL_TEXTURE_INTENSITY_SIZE + # GL_TEXTURE_PRIORITY + # GL_TEXTURE_RESIDENT + # HintMode + GL_DONT_CARE* = 0x00001100 + GL_FASTEST* = 0x00001101 + GL_NICEST* = 0x00001102 # HintTarget + # GL_PERSPECTIVE_CORRECTION_HINT + # GL_POINT_SMOOTH_HINT + # GL_LINE_SMOOTH_HINT + # GL_POLYGON_SMOOTH_HINT + # GL_FOG_HINT + # IndexPointerType + # GL_SHORT + # GL_INT + # GL_FLOAT + # GL_DOUBLE + # LightModelParameter + # GL_LIGHT_MODEL_AMBIENT + # GL_LIGHT_MODEL_LOCAL_VIEWER + # GL_LIGHT_MODEL_TWO_SIDE + # LightName + GL_LIGHT0* = 0x00004000 + GL_LIGHT1* = 0x00004001 + GL_LIGHT2* = 0x00004002 + GL_LIGHT3* = 0x00004003 + GL_LIGHT4* = 0x00004004 + GL_LIGHT5* = 0x00004005 + GL_LIGHT6* = 0x00004006 + GL_LIGHT7* = 0x00004007 # LightParameter + GL_AMBIENT* = 0x00001200 + GL_DIFFUSE* = 0x00001201 + GL_SPECULAR* = 0x00001202 + GL_POSITION* = 0x00001203 + GL_SPOT_DIRECTION* = 0x00001204 + GL_SPOT_EXPONENT* = 0x00001205 + GL_SPOT_CUTOFF* = 0x00001206 + GL_CONSTANT_ATTENUATION* = 0x00001207 + GL_LINEAR_ATTENUATION* = 0x00001208 + GL_QUADRATIC_ATTENUATION* = 0x00001209 # InterleavedArrays + # GL_V2F + # GL_V3F + # GL_C4UB_V2F + # GL_C4UB_V3F + # GL_C3F_V3F + # GL_N3F_V3F + # GL_C4F_N3F_V3F + # GL_T2F_V3F + # GL_T4F_V4F + # GL_T2F_C4UB_V3F + # GL_T2F_C3F_V3F + # GL_T2F_N3F_V3F + # GL_T2F_C4F_N3F_V3F + # GL_T4F_C4F_N3F_V4F + # ListMode + GL_COMPILE* = 0x00001300 + GL_COMPILE_AND_EXECUTE* = 0x00001301 # ListNameType + # GL_BYTE + # GL_UNSIGNED_BYTE + # GL_SHORT + # GL_UNSIGNED_SHORT + # GL_INT + # GL_UNSIGNED_INT + # GL_FLOAT + # GL_2_BYTES + # GL_3_BYTES + # GL_4_BYTES + # LogicOp + constGL_CLEAR* = 0x00001500 + GL_AND* = 0x00001501 + GL_AND_REVERSE* = 0x00001502 + GL_COPY* = 0x00001503 + GL_AND_INVERTED* = 0x00001504 + GL_NOOP* = 0x00001505 + GL_XOR* = 0x00001506 + GL_OR* = 0x00001507 + GL_NOR* = 0x00001508 + GL_EQUIV* = 0x00001509 + GL_INVERT* = 0x0000150A + GL_OR_REVERSE* = 0x0000150B + GL_COPY_INVERTED* = 0x0000150C + GL_OR_INVERTED* = 0x0000150D + GL_NAND* = 0x0000150E + GL_SET* = 0x0000150F # MapTarget + # GL_MAP1_COLOR_4 + # GL_MAP1_INDEX + # GL_MAP1_NORMAL + # GL_MAP1_TEXTURE_COORD_1 + # GL_MAP1_TEXTURE_COORD_2 + # GL_MAP1_TEXTURE_COORD_3 + # GL_MAP1_TEXTURE_COORD_4 + # GL_MAP1_VERTEX_3 + # GL_MAP1_VERTEX_4 + # GL_MAP2_COLOR_4 + # GL_MAP2_INDEX + # GL_MAP2_NORMAL + # GL_MAP2_TEXTURE_COORD_1 + # GL_MAP2_TEXTURE_COORD_2 + # GL_MAP2_TEXTURE_COORD_3 + # GL_MAP2_TEXTURE_COORD_4 + # GL_MAP2_VERTEX_3 + # GL_MAP2_VERTEX_4 + # MaterialFace + # GL_FRONT + # GL_BACK + # GL_FRONT_AND_BACK + # MaterialParameter + GL_EMISSION* = 0x00001600 + GL_SHININESS* = 0x00001601 + GL_AMBIENT_AND_DIFFUSE* = 0x00001602 + GL_COLOR_INDEXES* = 0x00001603 # GL_AMBIENT + # GL_DIFFUSE + # GL_SPECULAR + # MatrixMode + GL_MODELVIEW* = 0x00001700 + GL_PROJECTION* = 0x00001701 + GL_TEXTURE* = 0x00001702 # MeshMode1 + # GL_POINT + # GL_LINE + # MeshMode2 + # GL_POINT + # GL_LINE + # GL_FILL + # NormalPointerType + # GL_BYTE + # GL_SHORT + # GL_INT + # GL_FLOAT + # GL_DOUBLE + # PixelCopyType + GL_COLOR* = 0x00001800 + GL_DEPTH* = 0x00001801 + GL_STENCIL* = 0x00001802 # PixelFormat + GL_COLOR_INDEX* = 0x00001900 + GL_STENCIL_INDEX* = 0x00001901 + GL_DEPTH_COMPONENT* = 0x00001902 + GL_RED* = 0x00001903 + GL_GREEN* = 0x00001904 + GL_BLUE* = 0x00001905 + GL_ALPHA* = 0x00001906 + GL_RGB* = 0x00001907 + GL_RGBA* = 0x00001908 + GL_LUMINANCE* = 0x00001909 + GL_LUMINANCE_ALPHA* = 0x0000190A # PixelMap + # GL_PIXEL_MAP_I_TO_I + # GL_PIXEL_MAP_S_TO_S + # GL_PIXEL_MAP_I_TO_R + # GL_PIXEL_MAP_I_TO_G + # GL_PIXEL_MAP_I_TO_B + # GL_PIXEL_MAP_I_TO_A + # GL_PIXEL_MAP_R_TO_R + # GL_PIXEL_MAP_G_TO_G + # GL_PIXEL_MAP_B_TO_B + # GL_PIXEL_MAP_A_TO_A + # PixelStore + # GL_UNPACK_SWAP_BYTES + # GL_UNPACK_LSB_FIRST + # GL_UNPACK_ROW_LENGTH + # GL_UNPACK_SKIP_ROWS + # GL_UNPACK_SKIP_PIXELS + # GL_UNPACK_ALIGNMENT + # GL_PACK_SWAP_BYTES + # GL_PACK_LSB_FIRST + # GL_PACK_ROW_LENGTH + # GL_PACK_SKIP_ROWS + # GL_PACK_SKIP_PIXELS + # GL_PACK_ALIGNMENT + # PixelTransfer + # GL_MAP_COLOR + # GL_MAP_STENCIL + # GL_INDEX_SHIFT + # GL_INDEX_OFFSET + # GL_RED_SCALE + # GL_RED_BIAS + # GL_GREEN_SCALE + # GL_GREEN_BIAS + # GL_BLUE_SCALE + # GL_BLUE_BIAS + # GL_ALPHA_SCALE + # GL_ALPHA_BIAS + # GL_DEPTH_SCALE + # GL_DEPTH_BIAS + # PixelType + constGL_BITMAP* = 0x00001A00 + GL_POINT* = 0x00001B00 + GL_LINE* = 0x00001B01 + GL_FILL* = 0x00001B02 # ReadBufferMode + # GL_FRONT_LEFT + # GL_FRONT_RIGHT + # GL_BACK_LEFT + # GL_BACK_RIGHT + # GL_FRONT + # GL_BACK + # GL_LEFT + # GL_RIGHT + # GL_AUX0 + # GL_AUX1 + # GL_AUX2 + # GL_AUX3 + # RenderingMode + GL_RENDER* = 0x00001C00 + GL_FEEDBACK* = 0x00001C01 + GL_SELECT* = 0x00001C02 # ShadingModel + GL_FLAT* = 0x00001D00 + GL_SMOOTH* = 0x00001D01 # StencilFunction + # GL_NEVER + # GL_LESS + # GL_EQUAL + # GL_LEQUAL + # GL_GREATER + # GL_NOTEQUAL + # GL_GEQUAL + # GL_ALWAYS + # StencilOp + # GL_ZERO + GL_KEEP* = 0x00001E00 + GL_REPLACE* = 0x00001E01 + GL_INCR* = 0x00001E02 + GL_DECR* = 0x00001E03 # GL_INVERT + # StringName + GL_VENDOR* = 0x00001F00 + GL_RENDERER* = 0x00001F01 + GL_VERSION* = 0x00001F02 + GL_EXTENSIONS* = 0x00001F03 # TextureCoordName + GL_S* = 0x00002000 + GL_T* = 0x00002001 + GL_R* = 0x00002002 + GL_Q* = 0x00002003 # TexCoordPointerType + # GL_SHORT + # GL_INT + # GL_FLOAT + # GL_DOUBLE + # TextureEnvMode + GL_MODULATE* = 0x00002100 + GL_DECAL* = 0x00002101 # GL_BLEND + # GL_REPLACE + # TextureEnvParameter + GL_TEXTURE_ENV_MODE* = 0x00002200 + GL_TEXTURE_ENV_COLOR* = 0x00002201 # TextureEnvTarget + GL_TEXTURE_ENV* = 0x00002300 # TextureGenMode + GL_EYE_LINEAR* = 0x00002400 + GL_OBJECT_LINEAR* = 0x00002401 + GL_SPHERE_MAP* = 0x00002402 # TextureGenParameter + GL_TEXTURE_GEN_MODE* = 0x00002500 + GL_OBJECT_PLANE* = 0x00002501 + GL_EYE_PLANE* = 0x00002502 # TextureMagFilter + GL_NEAREST* = 0x00002600 + GL_LINEAR* = 0x00002601 # TextureMinFilter + # GL_NEAREST + # GL_LINEAR + GL_NEAREST_MIPMAP_NEAREST* = 0x00002700 + GL_LINEAR_MIPMAP_NEAREST* = 0x00002701 + GL_NEAREST_MIPMAP_LINEAR* = 0x00002702 + GL_LINEAR_MIPMAP_LINEAR* = 0x00002703 # TextureParameterName + GL_TEXTURE_MAG_FILTER* = 0x00002800 + GL_TEXTURE_MIN_FILTER* = 0x00002801 + GL_TEXTURE_WRAP_S* = 0x00002802 + GL_TEXTURE_WRAP_T* = 0x00002803 # GL_TEXTURE_BORDER_COLOR + # GL_TEXTURE_PRIORITY + # TextureTarget + # GL_TEXTURE_1D + # GL_TEXTURE_2D + # GL_PROXY_TEXTURE_1D + # GL_PROXY_TEXTURE_2D + # TextureWrapMode + GL_CLAMP* = 0x00002900 + GL_REPEAT* = 0x00002901 # VertexPointerType + # GL_SHORT + # GL_INT + # GL_FLOAT + # GL_DOUBLE + # ClientAttribMask + GL_CLIENT_PIXEL_STORE_BIT* = 0x00000001 + GL_CLIENT_VERTEX_ARRAY_BIT* = 0x00000002 + GL_CLIENT_ALL_ATTRIB_BITS* = 0xFFFFFFFF # polygon_offset + GL_POLYGON_OFFSET_FACTOR* = 0x00008038 + GL_POLYGON_OFFSET_UNITS* = 0x00002A00 + GL_POLYGON_OFFSET_POINT* = 0x00002A01 + GL_POLYGON_OFFSET_LINE* = 0x00002A02 + GL_POLYGON_OFFSET_FILL* = 0x00008037 # texture + GL_ALPHA4* = 0x0000803B + GL_ALPHA8* = 0x0000803C + GL_ALPHA12* = 0x0000803D + GL_ALPHA16* = 0x0000803E + GL_LUMINANCE4* = 0x0000803F + GL_LUMINANCE8* = 0x00008040 + GL_LUMINANCE12* = 0x00008041 + GL_LUMINANCE16* = 0x00008042 + GL_LUMINANCE4_ALPHA4* = 0x00008043 + GL_LUMINANCE6_ALPHA2* = 0x00008044 + GL_LUMINANCE8_ALPHA8* = 0x00008045 + GL_LUMINANCE12_ALPHA4* = 0x00008046 + GL_LUMINANCE12_ALPHA12* = 0x00008047 + GL_LUMINANCE16_ALPHA16* = 0x00008048 + GL_INTENSITY* = 0x00008049 + GL_INTENSITY4* = 0x0000804A + GL_INTENSITY8* = 0x0000804B + GL_INTENSITY12* = 0x0000804C + GL_INTENSITY16* = 0x0000804D + GL_R3_G3_B2* = 0x00002A10 + GL_RGB4* = 0x0000804F + GL_RGB5* = 0x00008050 + GL_RGB8* = 0x00008051 + GL_RGB10* = 0x00008052 + GL_RGB12* = 0x00008053 + GL_RGB16* = 0x00008054 + GL_RGBA2* = 0x00008055 + GL_RGBA4* = 0x00008056 + GL_RGB5_A1* = 0x00008057 + GL_RGBA8* = 0x00008058 + GL_RGB10_A2* = 0x00008059 + GL_RGBA12* = 0x0000805A + GL_RGBA16* = 0x0000805B + GL_TEXTURE_RED_SIZE* = 0x0000805C + GL_TEXTURE_GREEN_SIZE* = 0x0000805D + GL_TEXTURE_BLUE_SIZE* = 0x0000805E + GL_TEXTURE_ALPHA_SIZE* = 0x0000805F + GL_TEXTURE_LUMINANCE_SIZE* = 0x00008060 + GL_TEXTURE_INTENSITY_SIZE* = 0x00008061 + GL_PROXY_TEXTURE_1D* = 0x00008063 + GL_PROXY_TEXTURE_2D* = 0x00008064 # texture_object + GL_TEXTURE_PRIORITY* = 0x00008066 + GL_TEXTURE_RESIDENT* = 0x00008067 + GL_TEXTURE_BINDING_1D* = 0x00008068 + GL_TEXTURE_BINDING_2D* = 0x00008069 # vertex_array + GL_VERTEX_ARRAY* = 0x00008074 + GL_NORMAL_ARRAY* = 0x00008075 + GL_COLOR_ARRAY* = 0x00008076 + GL_INDEX_ARRAY* = 0x00008077 + GL_TEXTURE_COORD_ARRAY* = 0x00008078 + GL_EDGE_FLAG_ARRAY* = 0x00008079 + GL_VERTEX_ARRAY_SIZE* = 0x0000807A + GL_VERTEX_ARRAY_TYPE* = 0x0000807B + GL_VERTEX_ARRAY_STRIDE* = 0x0000807C + GL_NORMAL_ARRAY_TYPE* = 0x0000807E + GL_NORMAL_ARRAY_STRIDE* = 0x0000807F + GL_COLOR_ARRAY_SIZE* = 0x00008081 + GL_COLOR_ARRAY_TYPE* = 0x00008082 + GL_COLOR_ARRAY_STRIDE* = 0x00008083 + GL_INDEX_ARRAY_TYPE* = 0x00008085 + GL_INDEX_ARRAY_STRIDE* = 0x00008086 + GL_TEXTURE_COORD_ARRAY_SIZE* = 0x00008088 + GL_TEXTURE_COORD_ARRAY_TYPE* = 0x00008089 + GL_TEXTURE_COORD_ARRAY_STRIDE* = 0x0000808A + GL_EDGE_FLAG_ARRAY_STRIDE* = 0x0000808C + GL_VERTEX_ARRAY_POINTER* = 0x0000808E + GL_NORMAL_ARRAY_POINTER* = 0x0000808F + GL_COLOR_ARRAY_POINTER* = 0x00008090 + GL_INDEX_ARRAY_POINTER* = 0x00008091 + GL_TEXTURE_COORD_ARRAY_POINTER* = 0x00008092 + GL_EDGE_FLAG_ARRAY_POINTER* = 0x00008093 + GL_V2F* = 0x00002A20 + GL_V3F* = 0x00002A21 + GL_C4UB_V2F* = 0x00002A22 + GL_C4UB_V3F* = 0x00002A23 + GL_C3F_V3F* = 0x00002A24 + GL_N3F_V3F* = 0x00002A25 + GL_C4F_N3F_V3F* = 0x00002A26 + GL_T2F_V3F* = 0x00002A27 + GL_T4F_V4F* = 0x00002A28 + GL_T2F_C4UB_V3F* = 0x00002A29 + GL_T2F_C3F_V3F* = 0x00002A2A + GL_T2F_N3F_V3F* = 0x00002A2B + GL_T2F_C4F_N3F_V3F* = 0x00002A2C + GL_T4F_C4F_N3F_V4F* = 0x00002A2D # Extensions + GL_EXT_vertex_array* = 1 + GL_WIN_swap_hint* = 1 + GL_EXT_bgra* = 1 + GL_EXT_paletted_texture* = 1 # EXT_vertex_array + GL_VERTEX_ARRAY_EXT* = 0x00008074 + GL_NORMAL_ARRAY_EXT* = 0x00008075 + GL_COLOR_ARRAY_EXT* = 0x00008076 + GL_INDEX_ARRAY_EXT* = 0x00008077 + GL_TEXTURE_COORD_ARRAY_EXT* = 0x00008078 + GL_EDGE_FLAG_ARRAY_EXT* = 0x00008079 + GL_VERTEX_ARRAY_SIZE_EXT* = 0x0000807A + GL_VERTEX_ARRAY_TYPE_EXT* = 0x0000807B + GL_VERTEX_ARRAY_STRIDE_EXT* = 0x0000807C + GL_VERTEX_ARRAY_COUNT_EXT* = 0x0000807D + GL_NORMAL_ARRAY_TYPE_EXT* = 0x0000807E + GL_NORMAL_ARRAY_STRIDE_EXT* = 0x0000807F + GL_NORMAL_ARRAY_COUNT_EXT* = 0x00008080 + GL_COLOR_ARRAY_SIZE_EXT* = 0x00008081 + GL_COLOR_ARRAY_TYPE_EXT* = 0x00008082 + GL_COLOR_ARRAY_STRIDE_EXT* = 0x00008083 + GL_COLOR_ARRAY_COUNT_EXT* = 0x00008084 + GL_INDEX_ARRAY_TYPE_EXT* = 0x00008085 + GL_INDEX_ARRAY_STRIDE_EXT* = 0x00008086 + GL_INDEX_ARRAY_COUNT_EXT* = 0x00008087 + GL_TEXTURE_COORD_ARRAY_SIZE_EXT* = 0x00008088 + GL_TEXTURE_COORD_ARRAY_TYPE_EXT* = 0x00008089 + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT* = 0x0000808A + GL_TEXTURE_COORD_ARRAY_COUNT_EXT* = 0x0000808B + GL_EDGE_FLAG_ARRAY_STRIDE_EXT* = 0x0000808C + GL_EDGE_FLAG_ARRAY_COUNT_EXT* = 0x0000808D + GL_VERTEX_ARRAY_POINTER_EXT* = 0x0000808E + GL_NORMAL_ARRAY_POINTER_EXT* = 0x0000808F + GL_COLOR_ARRAY_POINTER_EXT* = 0x00008090 + GL_INDEX_ARRAY_POINTER_EXT* = 0x00008091 + GL_TEXTURE_COORD_ARRAY_POINTER_EXT* = 0x00008092 + GL_EDGE_FLAG_ARRAY_POINTER_EXT* = 0x00008093 + GL_DOUBLE_EXT* = GL_DOUBLE # EXT_bgra + GL_BGR_EXT* = 0x000080E0 + GL_BGRA_EXT* = 0x000080E1 # EXT_paletted_texture + # These must match the GL_COLOR_TABLE_*_SGI enumerants + GL_COLOR_TABLE_FORMAT_EXT* = 0x000080D8 + GL_COLOR_TABLE_WIDTH_EXT* = 0x000080D9 + GL_COLOR_TABLE_RED_SIZE_EXT* = 0x000080DA + GL_COLOR_TABLE_GREEN_SIZE_EXT* = 0x000080DB + GL_COLOR_TABLE_BLUE_SIZE_EXT* = 0x000080DC + GL_COLOR_TABLE_ALPHA_SIZE_EXT* = 0x000080DD + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT* = 0x000080DE + GL_COLOR_TABLE_INTENSITY_SIZE_EXT* = 0x000080DF + GL_COLOR_INDEX1_EXT* = 0x000080E2 + GL_COLOR_INDEX2_EXT* = 0x000080E3 + GL_COLOR_INDEX4_EXT* = 0x000080E4 + GL_COLOR_INDEX8_EXT* = 0x000080E5 + GL_COLOR_INDEX12_EXT* = 0x000080E6 + GL_COLOR_INDEX16_EXT* = 0x000080E7 # For compatibility with OpenGL v1.0 + constGL_LOGIC_OP* = GL_INDEX_LOGIC_OP + GL_TEXTURE_COMPONENTS* = GL_TEXTURE_INTERNAL_FORMAT + +proc glAccum*(op: TGLenum, value: TGLfloat){.dynlib: dllname, importc: "glAccum".} +proc glAlphaFunc*(func: TGLenum, theref: TGLclampf){.dynlib: dllname, + importc: "glAlphaFunc".} +proc glAreTexturesResident*(n: TGLsizei, textures: PGLuint, + residences: PGLboolean): TGLboolean{. + dynlib: dllname, importc: "glAreTexturesResident".} +proc glArrayElement*(i: TGLint){.dynlib: dllname, importc: "glArrayElement".} +proc glBegin*(mode: TGLenum){.dynlib: dllname, importc: "glBegin".} +proc glBindTexture*(target: TGLenum, texture: TGLuint){.dynlib: dllname, + importc: "glBindTexture".} +proc glBitmap*(width, height: TGLsizei, xorig, yorig: TGLfloat, + xmove, ymove: TGLfloat, bitmap: PGLubyte){.dynlib: dllname, + importc: "glBitmap".} +proc glBlendFunc*(sfactor, dfactor: TGLenum){.dynlib: dllname, + importc: "glBlendFunc".} +proc glCallList*(list: TGLuint){.dynlib: dllname, importc: "glCallList".} +proc glCallLists*(n: TGLsizei, atype: TGLenum, lists: Pointer){.dynlib: dllname, + importc: "glCallLists".} +proc glClear*(mask: TGLbitfield){.dynlib: dllname, importc: "glClear".} +proc glClearAccum*(red, green, blue, alpha: TGLfloat){.dynlib: dllname, + importc: "glClearAccum".} +proc glClearColor*(red, green, blue, alpha: TGLclampf){.dynlib: dllname, + importc: "glClearColor".} +proc glClearDepth*(depth: TGLclampd){.dynlib: dllname, importc: "glClearDepth".} +proc glClearIndex*(c: TGLfloat){.dynlib: dllname, importc: "glClearIndex".} +proc glClearStencil*(s: TGLint){.dynlib: dllname, importc: "glClearStencil".} +proc glClipPlane*(plane: TGLenum, equation: PGLdouble){.dynlib: dllname, + importc: "glClipPlane".} +proc glColor3b*(red, green, blue: TGlbyte){.dynlib: dllname, + importc: "glColor3b".} +proc glColor3bv*(v: PGLbyte){.dynlib: dllname, importc: "glColor3bv".} +proc glColor3d*(red, green, blue: TGLdouble){.dynlib: dllname, + importc: "glColor3d".} +proc glColor3dv*(v: PGLdouble){.dynlib: dllname, importc: "glColor3dv".} +proc glColor3f*(red, green, blue: TGLfloat){.dynlib: dllname, + importc: "glColor3f".} +proc glColor3fv*(v: PGLfloat){.dynlib: dllname, importc: "glColor3fv".} +proc glColor3i*(red, green, blue: TGLint){.dynlib: dllname, importc: "glColor3i".} +proc glColor3iv*(v: PGLint){.dynlib: dllname, importc: "glColor3iv".} +proc glColor3s*(red, green, blue: TGLshort){.dynlib: dllname, + importc: "glColor3s".} +proc glColor3sv*(v: PGLshort){.dynlib: dllname, importc: "glColor3sv".} +proc glColor3ub*(red, green, blue: TGLubyte){.dynlib: dllname, + importc: "glColor3ub".} +proc glColor3ubv*(v: PGLubyte){.dynlib: dllname, importc: "glColor3ubv".} +proc glColor3ui*(red, green, blue: TGLuint){.dynlib: dllname, + importc: "glColor3ui".} +proc glColor3uiv*(v: PGLuint){.dynlib: dllname, importc: "glColor3uiv".} +proc glColor3us*(red, green, blue: TGLushort){.dynlib: dllname, + importc: "glColor3us".} +proc glColor3usv*(v: PGLushort){.dynlib: dllname, importc: "glColor3usv".} +proc glColor4b*(red, green, blue, alpha: TGlbyte){.dynlib: dllname, + importc: "glColor4b".} +proc glColor4bv*(v: PGLbyte){.dynlib: dllname, importc: "glColor4bv".} +proc glColor4d*(red, green, blue, alpha: TGLdouble){.dynlib: dllname, + importc: "glColor4d".} +proc glColor4dv*(v: PGLdouble){.dynlib: dllname, importc: "glColor4dv".} +proc glColor4f*(red, green, blue, alpha: TGLfloat){.dynlib: dllname, + importc: "glColor4f".} +proc glColor4fv*(v: PGLfloat){.dynlib: dllname, importc: "glColor4fv".} +proc glColor4i*(red, green, blue, alpha: TGLint){.dynlib: dllname, + importc: "glColor4i".} +proc glColor4iv*(v: PGLint){.dynlib: dllname, importc: "glColor4iv".} +proc glColor4s*(red, green, blue, alpha: TGLshort){.dynlib: dllname, + importc: "glColor4s".} +proc glColor4sv*(v: PGLshort){.dynlib: dllname, importc: "glColor4sv".} +proc glColor4ub*(red, green, blue, alpha: TGLubyte){.dynlib: dllname, + importc: "glColor4ub".} +proc glColor4ubv*(v: PGLubyte){.dynlib: dllname, importc: "glColor4ubv".} +proc glColor4ui*(red, green, blue, alpha: TGLuint){.dynlib: dllname, + importc: "glColor4ui".} +proc glColor4uiv*(v: PGLuint){.dynlib: dllname, importc: "glColor4uiv".} +proc glColor4us*(red, green, blue, alpha: TGLushort){.dynlib: dllname, + importc: "glColor4us".} +proc glColor4usv*(v: PGLushort){.dynlib: dllname, importc: "glColor4usv".} +proc glColorMask*(red, green, blue, alpha: TGLboolean){.dynlib: dllname, + importc: "glColorMask".} +proc glColorMaterial*(face, mode: TGLenum){.dynlib: dllname, + importc: "glColorMaterial".} +proc glColorPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, + pointer: Pointer){.dynlib: dllname, + importc: "glColorPointer".} +proc glCopyPixels*(x, y: TGLint, width, height: TGLsizei, atype: TGLenum){. + dynlib: dllname, importc: "glCopyPixels".} +proc glCopyTexImage1D*(target: TGLenum, level: TGLint, internalFormat: TGLenum, + x, y: TGLint, width: TGLsizei, border: TGLint){. + dynlib: dllname, importc: "glCopyTexImage1D".} +proc glCopyTexImage2D*(target: TGLenum, level: TGLint, internalFormat: TGLenum, + x, y: TGLint, width, height: TGLsizei, border: TGLint){. + dynlib: dllname, importc: "glCopyTexImage2D".} +proc glCopyTexSubImage1D*(target: TGLenum, level, xoffset, x, y: TGLint, + width: TGLsizei){.dynlib: dllname, + importc: "glCopyTexSubImage1D".} +proc glCopyTexSubImage2D*(target: TGLenum, + level, xoffset, yoffset, x, y: TGLint, + width, height: TGLsizei){.dynlib: dllname, + importc: "glCopyTexSubImage2D".} +proc glCullFace*(mode: TGLenum){.dynlib: dllname, importc: "glCullFace".} +proc glDeleteLists*(list: TGLuint, range: TGLsizei){.dynlib: dllname, + importc: "glDeleteLists".} +proc glDeleteTextures*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, + importc: "glDeleteTextures".} +proc glDepthFunc*(func: TGLenum){.dynlib: dllname, importc: "glDepthFunc".} +proc glDepthMask*(flag: TGLboolean){.dynlib: dllname, importc: "glDepthMask".} +proc glDepthRange*(zNear, zFar: TGLclampd){.dynlib: dllname, + importc: "glDepthRange".} +proc glDisable*(cap: TGLenum){.dynlib: dllname, importc: "glDisable".} +proc glDisableClientState*(aarray: TGLenum){.dynlib: dllname, + importc: "glDisableClientState".} +proc glDrawArrays*(mode: TGLenum, first: TGLint, count: TGLsizei){. + dynlib: dllname, importc: "glDrawArrays".} +proc glDrawBuffer*(mode: TGLenum){.dynlib: dllname, importc: "glDrawBuffer".} +proc glDrawElements*(mode: TGLenum, count: TGLsizei, atype: TGLenum, + indices: Pointer){.dynlib: dllname, + importc: "glDrawElements".} +proc glDrawPixels*(width, height: TGLsizei, format, atype: TGLenum, + pixels: Pointer){.dynlib: dllname, importc: "glDrawPixels".} +proc glEdgeFlag*(flag: TGLboolean){.dynlib: dllname, importc: "glEdgeFlag".} +proc glEdgeFlagPointer*(stride: TGLsizei, pointer: Pointer){.dynlib: dllname, + importc: "glEdgeFlagPointer".} +proc glEdgeFlagv*(flag: PGLboolean){.dynlib: dllname, importc: "glEdgeFlagv".} +proc glEnable*(cap: TGLenum){.dynlib: dllname, importc: "glEnable".} +proc glEnableClientState*(aarray: TGLenum){.dynlib: dllname, + importc: "glEnableClientState".} +proc glEnd*(){.dynlib: dllname, importc: "glEnd".} +proc glEndList*(){.dynlib: dllname, importc: "glEndList".} +proc glEvalCoord1d*(u: TGLdouble){.dynlib: dllname, importc: "glEvalCoord1d".} +proc glEvalCoord1dv*(u: PGLdouble){.dynlib: dllname, importc: "glEvalCoord1dv".} +proc glEvalCoord1f*(u: TGLfloat){.dynlib: dllname, importc: "glEvalCoord1f".} +proc glEvalCoord1fv*(u: PGLfloat){.dynlib: dllname, importc: "glEvalCoord1fv".} +proc glEvalCoord2d*(u, v: TGLdouble){.dynlib: dllname, importc: "glEvalCoord2d".} +proc glEvalCoord2dv*(u: PGLdouble){.dynlib: dllname, importc: "glEvalCoord2dv".} +proc glEvalCoord2f*(u, v: TGLfloat){.dynlib: dllname, importc: "glEvalCoord2f".} +proc glEvalCoord2fv*(u: PGLfloat){.dynlib: dllname, importc: "glEvalCoord2fv".} +proc glEvalMesh1*(mode: TGLenum, i1, i2: TGLint){.dynlib: dllname, + importc: "glEvalMesh1".} +proc glEvalMesh2*(mode: TGLenum, i1, i2, j1, j2: TGLint){.dynlib: dllname, + importc: "glEvalMesh2".} +proc glEvalPoint1*(i: TGLint){.dynlib: dllname, importc: "glEvalPoint1".} +proc glEvalPoint2*(i, j: TGLint){.dynlib: dllname, importc: "glEvalPoint2".} +proc glFeedbackBuffer*(size: TGLsizei, atype: TGLenum, buffer: PGLfloat){. + dynlib: dllname, importc: "glFeedbackBuffer".} +proc glFinish*(){.dynlib: dllname, importc: "glFinish".} +proc glFlush*(){.dynlib: dllname, importc: "glFlush".} +proc glFogf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glFogf".} +proc glFogfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glFogfv".} +proc glFogi*(pname: TGLenum, param: TGLint){.dynlib: dllname, importc: "glFogi".} +proc glFogiv*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glFogiv".} +proc glFrontFace*(mode: TGLenum){.dynlib: dllname, importc: "glFrontFace".} +proc glFrustum*(left, right, bottom, top, zNear, zFar: TGLdouble){. + dynlib: dllname, importc: "glFrustum".} +proc glGenLists*(range: TGLsizei): TGLuint{.dynlib: dllname, + importc: "glGenLists".} +proc glGenTextures*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, + importc: "glGenTextures".} +proc glGetBooleanv*(pname: TGLenum, params: PGLboolean){.dynlib: dllname, + importc: "glGetBooleanv".} +proc glGetClipPlane*(plane: TGLenum, equation: PGLdouble){.dynlib: dllname, + importc: "glGetClipPlane".} +proc glGetDoublev*(pname: TGLenum, params: PGLdouble){.dynlib: dllname, + importc: "glGetDoublev".} +proc glGetError*(): TGLenum{.dynlib: dllname, importc: "glGetError".} +proc glGetFloatv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glGetFloatv".} +proc glGetIntegerv*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetIntegerv".} +proc glGetLightfv*(light, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glGetLightfv".} +proc glGetLightiv*(light, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetLightiv".} +proc glGetMapdv*(target, query: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glGetMapdv".} +proc glGetMapfv*(target, query: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glGetMapfv".} +proc glGetMapiv*(target, query: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glGetMapiv".} +proc glGetMaterialfv*(face, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glGetMaterialfv".} +proc glGetMaterialiv*(face, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetMaterialiv".} +proc glGetPixelMapfv*(map: TGLenum, values: PGLfloat){.dynlib: dllname, + importc: "glGetPixelMapfv".} +proc glGetPixelMapuiv*(map: TGLenum, values: PGLuint){.dynlib: dllname, + importc: "glGetPixelMapuiv".} +proc glGetPixelMapusv*(map: TGLenum, values: PGLushort){.dynlib: dllname, + importc: "glGetPixelMapusv".} +proc glGetPointerv*(pname: TGLenum, params: Pointer){.dynlib: dllname, + importc: "glGetPointerv".} +proc glGetPolygonStipple*(mask: PGLubyte){.dynlib: dllname, + importc: "glGetPolygonStipple".} +proc glGetString*(name: TGLenum): cstring{.dynlib: dllname, + importc: "glGetString".} +proc glGetTexEnvfv*(target, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glGetTexEnvfv".} +proc glGetTexEnviv*(target, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetTexEnviv".} +proc glGetTexGendv*(coord, pname: TGLenum, params: PGLdouble){.dynlib: dllname, + importc: "glGetTexGendv".} +proc glGetTexGenfv*(coord, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glGetTexGenfv".} +proc glGetTexGeniv*(coord, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetTexGeniv".} +proc glGetTexImage*(target: TGLenum, level: TGLint, format: TGLenum, + atype: TGLenum, pixels: Pointer){.dynlib: dllname, + importc: "glGetTexImage".} +proc glGetTexLevelParameterfv*(target: TGLenum, level: TGLint, pname: TGLenum, + params: Pointer){.dynlib: dllname, + importc: "glGetTexLevelParameterfv".} +proc glGetTexLevelParameteriv*(target: TGLenum, level: TGLint, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetTexLevelParameteriv".} +proc glGetTexParameterfv*(target, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetTexParameterfv".} +proc glGetTexParameteriv*(target, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetTexParameteriv".} +proc glHint*(target, mode: TGLenum){.dynlib: dllname, importc: "glHint".} +proc glIndexMask*(mask: TGLuint){.dynlib: dllname, importc: "glIndexMask".} +proc glIndexPointer*(atype: TGLenum, stride: TGLsizei, pointer: Pointer){. + dynlib: dllname, importc: "glIndexPointer".} +proc glIndexd*(c: TGLdouble){.dynlib: dllname, importc: "glIndexd".} +proc glIndexdv*(c: PGLdouble){.dynlib: dllname, importc: "glIndexdv".} +proc glIndexf*(c: TGLfloat){.dynlib: dllname, importc: "glIndexf".} +proc glIndexfv*(c: PGLfloat){.dynlib: dllname, importc: "glIndexfv".} +proc glIndexi*(c: TGLint){.dynlib: dllname, importc: "glIndexi".} +proc glIndexiv*(c: PGLint){.dynlib: dllname, importc: "glIndexiv".} +proc glIndexs*(c: TGLshort){.dynlib: dllname, importc: "glIndexs".} +proc glIndexsv*(c: PGLshort){.dynlib: dllname, importc: "glIndexsv".} +proc glIndexub*(c: TGLubyte){.dynlib: dllname, importc: "glIndexub".} +proc glIndexubv*(c: PGLubyte){.dynlib: dllname, importc: "glIndexubv".} +proc glInitNames*(){.dynlib: dllname, importc: "glInitNames".} +proc glInterleavedArrays*(format: TGLenum, stride: TGLsizei, pointer: Pointer){. + dynlib: dllname, importc: "glInterleavedArrays".} +proc glIsEnabled*(cap: TGLenum): TGLboolean{.dynlib: dllname, + importc: "glIsEnabled".} +proc glIsList*(list: TGLuint): TGLboolean{.dynlib: dllname, importc: "glIsList".} +proc glIsTexture*(texture: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsTexture".} +proc glLightModelf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glLightModelf".} +proc glLightModelfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glLightModelfv".} +proc glLightModeli*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glLightModeli".} +proc glLightModeliv*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glLightModeliv".} +proc glLightf*(light, pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glLightf".} +proc glLightfv*(light, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glLightfv".} +proc glLighti*(light, pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glLighti".} +proc glLightiv*(light, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glLightiv".} +proc glLineStipple*(factor: TGLint, pattern: TGLushort){.dynlib: dllname, + importc: "glLineStipple".} +proc glLineWidth*(width: TGLfloat){.dynlib: dllname, importc: "glLineWidth".} +proc glListBase*(base: TGLuint){.dynlib: dllname, importc: "glListBase".} +proc glLoadIdentity*(){.dynlib: dllname, importc: "glLoadIdentity".} +proc glLoadMatrixd*(m: PGLdouble){.dynlib: dllname, importc: "glLoadMatrixd".} +proc glLoadMatrixf*(m: PGLfloat){.dynlib: dllname, importc: "glLoadMatrixf".} +proc glLoadName*(name: TGLuint){.dynlib: dllname, importc: "glLoadName".} +proc glLogicOp*(opcode: TGLenum){.dynlib: dllname, importc: "glLogicOp".} +proc glMap1d*(target: TGLenum, u1, u2: TGLdouble, stride, order: TGLint, + points: PGLdouble){.dynlib: dllname, importc: "glMap1d".} +proc glMap1f*(target: TGLenum, u1, u2: TGLfloat, stride, order: TGLint, + points: PGLfloat){.dynlib: dllname, importc: "glMap1f".} +proc glMap2d*(target: TGLenum, u1, u2: TGLdouble, ustride, uorder: TGLint, + v1, v2: TGLdouble, vstride, vorder: TGLint, points: PGLdouble){. + dynlib: dllname, importc: "glMap2d".} +proc glMap2f*(target: TGLenum, u1, u2: TGLfloat, ustride, uorder: TGLint, + v1, v2: TGLfloat, vstride, vorder: TGLint, points: PGLfloat){. + dynlib: dllname, importc: "glMap2f".} +proc glMapGrid1d*(un: TGLint, u1, u2: TGLdouble){.dynlib: dllname, + importc: "glMapGrid1d".} +proc glMapGrid1f*(un: TGLint, u1, u2: TGLfloat){.dynlib: dllname, + importc: "glMapGrid1f".} +proc glMapGrid2d*(un: TGLint, u1, u2: TGLdouble, vn: TGLint, v1, v2: TGLdouble){. + dynlib: dllname, importc: "glMapGrid2d".} +proc glMapGrid2f*(un: TGLint, u1, u2: TGLfloat, vn: TGLint, v1, v2: TGLfloat){. + dynlib: dllname, importc: "glMapGrid2f".} +proc glMaterialf*(face, pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glMaterialf".} +proc glMaterialfv*(face, pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glMaterialfv".} +proc glMateriali*(face, pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glMateriali".} +proc glMaterialiv*(face, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glMaterialiv".} +proc glMatrixMode*(mode: TGLenum){.dynlib: dllname, importc: "glMatrixMode".} +proc glMultMatrixd*(m: PGLdouble){.dynlib: dllname, importc: "glMultMatrixd".} +proc glMultMatrixf*(m: PGLfloat){.dynlib: dllname, importc: "glMultMatrixf".} +proc glNewList*(list: TGLuint, mode: TGLenum){.dynlib: dllname, + importc: "glNewList".} +proc glNormal3b*(nx, ny, nz: TGlbyte){.dynlib: dllname, importc: "glNormal3b".} +proc glNormal3bv*(v: PGLbyte){.dynlib: dllname, importc: "glNormal3bv".} +proc glNormal3d*(nx, ny, nz: TGLdouble){.dynlib: dllname, importc: "glNormal3d".} +proc glNormal3dv*(v: PGLdouble){.dynlib: dllname, importc: "glNormal3dv".} +proc glNormal3f*(nx, ny, nz: TGLfloat){.dynlib: dllname, importc: "glNormal3f".} +proc glNormal3fv*(v: PGLfloat){.dynlib: dllname, importc: "glNormal3fv".} +proc glNormal3i*(nx, ny, nz: TGLint){.dynlib: dllname, importc: "glNormal3i".} +proc glNormal3iv*(v: PGLint){.dynlib: dllname, importc: "glNormal3iv".} +proc glNormal3s*(nx, ny, nz: TGLshort){.dynlib: dllname, importc: "glNormal3s".} +proc glNormal3sv*(v: PGLshort){.dynlib: dllname, importc: "glNormal3sv".} +proc glNormalPointer*(atype: TGLenum, stride: TGLsizei, pointer: Pointer){. + dynlib: dllname, importc: "glNormalPointer".} +proc glOrtho*(left, right, bottom, top, zNear, zFar: TGLdouble){. + dynlib: dllname, importc: "glOrtho".} +proc glPassThrough*(token: TGLfloat){.dynlib: dllname, importc: "glPassThrough".} +proc glPixelMapfv*(map: TGLenum, mapsize: TGLsizei, values: PGLfloat){. + dynlib: dllname, importc: "glPixelMapfv".} +proc glPixelMapuiv*(map: TGLenum, mapsize: TGLsizei, values: PGLuint){. + dynlib: dllname, importc: "glPixelMapuiv".} +proc glPixelMapusv*(map: TGLenum, mapsize: TGLsizei, values: PGLushort){. + dynlib: dllname, importc: "glPixelMapusv".} +proc glPixelStoref*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPixelStoref".} +proc glPixelStorei*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glPixelStorei".} +proc glPixelTransferf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPixelTransferf".} +proc glPixelTransferi*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glPixelTransferi".} +proc glPixelZoom*(xfactor, yfactor: TGLfloat){.dynlib: dllname, + importc: "glPixelZoom".} +proc glPointSize*(size: TGLfloat){.dynlib: dllname, importc: "glPointSize".} +proc glPolygonMode*(face, mode: TGLenum){.dynlib: dllname, + importc: "glPolygonMode".} +proc glPolygonOffset*(factor, units: TGLfloat){.dynlib: dllname, + importc: "glPolygonOffset".} +proc glPolygonStipple*(mask: PGLubyte){.dynlib: dllname, + importc: "glPolygonStipple".} +proc glPopAttrib*(){.dynlib: dllname, importc: "glPopAttrib".} +proc glPopClientAttrib*(){.dynlib: dllname, importc: "glPopClientAttrib".} +proc glPopMatrix*(){.dynlib: dllname, importc: "glPopMatrix".} +proc glPopName*(){.dynlib: dllname, importc: "glPopName".} +proc glPrioritizeTextures*(n: TGLsizei, textures: PGLuint, priorities: PGLclampf){. + dynlib: dllname, importc: "glPrioritizeTextures".} +proc glPushAttrib*(mask: TGLbitfield){.dynlib: dllname, importc: "glPushAttrib".} +proc glPushClientAttrib*(mask: TGLbitfield){.dynlib: dllname, + importc: "glPushClientAttrib".} +proc glPushMatrix*(){.dynlib: dllname, importc: "glPushMatrix".} +proc glPushName*(name: TGLuint){.dynlib: dllname, importc: "glPushName".} +proc glRasterPos2d*(x, y: TGLdouble){.dynlib: dllname, importc: "glRasterPos2d".} +proc glRasterPos2dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos2dv".} +proc glRasterPos2f*(x, y: TGLfloat){.dynlib: dllname, importc: "glRasterPos2f".} +proc glRasterPos2fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos2fv".} +proc glRasterPos2i*(x, y: TGLint){.dynlib: dllname, importc: "glRasterPos2i".} +proc glRasterPos2iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos2iv".} +proc glRasterPos2s*(x, y: TGLshort){.dynlib: dllname, importc: "glRasterPos2s".} +proc glRasterPos2sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos2sv".} +proc glRasterPos3d*(x, y, z: TGLdouble){.dynlib: dllname, + importc: "glRasterPos3d".} +proc glRasterPos3dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos3dv".} +proc glRasterPos3f*(x, y, z: TGLfloat){.dynlib: dllname, + importc: "glRasterPos3f".} +proc glRasterPos3fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos3fv".} +proc glRasterPos3i*(x, y, z: TGLint){.dynlib: dllname, importc: "glRasterPos3i".} +proc glRasterPos3iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos3iv".} +proc glRasterPos3s*(x, y, z: TGLshort){.dynlib: dllname, + importc: "glRasterPos3s".} +proc glRasterPos3sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos3sv".} +proc glRasterPos4d*(x, y, z, w: TGLdouble){.dynlib: dllname, + importc: "glRasterPos4d".} +proc glRasterPos4dv*(v: PGLdouble){.dynlib: dllname, importc: "glRasterPos4dv".} +proc glRasterPos4f*(x, y, z, w: TGLfloat){.dynlib: dllname, + importc: "glRasterPos4f".} +proc glRasterPos4fv*(v: PGLfloat){.dynlib: dllname, importc: "glRasterPos4fv".} +proc glRasterPos4i*(x, y, z, w: TGLint){.dynlib: dllname, + importc: "glRasterPos4i".} +proc glRasterPos4iv*(v: PGLint){.dynlib: dllname, importc: "glRasterPos4iv".} +proc glRasterPos4s*(x, y, z, w: TGLshort){.dynlib: dllname, + importc: "glRasterPos4s".} +proc glRasterPos4sv*(v: PGLshort){.dynlib: dllname, importc: "glRasterPos4sv".} +proc glReadBuffer*(mode: TGLenum){.dynlib: dllname, importc: "glReadBuffer".} +proc glReadPixels*(x, y: TGLint, width, height: TGLsizei, + format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, + importc: "glReadPixels".} +proc glRectd*(x1, y1, x2, y2: TGLdouble){.dynlib: dllname, importc: "glRectd".} +proc glRectdv*(v1: PGLdouble, v2: PGLdouble){.dynlib: dllname, + importc: "glRectdv".} +proc glRectf*(x1, y1, x2, y2: TGLfloat){.dynlib: dllname, importc: "glRectf".} +proc glRectfv*(v1: PGLfloat, v2: PGLfloat){.dynlib: dllname, importc: "glRectfv".} +proc glRecti*(x1, y1, x2, y2: TGLint){.dynlib: dllname, importc: "glRecti".} +proc glRectiv*(v1: PGLint, v2: PGLint){.dynlib: dllname, importc: "glRectiv".} +proc glRects*(x1, y1, x2, y2: TGLshort){.dynlib: dllname, importc: "glRects".} +proc glRectsv*(v1: PGLshort, v2: PGLshort){.dynlib: dllname, importc: "glRectsv".} +proc glRenderMode*(mode: TGLint): TGLint{.dynlib: dllname, + importc: "glRenderMode".} +proc glRotated*(angle, x, y, z: TGLdouble){.dynlib: dllname, + importc: "glRotated".} +proc glRotatef*(angle, x, y, z: TGLfloat){.dynlib: dllname, importc: "glRotatef".} +proc glScaled*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glScaled".} +proc glScalef*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glScalef".} +proc glScissor*(x, y: TGLint, width, height: TGLsizei){.dynlib: dllname, + importc: "glScissor".} +proc glSelectBuffer*(size: TGLsizei, buffer: PGLuint){.dynlib: dllname, + importc: "glSelectBuffer".} +proc glShadeModel*(mode: TGLenum){.dynlib: dllname, importc: "glShadeModel".} +proc glStencilFunc*(func: TGLenum, theref: TGLint, mask: TGLuint){. + dynlib: dllname, importc: "glStencilFunc".} +proc glStencilMask*(mask: TGLuint){.dynlib: dllname, importc: "glStencilMask".} +proc glStencilOp*(fail, zfail, zpass: TGLenum){.dynlib: dllname, + importc: "glStencilOp".} +proc glTexCoord1d*(s: TGLdouble){.dynlib: dllname, importc: "glTexCoord1d".} +proc glTexCoord1dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord1dv".} +proc glTexCoord1f*(s: TGLfloat){.dynlib: dllname, importc: "glTexCoord1f".} +proc glTexCoord1fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord1fv".} +proc glTexCoord1i*(s: TGLint){.dynlib: dllname, importc: "glTexCoord1i".} +proc glTexCoord1iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord1iv".} +proc glTexCoord1s*(s: TGLshort){.dynlib: dllname, importc: "glTexCoord1s".} +proc glTexCoord1sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord1sv".} +proc glTexCoord2d*(s, t: TGLdouble){.dynlib: dllname, importc: "glTexCoord2d".} +proc glTexCoord2dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord2dv".} +proc glTexCoord2f*(s, t: TGLfloat){.dynlib: dllname, importc: "glTexCoord2f".} +proc glTexCoord2fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord2fv".} +proc glTexCoord2i*(s, t: TGLint){.dynlib: dllname, importc: "glTexCoord2i".} +proc glTexCoord2iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord2iv".} +proc glTexCoord2s*(s, t: TGLshort){.dynlib: dllname, importc: "glTexCoord2s".} +proc glTexCoord2sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord2sv".} +proc glTexCoord3d*(s, t, r: TGLdouble){.dynlib: dllname, importc: "glTexCoord3d".} +proc glTexCoord3dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord3dv".} +proc glTexCoord3f*(s, t, r: TGLfloat){.dynlib: dllname, importc: "glTexCoord3f".} +proc glTexCoord3fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord3fv".} +proc glTexCoord3i*(s, t, r: TGLint){.dynlib: dllname, importc: "glTexCoord3i".} +proc glTexCoord3iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord3iv".} +proc glTexCoord3s*(s, t, r: TGLshort){.dynlib: dllname, importc: "glTexCoord3s".} +proc glTexCoord3sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord3sv".} +proc glTexCoord4d*(s, t, r, q: TGLdouble){.dynlib: dllname, + importc: "glTexCoord4d".} +proc glTexCoord4dv*(v: PGLdouble){.dynlib: dllname, importc: "glTexCoord4dv".} +proc glTexCoord4f*(s, t, r, q: TGLfloat){.dynlib: dllname, + importc: "glTexCoord4f".} +proc glTexCoord4fv*(v: PGLfloat){.dynlib: dllname, importc: "glTexCoord4fv".} +proc glTexCoord4i*(s, t, r, q: TGLint){.dynlib: dllname, importc: "glTexCoord4i".} +proc glTexCoord4iv*(v: PGLint){.dynlib: dllname, importc: "glTexCoord4iv".} +proc glTexCoord4s*(s, t, r, q: TGLshort){.dynlib: dllname, + importc: "glTexCoord4s".} +proc glTexCoord4sv*(v: PGLshort){.dynlib: dllname, importc: "glTexCoord4sv".} +proc glTexCoordPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, + pointer: Pointer){.dynlib: dllname, + importc: "glTexCoordPointer".} +proc glTexEnvf*(target: TGLenum, pname: TGLenum, param: TGLfloat){. + dynlib: dllname, importc: "glTexEnvf".} +proc glTexEnvfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glTexEnvfv".} +proc glTexEnvi*(target: TGLenum, pname: TGLenum, param: TGLint){. + dynlib: dllname, importc: "glTexEnvi".} +proc glTexEnviv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glTexEnviv".} +proc glTexGend*(coord: TGLenum, pname: TGLenum, param: TGLdouble){. + dynlib: dllname, importc: "glTexGend".} +proc glTexGendv*(coord: TGLenum, pname: TGLenum, params: PGLdouble){. + dynlib: dllname, importc: "glTexGendv".} +proc glTexGenf*(coord: TGLenum, pname: TGLenum, param: TGLfloat){. + dynlib: dllname, importc: "glTexGenf".} +proc glTexGenfv*(coord: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glTexGenfv".} +proc glTexGeni*(coord: TGLenum, pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glTexGeni".} +proc glTexGeniv*(coord: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glTexGeniv".} +proc glTexImage1D*(target: TGLenum, level, internalformat: TGLint, + width: TGLsizei, border: TGLint, format, atype: TGLenum, + pixels: Pointer){.dynlib: dllname, importc: "glTexImage1D".} +proc glTexImage2D*(target: TGLenum, level, internalformat: TGLint, + width, height: TGLsizei, border: TGLint, + format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, + importc: "glTexImage2D".} +proc glTexParameterf*(target: TGLenum, pname: TGLenum, param: TGLfloat){. + dynlib: dllname, importc: "glTexParameterf".} +proc glTexParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glTexParameterfv".} +proc glTexParameteri*(target: TGLenum, pname: TGLenum, param: TGLint){. + dynlib: dllname, importc: "glTexParameteri".} +proc glTexParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glTexParameteriv".} +proc glTexSubImage1D*(target: TGLenum, level, xoffset: TGLint, width: TGLsizei, + format, atype: TGLenum, pixels: Pointer){.dynlib: dllname, + importc: "glTexSubImage1D".} +proc glTexSubImage2D*(target: TGLenum, level, xoffset, yoffset: TGLint, + width, height: TGLsizei, format, atype: TGLenum, + pixels: Pointer){.dynlib: dllname, + importc: "glTexSubImage2D".} +proc glTranslated*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glTranslated".} +proc glTranslatef*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glTranslatef".} +proc glVertex2d*(x, y: TGLdouble){.dynlib: dllname, importc: "glVertex2d".} +proc glVertex2dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex2dv".} +proc glVertex2f*(x, y: TGLfloat){.dynlib: dllname, importc: "glVertex2f".} +proc glVertex2fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex2fv".} +proc glVertex2i*(x, y: TGLint){.dynlib: dllname, importc: "glVertex2i".} +proc glVertex2iv*(v: PGLint){.dynlib: dllname, importc: "glVertex2iv".} +proc glVertex2s*(x, y: TGLshort){.dynlib: dllname, importc: "glVertex2s".} +proc glVertex2sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex2sv".} +proc glVertex3d*(x, y, z: TGLdouble){.dynlib: dllname, importc: "glVertex3d".} +proc glVertex3dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex3dv".} +proc glVertex3f*(x, y, z: TGLfloat){.dynlib: dllname, importc: "glVertex3f".} +proc glVertex3fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex3fv".} +proc glVertex3i*(x, y, z: TGLint){.dynlib: dllname, importc: "glVertex3i".} +proc glVertex3iv*(v: PGLint){.dynlib: dllname, importc: "glVertex3iv".} +proc glVertex3s*(x, y, z: TGLshort){.dynlib: dllname, importc: "glVertex3s".} +proc glVertex3sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex3sv".} +proc glVertex4d*(x, y, z, w: TGLdouble){.dynlib: dllname, importc: "glVertex4d".} +proc glVertex4dv*(v: PGLdouble){.dynlib: dllname, importc: "glVertex4dv".} +proc glVertex4f*(x, y, z, w: TGLfloat){.dynlib: dllname, importc: "glVertex4f".} +proc glVertex4fv*(v: PGLfloat){.dynlib: dllname, importc: "glVertex4fv".} +proc glVertex4i*(x, y, z, w: TGLint){.dynlib: dllname, importc: "glVertex4i".} +proc glVertex4iv*(v: PGLint){.dynlib: dllname, importc: "glVertex4iv".} +proc glVertex4s*(x, y, z, w: TGLshort){.dynlib: dllname, importc: "glVertex4s".} +proc glVertex4sv*(v: PGLshort){.dynlib: dllname, importc: "glVertex4sv".} +proc glVertexPointer*(size: TGLint, atype: TGLenum, stride: TGLsizei, + pointer: Pointer){.dynlib: dllname, + importc: "glVertexPointer".} +proc glViewport*(x, y: TGLint, width, height: TGLsizei){.dynlib: dllname, + importc: "glViewport".} +type + PFN_GLARRAY_ELEMENT_EXTPROC* = proc (i: TGLint) + PFN_GLDRAW_ARRAYS_EXTPROC* = proc (mode: TGLenum, first: TGLint, + count: TGLsizei) + PFN_GLVERTEX_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, + stride, count: TGLsizei, + pointer: Pointer) + PFN_GLNORMAL_POINTER_EXTPROC* = proc (atype: TGLenum, stride, count: TGLsizei, + pointer: Pointer) + PFN_GLCOLOR_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, + stride, count: TGLsizei, pointer: Pointer) + PFN_GLINDEX_POINTER_EXTPROC* = proc (atype: TGLenum, stride, count: TGLsizei, + pointer: Pointer) + PFN_GLTEXCOORD_POINTER_EXTPROC* = proc (size: TGLint, atype: TGLenum, + stride, count: TGLsizei, pointer: Pointer) + PFN_GLEDGEFLAG_POINTER_EXTPROC* = proc (stride, count: TGLsizei, + pointer: PGLboolean) + PFN_GLGET_POINTER_VEXT_PROC* = proc (pname: TGLenum, params: Pointer) + PFN_GLARRAY_ELEMENT_ARRAY_EXTPROC* = proc (mode: TGLenum, count: TGLsizei, + pi: Pointer) # WIN_swap_hint + PFN_GLADDSWAPHINT_RECT_WINPROC* = proc (x, y: TGLint, width, height: TGLsizei) + PFN_GLCOLOR_TABLE_EXTPROC* = proc (target, internalFormat: TGLenum, + width: TGLsizei, format, atype: TGLenum, + data: Pointer) + PFN_GLCOLOR_SUBTABLE_EXTPROC* = proc (target: TGLenum, start, count: TGLsizei, + format, atype: TGLenum, data: Pointer) + PFN_GLGETCOLOR_TABLE_EXTPROC* = proc (target, format, atype: TGLenum, + data: Pointer) + PFN_GLGETCOLOR_TABLE_PARAMETER_IVEXTPROC* = proc (target, pname: TGLenum, + params: PGLint) + PFN_GLGETCOLOR_TABLE_PARAMETER_FVEXTPROC* = proc (target, pname: TGLenum, + params: PGLfloat) + +{.pop.} +# implementation diff --git a/lib/newwrap/opengl/glext.nim b/lib/newwrap/opengl/glext.nim new file mode 100644 index 000000000..32871df0e --- /dev/null +++ b/lib/newwrap/opengl/glext.nim @@ -0,0 +1,4673 @@ +# +# +# Adaption of the delphi3d.net OpenGL units to FreePascal +# Sebastian Guenther (sg@freepascal.org) in 2002 +# These units are free to use +# +# + +#************************************************* +# * OpenGL extension loading library * +# * Generated by MetaGLext, written by Tom Nuydens * +# * (tom@delphi3d.net -- http://www.delphi3d.net * +# ************************************************* +#*** Generated on 10/11/2002 + +when defined(windows): + {.push, callconv: stdcall.} +else: + {.push, callconv: cdecl.} +import + gl + +type + GLcharARB* = Char + TGLcharARB* = GLcharARB + PGLcharARB* = ptr GLcharARB + GLhandleARB* = int + TGLhandleARB* = GLhandleARB + PGLhandleARB* = ptr GLhandleARB + GLintptr* = int + TGLintptr* = GLintptr + PGLintptr* = ptr GLintptr + GLsizeiptr* = int + TGLsizeiptr* = GLsizeiptr + PGLsizeiptr* = ptr GLsizeiptr + GLchar* = Char + TGLchar* = GLchar + PGLchar* = cstring #***** GL_version_1_2 *****// + +const + GL_UNSIGNED_BYTE_3_3_2* = 0x00008032 + GL_UNSIGNED_SHORT_4_4_4_4* = 0x00008033 + GL_UNSIGNED_SHORT_5_5_5_1* = 0x00008034 + GL_UNSIGNED_INT_8_8_8_8* = 0x00008035 + GL_UNSIGNED_INT_10_10_10_2* = 0x00008036 + GL_RESCALE_NORMAL* = 0x0000803A + GL_UNSIGNED_BYTE_2_3_3_REV* = 0x00008362 + GL_UNSIGNED_SHORT_5_6_5* = 0x00008363 + GL_UNSIGNED_SHORT_5_6_5_REV* = 0x00008364 + GL_UNSIGNED_SHORT_4_4_4_4_REV* = 0x00008365 + GL_UNSIGNED_SHORT_1_5_5_5_REV* = 0x00008366 + GL_UNSIGNED_INT_8_8_8_8_REV* = 0x00008367 + GL_UNSIGNED_INT_2_10_10_10_REV* = 0x00008368 + GL_BGR* = 0x000080E0 + GL_BGRA* = 0x000080E1 + GL_MAX_ELEMENTS_VERTICES* = 0x000080E8 + GL_MAX_ELEMENTS_INDICES* = 0x000080E9 + GL_CLAMP_TO_EDGE* = 0x0000812F + GL_TEXTURE_MIN_LOD* = 0x0000813A + GL_TEXTURE_MAX_LOD* = 0x0000813B + GL_TEXTURE_BASE_LEVEL* = 0x0000813C + GL_TEXTURE_MAX_LEVEL* = 0x0000813D + GL_LIGHT_MODEL_COLOR_CONTROL* = 0x000081F8 + GL_SINGLE_COLOR* = 0x000081F9 + GL_SEPARATE_SPECULAR_COLOR* = 0x000081FA + GL_SMOOTH_POINT_SIZE_RANGE* = 0x00000B12 + GL_SMOOTH_POINT_SIZE_GRANULARITY* = 0x00000B13 + GL_SMOOTH_LINE_WIDTH_RANGE* = 0x00000B22 + GL_SMOOTH_LINE_WIDTH_GRANULARITY* = 0x00000B23 + GL_ALIASED_POINT_SIZE_RANGE* = 0x0000846D + GL_ALIASED_LINE_WIDTH_RANGE* = 0x0000846E + GL_PACK_SKIP_IMAGES* = 0x0000806B + GL_PACK_IMAGE_HEIGHT* = 0x0000806C + GL_UNPACK_SKIP_IMAGES* = 0x0000806D + GL_UNPACK_IMAGE_HEIGHT* = 0x0000806E + GL_TEXTURE_3D* = 0x0000806F + GL_PROXY_TEXTURE_3D* = 0x00008070 + GL_TEXTURE_DEPTH* = 0x00008071 + GL_TEXTURE_WRAP_R* = 0x00008072 + GL_MAX_3D_TEXTURE_SIZE* = 0x00008073 + +proc glBlendColor*(red: TGLclampf, green: TGLclampf, blue: TGLclampf, + alpha: TGLclampf){.dynlib: dllname, importc: "glBlendColor".} +proc glBlendEquation*(mode: TGLenum){.dynlib: dllname, + importc: "glBlendEquation".} +proc glDrawRangeElements*(mode: TGLenum, start: TGLuint, theend: TGLuint, + count: TGLsizei, thetype: TGLenum, indices: PGLvoid){. + dynlib: dllname, importc: "glDrawRangeElements".} +proc glColorTable*(target: TGLenum, internalformat: TGLenum, width: TGLsizei, + format: TGLenum, thetype: TGLenum, table: PGLvoid){. + dynlib: dllname, importc: "glColorTable".} +proc glColorTableParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glColorTableParameterfv".} +proc glColorTableParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glColorTableParameteriv".} +proc glCopyColorTable*(target: TGLenum, internalformat: TGLenum, x: TGLint, + y: TGLint, width: TGLsizei){.dynlib: dllname, + importc: "glCopyColorTable".} +proc glGetColorTable*(target: TGLenum, format: TGLenum, thetype: TGLenum, + table: PGLvoid){.dynlib: dllname, + importc: "glGetColorTable".} +proc glGetColorTableParameterfv*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetColorTableParameterfv".} +proc glGetColorTableParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetColorTableParameteriv".} +proc glColorSubTable*(target: TGLenum, start: TGLsizei, count: TGLsizei, + format: TGLenum, thetype: TGLenum, data: PGLvoid){. + dynlib: dllname, importc: "glColorSubTable".} +proc glCopyColorSubTable*(target: TGLenum, start: TGLsizei, x: TGLint, + y: TGLint, width: TGLsizei){.dynlib: dllname, + importc: "glCopyColorSubTable".} +proc glConvolutionFilter1D*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, format: TGLenum, thetype: TGLenum, + image: PGLvoid){.dynlib: dllname, + importc: "glConvolutionFilter1D".} +proc glConvolutionFilter2D*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei, format: TGLenum, + thetype: TGLenum, image: PGLvoid){.dynlib: dllname, + importc: "glConvolutionFilter2D".} +proc glConvolutionParameterf*(target: TGLenum, pname: TGLenum, params: TGLfloat){. + dynlib: dllname, importc: "glConvolutionParameterf".} +proc glConvolutionParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glConvolutionParameterfv".} +proc glConvolutionParameteri*(target: TGLenum, pname: TGLenum, params: TGLint){. + dynlib: dllname, importc: "glConvolutionParameteri".} +proc glConvolutionParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glConvolutionParameteriv".} +proc glCopyConvolutionFilter1D*(target: TGLenum, internalformat: TGLenum, + x: TGLint, y: TGLint, width: TGLsizei){. + dynlib: dllname, importc: "glCopyConvolutionFilter1D".} +proc glCopyConvolutionFilter2D*(target: TGLenum, internalformat: TGLenum, + x: TGLint, y: TGLint, width: TGLsizei, + height: TGLsizei){.dynlib: dllname, + importc: "glCopyConvolutionFilter2D".} +proc glGetConvolutionFilter*(target: TGLenum, format: TGLenum, thetype: TGLenum, + image: PGLvoid){.dynlib: dllname, + importc: "glGetConvolutionFilter".} +proc glGetConvolutionParameterfv*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetConvolutionParameterfv".} +proc glGetConvolutionParameteriv*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetConvolutionParameteriv".} +proc glGetSeparableFilter*(target: TGLenum, format: TGLenum, thetype: TGLenum, + row: PGLvoid, column: PGLvoid, span: PGLvoid){. + dynlib: dllname, importc: "glGetSeparableFilter".} +proc glSeparableFilter2D*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei, format: TGLenum, + thetype: TGLenum, row: PGLvoid, column: PGLvoid){. + dynlib: dllname, importc: "glSeparableFilter2D".} +proc glGetHistogram*(target: TGLenum, reset: TGLboolean, format: TGLenum, + thetype: TGLenum, values: PGLvoid){.dynlib: dllname, + importc: "glGetHistogram".} +proc glGetHistogramParameterfv*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetHistogramParameterfv".} +proc glGetHistogramParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetHistogramParameteriv".} +proc glGetMinmax*(target: TGLenum, reset: TGLboolean, format: TGLenum, + thetype: TGLenum, values: PGLvoid){.dynlib: dllname, + importc: "glGetMinmax".} +proc glGetMinmaxParameterfv*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetMinmaxParameterfv".} +proc glGetMinmaxParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetMinmaxParameteriv".} +proc glHistogram*(target: TGLenum, width: TGLsizei, internalformat: TGLenum, + sink: TGLboolean){.dynlib: dllname, importc: "glHistogram".} +proc glMinmax*(target: TGLenum, internalformat: TGLenum, sink: TGLboolean){. + dynlib: dllname, importc: "glMinmax".} +proc glResetHistogram*(target: TGLenum){.dynlib: dllname, + importc: "glResetHistogram".} +proc glResetMinmax*(target: TGLenum){.dynlib: dllname, importc: "glResetMinmax".} +proc glTexImage3D*(target: TGLenum, level: TGLint, internalformat: TGLint, + width: TGLsizei, height: TGLsizei, depth: TGLsizei, + border: TGLint, format: TGLenum, thetype: TGLenum, + pixels: PGLvoid){.dynlib: dllname, importc: "glTexImage3D".} +proc glTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, zoffset: TGLint, width: TGLsizei, + height: TGLsizei, depth: TGLsizei, format: TGLenum, + thetype: TGLenum, pixels: PGLvoid){.dynlib: dllname, + importc: "glTexSubImage3D".} +proc glCopyTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, zoffset: TGLint, x: TGLint, + y: TGLint, width: TGLsizei, height: TGLsizei){. + dynlib: dllname, importc: "glCopyTexSubImage3D".} +proc glActiveTextureARB*(texture: TGLenum){.dynlib: dllname, + importc: "glActiveTextureARB".} +proc glClientActiveTextureARB*(texture: TGLenum){.dynlib: dllname, + importc: "glClientActiveTextureARB".} +proc glMultiTexCoord1dARB*(target: TGLenum, s: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord1dARB".} +proc glMultiTexCoord1dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord1dvARB".} +proc glMultiTexCoord1fARB*(target: TGLenum, s: TGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord1fARB".} +proc glMultiTexCoord1fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord1fvARB".} +proc glMultiTexCoord1iARB*(target: TGLenum, s: TGLint){.dynlib: dllname, + importc: "glMultiTexCoord1iARB".} +proc glMultiTexCoord1ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord1ivARB".} +proc glMultiTexCoord1sARB*(target: TGLenum, s: TGLshort){.dynlib: dllname, + importc: "glMultiTexCoord1sARB".} +proc glMultiTexCoord1svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord1svARB".} +proc glMultiTexCoord2dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble){. + dynlib: dllname, importc: "glMultiTexCoord2dARB".} +proc glMultiTexCoord2dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord2dvARB".} +proc glMultiTexCoord2fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat){. + dynlib: dllname, importc: "glMultiTexCoord2fARB".} +proc glMultiTexCoord2fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord2fvARB".} +proc glMultiTexCoord2iARB*(target: TGLenum, s: TGLint, t: TGLint){. + dynlib: dllname, importc: "glMultiTexCoord2iARB".} +proc glMultiTexCoord2ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord2ivARB".} +proc glMultiTexCoord2sARB*(target: TGLenum, s: TGLshort, t: TGLshort){. + dynlib: dllname, importc: "glMultiTexCoord2sARB".} +proc glMultiTexCoord2svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord2svARB".} +proc glMultiTexCoord3dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble, + r: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord3dARB".} +proc glMultiTexCoord3dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord3dvARB".} +proc glMultiTexCoord3fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat, + r: TGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord3fARB".} +proc glMultiTexCoord3fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord3fvARB".} +proc glMultiTexCoord3iARB*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint){. + dynlib: dllname, importc: "glMultiTexCoord3iARB".} +proc glMultiTexCoord3ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord3ivARB".} +proc glMultiTexCoord3sARB*(target: TGLenum, s: TGLshort, t: TGLshort, + r: TGLshort){.dynlib: dllname, + importc: "glMultiTexCoord3sARB".} +proc glMultiTexCoord3svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord3svARB".} +proc glMultiTexCoord4dARB*(target: TGLenum, s: TGLdouble, t: TGLdouble, + r: TGLdouble, q: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord4dARB".} +proc glMultiTexCoord4dvARB*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord4dvARB".} +proc glMultiTexCoord4fARB*(target: TGLenum, s: TGLfloat, t: TGLfloat, + r: TGLfloat, q: TGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord4fARB".} +proc glMultiTexCoord4fvARB*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord4fvARB".} +proc glMultiTexCoord4iARB*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint, + q: TGLint){.dynlib: dllname, + importc: "glMultiTexCoord4iARB".} +proc glMultiTexCoord4ivARB*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord4ivARB".} +proc glMultiTexCoord4sARB*(target: TGLenum, s: TGLshort, t: TGLshort, + r: TGLshort, q: TGLshort){.dynlib: dllname, + importc: "glMultiTexCoord4sARB".} +proc glMultiTexCoord4svARB*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord4svARB".} +proc glSampleCoverageARB*(value: TGLclampf, invert: TGLboolean){. + dynlib: dllname, importc: "glSampleCoverageARB".} + #***** GL_ARB_texture_env_add *****// +proc glWeightbvARB*(size: TGLint, weights: PGLbyte){.dynlib: dllname, + importc: "glWeightbvARB".} +proc glWeightsvARB*(size: TGLint, weights: PGLshort){.dynlib: dllname, + importc: "glWeightsvARB".} +proc glWeightivARB*(size: TGLint, weights: PGLint){.dynlib: dllname, + importc: "glWeightivARB".} +proc glWeightfvARB*(size: TGLint, weights: PGLfloat){.dynlib: dllname, + importc: "glWeightfvARB".} +proc glWeightdvARB*(size: TGLint, weights: PGLdouble){.dynlib: dllname, + importc: "glWeightdvARB".} +proc glWeightvARB*(size: TGLint, weights: PGLdouble){.dynlib: dllname, + importc: "glWeightvARB".} +proc glWeightubvARB*(size: TGLint, weights: PGLubyte){.dynlib: dllname, + importc: "glWeightubvARB".} +proc glWeightusvARB*(size: TGLint, weights: PGLushort){.dynlib: dllname, + importc: "glWeightusvARB".} +proc glWeightuivARB*(size: TGLint, weights: PGLuint){.dynlib: dllname, + importc: "glWeightuivARB".} +proc glWeightPointerARB*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glWeightPointerARB".} +proc glVertexBlendARB*(count: TGLint){.dynlib: dllname, + importc: "glVertexBlendARB".} +proc glVertexAttrib1sARB*(index: TGLuint, x: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib1sARB".} +proc glVertexAttrib1fARB*(index: TGLuint, x: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1fARB".} +proc glVertexAttrib1dARB*(index: TGLuint, x: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1dARB".} +proc glVertexAttrib2sARB*(index: TGLuint, x: TGLshort, y: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib2sARB".} +proc glVertexAttrib2fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib2fARB".} +proc glVertexAttrib2dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble){. + dynlib: dllname, importc: "glVertexAttrib2dARB".} +proc glVertexAttrib3sARB*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib3sARB".} +proc glVertexAttrib3fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib3fARB".} +proc glVertexAttrib3dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble, + z: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib3dARB".} +proc glVertexAttrib4sARB*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, + w: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib4sARB".} +proc glVertexAttrib4fARB*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, + w: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4fARB".} +proc glVertexAttrib4dARB*(index: TGLuint, x: TGLdouble, y: TGLdouble, + z: TGLdouble, w: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4dARB".} +proc glVertexAttrib4NubARB*(index: TGLuint, x: TGLubyte, y: TGLubyte, + z: TGLubyte, w: TGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4NubARB".} +proc glVertexAttrib1svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib1svARB".} +proc glVertexAttrib1fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1fvARB".} +proc glVertexAttrib1dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1dvARB".} +proc glVertexAttrib2svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib2svARB".} +proc glVertexAttrib2fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib2fvARB".} +proc glVertexAttrib2dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib2dvARB".} +proc glVertexAttrib3svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib3svARB".} +proc glVertexAttrib3fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib3fvARB".} +proc glVertexAttrib3dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib3dvARB".} +proc glVertexAttrib4bvARB*(index: TGLuint, v: PGLbyte){.dynlib: dllname, + importc: "glVertexAttrib4bvARB".} +proc glVertexAttrib4svARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib4svARB".} +proc glVertexAttrib4ivARB*(index: TGLuint, v: PGLint){.dynlib: dllname, + importc: "glVertexAttrib4ivARB".} +proc glVertexAttrib4ubvARB*(index: TGLuint, v: PGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4ubvARB".} +proc glVertexAttrib4usvARB*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib4usvARB".} +proc glVertexAttrib4uivARB*(index: TGLuint, v: PGLuint){.dynlib: dllname, + importc: "glVertexAttrib4uivARB".} +proc glVertexAttrib4fvARB*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4fvARB".} +proc glVertexAttrib4dvARB*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4dvARB".} +proc glVertexAttrib4NbvARB*(index: TGLuint, v: PGLbyte){.dynlib: dllname, + importc: "glVertexAttrib4NbvARB".} +proc glVertexAttrib4NsvARB*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib4NsvARB".} +proc glVertexAttrib4NivARB*(index: TGLuint, v: PGLint){.dynlib: dllname, + importc: "glVertexAttrib4NivARB".} +proc glVertexAttrib4NubvARB*(index: TGLuint, v: PGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4NubvARB".} +proc glVertexAttrib4NusvARB*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib4NusvARB".} +proc glVertexAttrib4NuivARB*(index: TGLuint, v: PGLuint){.dynlib: dllname, + importc: "glVertexAttrib4NuivARB".} +proc glVertexAttribPointerARB*(index: TGLuint, size: TGLint, thetype: TGLenum, + normalized: TGLboolean, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexAttribPointerARB".} +proc glEnableVertexAttribArrayARB*(index: TGLuint){.dynlib: dllname, + importc: "glEnableVertexAttribArrayARB".} +proc glDisableVertexAttribArrayARB*(index: TGLuint){.dynlib: dllname, + importc: "glDisableVertexAttribArrayARB".} +proc glProgramStringARB*(target: TGLenum, format: TGLenum, length: TGLsizei, + str: PGLvoid){.dynlib: dllname, + importc: "glProgramStringARB".} +proc glBindProgramARB*(target: TGLenum, theProgram: TGLuint){.dynlib: dllname, + importc: "glBindProgramARB".} +proc glDeleteProgramsARB*(n: TGLsizei, programs: PGLuint){.dynlib: dllname, + importc: "glDeleteProgramsARB".} +proc glGenProgramsARB*(n: TGLsizei, programs: PGLuint){.dynlib: dllname, + importc: "glGenProgramsARB".} +proc glProgramEnvParameter4dARB*(target: TGLenum, index: TGLuint, x: TGLdouble, + y: TGLdouble, z: TGLdouble, w: TGLdouble){. + dynlib: dllname, importc: "glProgramEnvParameter4dARB".} +proc glProgramEnvParameter4dvARB*(target: TGLenum, index: TGLuint, + params: PGLdouble){.dynlib: dllname, + importc: "glProgramEnvParameter4dvARB".} +proc glProgramEnvParameter4fARB*(target: TGLenum, index: TGLuint, x: TGLfloat, + y: TGLfloat, z: TGLfloat, w: TGLfloat){. + dynlib: dllname, importc: "glProgramEnvParameter4fARB".} +proc glProgramEnvParameter4fvARB*(target: TGLenum, index: TGLuint, + params: PGLfloat){.dynlib: dllname, + importc: "glProgramEnvParameter4fvARB".} +proc glProgramLocalParameter4dARB*(target: TGLenum, index: TGLuint, + x: TGLdouble, y: TGLdouble, z: TGLdouble, + w: TGLdouble){.dynlib: dllname, + importc: "glProgramLocalParameter4dARB".} +proc glProgramLocalParameter4dvARB*(target: TGLenum, index: TGLuint, + params: PGLdouble){.dynlib: dllname, + importc: "glProgramLocalParameter4dvARB".} +proc glProgramLocalParameter4fARB*(target: TGLenum, index: TGLuint, x: TGLfloat, + y: TGLfloat, z: TGLfloat, w: TGLfloat){. + dynlib: dllname, importc: "glProgramLocalParameter4fARB".} +proc glProgramLocalParameter4fvARB*(target: TGLenum, index: TGLuint, + params: PGLfloat){.dynlib: dllname, + importc: "glProgramLocalParameter4fvARB".} +proc glGetProgramEnvParameterdvARB*(target: TGLenum, index: TGLuint, + params: PGLdouble){.dynlib: dllname, + importc: "glGetProgramEnvParameterdvARB".} +proc glGetProgramEnvParameterfvARB*(target: TGLenum, index: TGLuint, + params: PGLfloat){.dynlib: dllname, + importc: "glGetProgramEnvParameterfvARB".} +proc glGetProgramLocalParameterdvARB*(target: TGLenum, index: TGLuint, + params: PGLdouble){.dynlib: dllname, + importc: "glGetProgramLocalParameterdvARB".} +proc glGetProgramLocalParameterfvARB*(target: TGLenum, index: TGLuint, + params: PGLfloat){.dynlib: dllname, + importc: "glGetProgramLocalParameterfvARB".} +proc glGetProgramivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetProgramivARB".} +proc glGetProgramStringARB*(target: TGLenum, pname: TGLenum, str: PGLvoid){. + dynlib: dllname, importc: "glGetProgramStringARB".} +proc glGetVertexAttribdvARB*(index: TGLuint, pname: TGLenum, params: PGLdouble){. + dynlib: dllname, importc: "glGetVertexAttribdvARB".} +proc glGetVertexAttribfvARB*(index: TGLuint, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetVertexAttribfvARB".} +proc glGetVertexAttribivARB*(index: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetVertexAttribivARB".} +proc glGetVertexAttribPointervARB*(index: TGLuint, pname: TGLenum, + pointer: PGLvoid){.dynlib: dllname, + importc: "glGetVertexAttribPointervARB".} +proc glIsProgramARB*(theProgram: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsProgramARB".} + #***** GL_ARB_window_pos *****// +proc glWindowPos2dARB*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, + importc: "glWindowPos2dARB".} +proc glWindowPos2fARB*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, + importc: "glWindowPos2fARB".} +proc glWindowPos2iARB*(x: TGLint, y: TGLint){.dynlib: dllname, + importc: "glWindowPos2iARB".} +proc glWindowPos2sARB*(x: TGLshort, y: TGLshort){.dynlib: dllname, + importc: "glWindowPos2sARB".} +proc glWindowPos2dvARB*(p: PGLdouble){.dynlib: dllname, + importc: "glWindowPos2dvARB".} +proc glWindowPos2fvARB*(p: PGLfloat){.dynlib: dllname, + importc: "glWindowPos2fvARB".} +proc glWindowPos2ivARB*(p: PGLint){.dynlib: dllname, + importc: "glWindowPos2ivARB".} +proc glWindowPos2svARB*(p: PGLshort){.dynlib: dllname, + importc: "glWindowPos2svARB".} +proc glWindowPos3dARB*(x: TGLdouble, y: TGLdouble, z: TGLdouble){. + dynlib: dllname, importc: "glWindowPos3dARB".} +proc glWindowPos3fARB*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glWindowPos3fARB".} +proc glWindowPos3iARB*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, + importc: "glWindowPos3iARB".} +proc glWindowPos3sARB*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, + importc: "glWindowPos3sARB".} +proc glWindowPos3dvARB*(p: PGLdouble){.dynlib: dllname, + importc: "glWindowPos3dvARB".} +proc glWindowPos3fvARB*(p: PGLfloat){.dynlib: dllname, + importc: "glWindowPos3fvARB".} +proc glWindowPos3ivARB*(p: PGLint){.dynlib: dllname, + importc: "glWindowPos3ivARB".} +proc glWindowPos3svARB*(p: PGLshort){.dynlib: dllname, + importc: "glWindowPos3svARB".} +proc glBlendEquationSeparate*(modeRGB: TGLenum, modeAlpha: TGLenum){. + dynlib: dllname, importc: "glBlendEquationSeparate".} +proc glDrawBuffers*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, + importc: "glDrawBuffers".} +proc glStencilOpSeparate*(face: TGLenum, sfail: TGLenum, dpfail: TGLenum, + dppass: TGLenum){.dynlib: dllname, + importc: "glStencilOpSeparate".} +proc glStencilFuncSeparate*(frontfunc: TGLenum, backfunc: TGLenum, + theRef: TGLint, mask: TGLuint){.dynlib: dllname, + importc: "glStencilFuncSeparate".} +proc glStencilMaskSeparate*(face: TGLenum, mask: TGLuint){.dynlib: dllname, + importc: "glStencilMaskSeparate".} +proc glAttachShader*(theProgram: TGLuint, shader: TGLuint){.dynlib: dllname, + importc: "glAttachShader".} +proc glBindAttribLocation*(theProgram: TGLuint, index: TGLuint, name: PGLchar){. + dynlib: dllname, importc: "glBindAttribLocation".} +proc glCompileShader*(shader: TGLuint){.dynlib: dllname, + importc: "glCompileShader".} +proc glCreateProgram*(): TGLuint{.dynlib: dllname, importc: "glCreateProgram".} +proc glCreateShader*(thetype: TGLenum): TGLuint{.dynlib: dllname, + importc: "glCreateShader".} +proc glDeleteProgram*(theProgram: TGLuint){.dynlib: dllname, + importc: "glDeleteProgram".} +proc glDeleteShader*(shader: TGLuint){.dynlib: dllname, + importc: "glDeleteShader".} +proc glDetachShader*(theProgram: TGLuint, shader: TGLuint){.dynlib: dllname, + importc: "glDetachShader".} +proc glDisableVertexAttribArray*(index: TGLuint){.dynlib: dllname, + importc: "glDisableVertexAttribArray".} +proc glEnableVertexAttribArray*(index: TGLuint){.dynlib: dllname, + importc: "glEnableVertexAttribArray".} +proc glGetActiveAttrib*(theProgram: TGLuint, index: TGLuint, bufSize: TGLsizei, + len: PGLsizei, size: PGLint, thetype: PGLenum, + name: PGLchar){.dynlib: dllname, + importc: "glGetActiveAttrib".} +proc glGetActiveUniform*(theProgram: TGLuint, index: TGLuint, bufSize: TGLsizei, + len: PGLsizei, size: PGLint, thetype: PGLenum, + name: PGLchar){.dynlib: dllname, + importc: "glGetActiveUniform".} +proc glGetAttachedShaders*(theProgram: TGLuint, maxCount: TGLsizei, + count: PGLsizei, obj: PGLuint){.dynlib: dllname, + importc: "glGetAttachedShaders".} +proc glGetAttribLocation*(theProgram: TGLuint, name: PGLchar): TGLint{. + dynlib: dllname, importc: "glGetAttribLocation".} +proc glGetProgramiv*(theProgram: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetProgramiv".} +proc glGetProgramInfoLog*(theProgram: TGLuint, bufSize: TGLsizei, len: PGLsizei, + infoLog: PGLchar){.dynlib: dllname, + importc: "glGetProgramInfoLog".} +proc glGetShaderiv*(shader: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetShaderiv".} +proc glGetShaderInfoLog*(shader: TGLuint, bufSize: TGLsizei, len: PGLsizei, + infoLog: PGLchar){.dynlib: dllname, + importc: "glGetShaderInfoLog".} +proc glGetShaderSource*(shader: TGLuint, bufSize: TGLsizei, len: PGLsizei, + source: PGLchar){.dynlib: dllname, + importc: "glGetShaderSource".} +proc glGetUniformLocation*(theProgram: TGLuint, name: PGLchar): TGLint{. + dynlib: dllname, importc: "glGetUniformLocation".} +proc glGetUniformfv*(theProgram: TGLuint, location: TGLint, params: PGLfloat){. + dynlib: dllname, importc: "glGetUniformfv".} +proc glGetUniformiv*(theProgram: TGLuint, location: TGLint, params: PGLint){. + dynlib: dllname, importc: "glGetUniformiv".} +proc glGetVertexAttribdv*(index: TGLuint, pname: TGLenum, params: PGLdouble){. + dynlib: dllname, importc: "glGetVertexAttribdv".} +proc glGetVertexAttribfv*(index: TGLuint, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetVertexAttribfv".} +proc glGetVertexAttribiv*(index: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetVertexAttribiv".} +proc glGetVertexAttribPointerv*(index: TGLuint, pname: TGLenum, pointer: PGLvoid){. + dynlib: dllname, importc: "glGetVertexAttribPointerv".} +proc glIsProgram*(theProgram: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsProgram".} +proc glIsShader*(shader: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsShader".} +proc glLinkProgram*(theProgram: TGLuint){.dynlib: dllname, + importc: "glLinkProgram".} +proc glShaderSource*(shader: TGLuint, count: TGLsizei, str: PGLchar, len: PGLint){. + dynlib: dllname, importc: "glShaderSource".} +proc glUseProgram*(theProgram: TGLuint){.dynlib: dllname, + importc: "glUseProgram".} +proc glUniform1f*(location: TGLint, v0: TGLfloat){.dynlib: dllname, + importc: "glUniform1f".} +proc glUniform2f*(location: TGLint, v0: TGLfloat, v1: TGLfloat){. + dynlib: dllname, importc: "glUniform2f".} +proc glUniform3f*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat){. + dynlib: dllname, importc: "glUniform3f".} +proc glUniform4f*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat, + v3: TGLfloat){.dynlib: dllname, importc: "glUniform4f".} +proc glUniform1i*(location: TGLint, v0: TGLint){.dynlib: dllname, + importc: "glUniform1i".} +proc glUniform2i*(location: TGLint, v0: TGLint, v1: TGLint){.dynlib: dllname, + importc: "glUniform2i".} +proc glUniform3i*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint){. + dynlib: dllname, importc: "glUniform3i".} +proc glUniform4i*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint, + v3: TGLint){.dynlib: dllname, importc: "glUniform4i".} +proc glUniform1fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform1fv".} +proc glUniform2fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform2fv".} +proc glUniform3fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform3fv".} +proc glUniform4fv*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform4fv".} +proc glUniform1iv*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform1iv".} +proc glUniform2iv*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform2iv".} +proc glUniform3iv*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform3iv".} +proc glUniform4iv*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform4iv".} +proc glUniformMatrix2fv*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix2fv".} +proc glUniformMatrix3fv*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix3fv".} +proc glUniformMatrix4fv*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix4fv".} +proc glValidateProgram*(theProgram: TGLuint){.dynlib: dllname, + importc: "glValidateProgram".} +proc glVertexAttrib1d*(index: TGLuint, x: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1d".} +proc glVertexAttrib1dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1dv".} +proc glVertexAttrib1f*(index: TGLuint, x: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1f".} +proc glVertexAttrib1fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1fv".} +proc glVertexAttrib1s*(index: TGLuint, x: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib1s".} +proc glVertexAttrib1sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib1sv".} +proc glVertexAttrib2d*(index: TGLuint, x: TGLdouble, y: TGLdouble){. + dynlib: dllname, importc: "glVertexAttrib2d".} +proc glVertexAttrib2dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib2dv".} +proc glVertexAttrib2f*(index: TGLuint, x: TGLfloat, y: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib2f".} +proc glVertexAttrib2fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib2fv".} +proc glVertexAttrib2s*(index: TGLuint, x: TGLshort, y: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib2s".} +proc glVertexAttrib2sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib2sv".} +proc glVertexAttrib3d*(index: TGLuint, x: TGLdouble, y: TGLdouble, z: TGLdouble){. + dynlib: dllname, importc: "glVertexAttrib3d".} +proc glVertexAttrib3dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib3dv".} +proc glVertexAttrib3f*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib3f".} +proc glVertexAttrib3fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib3fv".} +proc glVertexAttrib3s*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib3s".} +proc glVertexAttrib3sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib3sv".} +proc glVertexAttrib4Nbv*(index: TGLuint, v: PGLbyte){.dynlib: dllname, + importc: "glVertexAttrib4Nbv".} +proc glVertexAttrib4Niv*(index: TGLuint, v: PGLint){.dynlib: dllname, + importc: "glVertexAttrib4Niv".} +proc glVertexAttrib4Nsv*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib4Nsv".} +proc glVertexAttrib4Nub*(index: TGLuint, x: TGLubyte, y: TGLubyte, z: TGLubyte, + w: TGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4Nub".} +proc glVertexAttrib4Nubv*(index: TGLuint, v: PGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4Nubv".} +proc glVertexAttrib4Nuiv*(index: TGLuint, v: PGLuint){.dynlib: dllname, + importc: "glVertexAttrib4Nuiv".} +proc glVertexAttrib4Nusv*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib4Nusv".} +proc glVertexAttrib4bv*(index: TGLuint, v: PGLbyte){.dynlib: dllname, + importc: "glVertexAttrib4bv".} +proc glVertexAttrib4d*(index: TGLuint, x: TGLdouble, y: TGLdouble, z: TGLdouble, + w: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4d".} +proc glVertexAttrib4dv*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4dv".} +proc glVertexAttrib4f*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, + w: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4f".} +proc glVertexAttrib4fv*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4fv".} +proc glVertexAttrib4iv*(index: TGLuint, v: PGLint){.dynlib: dllname, + importc: "glVertexAttrib4iv".} +proc glVertexAttrib4s*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, + w: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib4s".} +proc glVertexAttrib4sv*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib4sv".} +proc glVertexAttrib4ubv*(index: TGLuint, v: PGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4ubv".} +proc glVertexAttrib4uiv*(index: TGLuint, v: PGLuint){.dynlib: dllname, + importc: "glVertexAttrib4uiv".} +proc glVertexAttrib4usv*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib4usv".} +proc glVertexAttribPointer*(index: TGLuint, size: TGLint, thetype: TGLenum, + normalized: TGLboolean, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexAttribPointer".} +const + GL_CONSTANT_COLOR* = 0x00008001 + GL_ONE_MINUS_CONSTANT_COLOR* = 0x00008002 + GL_CONSTANT_ALPHA* = 0x00008003 + GL_ONE_MINUS_CONSTANT_ALPHA* = 0x00008004 + constGL_BLEND_COLOR* = 0x00008005 + GL_FUNC_ADD* = 0x00008006 + GL_MIN* = 0x00008007 + GL_MAX* = 0x00008008 + constGL_BLEND_EQUATION* = 0x00008009 + GL_FUNC_SUBTRACT* = 0x0000800A + GL_FUNC_REVERSE_SUBTRACT* = 0x0000800B + GL_CONVOLUTION_1D* = 0x00008010 + GL_CONVOLUTION_2D* = 0x00008011 + GL_SEPARABLE_2D* = 0x00008012 + GL_CONVOLUTION_BORDER_MODE* = 0x00008013 + GL_CONVOLUTION_FILTER_SCALE* = 0x00008014 + GL_CONVOLUTION_FILTER_BIAS* = 0x00008015 + GL_REDUCE* = 0x00008016 + GL_CONVOLUTION_FORMAT* = 0x00008017 + GL_CONVOLUTION_WIDTH* = 0x00008018 + GL_CONVOLUTION_HEIGHT* = 0x00008019 + GL_MAX_CONVOLUTION_WIDTH* = 0x0000801A + GL_MAX_CONVOLUTION_HEIGHT* = 0x0000801B + GL_POST_CONVOLUTION_RED_SCALE* = 0x0000801C + GL_POST_CONVOLUTION_GREEN_SCALE* = 0x0000801D + GL_POST_CONVOLUTION_BLUE_SCALE* = 0x0000801E + GL_POST_CONVOLUTION_ALPHA_SCALE* = 0x0000801F + GL_POST_CONVOLUTION_RED_BIAS* = 0x00008020 + GL_POST_CONVOLUTION_GREEN_BIAS* = 0x00008021 + GL_POST_CONVOLUTION_BLUE_BIAS* = 0x00008022 + GL_POST_CONVOLUTION_ALPHA_BIAS* = 0x00008023 + constGL_HISTOGRAM* = 0x00008024 + GL_PROXY_HISTOGRAM* = 0x00008025 + GL_HISTOGRAM_WIDTH* = 0x00008026 + GL_HISTOGRAM_FORMAT* = 0x00008027 + GL_HISTOGRAM_RED_SIZE* = 0x00008028 + GL_HISTOGRAM_GREEN_SIZE* = 0x00008029 + GL_HISTOGRAM_BLUE_SIZE* = 0x0000802A + GL_HISTOGRAM_ALPHA_SIZE* = 0x0000802B + GL_HISTOGRAM_LUMINANCE_SIZE* = 0x0000802C + GL_HISTOGRAM_SINK* = 0x0000802D + constGL_MINMAX* = 0x0000802E + GL_MINMAX_FORMAT* = 0x0000802F + GL_MINMAX_SINK* = 0x00008030 + GL_TABLE_TOO_LARGE* = 0x00008031 + GL_COLOR_MATRIX* = 0x000080B1 + GL_COLOR_MATRIX_STACK_DEPTH* = 0x000080B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH* = 0x000080B3 + GL_POST_COLOR_MATRIX_RED_SCALE* = 0x000080B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE* = 0x000080B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE* = 0x000080B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE* = 0x000080B7 + GL_POST_COLOR_MATRIX_RED_BIAS* = 0x000080B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS* = 0x000080B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS* = 0x000080BA + GL_POST_COLOR_MATIX_ALPHA_BIAS* = 0x000080BB + constGL_COLOR_TABLE* = 0x000080D0 + GL_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D2 + GL_PROXY_COLOR_TABLE* = 0x000080D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE* = 0x000080D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE* = 0x000080D5 + GL_COLOR_TABLE_SCALE* = 0x000080D6 + GL_COLOR_TABLE_BIAS* = 0x000080D7 + GL_COLOR_TABLE_FORMAT* = 0x000080D8 + GL_COLOR_TABLE_WIDTH* = 0x000080D9 + GL_COLOR_TABLE_RED_SIZE* = 0x000080DA + GL_COLOR_TABLE_GREEN_SIZE* = 0x000080DB + GL_COLOR_TABLE_BLUE_SIZE* = 0x000080DC + GL_COLOR_TABLE_ALPHA_SIZE* = 0x000080DD + GL_COLOR_TABLE_LUMINANCE_SIZE* = 0x000080DE + GL_COLOR_TABLE_INTENSITY_SIZE* = 0x000080DF + GL_IGNORE_BORDER* = 0x00008150 + GL_CONSTANT_BORDER* = 0x00008151 + GL_WRAP_BORDER* = 0x00008152 + GL_REPLICATE_BORDER* = 0x00008153 + GL_CONVOLUTION_BORDER_COLOR* = 0x00008154 + +proc glActiveTexture*(texture: TGLenum){.dynlib: dllname, + importc: "glActiveTexture".} +proc glClientActiveTexture*(texture: TGLenum){.dynlib: dllname, + importc: "glClientActiveTexture".} +proc glMultiTexCoord1d*(target: TGLenum, s: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord1d".} +proc glMultiTexCoord1dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord1dv".} +proc glMultiTexCoord1f*(target: TGLenum, s: TGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord1f".} +proc glMultiTexCoord1fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord1fv".} +proc glMultiTexCoord1i*(target: TGLenum, s: TGLint){.dynlib: dllname, + importc: "glMultiTexCoord1i".} +proc glMultiTexCoord1iv*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord1iv".} +proc glMultiTexCoord1s*(target: TGLenum, s: TGLshort){.dynlib: dllname, + importc: "glMultiTexCoord1s".} +proc glMultiTexCoord1sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord1sv".} +proc glMultiTexCoord2d*(target: TGLenum, s: TGLdouble, t: TGLdouble){. + dynlib: dllname, importc: "glMultiTexCoord2d".} +proc glMultiTexCoord2dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord2dv".} +proc glMultiTexCoord2f*(target: TGLenum, s: TGLfloat, t: TGLfloat){. + dynlib: dllname, importc: "glMultiTexCoord2f".} +proc glMultiTexCoord2fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord2fv".} +proc glMultiTexCoord2i*(target: TGLenum, s: TGLint, t: TGLint){.dynlib: dllname, + importc: "glMultiTexCoord2i".} +proc glMultiTexCoord2iv*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord2iv".} +proc glMultiTexCoord2s*(target: TGLenum, s: TGLshort, t: TGLshort){. + dynlib: dllname, importc: "glMultiTexCoord2s".} +proc glMultiTexCoord2sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord2sv".} +proc glMultiTexCoord3d*(target: TGLenum, s: TGLdouble, t: TGLdouble, + r: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord3d".} +proc glMultiTexCoord3dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord3dv".} +proc glMultiTexCoord3f*(target: TGLenum, s: TGLfloat, t: TGLfloat, r: TGLfloat){. + dynlib: dllname, importc: "glMultiTexCoord3f".} +proc glMultiTexCoord3fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord3fv".} +proc glMultiTexCoord3i*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint){. + dynlib: dllname, importc: "glMultiTexCoord3i".} +proc glMultiTexCoord3iv*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord3iv".} +proc glMultiTexCoord3s*(target: TGLenum, s: TGLshort, t: TGLshort, r: TGLshort){. + dynlib: dllname, importc: "glMultiTexCoord3s".} +proc glMultiTexCoord3sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord3sv".} +proc glMultiTexCoord4d*(target: TGLenum, s: TGLdouble, t: TGLdouble, + r: TGLdouble, q: TGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord4d".} +proc glMultiTexCoord4dv*(target: TGLenum, v: PGLdouble){.dynlib: dllname, + importc: "glMultiTexCoord4dv".} +proc glMultiTexCoord4f*(target: TGLenum, s: TGLfloat, t: TGLfloat, r: TGLfloat, + q: TGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord4f".} +proc glMultiTexCoord4fv*(target: TGLenum, v: PGLfloat){.dynlib: dllname, + importc: "glMultiTexCoord4fv".} +proc glMultiTexCoord4i*(target: TGLenum, s: TGLint, t: TGLint, r: TGLint, + q: TGLint){.dynlib: dllname, + importc: "glMultiTexCoord4i".} +proc glMultiTexCoord4iv*(target: TGLenum, v: PGLint){.dynlib: dllname, + importc: "glMultiTexCoord4iv".} +proc glMultiTexCoord4s*(target: TGLenum, s: TGLshort, t: TGLshort, r: TGLshort, + q: TGLshort){.dynlib: dllname, + importc: "glMultiTexCoord4s".} +proc glMultiTexCoord4sv*(target: TGLenum, v: PGLshort){.dynlib: dllname, + importc: "glMultiTexCoord4sv".} +proc glLoadTransposeMatrixf*(m: PGLfloat){.dynlib: dllname, + importc: "glLoadTransposeMatrixf".} +proc glLoadTransposeMatrixd*(m: PGLdouble){.dynlib: dllname, + importc: "glLoadTransposeMatrixd".} +proc glMultTransposeMatrixf*(m: PGLfloat){.dynlib: dllname, + importc: "glMultTransposeMatrixf".} +proc glMultTransposeMatrixd*(m: PGLdouble){.dynlib: dllname, + importc: "glMultTransposeMatrixd".} +proc glSampleCoverage*(value: TGLclampf, invert: TGLboolean){.dynlib: dllname, + importc: "glSampleCoverage".} +proc glCompressedTexImage3D*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + height: TGLsizei, depth: TGLsizei, border: TGLint, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexImage3D".} +proc glCompressedTexImage2D*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + height: TGLsizei, border: TGLint, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexImage2D".} +proc glCompressedTexImage1D*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + border: TGLint, imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexImage1D".} +proc glCompressedTexSubImage3D*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, zoffset: TGLint, + width: TGLsizei, height: TGLsizei, + depth: TGLsizei, format: TGLenum, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexSubImage3D".} +proc glCompressedTexSubImage2D*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, width: TGLsizei, + height: TGLsizei, format: TGLenum, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexSubImage2D".} +proc glCompressedTexSubImage1D*(target: TGLenum, level: TGLint, xoffset: TGLint, + width: TGLsizei, format: TGLenum, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexSubImage1D".} +proc glGetCompressedTexImage*(target: TGLenum, level: TGLint, img: PGLvoid){. + dynlib: dllname, importc: "glGetCompressedTexImage".} + #***** GL_version_1_3 *****// +const + GL_TEXTURE0* = 0x000084C0 + GL_TEXTURE1* = 0x000084C1 + GL_TEXTURE2* = 0x000084C2 + GL_TEXTURE3* = 0x000084C3 + GL_TEXTURE4* = 0x000084C4 + GL_TEXTURE5* = 0x000084C5 + GL_TEXTURE6* = 0x000084C6 + GL_TEXTURE7* = 0x000084C7 + GL_TEXTURE8* = 0x000084C8 + GL_TEXTURE9* = 0x000084C9 + GL_TEXTURE10* = 0x000084CA + GL_TEXTURE11* = 0x000084CB + GL_TEXTURE12* = 0x000084CC + GL_TEXTURE13* = 0x000084CD + GL_TEXTURE14* = 0x000084CE + GL_TEXTURE15* = 0x000084CF + GL_TEXTURE16* = 0x000084D0 + GL_TEXTURE17* = 0x000084D1 + GL_TEXTURE18* = 0x000084D2 + GL_TEXTURE19* = 0x000084D3 + GL_TEXTURE20* = 0x000084D4 + GL_TEXTURE21* = 0x000084D5 + GL_TEXTURE22* = 0x000084D6 + GL_TEXTURE23* = 0x000084D7 + GL_TEXTURE24* = 0x000084D8 + GL_TEXTURE25* = 0x000084D9 + GL_TEXTURE26* = 0x000084DA + GL_TEXTURE27* = 0x000084DB + GL_TEXTURE28* = 0x000084DC + GL_TEXTURE29* = 0x000084DD + GL_TEXTURE30* = 0x000084DE + GL_TEXTURE31* = 0x000084DF + constGL_ACTIVE_TEXTURE* = 0x000084E0 + constGL_CLIENT_ACTIVE_TEXTURE* = 0x000084E1 + GL_MAX_TEXTURE_UNITS* = 0x000084E2 + GL_TRANSPOSE_MODELVIEW_MATRIX* = 0x000084E3 + GL_TRANSPOSE_PROJECTION_MATRIX* = 0x000084E4 + GL_TRANSPOSE_TEXTURE_MATRIX* = 0x000084E5 + GL_TRANSPOSE_COLOR_MATRIX* = 0x000084E6 + GL_MULTISAMPLE* = 0x0000809D + GL_SAMPLE_ALPHA_TO_COVERAGE* = 0x0000809E + GL_SAMPLE_ALPHA_TO_ONE* = 0x0000809F + constGL_SAMPLE_COVERAGE* = 0x000080A0 + GL_SAMPLE_BUFFERS* = 0x000080A8 + GL_SAMPLES* = 0x000080A9 + GL_SAMPLE_COVERAGE_VALUE* = 0x000080AA + GL_SAMPLE_COVERAGE_INVERT* = 0x000080AB + GL_MULTISAMPLE_BIT* = 0x20000000 + GL_NORMAL_MAP* = 0x00008511 + GL_REFLECTION_MAP* = 0x00008512 + GL_TEXTURE_CUBE_MAP* = 0x00008513 + GL_TEXTURE_BINDING_CUBE_MAP* = 0x00008514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X* = 0x00008515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X* = 0x00008516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y* = 0x00008517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y* = 0x00008518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z* = 0x00008519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z* = 0x0000851A + GL_PROXY_TEXTURE_CUBE_MAP* = 0x0000851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE* = 0x0000851C + GL_COMPRESSED_ALPHA* = 0x000084E9 + GL_COMPRESSED_LUMINANCE* = 0x000084EA + GL_COMPRESSED_LUMINANCE_ALPHA* = 0x000084EB + GL_COMPRESSED_INTENSITY* = 0x000084EC + GL_COMPRESSED_RGB* = 0x000084ED + GL_COMPRESSED_RGBA* = 0x000084EE + GL_TEXTURE_COMPRESSION_HINT* = 0x000084EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE* = 0x000086A0 + GL_TEXTURE_COMPRESSED* = 0x000086A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS* = 0x000086A2 + GL_COMPRESSED_TEXTURE_FORMATS* = 0x000086A3 + GL_CLAMP_TO_BORDER* = 0x0000812D + GL_CLAMP_TO_BORDER_SGIS* = 0x0000812D + GL_COMBINE* = 0x00008570 + GL_COMBINE_RGB* = 0x00008571 + GL_COMBINE_ALPHA* = 0x00008572 + GL_SOURCE0_RGB* = 0x00008580 + GL_SOURCE1_RGB* = 0x00008581 + GL_SOURCE2_RGB* = 0x00008582 + GL_SOURCE0_ALPHA* = 0x00008588 + GL_SOURCE1_ALPHA* = 0x00008589 + GL_SOURCE2_ALPHA* = 0x0000858A + GL_OPERAND0_RGB* = 0x00008590 + GL_OPERAND1_RGB* = 0x00008591 + GL_OPERAND2_RGB* = 0x00008592 + GL_OPERAND0_ALPHA* = 0x00008598 + GL_OPERAND1_ALPHA* = 0x00008599 + GL_OPERAND2_ALPHA* = 0x0000859A + GL_RGB_SCALE* = 0x00008573 + GL_ADD_SIGNED* = 0x00008574 + GL_INTERPOLATE* = 0x00008575 + GL_SUBTRACT* = 0x000084E7 + GL_CONSTANT* = 0x00008576 + GL_PRIMARY_COLOR* = 0x00008577 + GL_PREVIOUS* = 0x00008578 + GL_DOT3_RGB* = 0x000086AE + GL_DOT3_RGBA* = 0x000086AF + +const + GL_TEXTURE0_ARB* = 0x000084C0 + GL_TEXTURE1_ARB* = 0x000084C1 + GL_TEXTURE2_ARB* = 0x000084C2 + GL_TEXTURE3_ARB* = 0x000084C3 + GL_TEXTURE4_ARB* = 0x000084C4 + GL_TEXTURE5_ARB* = 0x000084C5 + GL_TEXTURE6_ARB* = 0x000084C6 + GL_TEXTURE7_ARB* = 0x000084C7 + GL_TEXTURE8_ARB* = 0x000084C8 + GL_TEXTURE9_ARB* = 0x000084C9 + GL_TEXTURE10_ARB* = 0x000084CA + GL_TEXTURE11_ARB* = 0x000084CB + GL_TEXTURE12_ARB* = 0x000084CC + GL_TEXTURE13_ARB* = 0x000084CD + GL_TEXTURE14_ARB* = 0x000084CE + GL_TEXTURE15_ARB* = 0x000084CF + GL_TEXTURE16_ARB* = 0x000084D0 + GL_TEXTURE17_ARB* = 0x000084D1 + GL_TEXTURE18_ARB* = 0x000084D2 + GL_TEXTURE19_ARB* = 0x000084D3 + GL_TEXTURE20_ARB* = 0x000084D4 + GL_TEXTURE21_ARB* = 0x000084D5 + GL_TEXTURE22_ARB* = 0x000084D6 + GL_TEXTURE23_ARB* = 0x000084D7 + GL_TEXTURE24_ARB* = 0x000084D8 + GL_TEXTURE25_ARB* = 0x000084D9 + GL_TEXTURE26_ARB* = 0x000084DA + GL_TEXTURE27_ARB* = 0x000084DB + GL_TEXTURE28_ARB* = 0x000084DC + GL_TEXTURE29_ARB* = 0x000084DD + GL_TEXTURE30_ARB* = 0x000084DE + GL_TEXTURE31_ARB* = 0x000084DF + constGL_ACTIVE_TEXTURE_ARB* = 0x000084E0 + constGL_CLIENT_ACTIVE_TEXTURE_ARB* = 0x000084E1 + GL_MAX_TEXTURE_UNITS_ARB* = 0x000084E2 + #***** GL_ARB_transpose_matrix *****// + +const + GL_TRANSPOSE_MODELVIEW_MATRIX_ARB* = 0x000084E3 + GL_TRANSPOSE_PROJECTION_MATRIX_ARB* = 0x000084E4 + GL_TRANSPOSE_TEXTURE_MATRIX_ARB* = 0x000084E5 + GL_TRANSPOSE_COLOR_MATRIX_ARB* = 0x000084E6 + +proc glLoadTransposeMatrixfARB*(m: PGLfloat){.dynlib: dllname, + importc: "glLoadTransposeMatrixfARB".} +proc glLoadTransposeMatrixdARB*(m: PGLdouble){.dynlib: dllname, + importc: "glLoadTransposeMatrixdARB".} +proc glMultTransposeMatrixfARB*(m: PGLfloat){.dynlib: dllname, + importc: "glMultTransposeMatrixfARB".} +proc glMultTransposeMatrixdARB*(m: PGLdouble){.dynlib: dllname, + importc: "glMultTransposeMatrixdARB".} +const + WGL_SAMPLE_BUFFERS_ARB* = 0x00002041 + WGL_SAMPLES_ARB* = 0x00002042 + GL_MULTISAMPLE_ARB* = 0x0000809D + GL_SAMPLE_ALPHA_TO_COVERAGE_ARB* = 0x0000809E + GL_SAMPLE_ALPHA_TO_ONE_ARB* = 0x0000809F + constGL_SAMPLE_COVERAGE_ARB* = 0x000080A0 + GL_MULTISAMPLE_BIT_ARB* = 0x20000000 + GL_SAMPLE_BUFFERS_ARB* = 0x000080A8 + GL_SAMPLES_ARB* = 0x000080A9 + GL_SAMPLE_COVERAGE_VALUE_ARB* = 0x000080AA + GL_SAMPLE_COVERAGE_INVERT_ARB* = 0x000080AB + +const + GL_NORMAL_MAP_ARB* = 0x00008511 + GL_REFLECTION_MAP_ARB* = 0x00008512 + GL_TEXTURE_CUBE_MAP_ARB* = 0x00008513 + GL_TEXTURE_BINDING_CUBE_MAP_ARB* = 0x00008514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB* = 0x00008515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB* = 0x00008516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB* = 0x00008517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB* = 0x00008518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB* = 0x00008519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB* = 0x0000851A + GL_PROXY_TEXTURE_CUBE_MAP_ARB* = 0x0000851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB* = 0x0000851C + +const + GL_DEPTH_COMPONENT16_ARB* = 0x000081A5 + GL_DEPTH_COMPONENT24_ARB* = 0x000081A6 + GL_DEPTH_COMPONENT32_ARB* = 0x000081A7 + GL_TEXTURE_DEPTH_SIZE_ARB* = 0x0000884A + GL_DEPTH_TEXTURE_MODE_ARB* = 0x0000884B + #***** GL_ARB_point_parameters *****// + +const + GL_POINT_SIZE_MIN_ARB* = 0x00008126 + GL_POINT_SIZE_MAX_ARB* = 0x00008127 + GL_POINT_FADE_THRESHOLD_SIZE_ARB* = 0x00008128 + GL_POINT_DISTANCE_ATTENUATION_ARB* = 0x00008129 + +proc glPointParameterfARB*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPointParameterfARB".} +proc glPointParameterfvARB*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glPointParameterfvARB".} +const + GL_TEXTURE_COMPARE_MODE_ARB* = 0x0000884C + GL_TEXTURE_COMPARE_FUNC_ARB* = 0x0000884D + GL_COMPARE_R_TO_TEXTURE_ARB* = 0x0000884E + +const + GL_TEXTURE_COMPARE_FAIL_VALUE_ARB* = 0x000080BF + GL_CLAMP_TO_BORDER_ARB* = 0x0000812D + +const + GL_COMPRESSED_ALPHA_ARB* = 0x000084E9 + GL_COMPRESSED_LUMINANCE_ARB* = 0x000084EA + GL_COMPRESSED_LUMINANCE_ALPHA_ARB* = 0x000084EB + GL_COMPRESSED_INTENSITY_ARB* = 0x000084EC + GL_COMPRESSED_RGB_ARB* = 0x000084ED + GL_COMPRESSED_RGBA_ARB* = 0x000084EE + GL_TEXTURE_COMPRESSION_HINT_ARB* = 0x000084EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB* = 0x000086A0 + GL_TEXTURE_COMPRESSED_ARB* = 0x000086A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A2 + GL_COMPRESSED_TEXTURE_FORMATS_ARB* = 0x000086A3 + +proc glCompressedTexImage3DARB*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + height: TGLsizei, depth: TGLsizei, + border: TGLint, imageSize: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glCompressedTexImage3DARB".} +proc glCompressedTexImage2DARB*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + height: TGLsizei, border: TGLint, + imageSize: TGLsizei, data: PGLvoid){. + dynlib: dllname, importc: "glCompressedTexImage2DARB".} +proc glCompressedTexImage1DARB*(target: TGLenum, level: TGLint, + internalformat: TGLenum, width: TGLsizei, + border: TGLint, imageSize: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glCompressedTexImage1DARB".} +proc glCompressedTexSubImage3DARB*(target: TGLenum, level: TGLint, + xoffset: TGLint, yoffset: TGLint, + zoffset: TGLint, width: TGLsizei, + height: TGLsizei, depth: TGLsizei, + format: TGLenum, imageSize: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glCompressedTexSubImage3DARB".} +proc glCompressedTexSubImage2DARB*(target: TGLenum, level: TGLint, + xoffset: TGLint, yoffset: TGLint, + width: TGLsizei, height: TGLsizei, + format: TGLenum, imageSize: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glCompressedTexSubImage2DARB".} +proc glCompressedTexSubImage1DARB*(target: TGLenum, level: TGLint, + xoffset: TGLint, width: TGLsizei, + format: TGLenum, imageSize: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glCompressedTexSubImage1DARB".} +proc glGetCompressedTexImageARB*(target: TGLenum, lod: TGLint, img: PGLvoid){. + dynlib: dllname, importc: "glGetCompressedTexImageARB".} + #***** GL_ARB_texture_env_combine *****// +const + GL_COMBINE_ARB* = 0x00008570 + GL_COMBINE_RGB_ARB* = 0x00008571 + GL_COMBINE_ALPHA_ARB* = 0x00008572 + GL_SOURCE0_RGB_ARB* = 0x00008580 + GL_SOURCE1_RGB_ARB* = 0x00008581 + GL_SOURCE2_RGB_ARB* = 0x00008582 + GL_SOURCE0_ALPHA_ARB* = 0x00008588 + GL_SOURCE1_ALPHA_ARB* = 0x00008589 + GL_SOURCE2_ALPHA_ARB* = 0x0000858A + GL_OPERAND0_RGB_ARB* = 0x00008590 + GL_OPERAND1_RGB_ARB* = 0x00008591 + GL_OPERAND2_RGB_ARB* = 0x00008592 + GL_OPERAND0_ALPHA_ARB* = 0x00008598 + GL_OPERAND1_ALPHA_ARB* = 0x00008599 + GL_OPERAND2_ALPHA_ARB* = 0x0000859A + GL_RGB_SCALE_ARB* = 0x00008573 + GL_ADD_SIGNED_ARB* = 0x00008574 + GL_INTERPOLATE_ARB* = 0x00008575 + GL_SUBTRACT_ARB* = 0x000084E7 + GL_CONSTANT_ARB* = 0x00008576 + GL_PRIMARY_COLOR_ARB* = 0x00008577 + GL_PREVIOUS_ARB* = 0x00008578 + #***** GL_ARB_texture_env_crossbar *****// + #***** GL_ARB_texture_env_dot3 *****// + +const + GL_DOT3_RGB_ARB* = 0x000086AE + GL_DOT3_RGBA_ARB* = 0x000086AF + #***** GL_ARB_texture_mirrored_repeat *****// + +const + GL_MIRRORED_REPEAT_ARB* = 0x00008370 + #***** GL_ARB_vertex_blend *****// + +const + GL_MAX_VERTEX_UNITS_ARB* = 0x000086A4 + GL_ACTIVE_VERTEX_UNITS_ARB* = 0x000086A5 + GL_WEIGHT_SUM_UNITY_ARB* = 0x000086A6 + constGL_VERTEX_BLEND_ARB* = 0x000086A7 + GL_MODELVIEW0_ARB* = 0x00001700 + GL_MODELVIEW1_ARB* = 0x0000850A + GL_MODELVIEW2_ARB* = 0x00008722 + GL_MODELVIEW3_ARB* = 0x00008723 + GL_MODELVIEW4_ARB* = 0x00008724 + GL_MODELVIEW5_ARB* = 0x00008725 + GL_MODELVIEW6_ARB* = 0x00008726 + GL_MODELVIEW7_ARB* = 0x00008727 + GL_MODELVIEW8_ARB* = 0x00008728 + GL_MODELVIEW9_ARB* = 0x00008729 + GL_MODELVIEW10_ARB* = 0x0000872A + GL_MODELVIEW11_ARB* = 0x0000872B + GL_MODELVIEW12_ARB* = 0x0000872C + GL_MODELVIEW13_ARB* = 0x0000872D + GL_MODELVIEW14_ARB* = 0x0000872E + GL_MODELVIEW15_ARB* = 0x0000872F + GL_MODELVIEW16_ARB* = 0x00008730 + GL_MODELVIEW17_ARB* = 0x00008731 + GL_MODELVIEW18_ARB* = 0x00008732 + GL_MODELVIEW19_ARB* = 0x00008733 + GL_MODELVIEW20_ARB* = 0x00008734 + GL_MODELVIEW21_ARB* = 0x00008735 + GL_MODELVIEW22_ARB* = 0x00008736 + GL_MODELVIEW23_ARB* = 0x00008737 + GL_MODELVIEW24_ARB* = 0x00008738 + GL_MODELVIEW25_ARB* = 0x00008739 + GL_MODELVIEW26_ARB* = 0x0000873A + GL_MODELVIEW27_ARB* = 0x0000873B + GL_MODELVIEW28_ARB* = 0x0000873C + GL_MODELVIEW29_ARB* = 0x0000873D + GL_MODELVIEW30_ARB* = 0x0000873E + GL_MODELVIEW31_ARB* = 0x0000873F + GL_CURRENT_WEIGHT_ARB* = 0x000086A8 + GL_WEIGHT_ARRAY_TYPE_ARB* = 0x000086A9 + GL_WEIGHT_ARRAY_STRIDE_ARB* = 0x000086AA + GL_WEIGHT_ARRAY_SIZE_ARB* = 0x000086AB + GL_WEIGHT_ARRAY_POINTER_ARB* = 0x000086AC + GL_WEIGHT_ARRAY_ARB* = 0x000086AD + +const + GL_VERTEX_PROGRAM_ARB* = 0x00008620 + GL_VERTEX_PROGRAM_POINT_SIZE_ARB* = 0x00008642 + GL_VERTEX_PROGRAM_TWO_SIDE_ARB* = 0x00008643 + GL_COLOR_SUM_ARB* = 0x00008458 + GL_PROGRAM_FORMAT_ASCII_ARB* = 0x00008875 + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB* = 0x00008622 + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB* = 0x00008623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB* = 0x00008624 + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB* = 0x00008625 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB* = 0x0000886A + GL_CURRENT_VERTEX_ATTRIB_ARB* = 0x00008626 + GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB* = 0x00008645 + GL_PROGRAM_LENGTH_ARB* = 0x00008627 + GL_PROGRAM_FORMAT_ARB* = 0x00008876 + GL_PROGRAM_BINDING_ARB* = 0x00008677 + GL_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A0 + GL_MAX_PROGRAM_INSTRUCTIONS_ARB* = 0x000088A1 + GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A2 + GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB* = 0x000088A3 + GL_PROGRAM_TEMPORARIES_ARB* = 0x000088A4 + GL_MAX_PROGRAM_TEMPORARIES_ARB* = 0x000088A5 + GL_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A6 + GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB* = 0x000088A7 + GL_PROGRAM_PARAMETERS_ARB* = 0x000088A8 + GL_MAX_PROGRAM_PARAMETERS_ARB* = 0x000088A9 + GL_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AA + GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB* = 0x000088AB + GL_PROGRAM_ATTRIBS_ARB* = 0x000088AC + GL_MAX_PROGRAM_ATTRIBS_ARB* = 0x000088AD + GL_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AE + GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB* = 0x000088AF + GL_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B0 + GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB* = 0x000088B1 + GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B2 + GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB* = 0x000088B3 + GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB* = 0x000088B4 + GL_MAX_PROGRAM_ENV_PARAMETERS_ARB* = 0x000088B5 + GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB* = 0x000088B6 + constGL_PROGRAM_STRING_ARB* = 0x00008628 + GL_PROGRAM_ERROR_POSITION_ARB* = 0x0000864B + GL_CURRENT_MATRIX_ARB* = 0x00008641 + GL_TRANSPOSE_CURRENT_MATRIX_ARB* = 0x000088B7 + GL_CURRENT_MATRIX_STACK_DEPTH_ARB* = 0x00008640 + GL_MAX_VERTEX_ATTRIBS_ARB* = 0x00008869 + GL_MAX_PROGRAM_MATRICES_ARB* = 0x0000862F + GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB* = 0x0000862E + GL_PROGRAM_ERROR_STRING_ARB* = 0x00008874 + GL_MATRIX0_ARB* = 0x000088C0 + GL_MATRIX1_ARB* = 0x000088C1 + GL_MATRIX2_ARB* = 0x000088C2 + GL_MATRIX3_ARB* = 0x000088C3 + GL_MATRIX4_ARB* = 0x000088C4 + GL_MATRIX5_ARB* = 0x000088C5 + GL_MATRIX6_ARB* = 0x000088C6 + GL_MATRIX7_ARB* = 0x000088C7 + GL_MATRIX8_ARB* = 0x000088C8 + GL_MATRIX9_ARB* = 0x000088C9 + GL_MATRIX10_ARB* = 0x000088CA + GL_MATRIX11_ARB* = 0x000088CB + GL_MATRIX12_ARB* = 0x000088CC + GL_MATRIX13_ARB* = 0x000088CD + GL_MATRIX14_ARB* = 0x000088CE + GL_MATRIX15_ARB* = 0x000088CF + GL_MATRIX16_ARB* = 0x000088D0 + GL_MATRIX17_ARB* = 0x000088D1 + GL_MATRIX18_ARB* = 0x000088D2 + GL_MATRIX19_ARB* = 0x000088D3 + GL_MATRIX20_ARB* = 0x000088D4 + GL_MATRIX21_ARB* = 0x000088D5 + GL_MATRIX22_ARB* = 0x000088D6 + GL_MATRIX23_ARB* = 0x000088D7 + GL_MATRIX24_ARB* = 0x000088D8 + GL_MATRIX25_ARB* = 0x000088D9 + GL_MATRIX26_ARB* = 0x000088DA + GL_MATRIX27_ARB* = 0x000088DB + GL_MATRIX28_ARB* = 0x000088DC + GL_MATRIX29_ARB* = 0x000088DD + GL_MATRIX30_ARB* = 0x000088DE + GL_MATRIX31_ARB* = 0x000088DF + +const + GL_422_EXT* = 0x000080CC + GL_422_REV_EXT* = 0x000080CD + GL_422_AVERAGE_EXT* = 0x000080CE + GL_422_REV_AVERAGE_EXT* = 0x000080CF + #***** GL_EXT_abgr *****// + +const + GL_ABGR_EXT* = 0x00008000 + #***** GL_EXT_bgra *****// + +const + GL_BGR_EXT* = 0x000080E0 + GL_BGRA_EXT* = 0x000080E1 + #***** GL_EXT_blend_color *****// + +const + GL_CONSTANT_COLOR_EXT* = 0x00008001 + GL_ONE_MINUS_CONSTANT_COLOR_EXT* = 0x00008002 + GL_CONSTANT_ALPHA_EXT* = 0x00008003 + GL_ONE_MINUS_CONSTANT_ALPHA_EXT* = 0x00008004 + constGL_BLEND_COLOR_EXT* = 0x00008005 + +proc glBlendColorEXT*(red: TGLclampf, green: TGLclampf, blue: TGLclampf, + alpha: TGLclampf){.dynlib: dllname, + importc: "glBlendColorEXT".} + #***** GL_EXT_blend_func_separate *****// +const + GL_BLEND_DST_RGB_EXT* = 0x000080C8 + GL_BLEND_SRC_RGB_EXT* = 0x000080C9 + GL_BLEND_DST_ALPHA_EXT* = 0x000080CA + GL_BLEND_SRC_ALPHA_EXT* = 0x000080CB + +proc glBlendFuncSeparateEXT*(sfactorRGB: TGLenum, dfactorRGB: TGLenum, + sfactorAlpha: TGLenum, dfactorAlpha: TGLenum){. + dynlib: dllname, importc: "glBlendFuncSeparateEXT".} + #***** GL_EXT_blend_logic_op *****// + #***** GL_EXT_blend_minmax *****// +const + GL_FUNC_ADD_EXT* = 0x00008006 + GL_MIN_EXT* = 0x00008007 + GL_MAX_EXT* = 0x00008008 + constGL_BLEND_EQUATION_EXT* = 0x00008009 + +proc glBlendEquationEXT*(mode: TGLenum){.dynlib: dllname, + importc: "glBlendEquationEXT".} + #***** GL_EXT_blend_subtract *****// +const + GL_FUNC_SUBTRACT_EXT* = 0x0000800A + GL_FUNC_REVERSE_SUBTRACT_EXT* = 0x0000800B + #***** GL_EXT_clip_volume_hint *****// + +const + GL_CLIP_VOLUME_CLIPPING_HINT_EXT* = 0x000080F0 + #***** GL_EXT_color_subtable *****// + +proc glColorSubTableEXT*(target: TGLenum, start: TGLsizei, count: TGLsizei, + format: TGLenum, thetype: TGLenum, data: PGLvoid){. + dynlib: dllname, importc: "glColorSubTableEXT".} +proc glCopyColorSubTableEXT*(target: TGLenum, start: TGLsizei, x: TGLint, + y: TGLint, width: TGLsizei){.dynlib: dllname, + importc: "glCopyColorSubTableEXT".} + #***** GL_EXT_compiled_vertex_array *****// +const + GL_ARRAY_ELEMENT_LOCK_FIRST_EXT* = 0x000081A8 + GL_ARRAY_ELEMENT_LOCK_COUNT_EXT* = 0x000081A9 + +proc glLockArraysEXT*(first: TGLint, count: TGLsizei){.dynlib: dllname, + importc: "glLockArraysEXT".} +proc glUnlockArraysEXT*(){.dynlib: dllname, importc: "glUnlockArraysEXT".} + #***** GL_EXT_convolution *****// +const + GL_CONVOLUTION_1D_EXT* = 0x00008010 + GL_CONVOLUTION_2D_EXT* = 0x00008011 + GL_SEPARABLE_2D_EXT* = 0x00008012 + GL_CONVOLUTION_BORDER_MODE_EXT* = 0x00008013 + GL_CONVOLUTION_FILTER_SCALE_EXT* = 0x00008014 + GL_CONVOLUTION_FILTER_BIAS_EXT* = 0x00008015 + GL_REDUCE_EXT* = 0x00008016 + GL_CONVOLUTION_FORMAT_EXT* = 0x00008017 + GL_CONVOLUTION_WIDTH_EXT* = 0x00008018 + GL_CONVOLUTION_HEIGHT_EXT* = 0x00008019 + GL_MAX_CONVOLUTION_WIDTH_EXT* = 0x0000801A + GL_MAX_CONVOLUTION_HEIGHT_EXT* = 0x0000801B + GL_POST_CONVOLUTION_RED_SCALE_EXT* = 0x0000801C + GL_POST_CONVOLUTION_GREEN_SCALE_EXT* = 0x0000801D + GL_POST_CONVOLUTION_BLUE_SCALE_EXT* = 0x0000801E + GL_POST_CONVOLUTION_ALPHA_SCALE_EXT* = 0x0000801F + GL_POST_CONVOLUTION_RED_BIAS_EXT* = 0x00008020 + GL_POST_CONVOLUTION_GREEN_BIAS_EXT* = 0x00008021 + GL_POST_CONVOLUTION_BLUE_BIAS_EXT* = 0x00008022 + GL_POST_CONVOLUTION_ALPHA_BIAS_EXT* = 0x00008023 + +proc glConvolutionFilter1DEXT*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, format: TGLenum, + thetype: TGLenum, image: PGLvoid){. + dynlib: dllname, importc: "glConvolutionFilter1DEXT".} +proc glConvolutionFilter2DEXT*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei, + format: TGLenum, thetype: TGLenum, image: PGLvoid){. + dynlib: dllname, importc: "glConvolutionFilter2DEXT".} +proc glCopyConvolutionFilter1DEXT*(target: TGLenum, internalformat: TGLenum, + x: TGLint, y: TGLint, width: TGLsizei){. + dynlib: dllname, importc: "glCopyConvolutionFilter1DEXT".} +proc glCopyConvolutionFilter2DEXT*(target: TGLenum, internalformat: TGLenum, + x: TGLint, y: TGLint, width: TGLsizei, + height: TGLsizei){.dynlib: dllname, + importc: "glCopyConvolutionFilter2DEXT".} +proc glGetConvolutionFilterEXT*(target: TGLenum, format: TGLenum, + thetype: TGLenum, image: PGLvoid){. + dynlib: dllname, importc: "glGetConvolutionFilterEXT".} +proc glSeparableFilter2DEXT*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei, format: TGLenum, + thetype: TGLenum, row: PGLvoid, column: PGLvoid){. + dynlib: dllname, importc: "glSeparableFilter2DEXT".} +proc glGetSeparableFilterEXT*(target: TGLenum, format: TGLenum, + thetype: TGLenum, row: PGLvoid, column: PGLvoid, + span: PGLvoid){.dynlib: dllname, + importc: "glGetSeparableFilterEXT".} +proc glConvolutionParameteriEXT*(target: TGLenum, pname: TGLenum, param: TGLint){. + dynlib: dllname, importc: "glConvolutionParameteriEXT".} +proc glConvolutionParameterivEXT*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glConvolutionParameterivEXT".} +proc glConvolutionParameterfEXT*(target: TGLenum, pname: TGLenum, + param: TGLfloat){.dynlib: dllname, + importc: "glConvolutionParameterfEXT".} +proc glConvolutionParameterfvEXT*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glConvolutionParameterfvEXT".} +proc glGetConvolutionParameterivEXT*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetConvolutionParameterivEXT".} +proc glGetConvolutionParameterfvEXT*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetConvolutionParameterfvEXT".} + #***** GL_EXT_fog_coord *****// +const + GL_FOG_COORDINATE_SOURCE_EXT* = 0x00008450 + GL_FOG_COORDINATE_EXT* = 0x00008451 + GL_FRAGMENT_DEPTH_EXT* = 0x00008452 + GL_CURRENT_FOG_COORDINATE_EXT* = 0x00008453 + GL_FOG_COORDINATE_ARRAY_TYPE_EXT* = 0x00008454 + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT* = 0x00008455 + GL_FOG_COORDINATE_ARRAY_POINTER_EXT* = 0x00008456 + GL_FOG_COORDINATE_ARRAY_EXT* = 0x00008457 + +proc glFogCoordfEXfloat*(coord: TGLfloat){.dynlib: dllname, + importc: "glFogCoordfEXfloat".} +proc glFogCoorddEXdouble*(coord: TGLdouble){.dynlib: dllname, + importc: "glFogCoorddEXdouble".} +proc glFogCoordfvEXfloat*(coord: TGLfloat){.dynlib: dllname, + importc: "glFogCoordfvEXfloat".} +proc glFogCoorddvEXdouble*(coord: TGLdouble){.dynlib: dllname, + importc: "glFogCoorddvEXdouble".} +proc glFogCoordPointerEXT*(thetype: TGLenum, stride: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glFogCoordPointerEXT".} + #***** GL_EXT_histogram *****// +const + constGL_HISTOGRAM_EXT* = 0x00008024 + GL_PROXY_HISTOGRAM_EXT* = 0x00008025 + GL_HISTOGRAM_WIDTH_EXT* = 0x00008026 + GL_HISTOGRAM_FORMAT_EXT* = 0x00008027 + GL_HISTOGRAM_RED_SIZE_EXT* = 0x00008028 + GL_HISTOGRAM_GREEN_SIZE_EXT* = 0x00008029 + GL_HISTOGRAM_BLUE_SIZE_EXT* = 0x0000802A + GL_HISTOGRAM_ALPHA_SIZE_EXT* = 0x0000802B + GL_HISTOGRAM_LUMINANCE_SIZE_EXT* = 0x0000802C + GL_HISTOGRAM_SINK_EXT* = 0x0000802D + constGL_MINMAX_EXT* = 0x0000802E + GL_MINMAX_FORMAT_EXT* = 0x0000802F + GL_MINMAX_SINK_EXT* = 0x00008030 + +proc glHistogramEXT*(target: TGLenum, width: TGLsizei, internalformat: TGLenum, + sink: TGLboolean){.dynlib: dllname, + importc: "glHistogramEXT".} +proc glResetHistogramEXT*(target: TGLenum){.dynlib: dllname, + importc: "glResetHistogramEXT".} +proc glGetHistogramEXT*(target: TGLenum, reset: TGLboolean, format: TGLenum, + thetype: TGLenum, values: PGLvoid){.dynlib: dllname, + importc: "glGetHistogramEXT".} +proc glGetHistogramParameterivEXT*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetHistogramParameterivEXT".} +proc glGetHistogramParameterfvEXT*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetHistogramParameterfvEXT".} +proc glMinmaxEXT*(target: TGLenum, internalformat: TGLenum, sink: TGLboolean){. + dynlib: dllname, importc: "glMinmaxEXT".} +proc glResetMinmaxEXT*(target: TGLenum){.dynlib: dllname, + importc: "glResetMinmaxEXT".} +proc glGetMinmaxEXT*(target: TGLenum, reset: TGLboolean, format: TGLenum, + thetype: TGLenum, values: PGLvoid){.dynlib: dllname, + importc: "glGetMinmaxEXT".} +proc glGetMinmaxParameterivEXT*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetMinmaxParameterivEXT".} +proc glGetMinmaxParameterfvEXT*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetMinmaxParameterfvEXT".} + #***** GL_EXT_multi_draw_arrays *****// +proc glMultiDrawArraysEXT*(mode: TGLenum, first: PGLint, count: PGLsizei, + primcount: TGLsizei){.dynlib: dllname, + importc: "glMultiDrawArraysEXT".} +proc glMultiDrawElementsEXT*(mode: TGLenum, count: PGLsizei, thetype: TGLenum, + indices: PGLvoid, primcount: TGLsizei){. + dynlib: dllname, importc: "glMultiDrawElementsEXT".} + #***** GL_EXT_packed_pixels *****// +const + GL_UNSIGNED_BYTE_3_3_2_EXT* = 0x00008032 + GL_UNSIGNED_SHORT_4_4_4_4_EXT* = 0x00008033 + GL_UNSIGNED_SHORT_5_5_5_1_EXT* = 0x00008034 + GL_UNSIGNED_INT_8_8_8_8_EXT* = 0x00008035 + GL_UNSIGNED_INT_10_10_10_2_EXT* = 0x00008036 + #***** GL_EXT_paletted_texture *****// + +const + GL_COLOR_INDEX1_EXT* = 0x000080E2 + GL_COLOR_INDEX2_EXT* = 0x000080E3 + GL_COLOR_INDEX4_EXT* = 0x000080E4 + GL_COLOR_INDEX8_EXT* = 0x000080E5 + GL_COLOR_INDEX12_EXT* = 0x000080E6 + GL_COLOR_INDEX16_EXT* = 0x000080E7 + GL_COLOR_TABLE_FORMAT_EXT* = 0x000080D8 + GL_COLOR_TABLE_WIDTH_EXT* = 0x000080D9 + GL_COLOR_TABLE_RED_SIZE_EXT* = 0x000080DA + GL_COLOR_TABLE_GREEN_SIZE_EXT* = 0x000080DB + GL_COLOR_TABLE_BLUE_SIZE_EXT* = 0x000080DC + GL_COLOR_TABLE_ALPHA_SIZE_EXT* = 0x000080DD + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT* = 0x000080DE + GL_COLOR_TABLE_INTENSITY_SIZE_EXT* = 0x000080DF + GL_TEXTURE_INDEX_SIZE_EXT* = 0x000080ED + GL_TEXTURE_1D* = 0x00000DE0 + GL_TEXTURE_2D* = 0x00000DE1 + GL_TEXTURE_3D_EXT* = 0x0000806F # GL_TEXTURE_CUBE_MAP_ARB { already defined } + GL_PROXY_TEXTURE_1D* = 0x00008063 + GL_PROXY_TEXTURE_2D* = 0x00008064 + GL_PROXY_TEXTURE_3D_EXT* = 0x00008070 # GL_PROXY_TEXTURE_CUBE_MAP_ARB { already defined } + # GL_TEXTURE_1D { already defined } + # GL_TEXTURE_2D { already defined } + # GL_TEXTURE_3D_EXT { already defined } + # GL_TEXTURE_CUBE_MAP_ARB { already defined } + +proc glColorTableEXT*(target: TGLenum, internalFormat: TGLenum, width: TGLsizei, + format: TGLenum, thetype: TGLenum, data: PGLvoid){. + dynlib: dllname, importc: "glColorTableEXT".} + # glColorSubTableEXT { already defined } +proc glGetColorTableEXT*(target: TGLenum, format: TGLenum, thetype: TGLenum, + data: PGLvoid){.dynlib: dllname, + importc: "glGetColorTableEXT".} +proc glGetColorTableParameterivEXT*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetColorTableParameterivEXT".} +proc glGetColorTableParameterfvEXT*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetColorTableParameterfvEXT".} + #***** GL_EXT_point_parameters *****// +const + GL_POINT_SIZE_MIN_EXT* = 0x00008126 + GL_POINT_SIZE_MAX_EXT* = 0x00008127 + GL_POINT_FADE_THRESHOLD_SIZE_EXT* = 0x00008128 + GL_DISTANCE_ATTENUATION_EXT* = 0x00008129 + +proc glPointParameterfEXT*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPointParameterfEXT".} +proc glPointParameterfvEXT*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glPointParameterfvEXT".} + #***** GL_EXT_polygon_offset *****// +const + constGL_POLYGON_OFFSET_EXT* = 0x00008037 + GL_POLYGON_OFFSET_FACTOR_EXT* = 0x00008038 + GL_POLYGON_OFFSET_BIAS_EXT* = 0x00008039 + +proc glPolygonOffsetEXT*(factor: TGLfloat, bias: TGLfloat){.dynlib: dllname, + importc: "glPolygonOffsetEXT".} + #***** GL_EXT_secondary_color *****// +const + GL_COLOR_SUM_EXT* = 0x00008458 + GL_CURRENT_SECONDARY_COLOR_EXT* = 0x00008459 + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT* = 0x0000845A + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT* = 0x0000845B + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT* = 0x0000845C + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT* = 0x0000845D + GL_SECONDARY_COLOR_ARRAY_EXT* = 0x0000845E + +proc glSecondaryColor3bEXT*(components: TGLbyte){.dynlib: dllname, + importc: "glSecondaryColor3bEXT".} +proc glSecondaryColor3sEXT*(components: TGLshort){.dynlib: dllname, + importc: "glSecondaryColor3sEXT".} +proc glSecondaryColor3iEXT*(components: TGLint){.dynlib: dllname, + importc: "glSecondaryColor3iEXT".} +proc glSecondaryColor3fEXT*(components: TGLfloat){.dynlib: dllname, + importc: "glSecondaryColor3fEXT".} +proc glSecondaryColor3dEXT*(components: TGLdouble){.dynlib: dllname, + importc: "glSecondaryColor3dEXT".} +proc glSecondaryColor3ubEXT*(components: TGLubyte){.dynlib: dllname, + importc: "glSecondaryColor3ubEXT".} +proc glSecondaryColor3usEXT*(components: TGLushort){.dynlib: dllname, + importc: "glSecondaryColor3usEXT".} +proc glSecondaryColor3uiEXT*(components: TGLuint){.dynlib: dllname, + importc: "glSecondaryColor3uiEXT".} +proc glSecondaryColor3bvEXT*(components: TGLbyte){.dynlib: dllname, + importc: "glSecondaryColor3bvEXT".} +proc glSecondaryColor3svEXT*(components: TGLshort){.dynlib: dllname, + importc: "glSecondaryColor3svEXT".} +proc glSecondaryColor3ivEXT*(components: TGLint){.dynlib: dllname, + importc: "glSecondaryColor3ivEXT".} +proc glSecondaryColor3fvEXT*(components: TGLfloat){.dynlib: dllname, + importc: "glSecondaryColor3fvEXT".} +proc glSecondaryColor3dvEXT*(components: TGLdouble){.dynlib: dllname, + importc: "glSecondaryColor3dvEXT".} +proc glSecondaryColor3ubvEXT*(components: TGLubyte){.dynlib: dllname, + importc: "glSecondaryColor3ubvEXT".} +proc glSecondaryColor3usvEXT*(components: TGLushort){.dynlib: dllname, + importc: "glSecondaryColor3usvEXT".} +proc glSecondaryColor3uivEXT*(components: TGLuint){.dynlib: dllname, + importc: "glSecondaryColor3uivEXT".} +proc glSecondaryColorPointerEXT*(size: TGLint, thetype: TGLenum, + stride: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glSecondaryColorPointerEXT".} + #***** GL_EXT_separate_specular_color *****// +const + GL_LIGHT_MODEL_COLOR_CONTROL_EXT* = 0x000081F8 + GL_SINGLE_COLOR_EXT* = 0x000081F9 + GL_SEPARATE_SPECULAR_COLOR_EXT* = 0x000081FA + #***** GL_EXT_shadow_funcs *****// + #***** GL_EXT_shared_texture_palette *****// + +const + GL_SHARED_TEXTURE_PALETTE_EXT* = 0x000081FB + #***** GL_EXT_stencil_two_side *****// + +const + GL_STENCIL_TEST_TWO_SIDE_EXT* = 0x00008910 + constGL_ACTIVE_STENCIL_FACE_EXT* = 0x00008911 + +proc glActiveStencilFaceEXT*(face: TGLenum){.dynlib: dllname, + importc: "glActiveStencilFaceEXT".} + #***** GL_EXT_stencil_wrap *****// +const + GL_INCR_WRAP_EXT* = 0x00008507 + GL_DECR_WRAP_EXT* = 0x00008508 + #***** GL_EXT_subtexture *****// + +proc glTexSubImage1DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, + width: TGLsizei, format: TGLenum, thetype: TGLenum, + pixels: PGLvoid){.dynlib: dllname, + importc: "glTexSubImage1DEXT".} +proc glTexSubImage2DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, width: TGLsizei, height: TGLsizei, + format: TGLenum, thetype: TGLenum, pixels: PGLvoid){. + dynlib: dllname, importc: "glTexSubImage2DEXT".} +proc glTexSubImage3DEXT*(target: TGLenum, level: TGLint, xoffset: TGLint, + yoffset: TGLint, zoffset: TGLint, width: TGLsizei, + height: TGLsizei, depth: TGLsizei, format: TGLenum, + thetype: TGLenum, pixels: PGLvoid){.dynlib: dllname, + importc: "glTexSubImage3DEXT".} + #***** GL_EXT_texture3D *****// +const + GL_PACK_SKIP_IMAGES_EXT* = 0x0000806B + GL_PACK_IMAGE_HEIGHT_EXT* = 0x0000806C + GL_UNPACK_SKIP_IMAGES_EXT* = 0x0000806D + GL_UNPACK_IMAGE_HEIGHT_EXT* = 0x0000806E # GL_TEXTURE_3D_EXT { already defined } + # GL_PROXY_TEXTURE_3D_EXT { already defined } + GL_TEXTURE_DEPTH_EXT* = 0x00008071 + GL_TEXTURE_WRAP_R_EXT* = 0x00008072 + GL_MAX_3D_TEXTURE_SIZE_EXT* = 0x00008073 + +proc glTexImage3DEXT*(target: TGLenum, level: TGLint, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei, depth: TGLsizei, + border: TGLint, format: TGLenum, thetype: TGLenum, + pixels: PGLvoid){.dynlib: dllname, + importc: "glTexImage3DEXT".} + #***** GL_EXT_texture_compression_s3tc *****// +const + GL_COMPRESSED_RGB_S3TC_DXT1_EXT* = 0x000083F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT* = 0x000083F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT* = 0x000083F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT* = 0x000083F3 + #***** GL_EXT_texture_env_add *****// + #***** GL_EXT_texture_env_combine *****// + +const + GL_COMBINE_EXT* = 0x00008570 + GL_COMBINE_RGB_EXT* = 0x00008571 + GL_COMBINE_ALPHA_EXT* = 0x00008572 + GL_SOURCE0_RGB_EXT* = 0x00008580 + GL_SOURCE1_RGB_EXT* = 0x00008581 + GL_SOURCE2_RGB_EXT* = 0x00008582 + GL_SOURCE0_ALPHA_EXT* = 0x00008588 + GL_SOURCE1_ALPHA_EXT* = 0x00008589 + GL_SOURCE2_ALPHA_EXT* = 0x0000858A + GL_OPERAND0_RGB_EXT* = 0x00008590 + GL_OPERAND1_RGB_EXT* = 0x00008591 + GL_OPERAND2_RGB_EXT* = 0x00008592 + GL_OPERAND0_ALPHA_EXT* = 0x00008598 + GL_OPERAND1_ALPHA_EXT* = 0x00008599 + GL_OPERAND2_ALPHA_EXT* = 0x0000859A + GL_RGB_SCALE_EXT* = 0x00008573 + GL_ADD_SIGNED_EXT* = 0x00008574 + GL_INTERPOLATE_EXT* = 0x00008575 + GL_CONSTANT_EXT* = 0x00008576 + GL_PRIMARY_COLOR_EXT* = 0x00008577 + GL_PREVIOUS_EXT* = 0x00008578 + #***** GL_EXT_texture_env_dot3 *****// + +const + GL_DOT3_RGB_EXT* = 0x00008740 + GL_DOT3_RGBA_EXT* = 0x00008741 + #***** GL_EXT_texture_filter_anisotropic *****// + +const + GL_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FE + GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT* = 0x000084FF + #***** GL_EXT_texture_lod_bias *****// + +const + GL_TEXTURE_FILTER_CONTROL_EXT* = 0x00008500 + GL_TEXTURE_LOD_BIAS_EXT* = 0x00008501 + GL_MAX_TEXTURE_LOD_BIAS_EXT* = 0x000084FD + #***** GL_EXT_texture_object *****// + +const + GL_TEXTURE_PRIORITY_EXT* = 0x00008066 + GL_TEXTURE_RESIDENT_EXT* = 0x00008067 + GL_TEXTURE_1D_BINDING_EXT* = 0x00008068 + GL_TEXTURE_2D_BINDING_EXT* = 0x00008069 + GL_TEXTURE_3D_BINDING_EXT* = 0x0000806A + +proc glGenTexturesEXT*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, + importc: "glGenTexturesEXT".} +proc glDeleteTexturesEXT*(n: TGLsizei, textures: PGLuint){.dynlib: dllname, + importc: "glDeleteTexturesEXT".} +proc glBindTextureEXT*(target: TGLenum, texture: TGLuint){.dynlib: dllname, + importc: "glBindTextureEXT".} +proc glPrioritizeTexturesEXT*(n: TGLsizei, textures: PGLuint, + priorities: PGLclampf){.dynlib: dllname, + importc: "glPrioritizeTexturesEXT".} +proc glAreTexturesResidentEXT*(n: TGLsizei, textures: PGLuint, + residences: PGLboolean): TGLboolean{. + dynlib: dllname, importc: "glAreTexturesResidentEXT".} +proc glIsTextureEXT*(texture: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsTextureEXT".} + #***** GL_EXT_vertex_array *****// +const + GL_VERTEX_ARRAY_EXT* = 0x00008074 + GL_NORMAL_ARRAY_EXT* = 0x00008075 + GL_COLOR_ARRAY_EXT* = 0x00008076 + GL_INDEX_ARRAY_EXT* = 0x00008077 + GL_TEXTURE_COORD_ARRAY_EXT* = 0x00008078 + GL_EDGE_FLAG_ARRAY_EXT* = 0x00008079 + GL_DOUBLE_EXT* = 0x0000140A + GL_VERTEX_ARRAY_SIZE_EXT* = 0x0000807A + GL_VERTEX_ARRAY_TYPE_EXT* = 0x0000807B + GL_VERTEX_ARRAY_STRIDE_EXT* = 0x0000807C + GL_VERTEX_ARRAY_COUNT_EXT* = 0x0000807D + GL_NORMAL_ARRAY_TYPE_EXT* = 0x0000807E + GL_NORMAL_ARRAY_STRIDE_EXT* = 0x0000807F + GL_NORMAL_ARRAY_COUNT_EXT* = 0x00008080 + GL_COLOR_ARRAY_SIZE_EXT* = 0x00008081 + GL_COLOR_ARRAY_TYPE_EXT* = 0x00008082 + GL_COLOR_ARRAY_STRIDE_EXT* = 0x00008083 + GL_COLOR_ARRAY_COUNT_EXT* = 0x00008084 + GL_INDEX_ARRAY_TYPE_EXT* = 0x00008085 + GL_INDEX_ARRAY_STRIDE_EXT* = 0x00008086 + GL_INDEX_ARRAY_COUNT_EXT* = 0x00008087 + GL_TEXTURE_COORD_ARRAY_SIZE_EXT* = 0x00008088 + GL_TEXTURE_COORD_ARRAY_TYPE_EXT* = 0x00008089 + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT* = 0x0000808A + GL_TEXTURE_COORD_ARRAY_COUNT_EXT* = 0x0000808B + GL_EDGE_FLAG_ARRAY_STRIDE_EXT* = 0x0000808C + GL_EDGE_FLAG_ARRAY_COUNT_EXT* = 0x0000808D + GL_VERTEX_ARRAY_POINTER_EXT* = 0x0000808E + GL_NORMAL_ARRAY_POINTER_EXT* = 0x0000808F + GL_COLOR_ARRAY_POINTER_EXT* = 0x00008090 + GL_INDEX_ARRAY_POINTER_EXT* = 0x00008091 + GL_TEXTURE_COORD_ARRAY_POINTER_EXT* = 0x00008092 + GL_EDGE_FLAG_ARRAY_POINTER_EXT* = 0x00008093 + +proc glArrayElementEXT*(i: TGLint){.dynlib: dllname, + importc: "glArrayElementEXT".} +proc glDrawArraysEXT*(mode: TGLenum, first: TGLint, count: TGLsizei){. + dynlib: dllname, importc: "glDrawArraysEXT".} +proc glVertexPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexPointerEXT".} +proc glNormalPointerEXT*(thetype: TGLenum, stride: TGLsizei, count: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glNormalPointerEXT".} +proc glColorPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, + importc: "glColorPointerEXT".} +proc glIndexPointerEXT*(thetype: TGLenum, stride: TGLsizei, count: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glIndexPointerEXT".} +proc glTexCoordPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + count: TGLsizei, pointer: PGLvoid){.dynlib: dllname, + importc: "glTexCoordPointerEXT".} +proc glEdgeFlagPointerEXT*(stride: TGLsizei, count: TGLsizei, + pointer: PGLboolean){.dynlib: dllname, + importc: "glEdgeFlagPointerEXT".} +proc glGetPointervEXT*(pname: TGLenum, params: PGLvoid){.dynlib: dllname, + importc: "glGetPointervEXT".} + #***** GL_EXT_vertex_shader *****// +const + GL_VERTEX_SHADER_EXT* = 0x00008780 + GL_VARIANT_VALUE_EXT* = 0x000087E4 + GL_VARIANT_DATATYPE_EXT* = 0x000087E5 + GL_VARIANT_ARRAY_STRIDE_EXT* = 0x000087E6 + GL_VARIANT_ARRAY_TYPE_EXT* = 0x000087E7 + GL_VARIANT_ARRAY_EXT* = 0x000087E8 + GL_VARIANT_ARRAY_POINTER_EXT* = 0x000087E9 + GL_INVARIANT_VALUE_EXT* = 0x000087EA + GL_INVARIANT_DATATYPE_EXT* = 0x000087EB + GL_LOCAL_CONSTANT_VALUE_EXT* = 0x000087EC + GL_LOCAL_CONSTANT_DATATYPE_EXT* = 0x000087ED + GL_OP_INDEX_EXT* = 0x00008782 + GL_OP_NEGATE_EXT* = 0x00008783 + GL_OP_DOT3_EXT* = 0x00008784 + GL_OP_DOT4_EXT* = 0x00008785 + GL_OP_MUL_EXT* = 0x00008786 + GL_OP_ADD_EXT* = 0x00008787 + GL_OP_MADD_EXT* = 0x00008788 + GL_OP_FRAC_EXT* = 0x00008789 + GL_OP_MAX_EXT* = 0x0000878A + GL_OP_MIN_EXT* = 0x0000878B + GL_OP_SET_GE_EXT* = 0x0000878C + GL_OP_SET_LT_EXT* = 0x0000878D + GL_OP_CLAMP_EXT* = 0x0000878E + GL_OP_FLOOR_EXT* = 0x0000878F + GL_OP_ROUND_EXT* = 0x00008790 + GL_OP_EXP_BASE_2_EXT* = 0x00008791 + GL_OP_LOG_BASE_2_EXT* = 0x00008792 + GL_OP_POWER_EXT* = 0x00008793 + GL_OP_RECIP_EXT* = 0x00008794 + GL_OP_RECIP_SQRT_EXT* = 0x00008795 + GL_OP_SUB_EXT* = 0x00008796 + GL_OP_CROSS_PRODUCT_EXT* = 0x00008797 + GL_OP_MULTIPLY_MATRIX_EXT* = 0x00008798 + GL_OP_MOV_EXT* = 0x00008799 + GL_OUTPUT_VERTEX_EXT* = 0x0000879A + GL_OUTPUT_COLOR0_EXT* = 0x0000879B + GL_OUTPUT_COLOR1_EXT* = 0x0000879C + GL_OUTPUT_TEXTURE_COORD0_EXT* = 0x0000879D + GL_OUTPUT_TEXTURE_COORD1_EXT* = 0x0000879E + GL_OUTPUT_TEXTURE_COORD2_EXT* = 0x0000879F + GL_OUTPUT_TEXTURE_COORD3_EXT* = 0x000087A0 + GL_OUTPUT_TEXTURE_COORD4_EXT* = 0x000087A1 + GL_OUTPUT_TEXTURE_COORD5_EXT* = 0x000087A2 + GL_OUTPUT_TEXTURE_COORD6_EXT* = 0x000087A3 + GL_OUTPUT_TEXTURE_COORD7_EXT* = 0x000087A4 + GL_OUTPUT_TEXTURE_COORD8_EXT* = 0x000087A5 + GL_OUTPUT_TEXTURE_COORD9_EXT* = 0x000087A6 + GL_OUTPUT_TEXTURE_COORD10_EXT* = 0x000087A7 + GL_OUTPUT_TEXTURE_COORD11_EXT* = 0x000087A8 + GL_OUTPUT_TEXTURE_COORD12_EXT* = 0x000087A9 + GL_OUTPUT_TEXTURE_COORD13_EXT* = 0x000087AA + GL_OUTPUT_TEXTURE_COORD14_EXT* = 0x000087AB + GL_OUTPUT_TEXTURE_COORD15_EXT* = 0x000087AC + GL_OUTPUT_TEXTURE_COORD16_EXT* = 0x000087AD + GL_OUTPUT_TEXTURE_COORD17_EXT* = 0x000087AE + GL_OUTPUT_TEXTURE_COORD18_EXT* = 0x000087AF + GL_OUTPUT_TEXTURE_COORD19_EXT* = 0x000087B0 + GL_OUTPUT_TEXTURE_COORD20_EXT* = 0x000087B1 + GL_OUTPUT_TEXTURE_COORD21_EXT* = 0x000087B2 + GL_OUTPUT_TEXTURE_COORD22_EXT* = 0x000087B3 + GL_OUTPUT_TEXTURE_COORD23_EXT* = 0x000087B4 + GL_OUTPUT_TEXTURE_COORD24_EXT* = 0x000087B5 + GL_OUTPUT_TEXTURE_COORD25_EXT* = 0x000087B6 + GL_OUTPUT_TEXTURE_COORD26_EXT* = 0x000087B7 + GL_OUTPUT_TEXTURE_COORD27_EXT* = 0x000087B8 + GL_OUTPUT_TEXTURE_COORD28_EXT* = 0x000087B9 + GL_OUTPUT_TEXTURE_COORD29_EXT* = 0x000087BA + GL_OUTPUT_TEXTURE_COORD30_EXT* = 0x000087BB + GL_OUTPUT_TEXTURE_COORD31_EXT* = 0x000087BC + GL_OUTPUT_FOG_EXT* = 0x000087BD + GL_SCALAR_EXT* = 0x000087BE + GL_VECTOR_EXT* = 0x000087BF + GL_MATRIX_EXT* = 0x000087C0 + GL_VARIANT_EXT* = 0x000087C1 + GL_INVARIANT_EXT* = 0x000087C2 + GL_LOCAL_CONSTANT_EXT* = 0x000087C3 + GL_LOCAL_EXT* = 0x000087C4 + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087C5 + GL_MAX_VERTEX_SHADER_VARIANTS_EXT* = 0x000087C6 + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087C7 + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087C8 + GL_MAX_VERTEX_SHADER_LOCALS_EXT* = 0x000087C9 + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CA + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT* = 0x000087CB + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087CC + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087CD + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT* = 0x000087CE + GL_VERTEX_SHADER_INSTRUCTIONS_EXT* = 0x000087CF + GL_VERTEX_SHADER_VARIANTS_EXT* = 0x000087D0 + GL_VERTEX_SHADER_INVARIANTS_EXT* = 0x000087D1 + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT* = 0x000087D2 + GL_VERTEX_SHADER_LOCALS_EXT* = 0x000087D3 + GL_VERTEX_SHADER_BINDING_EXT* = 0x00008781 + GL_VERTEX_SHADER_OPTIMIZED_EXT* = 0x000087D4 + GL_X_EXT* = 0x000087D5 + GL_Y_EXT* = 0x000087D6 + GL_Z_EXT* = 0x000087D7 + GL_W_EXT* = 0x000087D8 + GL_NEGATIVE_X_EXT* = 0x000087D9 + GL_NEGATIVE_Y_EXT* = 0x000087DA + GL_NEGATIVE_Z_EXT* = 0x000087DB + GL_NEGATIVE_W_EXT* = 0x000087DC + GL_ZERO_EXT* = 0x000087DD + GL_ONE_EXT* = 0x000087DE + GL_NEGATIVE_ONE_EXT* = 0x000087DF + GL_NORMALIZED_RANGE_EXT* = 0x000087E0 + GL_FULL_RANGE_EXT* = 0x000087E1 + GL_CURRENT_VERTEX_EXT* = 0x000087E2 + GL_MVP_MATRIX_EXT* = 0x000087E3 + +proc glBeginVertexShaderEXT*(){.dynlib: dllname, + importc: "glBeginVertexShaderEXT".} +proc glEndVertexShaderEXT*(){.dynlib: dllname, importc: "glEndVertexShaderEXT".} +proc glBindVertexShaderEXT*(id: TGLuint){.dynlib: dllname, + importc: "glBindVertexShaderEXT".} +proc glGenVertexShadersEXT*(range: TGLuint): TGLuint{.dynlib: dllname, + importc: "glGenVertexShadersEXT".} +proc glDeleteVertexShaderEXT*(id: TGLuint){.dynlib: dllname, + importc: "glDeleteVertexShaderEXT".} +proc glShaderOp1EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint){.dynlib: dllname, + importc: "glShaderOp1EXT".} +proc glShaderOp2EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint, arg2: TGLuint){. + dynlib: dllname, importc: "glShaderOp2EXT".} +proc glShaderOp3EXT*(op: TGLenum, res: TGLuint, arg1: TGLuint, arg2: TGLuint, + arg3: TGLuint){.dynlib: dllname, importc: "glShaderOp3EXT".} +proc glSwizzleEXT*(res: TGLuint, theIn: TGLuint, outX: TGLenum, outY: TGLenum, + outZ: TGLenum, outW: TGLenum){.dynlib: dllname, + importc: "glSwizzleEXT".} +proc glWriteMaskEXT*(res: TGLuint, theIn: TGLuint, outX: TGLenum, outY: TGLenum, + outZ: TGLenum, outW: TGLenum){.dynlib: dllname, + importc: "glWriteMaskEXT".} +proc glInsertComponentEXT*(res: TGLuint, src: TGLuint, num: TGLuint){. + dynlib: dllname, importc: "glInsertComponentEXT".} +proc glExtractComponentEXT*(res: TGLuint, src: TGLuint, num: TGLuint){. + dynlib: dllname, importc: "glExtractComponentEXT".} +proc glGenSymbolsEXT*(datatype: TGLenum, storagetype: TGLenum, range: TGLenum, + components: TGLuint): TGLuint{.dynlib: dllname, + importc: "glGenSymbolsEXT".} +proc glSetInvariantEXT*(id: TGLuint, thetype: TGLenum, address: PGLvoid){. + dynlib: dllname, importc: "glSetInvariantEXT".} +proc glSetLocalConstantEXT*(id: TGLuint, thetype: TGLenum, address: PGLvoid){. + dynlib: dllname, importc: "glSetLocalConstantEXT".} +proc glVariantbvEXT*(id: TGLuint, address: PGLbyte){.dynlib: dllname, + importc: "glVariantbvEXT".} +proc glVariantsvEXT*(id: TGLuint, address: PGLshort){.dynlib: dllname, + importc: "glVariantsvEXT".} +proc glVariantivEXT*(id: TGLuint, address: PGLint){.dynlib: dllname, + importc: "glVariantivEXT".} +proc glVariantfvEXT*(id: TGLuint, address: PGLfloat){.dynlib: dllname, + importc: "glVariantfvEXT".} +proc glVariantdvEXT*(id: TGLuint, address: PGLdouble){.dynlib: dllname, + importc: "glVariantdvEXT".} +proc glVariantubvEXT*(id: TGLuint, address: PGLubyte){.dynlib: dllname, + importc: "glVariantubvEXT".} +proc glVariantusvEXT*(id: TGLuint, address: PGLushort){.dynlib: dllname, + importc: "glVariantusvEXT".} +proc glVariantuivEXT*(id: TGLuint, address: PGLuint){.dynlib: dllname, + importc: "glVariantuivEXT".} +proc glVariantPointerEXT*(id: TGLuint, thetype: TGLenum, stride: TGLuint, + address: PGLvoid){.dynlib: dllname, + importc: "glVariantPointerEXT".} +proc glEnableVariantClientStateEXT*(id: TGLuint){.dynlib: dllname, + importc: "glEnableVariantClientStateEXT".} +proc glDisableVariantClientStateEXT*(id: TGLuint){.dynlib: dllname, + importc: "glDisableVariantClientStateEXT".} +proc glBindLightParameterEXT*(light: TGLenum, value: TGLenum): TGLuint{. + dynlib: dllname, importc: "glBindLightParameterEXT".} +proc glBindMaterialParameterEXT*(face: TGLenum, value: TGLenum): TGLuint{. + dynlib: dllname, importc: "glBindMaterialParameterEXT".} +proc glBindTexGenParameterEXT*(theunit: TGLenum, coord: TGLenum, value: TGLenum): TGLuint{. + dynlib: dllname, importc: "glBindTexGenParameterEXT".} +proc glBindTextureUnitParameterEXT*(theunit: TGLenum, value: TGLenum): TGLuint{. + dynlib: dllname, importc: "glBindTextureUnitParameterEXT".} +proc glBindParameterEXT*(value: TGLenum): TGLuint{.dynlib: dllname, + importc: "glBindParameterEXT".} +proc glIsVariantEnabledEXT*(id: TGLuint, cap: TGLenum): TGLboolean{. + dynlib: dllname, importc: "glIsVariantEnabledEXT".} +proc glGetVariantBooleanvEXT*(id: TGLuint, value: TGLenum, data: PGLboolean){. + dynlib: dllname, importc: "glGetVariantBooleanvEXT".} +proc glGetVariantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. + dynlib: dllname, importc: "glGetVariantIntegervEXT".} +proc glGetVariantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. + dynlib: dllname, importc: "glGetVariantFloatvEXT".} +proc glGetVariantPointervEXT*(id: TGLuint, value: TGLenum, data: PGLvoid){. + dynlib: dllname, importc: "glGetVariantPointervEXT".} +proc glGetInvariantBooleanvEXT*(id: TGLuint, value: TGLenum, data: PGLboolean){. + dynlib: dllname, importc: "glGetInvariantBooleanvEXT".} +proc glGetInvariantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. + dynlib: dllname, importc: "glGetInvariantIntegervEXT".} +proc glGetInvariantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. + dynlib: dllname, importc: "glGetInvariantFloatvEXT".} +proc glGetLocalConstantBooleanvEXT*(id: TGLuint, value: TGLenum, + data: PGLboolean){.dynlib: dllname, + importc: "glGetLocalConstantBooleanvEXT".} +proc glGetLocalConstantIntegervEXT*(id: TGLuint, value: TGLenum, data: PGLint){. + dynlib: dllname, importc: "glGetLocalConstantIntegervEXT".} +proc glGetLocalConstantFloatvEXT*(id: TGLuint, value: TGLenum, data: PGLfloat){. + dynlib: dllname, importc: "glGetLocalConstantFloatvEXT".} + #***** GL_EXT_vertex_weighting *****// +const + GL_VERTEX_WEIGHTING_EXT* = 0x00008509 + GL_MODELVIEW0_EXT* = 0x00001700 + GL_MODELVIEW1_EXT* = 0x0000850A + GL_MODELVIEW0_MATRIX_EXT* = 0x00000BA6 + GL_MODELVIEW1_MATRIX_EXT* = 0x00008506 + GL_CURRENT_VERTEX_WEIGHT_EXT* = 0x0000850B + GL_VERTEX_WEIGHT_ARRAY_EXT* = 0x0000850C + GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT* = 0x0000850D + GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT* = 0x0000850E + GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT* = 0x0000850F + GL_MODELVIEW0_STACK_DEPTH_EXT* = 0x00000BA3 + GL_MODELVIEW1_STACK_DEPTH_EXT* = 0x00008502 + GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT* = 0x00008510 + +proc glVertexWeightfEXT*(weight: TGLfloat){.dynlib: dllname, + importc: "glVertexWeightfEXT".} +proc glVertexWeightfvEXT*(weight: PGLfloat){.dynlib: dllname, + importc: "glVertexWeightfvEXT".} +proc glVertexWeightPointerEXT*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexWeightPointerEXT".} + #***** GL_HP_occlusion_test *****// +const + GL_OCCLUSION_TEST_HP* = 0x00008165 + GL_OCCLUSION_TEST_RESULT_HP* = 0x00008166 + #***** GL_NV_blend_square *****// + #***** GL_NV_copy_depth_to_color *****// + +const + GL_DEPTH_STENCIL_TO_RGBA_NV* = 0x0000886E + GL_DEPTH_STENCIL_TO_BGRA_NV* = 0x0000886F + #***** GL_NV_depth_clamp *****// + +const + GL_DEPTH_CLAMP_NV* = 0x0000864F + #***** GL_NV_evaluators *****// + +const + GL_EVAL_2D_NV* = 0x000086C0 + GL_EVAL_TRIANGULAR_2D_NV* = 0x000086C1 + GL_MAP_TESSELLATION_NV* = 0x000086C2 + GL_MAP_ATTRIB_U_ORDER_NV* = 0x000086C3 + GL_MAP_ATTRIB_V_ORDER_NV* = 0x000086C4 + GL_EVAL_FRACTIONAL_TESSELLATION_NV* = 0x000086C5 + GL_EVAL_VERTEX_ATTRIB0_NV* = 0x000086C6 + GL_EVAL_VERTEX_ATTRIB1_NV* = 0x000086C7 + GL_EVAL_VERTEX_ATTRIB2_NV* = 0x000086C8 + GL_EVAL_VERTEX_ATTRIB3_NV* = 0x000086C9 + GL_EVAL_VERTEX_ATTRIB4_NV* = 0x000086CA + GL_EVAL_VERTEX_ATTRIB5_NV* = 0x000086CB + GL_EVAL_VERTEX_ATTRIB6_NV* = 0x000086CC + GL_EVAL_VERTEX_ATTRIB7_NV* = 0x000086CD + GL_EVAL_VERTEX_ATTRIB8_NV* = 0x000086CE + GL_EVAL_VERTEX_ATTRIB9_NV* = 0x000086CF + GL_EVAL_VERTEX_ATTRIB10_NV* = 0x000086D0 + GL_EVAL_VERTEX_ATTRIB11_NV* = 0x000086D1 + GL_EVAL_VERTEX_ATTRIB12_NV* = 0x000086D2 + GL_EVAL_VERTEX_ATTRIB13_NV* = 0x000086D3 + GL_EVAL_VERTEX_ATTRIB14_NV* = 0x000086D4 + GL_EVAL_VERTEX_ATTRIB15_NV* = 0x000086D5 + GL_MAX_MAP_TESSELLATION_NV* = 0x000086D6 + GL_MAX_RATIONAL_EVAL_ORDER_NV* = 0x000086D7 + +proc glMapControlPointsNV*(target: TGLenum, index: TGLuint, thetype: TGLenum, + ustride: TGLsizei, vstride: TGLsizei, uorder: TGLint, + vorder: TGLint, thepacked: TGLboolean, + points: PGLvoid){.dynlib: dllname, + importc: "glMapControlPointsNV".} +proc glMapParameterivNV*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glMapParameterivNV".} +proc glMapParameterfvNV*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glMapParameterfvNV".} +proc glGetMapControlPointsNV*(target: TGLenum, index: TGLuint, thetype: TGLenum, + ustride: TGLsizei, vstride: TGLsizei, + thepacked: TGLboolean, points: PGLvoid){. + dynlib: dllname, importc: "glGetMapControlPointsNV".} +proc glGetMapParameterivNV*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetMapParameterivNV".} +proc glGetMapParameterfvNV*(target: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetMapParameterfvNV".} +proc glGetMapAttribParameterivNV*(target: TGLenum, index: TGLuint, + pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetMapAttribParameterivNV".} +proc glGetMapAttribParameterfvNV*(target: TGLenum, index: TGLuint, + pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetMapAttribParameterfvNV".} +proc glEvalMapsNV*(target: TGLenum, mode: TGLenum){.dynlib: dllname, + importc: "glEvalMapsNV".} + #***** GL_NV_fence *****// +const + GL_ALL_COMPLETED_NV* = 0x000084F2 + GL_FENCE_STATUS_NV* = 0x000084F3 + GL_FENCE_CONDITION_NV* = 0x000084F4 + +proc glGenFencesNV*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, + importc: "glGenFencesNV".} +proc glDeleteFencesNV*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, + importc: "glDeleteFencesNV".} +proc glSetFenceNV*(fence: TGLuint, condition: TGLenum){.dynlib: dllname, + importc: "glSetFenceNV".} +proc glTestFenceNV*(fence: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glTestFenceNV".} +proc glFinishFenceNV*(fence: TGLuint){.dynlib: dllname, + importc: "glFinishFenceNV".} +proc glIsFenceNV*(fence: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsFenceNV".} +proc glGetFenceivNV*(fence: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetFenceivNV".} + #***** GL_NV_fog_distance *****// +const + GL_FOG_DISTANCE_MODE_NV* = 0x0000855A + GL_EYE_RADIAL_NV* = 0x0000855B + GL_EYE_PLANE_ABSOLUTE_NV* = 0x0000855C + #***** GL_NV_light_max_exponent *****// + +const + GL_MAX_SHININESS_NV* = 0x00008504 + GL_MAX_SPOT_EXPONENT_NV* = 0x00008505 + #***** GL_NV_multisample_filter_hint *****// + +const + GL_MULTISAMPLE_FILTER_HINT_NV* = 0x00008534 + #***** GL_NV_occlusion_query *****// + # GL_OCCLUSION_TEST_HP { already defined } + # GL_OCCLUSION_TEST_RESULT_HP { already defined } + +const + GL_PIXEL_COUNTER_BITS_NV* = 0x00008864 + GL_CURRENT_OCCLUSION_QUERY_ID_NV* = 0x00008865 + GL_PIXEL_COUNT_NV* = 0x00008866 + GL_PIXEL_COUNT_AVAILABLE_NV* = 0x00008867 + +proc glGenOcclusionQueriesNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glGenOcclusionQueriesNV".} +proc glDeleteOcclusionQueriesNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glDeleteOcclusionQueriesNV".} +proc glIsOcclusionQueryNV*(id: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsOcclusionQueryNV".} +proc glBeginOcclusionQueryNV*(id: TGLuint){.dynlib: dllname, + importc: "glBeginOcclusionQueryNV".} +proc glEndOcclusionQueryNV*(){.dynlib: dllname, importc: "glEndOcclusionQueryNV".} +proc glGetOcclusionQueryivNV*(id: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetOcclusionQueryivNV".} +proc glGetOcclusionQueryuivNV*(id: TGLuint, pname: TGLenum, params: PGLuint){. + dynlib: dllname, importc: "glGetOcclusionQueryuivNV".} + #***** GL_NV_packed_depth_stencil *****// +const + GL_DEPTH_STENCIL_NV* = 0x000084F9 + GL_UNSIGNED_INT_24_8_NV* = 0x000084FA + #***** GL_NV_point_sprite *****// + +const + GL_POINT_SPRITE_NV* = 0x00008861 + GL_COORD_REPLACE_NV* = 0x00008862 + GL_POINT_SPRITE_R_MODE_NV* = 0x00008863 + +proc glPointParameteriNV*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glPointParameteriNV".} +proc glPointParameterivNV*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glPointParameterivNV".} + #***** GL_NV_register_combiners *****// +const + GL_REGISTER_COMBINERS_NV* = 0x00008522 + GL_COMBINER0_NV* = 0x00008550 + GL_COMBINER1_NV* = 0x00008551 + GL_COMBINER2_NV* = 0x00008552 + GL_COMBINER3_NV* = 0x00008553 + GL_COMBINER4_NV* = 0x00008554 + GL_COMBINER5_NV* = 0x00008555 + GL_COMBINER6_NV* = 0x00008556 + GL_COMBINER7_NV* = 0x00008557 + GL_VARIABLE_A_NV* = 0x00008523 + GL_VARIABLE_B_NV* = 0x00008524 + GL_VARIABLE_C_NV* = 0x00008525 + GL_VARIABLE_D_NV* = 0x00008526 + GL_VARIABLE_E_NV* = 0x00008527 + GL_VARIABLE_F_NV* = 0x00008528 + GL_VARIABLE_G_NV* = 0x00008529 + GL_CONSTANT_COLOR0_NV* = 0x0000852A + GL_CONSTANT_COLOR1_NV* = 0x0000852B + GL_PRIMARY_COLOR_NV* = 0x0000852C + GL_SECONDARY_COLOR_NV* = 0x0000852D + GL_SPARE0_NV* = 0x0000852E + GL_SPARE1_NV* = 0x0000852F + GL_UNSIGNED_IDENTITY_NV* = 0x00008536 + GL_UNSIGNED_INVERT_NV* = 0x00008537 + GL_EXPAND_NORMAL_NV* = 0x00008538 + GL_EXPAND_NEGATE_NV* = 0x00008539 + GL_HALF_BIAS_NORMAL_NV* = 0x0000853A + GL_HALF_BIAS_NEGATE_NV* = 0x0000853B + GL_SIGNED_IDENTITY_NV* = 0x0000853C + GL_SIGNED_NEGATE_NV* = 0x0000853D + GL_E_TIMES_F_NV* = 0x00008531 + GL_SPARE0_PLUS_SECONDARY_COLOR_NV* = 0x00008532 + GL_SCALE_BY_TWO_NV* = 0x0000853E + GL_SCALE_BY_FOUR_NV* = 0x0000853F + GL_SCALE_BY_ONE_HALF_NV* = 0x00008540 + GL_BIAS_BY_NEGATIVE_ONE_HALF_NV* = 0x00008541 + GL_DISCARD_NV* = 0x00008530 + constGL_COMBINER_INPUT_NV* = 0x00008542 + GL_COMBINER_MAPPING_NV* = 0x00008543 + GL_COMBINER_COMPONENT_USAGE_NV* = 0x00008544 + GL_COMBINER_AB_DOT_PRODUCT_NV* = 0x00008545 + GL_COMBINER_CD_DOT_PRODUCT_NV* = 0x00008546 + GL_COMBINER_MUX_SUM_NV* = 0x00008547 + GL_COMBINER_SCALE_NV* = 0x00008548 + GL_COMBINER_BIAS_NV* = 0x00008549 + GL_COMBINER_AB_OUTPUT_NV* = 0x0000854A + GL_COMBINER_CD_OUTPUT_NV* = 0x0000854B + GL_COMBINER_SUM_OUTPUT_NV* = 0x0000854C + GL_NUM_GENERAL_COMBINERS_NV* = 0x0000854E + GL_COLOR_SUM_CLAMP_NV* = 0x0000854F + GL_MAX_GENERAL_COMBINERS_NV* = 0x0000854D + +proc glCombinerParameterfvNV*(pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glCombinerParameterfvNV".} +proc glCombinerParameterivNV*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glCombinerParameterivNV".} +proc glCombinerParameterfNV*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glCombinerParameterfNV".} +proc glCombinerParameteriNV*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glCombinerParameteriNV".} +proc glCombinerInputNV*(stage: TGLenum, portion: TGLenum, variable: TGLenum, + input: TGLenum, mapping: TGLenum, + componentUsage: TGLenum){.dynlib: dllname, + importc: "glCombinerInputNV".} +proc glCombinerOutputNV*(stage: TGLenum, portion: TGLenum, abOutput: TGLenum, + cdOutput: TGLenum, sumOutput: TGLenum, scale: TGLenum, + bias: TGLenum, abDotProduct: TGLboolean, + cdDotProduct: TGLboolean, muxSum: TGLboolean){. + dynlib: dllname, importc: "glCombinerOutputNV".} +proc glFinalCombinerInputNV*(variable: TGLenum, input: TGLenum, + mapping: TGLenum, componentUsage: TGLenum){. + dynlib: dllname, importc: "glFinalCombinerInputNV".} +proc glGetCombinerInputParameterfvNV*(stage: TGLenum, portion: TGLenum, + variable: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetCombinerInputParameterfvNV".} +proc glGetCombinerInputParameterivNV*(stage: TGLenum, portion: TGLenum, + variable: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetCombinerInputParameterivNV".} +proc glGetCombinerOutputParameterfvNV*(stage: TGLenum, portion: TGLenum, + pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetCombinerOutputParameterfvNV".} +proc glGetCombinerOutputParameterivNV*(stage: TGLenum, portion: TGLenum, + pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetCombinerOutputParameterivNV".} +proc glGetFinalCombinerInputParameterfvNV*(variable: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetFinalCombinerInputParameterfvNV".} +proc glGetFinalCombinerInputParameterivNV*(variable: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetFinalCombinerInputParameterivNV".} + #***** GL_NV_register_combiners2 *****// +const + GL_PER_STAGE_CONSTANTS_NV* = 0x00008535 + +proc glCombinerStageParameterfvNV*(stage: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glCombinerStageParameterfvNV".} +proc glGetCombinerStageParameterfvNV*(stage: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetCombinerStageParameterfvNV".} + #***** GL_NV_texgen_emboss *****// +const + GL_EMBOSS_MAP_NV* = 0x0000855F + GL_EMBOSS_LIGHT_NV* = 0x0000855D + GL_EMBOSS_CONSTANT_NV* = 0x0000855E + #***** GL_NV_texgen_reflection *****// + +const + GL_NORMAL_MAP_NV* = 0x00008511 + GL_REFLECTION_MAP_NV* = 0x00008512 + #***** GL_NV_texture_compression_vtc *****// + # GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } + # GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } + # GL_COMPRESSED_RGBA_S3TC_DXT3_EXT { already defined } + # GL_COMPRESSED_RGBA_S3TC_DXT5_EXT { already defined } + #***** GL_NV_texture_env_combine4 *****// + +const + GL_COMBINE4_NV* = 0x00008503 + GL_SOURCE3_RGB_NV* = 0x00008583 + GL_SOURCE3_ALPHA_NV* = 0x0000858B + GL_OPERAND3_RGB_NV* = 0x00008593 + GL_OPERAND3_ALPHA_NV* = 0x0000859B + #***** GL_NV_texture_rectangle *****// + +const + GL_TEXTURE_RECTANGLE_NV* = 0x000084F5 + GL_TEXTURE_BINDING_RECTANGLE_NV* = 0x000084F6 + GL_PROXY_TEXTURE_RECTANGLE_NV* = 0x000084F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_NV* = 0x000084F8 + #***** GL_NV_texture_shader *****// + +const + GL_TEXTURE_SHADER_NV* = 0x000086DE + GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV* = 0x000086D9 + GL_SHADER_OPERATION_NV* = 0x000086DF + GL_CULL_MODES_NV* = 0x000086E0 + GL_OFFSET_TEXTURE_MATRIX_NV* = 0x000086E1 + GL_OFFSET_TEXTURE_SCALE_NV* = 0x000086E2 + GL_OFFSET_TEXTURE_BIAS_NV* = 0x000086E3 + GL_PREVIOUS_TEXTURE_INPUT_NV* = 0x000086E4 + GL_CONST_EYE_NV* = 0x000086E5 + GL_SHADER_CONSISTENT_NV* = 0x000086DD + GL_PASS_THROUGH_NV* = 0x000086E6 + GL_CULL_FRAGMENT_NV* = 0x000086E7 + GL_OFFSET_TEXTURE_2D_NV* = 0x000086E8 + GL_OFFSET_TEXTURE_RECTANGLE_NV* = 0x0000864C + GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV* = 0x0000864D + GL_DEPENDENT_AR_TEXTURE_2D_NV* = 0x000086E9 + GL_DEPENDENT_GB_TEXTURE_2D_NV* = 0x000086EA + GL_DOT_PRODUCT_NV* = 0x000086EC + GL_DOT_PRODUCT_DEPTH_REPLACE_NV* = 0x000086ED + GL_DOT_PRODUCT_TEXTURE_2D_NV* = 0x000086EE + GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV* = 0x0000864E + GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV* = 0x000086F0 + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV* = 0x000086F1 + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV* = 0x000086F2 + GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV* = 0x000086F3 + GL_HILO_NV* = 0x000086F4 + GL_DSDT_NV* = 0x000086F5 + GL_DSDT_MAG_NV* = 0x000086F6 + GL_DSDT_MAG_VIB_NV* = 0x000086F7 + GL_UNSIGNED_INT_S8_S8_8_8_NV* = 0x000086DA + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV* = 0x000086DB + GL_SIGNED_RGBA_NV* = 0x000086FB + GL_SIGNED_RGBA8_NV* = 0x000086FC + GL_SIGNED_RGB_NV* = 0x000086FE + GL_SIGNED_RGB8_NV* = 0x000086FF + GL_SIGNED_LUMINANCE_NV* = 0x00008701 + GL_SIGNED_LUMINANCE8_NV* = 0x00008702 + GL_SIGNED_LUMINANCE_ALPHA_NV* = 0x00008703 + GL_SIGNED_LUMINANCE8_ALPHA8_NV* = 0x00008704 + GL_SIGNED_ALPHA_NV* = 0x00008705 + GL_SIGNED_ALPHA8_NV* = 0x00008706 + GL_SIGNED_INTENSITY_NV* = 0x00008707 + GL_SIGNED_INTENSITY8_NV* = 0x00008708 + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV* = 0x0000870C + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV* = 0x0000870D + GL_HILO16_NV* = 0x000086F8 + GL_SIGNED_HILO_NV* = 0x000086F9 + GL_SIGNED_HILO16_NV* = 0x000086FA + GL_DSDT8_NV* = 0x00008709 + GL_DSDT8_MAG8_NV* = 0x0000870A + GL_DSDT_MAG_INTENSITY_NV* = 0x000086DC + GL_DSDT8_MAG8_INTENSITY8_NV* = 0x0000870B + GL_HI_SCALE_NV* = 0x0000870E + GL_LO_SCALE_NV* = 0x0000870F + GL_DS_SCALE_NV* = 0x00008710 + GL_DT_SCALE_NV* = 0x00008711 + GL_MAGNITUDE_SCALE_NV* = 0x00008712 + GL_VIBRANCE_SCALE_NV* = 0x00008713 + GL_HI_BIAS_NV* = 0x00008714 + GL_LO_BIAS_NV* = 0x00008715 + GL_DS_BIAS_NV* = 0x00008716 + GL_DT_BIAS_NV* = 0x00008717 + GL_MAGNITUDE_BIAS_NV* = 0x00008718 + GL_VIBRANCE_BIAS_NV* = 0x00008719 + GL_TEXTURE_BORDER_VALUES_NV* = 0x0000871A + GL_TEXTURE_HI_SIZE_NV* = 0x0000871B + GL_TEXTURE_LO_SIZE_NV* = 0x0000871C + GL_TEXTURE_DS_SIZE_NV* = 0x0000871D + GL_TEXTURE_DT_SIZE_NV* = 0x0000871E + GL_TEXTURE_MAG_SIZE_NV* = 0x0000871F + #***** GL_NV_texture_shader2 *****// + +const + GL_DOT_PRODUCT_TEXTURE_3D_NV* = 0x000086EF # GL_HILO_NV { already defined } + # GL_DSDT_NV { already defined } + # GL_DSDT_MAG_NV { already defined } + # GL_DSDT_MAG_VIB_NV { already defined } + # GL_UNSIGNED_INT_S8_S8_8_8_NV { already defined } + # GL_UNSIGNED_INT_8_8_S8_S8_REV_NV { already defined } + # GL_SIGNED_RGBA_NV { already defined } + # GL_SIGNED_RGBA8_NV { already defined } + # GL_SIGNED_RGB_NV { already defined } + # GL_SIGNED_RGB8_NV { already defined } + # GL_SIGNED_LUMINANCE_NV { already defined } + # GL_SIGNED_LUMINANCE8_NV { already defined } + # GL_SIGNED_LUMINANCE_ALPHA_NV { already defined } + # GL_SIGNED_LUMINANCE8_ALPHA8_NV { already defined } + # GL_SIGNED_ALPHA_NV { already defined } + # GL_SIGNED_ALPHA8_NV { already defined } + # GL_SIGNED_INTENSITY_NV { already defined } + # GL_SIGNED_INTENSITY8_NV { already defined } + # GL_SIGNED_RGB_UNSIGNED_ALPHA_NV { already defined } + # GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV { already defined } + # GL_HILO16_NV { already defined } + # GL_SIGNED_HILO_NV { already defined } + # GL_SIGNED_HILO16_NV { already defined } + # GL_DSDT8_NV { already defined } + # GL_DSDT8_MAG8_NV { already defined } + # GL_DSDT_MAG_INTENSITY_NV { already defined } + # GL_DSDT8_MAG8_INTENSITY8_NV { already defined } + #***** GL_NV_texture_shader3 *****// + +const + GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV* = 0x00008850 + GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV* = 0x00008851 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008852 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV* = 0x00008853 + GL_OFFSET_HILO_TEXTURE_2D_NV* = 0x00008854 + GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV* = 0x00008855 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV* = 0x00008856 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV* = 0x00008857 + GL_DEPENDENT_HILO_TEXTURE_2D_NV* = 0x00008858 + GL_DEPENDENT_RGB_TEXTURE_3D_NV* = 0x00008859 + GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV* = 0x0000885A + GL_DOT_PRODUCT_PASS_THROUGH_NV* = 0x0000885B + GL_DOT_PRODUCT_TEXTURE_1D_NV* = 0x0000885C + GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV* = 0x0000885D + GL_HILO8_NV* = 0x0000885E + GL_SIGNED_HILO8_NV* = 0x0000885F + GL_FORCE_BLUE_TO_ONE_NV* = 0x00008860 + #***** GL_NV_vertex_array_range *****// + +const + constGL_VERTEX_ARRAY_RANGE_NV* = 0x0000851D + GL_VERTEX_ARRAY_RANGE_LENGTH_NV* = 0x0000851E + GL_VERTEX_ARRAY_RANGE_VALID_NV* = 0x0000851F + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV* = 0x00008520 + GL_VERTEX_ARRAY_RANGE_POINTER_NV* = 0x00008521 + +proc glVertexArrayRangeNV*(len: TGLsizei, pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexArrayRangeNV".} +proc glFlushVertexArrayRangeNV*(){.dynlib: dllname, + importc: "glFlushVertexArrayRangeNV".} + #***** GL_NV_vertex_array_range2 *****// +const + GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV* = 0x00008533 + #***** GL_NV_vertex_program *****// + +const + GL_VERTEX_PROGRAM_NV* = 0x00008620 + GL_VERTEX_PROGRAM_POINT_SIZE_NV* = 0x00008642 + GL_VERTEX_PROGRAM_TWO_SIDE_NV* = 0x00008643 + GL_VERTEX_STATE_PROGRAM_NV* = 0x00008621 + GL_ATTRIB_ARRAY_SIZE_NV* = 0x00008623 + GL_ATTRIB_ARRAY_STRIDE_NV* = 0x00008624 + GL_ATTRIB_ARRAY_TYPE_NV* = 0x00008625 + GL_CURRENT_ATTRIB_NV* = 0x00008626 + GL_PROGRAM_PARAMETER_NV* = 0x00008644 + GL_ATTRIB_ARRAY_POINTER_NV* = 0x00008645 + GL_PROGRAM_TARGET_NV* = 0x00008646 + GL_PROGRAM_LENGTH_NV* = 0x00008627 + GL_PROGRAM_RESIDENT_NV* = 0x00008647 + GL_PROGRAM_STRING_NV* = 0x00008628 + constGL_TRACK_MATRIX_NV* = 0x00008648 + GL_TRACK_MATRIX_TRANSFORM_NV* = 0x00008649 + GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV* = 0x0000862E + GL_MAX_TRACK_MATRICES_NV* = 0x0000862F + GL_CURRENT_MATRIX_STACK_DEPTH_NV* = 0x00008640 + GL_CURRENT_MATRIX_NV* = 0x00008641 + GL_VERTEX_PROGRAM_BINDING_NV* = 0x0000864A + GL_PROGRAM_ERROR_POSITION_NV* = 0x0000864B + GL_MODELVIEW_PROJECTION_NV* = 0x00008629 + GL_MATRIX0_NV* = 0x00008630 + GL_MATRIX1_NV* = 0x00008631 + GL_MATRIX2_NV* = 0x00008632 + GL_MATRIX3_NV* = 0x00008633 + GL_MATRIX4_NV* = 0x00008634 + GL_MATRIX5_NV* = 0x00008635 + GL_MATRIX6_NV* = 0x00008636 + GL_MATRIX7_NV* = 0x00008637 + GL_IDENTITY_NV* = 0x0000862A + GL_INVERSE_NV* = 0x0000862B + GL_TRANSPOSE_NV* = 0x0000862C + GL_INVERSE_TRANSPOSE_NV* = 0x0000862D + GL_VERTEX_ATTRIB_ARRAY0_NV* = 0x00008650 + GL_VERTEX_ATTRIB_ARRAY1_NV* = 0x00008651 + GL_VERTEX_ATTRIB_ARRAY2_NV* = 0x00008652 + GL_VERTEX_ATTRIB_ARRAY3_NV* = 0x00008653 + GL_VERTEX_ATTRIB_ARRAY4_NV* = 0x00008654 + GL_VERTEX_ATTRIB_ARRAY5_NV* = 0x00008655 + GL_VERTEX_ATTRIB_ARRAY6_NV* = 0x00008656 + GL_VERTEX_ATTRIB_ARRAY7_NV* = 0x00008657 + GL_VERTEX_ATTRIB_ARRAY8_NV* = 0x00008658 + GL_VERTEX_ATTRIB_ARRAY9_NV* = 0x00008659 + GL_VERTEX_ATTRIB_ARRAY10_NV* = 0x0000865A + GL_VERTEX_ATTRIB_ARRAY11_NV* = 0x0000865B + GL_VERTEX_ATTRIB_ARRAY12_NV* = 0x0000865C + GL_VERTEX_ATTRIB_ARRAY13_NV* = 0x0000865D + GL_VERTEX_ATTRIB_ARRAY14_NV* = 0x0000865E + GL_VERTEX_ATTRIB_ARRAY15_NV* = 0x0000865F + GL_MAP1_VERTEX_ATTRIB0_4_NV* = 0x00008660 + GL_MAP1_VERTEX_ATTRIB1_4_NV* = 0x00008661 + GL_MAP1_VERTEX_ATTRIB2_4_NV* = 0x00008662 + GL_MAP1_VERTEX_ATTRIB3_4_NV* = 0x00008663 + GL_MAP1_VERTEX_ATTRIB4_4_NV* = 0x00008664 + GL_MAP1_VERTEX_ATTRIB5_4_NV* = 0x00008665 + GL_MAP1_VERTEX_ATTRIB6_4_NV* = 0x00008666 + GL_MAP1_VERTEX_ATTRIB7_4_NV* = 0x00008667 + GL_MAP1_VERTEX_ATTRIB8_4_NV* = 0x00008668 + GL_MAP1_VERTEX_ATTRIB9_4_NV* = 0x00008669 + GL_MAP1_VERTEX_ATTRIB10_4_NV* = 0x0000866A + GL_MAP1_VERTEX_ATTRIB11_4_NV* = 0x0000866B + GL_MAP1_VERTEX_ATTRIB12_4_NV* = 0x0000866C + GL_MAP1_VERTEX_ATTRIB13_4_NV* = 0x0000866D + GL_MAP1_VERTEX_ATTRIB14_4_NV* = 0x0000866E + GL_MAP1_VERTEX_ATTRIB15_4_NV* = 0x0000866F + GL_MAP2_VERTEX_ATTRIB0_4_NV* = 0x00008670 + GL_MAP2_VERTEX_ATTRIB1_4_NV* = 0x00008671 + GL_MAP2_VERTEX_ATTRIB2_4_NV* = 0x00008672 + GL_MAP2_VERTEX_ATTRIB3_4_NV* = 0x00008673 + GL_MAP2_VERTEX_ATTRIB4_4_NV* = 0x00008674 + GL_MAP2_VERTEX_ATTRIB5_4_NV* = 0x00008675 + GL_MAP2_VERTEX_ATTRIB6_4_NV* = 0x00008676 + GL_MAP2_VERTEX_ATTRIB7_4_NV* = 0x00008677 + GL_MAP2_VERTEX_ATTRIB8_4_NV* = 0x00008678 + GL_MAP2_VERTEX_ATTRIB9_4_NV* = 0x00008679 + GL_MAP2_VERTEX_ATTRIB10_4_NV* = 0x0000867A + GL_MAP2_VERTEX_ATTRIB11_4_NV* = 0x0000867B + GL_MAP2_VERTEX_ATTRIB12_4_NV* = 0x0000867C + GL_MAP2_VERTEX_ATTRIB13_4_NV* = 0x0000867D + GL_MAP2_VERTEX_ATTRIB14_4_NV* = 0x0000867E + GL_MAP2_VERTEX_ATTRIB15_4_NV* = 0x0000867F + +proc glBindProgramNV*(target: TGLenum, id: TGLuint){.dynlib: dllname, + importc: "glBindProgramNV".} +proc glDeleteProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glDeleteProgramsNV".} +proc glExecuteProgramNV*(target: TGLenum, id: TGLuint, params: PGLfloat){. + dynlib: dllname, importc: "glExecuteProgramNV".} +proc glGenProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glGenProgramsNV".} +proc glAreProgramsResidentNV*(n: TGLsizei, ids: PGLuint, residences: PGLboolean): TGLboolean{. + dynlib: dllname, importc: "glAreProgramsResidentNV".} +proc glRequestResidentProgramsNV*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glRequestResidentProgramsNV".} +proc glGetProgramParameterfvNV*(target: TGLenum, index: TGLuint, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetProgramParameterfvNV".} +proc glGetProgramParameterdvNV*(target: TGLenum, index: TGLuint, pname: TGLenum, + params: PGLdouble){.dynlib: dllname, + importc: "glGetProgramParameterdvNV".} +proc glGetProgramivNV*(id: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetProgramivNV".} +proc glGetProgramStringNV*(id: TGLuint, pname: TGLenum, theProgram: PGLubyte){. + dynlib: dllname, importc: "glGetProgramStringNV".} +proc glGetTrackMatrixivNV*(target: TGLenum, address: TGLuint, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetTrackMatrixivNV".} +proc glGetVertexAttribdvNV*(index: TGLuint, pname: TGLenum, params: PGLdouble){. + dynlib: dllname, importc: "glGetVertexAttribdvNV".} +proc glGetVertexAttribfvNV*(index: TGLuint, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetVertexAttribfvNV".} +proc glGetVertexAttribivNV*(index: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetVertexAttribivNV".} +proc glGetVertexAttribPointervNV*(index: TGLuint, pname: TGLenum, + pointer: PGLvoid){.dynlib: dllname, + importc: "glGetVertexAttribPointervNV".} +proc glIsProgramNV*(id: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsProgramNV".} +proc glLoadProgramNV*(target: TGLenum, id: TGLuint, length: TGLsizei, + theProgram: PGLubyte){.dynlib: dllname, + importc: "glLoadProgramNV".} +proc glProgramParameter4fNV*(target: TGLenum, index: TGLuint, x: TGLfloat, + y: TGLfloat, z: TGLfloat, w: TGLfloat){. + dynlib: dllname, importc: "glProgramParameter4fNV".} +proc glProgramParameter4fvNV*(target: TGLenum, index: TGLuint, params: PGLfloat){. + dynlib: dllname, importc: "glProgramParameter4fvNV".} +proc glProgramParameters4dvNV*(target: TGLenum, index: TGLuint, num: TGLuint, + params: PGLdouble){.dynlib: dllname, + importc: "glProgramParameters4dvNV".} +proc glProgramParameters4fvNV*(target: TGLenum, index: TGLuint, num: TGLuint, + params: PGLfloat){.dynlib: dllname, + importc: "glProgramParameters4fvNV".} +proc glTrackMatrixNV*(target: TGLenum, address: TGLuint, matrix: TGLenum, + transform: TGLenum){.dynlib: dllname, + importc: "glTrackMatrixNV".} +proc glVertexAttribPointerNV*(index: TGLuint, size: TGLint, thetype: TGLenum, + stride: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glVertexAttribPointerNV".} +proc glVertexAttrib1sNV*(index: TGLuint, x: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib1sNV".} +proc glVertexAttrib1fNV*(index: TGLuint, x: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1fNV".} +proc glVertexAttrib1dNV*(index: TGLuint, x: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1dNV".} +proc glVertexAttrib2sNV*(index: TGLuint, x: TGLshort, y: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib2sNV".} +proc glVertexAttrib2fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib2fNV".} +proc glVertexAttrib2dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble){. + dynlib: dllname, importc: "glVertexAttrib2dNV".} +proc glVertexAttrib3sNV*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort){. + dynlib: dllname, importc: "glVertexAttrib3sNV".} +proc glVertexAttrib3fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glVertexAttrib3fNV".} +proc glVertexAttrib3dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble, + z: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib3dNV".} +proc glVertexAttrib4sNV*(index: TGLuint, x: TGLshort, y: TGLshort, z: TGLshort, + w: TGLshort){.dynlib: dllname, + importc: "glVertexAttrib4sNV".} +proc glVertexAttrib4fNV*(index: TGLuint, x: TGLfloat, y: TGLfloat, z: TGLfloat, + w: TGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4fNV".} +proc glVertexAttrib4dNV*(index: TGLuint, x: TGLdouble, y: TGLdouble, + z: TGLdouble, w: TGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4dNV".} +proc glVertexAttrib4ubNV*(index: TGLuint, x: TGLubyte, y: TGLubyte, z: TGLubyte, + w: TGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4ubNV".} +proc glVertexAttrib1svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib1svNV".} +proc glVertexAttrib1fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib1fvNV".} +proc glVertexAttrib1dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib1dvNV".} +proc glVertexAttrib2svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib2svNV".} +proc glVertexAttrib2fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib2fvNV".} +proc glVertexAttrib2dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib2dvNV".} +proc glVertexAttrib3svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib3svNV".} +proc glVertexAttrib3fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib3fvNV".} +proc glVertexAttrib3dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib3dvNV".} +proc glVertexAttrib4svNV*(index: TGLuint, v: PGLshort){.dynlib: dllname, + importc: "glVertexAttrib4svNV".} +proc glVertexAttrib4fvNV*(index: TGLuint, v: PGLfloat){.dynlib: dllname, + importc: "glVertexAttrib4fvNV".} +proc glVertexAttrib4dvNV*(index: TGLuint, v: PGLdouble){.dynlib: dllname, + importc: "glVertexAttrib4dvNV".} +proc glVertexAttrib4ubvNV*(index: TGLuint, v: PGLubyte){.dynlib: dllname, + importc: "glVertexAttrib4ubvNV".} +proc glVertexAttribs1svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. + dynlib: dllname, importc: "glVertexAttribs1svNV".} +proc glVertexAttribs1fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. + dynlib: dllname, importc: "glVertexAttribs1fvNV".} +proc glVertexAttribs1dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. + dynlib: dllname, importc: "glVertexAttribs1dvNV".} +proc glVertexAttribs2svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. + dynlib: dllname, importc: "glVertexAttribs2svNV".} +proc glVertexAttribs2fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. + dynlib: dllname, importc: "glVertexAttribs2fvNV".} +proc glVertexAttribs2dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. + dynlib: dllname, importc: "glVertexAttribs2dvNV".} +proc glVertexAttribs3svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. + dynlib: dllname, importc: "glVertexAttribs3svNV".} +proc glVertexAttribs3fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. + dynlib: dllname, importc: "glVertexAttribs3fvNV".} +proc glVertexAttribs3dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. + dynlib: dllname, importc: "glVertexAttribs3dvNV".} +proc glVertexAttribs4svNV*(index: TGLuint, n: TGLsizei, v: PGLshort){. + dynlib: dllname, importc: "glVertexAttribs4svNV".} +proc glVertexAttribs4fvNV*(index: TGLuint, n: TGLsizei, v: PGLfloat){. + dynlib: dllname, importc: "glVertexAttribs4fvNV".} +proc glVertexAttribs4dvNV*(index: TGLuint, n: TGLsizei, v: PGLdouble){. + dynlib: dllname, importc: "glVertexAttribs4dvNV".} +proc glVertexAttribs4ubvNV*(index: TGLuint, n: TGLsizei, v: PGLubyte){. + dynlib: dllname, importc: "glVertexAttribs4ubvNV".} + #***** GL_NV_vertex_program1_1 *****// + #***** GL_ATI_element_array *****// +const + GL_ELEMENT_ARRAY_ATI* = 0x00008768 + GL_ELEMENT_ARRAY_TYPE_ATI* = 0x00008769 + GL_ELEMENT_ARRAY_POINTER_ATI* = 0x0000876A + +proc glElementPointerATI*(thetype: TGLenum, pointer: PGLvoid){.dynlib: dllname, + importc: "glElementPointerATI".} +proc glDrawElementArrayATI*(mode: TGLenum, count: TGLsizei){.dynlib: dllname, + importc: "glDrawElementArrayATI".} +proc glDrawRangeElementArrayATI*(mode: TGLenum, start: TGLuint, theend: TGLuint, + count: TGLsizei){.dynlib: dllname, + importc: "glDrawRangeElementArrayATI".} + #***** GL_ATI_envmap_bumpmap *****// +const + GL_BUMP_ROT_MATRIX_ATI* = 0x00008775 + GL_BUMP_ROT_MATRIX_SIZE_ATI* = 0x00008776 + GL_BUMP_NUM_TEX_UNITS_ATI* = 0x00008777 + GL_BUMP_TEX_UNITS_ATI* = 0x00008778 + GL_DUDV_ATI* = 0x00008779 + GL_DU8DV8_ATI* = 0x0000877A + GL_BUMP_ENVMAP_ATI* = 0x0000877B + GL_BUMP_TARGET_ATI* = 0x0000877C + +proc glTexBumpParameterivATI*(pname: TGLenum, param: PGLint){.dynlib: dllname, + importc: "glTexBumpParameterivATI".} +proc glTexBumpParameterfvATI*(pname: TGLenum, param: PGLfloat){.dynlib: dllname, + importc: "glTexBumpParameterfvATI".} +proc glGetTexBumpParameterivATI*(pname: TGLenum, param: PGLint){. + dynlib: dllname, importc: "glGetTexBumpParameterivATI".} +proc glGetTexBumpParameterfvATI*(pname: TGLenum, param: PGLfloat){. + dynlib: dllname, importc: "glGetTexBumpParameterfvATI".} + #***** GL_ATI_fragment_shader *****// +const + GL_FRAGMENT_SHADER_ATI* = 0x00008920 + GL_REG_0_ATI* = 0x00008921 + GL_REG_1_ATI* = 0x00008922 + GL_REG_2_ATI* = 0x00008923 + GL_REG_3_ATI* = 0x00008924 + GL_REG_4_ATI* = 0x00008925 + GL_REG_5_ATI* = 0x00008926 + GL_CON_0_ATI* = 0x00008941 + GL_CON_1_ATI* = 0x00008942 + GL_CON_2_ATI* = 0x00008943 + GL_CON_3_ATI* = 0x00008944 + GL_CON_4_ATI* = 0x00008945 + GL_CON_5_ATI* = 0x00008946 + GL_CON_6_ATI* = 0x00008947 + GL_CON_7_ATI* = 0x00008948 + GL_MOV_ATI* = 0x00008961 + GL_ADD_ATI* = 0x00008963 + GL_MUL_ATI* = 0x00008964 + GL_SUB_ATI* = 0x00008965 + GL_DOT3_ATI* = 0x00008966 + GL_DOT4_ATI* = 0x00008967 + GL_MAD_ATI* = 0x00008968 + GL_LERP_ATI* = 0x00008969 + GL_CND_ATI* = 0x0000896A + GL_CND0_ATI* = 0x0000896B + GL_DOT2_ADD_ATI* = 0x0000896C + GL_SECONDARY_INTERPOLATOR_ATI* = 0x0000896D + GL_SWIZZLE_STR_ATI* = 0x00008976 + GL_SWIZZLE_STQ_ATI* = 0x00008977 + GL_SWIZZLE_STR_DR_ATI* = 0x00008978 + GL_SWIZZLE_STQ_DQ_ATI* = 0x00008979 + GL_RED_BIT_ATI* = 0x00000001 + GL_GREEN_BIT_ATI* = 0x00000002 + GL_BLUE_BIT_ATI* = 0x00000004 + GL_2X_BIT_ATI* = 0x00000001 + GL_4X_BIT_ATI* = 0x00000002 + GL_8X_BIT_ATI* = 0x00000004 + GL_HALF_BIT_ATI* = 0x00000008 + GL_QUARTER_BIT_ATI* = 0x00000010 + GL_EIGHTH_BIT_ATI* = 0x00000020 + GL_SATURATE_BIT_ATI* = 0x00000040 # GL_2X_BIT_ATI { already defined } + GL_COMP_BIT_ATI* = 0x00000002 + GL_NEGATE_BIT_ATI* = 0x00000004 + GL_BIAS_BIT_ATI* = 0x00000008 + +proc glGenFragmentShadersATI*(range: TGLuint): TGLuint{.dynlib: dllname, + importc: "glGenFragmentShadersATI".} +proc glBindFragmentShaderATI*(id: TGLuint){.dynlib: dllname, + importc: "glBindFragmentShaderATI".} +proc glDeleteFragmentShaderATI*(id: TGLuint){.dynlib: dllname, + importc: "glDeleteFragmentShaderATI".} +proc glBeginFragmentShaderATI*(){.dynlib: dllname, + importc: "glBeginFragmentShaderATI".} +proc glEndFragmentShaderATI*(){.dynlib: dllname, + importc: "glEndFragmentShaderATI".} +proc glPassTexCoordATI*(dst: TGLuint, coord: TGLuint, swizzle: TGLenum){. + dynlib: dllname, importc: "glPassTexCoordATI".} +proc glSampleMapATI*(dst: TGLuint, interp: TGLuint, swizzle: TGLenum){. + dynlib: dllname, importc: "glSampleMapATI".} +proc glColorFragmentOp1ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, + dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, + arg1Mod: TGLuint){.dynlib: dllname, + importc: "glColorFragmentOp1ATI".} +proc glColorFragmentOp2ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, + dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, + arg1Mod: TGLuint, arg2: TGLuint, arg2Rep: TGLuint, + arg2Mod: TGLuint){.dynlib: dllname, + importc: "glColorFragmentOp2ATI".} +proc glColorFragmentOp3ATI*(op: TGLenum, dst: TGLuint, dstMask: TGLuint, + dstMod: TGLuint, arg1: TGLuint, arg1Rep: TGLuint, + arg1Mod: TGLuint, arg2: TGLuint, arg2Rep: TGLuint, + arg2Mod: TGLuint, arg3: TGLuint, arg3Rep: TGLuint, + arg3Mod: TGLuint){.dynlib: dllname, + importc: "glColorFragmentOp3ATI".} +proc glAlphaFragmentOp1ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, + arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint){. + dynlib: dllname, importc: "glAlphaFragmentOp1ATI".} +proc glAlphaFragmentOp2ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, + arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint, + arg2: TGLuint, arg2Rep: TGLuint, arg2Mod: TGLuint){. + dynlib: dllname, importc: "glAlphaFragmentOp2ATI".} +proc glAlphaFragmentOp3ATI*(op: TGLenum, dst: TGLuint, dstMod: TGLuint, + arg1: TGLuint, arg1Rep: TGLuint, arg1Mod: TGLuint, + arg2: TGLuint, arg2Rep: TGLuint, arg2Mod: TGLuint, + arg3: TGLuint, arg3Rep: TGLuint, arg3Mod: TGLuint){. + dynlib: dllname, importc: "glAlphaFragmentOp3ATI".} +proc glSetFragmentShaderConstantATI*(dst: TGLuint, value: PGLfloat){. + dynlib: dllname, importc: "glSetFragmentShaderConstantATI".} + #***** GL_ATI_pn_triangles *****// +const + GL_PN_TRIANGLES_ATI* = 0x000087F0 + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F1 + GL_PN_TRIANGLES_POINT_MODE_ATI* = 0x000087F2 + GL_PN_TRIANGLES_NORMAL_MODE_ATI* = 0x000087F3 + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI* = 0x000087F4 + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI* = 0x000087F5 + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI* = 0x000087F6 + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI* = 0x000087F7 + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI* = 0x000087F8 + +proc glPNTrianglesiATI*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glPNTrianglesiATI".} +proc glPNTrianglesfATI*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPNTrianglesfATI".} + #***** GL_ATI_texture_mirror_once *****// +const + GL_MIRROR_CLAMP_ATI* = 0x00008742 + GL_MIRROR_CLAMP_TO_EDGE_ATI* = 0x00008743 + #***** GL_ATI_vertex_array_object *****// + +const + GL_STATIC_ATI* = 0x00008760 + GL_DYNAMIC_ATI* = 0x00008761 + GL_PRESERVE_ATI* = 0x00008762 + GL_DISCARD_ATI* = 0x00008763 + GL_OBJECT_BUFFER_SIZE_ATI* = 0x00008764 + GL_OBJECT_BUFFER_USAGE_ATI* = 0x00008765 + GL_ARRAY_OBJECT_BUFFER_ATI* = 0x00008766 + GL_ARRAY_OBJECT_OFFSET_ATI* = 0x00008767 + +proc glNewObjectBufferATI*(size: TGLsizei, pointer: PGLvoid, usage: TGLenum): TGLuint{. + dynlib: dllname, importc: "glNewObjectBufferATI".} +proc glIsObjectBufferATI*(buffer: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsObjectBufferATI".} +proc glUpdateObjectBufferATI*(buffer: TGLuint, offset: TGLuint, size: TGLsizei, + pointer: PGLvoid, preserve: TGLenum){. + dynlib: dllname, importc: "glUpdateObjectBufferATI".} +proc glGetObjectBufferfvATI*(buffer: TGLuint, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetObjectBufferfvATI".} +proc glGetObjectBufferivATI*(buffer: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetObjectBufferivATI".} +proc glDeleteObjectBufferATI*(buffer: TGLuint){.dynlib: dllname, + importc: "glDeleteObjectBufferATI".} +proc glArrayObjectATI*(thearray: TGLenum, size: TGLint, thetype: TGLenum, + stride: TGLsizei, buffer: TGLuint, offset: TGLuint){. + dynlib: dllname, importc: "glArrayObjectATI".} +proc glGetArrayObjectfvATI*(thearray: TGLenum, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetArrayObjectfvATI".} +proc glGetArrayObjectivATI*(thearray: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetArrayObjectivATI".} +proc glVariantArrayObjectATI*(id: TGLuint, thetype: TGLenum, stride: TGLsizei, + buffer: TGLuint, offset: TGLuint){. + dynlib: dllname, importc: "glVariantArrayObjectATI".} +proc glGetVariantArrayObjectfvATI*(id: TGLuint, pname: TGLenum, params: PGLfloat){. + dynlib: dllname, importc: "glGetVariantArrayObjectfvATI".} +proc glGetVariantArrayObjectivATI*(id: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetVariantArrayObjectivATI".} + #***** GL_ATI_vertex_streams *****// +const + GL_MAX_VERTEX_STREAMS_ATI* = 0x0000876B + GL_VERTEX_STREAM0_ATI* = 0x0000876C + GL_VERTEX_STREAM1_ATI* = 0x0000876D + GL_VERTEX_STREAM2_ATI* = 0x0000876E + GL_VERTEX_STREAM3_ATI* = 0x0000876F + GL_VERTEX_STREAM4_ATI* = 0x00008770 + GL_VERTEX_STREAM5_ATI* = 0x00008771 + GL_VERTEX_STREAM6_ATI* = 0x00008772 + GL_VERTEX_STREAM7_ATI* = 0x00008773 + GL_VERTEX_SOURCE_ATI* = 0x00008774 + +proc glVertexStream1s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream1s".} +proc glVertexStream1i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream1i".} +proc glVertexStream1f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream1f".} +proc glVertexStream1d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream1d".} +proc glVertexStream1sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream1sv".} +proc glVertexStream1iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream1iv".} +proc glVertexStream1fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream1fv".} +proc glVertexStream1dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream1dv".} +proc glVertexStream2s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream2s".} +proc glVertexStream2i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream2i".} +proc glVertexStream2f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream2f".} +proc glVertexStream2d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream2d".} +proc glVertexStream2sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream2sv".} +proc glVertexStream2iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream2iv".} +proc glVertexStream2fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream2fv".} +proc glVertexStream2dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream2dv".} +proc glVertexStream3s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream3s".} +proc glVertexStream3i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream3i".} +proc glVertexStream3f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream3f".} +proc glVertexStream3d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream3d".} +proc glVertexStream3sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream3sv".} +proc glVertexStream3iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream3iv".} +proc glVertexStream3fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream3fv".} +proc glVertexStream3dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream3dv".} +proc glVertexStream4s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream4s".} +proc glVertexStream4i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream4i".} +proc glVertexStream4f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream4f".} +proc glVertexStream4d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream4d".} +proc glVertexStream4sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glVertexStream4sv".} +proc glVertexStream4iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glVertexStream4iv".} +proc glVertexStream4fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glVertexStream4fv".} +proc glVertexStream4dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glVertexStream4dv".} +proc glNormalStream3b*(stream: TGLenum, coords: TGLByte){.dynlib: dllname, + importc: "glNormalStream3b".} +proc glNormalStream3s*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glNormalStream3s".} +proc glNormalStream3i*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glNormalStream3i".} +proc glNormalStream3f*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glNormalStream3f".} +proc glNormalStream3d*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glNormalStream3d".} +proc glNormalStream3bv*(stream: TGLenum, coords: TGLByte){.dynlib: dllname, + importc: "glNormalStream3bv".} +proc glNormalStream3sv*(stream: TGLenum, coords: TGLshort){.dynlib: dllname, + importc: "glNormalStream3sv".} +proc glNormalStream3iv*(stream: TGLenum, coords: TGLint){.dynlib: dllname, + importc: "glNormalStream3iv".} +proc glNormalStream3fv*(stream: TGLenum, coords: TGLfloat){.dynlib: dllname, + importc: "glNormalStream3fv".} +proc glNormalStream3dv*(stream: TGLenum, coords: TGLdouble){.dynlib: dllname, + importc: "glNormalStream3dv".} +proc glClientActiveVertexStream*(stream: TGLenum){.dynlib: dllname, + importc: "glClientActiveVertexStream".} +proc glVertexBlendEnvi*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glVertexBlendEnvi".} +proc glVertexBlendEnvf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glVertexBlendEnvf".} + #***** GL_3DFX_texture_compression_FXT1 *****// +const + GL_COMPRESSED_RGB_FXT1_3DFX* = 0x000086B0 + GL_COMPRESSED_RGBA_FXT1_3DFX* = 0x000086B1 + #***** GL_IBM_cull_vertex *****// + +const + GL_CULL_VERTEX_IBM* = 0x0001928A + #***** GL_IBM_multimode_draw_arrays *****// + +proc glMultiModeDrawArraysIBM*(mode: PGLenum, first: PGLint, count: PGLsizei, + primcount: TGLsizei, modestride: TGLint){. + dynlib: dllname, importc: "glMultiModeDrawArraysIBM".} +proc glMultiModeDrawElementsIBM*(mode: PGLenum, count: PGLsizei, + thetype: TGLenum, indices: PGLvoid, + primcount: TGLsizei, modestride: TGLint){. + dynlib: dllname, importc: "glMultiModeDrawElementsIBM".} + #***** GL_IBM_raster_pos_clip *****// +const + GL_RASTER_POSITION_UNCLIPPED_IBM* = 0x00019262 + #***** GL_IBM_texture_mirrored_repeat *****// + +const + GL_MIRRORED_REPEAT_IBM* = 0x00008370 + #***** GL_IBM_vertex_array_lists *****// + +const + GL_VERTEX_ARRAY_LIST_IBM* = 0x0001929E + GL_NORMAL_ARRAY_LIST_IBM* = 0x0001929F + GL_COLOR_ARRAY_LIST_IBM* = 0x000192A0 + GL_INDEX_ARRAY_LIST_IBM* = 0x000192A1 + GL_TEXTURE_COORD_ARRAY_LIST_IBM* = 0x000192A2 + GL_EDGE_FLAG_ARRAY_LIST_IBM* = 0x000192A3 + GL_FOG_COORDINATE_ARRAY_LIST_IBM* = 0x000192A4 + GL_SECONDARY_COLOR_ARRAY_LIST_IBM* = 0x000192A5 + GL_VERTEX_ARRAY_LIST_STRIDE_IBM* = 0x000192A8 + GL_NORMAL_ARRAY_LIST_STRIDE_IBM* = 0x000192A9 + GL_COLOR_ARRAY_LIST_STRIDE_IBM* = 0x000192AA + GL_INDEX_ARRAY_LIST_STRIDE_IBM* = 0x000192AB + GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM* = 0x000192AC + GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM* = 0x000192AD + GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM* = 0x000192AE + GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM* = 0x000192AF + +proc glColorPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, + pointer: PGLvoid, ptrstride: TGLint){. + dynlib: dllname, importc: "glColorPointerListIBM".} +proc glSecondaryColorPointerListIBM*(size: TGLint, thetype: TGLenum, + stride: TGLint, pointer: PGLvoid, + ptrstride: TGLint){.dynlib: dllname, + importc: "glSecondaryColorPointerListIBM".} +proc glEdgeFlagPointerListIBM*(stride: TGLint, pointer: PGLboolean, + ptrstride: TGLint){.dynlib: dllname, + importc: "glEdgeFlagPointerListIBM".} +proc glFogCoordPointerListIBM*(thetype: TGLenum, stride: TGLint, + pointer: PGLvoid, ptrstride: TGLint){. + dynlib: dllname, importc: "glFogCoordPointerListIBM".} +proc glNormalPointerListIBM*(thetype: TGLenum, stride: TGLint, pointer: PGLvoid, + ptrstride: TGLint){.dynlib: dllname, + importc: "glNormalPointerListIBM".} +proc glTexCoordPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, + pointer: PGLvoid, ptrstride: TGLint){. + dynlib: dllname, importc: "glTexCoordPointerListIBM".} +proc glVertexPointerListIBM*(size: TGLint, thetype: TGLenum, stride: TGLint, + pointer: PGLvoid, ptrstride: TGLint){. + dynlib: dllname, importc: "glVertexPointerListIBM".} + #***** GL_MESA_resize_buffers *****// +proc glResizeBuffersMESA*(){.dynlib: dllname, importc: "glResizeBuffersMESA".} + #***** GL_MESA_window_pos *****// +proc glWindowPos2dMESA*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, + importc: "glWindowPos2dMESA".} +proc glWindowPos2fMESA*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, + importc: "glWindowPos2fMESA".} +proc glWindowPos2iMESA*(x: TGLint, y: TGLint){.dynlib: dllname, + importc: "glWindowPos2iMESA".} +proc glWindowPos2sMESA*(x: TGLshort, y: TGLshort){.dynlib: dllname, + importc: "glWindowPos2sMESA".} +proc glWindowPos2ivMESA*(p: PGLint){.dynlib: dllname, + importc: "glWindowPos2ivMESA".} +proc glWindowPos2svMESA*(p: PGLshort){.dynlib: dllname, + importc: "glWindowPos2svMESA".} +proc glWindowPos2fvMESA*(p: PGLfloat){.dynlib: dllname, + importc: "glWindowPos2fvMESA".} +proc glWindowPos2dvMESA*(p: PGLdouble){.dynlib: dllname, + importc: "glWindowPos2dvMESA".} +proc glWindowPos3iMESA*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, + importc: "glWindowPos3iMESA".} +proc glWindowPos3sMESA*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, + importc: "glWindowPos3sMESA".} +proc glWindowPos3fMESA*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glWindowPos3fMESA".} +proc glWindowPos3dMESA*(x: TGLdouble, y: TGLdouble, z: TGLdouble){. + dynlib: dllname, importc: "glWindowPos3dMESA".} +proc glWindowPos3ivMESA*(p: PGLint){.dynlib: dllname, + importc: "glWindowPos3ivMESA".} +proc glWindowPos3svMESA*(p: PGLshort){.dynlib: dllname, + importc: "glWindowPos3svMESA".} +proc glWindowPos3fvMESA*(p: PGLfloat){.dynlib: dllname, + importc: "glWindowPos3fvMESA".} +proc glWindowPos3dvMESA*(p: PGLdouble){.dynlib: dllname, + importc: "glWindowPos3dvMESA".} +proc glWindowPos4iMESA*(x: TGLint, y: TGLint, z: TGLint, w: TGLint){. + dynlib: dllname, importc: "glWindowPos4iMESA".} +proc glWindowPos4sMESA*(x: TGLshort, y: TGLshort, z: TGLshort, w: TGLshort){. + dynlib: dllname, importc: "glWindowPos4sMESA".} +proc glWindowPos4fMESA*(x: TGLfloat, y: TGLfloat, z: TGLfloat, w: TGLfloat){. + dynlib: dllname, importc: "glWindowPos4fMESA".} +proc glWindowPos4dMESA*(x: TGLdouble, y: TGLdouble, z: TGLdouble, w: TGLdouble){. + dynlib: dllname, importc: "glWindowPos4dMESA".} +proc glWindowPos4ivMESA*(p: PGLint){.dynlib: dllname, + importc: "glWindowPos4ivMESA".} +proc glWindowPos4svMESA*(p: PGLshort){.dynlib: dllname, + importc: "glWindowPos4svMESA".} +proc glWindowPos4fvMESA*(p: PGLfloat){.dynlib: dllname, + importc: "glWindowPos4fvMESA".} +proc glWindowPos4dvMESA*(p: PGLdouble){.dynlib: dllname, + importc: "glWindowPos4dvMESA".} + #***** GL_OML_interlace *****// +const + GL_INTERLACE_OML* = 0x00008980 + GL_INTERLACE_READ_OML* = 0x00008981 + #***** GL_OML_resample *****// + +const + GL_PACK_RESAMPLE_OML* = 0x00008984 + GL_UNPACK_RESAMPLE_OML* = 0x00008985 + GL_RESAMPLE_REPLICATE_OML* = 0x00008986 + GL_RESAMPLE_ZERO_FILL_OML* = 0x00008987 + GL_RESAMPLE_AVERAGE_OML* = 0x00008988 + GL_RESAMPLE_DECIMATE_OML* = 0x00008989 # GL_RESAMPLE_AVERAGE_OML { already defined } + #***** GL_OML_subsample *****// + +const + GL_FORMAT_SUBSAMPLE_24_24_OML* = 0x00008982 + GL_FORMAT_SUBSAMPLE_244_244_OML* = 0x00008983 + #***** GL_SGIS_generate_mipmap *****// + +const + GL_GENERATE_MIPMAP_SGIS* = 0x00008191 + GL_GENERATE_MIPMAP_HINT_SGIS* = 0x00008192 + #***** GL_SGIS_multisample *****// + +const + GLX_SAMPLE_BUFFERS_SGIS* = 0x000186A0 + GLX_SAMPLES_SGIS* = 0x000186A1 + GL_MULTISAMPLE_SGIS* = 0x0000809D + GL_SAMPLE_ALPHA_TO_MASK_SGIS* = 0x0000809E + GL_SAMPLE_ALPHA_TO_ONE_SGIS* = 0x0000809F + constGL_SAMPLE_MASK_SGIS* = 0x000080A0 + GL_MULTISAMPLE_BIT_EXT* = 0x20000000 + GL_1PASS_SGIS* = 0x000080A1 + GL_2PASS_0_SGIS* = 0x000080A2 + GL_2PASS_1_SGIS* = 0x000080A3 + GL_4PASS_0_SGIS* = 0x000080A4 + GL_4PASS_1_SGIS* = 0x000080A5 + GL_4PASS_2_SGIS* = 0x000080A6 + GL_4PASS_3_SGIS* = 0x000080A7 + GL_SAMPLE_BUFFERS_SGIS* = 0x000080A8 + GL_SAMPLES_SGIS* = 0x000080A9 + GL_SAMPLE_MASK_VALUE_SGIS* = 0x000080AA + GL_SAMPLE_MASK_INVERT_SGIS* = 0x000080AB + constGL_SAMPLE_PATTERN_SGIS* = 0x000080AC + +proc glSampleMaskSGIS*(value: TGLclampf, invert: TGLboolean){.dynlib: dllname, + importc: "glSampleMaskSGIS".} +proc glSamplePatternSGIS*(pattern: TGLenum){.dynlib: dllname, + importc: "glSamplePatternSGIS".} + #***** GL_SGIS_pixel_texture *****// +const + GL_PIXEL_TEXTURE_SGIS* = 0x00008353 + GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS* = 0x00008354 + GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS* = 0x00008355 + GL_PIXEL_GROUP_COLOR_SGIS* = 0x00008356 + +proc glPixelTexGenParameteriSGIS*(pname: TGLenum, param: TGLint){. + dynlib: dllname, importc: "glPixelTexGenParameteriSGIS".} +proc glPixelTexGenParameterfSGIS*(pname: TGLenum, param: TGLfloat){. + dynlib: dllname, importc: "glPixelTexGenParameterfSGIS".} +proc glGetPixelTexGenParameterivSGIS*(pname: TGLenum, params: TGLint){. + dynlib: dllname, importc: "glGetPixelTexGenParameterivSGIS".} +proc glGetPixelTexGenParameterfvSGIS*(pname: TGLenum, params: TGLfloat){. + dynlib: dllname, importc: "glGetPixelTexGenParameterfvSGIS".} + #***** GL_SGIS_texture_border_clamp *****// + # GL_CLAMP_TO_BORDER_SGIS { already defined } + #***** GL_SGIS_texture_color_mask *****// +const + GL_TEXTURE_COLOR_WRITEMASK_SGIS* = 0x000081EF + +proc glTextureColorMaskSGIS*(r: TGLboolean, g: TGLboolean, b: TGLboolean, + a: TGLboolean){.dynlib: dllname, + importc: "glTextureColorMaskSGIS".} + #***** GL_SGIS_texture_edge_clamp *****// +const + GL_CLAMP_TO_EDGE_SGIS* = 0x0000812F + #***** GL_SGIS_texture_lod *****// + +const + GL_TEXTURE_MIN_LOD_SGIS* = 0x0000813A + GL_TEXTURE_MAX_LOD_SGIS* = 0x0000813B + GL_TEXTURE_BASE_LEVEL_SGIS* = 0x0000813C + GL_TEXTURE_MAX_LEVEL_SGIS* = 0x0000813D + #***** GL_SGIS_depth_texture *****// + +const + GL_DEPTH_COMPONENT16_SGIX* = 0x000081A5 + GL_DEPTH_COMPONENT24_SGIX* = 0x000081A6 + GL_DEPTH_COMPONENT32_SGIX* = 0x000081A7 + #***** GL_SGIX_fog_offset *****// + +const + GL_FOG_OFFSET_SGIX* = 0x00008198 + GL_FOG_OFFSET_VALUE_SGIX* = 0x00008199 + #***** GL_SGIX_interlace *****// + +const + GL_INTERLACE_SGIX* = 0x00008094 + #***** GL_SGIX_shadow_ambient *****// + +const + GL_SHADOW_AMBIENT_SGIX* = 0x000080BF + #***** GL_SGI_color_matrix *****// + +const + GL_COLOR_MATRIX_SGI* = 0x000080B1 + GL_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI* = 0x000080B3 + GL_POST_COLOR_MATRIX_RED_SCALE_SGI* = 0x000080B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI* = 0x000080B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI* = 0x000080B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI* = 0x000080B7 + GL_POST_COLOR_MATRIX_RED_BIAS_SGI* = 0x000080B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI* = 0x000080B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI* = 0x000080BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI* = 0x000080BB + #***** GL_SGI_color_table *****// + +const + constGL_COLOR_TABLE_SGI* = 0x000080D0 + GL_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D2 + GL_PROXY_COLOR_TABLE_SGI* = 0x000080D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI* = 0x000080D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI* = 0x000080D5 + GL_COLOR_TABLE_SCALE_SGI* = 0x000080D6 + GL_COLOR_TABLE_BIAS_SGI* = 0x000080D7 + GL_COLOR_TABLE_FORMAT_SGI* = 0x000080D8 + GL_COLOR_TABLE_WIDTH_SGI* = 0x000080D9 + GL_COLOR_TABLE_RED_SIZE_SGI* = 0x000080DA + GL_COLOR_TABLE_GREEN_SIZE_SGI* = 0x000080DB + GL_COLOR_TABLE_BLUE_SIZE_SGI* = 0x000080DC + GL_COLOR_TABLE_ALPHA_SIZE_SGI* = 0x000080DD + GL_COLOR_TABLE_LUMINANCE_SIZE_SGI* = 0x000080DE + GL_COLOR_TABLE_INTENSITY_SIZE_SGI* = 0x000080DF + +proc glColorTableSGI*(target: TGLenum, internalformat: TGLenum, width: TGLsizei, + format: TGLenum, thetype: TGLenum, table: PGLvoid){. + dynlib: dllname, importc: "glColorTableSGI".} +proc glCopyColorTableSGI*(target: TGLenum, internalformat: TGLenum, x: TGLint, + y: TGLint, width: TGLsizei){.dynlib: dllname, + importc: "glCopyColorTableSGI".} +proc glColorTableParameterivSGI*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glColorTableParameterivSGI".} +proc glColorTableParameterfvSGI*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glColorTableParameterfvSGI".} +proc glGetColorTableSGI*(target: TGLenum, format: TGLenum, thetype: TGLenum, + table: PGLvoid){.dynlib: dllname, + importc: "glGetColorTableSGI".} +proc glGetColorTableParameterivSGI*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetColorTableParameterivSGI".} +proc glGetColorTableParameterfvSGI*(target: TGLenum, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetColorTableParameterfvSGI".} + #***** GL_SGI_texture_color_table *****// +const + GL_TEXTURE_COLOR_TABLE_SGI* = 0x000080BC + GL_PROXY_TEXTURE_COLOR_TABLE_SGI* = 0x000080BD + #***** GL_SUN_vertex *****// + +proc glColor4ubVertex2fSUN*(r: TGLubyte, g: TGLubyte, b: TGLubyte, a: TGLubyte, + x: TGLfloat, y: TGLfloat){.dynlib: dllname, + importc: "glColor4ubVertex2fSUN".} +proc glColor4ubVertex2fvSUN*(c: PGLubyte, v: PGLfloat){.dynlib: dllname, + importc: "glColor4ubVertex2fvSUN".} +proc glColor4ubVertex3fSUN*(r: TGLubyte, g: TGLubyte, b: TGLubyte, a: TGLubyte, + x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glColor4ubVertex3fSUN".} +proc glColor4ubVertex3fvSUN*(c: PGLubyte, v: PGLfloat){.dynlib: dllname, + importc: "glColor4ubVertex3fvSUN".} +proc glColor3fVertex3fSUN*(r: TGLfloat, g: TGLfloat, b: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glColor3fVertex3fSUN".} +proc glColor3fVertex3fvSUN*(c: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glColor3fVertex3fvSUN".} +proc glNormal3fVertex3fSUN*(nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, + x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glNormal3fVertex3fSUN".} +proc glNormal3fVertex3fvSUN*(n: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glNormal3fVertex3fvSUN".} +proc glColor4fNormal3fVertex3fSUN*(r: TGLfloat, g: TGLfloat, b: TGLfloat, + a: TGLfloat, nx: TGLfloat, ny: TGLfloat, + nz: TGLfloat, x: TGLfloat, y: TGLfloat, + z: TGLfloat){.dynlib: dllname, + importc: "glColor4fNormal3fVertex3fSUN".} +proc glColor4fNormal3fVertex3fvSUN*(c: PGLfloat, n: PGLfloat, v: PGLfloat){. + dynlib: dllname, importc: "glColor4fNormal3fVertex3fvSUN".} +proc glTexCoord2fVertex3fSUN*(s: TGLfloat, t: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glTexCoord2fVertex3fSUN".} +proc glTexCoord2fVertex3fvSUN*(tc: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glTexCoord2fVertex3fvSUN".} +proc glTexCoord4fVertex4fSUN*(s: TGLfloat, t: TGLfloat, p: TGLfloat, + q: TGLfloat, x: TGLfloat, y: TGLfloat, + z: TGLfloat, w: TGLfloat){.dynlib: dllname, + importc: "glTexCoord4fVertex4fSUN".} +proc glTexCoord4fVertex4fvSUN*(tc: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glTexCoord4fVertex4fvSUN".} +proc glTexCoord2fColor4ubVertex3fSUN*(s: TGLfloat, t: TGLfloat, r: TGLubyte, + g: TGLubyte, b: TGLubyte, a: TGLubyte, + x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glTexCoord2fColor4ubVertex3fSUN".} +proc glTexCoord2fColor4ubVertex3fvSUN*(tc: PGLfloat, c: PGLubyte, v: PGLfloat){. + dynlib: dllname, importc: "glTexCoord2fColor4ubVertex3fvSUN".} +proc glTexCoord2fColor3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, r: TGLfloat, + g: TGLfloat, b: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glTexCoord2fColor3fVertex3fSUN".} +proc glTexCoord2fColor3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, v: PGLfloat){. + dynlib: dllname, importc: "glTexCoord2fColor3fVertex3fvSUN".} +proc glTexCoord2fNormal3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, nx: TGLfloat, + ny: TGLfloat, nz: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glTexCoord2fNormal3fVertex3fSUN".} +proc glTexCoord2fNormal3fVertex3fvSUN*(tc: PGLfloat, n: PGLfloat, v: PGLfloat){. + dynlib: dllname, importc: "glTexCoord2fNormal3fVertex3fvSUN".} +proc glTexCoord2fColor4fNormal3fVertex3fSUN*(s: TGLfloat, t: TGLfloat, + r: TGLfloat, g: TGLfloat, b: TGLfloat, a: TGLfloat, nx: TGLfloat, + ny: TGLfloat, nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glTexCoord2fColor4fNormal3fVertex3fSUN".} +proc glTexCoord2fColor4fNormal3fVertex3fvSUN*(tc: PGLfloat, c: PGLfloat, + n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glTexCoord2fColor4fNormal3fVertex3fvSUN".} +proc glTexCoord4fColor4fNormal3fVertex4fSUN*(s: TGLfloat, t: TGLfloat, + p: TGLfloat, q: TGLfloat, r: TGLfloat, g: TGLfloat, b: TGLfloat, + a: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat, w: TGLfloat){.dynlib: dllname, + importc: "glTexCoord4fColor4fNormal3fVertex4fSUN".} +proc glTexCoord4fColor4fNormal3fVertex4fvSUN*(tc: PGLfloat, c: PGLfloat, + n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glTexCoord4fColor4fNormal3fVertex4fvSUN".} +proc glReplacementCodeuiVertex3fSUN*(rc: TGLuint, x: TGLfloat, y: TGLfloat, + z: TGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiVertex3fSUN".} +proc glReplacementCodeuiVertex3fvSUN*(rc: PGLuint, v: PGLfloat){. + dynlib: dllname, importc: "glReplacementCodeuiVertex3fvSUN".} +proc glReplacementCodeuiColor4ubVertex3fSUN*(rc: TGLuint, r: TGLubyte, + g: TGLubyte, b: TGLubyte, a: TGLubyte, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glReplacementCodeuiColor4ubVertex3fSUN".} +proc glReplacementCodeuiColor4ubVertex3fvSUN*(rc: PGLuint, c: PGLubyte, + v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiColor4ubVertex3fvSUN".} +proc glReplacementCodeuiColor3fVertex3fSUN*(rc: TGLuint, r: TGLfloat, + g: TGLfloat, b: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glReplacementCodeuiColor3fVertex3fSUN".} +proc glReplacementCodeuiColor3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, + v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiColor3fVertex3fvSUN".} +proc glReplacementCodeuiNormal3fVertex3fSUN*(rc: TGLuint, nx: TGLfloat, + ny: TGLfloat, nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){. + dynlib: dllname, importc: "glReplacementCodeuiNormal3fVertex3fSUN".} +proc glReplacementCodeuiNormal3fVertex3fvSUN*(rc: PGLuint, n: PGLfloat, + v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiNormal3fVertex3fvSUN".} +proc glReplacementCodeuiColor4fNormal3fVertex3fSUN*(rc: TGLuint, r: TGLfloat, + g: TGLfloat, b: TGLfloat, a: TGLfloat, nx: TGLfloat, ny: TGLfloat, + nz: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiColor4fNormal3fVertex3fSUN".} +proc glReplacementCodeuiColor4fNormal3fVertex3fvSUN*(rc: PGLuint, c: PGLfloat, + n: PGLfloat, v: PGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiColor4fNormal3fVertex3fvSUN".} +proc glReplacementCodeuiTexCoord2fVertex3fSUN*(rc: TGLuint, s: TGLfloat, + t: TGLfloat, x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiTexCoord2fVertex3fSUN".} +proc glReplacementCodeuiTexCoord2fVertex3fvSUN*(rc: PGLuint, tc: PGLfloat, + v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiTexCoord2fVertex3fvSUN".} +proc glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN*(rc: TGLuint, s: TGLfloat, + t: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN".} +proc glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN*(rc: PGLuint, + tc: PGLfloat, n: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN".} +proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN*(rc: TGLuint, + s: TGLfloat, t: TGLfloat, r: TGLfloat, g: TGLfloat, b: TGLfloat, + a: TGLfloat, nx: TGLfloat, ny: TGLfloat, nz: TGLfloat, x: TGLfloat, + y: TGLfloat, z: TGLfloat){.dynlib: dllname, importc: "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN".} +proc glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN*(rc: PGLuint, + tc: PGLfloat, c: PGLfloat, n: PGLfloat, v: PGLfloat){.dynlib: dllname, + importc: "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN".} + #***** GL_ARB_fragment_program *****// +const + GL_FRAGMENT_PROGRAM_ARB* = 0x00008804 # GL_PROGRAM_FORMAT_ASCII_ARB { already defined } + # GL_PROGRAM_LENGTH_ARB { already defined } + # GL_PROGRAM_FORMAT_ARB { already defined } + # GL_PROGRAM_BINDING_ARB { already defined } + # GL_PROGRAM_INSTRUCTIONS_ARB { already defined } + # GL_MAX_PROGRAM_INSTRUCTIONS_ARB { already defined } + # GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } + # GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB { already defined } + # GL_PROGRAM_TEMPORARIES_ARB { already defined } + # GL_MAX_PROGRAM_TEMPORARIES_ARB { already defined } + # GL_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } + # GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB { already defined } + # GL_PROGRAM_PARAMETERS_ARB { already defined } + # GL_MAX_PROGRAM_PARAMETERS_ARB { already defined } + # GL_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } + # GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB { already defined } + # GL_PROGRAM_ATTRIBS_ARB { already defined } + # GL_MAX_PROGRAM_ATTRIBS_ARB { already defined } + # GL_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } + # GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB { already defined } + # GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB { already defined } + # GL_MAX_PROGRAM_ENV_PARAMETERS_ARB { already defined } + # GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB { already defined } + GL_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x00008805 + GL_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x00008806 + GL_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x00008807 + GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x00008808 + GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x00008809 + GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x0000880A + GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB* = 0x0000880B + GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB* = 0x0000880C + GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB* = 0x0000880D + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB* = 0x0000880E + GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB* = 0x0000880F + GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB* = 0x00008810 # GL_PROGRAM_STRING_ARB { already defined } + # + # + # GL_PROGRAM_ERROR_POSITION_ARB { already defined } + # GL_CURRENT_MATRIX_ARB { already defined } + # + # + # GL_TRANSPOSE_CURRENT_MATRIX_ARB { already defined } + # + # + # GL_CURRENT_MATRIX_STACK_DEPTH_ARB { already defined } + # + # + # GL_MAX_PROGRAM_MATRICES_ARB { already defined } + # + # + # GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB { already defined } + GL_MAX_TEXTURE_COORDS_ARB* = 0x00008871 + GL_MAX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008872 # GL_PROGRAM_ERROR_STRING_ARB { already defined } + # GL_MATRIX0_ARB { already defined } + # GL_MATRIX1_ARB { already defined } + # GL_MATRIX2_ARB { already defined } + # GL_MATRIX3_ARB { already defined } + # GL_MATRIX4_ARB { already defined } + # GL_MATRIX5_ARB { already defined } + # GL_MATRIX6_ARB { already defined } + # GL_MATRIX7_ARB { already defined } + # GL_MATRIX8_ARB { already defined } + # GL_MATRIX9_ARB { already defined } + # GL_MATRIX10_ARB { already defined } + # GL_MATRIX11_ARB { already defined } + # GL_MATRIX12_ARB { already defined } + # GL_MATRIX13_ARB { already defined } + # GL_MATRIX14_ARB { already defined } + # GL_MATRIX15_ARB { already defined } + # GL_MATRIX16_ARB { already defined } + # GL_MATRIX17_ARB { already defined } + # GL_MATRIX18_ARB { already defined } + # GL_MATRIX19_ARB { already defined } + # GL_MATRIX20_ARB { already defined } + # GL_MATRIX21_ARB { already defined } + # GL_MATRIX22_ARB { already defined } + # GL_MATRIX23_ARB { already defined } + # GL_MATRIX24_ARB { already defined } + # GL_MATRIX25_ARB { already defined } + # GL_MATRIX26_ARB { already defined } + # GL_MATRIX27_ARB { already defined } + # GL_MATRIX28_ARB { already defined } + # GL_MATRIX29_ARB { already defined } + # GL_MATRIX30_ARB { already defined } + # GL_MATRIX31_ARB { already defined } + # glProgramStringARB { already defined } + # glBindProgramARB { already defined } + # glDeleteProgramsARB { already defined } + # glGenProgramsARB { already defined } + # glProgramEnvParameter4dARB { already defined } + # glProgramEnvParameter4dvARB { already defined } + # glProgramEnvParameter4fARB { already defined } + # glProgramEnvParameter4fvARB { already defined } + # glProgramLocalParameter4dARB { already defined } + # glProgramLocalParameter4dvARB { already defined } + # glProgramLocalParameter4fARB { already defined } + # glProgramLocalParameter4fvARB { already defined } + # glGetProgramEnvParameterdvARB { already defined } + # glGetProgramEnvParameterfvARB { already defined } + # glGetProgramLocalParameterdvARB { already defined } + # glGetProgramLocalParameterfvARB { already defined } + # glGetProgramivARB { already defined } + # glGetProgramStringARB { already defined } + # glIsProgramARB { already defined } + #***** GL_ATI_text_fragment_shader ***** + +const + GL_TEXT_FRAGMENT_SHADER_ATI* = 0x00008200 #***** GL_ARB_vertex_buffer_object ***** + +const + GL_BUFFER_SIZE_ARB* = 0x00008764 + GL_BUFFER_USAGE_ARB* = 0x00008765 + GL_ARRAY_BUFFER_ARB* = 0x00008892 + GL_ELEMENT_ARRAY_BUFFER_ARB* = 0x00008893 + GL_ARRAY_BUFFER_BINDING_ARB* = 0x00008894 + GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB* = 0x00008895 + GL_VERTEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008896 + GL_NORMAL_ARRAY_BUFFER_BINDING_ARB* = 0x00008897 + GL_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x00008898 + GL_INDEX_ARRAY_BUFFER_BINDING_ARB* = 0x00008899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB* = 0x0000889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB* = 0x0000889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB* = 0x0000889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB* = 0x0000889D + GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB* = 0x0000889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB* = 0x0000889F + GL_READ_ONLY_ARB* = 0x000088B8 + GL_WRITE_ONLY_ARB* = 0x000088B9 + GL_READ_WRITE_ARB* = 0x000088BA + GL_BUFFER_ACCESS_ARB* = 0x000088BB + GL_BUFFER_MAPPED_ARB* = 0x000088BC + GL_BUFFER_MAP_POINTER_ARB* = 0x000088BD + GL_STREAM_DRAW_ARB* = 0x000088E0 + GL_STREAM_READ_ARB* = 0x000088E1 + GL_STREAM_COPY_ARB* = 0x000088E2 + GL_STATIC_DRAW_ARB* = 0x000088E4 + GL_STATIC_READ_ARB* = 0x000088E5 + GL_STATIC_COPY_ARB* = 0x000088E6 + GL_DYNAMIC_DRAW_ARB* = 0x000088E8 + GL_DYNAMIC_READ_ARB* = 0x000088E9 + GL_DYNAMIC_COPY_ARB* = 0x000088EA + +proc glBindBufferARB*(target: TGLenum, buffer: TGLuint){.dynlib: dllname, + importc: "glBindBufferARB".} +proc glDeleteBuffersARB*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, + importc: "glDeleteBuffersARB".} +proc glGenBuffersARB*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, + importc: "glGenBuffersARB".} +proc glIsBufferARB*(buffer: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsBufferARB".} +proc glBufferDataARB*(target: TGLenum, size: TGLsizei, data: PGLvoid, + usage: TGLenum){.dynlib: dllname, + importc: "glBufferDataARB".} +proc glBufferSubDataARB*(target: TGLenum, offset: TGLint, size: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glBufferSubDataARB".} +proc glGetBufferSubDataARB*(target: TGLenum, offset: TGLint, size: TGLsizei, + data: PGLvoid){.dynlib: dllname, + importc: "glGetBufferSubDataARB".} +proc glMapBufferARB*(target: TGLenum, access: TGLenum): PGLvoid{. + dynlib: dllname, importc: "glMapBufferARB".} +proc glUnmapBufferARB*(target: TGLenum): TGLboolean{.dynlib: dllname, + importc: "glUnmapBufferARB".} +proc glGetBufferParameterivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetBufferParameterivARB".} +proc glGetBufferPointervARB*(target: TGLenum, pname: TGLenum, params: PPGLvoid){. + dynlib: dllname, importc: "glGetBufferPointervARB".} + #***** GL_APPLE_client_storage *****// +const + GL_UNPACK_CLIENT_STORAGE_APPLE* = 0x000085B2 + #***** GL_APPLE_element_array *****// + +const + GL_ELEMENT_ARRAY_APPLE* = 0x00008768 + GL_ELEMENT_ARRAY_TYPE_APPLE* = 0x00008769 + GL_ELEMENT_ARRAY_POINTER_APPLE* = 0x0000876A + +proc glElementPointerAPPLE*(thetype: TGLenum, pointer: PGLvoid){. + dynlib: dllname, importc: "glElementPointerAPPLE".} +proc glDrawElementArrayAPPLE*(mode: TGLenum, first: TGLint, count: TGLsizei){. + dynlib: dllname, importc: "glDrawElementArrayAPPLE".} +proc glDrawRangeElementArrayAPPLE*(mode: TGLenum, start: TGLuint, + theend: TGLuint, first: TGLint, + count: TGLsizei){.dynlib: dllname, + importc: "glDrawRangeElementArrayAPPLE".} +proc glMultiDrawElementArrayAPPLE*(mode: TGLenum, first: PGLint, + count: PGLsizei, primcount: TGLsizei){. + dynlib: dllname, importc: "glMultiDrawElementArrayAPPLE".} +proc glMultiDrawRangeElementArrayAPPLE*(mode: TGLenum, start: TGLuint, + theend: TGLuint, first: PGLint, + count: PGLsizei, primcount: TGLsizei){. + dynlib: dllname, importc: "glMultiDrawRangeElementArrayAPPLE".} + #***** GL_APPLE_fence *****// +const + GL_DRAW_PIXELS_APPLE* = 0x00008A0A + GL_FENCE_APPLE* = 0x00008A0B + +proc glGenFencesAPPLE*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, + importc: "glGenFencesAPPLE".} +proc glDeleteFencesAPPLE*(n: TGLsizei, fences: PGLuint){.dynlib: dllname, + importc: "glDeleteFencesAPPLE".} +proc glSetFenceAPPLE*(fence: TGLuint){.dynlib: dllname, + importc: "glSetFenceAPPLE".} +proc glIsFenceAPPLE*(fence: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsFenceAPPLE".} +proc glTestFenceAPPLE*(fence: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glTestFenceAPPLE".} +proc glFinishFenceAPPLE*(fence: TGLuint){.dynlib: dllname, + importc: "glFinishFenceAPPLE".} +proc glTestObjectAPPLE*(theobject: TGLenum, name: TGLuint): TGLboolean{. + dynlib: dllname, importc: "glTestObjectAPPLE".} +proc glFinishObjectAPPLE*(theobject: TGLenum, name: TGLint){.dynlib: dllname, + importc: "glFinishObjectAPPLE".} + #***** GL_APPLE_vertex_array_object *****// +const + GL_VERTEX_ARRAY_BINDING_APPLE* = 0x000085B5 + +proc glBindVertexArrayAPPLE*(thearray: TGLuint){.dynlib: dllname, + importc: "glBindVertexArrayAPPLE".} +proc glDeleteVertexArraysAPPLE*(n: TGLsizei, arrays: PGLuint){.dynlib: dllname, + importc: "glDeleteVertexArraysAPPLE".} +proc glGenVertexArraysAPPLE*(n: TGLsizei, arrays: PGLuint){.dynlib: dllname, + importc: "glGenVertexArraysAPPLE".} +proc glIsVertexArrayAPPLE*(thearray: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsVertexArrayAPPLE".} + #***** GL_APPLE_vertex_array_range *****// +const + constGL_VERTEX_ARRAY_RANGE_APPLE* = 0x0000851D + GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE* = 0x0000851E + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE* = 0x00008520 + GL_VERTEX_ARRAY_RANGE_POINTER_APPLE* = 0x00008521 + GL_VERTEX_ARRAY_STORAGE_HINT_APPLE* = 0x0000851F + GL_STORAGE_CACHED_APPLE* = 0x000085BE + GL_STORAGE_SHARED_APPLE* = 0x000085BF + +proc glVertexArrayRangeAPPLE*(len: TGLsizei, pointer: PGLvoid){.dynlib: dllname, + importc: "glVertexArrayRangeAPPLE".} +proc glFlushVertexArrayRangeAPPLE*(len: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glFlushVertexArrayRangeAPPLE".} +proc glVertexArrayParameteriAPPLE*(pname: TGLenum, param: TGLint){. + dynlib: dllname, importc: "glVertexArrayParameteriAPPLE".} + #***** GL_ARB_matrix_palette *****// +const + GL_MATRIX_PALETTE_ARB* = 0x00008840 + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB* = 0x00008841 + GL_MAX_PALETTE_MATRICES_ARB* = 0x00008842 + constGL_CURRENT_PALETTE_MATRIX_ARB* = 0x00008843 + GL_MATRIX_INDEX_ARRAY_ARB* = 0x00008844 + GL_CURRENT_MATRIX_INDEX_ARB* = 0x00008845 + GL_MATRIX_INDEX_ARRAY_SIZE_ARB* = 0x00008846 + GL_MATRIX_INDEX_ARRAY_TYPE_ARB* = 0x00008847 + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB* = 0x00008848 + GL_MATRIX_INDEX_ARRAY_POINTER_ARB* = 0x00008849 + +proc glCurrentPaletteMatrixARB*(index: TGLint){.dynlib: dllname, + importc: "glCurrentPaletteMatrixARB".} +proc glMatrixIndexubvARB*(size: TGLint, indices: PGLubyte){.dynlib: dllname, + importc: "glMatrixIndexubvARB".} +proc glMatrixIndexusvARB*(size: TGLint, indices: PGLushort){.dynlib: dllname, + importc: "glMatrixIndexusvARB".} +proc glMatrixIndexuivARB*(size: TGLint, indices: PGLuint){.dynlib: dllname, + importc: "glMatrixIndexuivARB".} +proc glMatrixIndexPointerARB*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glMatrixIndexPointerARB".} + #***** GL_NV_element_array *****// +const + GL_ELEMENT_ARRAY_TYPE_NV* = 0x00008769 + GL_ELEMENT_ARRAY_POINTER_NV* = 0x0000876A + +proc glElementPointerNV*(thetype: TGLenum, pointer: PGLvoid){.dynlib: dllname, + importc: "glElementPointerNV".} +proc glDrawElementArrayNV*(mode: TGLenum, first: TGLint, count: TGLsizei){. + dynlib: dllname, importc: "glDrawElementArrayNV".} +proc glDrawRangeElementArrayNV*(mode: TGLenum, start: TGLuint, theend: TGLuint, + first: TGLint, count: TGLsizei){. + dynlib: dllname, importc: "glDrawRangeElementArrayNV".} +proc glMultiDrawElementArrayNV*(mode: TGLenum, first: PGLint, count: PGLsizei, + primcount: TGLsizei){.dynlib: dllname, + importc: "glMultiDrawElementArrayNV".} +proc glMultiDrawRangeElementArrayNV*(mode: TGLenum, start: TGLuint, + theend: TGLuint, first: PGLint, + count: PGLsizei, primcount: TGLsizei){. + dynlib: dllname, importc: "glMultiDrawRangeElementArrayNV".} + #***** GL_NV_float_buffer *****// +const + GL_FLOAT_R_NV* = 0x00008880 + GL_FLOAT_RG_NV* = 0x00008881 + GL_FLOAT_RGB_NV* = 0x00008882 + GL_FLOAT_RGBA_NV* = 0x00008883 + GL_FLOAT_R16_NV* = 0x00008884 + GL_FLOAT_R32_NV* = 0x00008885 + GL_FLOAT_RG16_NV* = 0x00008886 + GL_FLOAT_RG32_NV* = 0x00008887 + GL_FLOAT_RGB16_NV* = 0x00008888 + GL_FLOAT_RGB32_NV* = 0x00008889 + GL_FLOAT_RGBA16_NV* = 0x0000888A + GL_FLOAT_RGBA32_NV* = 0x0000888B + GL_TEXTURE_FLOAT_COMPONENTS_NV* = 0x0000888C + GL_FLOAT_CLEAR_COLOR_VALUE_NV* = 0x0000888D + GL_FLOAT_RGBA_MODE_NV* = 0x0000888E + #***** GL_NV_fragment_program *****// + +const + GL_FRAGMENT_PROGRAM_NV* = 0x00008870 + GL_MAX_TEXTURE_COORDS_NV* = 0x00008871 + GL_MAX_TEXTURE_IMAGE_UNITS_NV* = 0x00008872 + GL_FRAGMENT_PROGRAM_BINDING_NV* = 0x00008873 + GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV* = 0x00008868 + GL_PROGRAM_ERROR_STRING_NV* = 0x00008874 + +proc glProgramNamedParameter4fNV*(id: TGLuint, length: TGLsizei, name: PGLubyte, + x: TGLfloat, y: TGLfloat, z: TGLfloat, + w: TGLfloat){.dynlib: dllname, + importc: "glProgramNamedParameter4fNV".} +proc glProgramNamedParameter4dNV*(id: TGLuint, length: TGLsizei, name: PGLubyte, + x: TGLdouble, y: TGLdouble, z: TGLdouble, + w: TGLdouble){.dynlib: dllname, + importc: "glProgramNamedParameter4dNV".} +proc glGetProgramNamedParameterfvNV*(id: TGLuint, length: TGLsizei, + name: PGLubyte, params: PGLfloat){. + dynlib: dllname, importc: "glGetProgramNamedParameterfvNV".} +proc glGetProgramNamedParameterdvNV*(id: TGLuint, length: TGLsizei, + name: PGLubyte, params: PGLdouble){. + dynlib: dllname, importc: "glGetProgramNamedParameterdvNV".} + # glProgramLocalParameter4dARB { already defined } + # glProgramLocalParameter4dvARB { already defined } + # glProgramLocalParameter4fARB { already defined } + # glProgramLocalParameter4fvARB { already defined } + # glGetProgramLocalParameterdvARB { already defined } + # glGetProgramLocalParameterfvARB { already defined } + #***** GL_NV_primitive_restart *****// +const + constGL_PRIMITIVE_RESTART_NV* = 0x00008558 + constGL_PRIMITIVE_RESTART_INDEX_NV* = 0x00008559 + +proc glPrimitiveRestartNV*(){.dynlib: dllname, importc: "glPrimitiveRestartNV".} +proc glPrimitiveRestartIndexNV*(index: TGLuint){.dynlib: dllname, + importc: "glPrimitiveRestartIndexNV".} + #***** GL_NV_vertex_program2 *****// + #***** GL_NV_pixel_data_range *****// +const + GL_WRITE_PIXEL_DATA_RANGE_NV* = 0x00008878 + GL_READ_PIXEL_DATA_RANGE_NV* = 0x00008879 + GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887A + GL_READ_PIXEL_DATA_RANGE_LENGTH_NV* = 0x0000887B + GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887C + GL_READ_PIXEL_DATA_RANGE_POINTER_NV* = 0x0000887D + +proc glPixelDataRangeNV*(target: TGLenum, len: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glPixelDataRangeNV".} +proc glFlushPixelDataRangeNV*(target: TGLenum){.dynlib: dllname, + importc: "glFlushPixelDataRangeNV".} + # wglAllocateMemoryNV { already defined } + # wglFreeMemoryNV { already defined } + #***** GL_EXT_texture_rectangle *****// +const + GL_TEXTURE_RECTANGLE_EXT* = 0x000084F5 + GL_TEXTURE_BINDING_RECTANGLE_EXT* = 0x000084F6 + GL_PROXY_TEXTURE_RECTANGLE_EXT* = 0x000084F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT* = 0x000084F8 + #***** GL_S3_s3tc *****// + +const + GL_RGB_S3TC* = 0x000083A0 + GL_RGB4_S3TC* = 0x000083A1 + GL_RGBA_S3TC* = 0x000083A2 + GL_RGBA4_S3TC* = 0x000083A3 + #***** GL_ATI_draw_buffers *****// + +const + GL_MAX_DRAW_BUFFERS_ATI* = 0x00008824 + GL_DRAW_BUFFER0_ATI* = 0x00008825 + GL_DRAW_BUFFER1_ATI* = 0x00008826 + GL_DRAW_BUFFER2_ATI* = 0x00008827 + GL_DRAW_BUFFER3_ATI* = 0x00008828 + GL_DRAW_BUFFER4_ATI* = 0x00008829 + GL_DRAW_BUFFER5_ATI* = 0x0000882A + GL_DRAW_BUFFER6_ATI* = 0x0000882B + GL_DRAW_BUFFER7_ATI* = 0x0000882C + GL_DRAW_BUFFER8_ATI* = 0x0000882D + GL_DRAW_BUFFER9_ATI* = 0x0000882E + GL_DRAW_BUFFER10_ATI* = 0x0000882F + GL_DRAW_BUFFER11_ATI* = 0x00008830 + GL_DRAW_BUFFER12_ATI* = 0x00008831 + GL_DRAW_BUFFER13_ATI* = 0x00008832 + GL_DRAW_BUFFER14_ATI* = 0x00008833 + GL_DRAW_BUFFER15_ATI* = 0x00008834 + +proc glDrawBuffersATI*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, + importc: "glDrawBuffersATI".} + #***** GL_ATI_texture_env_combine3 *****// +const + GL_MODULATE_ADD_ATI* = 0x00008744 + GL_MODULATE_SIGNED_ADD_ATI* = 0x00008745 + GL_MODULATE_SUBTRACT_ATI* = 0x00008746 + #***** GL_ATI_texture_float *****// + +const + GL_RGBA_FLOAT32_ATI* = 0x00008814 + GL_RGB_FLOAT32_ATI* = 0x00008815 + GL_ALPHA_FLOAT32_ATI* = 0x00008816 + GL_INTENSITY_FLOAT32_ATI* = 0x00008817 + GL_LUMINANCE_FLOAT32_ATI* = 0x00008818 + GL_LUMINANCE_ALPHA_FLOAT32_ATI* = 0x00008819 + GL_RGBA_FLOAT16_ATI* = 0x0000881A + GL_RGB_FLOAT16_ATI* = 0x0000881B + GL_ALPHA_FLOAT16_ATI* = 0x0000881C + GL_INTENSITY_FLOAT16_ATI* = 0x0000881D + GL_LUMINANCE_FLOAT16_ATI* = 0x0000881E + GL_LUMINANCE_ALPHA_FLOAT16_ATI* = 0x0000881F + #***** GL_NV_texture_expand_normal *****// + +const + GL_TEXTURE_UNSIGNED_REMAP_MODE_NV* = 0x0000888F + #***** GL_NV_half_float *****// + +const + GL_HALF_FLOAT_NV* = 0x0000140B + +proc glVertex2hNV*(x: TGLushort, y: TGLushort){.dynlib: dllname, + importc: "glVertex2hNV".} +proc glVertex2hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex2hvNV".} +proc glVertex3hNV*(x: TGLushort, y: TGLushort, z: TGLushort){.dynlib: dllname, + importc: "glVertex3hNV".} +proc glVertex3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex3hvNV".} +proc glVertex4hNV*(x: TGLushort, y: TGLushort, z: TGLushort, w: TGLushort){. + dynlib: dllname, importc: "glVertex4hNV".} +proc glVertex4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glVertex4hvNV".} +proc glNormal3hNV*(nx: TGLushort, ny: TGLushort, nz: TGLushort){. + dynlib: dllname, importc: "glNormal3hNV".} +proc glNormal3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glNormal3hvNV".} +proc glColor3hNV*(red: TGLushort, green: TGLushort, blue: TGLushort){. + dynlib: dllname, importc: "glColor3hNV".} +proc glColor3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glColor3hvNV".} +proc glColor4hNV*(red: TGLushort, green: TGLushort, blue: TGLushort, + alpha: TGLushort){.dynlib: dllname, importc: "glColor4hNV".} +proc glColor4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glColor4hvNV".} +proc glTexCoord1hNV*(s: TGLushort){.dynlib: dllname, importc: "glTexCoord1hNV".} +proc glTexCoord1hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord1hvNV".} +proc glTexCoord2hNV*(s: TGLushort, t: TGLushort){.dynlib: dllname, + importc: "glTexCoord2hNV".} +proc glTexCoord2hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord2hvNV".} +proc glTexCoord3hNV*(s: TGLushort, t: TGLushort, r: TGLushort){.dynlib: dllname, + importc: "glTexCoord3hNV".} +proc glTexCoord3hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord3hvNV".} +proc glTexCoord4hNV*(s: TGLushort, t: TGLushort, r: TGLushort, q: TGLushort){. + dynlib: dllname, importc: "glTexCoord4hNV".} +proc glTexCoord4hvNV*(v: PGLushort){.dynlib: dllname, importc: "glTexCoord4hvNV".} +proc glMultiTexCoord1hNV*(target: TGLenum, s: TGLushort){.dynlib: dllname, + importc: "glMultiTexCoord1hNV".} +proc glMultiTexCoord1hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, + importc: "glMultiTexCoord1hvNV".} +proc glMultiTexCoord2hNV*(target: TGLenum, s: TGLushort, t: TGLushort){. + dynlib: dllname, importc: "glMultiTexCoord2hNV".} +proc glMultiTexCoord2hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, + importc: "glMultiTexCoord2hvNV".} +proc glMultiTexCoord3hNV*(target: TGLenum, s: TGLushort, t: TGLushort, + r: TGLushort){.dynlib: dllname, + importc: "glMultiTexCoord3hNV".} +proc glMultiTexCoord3hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, + importc: "glMultiTexCoord3hvNV".} +proc glMultiTexCoord4hNV*(target: TGLenum, s: TGLushort, t: TGLushort, + r: TGLushort, q: TGLushort){.dynlib: dllname, + importc: "glMultiTexCoord4hNV".} +proc glMultiTexCoord4hvNV*(target: TGLenum, v: PGLushort){.dynlib: dllname, + importc: "glMultiTexCoord4hvNV".} +proc glFogCoordhNV*(fog: TGLushort){.dynlib: dllname, importc: "glFogCoordhNV".} +proc glFogCoordhvNV*(fog: PGLushort){.dynlib: dllname, importc: "glFogCoordhvNV".} +proc glSecondaryColor3hNV*(red: TGLushort, green: TGLushort, blue: TGLushort){. + dynlib: dllname, importc: "glSecondaryColor3hNV".} +proc glSecondaryColor3hvNV*(v: PGLushort){.dynlib: dllname, + importc: "glSecondaryColor3hvNV".} +proc glVertexWeighthNV*(weight: TGLushort){.dynlib: dllname, + importc: "glVertexWeighthNV".} +proc glVertexWeighthvNV*(weight: PGLushort){.dynlib: dllname, + importc: "glVertexWeighthvNV".} +proc glVertexAttrib1hNV*(index: TGLuint, x: TGLushort){.dynlib: dllname, + importc: "glVertexAttrib1hNV".} +proc glVertexAttrib1hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib1hvNV".} +proc glVertexAttrib2hNV*(index: TGLuint, x: TGLushort, y: TGLushort){. + dynlib: dllname, importc: "glVertexAttrib2hNV".} +proc glVertexAttrib2hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib2hvNV".} +proc glVertexAttrib3hNV*(index: TGLuint, x: TGLushort, y: TGLushort, + z: TGLushort){.dynlib: dllname, + importc: "glVertexAttrib3hNV".} +proc glVertexAttrib3hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib3hvNV".} +proc glVertexAttrib4hNV*(index: TGLuint, x: TGLushort, y: TGLushort, + z: TGLushort, w: TGLushort){.dynlib: dllname, + importc: "glVertexAttrib4hNV".} +proc glVertexAttrib4hvNV*(index: TGLuint, v: PGLushort){.dynlib: dllname, + importc: "glVertexAttrib4hvNV".} +proc glVertexAttribs1hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. + dynlib: dllname, importc: "glVertexAttribs1hvNV".} +proc glVertexAttribs2hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. + dynlib: dllname, importc: "glVertexAttribs2hvNV".} +proc glVertexAttribs3hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. + dynlib: dllname, importc: "glVertexAttribs3hvNV".} +proc glVertexAttribs4hvNV*(index: TGLuint, n: TGLsizei, v: PGLushort){. + dynlib: dllname, importc: "glVertexAttribs4hvNV".} + #***** GL_ATI_map_object_buffer *****// +proc glMapObjectBufferATI*(buffer: TGLuint): PGLvoid{.dynlib: dllname, + importc: "glMapObjectBufferATI".} +proc glUnmapObjectBufferATI*(buffer: TGLuint){.dynlib: dllname, + importc: "glUnmapObjectBufferATI".} + #***** GL_ATI_separate_stencil *****// +const + GL_KEEP* = 0x00001E00 + GL_ZERO* = 0x00000000 + GL_REPLACE* = 0x00001E01 + GL_INCR* = 0x00001E02 + GL_DECR* = 0x00001E03 + GL_INVERT* = 0x0000150A + GL_NEVER* = 0x00000200 + GL_LESS* = 0x00000201 + GL_LEQUAL* = 0x00000203 + GL_GREATER* = 0x00000204 + GL_GEQUAL* = 0x00000206 + GL_EQUAL* = 0x00000202 + GL_NOTEQUAL* = 0x00000205 + GL_ALWAYS* = 0x00000207 + GL_FRONT* = 0x00000404 + GL_BACK* = 0x00000405 + GL_FRONT_AND_BACK* = 0x00000408 + GL_STENCIL_BACK_FUNC_ATI* = 0x00008800 + GL_STENCIL_BACK_FAIL_ATI* = 0x00008801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI* = 0x00008802 + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI* = 0x00008803 + +proc glStencilOpSeparateATI*(face: TGLenum, sfail: TGLenum, dpfail: TGLenum, + dppass: TGLenum){.dynlib: dllname, + importc: "glStencilOpSeparateATI".} +proc glStencilFuncSeparateATI*(frontfunc: TGLenum, backfunc: TGLenum, + theRef: TGLint, mask: TGLuint){.dynlib: dllname, + importc: "glStencilFuncSeparateATI".} + #***** GL_ATI_vertex_attrib_array_object *****// +proc glVertexAttribArrayObjectATI*(index: TGLuint, size: TGLint, + thetype: TGLenum, normalized: TGLboolean, + stride: TGLsizei, buffer: TGLuint, + offset: TGLuint){.dynlib: dllname, + importc: "glVertexAttribArrayObjectATI".} +proc glGetVertexAttribArrayObjectfvATI*(index: TGLuint, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetVertexAttribArrayObjectfvATI".} +proc glGetVertexAttribArrayObjectivATI*(index: TGLuint, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetVertexAttribArrayObjectivATI".} + #***** GL_ARB_occlusion_query *****// +const + GL_SAMPLES_PASSED_ARB* = 0x00008914 + GL_QUERY_COUNTER_BITS_ARB* = 0x00008864 + GL_CURRENT_QUERY_ARB* = 0x00008865 + GL_QUERY_RESULT_ARB* = 0x00008866 + GL_QUERY_RESULT_AVAILABLE_ARB* = 0x00008867 + +proc glGenQueriesARB*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glGenQueriesARB".} +proc glDeleteQueriesARB*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glDeleteQueriesARB".} +proc glIsQueryARB*(id: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsQueryARB".} +proc glBeginQueryARB*(target: TGLenum, id: TGLuint){.dynlib: dllname, + importc: "glBeginQueryARB".} +proc glEndQueryARB*(target: TGLenum){.dynlib: dllname, importc: "glEndQueryARB".} +proc glGetQueryivARB*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetQueryivARB".} +proc glGetQueryObjectivARB*(id: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetQueryObjectivARB".} +proc glGetQueryObjectuivARB*(id: TGLuint, pname: TGLenum, params: PGLuint){. + dynlib: dllname, importc: "glGetQueryObjectuivARB".} + #***** GL_ARB_shader_objects *****// +const + GL_PROGRAM_OBJECT_ARB* = 0x00008B40 + GL_OBJECT_TYPE_ARB* = 0x00008B4E + GL_OBJECT_SUBTYPE_ARB* = 0x00008B4F + GL_OBJECT_DELETE_STATUS_ARB* = 0x00008B80 + GL_OBJECT_COMPILE_STATUS_ARB* = 0x00008B81 + GL_OBJECT_LINK_STATUS_ARB* = 0x00008B82 + GL_OBJECT_VALIDATE_STATUS_ARB* = 0x00008B83 + GL_OBJECT_INFO_LOG_LENGTH_ARB* = 0x00008B84 + GL_OBJECT_ATTACHED_OBJECTS_ARB* = 0x00008B85 + GL_OBJECT_ACTIVE_UNIFORMS_ARB* = 0x00008B86 + GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB* = 0x00008B87 + GL_OBJECT_SHADER_SOURCE_LENGTH_ARB* = 0x00008B88 + GL_SHADER_OBJECT_ARB* = 0x00008B48 + GL_FLOAT* = 0x00001406 + GL_FLOAT_VEC2_ARB* = 0x00008B50 + GL_FLOAT_VEC3_ARB* = 0x00008B51 + GL_FLOAT_VEC4_ARB* = 0x00008B52 + GL_INT* = 0x00001404 + GL_INT_VEC2_ARB* = 0x00008B53 + GL_INT_VEC3_ARB* = 0x00008B54 + GL_INT_VEC4_ARB* = 0x00008B55 + GL_BOOL_ARB* = 0x00008B56 + GL_BOOL_VEC2_ARB* = 0x00008B57 + GL_BOOL_VEC3_ARB* = 0x00008B58 + GL_BOOL_VEC4_ARB* = 0x00008B59 + GL_FLOAT_MAT2_ARB* = 0x00008B5A + GL_FLOAT_MAT3_ARB* = 0x00008B5B + GL_FLOAT_MAT4_ARB* = 0x00008B5C + +proc glDeleteObjectARB*(obj: GLhandleARB){.dynlib: dllname, + importc: "glDeleteObjectARB".} +proc glGetHandleARB*(pname: TGLenum): GLhandleARB{.dynlib: dllname, + importc: "glGetHandleARB".} +proc glDetachObjectARB*(containerObj: GLhandleARB, attachedObj: GLhandleARB){. + dynlib: dllname, importc: "glDetachObjectARB".} +proc glCreateShaderObjectARB*(shaderType: TGLenum): GLhandleARB{. + dynlib: dllname, importc: "glCreateShaderObjectARB".} +proc glShaderSourceARB*(shaderObj: GLhandleARB, count: TGLsizei, str: PGLvoid, + len: PGLint){.dynlib: dllname, + importc: "glShaderSourceARB".} +proc glCompileShaderARB*(shaderObj: GLhandleARB){.dynlib: dllname, + importc: "glCompileShaderARB".} +proc glCreateProgramObjectARB*(): GLhandleARB{.dynlib: dllname, + importc: "glCreateProgramObjectARB".} +proc glAttachObjectARB*(containerObj: GLhandleARB, obj: GLhandleARB){. + dynlib: dllname, importc: "glAttachObjectARB".} +proc glLinkProgramARB*(programObj: GLhandleARB){.dynlib: dllname, + importc: "glLinkProgramARB".} +proc glUseProgramObjectARB*(programObj: GLhandleARB){.dynlib: dllname, + importc: "glUseProgramObjectARB".} +proc glValidateProgramARB*(programObj: GLhandleARB){.dynlib: dllname, + importc: "glValidateProgramARB".} +proc glUniform1fARB*(location: TGLint, v0: TGLfloat){.dynlib: dllname, + importc: "glUniform1fARB".} +proc glUniform2fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat){. + dynlib: dllname, importc: "glUniform2fARB".} +proc glUniform3fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat){. + dynlib: dllname, importc: "glUniform3fARB".} +proc glUniform4fARB*(location: TGLint, v0: TGLfloat, v1: TGLfloat, v2: TGLfloat, + v3: TGLfloat){.dynlib: dllname, importc: "glUniform4fARB".} +proc glUniform1iARB*(location: TGLint, v0: TGLint){.dynlib: dllname, + importc: "glUniform1iARB".} +proc glUniform2iARB*(location: TGLint, v0: TGLint, v1: TGLint){.dynlib: dllname, + importc: "glUniform2iARB".} +proc glUniform3iARB*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint){. + dynlib: dllname, importc: "glUniform3iARB".} +proc glUniform4iARB*(location: TGLint, v0: TGLint, v1: TGLint, v2: TGLint, + v3: TGLint){.dynlib: dllname, importc: "glUniform4iARB".} +proc glUniform1fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform1fvARB".} +proc glUniform2fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform2fvARB".} +proc glUniform3fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform3fvARB".} +proc glUniform4fvARB*(location: TGLint, count: TGLsizei, value: PGLfloat){. + dynlib: dllname, importc: "glUniform4fvARB".} +proc glUniform1ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform1ivARB".} +proc glUniform2ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform2ivARB".} +proc glUniform3ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform3ivARB".} +proc glUniform4ivARB*(location: TGLint, count: TGLsizei, value: PGLint){. + dynlib: dllname, importc: "glUniform4ivARB".} +proc glUniformMatrix2fvARB*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix2fvARB".} +proc glUniformMatrix3fvARB*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix3fvARB".} +proc glUniformMatrix4fvARB*(location: TGLint, count: TGLsizei, + transpose: TGLboolean, value: PGLfloat){. + dynlib: dllname, importc: "glUniformMatrix4fvARB".} +proc glGetObjectParameterfvARB*(obj: GLhandleARB, pname: TGLenum, + params: PGLfloat){.dynlib: dllname, + importc: "glGetObjectParameterfvARB".} +proc glGetObjectParameterivARB*(obj: GLhandleARB, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetObjectParameterivARB".} +proc glGetInfoLogARB*(obj: GLhandleARB, maxLength: TGLsizei, len: PGLsizei, + infoLog: PGLcharARB){.dynlib: dllname, + importc: "glGetInfoLogARB".} +proc glGetAttachedObjectsARB*(containerObj: GLhandleARB, maxCount: TGLsizei, + count: PGLsizei, obj: PGLhandleARB){. + dynlib: dllname, importc: "glGetAttachedObjectsARB".} +proc glGetUniformLocationARB*(programObj: GLhandleARB, name: PGLcharARB): TGLint{. + dynlib: dllname, importc: "glGetUniformLocationARB".} +proc glGetActiveUniformARB*(programObj: GLhandleARB, index: TGLuint, + maxLength: TGLsizei, len: PGLsizei, size: PGLint, + thetype: PGLenum, name: PGLcharARB){. + dynlib: dllname, importc: "glGetActiveUniformARB".} +proc glGetUniformfvARB*(programObj: GLhandleARB, location: TGLint, + params: PGLfloat){.dynlib: dllname, + importc: "glGetUniformfvARB".} +proc glGetUniformivARB*(programObj: GLhandleARB, location: TGLint, + params: PGLint){.dynlib: dllname, + importc: "glGetUniformivARB".} +proc glGetShaderSourceARB*(obj: GLhandleARB, maxLength: TGLsizei, len: PGLsizei, + source: PGLcharARB){.dynlib: dllname, + importc: "glGetShaderSourceARB".} +const + GL_VERTEX_SHADER_ARB* = 0x00008B31 + GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB* = 0x00008B4A + GL_MAX_VARYING_FLOATS_ARB* = 0x00008B4B # GL_MAX_VERTEX_ATTRIBS_ARB { already defined } + # GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB* = 0x00008B4D # + # + # GL_MAX_TEXTURE_COORDS_ARB { already defined } + # + # + # GL_VERTEX_PROGRAM_POINT_SIZE_ARB { already defined } + # + # + # GL_VERTEX_PROGRAM_TWO_SIDE_ARB { already defined } + # GL_OBJECT_TYPE_ARB { already defined } + # GL_OBJECT_SUBTYPE_ARB { already defined } + GL_OBJECT_ACTIVE_ATTRIBUTES_ARB* = 0x00008B89 + GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB* = 0x00008B8A # GL_SHADER_OBJECT_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB { already defined } + # + # + # GL_CURRENT_VERTEX_ATTRIB_ARB { already defined } + # + # + # GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB { already defined } + # GL_FLOAT { already defined } + # GL_FLOAT_VEC2_ARB { already defined } + # GL_FLOAT_VEC3_ARB { already defined } + # GL_FLOAT_VEC4_ARB { already defined } + # GL_FLOAT_MAT2_ARB { already defined } + # GL_FLOAT_MAT3_ARB { already defined } + # GL_FLOAT_MAT4_ARB { already defined } + # glVertexAttrib1fARB { already defined } + # glVertexAttrib1sARB { already defined } + # glVertexAttrib1dARB { already defined } + # glVertexAttrib2fARB { already defined } + # glVertexAttrib2sARB { already defined } + # glVertexAttrib2dARB { already defined } + # glVertexAttrib3fARB { already defined } + # glVertexAttrib3sARB { already defined } + # glVertexAttrib3dARB { already defined } + # glVertexAttrib4fARB { already defined } + # glVertexAttrib4sARB { already defined } + # glVertexAttrib4dARB { already defined } + # glVertexAttrib4NubARB { already defined } + # glVertexAttrib1fvARB { already defined } + # glVertexAttrib1svARB { already defined } + # glVertexAttrib1dvARB { already defined } + # glVertexAttrib2fvARB { already defined } + # glVertexAttrib2svARB { already defined } + # glVertexAttrib2dvARB { already defined } + # glVertexAttrib3fvARB { already defined } + # glVertexAttrib3svARB { already defined } + # glVertexAttrib3dvARB { already defined } + # glVertexAttrib4fvARB { already defined } + # glVertexAttrib4svARB { already defined } + # glVertexAttrib4dvARB { already defined } + # glVertexAttrib4ivARB { already defined } + # glVertexAttrib4bvARB { already defined } + # glVertexAttrib4ubvARB { already defined } + # glVertexAttrib4usvARB { already defined } + # glVertexAttrib4uivARB { already defined } + # glVertexAttrib4NbvARB { already defined } + # glVertexAttrib4NsvARB { already defined } + # glVertexAttrib4NivARB { already defined } + # glVertexAttrib4NubvARB { already defined } + # glVertexAttrib4NusvARB { already defined } + # glVertexAttrib4NuivARB { already defined } + # + # + # glVertexAttribPointerARB { already defined } + # + # + # glEnableVertexAttribArrayARB { already defined } + # + # + # glDisableVertexAttribArrayARB { already defined } + +proc glBindAttribLocationARB*(programObj: GLhandleARB, index: TGLuint, + name: PGLcharARB){.dynlib: dllname, + importc: "glBindAttribLocationARB".} +proc glGetActiveAttribARB*(programObj: GLhandleARB, index: TGLuint, + maxLength: TGLsizei, len: PGLsizei, size: PGLint, + thetype: PGLenum, name: PGLcharARB){.dynlib: dllname, + importc: "glGetActiveAttribARB".} +proc glGetAttribLocationARB*(programObj: GLhandleARB, name: PGLcharARB): TGLint{. + dynlib: dllname, importc: "glGetAttribLocationARB".} + # glGetVertexAttribdvARB { already defined } + # glGetVertexAttribfvARB { already defined } + # glGetVertexAttribivARB { already defined } + # glGetVertexAttribPointervARB { already defined } + #***** GL_ARB_fragment_shader *****// +const + GL_FRAGMENT_SHADER_ARB* = 0x00008B30 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB* = 0x00008B49 # GL_MAX_TEXTURE_COORDS_ARB { already defined } + # + # + # GL_MAX_TEXTURE_IMAGE_UNITS_ARB { already defined } + # GL_OBJECT_TYPE_ARB { already defined } + # GL_OBJECT_SUBTYPE_ARB { already defined } + # GL_SHADER_OBJECT_ARB { already defined } + #***** GL_ARB_shading_language_100 *****// + #***** GL_ARB_texture_non_power_of_two *****// + #***** GL_ARB_point_sprite *****// + +const + GL_POINT_SPRITE_ARB* = 0x00008861 + GL_COORD_REPLACE_ARB* = 0x00008862 + #***** GL_EXT_depth_bounds_test *****// + +const + constGL_DEPTH_BOUNDS_TEST_EXT* = 0x00008890 + constGL_DEPTH_BOUNDS_EXT* = 0x00008891 + +proc glDepthBoundsEXT*(zmin: TGLclampd, zmax: TGLclampd){.dynlib: dllname, + importc: "glDepthBoundsEXT".} + #***** GL_EXT_texture_mirror_clamp *****// +const + GL_MIRROR_CLAMP_EXT* = 0x00008742 + GL_MIRROR_CLAMP_TO_EDGE_EXT* = 0x00008743 + GL_MIRROR_CLAMP_TO_BORDER_EXT* = 0x00008912 + #***** GL_EXT_blend_equation_separate *****// + +const + GL_BLEND_EQUATION_RGB_EXT* = 0x00008009 + GL_BLEND_EQUATION_ALPHA_EXT* = 0x0000883D + +proc glBlendEquationSeparateEXT*(modeRGB: TGLenum, modeAlpha: TGLenum){. + dynlib: dllname, importc: "glBlendEquationSeparateEXT".} + #***** GL_MESA_pack_invert *****// +const + GL_PACK_INVERT_MESA* = 0x00008758 + #***** GL_MESA_ycbcr_texture *****// + +const + GL_YCBCR_MESA* = 0x00008757 + GL_UNSIGNED_SHORT_8_8_MESA* = 0x000085BA + GL_UNSIGNED_SHORT_8_8_REV_MESA* = 0x000085BB + #***** GL_ARB_fragment_program_shadow *****// + #***** GL_NV_fragment_program_option *****// + #***** GL_EXT_pixel_buffer_object *****// + +const + GL_PIXEL_PACK_BUFFER_EXT* = 0x000088EB + GL_PIXEL_UNPACK_BUFFER_EXT* = 0x000088EC + GL_PIXEL_PACK_BUFFER_BINDING_EXT* = 0x000088ED + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT* = 0x000088EF + #***** GL_NV_fragment_program2 *****// + +const + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV* = 0x000088F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV* = 0x000088F5 + GL_MAX_PROGRAM_IF_DEPTH_NV* = 0x000088F6 + GL_MAX_PROGRAM_LOOP_DEPTH_NV* = 0x000088F7 + GL_MAX_PROGRAM_LOOP_COUNT_NV* = 0x000088F8 + #***** GL_NV_vertex_program2_option *****// + # GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV { already defined } + # GL_MAX_PROGRAM_CALL_DEPTH_NV { already defined } + #***** GL_NV_vertex_program3 *****// + # GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB { already defined } + #***** GL_ARB_draw_buffers *****// + +const + GL_MAX_DRAW_BUFFERS_ARB* = 0x00008824 + GL_DRAW_BUFFER0_ARB* = 0x00008825 + GL_DRAW_BUFFER1_ARB* = 0x00008826 + GL_DRAW_BUFFER2_ARB* = 0x00008827 + GL_DRAW_BUFFER3_ARB* = 0x00008828 + GL_DRAW_BUFFER4_ARB* = 0x00008829 + GL_DRAW_BUFFER5_ARB* = 0x0000882A + GL_DRAW_BUFFER6_ARB* = 0x0000882B + GL_DRAW_BUFFER7_ARB* = 0x0000882C + GL_DRAW_BUFFER8_ARB* = 0x0000882D + GL_DRAW_BUFFER9_ARB* = 0x0000882E + GL_DRAW_BUFFER10_ARB* = 0x0000882F + GL_DRAW_BUFFER11_ARB* = 0x00008830 + GL_DRAW_BUFFER12_ARB* = 0x00008831 + GL_DRAW_BUFFER13_ARB* = 0x00008832 + GL_DRAW_BUFFER14_ARB* = 0x00008833 + GL_DRAW_BUFFER15_ARB* = 0x00008834 + +proc glDrawBuffersARB*(n: TGLsizei, bufs: PGLenum){.dynlib: dllname, + importc: "glDrawBuffersARB".} + #***** GL_ARB_texture_rectangle *****// +const + GL_TEXTURE_RECTANGLE_ARB* = 0x000084F5 + GL_TEXTURE_BINDING_RECTANGLE_ARB* = 0x000084F6 + GL_PROXY_TEXTURE_RECTANGLE_ARB* = 0x000084F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB* = 0x000084F8 + #***** GL_ARB_color_buffer_float *****// + +const + GL_RGBA_FLOAT_MODE_ARB* = 0x00008820 + GL_CLAMP_VERTEX_COLOR_ARB* = 0x0000891A + GL_CLAMP_FRAGMENT_COLOR_ARB* = 0x0000891B + GL_CLAMP_READ_COLOR_ARB* = 0x0000891C + GL_FIXED_ONLY_ARB* = 0x0000891D + WGL_TYPE_RGBA_FLOAT_ARB* = 0x000021A0 + +proc glClampColorARB*(target: TGLenum, clamp: TGLenum){.dynlib: dllname, + importc: "glClampColorARB".} + #***** GL_ARB_half_float_pixel *****// +const + GL_HALF_FLOAT_ARB* = 0x0000140B + #***** GL_ARB_texture_float *****// + +const + GL_TEXTURE_RED_TYPE_ARB* = 0x00008C10 + GL_TEXTURE_GREEN_TYPE_ARB* = 0x00008C11 + GL_TEXTURE_BLUE_TYPE_ARB* = 0x00008C12 + GL_TEXTURE_ALPHA_TYPE_ARB* = 0x00008C13 + GL_TEXTURE_LUMINANCE_TYPE_ARB* = 0x00008C14 + GL_TEXTURE_INTENSITY_TYPE_ARB* = 0x00008C15 + GL_TEXTURE_DEPTH_TYPE_ARB* = 0x00008C16 + GL_UNSIGNED_NORMALIZED_ARB* = 0x00008C17 + GL_RGBA32F_ARB* = 0x00008814 + GL_RGB32F_ARB* = 0x00008815 + GL_ALPHA32F_ARB* = 0x00008816 + GL_INTENSITY32F_ARB* = 0x00008817 + GL_LUMINANCE32F_ARB* = 0x00008818 + GL_LUMINANCE_ALPHA32F_ARB* = 0x00008819 + GL_RGBA16F_ARB* = 0x0000881A + GL_RGB16F_ARB* = 0x0000881B + GL_ALPHA16F_ARB* = 0x0000881C + GL_INTENSITY16F_ARB* = 0x0000881D + GL_LUMINANCE16F_ARB* = 0x0000881E + GL_LUMINANCE_ALPHA16F_ARB* = 0x0000881F + #***** GL_EXT_texture_compression_dxt1 *****// + # GL_COMPRESSED_RGB_S3TC_DXT1_EXT { already defined } + # GL_COMPRESSED_RGBA_S3TC_DXT1_EXT { already defined } + #***** GL_ARB_pixel_buffer_object *****// + +const + GL_PIXEL_PACK_BUFFER_ARB* = 0x000088EB + GL_PIXEL_UNPACK_BUFFER_ARB* = 0x000088EC + GL_PIXEL_PACK_BUFFER_BINDING_ARB* = 0x000088ED + GL_PIXEL_UNPACK_BUFFER_BINDING_ARB* = 0x000088EF + #***** GL_EXT_framebuffer_object *****// + +const + GL_FRAMEBUFFER_EXT* = 0x00008D40 + GL_RENDERBUFFER_EXT* = 0x00008D41 + GL_STENCIL_INDEX_EXT* = 0x00008D45 + GL_STENCIL_INDEX1_EXT* = 0x00008D46 + GL_STENCIL_INDEX4_EXT* = 0x00008D47 + GL_STENCIL_INDEX8_EXT* = 0x00008D48 + GL_STENCIL_INDEX16_EXT* = 0x00008D49 + GL_RENDERBUFFER_WIDTH_EXT* = 0x00008D42 + GL_RENDERBUFFER_HEIGHT_EXT* = 0x00008D43 + GL_RENDERBUFFER_INTERNAL_FORMAT_EXT* = 0x00008D44 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT* = 0x00008CD0 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT* = 0x00008CD1 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT* = 0x00008CD2 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT* = 0x00008CD3 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT* = 0x00008CD4 + GL_COLOR_ATTACHMENT0_EXT* = 0x00008CE0 + GL_COLOR_ATTACHMENT1_EXT* = 0x00008CE1 + GL_COLOR_ATTACHMENT2_EXT* = 0x00008CE2 + GL_COLOR_ATTACHMENT3_EXT* = 0x00008CE3 + GL_COLOR_ATTACHMENT4_EXT* = 0x00008CE4 + GL_COLOR_ATTACHMENT5_EXT* = 0x00008CE5 + GL_COLOR_ATTACHMENT6_EXT* = 0x00008CE6 + GL_COLOR_ATTACHMENT7_EXT* = 0x00008CE7 + GL_COLOR_ATTACHMENT8_EXT* = 0x00008CE8 + GL_COLOR_ATTACHMENT9_EXT* = 0x00008CE9 + GL_COLOR_ATTACHMENT10_EXT* = 0x00008CEA + GL_COLOR_ATTACHMENT11_EXT* = 0x00008CEB + GL_COLOR_ATTACHMENT12_EXT* = 0x00008CEC + GL_COLOR_ATTACHMENT13_EXT* = 0x00008CED + GL_COLOR_ATTACHMENT14_EXT* = 0x00008CEE + GL_COLOR_ATTACHMENT15_EXT* = 0x00008CEF + GL_DEPTH_ATTACHMENT_EXT* = 0x00008D00 + GL_STENCIL_ATTACHMENT_EXT* = 0x00008D20 + GL_FRAMEBUFFER_COMPLETE_EXT* = 0x00008CD5 + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT* = 0x00008CD6 + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT* = 0x00008CD7 + GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT* = 0x00008CD8 + GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT* = 0x00008CD9 + GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT* = 0x00008CDA + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT* = 0x00008CDB + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT* = 0x00008CDC + GL_FRAMEBUFFER_UNSUPPORTED_EXT* = 0x00008CDD + GL_FRAMEBUFFER_STATUS_ERROR_EXT* = 0x00008CDE + GL_FRAMEBUFFER_BINDING_EXT* = 0x00008CA6 + GL_RENDERBUFFER_BINDING_EXT* = 0x00008CA7 + GL_MAX_COLOR_ATTACHMENTS_EXT* = 0x00008CDF + GL_MAX_RENDERBUFFER_SIZE_EXT* = 0x000084E8 + GL_INVALID_FRAMEBUFFER_OPERATION_EXT* = 0x00000506 + +proc glIsRenderbufferEXT*(renderbuffer: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsRenderbufferEXT".} +proc glBindRenderbufferEXT*(target: TGLenum, renderbuffer: TGLuint){. + dynlib: dllname, importc: "glBindRenderbufferEXT".} +proc glDeleteRenderbuffersEXT*(n: TGLsizei, renderbuffers: PGLuint){. + dynlib: dllname, importc: "glDeleteRenderbuffersEXT".} +proc glGenRenderbuffersEXT*(n: TGLsizei, renderbuffers: PGLuint){. + dynlib: dllname, importc: "glGenRenderbuffersEXT".} +proc glRenderbufferStorageEXT*(target: TGLenum, internalformat: TGLenum, + width: TGLsizei, height: TGLsizei){. + dynlib: dllname, importc: "glRenderbufferStorageEXT".} +proc glGetRenderbufferParameterivEXT*(target: TGLenum, pname: TGLenum, + params: PGLint){.dynlib: dllname, + importc: "glGetRenderbufferParameterivEXT".} +proc glIsFramebufferEXT*(framebuffer: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsFramebufferEXT".} +proc glBindFramebufferEXT*(target: TGLenum, framebuffer: TGLuint){. + dynlib: dllname, importc: "glBindFramebufferEXT".} +proc glDeleteFramebuffersEXT*(n: TGLsizei, framebuffers: PGLuint){. + dynlib: dllname, importc: "glDeleteFramebuffersEXT".} +proc glGenFramebuffersEXT*(n: TGLsizei, framebuffers: PGLuint){.dynlib: dllname, + importc: "glGenFramebuffersEXT".} +proc glCheckFramebufferStatusEXT*(target: TGLenum): TGLenum{.dynlib: dllname, + importc: "glCheckFramebufferStatusEXT".} +proc glFramebufferTexture1DEXT*(target: TGLenum, attachment: TGLenum, + textarget: TGLenum, texture: TGLuint, + level: TGLint){.dynlib: dllname, + importc: "glFramebufferTexture1DEXT".} +proc glFramebufferTexture2DEXT*(target: TGLenum, attachment: TGLenum, + textarget: TGLenum, texture: TGLuint, + level: TGLint){.dynlib: dllname, + importc: "glFramebufferTexture2DEXT".} +proc glFramebufferTexture3DEXT*(target: TGLenum, attachment: TGLenum, + textarget: TGLenum, texture: TGLuint, + level: TGLint, zoffset: TGLint){. + dynlib: dllname, importc: "glFramebufferTexture3DEXT".} +proc glFramebufferRenderbufferEXT*(target: TGLenum, attachment: TGLenum, + renderbuffertarget: TGLenum, + renderbuffer: TGLuint){.dynlib: dllname, + importc: "glFramebufferRenderbufferEXT".} +proc glGetFramebufferAttachmentParameterivEXT*(target: TGLenum, + attachment: TGLenum, pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glGetFramebufferAttachmentParameterivEXT".} +proc glGenerateMipmapEXT*(target: TGLenum){.dynlib: dllname, + importc: "glGenerateMipmapEXT".} + #***** GL_version_1_4 *****// +const + GL_BLEND_DST_RGB* = 0x000080C8 + GL_BLEND_SRC_RGB* = 0x000080C9 + GL_BLEND_DST_ALPHA* = 0x000080CA + GL_BLEND_SRC_ALPHA* = 0x000080CB + GL_POINT_SIZE_MIN* = 0x00008126 + GL_POINT_SIZE_MAX* = 0x00008127 + GL_POINT_FADE_THRESHOLD_SIZE* = 0x00008128 + GL_POINT_DISTANCE_ATTENUATION* = 0x00008129 + GL_GENERATE_MIPMAP* = 0x00008191 + GL_GENERATE_MIPMAP_HINT* = 0x00008192 + GL_DEPTH_COMPONENT16* = 0x000081A5 + GL_DEPTH_COMPONENT24* = 0x000081A6 + GL_DEPTH_COMPONENT32* = 0x000081A7 + GL_MIRRORED_REPEAT* = 0x00008370 + GL_FOG_COORDINATE_SOURCE* = 0x00008450 + GL_FOG_COORDINATE* = 0x00008451 + GL_FRAGMENT_DEPTH* = 0x00008452 + GL_CURRENT_FOG_COORDINATE* = 0x00008453 + GL_FOG_COORDINATE_ARRAY_TYPE* = 0x00008454 + GL_FOG_COORDINATE_ARRAY_STRIDE* = 0x00008455 + GL_FOG_COORDINATE_ARRAY_POINTER* = 0x00008456 + GL_FOG_COORDINATE_ARRAY* = 0x00008457 + GL_COLOR_SUM* = 0x00008458 + GL_CURRENT_SECONDARY_COLOR* = 0x00008459 + GL_SECONDARY_COLOR_ARRAY_SIZE* = 0x0000845A + GL_SECONDARY_COLOR_ARRAY_TYPE* = 0x0000845B + GL_SECONDARY_COLOR_ARRAY_STRIDE* = 0x0000845C + GL_SECONDARY_COLOR_ARRAY_POINTER* = 0x0000845D + GL_SECONDARY_COLOR_ARRAY* = 0x0000845E + GL_MAX_TEXTURE_LOD_BIAS* = 0x000084FD + GL_TEXTURE_FILTER_CONTROL* = 0x00008500 + GL_TEXTURE_LOD_BIAS* = 0x00008501 + GL_INCR_WRAP* = 0x00008507 + GL_DECR_WRAP* = 0x00008508 + GL_TEXTURE_DEPTH_SIZE* = 0x0000884A + GL_DEPTH_TEXTURE_MODE* = 0x0000884B + GL_TEXTURE_COMPARE_MODE* = 0x0000884C + GL_TEXTURE_COMPARE_FUNC* = 0x0000884D + GL_COMPARE_R_TO_TEXTURE* = 0x0000884E + +proc glBlendFuncSeparate*(sfactorRGB: TGLenum, dfactorRGB: TGLenum, + sfactorAlpha: TGLenum, dfactorAlpha: TGLenum){. + dynlib: dllname, importc: "glBlendFuncSeparate".} +proc glFogCoordf*(coord: TGLfloat){.dynlib: dllname, importc: "glFogCoordf".} +proc glFogCoordfv*(coord: PGLfloat){.dynlib: dllname, importc: "glFogCoordfv".} +proc glFogCoordd*(coord: TGLdouble){.dynlib: dllname, importc: "glFogCoordd".} +proc glFogCoorddv*(coord: PGLdouble){.dynlib: dllname, importc: "glFogCoorddv".} +proc glFogCoordPointer*(thetype: TGLenum, stride: TGLsizei, pointer: PGLvoid){. + dynlib: dllname, importc: "glFogCoordPointer".} +proc glMultiDrawArrays*(mode: TGLenum, first: PGLint, count: PGLsizei, + primcount: TGLsizei){.dynlib: dllname, + importc: "glMultiDrawArrays".} +proc glMultiDrawElements*(mode: TGLenum, count: PGLsizei, thetype: TGLenum, + indices: PGLvoid, primcount: TGLsizei){. + dynlib: dllname, importc: "glMultiDrawElements".} +proc glPointParameterf*(pname: TGLenum, param: TGLfloat){.dynlib: dllname, + importc: "glPointParameterf".} +proc glPointParameterfv*(pname: TGLenum, params: PGLfloat){.dynlib: dllname, + importc: "glPointParameterfv".} +proc glPointParameteri*(pname: TGLenum, param: TGLint){.dynlib: dllname, + importc: "glPointParameteri".} +proc glPointParameteriv*(pname: TGLenum, params: PGLint){.dynlib: dllname, + importc: "glPointParameteriv".} +proc glSecondaryColor3b*(red: TGLByte, green: TGLByte, blue: TGLByte){. + dynlib: dllname, importc: "glSecondaryColor3b".} +proc glSecondaryColor3bv*(v: PGLbyte){.dynlib: dllname, + importc: "glSecondaryColor3bv".} +proc glSecondaryColor3d*(red: TGLdouble, green: TGLdouble, blue: TGLdouble){. + dynlib: dllname, importc: "glSecondaryColor3d".} +proc glSecondaryColor3dv*(v: PGLdouble){.dynlib: dllname, + importc: "glSecondaryColor3dv".} +proc glSecondaryColor3f*(red: TGLfloat, green: TGLfloat, blue: TGLfloat){. + dynlib: dllname, importc: "glSecondaryColor3f".} +proc glSecondaryColor3fv*(v: PGLfloat){.dynlib: dllname, + importc: "glSecondaryColor3fv".} +proc glSecondaryColor3i*(red: TGLint, green: TGLint, blue: TGLint){. + dynlib: dllname, importc: "glSecondaryColor3i".} +proc glSecondaryColor3iv*(v: PGLint){.dynlib: dllname, + importc: "glSecondaryColor3iv".} +proc glSecondaryColor3s*(red: TGLshort, green: TGLshort, blue: TGLshort){. + dynlib: dllname, importc: "glSecondaryColor3s".} +proc glSecondaryColor3sv*(v: PGLshort){.dynlib: dllname, + importc: "glSecondaryColor3sv".} +proc glSecondaryColor3ub*(red: TGLubyte, green: TGLubyte, blue: TGLubyte){. + dynlib: dllname, importc: "glSecondaryColor3ub".} +proc glSecondaryColor3ubv*(v: PGLubyte){.dynlib: dllname, + importc: "glSecondaryColor3ubv".} +proc glSecondaryColor3ui*(red: TGLuint, green: TGLuint, blue: TGLuint){. + dynlib: dllname, importc: "glSecondaryColor3ui".} +proc glSecondaryColor3uiv*(v: PGLuint){.dynlib: dllname, + importc: "glSecondaryColor3uiv".} +proc glSecondaryColor3us*(red: TGLushort, green: TGLushort, blue: TGLushort){. + dynlib: dllname, importc: "glSecondaryColor3us".} +proc glSecondaryColor3usv*(v: PGLushort){.dynlib: dllname, + importc: "glSecondaryColor3usv".} +proc glSecondaryColorPointer*(size: TGLint, thetype: TGLenum, stride: TGLsizei, + pointer: PGLvoid){.dynlib: dllname, + importc: "glSecondaryColorPointer".} +proc glWindowPos2d*(x: TGLdouble, y: TGLdouble){.dynlib: dllname, + importc: "glWindowPos2d".} +proc glWindowPos2dv*(v: PGLdouble){.dynlib: dllname, importc: "glWindowPos2dv".} +proc glWindowPos2f*(x: TGLfloat, y: TGLfloat){.dynlib: dllname, + importc: "glWindowPos2f".} +proc glWindowPos2fv*(v: PGLfloat){.dynlib: dllname, importc: "glWindowPos2fv".} +proc glWindowPos2i*(x: TGLint, y: TGLint){.dynlib: dllname, + importc: "glWindowPos2i".} +proc glWindowPos2iv*(v: PGLint){.dynlib: dllname, importc: "glWindowPos2iv".} +proc glWindowPos2s*(x: TGLshort, y: TGLshort){.dynlib: dllname, + importc: "glWindowPos2s".} +proc glWindowPos2sv*(v: PGLshort){.dynlib: dllname, importc: "glWindowPos2sv".} +proc glWindowPos3d*(x: TGLdouble, y: TGLdouble, z: TGLdouble){.dynlib: dllname, + importc: "glWindowPos3d".} +proc glWindowPos3dv*(v: PGLdouble){.dynlib: dllname, importc: "glWindowPos3dv".} +proc glWindowPos3f*(x: TGLfloat, y: TGLfloat, z: TGLfloat){.dynlib: dllname, + importc: "glWindowPos3f".} +proc glWindowPos3fv*(v: PGLfloat){.dynlib: dllname, importc: "glWindowPos3fv".} +proc glWindowPos3i*(x: TGLint, y: TGLint, z: TGLint){.dynlib: dllname, + importc: "glWindowPos3i".} +proc glWindowPos3iv*(v: PGLint){.dynlib: dllname, importc: "glWindowPos3iv".} +proc glWindowPos3s*(x: TGLshort, y: TGLshort, z: TGLshort){.dynlib: dllname, + importc: "glWindowPos3s".} +proc glWindowPos3sv*(v: PGLshort){.dynlib: dllname, importc: "glWindowPos3sv".} + #***** GL_version_1_5 *****// +const + GL_BUFFER_SIZE* = 0x00008764 + GL_BUFFER_USAGE* = 0x00008765 + GL_QUERY_COUNTER_BITS* = 0x00008864 + GL_CURRENT_QUERY* = 0x00008865 + GL_QUERY_RESULT* = 0x00008866 + GL_QUERY_RESULT_AVAILABLE* = 0x00008867 + GL_ARRAY_BUFFER* = 0x00008892 + GL_ELEMENT_ARRAY_BUFFER* = 0x00008893 + GL_ARRAY_BUFFER_BINDING* = 0x00008894 + GL_ELEMENT_ARRAY_BUFFER_BINDING* = 0x00008895 + GL_VERTEX_ARRAY_BUFFER_BINDING* = 0x00008896 + GL_NORMAL_ARRAY_BUFFER_BINDING* = 0x00008897 + GL_COLOR_ARRAY_BUFFER_BINDING* = 0x00008898 + GL_INDEX_ARRAY_BUFFER_BINDING* = 0x00008899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING* = 0x0000889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING* = 0x0000889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING* = 0x0000889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING* = 0x0000889D + GL_WEIGHT_ARRAY_BUFFER_BINDING* = 0x0000889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING* = 0x0000889F + GL_READ_ONLY* = 0x000088B8 + GL_WRITE_ONLY* = 0x000088B9 + GL_READ_WRITE* = 0x000088BA + GL_BUFFER_ACCESS* = 0x000088BB + GL_BUFFER_MAPPED* = 0x000088BC + GL_BUFFER_MAP_POINTER* = 0x000088BD + GL_STREAM_DRAW* = 0x000088E0 + GL_STREAM_READ* = 0x000088E1 + GL_STREAM_COPY* = 0x000088E2 + GL_STATIC_DRAW* = 0x000088E4 + GL_STATIC_READ* = 0x000088E5 + GL_STATIC_COPY* = 0x000088E6 + GL_DYNAMIC_DRAW* = 0x000088E8 + GL_DYNAMIC_READ* = 0x000088E9 + GL_DYNAMIC_COPY* = 0x000088EA + GL_SAMPLES_PASSED* = 0x00008914 + GL_FOG_COORD_SRC* = 0x00008450 + GL_FOG_COORD* = 0x00008451 + GL_CURRENT_FOG_COORD* = 0x00008453 + GL_FOG_COORD_ARRAY_TYPE* = 0x00008454 + GL_FOG_COORD_ARRAY_STRIDE* = 0x00008455 + GL_FOG_COORD_ARRAY_POINTER* = 0x00008456 + GL_FOG_COORD_ARRAY* = 0x00008457 + GL_FOG_COORD_ARRAY_BUFFER_BINDING* = 0x0000889D + GL_SRC0_RGB* = 0x00008580 + GL_SRC1_RGB* = 0x00008581 + GL_SRC2_RGB* = 0x00008582 + GL_SRC0_ALPHA* = 0x00008588 + GL_SRC1_ALPHA* = 0x00008589 + GL_SRC2_ALPHA* = 0x0000858A + +proc glGenQueries*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glGenQueries".} +proc glDeleteQueries*(n: TGLsizei, ids: PGLuint){.dynlib: dllname, + importc: "glDeleteQueries".} +proc glIsQuery*(id: TGLuint): TGLboolean{.dynlib: dllname, importc: "glIsQuery".} +proc glBeginQuery*(target: TGLenum, id: TGLuint){.dynlib: dllname, + importc: "glBeginQuery".} +proc glEndQuery*(target: TGLenum){.dynlib: dllname, importc: "glEndQuery".} +proc glGetQueryiv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetQueryiv".} +proc glGetQueryObjectiv*(id: TGLuint, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetQueryObjectiv".} +proc glGetQueryObjectuiv*(id: TGLuint, pname: TGLenum, params: PGLuint){. + dynlib: dllname, importc: "glGetQueryObjectuiv".} +proc glBindBuffer*(target: TGLenum, buffer: TGLuint){.dynlib: dllname, + importc: "glBindBuffer".} +proc glDeleteBuffers*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, + importc: "glDeleteBuffers".} +proc glGenBuffers*(n: TGLsizei, buffers: PGLuint){.dynlib: dllname, + importc: "glGenBuffers".} +proc glIsBuffer*(buffer: TGLuint): TGLboolean{.dynlib: dllname, + importc: "glIsBuffer".} +proc glBufferData*(target: TGLenum, size: GLsizeiptr, data: PGLvoid, + usage: TGLenum){.dynlib: dllname, importc: "glBufferData".} +proc glBufferSubData*(target: TGLenum, offset: GLintptr, size: GLsizeiptr, + data: PGLvoid){.dynlib: dllname, + importc: "glBufferSubData".} +proc glGetBufferSubData*(target: TGLenum, offset: GLintptr, size: GLsizeiptr, + data: PGLvoid){.dynlib: dllname, + importc: "glGetBufferSubData".} +proc glMapBuffer*(target: TGLenum, access: TGLenum): PGLvoid{.dynlib: dllname, + importc: "glMapBuffer".} +proc glUnmapBuffer*(target: TGLenum): TGLboolean{.dynlib: dllname, + importc: "glUnmapBuffer".} +proc glGetBufferParameteriv*(target: TGLenum, pname: TGLenum, params: PGLint){. + dynlib: dllname, importc: "glGetBufferParameteriv".} +proc glGetBufferPointerv*(target: TGLenum, pname: TGLenum, params: PGLvoid){. + dynlib: dllname, importc: "glGetBufferPointerv".} + #***** GL_version_2_0 *****// +const + GL_BLEND_EQUATION_RGB* = 0x00008009 + GL_VERTEX_ATTRIB_ARRAY_ENABLED* = 0x00008622 + GL_VERTEX_ATTRIB_ARRAY_SIZE* = 0x00008623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE* = 0x00008624 + GL_VERTEX_ATTRIB_ARRAY_TYPE* = 0x00008625 + GL_CURRENT_VERTEX_ATTRIB* = 0x00008626 + GL_VERTEX_PROGRAM_POINT_SIZE* = 0x00008642 + GL_VERTEX_PROGRAM_TWO_SIDE* = 0x00008643 + GL_VERTEX_ATTRIB_ARRAY_POINTER* = 0x00008645 + GL_STENCIL_BACK_FUNC* = 0x00008800 + GL_STENCIL_BACK_FAIL* = 0x00008801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL* = 0x00008802 + GL_STENCIL_BACK_PASS_DEPTH_PASS* = 0x00008803 + GL_MAX_DRAW_BUFFERS* = 0x00008824 + GL_DRAW_BUFFER0* = 0x00008825 + GL_DRAW_BUFFER1* = 0x00008826 + GL_DRAW_BUFFER2* = 0x00008827 + GL_DRAW_BUFFER3* = 0x00008828 + GL_DRAW_BUFFER4* = 0x00008829 + GL_DRAW_BUFFER5* = 0x0000882A + GL_DRAW_BUFFER6* = 0x0000882B + GL_DRAW_BUFFER7* = 0x0000882C + GL_DRAW_BUFFER8* = 0x0000882D + GL_DRAW_BUFFER9* = 0x0000882E + GL_DRAW_BUFFER10* = 0x0000882F + GL_DRAW_BUFFER11* = 0x00008830 + GL_DRAW_BUFFER12* = 0x00008831 + GL_DRAW_BUFFER13* = 0x00008832 + GL_DRAW_BUFFER14* = 0x00008833 + GL_DRAW_BUFFER15* = 0x00008834 + GL_BLEND_EQUATION_ALPHA* = 0x0000883D + GL_POINT_SPRITE* = 0x00008861 + GL_COORD_REPLACE* = 0x00008862 + GL_MAX_VERTEX_ATTRIBS* = 0x00008869 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED* = 0x0000886A + GL_MAX_TEXTURE_COORDS* = 0x00008871 + GL_MAX_TEXTURE_IMAGE_UNITS* = 0x00008872 + GL_FRAGMENT_SHADER* = 0x00008B30 + GL_VERTEX_SHADER* = 0x00008B31 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS* = 0x00008B49 + GL_MAX_VERTEX_UNIFORM_COMPONENTS* = 0x00008B4A + GL_MAX_VARYING_FLOATS* = 0x00008B4B + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS* = 0x00008B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS* = 0x00008B4D + GL_SHADER_TYPE* = 0x00008B4F + GL_FLOAT_VEC2* = 0x00008B50 + GL_FLOAT_VEC3* = 0x00008B51 + GL_FLOAT_VEC4* = 0x00008B52 + GL_INT_VEC2* = 0x00008B53 + GL_INT_VEC3* = 0x00008B54 + GL_INT_VEC4* = 0x00008B55 + GL_BOOL* = 0x00008B56 + GL_BOOL_VEC2* = 0x00008B57 + GL_BOOL_VEC3* = 0x00008B58 + GL_BOOL_VEC4* = 0x00008B59 + GL_FLOAT_MAT2* = 0x00008B5A + GL_FLOAT_MAT3* = 0x00008B5B + GL_FLOAT_MAT4* = 0x00008B5C + GL_SAMPLER_1D* = 0x00008B5D + GL_SAMPLER_2D* = 0x00008B5E + GL_SAMPLER_3D* = 0x00008B5F + GL_SAMPLER_CUBE* = 0x00008B60 + GL_SAMPLER_1D_SHADOW* = 0x00008B61 + GL_SAMPLER_2D_SHADOW* = 0x00008B62 + GL_DELETE_STATUS* = 0x00008B80 + GL_COMPILE_STATUS* = 0x00008B81 + GL_LINK_STATUS* = 0x00008B82 + GL_VALIDATE_STATUS* = 0x00008B83 + GL_INFO_LOG_LENGTH* = 0x00008B84 + GL_ATTACHED_SHADERS* = 0x00008B85 + GL_ACTIVE_UNIFORMS* = 0x00008B86 + GL_ACTIVE_UNIFORM_MAX_LENGTH* = 0x00008B87 + GL_SHADER_SOURCE_LENGTH* = 0x00008B88 + GL_ACTIVE_ATTRIBUTES* = 0x00008B89 + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH* = 0x00008B8A + GL_FRAGMENT_SHADER_DERIVATIVE_HINT* = 0x00008B8B + GL_SHADING_LANGUAGE_VERSION* = 0x00008B8C + GL_CURRENT_PROGRAM* = 0x00008B8D + GL_POINT_SPRITE_COORD_ORIGIN* = 0x00008CA0 + GL_LOWER_LEFT* = 0x00008CA1 + GL_UPPER_LEFT* = 0x00008CA2 + GL_STENCIL_BACK_REF* = 0x00008CA3 + GL_STENCIL_BACK_VALUE_MASK* = 0x00008CA4 + GL_STENCIL_BACK_WRITEMASK* = 0x00008CA5 + +{.pop.} \ No newline at end of file diff --git a/lib/newwrap/opengl/glu.nim b/lib/newwrap/opengl/glu.nim new file mode 100644 index 000000000..29edb0df2 --- /dev/null +++ b/lib/newwrap/opengl/glu.nim @@ -0,0 +1,329 @@ +# +# +# 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): + 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 + +# implementation diff --git a/lib/newwrap/opengl/glut.nim b/lib/newwrap/opengl/glut.nim new file mode 100644 index 000000000..43bee3382 --- /dev/null +++ b/lib/newwrap/opengl/glut.nim @@ -0,0 +1,432 @@ +# +# +# 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 + PInteger* = ptr int + PPChar* = ptr cstring + 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: PInteger, argv: PPChar){.dynlib: dllname, + importc: "glutInit".} +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 diff --git a/lib/newwrap/opengl/glx.nim b/lib/newwrap/opengl/glx.nim new file mode 100644 index 000000000..76c052d70 --- /dev/null +++ b/lib/newwrap/opengl/glx.nim @@ -0,0 +1,153 @@ +# +# +# 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 + GLX_BUFFER_SIZE* = 2 + GLX_LEVEL* = 3 + GLX_RGBA* = 4 + GLX_DOUBLEBUFFER* = 5 + GLX_STEREO* = 6 + GLX_AUX_BUFFERS* = 7 + GLX_RED_SIZE* = 8 + GLX_GREEN_SIZE* = 9 + GLX_BLUE_SIZE* = 10 + GLX_ALPHA_SIZE* = 11 + GLX_DEPTH_SIZE* = 12 + GLX_STENCIL_SIZE* = 13 + GLX_ACCUM_RED_SIZE* = 14 + GLX_ACCUM_GREEN_SIZE* = 15 + GLX_ACCUM_BLUE_SIZE* = 16 + GLX_ACCUM_ALPHA_SIZE* = 17 # 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 diff --git a/lib/newwrap/opengl/wingl.nim b/lib/newwrap/opengl/wingl.nim new file mode 100644 index 000000000..7ed78f970 --- /dev/null +++ b/lib/newwrap/opengl/wingl.nim @@ -0,0 +1,368 @@ +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 diff --git a/lib/newwrap/pcre/pcre.nim b/lib/newwrap/pcre/pcre.nim new file mode 100644 index 000000000..c2220b4e5 --- /dev/null +++ b/lib/newwrap/pcre/pcre.nim @@ -0,0 +1,259 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +{.compile: "pcre_all.c".} +type + Pbyte = ptr byte + PPchar = ptr cstring + Pint = ptr cint + P* = ptr T + Pcallout_block* = ptr tcallout_block + Pextra* = ptr Textra + T{.final, pure.} = object + # The structure for passing additional data to pcre_exec(). This is defined + # in such as way as to be extensible. + # Bits for which fields are set + # Opaque data from pcre_study() + # Maximum number of calls to match() + # Data passed back in callouts + # Const before type ignored + # Pointer to character tables + Textra*{.final, pure.} = object # The structure for passing out data via the pcre_callout_function. We use a + # structure so that new fields can be added on the end in future versions, + # without changing the API of the function, thereby allowing old clients to + # work without modification. + # Identifies version of block + # ------------------------ Version 0 ------------------------------- + # Number compiled into pattern + # The offset vector + # Const before type ignored + # The subject being matched + # The length of the subject + # Offset to start of this match attempt + # Where we currently are in the subject + # Max current capture + # Most recently closed capture + # Data passed in with the call + # ------------------- Added for Version 1 -------------------------- + # Offset to next item in the pattern + # Length of next item in the pattern + # + # ------------------------------------------------------------------ + flags: cint + study_data: pointer + match_limit: cint + callout_data: pointer + tables: ptr byte + + Tcallout_block*{.final, pure.} = object + version: cint + callout_number: cint + offset_vector: ptr cint + subject: ptr char + subject_length: cint + start_match: cint + current_position: cint + capture_top: cint + capture_last: cint + callout_data: pointer + pattern_position: cint + next_item_length: cint + + +#************************************************ +#* Perl-Compatible Regular Expressions * +#************************************************ +# +# Modified by Andreas Rumpf for h2pas. + +# In its original form, this is the .in file that is transformed by +# "configure" into pcre.h. +# +# Copyright (c) 1997-2005 University of Cambridge +# +# ----------------------------------------------------------------------------- +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of the University of Cambridge nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- + +# The file pcre.h is build by "configure". Do not edit it; instead +# make changes to pcre.in. + +const + PCRE_MAJOR* = 6 + PCRE_MINOR* = 3 + PCRE_DATE* = "2005/11/29" + # Options + PCRE_CASELESS* = 0x00000001 + PCRE_MULTILINE* = 0x00000002 + PCRE_DOTALL* = 0x00000004 + PCRE_EXTENDED* = 0x00000008 + PCRE_ANCHORED* = 0x00000010 + PCRE_DOLLAR_ENDONLY* = 0x00000020 + PCRE_EXTRA* = 0x00000040 + PCRE_NOTBOL* = 0x00000080 + PCRE_NOTEOL* = 0x00000100 + PCRE_UNGREEDY* = 0x00000200 + PCRE_NOTEMPTY* = 0x00000400 + PCRE_UTF8* = 0x00000800 + PCRE_NO_AUTO_CAPTURE* = 0x00001000 + PCRE_NO_UTF8_CHECK* = 0x00002000 + PCRE_AUTO_CALLOUT* = 0x00004000 + PCRE_PARTIAL* = 0x00008000 + PCRE_DFA_SHORTEST* = 0x00010000 + PCRE_DFA_RESTART* = 0x00020000 + PCRE_FIRSTLINE* = 0x00040000 + # Exec-time and get/set-time error codes + PCRE_ERROR_NOMATCH* = - (1) + PCRE_ERROR_NULL* = - (2) + PCRE_ERROR_BADOPTION* = - (3) + PCRE_ERROR_BADMAGIC* = - (4) + PCRE_ERROR_UNKNOWN_NODE* = - (5) + PCRE_ERROR_NOMEMORY* = - (6) + PCRE_ERROR_NOSUBSTRING* = - (7) + PCRE_ERROR_MATCHLIMIT* = - (8) + # Never used by PCRE itself + PCRE_ERROR_CALLOUT* = - (9) + PCRE_ERROR_BADUTF8* = - (10) + PCRE_ERROR_BADUTF8_OFFSET* = - (11) + PCRE_ERROR_PARTIAL* = - (12) + PCRE_ERROR_BADPARTIAL* = - (13) + PCRE_ERROR_INTERNAL* = - (14) + PCRE_ERROR_BADCOUNT* = - (15) + PCRE_ERROR_DFA_UITEM* = - (16) + PCRE_ERROR_DFA_UCOND* = - (17) + PCRE_ERROR_DFA_UMLIMIT* = - (18) + PCRE_ERROR_DFA_WSSIZE* = - (19) + PCRE_ERROR_DFA_RECURSE* = - (20) + # Request types for pcre_fullinfo() + PCRE_INFO_OPTIONS* = 0 + PCRE_INFO_SIZE* = 1 + PCRE_INFO_CAPTURECOUNT* = 2 + PCRE_INFO_BACKREFMAX* = 3 + PCRE_INFO_FIRSTBYTE* = 4 + # For backwards compatibility + PCRE_INFO_FIRSTCHAR* = 4 + PCRE_INFO_FIRSTTABLE* = 5 + PCRE_INFO_LASTLITERAL* = 6 + PCRE_INFO_NAMEENTRYSIZE* = 7 + PCRE_INFO_NAMECOUNT* = 8 + PCRE_INFO_NAMETABLE* = 9 + PCRE_INFO_STUDYSIZE* = 10 + PCRE_INFO_DEFAULT_TABLES* = 11 + # Request types for pcre_config() + PCRE_CONFIG_UTF8* = 0 + PCRE_CONFIG_NEWLINE* = 1 + PCRE_CONFIG_LINK_SIZE* = 2 + PCRE_CONFIG_POSIX_MALLOC_THRESHOLD* = 3 + PCRE_CONFIG_MATCH_LIMIT* = 4 + PCRE_CONFIG_STACKRECURSE* = 5 + PCRE_CONFIG_UNICODE_PROPERTIES* = 6 + # Bit flags for the pcre_extra structure + PCRE_EXTRA_STUDY_DATA* = 0x00000001 + PCRE_EXTRA_MATCH_LIMIT* = 0x00000002 + PCRE_EXTRA_CALLOUT_DATA* = 0x00000004 + PCRE_EXTRA_TABLES* = 0x00000008 + +# Exported PCRE functions + +proc pcre_compile*(para1: cstring, para2: cint, para3: ptr cstring, + para4: ptr int, para5: Pbyte): P{.importc: "pcre_compile", + noconv.} +proc pcre_compile2*(para1: cstring, para2: cint, para3: Pint, para4: PPchar, + para5: ptr int, para6: Pbyte): P{.importc: "pcre_compile2", + noconv.} +proc pcre_config*(para1: cint, para2: pointer): cint{.importc: "pcre_config", + noconv.} +proc pcre_copy_named_substring*(para1: P, para2: cstring, para3: Pint, + para4: cint, para5: cstring, para6: cstring, + para7: cint): cint{. + importc: "pcre_copy_named_substring", noconv.} +proc pcre_copy_substring*(para1: cstring, para2: Pint, para3: cint, para4: cint, + para5: cstring, para6: cint): cint{. + importc: "pcre_copy_substring", noconv.} +proc pcre_dfa_exec*(para1: P, para2: Pextra, para3: cstring, para4: cint, + para5: cint, para6: cint, para7: Pint, para8: cint, + para9: Pint, para10: cint): cint{.importc: "pcre_dfa_exec", + noconv.} +proc pcre_exec*(para1: P, para2: Pextra, para3: cstring, para4: cint, + para5: cint, para6: cint, para7: Pint, para8: cint): cint{. + importc: "pcre_exec", noconv.} +proc pcre_free_substring*(para1: cstring){.importc: "pcre_free_substring", + noconv.} +proc pcre_free_substring_list*(para1: PPchar){. + importc: "pcre_free_substring_list", noconv.} +proc pcre_fullinfo*(para1: P, para2: Pextra, para3: cint, para4: pointer): cint{. + importc: "pcre_fullinfo", noconv.} +proc pcre_get_named_substring*(para1: P, para2: cstring, para3: Pint, + para4: cint, para5: cstring, para6: PPchar): cint{. + importc: "pcre_get_named_substring", noconv.} +proc pcre_get_stringnumber*(para1: P, para2: cstring): cint{. + importc: "pcre_get_stringnumber", noconv.} +proc pcre_get_substring*(para1: cstring, para2: Pint, para3: cint, para4: cint, + para5: PPchar): cint{.importc: "pcre_get_substring", + noconv.} +proc pcre_get_substring_list*(para1: cstring, para2: Pint, para3: cint, + para4: ptr PPchar): cint{. + importc: "pcre_get_substring_list", noconv.} +proc pcre_info*(para1: P, para2: Pint, para3: Pint): cint{.importc: "pcre_info", + noconv.} +proc pcre_maketables*(): ptr byte{.importc: "pcre_maketables", noconv.} +proc pcre_refcount*(para1: P, para2: cint): cint{.importc: "pcre_refcount", + noconv.} +proc pcre_study*(para1: P, para2: cint, para3: ptr CString): Pextra{. + importc: "pcre_study", noconv.} +proc pcre_version*(): CString{.importc: "pcre_version", noconv.} +# Indirection for store get and free functions. These can be set to +# alternative malloc/free functions if required. Special ones are used in the +# non-recursive case for "frames". There is also an optional callout function +# that is triggered by the (?) regex item. +# + +# we use Nimrod's memory manager (but not GC!) for these functions: + +type + TMalloc = proc (para1: int): pointer{.noconv.} + TFree = proc (para1: pointer){.noconv.} + +var + pcre_malloc{.importc: "pcre_malloc".}: TMalloc + pcre_free{.importc: "pcre_free".}: TFree + pcre_stack_malloc{.importc: "pcre_stack_malloc".}: TMalloc + pcre_stack_free{.importc: "pcre_stack_free".}: TFree + pcre_callout{.importc: "pcre_callout".}: proc (para1: Pcallout_block): cint{. + noconv.} + +pcre_malloc = cast[TMalloc](system.alloc) +pcre_free = cast[TFree](system.dealloc) +pcre_stack_malloc = cast[TMalloc](system.alloc) +pcre_stack_free = cast[TFree](system.dealloc) +pcre_callout = nil \ No newline at end of file diff --git a/lib/newwrap/postgres.nim b/lib/newwrap/postgres.nim new file mode 100644 index 000000000..cdb4a7283 --- /dev/null +++ b/lib/newwrap/postgres.nim @@ -0,0 +1,348 @@ +# This module contains the definitions for structures and externs for +# functions used by frontend postgres applications. It is based on +# Postgresql's libpq-fe.h. +# +# It is for postgreSQL version 7.4 and higher with support for the v3.0 +# connection-protocol. +# + +when defined(windows): + const + dllName = "pq.dll" +elif defined(macosx): + const + dllName = "libpq.dylib" +else: + const + dllName = "libpq.so(.5|)" +type + POid* = ptr Oid + Oid* = int32 + +const + ERROR_MSG_LENGTH* = 4096 + CMDSTATUS_LEN* = 40 + +type + TSockAddr* = array[1..112, int8] + TPGresAttDesc*{.pure, final.} = object + name*: cstring + adtid*: Oid + adtsize*: int + + PPGresAttDesc* = ptr TPGresAttDesc + PPPGresAttDesc* = ptr PPGresAttDesc + TPGresAttValue*{.pure, final.} = object + length*: int32 + value*: cstring + + PPGresAttValue* = ptr TPGresAttValue + PPPGresAttValue* = ptr PPGresAttValue + PExecStatusType* = ptr TExecStatusType + TExecStatusType* = enum + PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT, + PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR + TPGlobjfuncs*{.pure, final.} = object + fn_lo_open*: Oid + fn_lo_close*: Oid + fn_lo_creat*: Oid + fn_lo_unlink*: Oid + fn_lo_lseek*: Oid + fn_lo_tell*: Oid + fn_lo_read*: Oid + fn_lo_write*: Oid + + PPGlobjfuncs* = ptr TPGlobjfuncs + PConnStatusType* = ptr TConnStatusType + TConnStatusType* = enum + CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE, + CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV, + CONNECTION_SSL_STARTUP, CONNECTION_NEEDED + TPGconn*{.pure, final.} = object + pghost*: cstring + pgtty*: cstring + pgport*: cstring + pgoptions*: cstring + dbName*: cstring + status*: TConnStatusType + errorMessage*: array[0..(ERROR_MSG_LENGTH) - 1, char] + Pfin*: TFile + Pfout*: TFile + Pfdebug*: TFile + sock*: int32 + laddr*: TSockAddr + raddr*: TSockAddr + salt*: array[0..(2) - 1, char] + asyncNotifyWaiting*: int32 + notifyList*: pointer + pguser*: cstring + pgpass*: cstring + lobjfuncs*: PPGlobjfuncs + + PPGconn* = ptr TPGconn + TPGresult*{.pure, final.} = object + ntups*: int32 + numAttributes*: int32 + attDescs*: PPGresAttDesc + tuples*: PPPGresAttValue + tupArrSize*: int32 + resultStatus*: TExecStatusType + cmdStatus*: array[0..(CMDSTATUS_LEN) - 1, char] + binary*: int32 + conn*: PPGconn + + PPGresult* = ptr TPGresult + PPostgresPollingStatusType* = ptr PostgresPollingStatusType + PostgresPollingStatusType* = enum + PGRES_POLLING_FAILED = 0, PGRES_POLLING_READING, PGRES_POLLING_WRITING, + PGRES_POLLING_OK, PGRES_POLLING_ACTIVE + PPGTransactionStatusType* = ptr PGTransactionStatusType + PGTransactionStatusType* = enum + PQTRANS_IDLE, PQTRANS_ACTIVE, PQTRANS_INTRANS, PQTRANS_INERROR, + PQTRANS_UNKNOWN + PPGVerbosity* = ptr PGVerbosity + PGVerbosity* = enum + PQERRORS_TERSE, PQERRORS_DEFAULT, PQERRORS_VERBOSE + PpgNotify* = ptr pgNotify + pgNotify*{.pure, final.} = object + relname*: cstring + be_pid*: int32 + extra*: cstring + + PQnoticeReceiver* = proc (arg: pointer, res: PPGresult){.cdecl.} + PQnoticeProcessor* = proc (arg: pointer, message: cstring){.cdecl.} + Ppqbool* = ptr pqbool + pqbool* = char + P_PQprintOpt* = ptr PQprintOpt + PQprintOpt*{.pure, final.} = object + header*: pqbool + align*: pqbool + standard*: pqbool + html3*: pqbool + expanded*: pqbool + pager*: pqbool + fieldSep*: cstring + tableOpt*: cstring + caption*: cstring + fieldName*: ptr cstring + + P_PQconninfoOption* = ptr PQconninfoOption + PQconninfoOption*{.pure, final.} = object + keyword*: cstring + envvar*: cstring + compiled*: cstring + val*: cstring + label*: cstring + dispchar*: cstring + dispsize*: int32 + + PPQArgBlock* = ptr PQArgBlock + PQArgBlock*{.pure, final.} = object + length*: int32 + isint*: int32 + p*: pointer + + +proc PQconnectStart*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName, + importc: "PQconnectStart".} +proc PQconnectPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl, + dynlib: dllName, importc: "PQconnectPoll".} +proc PQconnectdb*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName, + importc: "PQconnectdb".} +proc PQsetdbLogin*(pghost: cstring, pgport: cstring, pgoptions: cstring, + pgtty: cstring, dbName: cstring, login: cstring, pwd: cstring): PPGconn{. + cdecl, dynlib: dllName, importc: "PQsetdbLogin".} +proc PQsetdb*(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): ppgconn +proc PQfinish*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQfinish".} +proc PQconndefaults*(): PPQconninfoOption{.cdecl, dynlib: dllName, + importc: "PQconndefaults".} +proc PQconninfoFree*(connOptions: PPQconninfoOption){.cdecl, dynlib: dllName, + importc: "PQconninfoFree".} +proc PQresetStart*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQresetStart".} +proc PQresetPoll*(conn: PPGconn): PostgresPollingStatusType{.cdecl, + dynlib: dllName, importc: "PQresetPoll".} +proc PQreset*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQreset".} +proc PQrequestCancel*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQrequestCancel".} +proc PQdb*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQdb".} +proc PQuser*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQuser".} +proc PQpass*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQpass".} +proc PQhost*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQhost".} +proc PQport*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQport".} +proc PQtty*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, importc: "PQtty".} +proc PQoptions*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, + importc: "PQoptions".} +proc PQstatus*(conn: PPGconn): TConnStatusType{.cdecl, dynlib: dllName, + importc: "PQstatus".} +proc PQtransactionStatus*(conn: PPGconn): PGTransactionStatusType{.cdecl, + dynlib: dllName, importc: "PQtransactionStatus".} +proc PQparameterStatus*(conn: PPGconn, paramName: cstring): cstring{.cdecl, + dynlib: dllName, importc: "PQparameterStatus".} +proc PQprotocolVersion*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQprotocolVersion".} +proc PQerrorMessage*(conn: PPGconn): cstring{.cdecl, dynlib: dllName, + importc: "PQerrorMessage".} +proc PQsocket*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQsocket".} +proc PQbackendPID*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQbackendPID".} +proc PQclientEncoding*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQclientEncoding".} +proc PQsetClientEncoding*(conn: PPGconn, encoding: cstring): int32{.cdecl, + dynlib: dllName, importc: "PQsetClientEncoding".} +when defined(USE_SSL): + # Get the SSL structure associated with a connection + proc PQgetssl*(conn: PPGconn): PSSL{.cdecl, dynlib: dllName, + importc: "PQgetssl".} +proc PQsetErrorVerbosity*(conn: PPGconn, verbosity: PGVerbosity): PGVerbosity{. + cdecl, dynlib: dllName, importc: "PQsetErrorVerbosity".} +proc PQtrace*(conn: PPGconn, debug_port: TFile){.cdecl, dynlib: dllName, + importc: "PQtrace".} +proc PQuntrace*(conn: PPGconn){.cdecl, dynlib: dllName, importc: "PQuntrace".} +proc PQsetNoticeReceiver*(conn: PPGconn, theProc: PQnoticeReceiver, arg: pointer): PQnoticeReceiver{. + cdecl, dynlib: dllName, importc: "PQsetNoticeReceiver".} +proc PQsetNoticeProcessor*(conn: PPGconn, theProc: PQnoticeProcessor, + arg: pointer): PQnoticeProcessor{.cdecl, + dynlib: dllName, importc: "PQsetNoticeProcessor".} +proc PQexec*(conn: PPGconn, query: cstring): PPGresult{.cdecl, dynlib: dllName, + importc: "PQexec".} +proc PQexecParams*(conn: PPGconn, command: cstring, nParams: int32, + paramTypes: POid, paramValues: cstringArray, + paramLengths, paramFormats: ptr int32, resultFormat: int32): PPGresult{. + cdecl, dynlib: dllName, importc: "PQexecParams".} +proc PQexecPrepared*(conn: PPGconn, stmtName: cstring, nParams: int32, + paramValues: cstringArray, + paramLengths, paramFormats: ptr int32, resultFormat: int32): PPGresult{. + cdecl, dynlib: dllName, importc: "PQexecPrepared".} +proc PQsendQuery*(conn: PPGconn, query: cstring): int32{.cdecl, dynlib: dllName, + importc: "PQsendQuery".} +proc PQsendQueryParams*(conn: PPGconn, command: cstring, nParams: int32, + paramTypes: POid, paramValues: cstringArray, + paramLengths, paramFormats: ptr int32, + resultFormat: int32): int32{.cdecl, dynlib: dllName, + importc: "PQsendQueryParams".} +proc PQsendQueryPrepared*(conn: PPGconn, stmtName: cstring, nParams: int32, + paramValues: cstringArray, + paramLengths, paramFormats: ptr int32, + resultFormat: int32): int32{.cdecl, dynlib: dllName, + importc: "PQsendQueryPrepared".} +proc PQgetResult*(conn: PPGconn): PPGresult{.cdecl, dynlib: dllName, + importc: "PQgetResult".} +proc PQisBusy*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQisBusy".} +proc PQconsumeInput*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQconsumeInput".} +proc PQnotifies*(conn: PPGconn): PPGnotify{.cdecl, dynlib: dllName, + importc: "PQnotifies".} +proc PQputCopyData*(conn: PPGconn, buffer: cstring, nbytes: int32): int32{. + cdecl, dynlib: dllName, importc: "PQputCopyData".} +proc PQputCopyEnd*(conn: PPGconn, errormsg: cstring): int32{.cdecl, + dynlib: dllName, importc: "PQputCopyEnd".} +proc PQgetCopyData*(conn: PPGconn, buffer: cstringArray, async: int32): int32{. + cdecl, dynlib: dllName, importc: "PQgetCopyData".} +proc PQgetline*(conn: PPGconn, str: cstring, len: int32): int32{.cdecl, + dynlib: dllName, importc: "PQgetline".} +proc PQputline*(conn: PPGconn, str: cstring): int32{.cdecl, dynlib: dllName, + importc: "PQputline".} +proc PQgetlineAsync*(conn: PPGconn, buffer: cstring, bufsize: int32): int32{. + cdecl, dynlib: dllName, importc: "PQgetlineAsync".} +proc PQputnbytes*(conn: PPGconn, buffer: cstring, nbytes: int32): int32{.cdecl, + dynlib: dllName, importc: "PQputnbytes".} +proc PQendcopy*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQendcopy".} +proc PQsetnonblocking*(conn: PPGconn, arg: int32): int32{.cdecl, + dynlib: dllName, importc: "PQsetnonblocking".} +proc PQisnonblocking*(conn: PPGconn): int32{.cdecl, dynlib: dllName, + importc: "PQisnonblocking".} +proc PQflush*(conn: PPGconn): int32{.cdecl, dynlib: dllName, importc: "PQflush".} +proc PQfn*(conn: PPGconn, fnid: int32, result_buf, result_len: ptr int32, + result_is_int: int32, args: PPQArgBlock, nargs: int32): PPGresult{. + cdecl, dynlib: dllName, importc: "PQfn".} +proc PQresultStatus*(res: PPGresult): TExecStatusType{.cdecl, dynlib: dllName, + importc: "PQresultStatus".} +proc PQresStatus*(status: TExecStatusType): cstring{.cdecl, dynlib: dllName, + importc: "PQresStatus".} +proc PQresultErrorMessage*(res: PPGresult): cstring{.cdecl, dynlib: dllName, + importc: "PQresultErrorMessage".} +proc PQresultErrorField*(res: PPGresult, fieldcode: int32): cstring{.cdecl, + dynlib: dllName, importc: "PQresultErrorField".} +proc PQntuples*(res: PPGresult): int32{.cdecl, dynlib: dllName, + importc: "PQntuples".} +proc PQnfields*(res: PPGresult): int32{.cdecl, dynlib: dllName, + importc: "PQnfields".} +proc PQbinaryTuples*(res: PPGresult): int32{.cdecl, dynlib: dllName, + importc: "PQbinaryTuples".} +proc PQfname*(res: PPGresult, field_num: int32): cstring{.cdecl, + dynlib: dllName, importc: "PQfname".} +proc PQfnumber*(res: PPGresult, field_name: cstring): int32{.cdecl, + dynlib: dllName, importc: "PQfnumber".} +proc PQftable*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName, + importc: "PQftable".} +proc PQftablecol*(res: PPGresult, field_num: int32): int32{.cdecl, + dynlib: dllName, importc: "PQftablecol".} +proc PQfformat*(res: PPGresult, field_num: int32): int32{.cdecl, + dynlib: dllName, importc: "PQfformat".} +proc PQftype*(res: PPGresult, field_num: int32): Oid{.cdecl, dynlib: dllName, + importc: "PQftype".} +proc PQfsize*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName, + importc: "PQfsize".} +proc PQfmod*(res: PPGresult, field_num: int32): int32{.cdecl, dynlib: dllName, + importc: "PQfmod".} +proc PQcmdStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName, + importc: "PQcmdStatus".} +proc PQoidStatus*(res: PPGresult): cstring{.cdecl, dynlib: dllName, + importc: "PQoidStatus".} +proc PQoidValue*(res: PPGresult): Oid{.cdecl, dynlib: dllName, + importc: "PQoidValue".} +proc PQcmdTuples*(res: PPGresult): cstring{.cdecl, dynlib: dllName, + importc: "PQcmdTuples".} +proc PQgetvalue*(res: PPGresult, tup_num: int32, field_num: int32): cstring{. + cdecl, dynlib: dllName, importc: "PQgetvalue".} +proc PQgetlength*(res: PPGresult, tup_num: int32, field_num: int32): int32{. + cdecl, dynlib: dllName, importc: "PQgetlength".} +proc PQgetisnull*(res: PPGresult, tup_num: int32, field_num: int32): int32{. + cdecl, dynlib: dllName, importc: "PQgetisnull".} +proc PQclear*(res: PPGresult){.cdecl, dynlib: dllName, importc: "PQclear".} +proc PQfreemem*(p: pointer){.cdecl, dynlib: dllName, importc: "PQfreemem".} +proc PQmakeEmptyPGresult*(conn: PPGconn, status: TExecStatusType): PPGresult{. + cdecl, dynlib: dllName, importc: "PQmakeEmptyPGresult".} +proc PQescapeString*(till, `from`: cstring, len: int): int{.cdecl, + dynlib: dllName, importc: "PQescapeString".} +proc PQescapeBytea*(bintext: cstring, binlen: int, bytealen: var int): cstring{. + cdecl, dynlib: dllName, importc: "PQescapeBytea".} +proc PQunescapeBytea*(strtext: cstring, retbuflen: var int): cstring{.cdecl, + dynlib: dllName, importc: "PQunescapeBytea".} +proc PQprint*(fout: TFile, res: PPGresult, ps: PPQprintOpt){.cdecl, + dynlib: dllName, importc: "PQprint".} +proc PQdisplayTuples*(res: PPGresult, fp: TFile, fillAlign: int32, + fieldSep: cstring, printHeader: int32, quiet: int32){. + cdecl, dynlib: dllName, importc: "PQdisplayTuples".} +proc PQprintTuples*(res: PPGresult, fout: TFile, printAttName: int32, + terseOutput: int32, width: int32){.cdecl, dynlib: dllName, + importc: "PQprintTuples".} +proc lo_open*(conn: PPGconn, lobjId: Oid, mode: int32): int32{.cdecl, + dynlib: dllName, importc: "lo_open".} +proc lo_close*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName, + importc: "lo_close".} +proc lo_read*(conn: PPGconn, fd: int32, buf: cstring, length: int): int32{. + cdecl, dynlib: dllName, importc: "lo_read".} +proc lo_write*(conn: PPGconn, fd: int32, buf: cstring, length: int): int32{. + cdecl, dynlib: dllName, importc: "lo_write".} +proc lo_lseek*(conn: PPGconn, fd: int32, offset: int32, whence: int32): int32{. + cdecl, dynlib: dllName, importc: "lo_lseek".} +proc lo_creat*(conn: PPGconn, mode: int32): Oid{.cdecl, dynlib: dllName, + importc: "lo_creat".} +proc lo_tell*(conn: PPGconn, fd: int32): int32{.cdecl, dynlib: dllName, + importc: "lo_tell".} +proc lo_unlink*(conn: PPGconn, lobjId: Oid): int32{.cdecl, dynlib: dllName, + importc: "lo_unlink".} +proc lo_import*(conn: PPGconn, filename: cstring): Oid{.cdecl, dynlib: dllName, + importc: "lo_import".} +proc lo_export*(conn: PPGconn, lobjId: Oid, filename: cstring): int32{.cdecl, + dynlib: dllName, importc: "lo_export".} +proc PQmblen*(s: cstring, encoding: int32): int32{.cdecl, dynlib: dllName, + importc: "PQmblen".} +proc PQenv2encoding*(): int32{.cdecl, dynlib: dllName, importc: "PQenv2encoding".} +proc PQsetdb(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): ppgconn = + result = PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, "", "") diff --git a/lib/newwrap/sdl/sdl.nim b/lib/newwrap/sdl/sdl.nim new file mode 100644 index 000000000..40f2fafff --- /dev/null +++ b/lib/newwrap/sdl/sdl.nim @@ -0,0 +1,2583 @@ +#****************************************************************************** +# +# JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer +# Conversion of the Simple DirectMedia Layer Headers +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997-2004 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : SDL.h +# SDL_main.h +# SDL_types.h +# SDL_rwops.h +# SDL_timer.h +# SDL_audio.h +# SDL_cdrom.h +# SDL_joystick.h +# SDL_mouse.h +# SDL_keyboard.h +# SDL_events.h +# SDL_video.h +# SDL_byteorder.h +# SDL_version.h +# SDL_active.h +# SDL_thread.h +# SDL_mutex .h +# SDL_getenv.h +# SDL_loadso.h +# +# The initial developer of this Pascal code was : +# Dominique Louis <Dominique@SavageSoftware.com.au> +# +# Portions created by Dominique Louis are +# Copyright (C) 2000 - 2004 Dominique Louis. +# +# +# Contributor(s) +# -------------- +# Tom Jones <tigertomjones@gmx.de> His Project inspired this conversion +# Matthias Thoma <ma.thoma@gmx.de> +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# +# +# +# +# +# +# +# Requires +# -------- +# The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL.so +# They are available from... +# http://www.libsdl.org . +# +# Programming Notes +# ----------------- +# +# +# +# +# Revision History +# ---------------- +# May 08 2001 - DL : Added Keyboard State Array ( See demos for how to +# use ) +# PKeyStateArr = ^TKeyStateArr; +# TKeyStateArr = array[0..65000] of UInt8; +# As most games will need it. +# +# April 02 2001 - DL : Added SDL_getenv.h definitions and tested version +# 1.2.0 compatability. +# +# March 13 2001 - MT : Added Linux compatibility. +# +# March 10 2001 - MT : Added externalsyms for DEFINES +# Changed the license header +# +# March 09 2001 - MT : Added Kylix Ifdefs/Deleted the uses mmsystem +# +# March 01 2001 - DL : Update conversion of version 1.1.8 +# +# July 22 2001 - DL : Added TUInt8Array and PUIntArray after suggestions +# from Matthias Thoma and Eric Grange. +# +# October 12 2001 - DL : Various changes as suggested by Matthias Thoma and +# David Acklam +# +# October 24 2001 - DL : Added FreePascal support as per suggestions from +# Dean Ellis. +# +# October 27 2001 - DL : Added SDL_BUTTON macro +# +# November 08 2001 - DL : Bug fix as pointed out by Puthoon. +# +# November 29 2001 - DL : Bug fix of SDL_SetGammaRamp as pointed out by Simon +# Rushton. +# +# November 30 2001 - DL : SDL_NOFRAME added as pointed out by Simon Rushton. +# +# December 11 2001 - DL : Added $WEAKPACKAGEUNIT ON to facilitate useage in +# Components +# +# January 05 2002 - DL : Added SDL_Swap32 function as suggested by Matthias +# Thoma and also made sure the _getenv from +# MSVCRT.DLL uses the right calling convention +# +# January 25 2002 - DL : Updated conversion of SDL_AddTimer & +# SDL_RemoveTimer as per suggestions from Matthias +# Thoma. +# +# January 27 2002 - DL : Commented out exported function putenv and getenv +# So that developers get used to using SDL_putenv +# SDL_getenv, as they are more portable +# +# March 05 2002 - DL : Added FreeAnNil procedure for Delphi 4 users. +# +# October 23 2002 - DL : Added Delphi 3 Define of Win32. +# If you intend to you Delphi 3... +# ( which is officially unsupported ) make sure you +# remove references to $EXTERNALSYM in this and other +# SDL files. +# +# November 29 2002 - DL : Fixed bug in Declaration of SDL_GetRGBA that was +# pointed out by Todd Lang +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# +# Revision 1.31 2007/05/29 21:30:48 savage +# Changes as suggested by Almindor for 64bit compatibility. +# +# Revision 1.30 2007/05/29 19:31:03 savage +# Fix to TSDL_Overlay structure - thanks David Pethes (aka imcold) +# +# Revision 1.29 2007/05/20 20:29:11 savage +# Initial Changes to Handle 64 Bits +# +# Revision 1.26 2007/02/11 13:38:04 savage +# Added Nintendo DS support - Thanks Dean. +# +# Revision 1.25 2006/12/02 00:12:52 savage +# Updated to latest version +# +# Revision 1.24 2006/05/18 21:10:04 savage +# Added 1.2.10 Changes +# +# Revision 1.23 2005/12/04 23:17:52 drellis +# Added declaration of SInt8 and PSInt8 +# +# Revision 1.22 2005/05/24 21:59:03 savage +# Re-arranged uses clause to work on Win32 and Linux, Thanks again Michalis. +# +# Revision 1.21 2005/05/22 18:42:31 savage +# Changes as suggested by Michalis Kamburelis. Thanks again. +# +# Revision 1.20 2005/04/10 11:48:33 savage +# Changes as suggested by Michalis, thanks. +# +# Revision 1.19 2005/01/05 01:47:06 savage +# Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively. +# +# Revision 1.18 2005/01/04 23:14:41 savage +# Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively. +# +# Revision 1.17 2005/01/03 18:40:59 savage +# Updated Version number to reflect latest one +# +# Revision 1.16 2005/01/01 02:02:06 savage +# Updated to v1.2.8 +# +# Revision 1.15 2004/12/24 18:57:11 savage +# forgot to apply Michalis Kamburelis' patch to the implementation section. now fixed +# +# Revision 1.14 2004/12/23 23:42:18 savage +# Applied Patches supplied by Michalis Kamburelis ( THANKS! ), for greater FreePascal compatability. +# +# Revision 1.13 2004/09/30 22:31:59 savage +# Updated with slightly different header comments +# +# Revision 1.12 2004/09/12 21:52:58 savage +# Slight changes to fix some issues with the sdl classes. +# +# Revision 1.11 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.10 2004/07/20 23:57:33 savage +# Thanks to Paul Toth for spotting an error in the SDL Audio Convertion structures. +# In TSDL_AudioCVT the filters variable should point to and array of pointers and not what I had there previously. +# +# Revision 1.9 2004/07/03 22:07:22 savage +# Added Bitwise Manipulation Functions for TSDL_VideoInfo struct. +# +# Revision 1.8 2004/05/10 14:10:03 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.7 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.6 2004/04/01 20:53:23 savage +# Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.5 2004/02/22 15:32:10 savage +# SDL_GetEnv Fix so it also works on FPC/Linux. Thanks to Rodrigo for pointing this out. +# +# Revision 1.4 2004/02/21 23:24:29 savage +# SDL_GetEnv Fix so that it is not define twice for FPC. Thanks to Rene Hugentobler for pointing out this bug, +# +# Revision 1.3 2004/02/18 22:35:51 savage +# Brought sdl.pas up to 1.2.7 compatability +# Thus... +# Added SDL_GL_STEREO, +# SDL_GL_MULTISAMPLEBUFFERS, +# SDL_GL_MULTISAMPLESAMPLES +# +# Add DLL/Shared object functions +# function SDL_LoadObject( const sofile : PChar ) : Pointer; +# +# function SDL_LoadFunction( handle : Pointer; const name : PChar ) : Pointer; +# +# procedure SDL_UnloadObject( handle : Pointer ); +# +# Added function to create RWops from const memory: SDL_RWFromConstMem() +# function SDL_RWFromConstMem(const mem: Pointer; size: Integer) : PSDL_RWops; +# +# Ported SDL_cpuinfo.h so Now you can test for Specific CPU types. +# +# Revision 1.2 2004/02/17 21:37:12 savage +# Tidying up of units +# +# Revision 1.1 2004/02/05 00:08:20 savage +# Module 1.0 release +# +# + +{.deadCodeElim: on.} +when defined(windows): + const + LibName = "SDL.dll" +elif defined(macosx): + const + LibName = "libSDL-1.2.0.dylib" +else: + const + LibName = "libSDL.so" +const + MAJOR_VERSION* = 1'i8 + MINOR_VERSION* = 2'i8 + PATCHLEVEL* = 11'i8 # SDL.h constants + INIT_TIMER* = 0x00000001 + INIT_AUDIO* = 0x00000010 + INIT_VIDEO* = 0x00000020 + INIT_CDROM* = 0x00000100 + INIT_JOYSTICK* = 0x00000200 + INIT_NOPARACHUTE* = 0x00100000 # Don't catch fatal signals + INIT_EVENTTHREAD* = 0x01000000 # Not supported on all OS's + INIT_EVERYTHING* = 0x0000FFFF # SDL_error.h constants + ERR_MAX_STRLEN* = 128 + ERR_MAX_ARGS* = 5 # SDL_types.h constants + PRESSED* = 0x00000001 + RELEASED* = 0x00000000 # SDL_timer.h constants + # This is the OS scheduler timeslice, in milliseconds + TIMESLICE* = 10 # This is the maximum resolution of the SDL timer on all platforms + TIMER_RESOLUTION* = 10 # Experimentally determined + # SDL_audio.h constants + AUDIO_U8* = 0x00000008 # Unsigned 8-bit samples + AUDIO_S8* = 0x00008008 # Signed 8-bit samples + AUDIO_U16LSB* = 0x00000010 # Unsigned 16-bit samples + AUDIO_S16LSB* = 0x00008010 # Signed 16-bit samples + AUDIO_U16MSB* = 0x00001010 # As above, but big-endian byte order + AUDIO_S16MSB* = 0x00009010 # As above, but big-endian byte order + AUDIO_U16* = AUDIO_U16LSB + AUDIO_S16* = AUDIO_S16LSB # SDL_cdrom.h constants + # The maximum number of CD-ROM tracks on a disk + MAX_TRACKS* = 99 # The types of CD-ROM track possible + AUDIO_TRACK* = 0x00000000 + DATA_TRACK* = 0x00000004 # Conversion functions from frames to Minute/Second/Frames and vice versa + CD_FPS* = 75 # SDL_byteorder.h constants + # The two types of endianness + LIL_ENDIAN* = 1234 + BIG_ENDIAN* = 4321 + +when cpuEndian == littleEndian: + const + BYTEORDER* = LIL_ENDIAN # Native audio byte ordering + AUDIO_U16SYS* = AUDIO_U16LSB + AUDIO_S16SYS* = AUDIO_S16LSB +else: + const + BYTEORDER* = BIG_ENDIAN # Native audio byte ordering + AUDIO_U16SYS* = AUDIO_U16MSB + AUDIO_S16SYS* = AUDIO_S16MSB +const + MIX_MAXVOLUME* = 128 # SDL_joystick.h constants + MAX_JOYSTICKS* = 2 # only 2 are supported in the multimedia API + MAX_AXES* = 6 # each joystick can have up to 6 axes + MAX_BUTTONS* = 32 # and 32 buttons + AXIS_MIN* = - 32768 # minimum value for axis coordinate + AXIS_MAX* = 32767 # maximum value for axis coordinate + JOY_AXIS_THRESHOLD* = (toFloat((AXIS_MAX) - (AXIS_MIN)) / 100.000) # 1% motion + HAT_CENTERED* = 0x00000000 + HAT_UP* = 0x00000001 + HAT_RIGHT* = 0x00000002 + HAT_DOWN* = 0x00000004 + HAT_LEFT* = 0x00000008 + HAT_RIGHTUP* = HAT_RIGHT or HAT_UP + HAT_RIGHTDOWN* = HAT_RIGHT or HAT_DOWN + HAT_LEFTUP* = HAT_LEFT or HAT_UP + HAT_LEFTDOWN* = HAT_LEFT or HAT_DOWN # SDL_events.h constants + +type + TEventKind* = enum # kind of an SDL event + NOEVENT = 0, # Unused (do not remove) + ACTIVEEVENT = 1, # Application loses/gains visibility + KEYDOWN = 2, # Keys pressed + KEYUP = 3, # Keys released + MOUSEMOTION = 4, # Mouse moved + MOUSEBUTTONDOWN = 5, # Mouse button pressed + MOUSEBUTTONUP = 6, # Mouse button released + JOYAXISMOTION = 7, # Joystick axis motion + JOYBALLMOTION = 8, # Joystick trackball motion + JOYHATMOTION = 9, # Joystick hat position change + JOYBUTTONDOWN = 10, # Joystick button pressed + JOYBUTTONUP = 11, # Joystick button released + QUITEV = 12, # User-requested quit ( Changed due to procedure conflict ) + SYSWMEVENT = 13, # System specific event + EVENT_RESERVEDA = 14, # Reserved for future use.. + EVENT_RESERVED = 15, # Reserved for future use.. + VIDEORESIZE = 16, # User resized video mode + VIDEOEXPOSE = 17, # Screen needs to be redrawn + EVENT_RESERVED2 = 18, # Reserved for future use.. + EVENT_RESERVED3 = 19, # Reserved for future use.. + EVENT_RESERVED4 = 20, # Reserved for future use.. + EVENT_RESERVED5 = 21, # Reserved for future use.. + EVENT_RESERVED6 = 22, # Reserved for future use.. + EVENT_RESERVED7 = 23, # Reserved for future use.. + # Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use + USEREVENT = 24 # This last event is only for bounding internal arrays + # It is the number of bits in the event mask datatype -- UInt32 + +const + NUMEVENTS* = 32 + ALLEVENTS* = 0xFFFFFFFF + ACTIVEEVENTMASK* = 1 shl ord(ACTIVEEVENT) + KEYDOWNMASK* = 1 shl ord(KEYDOWN) + KEYUPMASK* = 1 shl ord(KEYUP) + MOUSEMOTIONMASK* = 1 shl ord(MOUSEMOTION) + MOUSEBUTTONDOWNMASK* = 1 shl ord(MOUSEBUTTONDOWN) + MOUSEBUTTONUPMASK* = 1 shl ord(MOUSEBUTTONUP) + MOUSEEVENTMASK* = 1 shl ord(MOUSEMOTION) or 1 shl ord(MOUSEBUTTONDOWN) or + 1 shl ord(MOUSEBUTTONUP) + JOYAXISMOTIONMASK* = 1 shl ord(JOYAXISMOTION) + JOYBALLMOTIONMASK* = 1 shl ord(JOYBALLMOTION) + JOYHATMOTIONMASK* = 1 shl ord(JOYHATMOTION) + JOYBUTTONDOWNMASK* = 1 shl ord(JOYBUTTONDOWN) + JOYBUTTONUPMASK* = 1 shl ord(JOYBUTTONUP) + JOYEVENTMASK* = 1 shl ord(JOYAXISMOTION) or 1 shl ord(JOYBALLMOTION) or + 1 shl ord(JOYHATMOTION) or 1 shl ord(JOYBUTTONDOWN) or + 1 shl ord(JOYBUTTONUP) + VIDEORESIZEMASK* = 1 shl ord(VIDEORESIZE) + QUITMASK* = 1 shl ord(QUITEV) + SYSWMEVENTMASK* = 1 shl ord(SYSWMEVENT) + QUERY* = - 1 + IGNORE* = 0 + DISABLE* = 0 + ENABLE* = 1 #SDL_keyboard.h constants + # This is the mask which refers to all hotkey bindings + ALL_HOTKEYS* = 0xFFFFFFFF # Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + # 'delay' is the initial delay in ms between the time when a key is + # pressed, and keyboard repeat begins. + # 'interval' is the time in ms between keyboard repeat events. + DEFAULT_REPEAT_DELAY* = 500 + DEFAULT_REPEAT_INTERVAL* = 30 # The keyboard syms have been cleverly chosen to map to ASCII + K_UNKNOWN* = 0 + K_FIRST* = 0 + K_BACKSPACE* = 8 + K_TAB* = 9 + K_CLEAR* = 12 + K_RETURN* = 13 + K_PAUSE* = 19 + K_ESCAPE* = 27 + K_SPACE* = 32 + K_EXCLAIM* = 33 + K_QUOTEDBL* = 34 + K_HASH* = 35 + K_DOLLAR* = 36 + K_AMPERSAND* = 38 + K_QUOTE* = 39 + K_LEFTPAREN* = 40 + K_RIGHTPAREN* = 41 + K_ASTERISK* = 42 + K_PLUS* = 43 + K_COMMA* = 44 + K_MINUS* = 45 + K_PERIOD* = 46 + K_SLASH* = 47 + K_0* = 48 + K_1* = 49 + K_2* = 50 + K_3* = 51 + K_4* = 52 + K_5* = 53 + K_6* = 54 + K_7* = 55 + K_8* = 56 + K_9* = 57 + K_COLON* = 58 + K_SEMICOLON* = 59 + K_LESS* = 60 + K_EQUALS* = 61 + K_GREATER* = 62 + K_QUESTION* = 63 + K_AT* = 64 # Skip uppercase letters + K_LEFTBRACKET* = 91 + K_BACKSLASH* = 92 + K_RIGHTBRACKET* = 93 + K_CARET* = 94 + K_UNDERSCORE* = 95 + K_BACKQUOTE* = 96 + K_a* = 97 + K_b* = 98 + K_c* = 99 + K_d* = 100 + K_e* = 101 + K_f* = 102 + K_g* = 103 + K_h* = 104 + K_i* = 105 + K_j* = 106 + K_k* = 107 + K_l* = 108 + K_m* = 109 + K_n* = 110 + K_o* = 111 + K_p* = 112 + K_q* = 113 + K_r* = 114 + K_s* = 115 + K_t* = 116 + K_u* = 117 + K_v* = 118 + K_w* = 119 + K_x* = 120 + K_y* = 121 + K_z* = 122 + K_DELETE* = 127 # End of ASCII mapped keysyms + # International keyboard syms + K_WORLD_0* = 160 # 0xA0 + K_WORLD_1* = 161 + K_WORLD_2* = 162 + K_WORLD_3* = 163 + K_WORLD_4* = 164 + K_WORLD_5* = 165 + K_WORLD_6* = 166 + K_WORLD_7* = 167 + K_WORLD_8* = 168 + K_WORLD_9* = 169 + K_WORLD_10* = 170 + K_WORLD_11* = 171 + K_WORLD_12* = 172 + K_WORLD_13* = 173 + K_WORLD_14* = 174 + K_WORLD_15* = 175 + K_WORLD_16* = 176 + K_WORLD_17* = 177 + K_WORLD_18* = 178 + K_WORLD_19* = 179 + K_WORLD_20* = 180 + K_WORLD_21* = 181 + K_WORLD_22* = 182 + K_WORLD_23* = 183 + K_WORLD_24* = 184 + K_WORLD_25* = 185 + K_WORLD_26* = 186 + K_WORLD_27* = 187 + K_WORLD_28* = 188 + K_WORLD_29* = 189 + K_WORLD_30* = 190 + K_WORLD_31* = 191 + K_WORLD_32* = 192 + K_WORLD_33* = 193 + K_WORLD_34* = 194 + K_WORLD_35* = 195 + K_WORLD_36* = 196 + K_WORLD_37* = 197 + K_WORLD_38* = 198 + K_WORLD_39* = 199 + K_WORLD_40* = 200 + K_WORLD_41* = 201 + K_WORLD_42* = 202 + K_WORLD_43* = 203 + K_WORLD_44* = 204 + K_WORLD_45* = 205 + K_WORLD_46* = 206 + K_WORLD_47* = 207 + K_WORLD_48* = 208 + K_WORLD_49* = 209 + K_WORLD_50* = 210 + K_WORLD_51* = 211 + K_WORLD_52* = 212 + K_WORLD_53* = 213 + K_WORLD_54* = 214 + K_WORLD_55* = 215 + K_WORLD_56* = 216 + K_WORLD_57* = 217 + K_WORLD_58* = 218 + K_WORLD_59* = 219 + K_WORLD_60* = 220 + K_WORLD_61* = 221 + K_WORLD_62* = 222 + K_WORLD_63* = 223 + K_WORLD_64* = 224 + K_WORLD_65* = 225 + K_WORLD_66* = 226 + K_WORLD_67* = 227 + K_WORLD_68* = 228 + K_WORLD_69* = 229 + K_WORLD_70* = 230 + K_WORLD_71* = 231 + K_WORLD_72* = 232 + K_WORLD_73* = 233 + K_WORLD_74* = 234 + K_WORLD_75* = 235 + K_WORLD_76* = 236 + K_WORLD_77* = 237 + K_WORLD_78* = 238 + K_WORLD_79* = 239 + K_WORLD_80* = 240 + K_WORLD_81* = 241 + K_WORLD_82* = 242 + K_WORLD_83* = 243 + K_WORLD_84* = 244 + K_WORLD_85* = 245 + K_WORLD_86* = 246 + K_WORLD_87* = 247 + K_WORLD_88* = 248 + K_WORLD_89* = 249 + K_WORLD_90* = 250 + K_WORLD_91* = 251 + K_WORLD_92* = 252 + K_WORLD_93* = 253 + K_WORLD_94* = 254 + K_WORLD_95* = 255 # 0xFF + # Numeric keypad + K_KP0* = 256 + K_KP1* = 257 + K_KP2* = 258 + K_KP3* = 259 + K_KP4* = 260 + K_KP5* = 261 + K_KP6* = 262 + K_KP7* = 263 + K_KP8* = 264 + K_KP9* = 265 + K_KP_PERIOD* = 266 + K_KP_DIVIDE* = 267 + K_KP_MULTIPLY* = 268 + K_KP_MINUS* = 269 + K_KP_PLUS* = 270 + K_KP_ENTER* = 271 + K_KP_EQUALS* = 272 # Arrows + Home/End pad + K_UP* = 273 + K_DOWN* = 274 + K_RIGHT* = 275 + K_LEFT* = 276 + K_INSERT* = 277 + K_HOME* = 278 + K_END* = 279 + K_PAGEUP* = 280 + K_PAGEDOWN* = 281 # Function keys + K_F1* = 282 + K_F2* = 283 + K_F3* = 284 + K_F4* = 285 + K_F5* = 286 + K_F6* = 287 + K_F7* = 288 + K_F8* = 289 + K_F9* = 290 + K_F10* = 291 + K_F11* = 292 + K_F12* = 293 + K_F13* = 294 + K_F14* = 295 + K_F15* = 296 # Key state modifier keys + K_NUMLOCK* = 300 + K_CAPSLOCK* = 301 + K_SCROLLOCK* = 302 + K_RSHIFT* = 303 + K_LSHIFT* = 304 + K_RCTRL* = 305 + K_LCTRL* = 306 + K_RALT* = 307 + K_LALT* = 308 + K_RMETA* = 309 + K_LMETA* = 310 + K_LSUPER* = 311 # Left "Windows" key + K_RSUPER* = 312 # Right "Windows" key + K_MODE* = 313 # "Alt Gr" key + K_COMPOSE* = 314 # Multi-key compose key + # Miscellaneous function keys + K_HELP* = 315 + K_PRINT* = 316 + K_SYSREQ* = 317 + K_BREAK* = 318 + K_MENU* = 319 + K_POWER* = 320 # Power Macintosh power key + K_EURO* = 321 # Some european keyboards + K_GP2X_UP* = 0 + K_GP2X_UPLEFT* = 1 + K_GP2X_LEFT* = 2 + K_GP2X_DOWNLEFT* = 3 + K_GP2X_DOWN* = 4 + K_GP2X_DOWNRIGHT* = 5 + K_GP2X_RIGHT* = 6 + K_GP2X_UPRIGHT* = 7 + K_GP2X_START* = 8 + K_GP2X_SELECT* = 9 + K_GP2X_L* = 10 + K_GP2X_R* = 11 + K_GP2X_A* = 12 + K_GP2X_B* = 13 + K_GP2X_Y* = 14 + K_GP2X_X* = 15 + K_GP2X_VOLUP* = 16 + K_GP2X_VOLDOWN* = 17 + K_GP2X_CLICK* = 18 + +const # Enumeration of valid key mods (possibly OR'd together) + KMOD_NONE* = 0x00000000 + KMOD_LSHIFT* = 0x00000001 + KMOD_RSHIFT* = 0x00000002 + KMOD_LCTRL* = 0x00000040 + KMOD_RCTRL* = 0x00000080 + KMOD_LALT* = 0x00000100 + KMOD_RALT* = 0x00000200 + KMOD_LMETA* = 0x00000400 + KMOD_RMETA* = 0x00000800 + KMOD_NUM* = 0x00001000 + KMOD_CAPS* = 0x00002000 + KMOD_MODE* = 44000 + KMOD_RESERVED* = 0x00008000 + KMOD_CTRL* = (KMOD_LCTRL or KMOD_RCTRL) + KMOD_SHIFT* = (KMOD_LSHIFT or KMOD_RSHIFT) + KMOD_ALT* = (KMOD_LALT or KMOD_RALT) + KMOD_META* = (KMOD_LMETA or KMOD_RMETA) #SDL_video.h constants + # Transparency definitions: These define alpha as the opacity of a surface */ + ALPHA_OPAQUE* = 255 + ALPHA_TRANSPARENT* = 0 # These are the currently supported flags for the SDL_surface + # Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() + SWSURFACE* = 0x00000000 # Surface is in system memory + HWSURFACE* = 0x00000001 # Surface is in video memory + ASYNCBLIT* = 0x00000004 # Use asynchronous blits if possible + # Available for SDL_SetVideoMode() + ANYFORMAT* = 0x10000000 # Allow any video depth/pixel-format + HWPALETTE* = 0x20000000 # Surface has exclusive palette + DOUBLEBUF* = 0x40000000 # Set up double-buffered video mode + FULLSCREEN* = 0x80000000 # Surface is a full screen display + OPENGL* = 0x00000002 # Create an OpenGL rendering context + OPENGLBLIT* = 0x00000002 # Create an OpenGL rendering context + RESIZABLE* = 0x00000010 # This video mode may be resized + NOFRAME* = 0x00000020 # No window caption or edge frame + # Used internally (read-only) + HWACCEL* = 0x00000100 # Blit uses hardware acceleration + SRCCOLORKEY* = 0x00001000 # Blit uses a source color key + RLEACCELOK* = 0x00002000 # Private flag + RLEACCEL* = 0x00004000 # Colorkey blit is RLE accelerated + SRCALPHA* = 0x00010000 # Blit uses source alpha blending + SRCCLIPPING* = 0x00100000 # Blit uses source clipping + PREALLOC* = 0x01000000 # Surface uses preallocated memory + # The most common video overlay formats. + # For an explanation of these pixel formats, see: + # http://www.webartz.com/fourcc/indexyuv.htm + # + # For information on the relationship between color spaces, see: + # + # + # http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + YV12_OVERLAY* = 0x32315659 # Planar mode: Y + V + U (3 planes) + IYUV_OVERLAY* = 0x56555949 # Planar mode: Y + U + V (3 planes) + YUY2_OVERLAY* = 0x32595559 # Packed mode: Y0+U0+Y1+V0 (1 plane) + UYVY_OVERLAY* = 0x59565955 # Packed mode: U0+Y0+V0+Y1 (1 plane) + YVYU_OVERLAY* = 0x55595659 # Packed mode: Y0+V0+Y1+U0 (1 plane) + # flags for SDL_SetPalette() + LOGPAL* = 0x00000001 + PHYSPAL* = 0x00000002 #SDL_mouse.h constants + # Used as a mask when testing buttons in buttonstate + # Button 1: Left mouse button + # Button 2: Middle mouse button + # Button 3: Right mouse button + # Button 4: Mouse Wheel Up + # Button 5: Mouse Wheel Down + # + BUTTON_LEFT* = 1 + BUTTON_MIDDLE* = 2 + BUTTON_RIGHT* = 3 + BUTTON_WHEELUP* = 4 + BUTTON_WHEELDOWN* = 5 + BUTTON_LMASK* = PRESSED shl (BUTTON_LEFT - 1) + BUTTON_MMASK* = PRESSED shl (BUTTON_MIDDLE - 1) + BUTTON_RMask* = PRESSED shl (BUTTON_RIGHT - 1) # SDL_active.h constants + # The available application states + APPMOUSEFOCUS* = 0x00000001 # The app has mouse coverage + APPINPUTFOCUS* = 0x00000002 # The app has input focus + APPACTIVE* = 0x00000004 # The application is active + # SDL_mutex.h constants + # Synchronization functions which can time out return this value + # they time out. + MUTEX_TIMEDOUT* = 1 # This is the timeout value which corresponds to never time out + MUTEX_MAXWAIT* = not int(0) + GRAB_QUERY* = - 1 + GRAB_OFF* = 0 + GRAB_ON* = 1 #SDL_GRAB_FULLSCREEN // Used internally + +type + THandle* = int #SDL_types.h types + # Basic data types + TBool* = enum + FALSE, TRUE + PUInt8Array* = ptr TUInt8Array + PUInt8* = ptr UInt8 + PPUInt8* = ptr PUInt8 + UInt8* = int8 + TUInt8Array* = array[0..high(int) shr 1, UInt8] + PUInt16* = ptr UInt16 + UInt16* = int16 + PSInt8* = ptr SInt8 + SInt8* = int8 + PSInt16* = ptr SInt16 + SInt16* = int16 + PUInt32* = ptr UInt32 + UInt32* = int + SInt32* = int + PInt* = ptr int + PShortInt* = ptr int8 + PUInt64* = ptr UInt64 + UInt64*{.final.} = object + hi*: UInt32 + lo*: UInt32 + + PSInt64* = ptr SInt64 + SInt64*{.final.} = object + hi*: UInt32 + lo*: UInt32 + + TGrabMode* = int # SDL_error.h types + Terrorcode* = enum + ENOMEM, EFREAD, EFWRITE, EFSEEK, LASTERROR + errorcode* = Terrorcode + TArg*{.final.} = object + buf*: array[0..ERR_MAX_STRLEN - 1, int8] + + Perror* = ptr Terror + Terror*{.final.} = object # This is a numeric value corresponding to the current error + # SDL_rwops.h types + # This is the read/write operation structure -- very basic + # some helper types to handle the unions + # "packed" is only guessed + error*: int # This is a key used to index into a language hashtable containing + # internationalized versions of the SDL error messages. If the key + # is not in the hashtable, or no hashtable is available, the key is + # used directly as an error message format string. + key*: array[0..ERR_MAX_STRLEN - 1, int8] # These are the arguments for the error functions + argc*: int + args*: array[0..ERR_MAX_ARGS - 1, TArg] + + TStdio*{.final.} = object + autoclose*: int # FILE * is only defined in Kylix so we use a simple Pointer + fp*: Pointer + + TMem*{.final.} = object + base*: PUInt8 + here*: PUInt8 + stop*: PUInt8 + + TUnknown*{.final.} = object # first declare the pointer type + data1*: Pointer + + PRWops* = ptr TRWops # now the pointer to function types + TSeek* = proc (context: PRWops, offset: int, whence: int): int{.cdecl.} + TRead* = proc (context: PRWops, thePtr: Pointer, size: int, maxnum: int): int{. + cdecl.} + TWrite* = proc (context: PRWops, thePtr: Pointer, size: int, num: int): int{. + cdecl.} + TClose* = proc (context: PRWops): int{.cdecl.} # the variant record itself + trange010 = range[0..2] + TRWops*{.final.} = object + seek*: TSeek + read*: TRead + write*: TWrite + closeFile*: TClose # a keyword as name is not allowed + # be warned! structure alignment may arise at this point + case theType*: trange010 + of trange010(0): + stdio*: TStdio + + of trange010(1): + mem*: TMem + + of trange010(2): + unknown*: TUnknown + + + RWops* = TRWops # SDL_timer.h types + # Function prototype for the timer callback function + TTimerCallback* = proc (interval: UInt32): UInt32{.cdecl.} # New timer API, supports multiple timers + # Written by Stephane Peter + # + # <megastep@lokigames.com> + # Function prototype for the new timer callback function. + # The callback function is passed the current timer interval and returns + # the next timer interval. If the returned value is the same as the one + # passed in, the periodic alarm continues, otherwise a new alarm is + # scheduled. If the callback returns 0, the periodic alarm is cancelled. + TNewTimerCallback* = proc (interval: UInt32, param: Pointer): UInt32{.cdecl.} # + # Definition + # of + # the + # timer + # ID + # type + PTimerID* = ptr TTimerID + TTimerID*{.final.} = object + interval*: UInt32 + callback*: TNewTimerCallback + param*: Pointer + last_alarm*: UInt32 + next*: PTimerID + + TAudioSpecCallback* = proc (userdata: Pointer, stream: PUInt8, length: int){. + cdecl.} # SDL_audio.h types + # The calculated values in this structure are calculated by SDL_OpenAudio() + PAudioSpec* = ptr TAudioSpec + TAudioSpec*{.final.} = object # A structure to hold a set of audio conversion filters and buffers + freq*: int # DSP frequency -- samples per second + format*: UInt16 # Audio data format + channels*: UInt8 # Number of channels: 1 mono, 2 stereo + silence*: UInt8 # Audio buffer silence value (calculated) + samples*: UInt16 # Audio buffer size in samples + padding*: UInt16 # Necessary for some compile environments + size*: UInt32 # Audio buffer size in bytes (calculated) + # This function is called when the audio device needs more data. + # 'stream' is a pointer to the audio data buffer + # 'len' is the length of that buffer in bytes. + # Once the callback returns, the buffer will no longer be valid. + # Stereo samples are stored in a LRLRLR ordering. + callback*: TAudioSpecCallback + userdata*: Pointer + + PAudioCVT* = ptr TAudioCVT + PAudioCVTFilter* = ptr TAudioCVTFilter + TAudioCVTFilter*{.final.} = object + cvt*: PAudioCVT + format*: UInt16 + + PAudioCVTFilterArray* = ptr TAudioCVTFilterArray + TAudioCVTFilterArray* = array[0..9, PAudioCVTFilter] + TAudioCVT*{.final.} = object + needed*: int # Set to 1 if conversion possible + src_format*: UInt16 # Source audio format + dst_format*: UInt16 # Target audio format + rate_incr*: float64 # Rate conversion increment + buf*: PUInt8 # Buffer to hold entire audio data + length*: int # Length of original audio buffer + len_cvt*: int # Length of converted audio buffer + len_mult*: int # buffer must be len*len_mult big + len_ratio*: float64 # Given len, final size is len*len_ratio + filters*: TAudioCVTFilterArray + filter_index*: int # Current audio conversion function + + TAudiostatus* = enum # SDL_cdrom.h types + AUDIO_STOPPED, AUDIO_PLAYING, AUDIO_PAUSED + TCDStatus* = enum + CD_ERROR, CD_TRAYEMPTY, CD_STOPPED, CD_PLAYING, CD_PAUSED + PCDTrack* = ptr TCDTrack + TCDTrack*{.final.} = object # This structure is only current as of the last call to SDL_CDStatus() + id*: UInt8 # Track number + theType*: UInt8 # Data or audio track + unused*: UInt16 + len*: UInt32 # Length, in frames, of this track + offset*: UInt32 # Offset, in frames, from start of disk + + PCD* = ptr TCD + TCD*{.final.} = object #SDL_joystick.h types + id*: int # Private drive identifier + status*: TCDStatus # Current drive status + # The rest of this structure is only valid if there's a CD in drive + numtracks*: int # Number of tracks on disk + cur_track*: int # Current track position + cur_frame*: int # Current frame offset within current track + track*: array[0..MAX_TRACKS, TCDTrack] + + PTransAxis* = ptr TTransAxis + TTransAxis*{.final.} = object # The private structure used to keep track of a joystick + offset*: int + scale*: float32 + + PJoystick_hwdata* = ptr TJoystick_hwdata + TJoystick_hwdata*{.final.} = object # joystick ID + id*: int # values used to translate device-specific coordinates into SDL-standard ranges + transaxis*: array[0..5, TTransAxis] + + PBallDelta* = ptr TBallDelta + TBallDelta*{.final.} = object # Current ball motion deltas + # The SDL joystick structure + dx*: int + dy*: int + + PJoystick* = ptr TJoystick + TJoystick*{.final.} = object # SDL_verion.h types + index*: UInt8 # Device index + name*: cstring # Joystick name - system dependent + naxes*: int # Number of axis controls on the joystick + axes*: PUInt16 # Current axis states + nhats*: int # Number of hats on the joystick + hats*: PUInt8 # Current hat states + nballs*: int # Number of trackballs on the joystick + balls*: PBallDelta # Current ball motion deltas + nbuttons*: int # Number of buttons on the joystick + buttons*: PUInt8 # Current button states + hwdata*: PJoystick_hwdata # Driver dependent information + ref_count*: int # Reference count for multiple opens + + Pversion* = ptr Tversion + Tversion*{.final.} = object # SDL_keyboard.h types + major*: UInt8 + minor*: UInt8 + patch*: UInt8 + + TKey* = int32 + TMod* = int32 + PKeySym* = ptr TKeySym + TKeySym*{.final.} = object # SDL_events.h types + #Checks the event queue for messages and optionally returns them. + # If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + # the back of the event queue. + # If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + # of the event queue, matching 'mask', will be returned and will not + # be removed from the queue. + # If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + # of the event queue, matching 'mask', will be returned and will be + # removed from the queue. + # This function returns the number of events actually stored, or -1 + # if there was an error. This function is thread-safe. + scancode*: UInt8 # hardware specific scancode + sym*: TKey # SDL virtual keysym + modifier*: TMod # current key modifiers + unicode*: UInt16 # translated character + + TEventAction* = enum # Application visibility event structure + ADDEVENT, PEEKEVENT, GETEVENT + TActiveEvent*{.final.} = object # SDL_ACTIVEEVENT + # Keyboard event structure + gain*: UInt8 # Whether given states were gained or lost (1/0) + state*: UInt8 # A mask of the focus states + + TKeyboardEvent*{.final.} = object # SDL_KEYDOWN or SDL_KEYUP + # Mouse motion event structure + which*: UInt8 # The keyboard device index + state*: UInt8 # SDL_PRESSED or SDL_RELEASED + keysym*: TKeySym + + TMouseMotionEvent*{.final.} = object # SDL_MOUSEMOTION + # Mouse button event structure + which*: UInt8 # The mouse device index + state*: UInt8 # The current button state + x*, y*: UInt16 # The X/Y coordinates of the mouse + xrel*: SInt16 # The relative motion in the X direction + yrel*: SInt16 # The relative motion in the Y direction + + TMouseButtonEvent*{.final.} = object # SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP + # Joystick axis motion event structure + which*: UInt8 # The mouse device index + button*: UInt8 # The mouse button index + state*: UInt8 # SDL_PRESSED or SDL_RELEASED + x*: UInt16 # The X coordinates of the mouse at press time + y*: UInt16 # The Y coordinates of the mouse at press time + + TJoyAxisEvent*{.final.} = object # SDL_JOYAXISMOTION + # Joystick trackball motion event structure + which*: UInt8 # The joystick device index + axis*: UInt8 # The joystick axis index + value*: SInt16 # The axis value (range: -32768 to 32767) + + TJoyBallEvent*{.final.} = object # SDL_JOYAVBALLMOTION + # Joystick hat position change event structure + which*: UInt8 # The joystick device index + ball*: UInt8 # The joystick trackball index + xrel*: SInt16 # The relative motion in the X direction + yrel*: SInt16 # The relative motion in the Y direction + + TJoyHatEvent*{.final.} = object # SDL_JOYHATMOTION */ + # Joystick button event structure + which*: UInt8 # The joystick device index */ + hat*: UInt8 # The joystick hat index */ + value*: UInt8 # The hat position value: + # 8 1 2 + # 7 0 3 + # 6 5 4 + # Note that zero means the POV is centered. + + TJoyButtonEvent*{.final.} = object # SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP + # The "window resized" event + # When you get this event, you are responsible for setting a new video + # mode with the new width and height. + which*: UInt8 # The joystick device index + button*: UInt8 # The joystick button index + state*: UInt8 # SDL_PRESSED or SDL_RELEASED + + TResizeEvent*{.final.} = object # SDL_VIDEORESIZE + # A user-defined event type + w*: int # New width + h*: int # New height + + PUserEvent* = ptr TUserEvent + TUserEvent*{.final.} = object # SDL_USEREVENT through SDL_NUMEVENTS-1 + code*: int # User defined event code */ + data1*: Pointer # User defined data pointer */ + data2*: Pointer # User defined data pointer */ + + +when defined(Unix): + type #These are the various supported subsystems under UNIX + TSysWm* = enum + SYSWM_X11 +when defined(WINDOWS): + type + PSysWMmsg* = ptr TSysWMmsg + TSysWMmsg*{.final.} = object + version*: Tversion + hwnd*: THandle # The window for the message + msg*: int # The type of message + w_Param*: int32 # WORD message parameter + lParam*: int32 # LONG message parameter + +elif defined(Unix): + type # The Linux custom event structure + PSysWMmsg* = ptr TSysWMmsg + TSysWMmsg*{.final.} = object + version*: Tversion + subsystem*: TSysWm + when false: + event*: TXEvent + + +else: + type # The generic custom event structure + PSysWMmsg* = ptr TSysWMmsg + TSysWMmsg*{.final.} = object + version*: Tversion + data*: int + +# The Windows custom window manager information structure + +when defined(WINDOWS): + type + PSysWMinfo* = ptr TSysWMinfo + TSysWMinfo*{.final.} = object + version*: Tversion + window*: THandle # The display window + +elif defined(Unix): + type + TX11*{.final.} = object + when false: + display*: PDisplay # The X11 display + window*: TWindow # The X11 display window + # These locking functions should be called around + # any X11 functions using the display variable. + # They lock the event thread, so should not be + # called around event functions or from event filters. + lock_func*: Pointer + unlock_func*: Pointer # Introduced in SDL 1.0.2 + fswindow*: TWindow # The X11 fullscreen window + wmwindow*: TWindow # The X11 managed input window + + + type + PSysWMinfo* = ptr TSysWMinfo + TSysWMinfo*{.final.} = object + version*: Tversion + subsystem*: TSysWm + X11*: TX11 + +else: + type # The generic custom window manager information structure + PSysWMinfo* = ptr TSysWMinfo + TSysWMinfo*{.final.} = object + version*: Tversion + data*: int + +type + PSysWMEvent* = ptr TSysWMEvent + TSysWMEvent*{.final.} = object + msg*: PSysWMmsg + + PEvent* = ptr TEvent + TEvent*{.final.} = object # This function sets up a filter to process all events before they + # change internal state and are posted to the internal event queue. + # + # The filter is protypted as: + case theType*: TEventKind # SDL_NOEVENT, SDL_QUITEV: (); + of ACTIVEEVENT: + active*: TActiveEvent + + of KEYDOWN, KEYUP: + key*: TKeyboardEvent + + of MOUSEMOTION: + motion*: TMouseMotionEvent + + of MOUSEBUTTONDOWN, MOUSEBUTTONUP: + button*: TMouseButtonEvent + + of JOYAXISMOTION: + jaxis*: TJoyAxisEvent + + of JOYBALLMOTION: + jball*: TJoyBallEvent + + of JOYHATMOTION: + jhat*: TJoyHatEvent + + of JOYBUTTONDOWN, JOYBUTTONUP: + jbutton*: TJoyButtonEvent + + of VIDEORESIZE: + resize*: TResizeEvent + + of USEREVENT: + user*: TUserEvent + + of SYSWMEVENT: + syswm*: TSysWMEvent + + else: + nil + + + TEventFilter* = proc (event: PEvent): int{.cdecl.} # SDL_video.h types + # Useful data types + PPSDL_Rect* = ptr PRect + PRect* = ptr TRect + TRect*{.final.} = object + x*, y*: SInt16 + w*, h*: UInt16 + + Rect* = TRect + PColor* = ptr TColor + TColor*{.final.} = object + r*: UInt8 + g*: UInt8 + b*: UInt8 + unused*: UInt8 + + PColorArray* = ptr TColorArray + TColorArray* = array[0..65000, TColor] + PPalette* = ptr TPalette + TPalette*{.final.} = object # Everything in the pixel format structure is read-only + ncolors*: int + colors*: PColorArray + + PPixelFormat* = ptr TPixelFormat + TPixelFormat*{.final.} = object # The structure passed to the low level blit functions + palette*: PPalette + BitsPerPixel*: UInt8 + BytesPerPixel*: UInt8 + Rloss*: UInt8 + Gloss*: UInt8 + Bloss*: UInt8 + Aloss*: UInt8 + Rshift*: UInt8 + Gshift*: UInt8 + Bshift*: UInt8 + Ashift*: UInt8 + RMask*: UInt32 + GMask*: UInt32 + BMask*: UInt32 + AMask*: UInt32 + colorkey*: UInt32 # RGB color key information + alpha*: UInt8 # Alpha value information (per-surface alpha) + + PBlitInfo* = ptr TBlitInfo + TBlitInfo*{.final.} = object # typedef for private surface blitting functions + s_pixels*: PUInt8 + s_width*: int + s_height*: int + s_skip*: int + d_pixels*: PUInt8 + d_width*: int + d_height*: int + d_skip*: int + aux_data*: Pointer + src*: PPixelFormat + table*: PUInt8 + dst*: PPixelFormat + + PSurface* = ptr TSurface + TBlit* = proc (src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int{. + cdecl.} + TSurface*{.final.} = object # Useful for determining the video hardware capabilities + flags*: UInt32 # Read-only + format*: PPixelFormat # Read-only + w*, h*: int # Read-only + pitch*: UInt16 # Read-only + pixels*: Pointer # Read-write + offset*: int # Private + hwdata*: Pointer #TPrivate_hwdata; Hardware-specific surface info + # clipping information: + clip_rect*: TRect # Read-only + unused1*: UInt32 # for binary compatibility + # Allow recursive locks + locked*: UInt32 # Private + # info for fast blit mapping to other surfaces + Blitmap*: Pointer # PSDL_BlitMap; // Private + # format version, bumped at every change to invalidate blit maps + format_version*: int # Private + refcount*: int + + PVideoInfo* = ptr TVideoInfo + TVideoInfo*{.final.} = object # The YUV hardware video overlay + hw_available*: UInt8 # Hardware and WindowManager flags in first 2 bits ( see below ) + #hw_available: 1; // Can you create hardware surfaces + # wm_available: 1; // Can you talk to a window manager? + # UnusedBits1: 6; + blit_hw*: UInt8 # Blit Hardware flags. See below for which bits do what + #UnusedBits2: 1; + # blit_hw: 1; // Flag:UInt32 Accelerated blits HW --> HW + # blit_hw_CC: 1; // Flag:UInt32 Accelerated blits with Colorkey + # blit_hw_A: 1; // Flag:UInt32 Accelerated blits with Alpha + # blit_sw: 1; // Flag:UInt32 Accelerated blits SW --> HW + # blit_sw_CC: 1; // Flag:UInt32 Accelerated blits with Colorkey + # blit_sw_A: 1; // Flag:UInt32 Accelerated blits with Alpha + # blit_fill: 1; // Flag:UInt32 Accelerated color fill + UnusedBits3*: UInt8 # Unused at this point + video_mem*: UInt32 # The total amount of video memory (in K) + vfmt*: PPixelFormat # Value: The format of the video surface + current_w*: SInt32 # Value: The current video mode width + current_h*: SInt32 # Value: The current video mode height + + POverlay* = ptr TOverlay + TOverlay*{.final.} = object # Public enumeration for setting the OpenGL window attributes. + format*: UInt32 # Overlay format + w*, h*: int # Width and height of overlay + planes*: int # Number of planes in the overlay. Usually either 1 or 3 + pitches*: PUInt16 # An array of pitches, one for each plane. Pitch is the length of a row in bytes. + pixels*: PPUInt8 # An array of pointers to the data of each plane. The overlay should be locked before these pointers are used. + hw_overlay*: UInt32 # This will be set to 1 if the overlay is hardware accelerated. + + TGLAttr* = enum + GL_RED_SIZE, GL_GREEN_SIZE, GL_BLUE_SIZE, GL_ALPHA_SIZE, GL_BUFFER_SIZE, + GL_DOUBLEBUFFER, GL_DEPTH_SIZE, GL_STENCIL_SIZE, GL_ACCUM_RED_SIZE, + GL_ACCUM_GREEN_SIZE, GL_ACCUM_BLUE_SIZE, GL_ACCUM_ALPHA_SIZE, GL_STEREO, + GL_MULTISAMPLEBUFFERS, GL_MULTISAMPLESAMPLES, GL_ACCELERATED_VISUAL, + GL_SWAP_CONTROL + PCursor* = ptr TCursor + TCursor*{.final.} = object # SDL_mutex.h types + area*: TRect # The area of the mouse cursor + hot_x*, hot_y*: SInt16 # The "tip" of the cursor + data*: PUInt8 # B/W cursor data + mask*: PUInt8 # B/W cursor mask + save*: array[1..2, PUInt8] # Place to save cursor area + wm_cursor*: Pointer # Window-manager cursor + + +type + PMutex* = ptr TMutex + TMutex*{.final.} = object + Psemaphore* = ptr Tsemaphore + Tsemaphore*{.final.} = object + PSem* = ptr TSem + TSem* = TSemaphore + PCond* = ptr TCond + TCond*{.final.} = object # SDL_thread.h types + +when defined(WINDOWS): + type + TSYS_ThreadHandle* = THandle +when defined(Unix): + type + TSYS_ThreadHandle* = pointer +type # This is the system-independent thread info structure + PThread* = ptr TThread + TThread*{.final.} = object # Helper Types + # Keyboard State Array ( See demos for how to use ) + threadid*: UInt32 + handle*: TSYS_ThreadHandle + status*: int + errbuf*: TError + data*: Pointer + + PKeyStateArr* = ptr TKeyStateArr + TKeyStateArr* = array[0..65000, UInt8] # Types required so we don't need to use Windows.pas + PInteger* = ptr int + PByte* = ptr int8 + PWord* = ptr int16 + PLongWord* = ptr int32 # General arrays + PByteArray* = ptr TByteArray + TByteArray* = array[0..32767, int8] + PWordArray* = ptr TWordArray + TWordArray* = array[0..16383, int16] # Generic procedure pointer + TProcedure* = proc () #------------------------------------------------------------------------------ + # initialization + #------------------------------------------------------------------------------ + # This function loads the SDL dynamically linked library and initializes + # the subsystems specified by 'flags' (and those satisfying dependencies) + # Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + # signal handlers for some commonly ignored fatal signals (like SIGSEGV) + +proc Init*(flags: UInt32): int{.cdecl, importc: "SDL_Init", dynlib: LibName.} + # This function initializes specific SDL subsystems +proc InitSubSystem*(flags: UInt32): int{.cdecl, importc: "SDL_InitSubSystem", + dynlib: LibName.} + # This function cleans up specific SDL subsystems +proc QuitSubSystem*(flags: UInt32){.cdecl, importc: "SDL_QuitSubSystem", + dynlib: LibName.} + # This function returns mask of the specified subsystems which have + # been initialized. + # If 'flags' is 0, it returns a mask of all initialized subsystems. +proc WasInit*(flags: UInt32): UInt32{.cdecl, importc: "SDL_WasInit", + dynlib: LibName.} + # This function cleans up all initialized subsystems and unloads the + # dynamically linked library. You should call it upon all exit conditions. +proc Quit*(){.cdecl, importc: "SDL_Quit", dynlib: LibName.} +when defined(WINDOWS): + # This should be called from your WinMain() function, if any + proc RegisterApp*(name: cstring, style: UInt32, h_Inst: Pointer): int{.cdecl, + importc: "SDL_RegisterApp", dynlib: LibName.} +proc TableSize*(table: cstring): int + #------------------------------------------------------------------------------ + # error-handling + #------------------------------------------------------------------------------ + # Public functions +proc GetError*(): cstring{.cdecl, importc: "SDL_GetError", dynlib: LibName.} +proc SetError*(fmt: cstring){.cdecl, importc: "SDL_SetError", dynlib: LibName.} +proc ClearError*(){.cdecl, importc: "SDL_ClearError", dynlib: LibName.} +when not (defined(WINDOWS)): + proc Error*(Code: Terrorcode){.cdecl, importc: "SDL_Error", dynlib: LibName.} +proc OutOfMemory*() + #------------------------------------------------------------------------------ + # io handling + #------------------------------------------------------------------------------ + # Functions to create SDL_RWops structures from various data sources +proc RWFromFile*(filename, mode: cstring): PRWops{.cdecl, + importc: "SDL_RWFromFile", dynlib: LibName.} +proc FreeRW*(area: PRWops){.cdecl, importc: "SDL_FreeRW", dynlib: LibName.} + #fp is FILE *fp ??? +proc RWFromFP*(fp: Pointer, autoclose: int): PRWops{.cdecl, + importc: "SDL_RWFromFP", dynlib: LibName.} +proc RWFromMem*(mem: Pointer, size: int): PRWops{.cdecl, + importc: "SDL_RWFromMem", dynlib: LibName.} +proc RWFromConstMem*(mem: Pointer, size: int): PRWops{.cdecl, + importc: "SDL_RWFromConstMem", dynlib: LibName.} +proc AllocRW*(): PRWops{.cdecl, importc: "SDL_AllocRW", dynlib: LibName.} +proc RWSeek*(context: PRWops, offset: int, whence: int): int +proc RWTell*(context: PRWops): int +proc RWRead*(context: PRWops, theptr: Pointer, size: int, n: int): int +proc RWWrite*(context: PRWops, theptr: Pointer, size: int, n: int): int +proc RWClose*(context: PRWops): int + #------------------------------------------------------------------------------ + # time-handling + #------------------------------------------------------------------------------ + # Get the number of milliseconds since the SDL library initialization. + # Note that this value wraps if the program runs for more than ~49 days. +proc GetTicks*(): UInt32{.cdecl, importc: "SDL_GetTicks", dynlib: LibName.} + # Wait a specified number of milliseconds before returning +proc Delay*(msec: UInt32){.cdecl, importc: "SDL_Delay", dynlib: LibName.} + # Add a new timer to the pool of timers already running. + # Returns a timer ID, or NULL when an error occurs. +proc AddTimer*(interval: UInt32, callback: TNewTimerCallback, param: Pointer): PTimerID{. + cdecl, importc: "SDL_AddTimer", dynlib: LibName.} + # Remove one of the multiple timers knowing its ID. + # Returns a boolean value indicating success. +proc RemoveTimer*(t: PTimerID): TBool{.cdecl, importc: "SDL_RemoveTimer", + dynlib: LibName.} +proc SetTimer*(interval: UInt32, callback: TTimerCallback): int{.cdecl, + importc: "SDL_SetTimer", dynlib: LibName.} + #------------------------------------------------------------------------------ + # audio-routines + #------------------------------------------------------------------------------ + # These functions are used internally, and should not be used unless you + # have a specific need to specify the audio driver you want to use. + # You should normally use SDL_Init() or SDL_InitSubSystem(). +proc AudioInit*(driver_name: cstring): int{.cdecl, importc: "SDL_AudioInit", + dynlib: LibName.} +proc AudioQuit*(){.cdecl, importc: "SDL_AudioQuit", dynlib: LibName.} + # This function fills the given character buffer with the name of the + # current audio driver, and returns a Pointer to it if the audio driver has + # been initialized. It returns NULL if no driver has been initialized. +proc AudioDriverName*(namebuf: cstring, maxlen: int): cstring{.cdecl, + importc: "SDL_AudioDriverName", dynlib: LibName.} + # This function opens the audio device with the desired parameters, and + # returns 0 if successful, placing the actual hardware parameters in the + # structure pointed to by 'obtained'. If 'obtained' is NULL, the audio + # data passed to the callback function will be guaranteed to be in the + # requested format, and will be automatically converted to the hardware + # audio format if necessary. This function returns -1 if it failed + # to open the audio device, or couldn't set up the audio thread. + # + # When filling in the desired audio spec structure, + # 'desired->freq' should be the desired audio frequency in samples-per-second. + # 'desired->format' should be the desired audio format. + # 'desired->samples' is the desired size of the audio buffer, in samples. + # This number should be a power of two, and may be adjusted by the audio + # driver to a value more suitable for the hardware. Good values seem to + # range between 512 and 8096 inclusive, depending on the application and + # CPU speed. Smaller values yield faster response time, but can lead + # to underflow if the application is doing heavy processing and cannot + # fill the audio buffer in time. A stereo sample consists of both right + # and left channels in LR ordering. + # Note that the number of samples is directly related to time by the + # following formula: ms = (samples*1000)/freq + # 'desired->size' is the size in bytes of the audio buffer, and is + # calculated by SDL_OpenAudio(). + # 'desired->silence' is the value used to set the buffer to silence, + # and is calculated by SDL_OpenAudio(). + # 'desired->callback' should be set to a function that will be called + # when the audio device is ready for more data. It is passed a pointer + # to the audio buffer, and the length in bytes of the audio buffer. + # This function usually runs in a separate thread, and so you should + # protect data structures that it accesses by calling SDL_LockAudio() + # and SDL_UnlockAudio() in your code. + # 'desired->userdata' is passed as the first parameter to your callback + # function. + # + # The audio device starts out playing silence when it's opened, and should + # be enabled for playing by calling SDL_PauseAudio(0) when you are ready + # for your audio callback function to be called. Since the audio driver + # may modify the requested size of the audio buffer, you should allocate + # any local mixing buffers after you open the audio device. +proc OpenAudio*(desired, obtained: PAudioSpec): int{.cdecl, + importc: "SDL_OpenAudio", dynlib: LibName.} + # Get the current audio state: +proc GetAudioStatus*(): TAudiostatus{.cdecl, importc: "SDL_GetAudioStatus", + dynlib: LibName.} + # This function pauses and unpauses the audio callback processing. + # It should be called with a parameter of 0 after opening the audio + # device to start playing sound. This is so you can safely initialize + # data for your callback function after opening the audio device. + # Silence will be written to the audio device during the pause. +proc PauseAudio*(pause_on: int){.cdecl, importc: "SDL_PauseAudio", + dynlib: LibName.} + # This function loads a WAVE from the data source, automatically freeing + # that source if 'freesrc' is non-zero. For example, to load a WAVE file, + # you could do: + # SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + # + # If this function succeeds, it returns the given SDL_AudioSpec, + # filled with the audio data format of the wave data, and sets + # 'audio_buf' to a malloc()'d buffer containing the audio data, + # and sets 'audio_len' to the length of that audio buffer, in bytes. + # You need to free the audio buffer with SDL_FreeWAV() when you are + # done with it. + # + # This function returns NULL and sets the SDL error message if the + # wave file cannot be opened, uses an unknown data format, or is + # corrupt. Currently raw and MS-ADPCM WAVE files are supported. +proc LoadWAV_RW*(src: PRWops, freesrc: int, spec: PAudioSpec, audio_buf: PUInt8, + audiolen: PUInt32): PAudioSpec{.cdecl, + importc: "SDL_LoadWAV_RW", dynlib: LibName.} + # Compatibility convenience function -- loads a WAV from a file +proc LoadWAV*(filename: cstring, spec: PAudioSpec, audio_buf: PUInt8, + audiolen: PUInt32): PAudioSpec + # This function frees data previously allocated with SDL_LoadWAV_RW() +proc FreeWAV*(audio_buf: PUInt8){.cdecl, importc: "SDL_FreeWAV", dynlib: LibName.} + # This function takes a source format and rate and a destination format + # and rate, and initializes the 'cvt' structure with information needed + # by SDL_ConvertAudio() to convert a buffer of audio data from one format + # to the other. + # This function returns 0, or -1 if there was an error. +proc BuildAudioCVT*(cvt: PAudioCVT, src_format: UInt16, src_channels: UInt8, + src_rate: int, dst_format: UInt16, dst_channels: UInt8, + dst_rate: int): int{.cdecl, importc: "SDL_BuildAudioCVT", + dynlib: LibName.} + # Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), + # created an audio buffer cvt->buf, and filled it with cvt->len bytes of + # audio data in the source format, this function will convert it in-place + # to the desired format. + # The data conversion may expand the size of the audio data, so the buffer + # cvt->buf should be allocated after the cvt structure is initialized by + # SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. +proc ConvertAudio*(cvt: PAudioCVT): int{.cdecl, importc: "SDL_ConvertAudio", + dynlib: LibName.} + # This takes two audio buffers of the playing audio format and mixes + # them, performing addition, volume adjustment, and overflow clipping. + # The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + # for full audio volume. Note this does not change hardware volume. + # This is provided for convenience -- you can mix your own audio data. +proc MixAudio*(dst, src: PUInt8, length: UInt32, volume: int){.cdecl, + importc: "SDL_MixAudio", dynlib: LibName.} + # The lock manipulated by these functions protects the callback function. + # During a LockAudio/UnlockAudio pair, you can be guaranteed that the + # callback function is not running. Do not call these from the callback + # function or you will cause deadlock. +proc LockAudio*(){.cdecl, importc: "SDL_LockAudio", dynlib: LibName.} +proc UnlockAudio*(){.cdecl, importc: "SDL_UnlockAudio", dynlib: LibName.} + # This function shuts down audio processing and closes the audio device. +proc CloseAudio*(){.cdecl, importc: "SDL_CloseAudio", dynlib: LibName.} + #------------------------------------------------------------------------------ + # CD-routines + #------------------------------------------------------------------------------ + # Returns the number of CD-ROM drives on the system, or -1 if + # SDL_Init() has not been called with the SDL_INIT_CDROM flag. +proc CDNumDrives*(): int{.cdecl, importc: "SDL_CDNumDrives", dynlib: LibName.} + # Returns a human-readable, system-dependent identifier for the CD-ROM. + # Example: + # "/dev/cdrom" + # "E:" + # "/dev/disk/ide/1/master" +proc CDName*(drive: int): cstring{.cdecl, importc: "SDL_CDName", dynlib: LibName.} + # Opens a CD-ROM drive for access. It returns a drive handle on success, + # or NULL if the drive was invalid or busy. This newly opened CD-ROM + # becomes the default CD used when other CD functions are passed a NULL + # CD-ROM handle. + # Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. +proc CDOpen*(drive: int): PCD{.cdecl, importc: "SDL_CDOpen", dynlib: LibName.} + # This function returns the current status of the given drive. + # If the drive has a CD in it, the table of contents of the CD and current + # play position of the CD will be stored in the SDL_CD structure. +proc CDStatus*(cdrom: PCD): TCDStatus{.cdecl, importc: "SDL_CDStatus", + dynlib: LibName.} + # Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' + # tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play + # until the end of the CD. This function will skip data tracks. + # This function should only be called after calling SDL_CDStatus() to + # get track information about the CD. + # + # For example: + # // Play entire CD: + # if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then + # SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + # // Play last track: + # if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then + # begin + # SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); + # end; + # + # // Play first and second track and 10 seconds of third track: + # if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + # SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); + # + # This function returns 0, or -1 if there was an error. +proc CDPlayTracks*(cdrom: PCD, start_track: int, start_frame: int, ntracks: int, + nframes: int): int{.cdecl, importc: "SDL_CDPlayTracks", + dynlib: LibName.} + # Play the given CD starting at 'start' frame for 'length' frames. + # It returns 0, or -1 if there was an error. +proc CDPlay*(cdrom: PCD, start: int, len: int): int{.cdecl, + importc: "SDL_CDPlay", dynlib: LibName.} + # Pause play -- returns 0, or -1 on error +proc CDPause*(cdrom: PCD): int{.cdecl, importc: "SDL_CDPause", dynlib: LibName.} + # Resume play -- returns 0, or -1 on error +proc CDResume*(cdrom: PCD): int{.cdecl, importc: "SDL_CDResume", dynlib: LibName.} + # Stop play -- returns 0, or -1 on error +proc CDStop*(cdrom: PCD): int{.cdecl, importc: "SDL_CDStop", dynlib: LibName.} + # Eject CD-ROM -- returns 0, or -1 on error +proc CDEject*(cdrom: PCD): int{.cdecl, importc: "SDL_CDEject", dynlib: LibName.} + # Closes the handle for the CD-ROM drive +proc CDClose*(cdrom: PCD){.cdecl, importc: "SDL_CDClose", dynlib: LibName.} + # Given a status, returns true if there's a disk in the drive +proc CDInDrive*(status: TCDStatus): bool + # Conversion functions from frames to Minute/Second/Frames and vice versa +proc FRAMES_TO_MSF*(frames: int, M: var int, S: var int, F: var int) +proc MSF_TO_FRAMES*(M: int, S: int, F: int): int + #------------------------------------------------------------------------------ + # JoyStick-routines + #------------------------------------------------------------------------------ + # Count the number of joysticks attached to the system +proc NumJoysticks*(): int{.cdecl, importc: "SDL_NumJoysticks", dynlib: LibName.} + # Get the implementation dependent name of a joystick. + # This can be called before any joysticks are opened. + # If no name can be found, this function returns NULL. +proc JoystickName*(index: int): cstring{.cdecl, importc: "SDL_JoystickName", + dynlib: LibName.} + # Open a joystick for use - the index passed as an argument refers to + # the N'th joystick on the system. This index is the value which will + # identify this joystick in future joystick events. + # + # This function returns a joystick identifier, or NULL if an error occurred. +proc JoystickOpen*(index: int): PJoystick{.cdecl, importc: "SDL_JoystickOpen", + dynlib: LibName.} + # Returns 1 if the joystick has been opened, or 0 if it has not. +proc JoystickOpened*(index: int): int{.cdecl, importc: "SDL_JoystickOpened", + dynlib: LibName.} + # Get the device index of an opened joystick. +proc JoystickIndex*(joystick: PJoystick): int{.cdecl, + importc: "SDL_JoystickIndex", dynlib: LibName.} + # Get the number of general axis controls on a joystick +proc JoystickNumAxes*(joystick: PJoystick): int{.cdecl, + importc: "SDL_JoystickNumAxes", dynlib: LibName.} + # Get the number of trackballs on a joystick + # Joystick trackballs have only relative motion events associated + # with them and their state cannot be polled. +proc JoystickNumBalls*(joystick: PJoystick): int{.cdecl, + importc: "SDL_JoystickNumBalls", dynlib: LibName.} + # Get the number of POV hats on a joystick +proc JoystickNumHats*(joystick: PJoystick): int{.cdecl, + importc: "SDL_JoystickNumHats", dynlib: LibName.} + # Get the number of buttons on a joystick +proc JoystickNumButtons*(joystick: PJoystick): int{.cdecl, + importc: "SDL_JoystickNumButtons", dynlib: LibName.} + # Update the current state of the open joysticks. + # This is called automatically by the event loop if any joystick + # events are enabled. +proc JoystickUpdate*(){.cdecl, importc: "SDL_JoystickUpdate", dynlib: LibName.} + # Enable/disable joystick event polling. + # If joystick events are disabled, you must call SDL_JoystickUpdate() + # yourself and check the state of the joystick when you want joystick + # information. + # The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. +proc JoystickEventState*(state: int): int{.cdecl, + importc: "SDL_JoystickEventState", dynlib: LibName.} + # Get the current state of an axis control on a joystick + # The state is a value ranging from -32768 to 32767. + # The axis indices start at index 0. +proc JoystickGetAxis*(joystick: PJoystick, axis: int): SInt16{.cdecl, + importc: "SDL_JoystickGetAxis", dynlib: LibName.} + # The hat indices start at index 0. +proc JoystickGetHat*(joystick: PJoystick, hat: int): UInt8{.cdecl, + importc: "SDL_JoystickGetHat", dynlib: LibName.} + # Get the ball axis change since the last poll + # This returns 0, or -1 if you passed it invalid parameters. + # The ball indices start at index 0. +proc JoystickGetBall*(joystick: PJoystick, ball: int, dx: var int, dy: var int): int{. + cdecl, importc: "SDL_JoystickGetBall", dynlib: LibName.} + # Get the current state of a button on a joystick + # The button indices start at index 0. +proc JoystickGetButton*(joystick: PJoystick, Button: int): UInt8{.cdecl, + importc: "SDL_JoystickGetButton", dynlib: LibName.} + # Close a joystick previously opened with SDL_JoystickOpen() +proc JoystickClose*(joystick: PJoystick){.cdecl, importc: "SDL_JoystickClose", + dynlib: LibName.} + #------------------------------------------------------------------------------ + # event-handling + #------------------------------------------------------------------------------ + # Pumps the event loop, gathering events from the input devices. + # This function updates the event queue and internal input device state. + # This should only be run in the thread that sets the video mode. +proc PumpEvents*(){.cdecl, importc: "SDL_PumpEvents", dynlib: LibName.} + # Checks the event queue for messages and optionally returns them. + # If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + # the back of the event queue. + # If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + # of the event queue, matching 'mask', will be returned and will not + # be removed from the queue. + # If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + # of the event queue, matching 'mask', will be returned and will be + # removed from the queue. + # This function returns the number of events actually stored, or -1 + # if there was an error. This function is thread-safe. +proc PeepEvents*(events: PEvent, numevents: int, action: Teventaction, + mask: UInt32): int{.cdecl, importc: "SDL_PeepEvents", + dynlib: LibName.} + # Polls for currently pending events, and returns 1 if there are any pending + # events, or 0 if there are none available. If 'event' is not NULL, the next + # event is removed from the queue and stored in that area. +proc PollEvent*(event: PEvent): int{.cdecl, importc: "SDL_PollEvent", + dynlib: LibName.} + # Waits indefinitely for the next available event, returning 1, or 0 if there + # was an error while waiting for events. If 'event' is not NULL, the next + # event is removed from the queue and stored in that area. +proc WaitEvent*(event: PEvent): int{.cdecl, importc: "SDL_WaitEvent", + dynlib: LibName.} +proc PushEvent*(event: PEvent): int{.cdecl, importc: "SDL_PushEvent", + dynlib: LibName.} + # If the filter returns 1, then the event will be added to the internal queue. + # If it returns 0, then the event will be dropped from the queue, but the + # internal state will still be updated. This allows selective filtering of + # dynamically arriving events. + # + # WARNING: Be very careful of what you do in the event filter function, as + # it may run in a different thread! + # + # There is one caveat when dealing with the SDL_QUITEVENT event type. The + # event filter is only called when the window manager desires to close the + # application window. If the event filter returns 1, then the window will + # be closed, otherwise the window will remain open if possible. + # If the quit event is generated by an interrupt signal, it will bypass the + # internal queue and be delivered to the application at the next event poll. +proc SetEventFilter*(filter: TEventFilter){.cdecl, + importc: "SDL_SetEventFilter", dynlib: LibName.} + # Return the current event filter - can be used to "chain" filters. + # If there is no event filter set, this function returns NULL. +proc GetEventFilter*(): TEventFilter{.cdecl, importc: "SDL_GetEventFilter", + dynlib: LibName.} + # This function allows you to set the state of processing certain events. + # If 'state' is set to SDL_IGNORE, that event will be automatically dropped + # from the event queue and will not event be filtered. + # If 'state' is set to SDL_ENABLE, that event will be processed normally. + # If 'state' is set to SDL_QUERY, SDL_EventState() will return the + # current processing state of the specified event. +proc EventState*(theType: UInt8, state: int): UInt8{.cdecl, + importc: "SDL_EventState", dynlib: LibName.} + #------------------------------------------------------------------------------ + # Version Routines + #------------------------------------------------------------------------------ + # This macro can be used to fill a version structure with the compile-time + # version of the SDL library. +proc VERSION*(X: var TVersion) + # This macro turns the version numbers into a numeric value: + # (1,2,3) -> (1203) + # This assumes that there will never be more than 100 patchlevels +proc VERSIONNUM*(X, Y, Z: int): int + # This is the version number macro for the current SDL version +proc COMPILEDVERSION*(): int + # This macro will evaluate to true if compiled with SDL at least X.Y.Z +proc VERSION_ATLEAST*(X: int, Y: int, Z: int): bool + # This function gets the version of the dynamically linked SDL library. + # it should NOT be used to fill a version structure, instead you should + # use the SDL_Version() macro. +proc Linked_Version*(): Pversion{.cdecl, importc: "SDL_Linked_Version", + dynlib: LibName.} + #------------------------------------------------------------------------------ + # video + #------------------------------------------------------------------------------ + # These functions are used internally, and should not be used unless you + # have a specific need to specify the video driver you want to use. + # You should normally use SDL_Init() or SDL_InitSubSystem(). + # + # SDL_VideoInit() initializes the video subsystem -- sets up a connection + # to the window manager, etc, and determines the current video mode and + # pixel format, but does not initialize a window or graphics mode. + # Note that event handling is activated by this routine. + # + # If you use both sound and video in your application, you need to call + # SDL_Init() before opening the sound device, otherwise under Win32 DirectX, + # you won't be able to set full-screen display modes. +proc VideoInit*(driver_name: cstring, flags: UInt32): int{.cdecl, + importc: "SDL_VideoInit", dynlib: LibName.} +proc VideoQuit*(){.cdecl, importc: "SDL_VideoQuit", dynlib: LibName.} + # This function fills the given character buffer with the name of the + # video driver, and returns a pointer to it if the video driver has + # been initialized. It returns NULL if no driver has been initialized. +proc VideoDriverName*(namebuf: cstring, maxlen: int): cstring{.cdecl, + importc: "SDL_VideoDriverName", dynlib: LibName.} + # This function returns a pointer to the current display surface. + # If SDL is doing format conversion on the display surface, this + # function returns the publicly visible surface, not the real video + # surface. +proc GetVideoSurface*(): PSurface{.cdecl, importc: "SDL_GetVideoSurface", + dynlib: LibName.} + # This function returns a read-only pointer to information about the + # video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' + # member of the returned structure will contain the pixel format of the + # "best" video mode. +proc GetVideoInfo*(): PVideoInfo{.cdecl, importc: "SDL_GetVideoInfo", + dynlib: LibName.} + # Check to see if a particular video mode is supported. + # It returns 0 if the requested mode is not supported under any bit depth, + # or returns the bits-per-pixel of the closest available mode with the + # given width and height. If this bits-per-pixel is different from the + # one used when setting the video mode, SDL_SetVideoMode() will succeed, + # but will emulate the requested bits-per-pixel with a shadow surface. + # + # The arguments to SDL_VideoModeOK() are the same ones you would pass to + # SDL_SetVideoMode() +proc VideoModeOK*(width, height, bpp: int, flags: UInt32): int{.cdecl, + importc: "SDL_VideoModeOK", importc: "SDL_VideoModeOK", dynlib: LibName.} + # Return a pointer to an array of available screen dimensions for the + # given format and video flags, sorted largest to smallest. Returns + # NULL if there are no dimensions available for a particular format, + # or (SDL_Rect **)-1 if any dimension is okay for the given format. + # + # if 'format' is NULL, the mode list will be for the format given + # by SDL_GetVideoInfo( ) - > vfmt +proc ListModes*(format: PPixelFormat, flags: UInt32): PPSDL_Rect{.cdecl, + importc: "SDL_ListModes", dynlib: LibName.} + # Set up a video mode with the specified width, height and bits-per-pixel. + # + # If 'bpp' is 0, it is treated as the current display bits per pixel. + # + # If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the + # requested bits-per-pixel, but will return whatever video pixel format is + # available. The default is to emulate the requested pixel format if it + # is not natively available. + # + # If SDL_HWSURFACE is set in 'flags', the video surface will be placed in + # video memory, if possible, and you may have to call SDL_LockSurface() + # in order to access the raw framebuffer. Otherwise, the video surface + # will be created in system memory. + # + # If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle + # updates asynchronously, but you must always lock before accessing pixels. + # SDL will wait for updates to complete before returning from the lock. + # + # If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee + # that the colors set by SDL_SetColors() will be the colors you get. + # Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all + # of the colors exactly the way they are requested, and you should look + # at the video surface structure to determine the actual palette. + # If SDL cannot guarantee that the colors you request can be set, + # i.e. if the colormap is shared, then the video surface may be created + # under emulation in system memory, overriding the SDL_HWSURFACE flag. + # + # If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set + # a fullscreen video mode. The default is to create a windowed mode + # if the current graphics system has a window manager. + # If the SDL library is able to set a fullscreen video mode, this flag + # will be set in the surface that is returned. + # + # If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up + # two surfaces in video memory and swap between them when you call + # SDL_Flip(). This is usually slower than the normal single-buffering + # scheme, but prevents "tearing" artifacts caused by modifying video + # memory while the monitor is refreshing. It should only be used by + # applications that redraw the entire screen on every update. + # + # This function returns the video framebuffer surface, or NULL if it fails. +proc SetVideoMode*(width, height, bpp: int, flags: UInt32): PSurface{.cdecl, + importc: "SDL_SetVideoMode", dynlib: LibName.} + # Makes sure the given list of rectangles is updated on the given screen. + # If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire + # screen. + # These functions should not be called while 'screen' is locked. +proc UpdateRects*(screen: PSurface, numrects: int, rects: PRect){.cdecl, + importc: "SDL_UpdateRects", dynlib: LibName.} +proc UpdateRect*(screen: PSurface, x, y: SInt32, w, h: UInt32){.cdecl, + importc: "SDL_UpdateRect", dynlib: LibName.} + # On hardware that supports double-buffering, this function sets up a flip + # and returns. The hardware will wait for vertical retrace, and then swap + # video buffers before the next video surface blit or lock will return. + # On hardware that doesn not support double-buffering, this is equivalent + # to calling SDL_UpdateRect(screen, 0, 0, 0, 0); + # The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when + # setting the video mode for this function to perform hardware flipping. + # This function returns 0 if successful, or -1 if there was an error. +proc Flip*(screen: PSurface): int{.cdecl, importc: "SDL_Flip", dynlib: LibName.} + # Set the gamma correction for each of the color channels. + # The gamma values range (approximately) between 0.1 and 10.0 + # + # If this function isn't supported directly by the hardware, it will + # be emulated using gamma ramps, if available. If successful, this + # function returns 0, otherwise it returns -1. +proc SetGamma*(redgamma: float32, greengamma: float32, bluegamma: float32): int{. + cdecl, importc: "SDL_SetGamma", dynlib: LibName.} + # Set the gamma translation table for the red, green, and blue channels + # of the video hardware. Each table is an array of 256 16-bit quantities, + # representing a mapping between the input and output for that channel. + # The input is the index into the array, and the output is the 16-bit + # gamma value at that index, scaled to the output color precision. + # + # You may pass NULL for any of the channels to leave it unchanged. + # If the call succeeds, it will return 0. If the display driver or + # hardware does not support gamma translation, or otherwise fails, + # this function will return -1. +proc SetGammaRamp*(redtable: PUInt16, greentable: PUInt16, bluetable: PUInt16): int{. + cdecl, importc: "SDL_SetGammaRamp", dynlib: LibName.} + # Retrieve the current values of the gamma translation tables. + # + # You must pass in valid pointers to arrays of 256 16-bit quantities. + # Any of the pointers may be NULL to ignore that channel. + # If the call succeeds, it will return 0. If the display driver or + # hardware does not support gamma translation, or otherwise fails, + # this function will return -1. +proc GetGammaRamp*(redtable: PUInt16, greentable: PUInt16, bluetable: PUInt16): int{. + cdecl, importc: "SDL_GetGammaRamp", dynlib: LibName.} + # Sets a portion of the colormap for the given 8-bit surface. If 'surface' + # is not a palettized surface, this function does nothing, returning 0. + # If all of the colors were set as passed to SDL_SetColors(), it will + # return 1. If not all the color entries were set exactly as given, + # it will return 0, and you should look at the surface palette to + # determine the actual color palette. + # + # When 'surface' is the surface associated with the current display, the + # display colormap will be updated with the requested colors. If + # SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() + # will always return 1, and the palette is guaranteed to be set the way + # you desire, even if the window colormap has to be warped or run under + # emulation. +proc SetColors*(surface: PSurface, colors: PColor, firstcolor: int, ncolors: int): int{. + cdecl, importc: "SDL_SetColors", dynlib: LibName.} + # Sets a portion of the colormap for a given 8-bit surface. + # 'flags' is one or both of: + # SDL_LOGPAL -- set logical palette, which controls how blits are mapped + # to/from the surface, + # SDL_PHYSPAL -- set physical palette, which controls how pixels look on + # the screen + # Only screens have physical palettes. Separate change of physical/logical + # palettes is only possible if the screen has SDL_HWPALETTE set. + # + # The return value is 1 if all colours could be set as requested, and 0 + # otherwise. + # + # SDL_SetColors() is equivalent to calling this function with + # flags = (SDL_LOGPAL or SDL_PHYSPAL). +proc SetPalette*(surface: PSurface, flags: int, colors: PColor, firstcolor: int, + ncolors: int): int{.cdecl, importc: "SDL_SetPalette", + dynlib: LibName.} + # Maps an RGB triple to an opaque pixel value for a given pixel format +proc MapRGB*(format: PPixelFormat, r: UInt8, g: UInt8, b: UInt8): UInt32{.cdecl, + importc: "SDL_MapRGB", dynlib: LibName.} + # Maps an RGBA quadruple to a pixel value for a given pixel format +proc MapRGBA*(format: PPixelFormat, r: UInt8, g: UInt8, b: UInt8, a: UInt8): UInt32{. + cdecl, importc: "SDL_MapRGBA", dynlib: LibName.} + # Maps a pixel value into the RGB components for a given pixel format +proc GetRGB*(pixel: UInt32, fmt: PPixelFormat, r: PUInt8, g: PUInt8, b: PUInt8){. + cdecl, importc: "SDL_GetRGB", dynlib: LibName.} + # Maps a pixel value into the RGBA components for a given pixel format +proc GetRGBA*(pixel: UInt32, fmt: PPixelFormat, r: PUInt8, g: PUInt8, b: PUInt8, + a: PUInt8){.cdecl, importc: "SDL_GetRGBA", dynlib: LibName.} + # Allocate and free an RGB surface (must be called after SDL_SetVideoMode) + # If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + # If the depth is greater than 8 bits, the pixel format is set using the + # flags '[RGB]mask'. + # If the function runs out of memory, it will return NULL. + # + # The 'flags' tell what kind of surface to create. + # SDL_SWSURFACE means that the surface should be created in system memory. + # SDL_HWSURFACE means that the surface should be created in video memory, + # with the same format as the display surface. This is useful for surfaces + # that will not change much, to take advantage of hardware acceleration + # when being blitted to the display surface. + # SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with + # this surface, but you must always lock it before accessing the pixels. + # SDL will wait for current blits to finish before returning from the lock. + # SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. + # If the hardware supports acceleration of colorkey blits between + # two surfaces in video memory, SDL will try to place the surface in + # video memory. If this isn't possible or if there is no hardware + # acceleration available, the surface will be placed in system memory. + # SDL_SRCALPHA means that the surface will be used for alpha blits and + # if the hardware supports hardware acceleration of alpha blits between + # two surfaces in video memory, to place the surface in video memory + # if possible, otherwise it will be placed in system memory. + # If the surface is created in video memory, blits will be _much_ faster, + # but the surface format must be identical to the video surface format, + # and the only way to access the pixels member of the surface is to use + # the SDL_LockSurface() and SDL_UnlockSurface() calls. + # If the requested surface actually resides in video memory, SDL_HWSURFACE + # will be set in the flags member of the returned surface. If for some + # reason the surface could not be placed in video memory, it will not have + # the SDL_HWSURFACE flag set, and will be created in system memory instead. +proc AllocSurface*(flags: UInt32, width, height, depth: int, + RMask, GMask, BMask, AMask: UInt32): PSurface +proc CreateRGBSurface*(flags: UInt32, width, height, depth: int, + RMask, GMask, BMask, AMask: UInt32): PSurface{.cdecl, + importc: "SDL_CreateRGBSurface", dynlib: LibName.} +proc CreateRGBSurfaceFrom*(pixels: Pointer, width, height, depth, pitch: int, + RMask, GMask, BMask, AMask: UInt32): PSurface{.cdecl, + importc: "SDL_CreateRGBSurfaceFrom", dynlib: LibName.} +proc FreeSurface*(surface: PSurface){.cdecl, importc: "SDL_FreeSurface", + dynlib: LibName.} +proc MustLock*(Surface: PSurface): bool + # SDL_LockSurface() sets up a surface for directly accessing the pixels. + # Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write + # to and read from 'surface->pixels', using the pixel format stored in + # 'surface->format'. Once you are done accessing the surface, you should + # use SDL_UnlockSurface() to release it. + # + # Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + # to 0, then you can read and write to the surface at any time, and the + # pixel format of the surface will not change. In particular, if the + # SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you + # will not need to lock the display surface before accessing it. + # + # No operating system or library calls should be made between lock/unlock + # pairs, as critical system locks may be held during this time. + # + # SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. +proc LockSurface*(surface: PSurface): int{.cdecl, importc: "SDL_LockSurface", + dynlib: LibName.} +proc UnlockSurface*(surface: PSurface){.cdecl, importc: "SDL_UnlockSurface", + dynlib: LibName.} + # Load a surface from a seekable SDL data source (memory or file.) + # If 'freesrc' is non-zero, the source will be closed after being read. + # Returns the new surface, or NULL if there was an error. + # The new surface should be freed with SDL_FreeSurface(). +proc LoadBMP_RW*(src: PRWops, freesrc: int): PSurface{.cdecl, + importc: "SDL_LoadBMP_RW", dynlib: LibName.} + # Convenience macro -- load a surface from a file +proc LoadBMP*(filename: cstring): PSurface + # Save a surface to a seekable SDL data source (memory or file.) + # If 'freedst' is non-zero, the source will be closed after being written. + # Returns 0 if successful or -1 if there was an error. +proc SaveBMP_RW*(surface: PSurface, dst: PRWops, freedst: int): int{.cdecl, + importc: "SDL_SaveBMP_RW", dynlib: LibName.} + # Convenience macro -- save a surface to a file +proc SaveBMP*(surface: PSurface, filename: cstring): int + # Sets the color key (transparent pixel) in a blittable surface. + # If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), + # 'key' will be the transparent pixel in the source image of a blit. + # SDL_RLEACCEL requests RLE acceleration for the surface if present, + # and removes RLE acceleration if absent. + # If 'flag' is 0, this function clears any current color key. + # This function returns 0, or -1 if there was an error. +proc SetColorKey*(surface: PSurface, flag, key: UInt32): int{.cdecl, + importc: "SDL_SetColorKey", dynlib: LibName.} + # This function sets the alpha value for the entire surface, as opposed to + # using the alpha component of each pixel. This value measures the range + # of transparency of the surface, 0 being completely transparent to 255 + # being completely opaque. An 'alpha' value of 255 causes blits to be + # opaque, the source pixels copied to the destination (the default). Note + # that per-surface alpha can be combined with colorkey transparency. + # + # If 'flag' is 0, alpha blending is disabled for the surface. + # If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. + # OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the + # surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. +proc SetAlpha*(surface: PSurface, flag: UInt32, alpha: UInt8): int{.cdecl, + importc: "SDL_SetAlpha", dynlib: LibName.} + # Sets the clipping rectangle for the destination surface in a blit. + # + # If the clip rectangle is NULL, clipping will be disabled. + # If the clip rectangle doesn't intersect the surface, the function will + # return SDL_FALSE and blits will be completely clipped. Otherwise the + # function returns SDL_TRUE and blits to the surface will be clipped to + # the intersection of the surface area and the clipping rectangle. + # + # Note that blits are automatically clipped to the edges of the source + # and destination surfaces. +proc SetClipRect*(surface: PSurface, rect: PRect){.cdecl, + importc: "SDL_SetClipRect", dynlib: LibName.} + # Gets the clipping rectangle for the destination surface in a blit. + # 'rect' must be a pointer to a valid rectangle which will be filled + # with the correct values. +proc GetClipRect*(surface: PSurface, rect: PRect){.cdecl, + importc: "SDL_GetClipRect", dynlib: LibName.} + # Creates a new surface of the specified format, and then copies and maps + # the given surface to it so the blit of the converted surface will be as + # fast as possible. If this function fails, it returns NULL. + # + # The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those + # semantics. You can also pass SDL_RLEACCEL in the flags parameter and + # SDL will try to RLE accelerate colorkey and alpha blits in the resulting + # surface. + # + # This function is used internally by SDL_DisplayFormat(). +proc ConvertSurface*(src: PSurface, fmt: PPixelFormat, flags: UInt32): PSurface{. + cdecl, importc: "SDL_ConvertSurface", dynlib: LibName.} + # + # This performs a fast blit from the source surface to the destination + # surface. It assumes that the source and destination rectangles are + # the same size. If either 'srcrect' or 'dstrect' are NULL, the entire + # surface (src or dst) is copied. The final blit rectangles are saved + # in 'srcrect' and 'dstrect' after all clipping is performed. + # If the blit is successful, it returns 0, otherwise it returns -1. + # + # The blit function should not be called on a locked surface. + # + # The blit semantics for surfaces with and without alpha and colorkey + # are defined as follows: + # + # RGBA->RGB: + # SDL_SRCALPHA set: + # alpha-blend (using alpha-channel). + # SDL_SRCCOLORKEY ignored. + # SDL_SRCALPHA not set: + # copy RGB. + # if SDL_SRCCOLORKEY set, only copy the pixels matching the + # RGB values of the source colour key, ignoring alpha in the + # comparison. + # + # RGB->RGBA: + # SDL_SRCALPHA set: + # alpha-blend (using the source per-surface alpha value); + # set destination alpha to opaque. + # SDL_SRCALPHA not set: + # copy RGB, set destination alpha to opaque. + # both: + # if SDL_SRCCOLORKEY set, only copy the pixels matching the + # source colour key. + # + # RGBA->RGBA: + # SDL_SRCALPHA set: + # alpha-blend (using the source alpha channel) the RGB values; + # leave destination alpha untouched. [Note: is this correct?] + # SDL_SRCCOLORKEY ignored. + # SDL_SRCALPHA not set: + # copy all of RGBA to the destination. + # if SDL_SRCCOLORKEY set, only copy the pixels matching the + # RGB values of the source colour key, ignoring alpha in the + # comparison. + # + # RGB->RGB: + # SDL_SRCALPHA set: + # alpha-blend (using the source per-surface alpha value). + # SDL_SRCALPHA not set: + # copy RGB. + # both: + # if SDL_SRCCOLORKEY set, only copy the pixels matching the + # source colour key. + # + # If either of the surfaces were in video memory, and the blit returns -2, + # the video memory was lost, so it should be reloaded with artwork and + # re-blitted: + # while ( SDL_BlitSurface(image, imgrect, screen, dstrect) = -2 ) do + # begin + # while ( SDL_LockSurface(image) < 0 ) do + # Sleep(10); + # -- Write image pixels to image->pixels -- + # SDL_UnlockSurface(image); + # end; + # + # This happens under DirectX 5.0 when the system switches away from your + # fullscreen application. The lock will also fail until you have access + # to the video memory again. + # You should call SDL_BlitSurface() unless you know exactly how SDL + # blitting works internally and how to use the other blit functions. +proc BlitSurface*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int + # This is the public blit function, SDL_BlitSurface(), and it performs + # rectangle validation and clipping before passing it to SDL_LowerBlit() +proc UpperBlit*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int{. + cdecl, importc: "SDL_UpperBlit", dynlib: LibName.} + # This is a semi-private blit function and it performs low-level surface + # blitting only. +proc LowerBlit*(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int{. + cdecl, importc: "SDL_LowerBlit", dynlib: LibName.} + # This function performs a fast fill of the given rectangle with 'color' + # The given rectangle is clipped to the destination surface clip area + # and the final fill rectangle is saved in the passed in pointer. + # If 'dstrect' is NULL, the whole surface will be filled with 'color' + # The color should be a pixel of the format used by the surface, and + # can be generated by the SDL_MapRGB() function. + # This function returns 0 on success, or -1 on error. +proc FillRect*(dst: PSurface, dstrect: PRect, color: UInt32): int{.cdecl, + importc: "SDL_FillRect", dynlib: LibName.} + # This function takes a surface and copies it to a new surface of the + # pixel format and colors of the video framebuffer, suitable for fast + # blitting onto the display surface. It calls SDL_ConvertSurface() + # + # If you want to take advantage of hardware colorkey or alpha blit + # acceleration, you should set the colorkey and alpha value before + # calling this function. + # + # If the conversion fails or runs out of memory, it returns NULL +proc DisplayFormat*(surface: PSurface): PSurface{.cdecl, + importc: "SDL_DisplayFormat", dynlib: LibName.} + # This function takes a surface and copies it to a new surface of the + # pixel format and colors of the video framebuffer (if possible), + # suitable for fast alpha blitting onto the display surface. + # The new surface will always have an alpha channel. + # + # If you want to take advantage of hardware colorkey or alpha blit + # acceleration, you should set the colorkey and alpha value before + # calling this function. + # + # If the conversion fails or runs out of memory, it returns NULL +proc DisplayFormatAlpha*(surface: PSurface): PSurface{.cdecl, + importc: "SDL_DisplayFormatAlpha", dynlib: LibName.} + #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + #* YUV video surface overlay functions */ + #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + # This function creates a video output overlay + # Calling the returned surface an overlay is something of a misnomer because + # the contents of the display surface underneath the area where the overlay + # is shown is undefined - it may be overwritten with the converted YUV data. +proc CreateYUVOverlay*(width: int, height: int, format: UInt32, + display: PSurface): POverlay{.cdecl, + importc: "SDL_CreateYUVOverlay", dynlib: LibName.} + # Lock an overlay for direct access, and unlock it when you are done +proc LockYUVOverlay*(Overlay: POverlay): int{.cdecl, + importc: "SDL_LockYUVOverlay", dynlib: LibName.} +proc UnlockYUVOverlay*(Overlay: POverlay){.cdecl, + importc: "SDL_UnlockYUVOverlay", dynlib: LibName.} + # Blit a video overlay to the display surface. + # The contents of the video surface underneath the blit destination are + # not defined. + # The width and height of the destination rectangle may be different from + # that of the overlay, but currently only 2x scaling is supported. +proc DisplayYUVOverlay*(Overlay: POverlay, dstrect: PRect): int{.cdecl, + importc: "SDL_DisplayYUVOverlay", dynlib: LibName.} + # Free a video overlay +proc FreeYUVOverlay*(Overlay: POverlay){.cdecl, importc: "SDL_FreeYUVOverlay", + dynlib: LibName.} + #------------------------------------------------------------------------------ + # OpenGL Routines + #------------------------------------------------------------------------------ + # Dynamically load a GL driver, if SDL is built with dynamic GL. + # + # SDL links normally with the OpenGL library on your system by default, + # but you can compile it to dynamically load the GL driver at runtime. + # If you do this, you need to retrieve all of the GL functions used in + # your program from the dynamic library using SDL_GL_GetProcAddress(). + # + # This is disabled in default builds of SDL. +proc GL_LoadLibrary*(filename: cstring): int{.cdecl, + importc: "SDL_GL_LoadLibrary", dynlib: LibName.} + # Get the address of a GL function (for extension functions) +proc GL_GetProcAddress*(procname: cstring): Pointer{.cdecl, + importc: "SDL_GL_GetProcAddress", dynlib: LibName.} + # Set an attribute of the OpenGL subsystem before intialization. +proc GL_SetAttribute*(attr: TGLAttr, value: int): int{.cdecl, + importc: "SDL_GL_SetAttribute", dynlib: LibName.} + # Get an attribute of the OpenGL subsystem from the windowing + # interface, such as glX. This is of course different from getting + # the values from SDL's internal OpenGL subsystem, which only + # stores the values you request before initialization. + # + # Developers should track the values they pass into SDL_GL_SetAttribute + # themselves if they want to retrieve these values. +proc GL_GetAttribute*(attr: TGLAttr, value: var int): int{.cdecl, + importc: "SDL_GL_GetAttribute", dynlib: LibName.} + # Swap the OpenGL buffers, if double-buffering is supported. +proc GL_SwapBuffers*(){.cdecl, importc: "SDL_GL_SwapBuffers", dynlib: LibName.} + # Internal functions that should not be called unless you have read + # and understood the source code for these functions. +proc GL_UpdateRects*(numrects: int, rects: PRect){.cdecl, + importc: "SDL_GL_UpdateRects", dynlib: LibName.} +proc GL_Lock*(){.cdecl, importc: "SDL_GL_Lock", dynlib: LibName.} +proc GL_Unlock*(){.cdecl, importc: "SDL_GL_Unlock", dynlib: LibName.} + #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + #* These functions allow interaction with the window manager, if any. * + #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Sets/Gets the title and icon text of the display window +proc WM_GetCaption*(title: var cstring, icon: var cstring){.cdecl, + importc: "SDL_WM_GetCaption", dynlib: LibName.} +proc WM_SetCaption*(title: cstring, icon: cstring){.cdecl, + importc: "SDL_WM_SetCaption", dynlib: LibName.} + # Sets the icon for the display window. + # This function must be called before the first call to SDL_SetVideoMode(). + # It takes an icon surface, and a mask in MSB format. + # If 'mask' is NULL, the entire icon surface will be used as the icon. +proc WM_SetIcon*(icon: PSurface, mask: UInt8){.cdecl, importc: "SDL_WM_SetIcon", + dynlib: LibName.} + # This function iconifies the window, and returns 1 if it succeeded. + # If the function succeeds, it generates an SDL_APPACTIVE loss event. + # This function is a noop and returns 0 in non-windowed environments. +proc WM_IconifyWindow*(): int{.cdecl, importc: "SDL_WM_IconifyWindow", + dynlib: LibName.} + # Toggle fullscreen mode without changing the contents of the screen. + # If the display surface does not require locking before accessing + # the pixel information, then the memory pointers will not change. + # + # If this function was able to toggle fullscreen mode (change from + # running in a window to fullscreen, or vice-versa), it will return 1. + # If it is not implemented, or fails, it returns 0. + # + # The next call to SDL_SetVideoMode() will set the mode fullscreen + # attribute based on the flags parameter - if SDL_FULLSCREEN is not + # set, then the display will be windowed by default where supported. + # + # This is currently only implemented in the X11 video driver. +proc WM_ToggleFullScreen*(surface: PSurface): int{.cdecl, + importc: "SDL_WM_ToggleFullScreen", dynlib: LibName.} + # Grabbing means that the mouse is confined to the application window, + # and nearly all keyboard input is passed directly to the application, + # and not interpreted by a window manager, if any. +proc WM_GrabInput*(mode: TGrabMode): TGrabMode{.cdecl, + importc: "SDL_WM_GrabInput", dynlib: LibName.} + #------------------------------------------------------------------------------ + # mouse-routines + #------------------------------------------------------------------------------ + # Retrieve the current state of the mouse. + # The current button state is returned as a button bitmask, which can + # be tested using the SDL_BUTTON(X) macros, and x and y are set to the + # current mouse cursor position. You can pass NULL for either x or y. +proc GetMouseState*(x: var int, y: var int): UInt8{.cdecl, + importc: "SDL_GetMouseState", dynlib: LibName.} + # Retrieve the current state of the mouse. + # The current button state is returned as a button bitmask, which can + # be tested using the SDL_BUTTON(X) macros, and x and y are set to the + # mouse deltas since the last call to SDL_GetRelativeMouseState(). +proc GetRelativeMouseState*(x: var int, y: var int): UInt8{.cdecl, + importc: "SDL_GetRelativeMouseState", dynlib: LibName.} + # Set the position of the mouse cursor (generates a mouse motion event) +proc WarpMouse*(x, y: UInt16){.cdecl, importc: "SDL_WarpMouse", dynlib: LibName.} + # Create a cursor using the specified data and mask (in MSB format). + # The cursor width must be a multiple of 8 bits. + # + # The cursor is created in black and white according to the following: + # data mask resulting pixel on screen + # 0 1 White + # 1 1 Black + # 0 0 Transparent + # 1 0 Inverted color if possible, black if not. + # + # Cursors created with this function must be freed with SDL_FreeCursor(). +proc CreateCursor*(data, mask: PUInt8, w, h, hot_x, hot_y: int): PCursor{.cdecl, + importc: "SDL_CreateCursor", dynlib: LibName.} + # Set the currently active cursor to the specified one. + # If the cursor is currently visible, the change will be immediately + # represented on the display. +proc SetCursor*(cursor: PCursor){.cdecl, importc: "SDL_SetCursor", + dynlib: LibName.} + # Returns the currently active cursor. +proc GetCursor*(): PCursor{.cdecl, importc: "SDL_GetCursor", dynlib: LibName.} + # Deallocates a cursor created with SDL_CreateCursor(). +proc FreeCursor*(cursor: PCursor){.cdecl, importc: "SDL_FreeCursor", + dynlib: LibName.} + # Toggle whether or not the cursor is shown on the screen. + # The cursor start off displayed, but can be turned off. + # SDL_ShowCursor() returns 1 if the cursor was being displayed + # before the call, or 0 if it was not. You can query the current + # state by passing a 'toggle' value of -1. +proc ShowCursor*(toggle: int): int{.cdecl, importc: "SDL_ShowCursor", + dynlib: LibName.} +proc BUTTON*(Button: int): int + #------------------------------------------------------------------------------ + # Keyboard-routines + #------------------------------------------------------------------------------ + # Enable/Disable UNICODE translation of keyboard input. + # This translation has some overhead, so translation defaults off. + # If 'enable' is 1, translation is enabled. + # If 'enable' is 0, translation is disabled. + # If 'enable' is -1, the translation state is not changed. + # It returns the previous state of keyboard translation. +proc EnableUNICODE*(enable: int): int{.cdecl, importc: "SDL_EnableUNICODE", + dynlib: LibName.} + # If 'delay' is set to 0, keyboard repeat is disabled. +proc EnableKeyRepeat*(delay: int, interval: int): int{.cdecl, + importc: "SDL_EnableKeyRepeat", dynlib: LibName.} +proc GetKeyRepeat*(delay: PInteger, interval: PInteger){.cdecl, + importc: "SDL_GetKeyRepeat", dynlib: LibName.} + # Get a snapshot of the current state of the keyboard. + # Returns an array of keystates, indexed by the SDLK_* syms. + # Used: + # + # UInt8 *keystate = SDL_GetKeyState(NULL); + # if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed +proc GetKeyState*(numkeys: PInt): PUInt8{.cdecl, importc: "SDL_GetKeyState", + dynlib: LibName.} + # Get the current key modifier state +proc GetModState*(): TMod{.cdecl, importc: "SDL_GetModState", dynlib: LibName.} + # Set the current key modifier state + # This does not change the keyboard state, only the key modifier flags. +proc SetModState*(modstate: TMod){.cdecl, importc: "SDL_SetModState", + dynlib: LibName.} + # Get the name of an SDL virtual keysym +proc GetKeyName*(key: TKey): cstring{.cdecl, importc: "SDL_GetKeyName", + dynlib: LibName.} + #------------------------------------------------------------------------------ + # Active Routines + #------------------------------------------------------------------------------ + # This function returns the current state of the application, which is a + # bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and + # SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to + # see your application, otherwise it has been iconified or disabled. +proc GetAppState*(): UInt8{.cdecl, importc: "SDL_GetAppState", dynlib: LibName.} + # Mutex functions + # Create a mutex, initialized unlocked +proc CreateMutex*(): PMutex{.cdecl, importc: "SDL_CreateMutex", dynlib: LibName.} + # Lock the mutex (Returns 0, or -1 on error) +proc mutexP*(mutex: Pmutex): int{.cdecl, importc: "SDL_mutexP", dynlib: LibName.} +proc LockMutex*(mutex: Pmutex): int + # Unlock the mutex (Returns 0, or -1 on error) +proc mutexV*(mutex: Pmutex): int{.cdecl, importc: "SDL_mutexV", dynlib: LibName.} +proc UnlockMutex*(mutex: Pmutex): int + # Destroy a mutex +proc DestroyMutex*(mutex: Pmutex){.cdecl, importc: "SDL_DestroyMutex", + dynlib: LibName.} + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Semaphore functions + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Create a semaphore, initialized with value, returns NULL on failure. +proc CreateSemaphore*(initial_value: UInt32): PSem{.cdecl, + importc: "SDL_CreateSemaphore", dynlib: LibName.} + # Destroy a semaphore +proc DestroySemaphore*(sem: Psem){.cdecl, importc: "SDL_DestroySemaphore", + dynlib: LibName.} + # This function suspends the calling thread until the semaphore pointed + # to by sem has a positive count. It then atomically decreases the semaphore + # count. +proc SemWait*(sem: Psem): int{.cdecl, importc: "SDL_SemWait", dynlib: LibName.} + # Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, + # SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. +proc SemTryWait*(sem: Psem): int{.cdecl, importc: "SDL_SemTryWait", + dynlib: LibName.} + # Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if + # the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in + # the allotted time, and -1 on error. + # On some platforms this function is implemented by looping with a delay + # of 1 ms, and so should be avoided if possible. +proc SemWaitTimeout*(sem: Psem, ms: UInt32): int{.cdecl, + importc: "SDL_SemWaitTimeout", dynlib: LibName.} + # Atomically increases the semaphore's count (not blocking), returns 0, + # or -1 on error. +proc SemPost*(sem: Psem): int{.cdecl, importc: "SDL_SemPost", dynlib: LibName.} + # Returns the current count of the semaphore +proc SemValue*(sem: Psem): UInt32{.cdecl, importc: "SDL_SemValue", + dynlib: LibName.} + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Condition variable functions + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Create a condition variable +proc CreateCond*(): PCond{.cdecl, importc: "SDL_CreateCond", dynlib: LibName.} + # Destroy a condition variable +proc DestroyCond*(cond: PCond){.cdecl, importc: "SDL_DestroyCond", + dynlib: LibName.} + # Restart one of the threads that are waiting on the condition variable, + # returns 0 or -1 on error. +proc CondSignal*(cond: Pcond): int{.cdecl, importc: "SDL_CondSignal", + dynlib: LibName.} + # Restart all threads that are waiting on the condition variable, + # returns 0 or -1 on error. +proc CondBroadcast*(cond: Pcond): int{.cdecl, importc: "SDL_CondBroadcast", + dynlib: LibName.} + # Wait on the condition variable, unlocking the provided mutex. + # The mutex must be locked before entering this function! + # Returns 0 when it is signaled, or -1 on error. +proc CondWait*(cond: Pcond, mut: Pmutex): int{.cdecl, importc: "SDL_CondWait", + dynlib: LibName.} + # Waits for at most 'ms' milliseconds, and returns 0 if the condition + # variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not + # signaled in the allotted time, and -1 on error. + # On some platforms this function is implemented by looping with a delay + # of 1 ms, and so should be avoided if possible. +proc CondWaitTimeout*(cond: Pcond, mut: Pmutex, ms: UInt32): int{.cdecl, + importc: "SDL_CondWaitTimeout", dynlib: LibName.} + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Condition variable functions + # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + # Create a thread +proc CreateThread*(fn: PInt, data: Pointer): PThread{.cdecl, + importc: "SDL_CreateThread", dynlib: LibName.} + # Get the 32-bit thread identifier for the current thread +proc ThreadID*(): UInt32{.cdecl, importc: "SDL_ThreadID", dynlib: LibName.} + # Get the 32-bit thread identifier for the specified thread, + # equivalent to SDL_ThreadID() if the specified thread is NULL. +proc GetThreadID*(thread: PThread): UInt32{.cdecl, importc: "SDL_GetThreadID", + dynlib: LibName.} + # Wait for a thread to finish. + # The return code for the thread function is placed in the area + # pointed to by 'status', if 'status' is not NULL. +proc WaitThread*(thread: PThread, status: var int){.cdecl, + importc: "SDL_WaitThread", dynlib: LibName.} + # Forcefully kill a thread without worrying about its state +proc KillThread*(thread: PThread){.cdecl, importc: "SDL_KillThread", + dynlib: LibName.} + #------------------------------------------------------------------------------ + # Get Environment Routines + #------------------------------------------------------------------------------ + #* + # * This function gives you custom hooks into the window manager information. + # * It fills the structure pointed to by 'info' with custom information and + # * returns 1 if the function is implemented. If it's not implemented, or + # * the version member of the 'info' structure is invalid, it returns 0. + # * +proc GetWMInfo*(info: PSysWMinfo): int{.cdecl, importc: "SDL_GetWMInfo", + dynlib: LibName.} + #------------------------------------------------------------------------------ + #SDL_loadso.h + #* This function dynamically loads a shared object and returns a pointer + # * to the object handle (or NULL if there was an error). + # * The 'sofile' parameter is a system dependent name of the object file. + # * +proc LoadObject*(sofile: cstring): Pointer{.cdecl, importc: "SDL_LoadObject", + dynlib: LibName.} + #* Given an object handle, this function looks up the address of the + # * named function in the shared object and returns it. This address + # * is no longer valid after calling SDL_UnloadObject(). + # * +proc LoadFunction*(handle: Pointer, name: cstring): Pointer{.cdecl, + importc: "SDL_LoadFunction", dynlib: LibName.} + #* Unload a shared object from memory * +proc UnloadObject*(handle: Pointer){.cdecl, importc: "SDL_UnloadObject", + dynlib: LibName.} + #------------------------------------------------------------------------------ +proc Swap32*(D: Uint32): Uint32 + # Bitwise Checking functions +proc IsBitOn*(value: int, bit: int8): bool +proc TurnBitOn*(value: int, bit: int8): int +proc TurnBitOff*(value: int, bit: int8): int +# implementation + +proc TABLESIZE(table: cstring): int = + Result = SizeOf(table) div SizeOf(table[0]) + +proc OutOfMemory() = + when not (defined(WINDOWS)): Error(ENOMEM) + +proc RWSeek(context: PRWops, offset: int, whence: int): int = + Result = context.seek(context, offset, whence) + +proc RWTell(context: PRWops): int = + Result = context.seek(context, 0, 1) + +proc RWRead(context: PRWops, theptr: Pointer, size: int, n: int): int = + Result = context.read(context, theptr, size, n) + +proc RWWrite(context: PRWops, theptr: Pointer, size: int, n: int): int = + Result = context.write(context, theptr, size, n) + +proc RWClose(context: PRWops): int = + Result = context.closeFile(context) + +proc LoadWAV(filename: cstring, spec: PAudioSpec, audio_buf: PUInt8, + audiolen: PUInt32): PAudioSpec = + Result = LoadWAV_RW(RWFromFile(filename, "rb"), 1, spec, audio_buf, audiolen) + +proc CDInDrive(status: TCDStatus): bool = + Result = ord(status) > ord(CD_ERROR) + +proc FRAMES_TO_MSF(frames: int, M: var int, S: var int, F: var int) = + var value: int + value = frames + F = value mod CD_FPS + value = value div CD_FPS + S = value mod 60 + value = value div 60 + M = value + +proc MSF_TO_FRAMES(M: int, S: int, F: int): int = + Result = M * 60 * CD_FPS + S * CD_FPS + F + +proc VERSION(X: var TVersion) = + X.major = MAJOR_VERSION + X.minor = MINOR_VERSION + X.patch = PATCHLEVEL + +proc VERSIONNUM(X, Y, Z: int): int = + Result = X * 1000 + Y * 100 + Z + +proc COMPILEDVERSION(): int = + Result = VERSIONNUM(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL) + +proc VERSION_ATLEAST(X, Y, Z: int): bool = + Result = (COMPILEDVERSION() >= VERSIONNUM(X, Y, Z)) + +proc LoadBMP(filename: cstring): PSurface = + Result = LoadBMP_RW(RWFromFile(filename, "rb"), 1) + +proc SaveBMP(surface: PSurface, filename: cstring): int = + Result = SaveBMP_RW(surface, RWFromFile(filename, "wb"), 1) + +proc BlitSurface(src: PSurface, srcrect: PRect, dst: PSurface, dstrect: PRect): int = + Result = UpperBlit(src, srcrect, dst, dstrect) + +proc AllocSurface(flags: UInt32, width, height, depth: int, + RMask, GMask, BMask, AMask: UInt32): PSurface = + Result = CreateRGBSurface(flags, width, height, depth, RMask, GMask, BMask, + AMask) + +proc MustLock(Surface: PSurface): bool = + Result = ((surface^ .offset != 0) or + ((surface^ .flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0)) + +proc LockMutex(mutex: Pmutex): int = + Result = mutexP(mutex) + +proc UnlockMutex(mutex: Pmutex): int = + Result = mutexV(mutex) + +proc BUTTON(Button: int): int = + Result = PRESSED shl (Button - 1) + +proc Swap32(D: Uint32): Uint32 = + Result = ((D shl 24) or ((D shl 8) and 0x00FF0000) or + ((D shr 8) and 0x0000FF00) or (D shr 24)) + +proc IsBitOn(value: int, bit: int8): bool = + result = ((value and (1 shl ze(bit))) != 0) + +proc TurnBitOn(value: int, bit: int8): int = + result = (value or (1 shl ze(bit))) + +proc TurnBitOff(value: int, bit: int8): int = + result = (value and not (1 shl ze(bit))) diff --git a/lib/newwrap/sdl/sdl_gfx.nim b/lib/newwrap/sdl/sdl_gfx.nim new file mode 100644 index 000000000..39d4c3dc8 --- /dev/null +++ b/lib/newwrap/sdl/sdl_gfx.nim @@ -0,0 +1,452 @@ +# +# $Id: sdl_gfx.pas,v 1.3 2007/05/29 21:31:04 savage Exp $ +# +# +# +# $Log: sdl_gfx.pas,v $ +# Revision 1.3 2007/05/29 21:31:04 savage +# Changes as suggested by Almindor for 64bit compatibility. +# +# Revision 1.2 2007/05/20 20:30:18 savage +# Initial Changes to Handle 64 Bits +# +# Revision 1.1 2005/01/03 19:08:32 savage +# Header for the SDL_Gfx library. +# +# +# +# + +import + + +when defined(windows): + const + gfxLibName = "SDL_gfx.dll" +elif defined(macosx): + const + gfxLibName = "libSDL_gfx.dylib" +else: + const + gfxLibName = "libSDL_gfx.so" +const # Some rates in Hz + FPS_UPPER_LIMIT* = 200 + FPS_LOWER_LIMIT* = 1 + FPS_DEFAULT* = 30 # ---- Defines + SMOOTHING_OFF* = 0 + SMOOTHING_ON* = 1 + +type + PFPSmanager* = ptr TFPSmanager + TFPSmanager*{.final.} = object # ---- Structures + framecount*: Uint32 + rateticks*: float32 + lastticks*: Uint32 + rate*: Uint32 + + PColorRGBA* = ptr TColorRGBA + TColorRGBA*{.final.} = object + r*: Uint8 + g*: Uint8 + b*: Uint8 + a*: Uint8 + + PColorY* = ptr TColorY + TColorY*{.final.} = object # + # + # SDL_framerate: framerate manager + # + # LGPL (c) A. Schiffler + # + # + y*: Uint8 + + +proc initFramerate*(manager: PFPSmanager){.cdecl, importc: "SDL_initFramerate", + dynlib: gfxLibName.} +proc setFramerate*(manager: PFPSmanager, rate: int): int{.cdecl, + importc: "SDL_setFramerate", dynlib: gfxLibName.} +proc getFramerate*(manager: PFPSmanager): int{.cdecl, + importc: "SDL_getFramerate", dynlib: gfxLibName.} +proc framerateDelay*(manager: PFPSmanager){.cdecl, + importc: "SDL_framerateDelay", dynlib: gfxLibName.} + # + # + # SDL_gfxPrimitives: graphics primitives for SDL + # + # LGPL (c) A. Schiffler + # + # + # Note: all ___Color routines expect the color to be in format 0xRRGGBBAA + # Pixel +proc pixelColor*(dst: PSurface, x: Sint16, y: Sint16, color: Uint32): int{. + cdecl, importc: "pixelColor", dynlib: gfxLibName.} +proc pixelRGBA*(dst: PSurface, x: Sint16, y: Sint16, r: Uint8, g: Uint8, + b: Uint8, a: Uint8): int{.cdecl, importc: "pixelRGBA", + dynlib: gfxLibName.} + # Horizontal line +proc hlineColor*(dst: PSurface, x1: Sint16, x2: Sint16, y: Sint16, color: Uint32): int{. + cdecl, importc: "hlineColor", dynlib: gfxLibName.} +proc hlineRGBA*(dst: PSurface, x1: Sint16, x2: Sint16, y: Sint16, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc: "hlineRGBA", + dynlib: gfxLibName.} + # Vertical line +proc vlineColor*(dst: PSurface, x: Sint16, y1: Sint16, y2: Sint16, color: Uint32): int{. + cdecl, importc: "vlineColor", dynlib: gfxLibName.} +proc vlineRGBA*(dst: PSurface, x: Sint16, y1: Sint16, y2: Sint16, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, importc: "vlineRGBA", + dynlib: gfxLibName.} + # Rectangle +proc rectangleColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, color: Uint32): int{.cdecl, + importc: "rectangleColor", dynlib: gfxLibName.} +proc rectangleRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. + cdecl, importc: "rectangleRGBA", dynlib: gfxLibName.} + # Filled rectangle (Box) +proc boxColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + color: Uint32): int{.cdecl, importc: "boxColor", + dynlib: gfxLibName.} +proc boxRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "boxRGBA", dynlib: gfxLibName.} + # Line +proc lineColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + color: Uint32): int{.cdecl, importc: "lineColor", + dynlib: gfxLibName.} +proc lineRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "lineRGBA", dynlib: gfxLibName.} + # AA Line +proc aalineColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + color: Uint32): int{.cdecl, importc: "aalineColor", + dynlib: gfxLibName.} +proc aalineRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "aalineRGBA", dynlib: gfxLibName.} + # Circle +proc circleColor*(dst: PSurface, x: Sint16, y: Sint16, r: Sint16, color: Uint32): int{. + cdecl, importc: "circleColor", dynlib: gfxLibName.} +proc circleRGBA*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "circleRGBA", dynlib: gfxLibName.} + # AA Circle +proc aacircleColor*(dst: PSurface, x: Sint16, y: Sint16, r: Sint16, + color: Uint32): int{.cdecl, importc: "aacircleColor", + dynlib: gfxLibName.} +proc aacircleRGBA*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "aacircleRGBA", dynlib: gfxLibName.} + # Filled Circle +proc filledCircleColor*(dst: PSurface, x: Sint16, y: Sint16, r: Sint16, + color: Uint32): int{.cdecl, + importc: "filledCircleColor", dynlib: gfxLibName.} +proc filledCircleRGBA*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "filledCircleRGBA", dynlib: gfxLibName.} + # Ellipse +proc ellipseColor*(dst: PSurface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, + color: Uint32): int{.cdecl, importc: "ellipseColor", + dynlib: gfxLibName.} +proc ellipseRGBA*(dst: PSurface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "ellipseRGBA", dynlib: gfxLibName.} + # AA Ellipse +proc aaellipseColor*(dst: PSurface, xc: Sint16, yc: Sint16, rx: Sint16, + ry: Sint16, color: Uint32): int{.cdecl, + importc: "aaellipseColor", dynlib: gfxLibName.} +proc aaellipseRGBA*(dst: PSurface, x: Sint16, y: Sint16, rx: Sint16, ry: Sint16, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "aaellipseRGBA", dynlib: gfxLibName.} + # Filled Ellipse +proc filledEllipseColor*(dst: PSurface, x: Sint16, y: Sint16, rx: Sint16, + ry: Sint16, color: Uint32): int{.cdecl, + importc: "filledEllipseColor", dynlib: gfxLibName.} +proc filledEllipseRGBA*(dst: PSurface, x: Sint16, y: Sint16, rx: Sint16, + ry: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. + cdecl, importc: "filledEllipseRGBA", dynlib: gfxLibName.} + # Pie +proc pieColor*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, + finish: Sint16, color: Uint32): int{.cdecl, importc: "pieColor", + dynlib: gfxLibName.} +proc pieRGBA*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, start: Sint16, + finish: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. + cdecl, importc: "pieRGBA", dynlib: gfxLibName.} + # Filled Pie +proc filledPieColor*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, + start: Sint16, finish: Sint16, color: Uint32): int{.cdecl, + importc: "filledPieColor", dynlib: gfxLibName.} +proc filledPieRGBA*(dst: PSurface, x: Sint16, y: Sint16, rad: Sint16, + start: Sint16, finish: Sint16, r: Uint8, g: Uint8, b: Uint8, + a: Uint8): int{.cdecl, importc: "filledPieRGBA", + dynlib: gfxLibName.} + # Trigon +proc trigonColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + x3: Sint16, y3: Sint16, color: Uint32): int{.cdecl, + importc: "trigonColor", dynlib: gfxLibName.} +proc trigonRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, y2: Sint16, + x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{. + cdecl, importc: "trigonRGBA", dynlib: gfxLibName.} + # AA-Trigon +proc aatrigonColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, x3: Sint16, y3: Sint16, color: Uint32): int{. + cdecl, importc: "aatrigonColor", dynlib: gfxLibName.} +proc aatrigonRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, + b: Uint8, a: Uint8): int{.cdecl, importc: "aatrigonRGBA", + dynlib: gfxLibName.} + # Filled Trigon +proc filledTrigonColor*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, x3: Sint16, y3: Sint16, color: Uint32): int{. + cdecl, importc: "filledTrigonColor", dynlib: gfxLibName.} +proc filledTrigonRGBA*(dst: PSurface, x1: Sint16, y1: Sint16, x2: Sint16, + y2: Sint16, x3: Sint16, y3: Sint16, r: Uint8, g: Uint8, + b: Uint8, a: Uint8): int{.cdecl, + importc: "filledTrigonRGBA", dynlib: gfxLibName.} + # Polygon +proc polygonColor*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, + color: Uint32): int{.cdecl, importc: "polygonColor", + dynlib: gfxLibName.} +proc polygonRGBA*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "polygonRGBA", dynlib: gfxLibName.} + # AA-Polygon +proc aapolygonColor*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, + color: Uint32): int{.cdecl, importc: "aapolygonColor", + dynlib: gfxLibName.} +proc aapolygonRGBA*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "aapolygonRGBA", dynlib: gfxLibName.} + # Filled Polygon +proc filledPolygonColor*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, + color: Uint32): int{.cdecl, + importc: "filledPolygonColor", dynlib: gfxLibName.} +proc filledPolygonRGBA*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "filledPolygonRGBA", dynlib: gfxLibName.} + # Bezier + # s = number of steps +proc bezierColor*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, s: int, + color: Uint32): int{.cdecl, importc: "bezierColor", + dynlib: gfxLibName.} +proc bezierRGBA*(dst: PSurface, vx: PSint16, vy: PSint16, n: int, s: int, + r: Uint8, g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "bezierRGBA", dynlib: gfxLibName.} + # Characters/Strings +proc characterColor*(dst: PSurface, x: Sint16, y: Sint16, c: char, color: Uint32): int{. + cdecl, importc: "characterColor", dynlib: gfxLibName.} +proc characterRGBA*(dst: PSurface, x: Sint16, y: Sint16, c: char, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "characterRGBA", dynlib: gfxLibName.} +proc stringColor*(dst: PSurface, x: Sint16, y: Sint16, c: cstring, color: Uint32): int{. + cdecl, importc: "stringColor", dynlib: gfxLibName.} +proc stringRGBA*(dst: PSurface, x: Sint16, y: Sint16, c: cstring, r: Uint8, + g: Uint8, b: Uint8, a: Uint8): int{.cdecl, + importc: "stringRGBA", dynlib: gfxLibName.} +proc gfxPrimitivesSetFont*(fontdata: Pointer, cw: int, ch: int){.cdecl, + importc: "gfxPrimitivesSetFont", dynlib: gfxLibName.} + # + # + # SDL_imageFilter - bytes-image "filter" routines + # (uses inline x86 MMX optimizations if available) + # + # LGPL (c) A. Schiffler + # + # + # Comments: + # 1.) MMX functions work best if all data blocks are aligned on a 32 bytes boundary. + # 2.) Data that is not within an 8 byte boundary is processed using the C routine. + # 3.) Convolution routines do not have C routines at this time. + # Detect MMX capability in CPU +proc imageFilterMMXdetect*(): int{.cdecl, importc: "SDL_imageFilterMMXdetect", + dynlib: gfxLibName.} + # Force use of MMX off (or turn possible use back on) +proc imageFilterMMXoff*(){.cdecl, importc: "SDL_imageFilterMMXoff", + dynlib: gfxLibName.} +proc imageFilterMMXon*(){.cdecl, importc: "SDL_imageFilterMMXon", + dynlib: gfxLibName.} + # + # All routines return: + # 0 OK + # -1 Error (internal error, parameter error) + # + # SDL_imageFilterAdd: D = saturation255(S1 + S2) +proc imageFilterAdd*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterAdd", dynlib: gfxLibName.} + # SDL_imageFilterMean: D = S1/2 + S2/2 +proc imageFilterMean*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterMean", dynlib: gfxLibName.} + # SDL_imageFilterSub: D = saturation0(S1 - S2) +proc imageFilterSub*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterSub", dynlib: gfxLibName.} + # SDL_imageFilterAbsDiff: D = | S1 - S2 | +proc imageFilterAbsDiff*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterAbsDiff", dynlib: gfxLibName.} + # SDL_imageFilterMult: D = saturation(S1 * S2) +proc imageFilterMult*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterMult", dynlib: gfxLibName.} + # SDL_imageFilterMultNor: D = S1 * S2 (non-MMX) +proc imageFilterMultNor*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterMultNor", dynlib: gfxLibName.} + # SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2) +proc imageFilterMultDivby2*(Src1: cstring, Src2: cstring, Dest: cstring, + len: int): int{.cdecl, + importc: "SDL_imageFilterMultDivby2", dynlib: gfxLibName.} + # SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2) +proc imageFilterMultDivby4*(Src1: cstring, Src2: cstring, Dest: cstring, + len: int): int{.cdecl, + importc: "SDL_imageFilterMultDivby4", dynlib: gfxLibName.} + # SDL_imageFilterBitAnd: D = S1 & S2 +proc imageFilterBitAnd*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterBitAnd", dynlib: gfxLibName.} + # SDL_imageFilterBitOr: D = S1 | S2 +proc imageFilterBitOr*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterBitOr", dynlib: gfxLibName.} + # SDL_imageFilterDiv: D = S1 / S2 (non-MMX) +proc imageFilterDiv*(Src1: cstring, Src2: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterDiv", dynlib: gfxLibName.} + # SDL_imageFilterBitNegation: D = !S +proc imageFilterBitNegation*(Src1: cstring, Dest: cstring, len: int): int{. + cdecl, importc: "SDL_imageFilterBitNegation", dynlib: gfxLibName.} + # SDL_imageFilterAddByte: D = saturation255(S + C) +proc imageFilterAddByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. + cdecl, importc: "SDL_imageFilterAddByte", dynlib: gfxLibName.} + # SDL_imageFilterAddUint: D = saturation255(S + (uint)C) +proc imageFilterAddUint*(Src1: cstring, Dest: cstring, len: int, C: int): int{. + cdecl, importc: "SDL_imageFilterAddUint", dynlib: gfxLibName.} + # SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C) +proc imageFilterAddByteToHalf*(Src1: cstring, Dest: cstring, len: int, C: char): int{. + cdecl, importc: "SDL_imageFilterAddByteToHalf", dynlib: gfxLibName.} + # SDL_imageFilterSubByte: D = saturation0(S - C) +proc imageFilterSubByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. + cdecl, importc: "SDL_imageFilterSubByte", dynlib: gfxLibName.} + # SDL_imageFilterSubUint: D = saturation0(S - (uint)C) +proc imageFilterSubUint*(Src1: cstring, Dest: cstring, len: int, C: int): int{. + cdecl, importc: "SDL_imageFilterSubUint", dynlib: gfxLibName.} + # SDL_imageFilterShiftRight: D = saturation0(S >> N) +proc imageFilterShiftRight*(Src1: cstring, Dest: cstring, len: int, N: char): int{. + cdecl, importc: "SDL_imageFilterShiftRight", dynlib: gfxLibName.} + # SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N) +proc imageFilterShiftRightUint*(Src1: cstring, Dest: cstring, len: int, N: char): int{. + cdecl, importc: "SDL_imageFilterShiftRightUint", dynlib: gfxLibName.} + # SDL_imageFilterMultByByte: D = saturation255(S * C) +proc imageFilterMultByByte*(Src1: cstring, Dest: cstring, len: int, C: char): int{. + cdecl, importc: "SDL_imageFilterMultByByte", dynlib: gfxLibName.} + # SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C) +proc imageFilterShiftRightAndMultByByte*(Src1: cstring, Dest: cstring, len: int, + N: char, C: char): int{.cdecl, + importc: "SDL_imageFilterShiftRightAndMultByByte", + dynlib: gfxLibName.} + # SDL_imageFilterShiftLeftByte: D = (S << N) +proc imageFilterShiftLeftByte*(Src1: cstring, Dest: cstring, len: int, N: char): int{. + cdecl, importc: "SDL_imageFilterShiftLeftByte", dynlib: gfxLibName.} + # SDL_imageFilterShiftLeftUint: D = ((uint)S << N) +proc imageFilterShiftLeftUint*(Src1: cstring, Dest: cstring, len: int, N: char): int{. + cdecl, importc: "SDL_imageFilterShiftLeftUint", dynlib: gfxLibName.} + # SDL_imageFilterShiftLeft: D = saturation255(S << N) +proc imageFilterShiftLeft*(Src1: cstring, Dest: cstring, len: int, N: char): int{. + cdecl, importc: "SDL_imageFilterShiftLeft", dynlib: gfxLibName.} + # SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0 +proc imageFilterBinarizeUsingThreshold*(Src1: cstring, Dest: cstring, len: int, + T: char): int{.cdecl, + importc: "SDL_imageFilterBinarizeUsingThreshold", dynlib: gfxLibName.} + # SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0 +proc imageFilterClipToRange*(Src1: cstring, Dest: cstring, len: int, Tmin: int8, + Tmax: int8): int{.cdecl, + importc: "SDL_imageFilterClipToRange", dynlib: gfxLibName.} + # SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin) +proc imageFilterNormalizeLinear*(Src1: cstring, Dest: cstring, len: int, + Cmin: int, Cmax: int, Nmin: int, Nmax: int): int{. + cdecl, importc: "SDL_imageFilterNormalizeLinear", dynlib: gfxLibName.} + # !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!! + # SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel3x3Divide*(Src: cstring, Dest: cstring, rows: int, + columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel3x3Divide", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel5x5Divide*(Src: cstring, Dest: cstring, rows: int, + columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel5x5Divide", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel7x7Divide*(Src: cstring, Dest: cstring, rows: int, + columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel7x7Divide", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel9x9Divide*(Src: cstring, Dest: cstring, rows: int, + columns: int, Kernel: PShortInt, Divisor: int8): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel9x9Divide", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel3x3ShiftRight*(Src: cstring, Dest: cstring, + rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel3x3ShiftRight", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel5x5ShiftRight*(Src: cstring, Dest: cstring, + rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel5x5ShiftRight", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel7x7ShiftRight*(Src: cstring, Dest: cstring, + rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel7x7ShiftRight", dynlib: gfxLibName.} + # SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... ) +proc imageFilterConvolveKernel9x9ShiftRight*(Src: cstring, Dest: cstring, + rows: int, columns: int, Kernel: PShortInt, NRightShift: char): int{.cdecl, + importc: "SDL_imageFilterConvolveKernel9x9ShiftRight", dynlib: gfxLibName.} + # SDL_imageFilterSobelX: Dij = saturation255( ... ) +proc imageFilterSobelX*(Src: cstring, Dest: cstring, rows: int, columns: int): int{. + cdecl, importc: "SDL_imageFilterSobelX", dynlib: gfxLibName.} + # SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... ) +proc imageFilterSobelXShiftRight*(Src: cstring, Dest: cstring, rows: int, + columns: int, NRightShift: char): int{.cdecl, + importc: "SDL_imageFilterSobelXShiftRight", dynlib: gfxLibName.} + # Align/restore stack to 32 byte boundary -- Functionality untested! -- +proc imageFilterAlignStack*(){.cdecl, importc: "SDL_imageFilterAlignStack", + dynlib: gfxLibName.} +proc imageFilterRestoreStack*(){.cdecl, importc: "SDL_imageFilterRestoreStack", + dynlib: gfxLibName.} + # + # + # SDL_rotozoom - rotozoomer + # + # LGPL (c) A. Schiffler + # + # + # + # + # rotozoomSurface() + # + # Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. + # 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1 + # then the destination 32bit surface is anti-aliased. If the surface is not 8bit + # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. + # + # +proc rotozoomSurface*(src: PSurface, angle: float64, zoom: float64, smooth: int): PSurface{. + cdecl, importc: "rotozoomSurface", dynlib: gfxLibName.} +proc rotozoomSurfaceXY*(src: PSurface, angle: float64, zoomx: float64, + zoomy: float64, smooth: int): PSurface{.cdecl, + importc: "rotozoomSurfaceXY", dynlib: gfxLibName.} + # Returns the size of the target surface for a rotozoomSurface() call +proc rotozoomSurfaceSize*(width: int, height: int, angle: float64, + zoom: float64, dstwidth: var int, dstheight: var int){. + cdecl, importc: "rotozoomSurfaceSize", dynlib: gfxLibName.} +proc rotozoomSurfaceSizeXY*(width: int, height: int, angle: float64, + zoomx: float64, zoomy: float64, dstwidth: var int, + dstheight: var int){.cdecl, + importc: "rotozoomSurfaceSizeXY", dynlib: gfxLibName.} + # + # + # zoomSurface() + # + # Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. + # 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1 + # then the destination 32bit surface is anti-aliased. If the surface is not 8bit + # or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. + # + # +proc zoomSurface*(src: PSurface, zoomx: float64, zoomy: float64, smooth: int): PSurface{. + cdecl, importc: "zoomSurface", dynlib: gfxLibName.} + # Returns the size of the target surface for a zoomSurface() call +proc zoomSurfaceSize*(width: int, height: int, zoomx: float64, zoomy: float64, + dstwidth: var int, dstheight: var int){.cdecl, + importc: "zoomSurfaceSize", dynlib: gfxLibName.} +# implementation diff --git a/lib/newwrap/sdl/sdl_image.nim b/lib/newwrap/sdl/sdl_image.nim new file mode 100644 index 000000000..621749e32 --- /dev/null +++ b/lib/newwrap/sdl/sdl_image.nim @@ -0,0 +1,242 @@ +# +# $Id: sdl_image.pas,v 1.14 2007/05/29 21:31:13 savage Exp $ +# +# +#****************************************************************************** +# +# Borland Delphi SDL_Image - An example image loading library for use +# with SDL +# Conversion of the Simple DirectMedia Layer Image Headers +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : SDL_image.h +# +# The initial developer of this Pascal code was : +# Matthias Thoma <ma.thoma@gmx.de> +# +# Portions created by Matthias Thoma are +# Copyright (C) 2000 - 2001 Matthias Thoma. +# +# +# Contributor(s) +# -------------- +# Dominique Louis <Dominique@SavageSoftware.com.au> +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# A simple library to load images of various formats as SDL surfaces +# +# Requires +# -------- +# SDL.pas in your search path. +# +# Programming Notes +# ----------------- +# See the Aliens Demo on how to make use of this libaray +# +# Revision History +# ---------------- +# April 02 2001 - MT : Initial Translation +# +# May 08 2001 - DL : Added ExternalSym derectives and copyright header +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# $Log: sdl_image.pas,v $ +# Revision 1.14 2007/05/29 21:31:13 savage +# Changes as suggested by Almindor for 64bit compatibility. +# +# Revision 1.13 2007/05/20 20:30:54 savage +# Initial Changes to Handle 64 Bits +# +# Revision 1.12 2006/12/02 00:14:40 savage +# Updated to latest version +# +# Revision 1.11 2005/04/10 18:22:59 savage +# Changes as suggested by Michalis, thanks. +# +# Revision 1.10 2005/04/10 11:48:33 savage +# Changes as suggested by Michalis, thanks. +# +# Revision 1.9 2005/01/05 01:47:07 savage +# Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively. +# +# Revision 1.8 2005/01/04 23:14:44 savage +# Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively. +# +# Revision 1.7 2005/01/01 02:03:12 savage +# Updated to v1.2.4 +# +# Revision 1.6 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.5 2004/05/10 14:10:04 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.4 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.3 2004/04/01 20:53:23 savage +# Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.2 2004/03/30 20:23:28 savage +# Tidied up use of UNIX compiler directive. +# +# Revision 1.1 2004/02/14 23:35:42 savage +# version 1 of sdl_image, sdl_mixer and smpeg. +# +# +# +#****************************************************************************** + +import + + +when defined(windows): + const + ImageLibName = "SDL_Image.dll" +elif defined(macosx): + const + ImageLibName = "libSDL_image-1.2.0.dylib" +else: + const + ImageLibName = "libSDL_image.so" +const + IMAGE_MAJOR_VERSION* = 1'i8 + IMAGE_MINOR_VERSION* = 2'i8 + IMAGE_PATCHLEVEL* = 5'i8 + +# This macro can be used to fill a version structure with the compile-time +# version of the SDL_image library. + +proc IMAGE_VERSION*(X: var TVersion) + # This function gets the version of the dynamically linked SDL_image library. + # it should NOT be used to fill a version structure, instead you should + # use the SDL_IMAGE_VERSION() macro. + # +proc IMG_Linked_Version*(): Pversion{.importc: "IMG_Linked_Version", + dynlib: ImageLibName.} + # Load an image from an SDL data source. + # The 'type' may be one of: "BMP", "GIF", "PNG", etc. + # + # If the image format supports a transparent pixel, SDL will set the + # colorkey for the surface. You can enable RLE acceleration on the + # surface afterwards by calling: + # SDL_SetColorKey(image, SDL_RLEACCEL, image.format.colorkey); + # +proc IMG_LoadTyped_RW*(src: PRWops, freesrc: int, theType: cstring): PSurface{. + cdecl, importc: "IMG_LoadTyped_RW", dynlib: ImageLibName.} + # Convenience functions +proc IMG_Load*(theFile: cstring): PSurface{.cdecl, importc: "IMG_Load", + dynlib: ImageLibName.} +proc IMG_Load_RW*(src: PRWops, freesrc: int): PSurface{.cdecl, + importc: "IMG_Load_RW", dynlib: ImageLibName.} + # Invert the alpha of a surface for use with OpenGL + # This function is now a no-op, and only provided for backwards compatibility. +proc IMG_InvertAlpha*(theOn: int): int{.cdecl, importc: "IMG_InvertAlpha", + dynlib: ImageLibName.} + # Functions to detect a file type, given a seekable source +proc IMG_isBMP*(src: PRWops): int{.cdecl, importc: "IMG_isBMP", + dynlib: ImageLibName.} +proc IMG_isGIF*(src: PRWops): int{.cdecl, importc: "IMG_isGIF", + dynlib: ImageLibName.} +proc IMG_isJPG*(src: PRWops): int{.cdecl, importc: "IMG_isJPG", + dynlib: ImageLibName.} +proc IMG_isLBM*(src: PRWops): int{.cdecl, importc: "IMG_isLBM", + dynlib: ImageLibName.} +proc IMG_isPCX*(src: PRWops): int{.cdecl, importc: "IMG_isPCX", + dynlib: ImageLibName.} +proc IMG_isPNG*(src: PRWops): int{.cdecl, importc: "IMG_isPNG", + dynlib: ImageLibName.} +proc IMG_isPNM*(src: PRWops): int{.cdecl, importc: "IMG_isPNM", + dynlib: ImageLibName.} +proc IMG_isTIF*(src: PRWops): int{.cdecl, importc: "IMG_isTIF", + dynlib: ImageLibName.} +proc IMG_isXCF*(src: PRWops): int{.cdecl, importc: "IMG_isXCF", + dynlib: ImageLibName.} +proc IMG_isXPM*(src: PRWops): int{.cdecl, importc: "IMG_isXPM", + dynlib: ImageLibName.} +proc IMG_isXV*(src: PRWops): int{.cdecl, importc: "IMG_isXV", + dynlib: ImageLibName.} + # Individual loading functions +proc IMG_LoadBMP_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadBMP_RW", + dynlib: ImageLibName.} +proc IMG_LoadGIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadGIF_RW", + dynlib: ImageLibName.} +proc IMG_LoadJPG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadJPG_RW", + dynlib: ImageLibName.} +proc IMG_LoadLBM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadLBM_RW", + dynlib: ImageLibName.} +proc IMG_LoadPCX_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPCX_RW", + dynlib: ImageLibName.} +proc IMG_LoadPNM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNM_RW", + dynlib: ImageLibName.} +proc IMG_LoadPNG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNG_RW", + dynlib: ImageLibName.} +proc IMG_LoadTGA_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTGA_RW", + dynlib: ImageLibName.} +proc IMG_LoadTIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTIF_RW", + dynlib: ImageLibName.} +proc IMG_LoadXCF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXCF_RW", + dynlib: ImageLibName.} +proc IMG_LoadXPM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXPM_RW", + dynlib: ImageLibName.} +proc IMG_LoadXV_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXV_RW", + dynlib: ImageLibName.} +proc IMG_ReadXPMFromArray*(xpm: cstringArray): PSurface{.cdecl, + importc: "IMG_ReadXPMFromArray", dynlib: ImageLibName.} + # Error Macros + # We'll use SDL for reporting errors +proc IMG_SetError*(fmt: cstring) +proc IMG_GetError*(): cstring +# implementation + +proc IMAGE_VERSION(X: var TVersion) = + X.major = IMAGE_MAJOR_VERSION + X.minor = IMAGE_MINOR_VERSION + X.patch = IMAGE_PATCHLEVEL + +proc IMG_SetError(fmt: cstring) = + SetError(fmt) + +proc IMG_GetError(): cstring = + result = GetError() diff --git a/lib/newwrap/sdl/sdl_mixer.nim b/lib/newwrap/sdl/sdl_mixer.nim new file mode 100644 index 000000000..d4dd2e8df --- /dev/null +++ b/lib/newwrap/sdl/sdl_mixer.nim @@ -0,0 +1,763 @@ +#****************************************************************************** +# +# $Id: sdl_mixer.pas,v 1.18 2007/05/29 21:31:44 savage Exp $ +# +# +# +# Borland Delphi SDL_Mixer - Simple DirectMedia Layer Mixer Library +# Conversion of the Simple DirectMedia Layer Headers +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : SDL_mixer.h +# music_cmd.h +# wavestream.h +# timidity.h +# playmidi.h +# music_ogg.h +# mikmod.h +# +# The initial developer of this Pascal code was : +# Dominqiue Louis <Dominique@SavageSoftware.com.au> +# +# Portions created by Dominqiue Louis are +# Copyright (C) 2000 - 2001 Dominqiue Louis. +# +# +# Contributor(s) +# -------------- +# Matthias Thoma <ma.thoma@gmx.de> +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# +# +# +# +# +# +# +# Requires +# -------- +# SDL.pas & SMPEG.pas somewhere within your search path. +# +# Programming Notes +# ----------------- +# See the Aliens Demo to see how this library is used +# +# Revision History +# ---------------- +# April 02 2001 - DL : Initial Translation +# +# February 02 2002 - DL : Update to version 1.2.1 +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# $Log: sdl_mixer.pas,v $ +# Revision 1.18 2007/05/29 21:31:44 savage +# Changes as suggested by Almindor for 64bit compatibility. +# +# Revision 1.17 2007/05/20 20:31:17 savage +# Initial Changes to Handle 64 Bits +# +# Revision 1.16 2006/12/02 00:16:17 savage +# Updated to latest version +# +# Revision 1.15 2005/04/10 11:48:33 savage +# Changes as suggested by Michalis, thanks. +# +# Revision 1.14 2005/02/24 20:20:07 savage +# Changed definition of MusicType and added GetMusicType function +# +# Revision 1.13 2005/01/05 01:47:09 savage +# Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively. +# +# Revision 1.12 2005/01/04 23:14:56 savage +# Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively. +# +# Revision 1.11 2005/01/01 02:05:19 savage +# Updated to v1.2.6 +# +# Revision 1.10 2004/09/12 21:45:17 savage +# Robert Reed spotted that Mix_SetMusicPosition was missing from the conversion, so this has now been added. +# +# Revision 1.9 2004/08/27 21:48:24 savage +# IFDEFed out Smpeg support on MacOS X +# +# Revision 1.8 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.7 2004/05/10 14:10:04 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.6 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.5 2004/04/01 20:53:23 savage +# Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.4 2004/03/31 22:20:02 savage +# Windows unit not used in this file, so it was removed to keep the code tidy. +# +# Revision 1.3 2004/03/31 10:05:08 savage +# Better defines for Endianess under FreePascal and Borland compilers. +# +# Revision 1.2 2004/03/30 20:23:28 savage +# Tidied up use of UNIX compiler directive. +# +# Revision 1.1 2004/02/14 23:35:42 savage +# version 1 of sdl_image, sdl_mixer and smpeg. +# +# +# +#****************************************************************************** + +import + , smpeg + +when defined(windows): + const + MixerLibName = "SDL_mixer.dll" +elif defined(macosx): + const + MixerLibName = "libSDL_mixer-1.2.0.dylib" +else: + const + MixerLibName = "libSDL_mixer.so" +const + MIXER_MAJOR_VERSION* = 1'i8 + MIXER_MINOR_VERSION* = 2'i8 + MIXER_PATCHLEVEL* = 7'i8 # Backwards compatibility + MIX_MAJOR_VERSION* = MIXER_MAJOR_VERSION + MIX_MINOR_VERSION* = MIXER_MINOR_VERSION + MIX_PATCHLEVEL* = MIXER_PATCHLEVEL # SDL_Mixer.h constants + # The default mixer has 8 simultaneous mixing channels + MIX_CHANNELS* = 8 # Good default values for a PC soundcard + MIX_DEFAULT_FREQUENCY* = 22050 + +when defined(IA32): + const + MIX_DEFAULT_FORMAT* = AUDIO_S16LSB +else: + const + MIX_DEFAULT_FORMAT* = AUDIO_S16MSB +const + MIX_DEFAULT_CHANNELS* = 2 + MIX_MAX_VOLUME* = 128 # Volume of a chunk + PATH_MAX* = 255 # mikmod.h constants + #* + # * Library version + # * + LIBMIKMOD_VERSION_MAJOR* = 3 + LIBMIKMOD_VERSION_MINOR* = 1 + LIBMIKMOD_REVISION* = 8 + LIBMIKMOD_VERSION* = ((LIBMIKMOD_VERSION_MAJOR shl 16) or + (LIBMIKMOD_VERSION_MINOR shl 8) or (LIBMIKMOD_REVISION)) + +type #music_cmd.h types + PMusicCMD* = ptr TMusicCMD + TMusicCMD*{.final.} = object #wavestream.h types + filename*: array[0..PATH_MAX - 1, char] + cmd*: array[0..PATH_MAX - 1, char] + pid*: TSYS_ThreadHandle + + PWAVStream* = ptr TWAVStream + TWAVStream*{.final.} = object #playmidi.h types + wavefp*: Pointer + start*: int32 + stop*: int32 + cvt*: TAudioCVT + + PMidiEvent* = ptr TMidiEvent + TMidiEvent*{.final.} = object + time*: int32 + channel*: uint8 + type_*: uint8 + a*: uint8 + b*: uint8 + + PMidiSong* = ptr TMidiSong + TMidiSong*{.final.} = object #music_ogg.h types + samples*: int32 + events*: PMidiEvent + + POGG_Music* = ptr TOGG_Music + TOGG_Music*{.final.} = object # mikmod.h types + #* + # * Error codes + # * + playing*: int + volume*: int #vf: OggVorbis_File; + section*: int + cvt*: TAudioCVT + len_available*: int + snd_available*: PUint8 + + TErrorEnum* = enum + MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING, + MMERR_SAMPLE_TOO_BIG, MMERR_OUT_OF_HANDLES, MMERR_UNKNOWN_WAVE_TYPE, + MMERR_LOADING_PATTERN, MMERR_LOADING_TRACK, MMERR_LOADING_HEADER, + MMERR_LOADING_SAMPLEINFO, MMERR_NOT_A_MODULE, MMERR_NOT_A_STREAM, + MMERR_MED_SYNTHSAMPLES, MMERR_ITPACK_INVALID_DATA, MMERR_DETECTING_DEVICE, + MMERR_INVALID_DEVICE, MMERR_INITIALIZING_MIXER, MMERR_OPENING_AUDIO, + MMERR_8BIT_ONLY, MMERR_16BIT_ONLY, MMERR_STEREO_ONLY, MMERR_ULAW, + MMERR_NON_BLOCK, MMERR_AF_AUDIO_PORT, MMERR_AIX_CONFIG_INIT, + MMERR_AIX_CONFIG_CONTROL, MMERR_AIX_CONFIG_START, MMERR_GUS_SETTINGS, + MMERR_GUS_RESET, MMERR_GUS_TIMER, MMERR_HP_SETSAMPLESIZE, MMERR_HP_SETSPEED, + MMERR_HP_CHANNELS, MMERR_HP_AUDIO_OUTPUT, MMERR_HP_AUDIO_DESC, + MMERR_HP_BUFFERSIZE, MMERR_OSS_SETFRAGMENT, MMERR_OSS_SETSAMPLESIZE, + MMERR_OSS_SETSTEREO, MMERR_OSS_SETSPEED, MMERR_SGI_SPEED, MMERR_SGI_16BIT, + MMERR_SGI_8BIT, MMERR_SGI_STEREO, MMERR_SGI_MONO, MMERR_SUN_INIT, + MMERR_OS2_MIXSETUP, MMERR_OS2_SEMAPHORE, MMERR_OS2_TIMER, MMERR_OS2_THREAD, + MMERR_DS_PRIORITY, MMERR_DS_BUFFER, MMERR_DS_FORMAT, MMERR_DS_NOTIFY, + MMERR_DS_EVENT, MMERR_DS_THREAD, MMERR_DS_UPDATE, MMERR_WINMM_HANDLE, + MMERR_WINMM_ALLOCATED, MMERR_WINMM_DEVICEID, MMERR_WINMM_FORMAT, + MMERR_WINMM_UNKNOWN, MMERR_MAC_SPEED, MMERR_MAC_START, MMERR_MAX + PMODULE* = ptr TMODULE + TMODULE*{.final.} = object + PUNIMOD* = ptr TUNIMOD + TUNIMOD* = TMODULE #SDL_mixer.h types + # The internal format for an audio chunk + PMix_Chunk* = ptr TMix_Chunk + TMix_Chunk*{.final.} = object + allocated*: int + abuf*: PUint8 + alen*: Uint32 + volume*: Uint8 # Per-sample volume, 0-128 + + Mix_Chunk* = TMix_Chunk # The different fading types supported + TMix_Fading* = enum + MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN + Mix_Fading* = TMix_Fading + TMix_MusicType* = enum + MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3 + Mix_MusicType* = TMix_MusicType # + # TMusicUnion = record + # case XXX: Byte of + # 0 : ( cmd : PMusicCMD ); + # 1 : ( wave : PWAVStream ); + # 2 : ( module : PUNIMOD ); + # 3 : ( midi : TMidiSong ); + # 4 : ( ogg : POGG_music ); + # {$IFNDEF DARWIN} + # 5 : ( mp3 : PSMPEG ); + # {$ENDIF} + # end; + PMix_Music* = ptr TMix_Music + TMix_Music*{.final.} = object # The internal format for a music chunk interpreted via mikmod + type_*: TMix_MusicType # other fields are not aviable + # data : TMusicUnion; + # fading : TMix_Fading; + # fade_volume : integer; + # fade_step : integer; + # fade_steps : integer; + # error : integer; + + TMixFunction* = proc (udata: Pointer, stream: PUint8, length: int): Pointer{. + cdecl.} # This macro can be used to fill a version structure with the compile-time + # version of the SDL_mixer library. + +proc MIXER_VERSION*(X: var TVersion) + # This function gets the version of the dynamically linked SDL_mixer library. + # It should NOT be used to fill a version structure, instead you should use the + # SDL_MIXER_VERSION() macro. +proc Mix_Linked_Version*(): Pversion{.cdecl, importc: "Mix_Linked_Version", + dynlib: MixerLibName.} + # Open the mixer with a certain audio format +proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int, + chunksize: int): int{.cdecl, importc: "Mix_OpenAudio", + dynlib: MixerLibName.} + # Dynamically change the number of channels managed by the mixer. + # If decreasing the number of channels, the upper channels are + # stopped. + # This function returns the new number of allocated channels. + # +proc Mix_AllocateChannels*(numchannels: int): int{.cdecl, + importc: "Mix_AllocateChannels", dynlib: MixerLibName.} + # Find out what the actual audio device parameters are. + # This function returns 1 if the audio has been opened, 0 otherwise. + # +proc Mix_QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{. + cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.} + # Load a wave file or a music (.mod .s3m .it .xm) file +proc Mix_LoadWAV_RW*(src: PRWops, freesrc: int): PMix_Chunk{.cdecl, + importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.} +proc Mix_LoadWAV*(filename: cstring): PMix_Chunk +proc Mix_LoadMUS*(filename: cstring): PMix_Music{.cdecl, importc: "Mix_LoadMUS", + dynlib: MixerLibName.} + # Load a wave file of the mixer format from a memory buffer +proc Mix_QuickLoad_WAV*(mem: PUint8): PMix_Chunk{.cdecl, + importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.} + # Free an audio chunk previously loaded +proc Mix_FreeChunk*(chunk: PMix_Chunk){.cdecl, importc: "Mix_FreeChunk", + dynlib: MixerLibName.} +proc Mix_FreeMusic*(music: PMix_Music){.cdecl, importc: "Mix_FreeMusic", + dynlib: MixerLibName.} + # Find out the music format of a mixer music, or the currently playing + # music, if 'music' is NULL. +proc Mix_GetMusicType*(music: PMix_Music): TMix_MusicType{.cdecl, + importc: "Mix_GetMusicType", dynlib: MixerLibName.} + # Set a function that is called after all mixing is performed. + # This can be used to provide real-time visual display of the audio stream + # or add a custom mixer filter for the stream data. + # +proc Mix_SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl, + importc: "Mix_SetPostMix", dynlib: MixerLibName.} + # Add your own music player or additional mixer function. + # If 'mix_func' is NULL, the default music player is re-enabled. + # +proc Mix_HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, + importc: "Mix_HookMusic", dynlib: MixerLibName.} + # Add your own callback when the music has finished playing. + # +proc Mix_HookMusicFinished*(music_finished: Pointer){.cdecl, + importc: "Mix_HookMusicFinished", dynlib: MixerLibName.} + # Get a pointer to the user data for the current music hook +proc Mix_GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", + dynlib: MixerLibName.} + #* Add your own callback when a channel has finished playing. NULL + # * to disable callback.* +type + TChannel_finished* = proc (channel: int){.cdecl.} + +proc Mix_ChannelFinished*(channel_finished: TChannel_finished){.cdecl, + importc: "Mix_ChannelFinished", dynlib: MixerLibName.} +const + MIX_CHANNEL_POST* = - 2 # This is the format of a special effect callback: + # myeffect(int chan, void *stream, int len, void *udata); + # + # (chan) is the channel number that your effect is affecting. (stream) is + # the buffer of data to work upon. (len) is the size of (stream), and + # (udata) is a user-defined bit of data, which you pass as the last arg of + # Mix_RegisterEffect(), and is passed back unmolested to your callback. + # Your effect changes the contents of (stream) based on whatever parameters + # are significant, or just leaves it be, if you prefer. You can do whatever + # you like to the buffer, though, and it will continue in its changed state + # down the mixing pipeline, through any other effect functions, then finally + # to be mixed with the rest of the channels and music for the final output + # stream. + # + +type + TMix_EffectFunc* = proc (chan: int, stream: Pointer, length: int, + udata: Pointer): Pointer{.cdecl.} # * This is a callback that signifies that a channel has finished all its + # * loops and has completed playback. This gets called if the buffer + # * plays out normally, or if you call Mix_HaltChannel(), implicitly stop + # * a channel via + # Mix_AllocateChannels(), or unregister a callback while + # * it's still playing. + TMix_EffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} #* Register a special effect function. At mixing time, the channel data is + # * copied into a buffer and passed through each registered effect function. + # * After it passes through all the functions, it is mixed into the final + # * output stream. The copy to buffer is performed once, then each effect + # * function performs on the output of the previous effect. Understand that + # * this extra copy to a buffer is not performed if there are no effects + # * registered for a given chunk, which saves CPU cycles, and any given + # * effect will be extra cycles, too, so it is crucial that your code run + # * fast. Also note that the data that your function is given is in the + # * format of the sound device, and not the format you gave to Mix_OpenAudio(), + # * although they may in reality be the same. This is an unfortunate but + # * necessary speed concern. Use Mix_QuerySpec() to determine if you can + # * handle the data before you register your effect, and take appropriate + # * actions. + # * You may also specify a callback (Mix_EffectDone_t) that is called when + # * the channel finishes playing. This gives you a more fine-grained control + # * than Mix_ChannelFinished(), in case you need to free effect-specific + # * resources, etc. If you don't need this, you can specify NULL. + # * You may set the callbacks before or after calling Mix_PlayChannel(). + # * Things like Mix_SetPanning() are just internal special effect functions, + # * so if you are using that, you've already incurred the overhead of a copy + # * to a separate buffer, and that these effects will be in the queue with + # * any functions you've registered. The list of registered effects for a + # * channel is reset when a chunk finishes playing, so you need to explicitly + # * set them with each call to Mix_PlayChannel*(). + # * You may also register a special effect function that is to be run after + # * final mixing occurs. The rules for these callbacks are identical to those + # * in Mix_RegisterEffect, but they are run after all the channels and the + # * music have been mixed into a single stream, whereas channel-specific + # * effects run on a given channel before any other mixing occurs. These + # * global effect callbacks are call "posteffects". Posteffects only have + # * their Mix_EffectDone_t function called when they are unregistered (since + # * the main output stream is never "done" in the same sense as a channel). + # * You must unregister them manually when you've had enough. Your callback + # * will be told that the channel being mixed is (MIX_CHANNEL_POST) if the + # * processing is considered a posteffect. + # * + # * After all these effects have finished processing, the callback registered + # * through Mix_SetPostMix() runs, and then the stream goes to the audio + # * device. + # * + # * returns zero if error (no such channel), nonzero if added. + # * Error messages can be retrieved from Mix_GetError(). + # * + +proc Mix_RegisterEffect*(chan: int, f: TMix_EffectFunc, d: TMix_EffectDone, + arg: Pointer): int{.cdecl, + importc: "Mix_RegisterEffect", dynlib: MixerLibName.} + #* You may not need to call this explicitly, unless you need to stop an + # * effect from processing in the middle of a chunk's playback. + # * Posteffects are never implicitly unregistered as they are for channels, + # * but they may be explicitly unregistered through this function by + # * specifying MIX_CHANNEL_POST for a channel. + # * returns zero if error (no such channel or effect), nonzero if removed. + # * Error messages can be retrieved from Mix_GetError(). + # * +proc Mix_UnregisterEffect*(channel: int, f: TMix_EffectFunc): int{.cdecl, + importc: "Mix_UnregisterEffect", dynlib: MixerLibName.} + #* You may not need to call this explicitly, unless you need to stop all + # * effects from processing in the middle of a chunk's playback. Note that + # * this will also shut off some internal effect processing, since + # * Mix_SetPanning( ) and others may use this API under the hood.This is + # * called internally when a channel completes playback. + # * Posteffects are never implicitly unregistered as they are for channels, + # * but they may be explicitly unregistered through this function by + # * specifying MIX_CHANNEL_POST for a channel. + # * returns zero if error( no such channel ), nonzero if all effects removed. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_UnregisterAllEffects*(channel: int): int{.cdecl, + importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.} +const + MIX_EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED" # * These are the internally - defined mixing effects.They use the same API that + # * effects defined in the application use, but are provided here as a + # * convenience.Some effects can reduce their quality or use more memory in + # * the name of speed; to enable this, make sure the environment variable + # * MIX_EFFECTSMAXSPEED( see above ) is defined before you call + # * Mix_OpenAudio( ). + # * + #* set the panning of a channel.The left and right channels are specified + # * as integers between 0 and 255, quietest to loudest, respectively. + # * + # * Technically, this is just individual volume control for a sample with + # * two( stereo )channels, so it can be used for more than just panning. + # * if you want real panning, call it like this : + # * + # * Mix_SetPanning( channel, left, 255 - left ); + # * + # * ...which isn't so hard. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the panning will be done to the final mixed stream before passing it on + # * to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally, and returns without + # * registering the effect function if the audio device is not configured + # * for stereo output.Setting both( left ) and ( right ) to 255 causes this + # * effect to be unregistered, since that is the data's normal state. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if panning effect enabled.Note that an audio device in mono + # * mode is a no - op, but this call will return successful in that case . + # * Error messages can be retrieved from Mix_GetError( ). + # * + +proc Mix_SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, + importc: "Mix_SetPanning", dynlib: MixerLibName.} + # * set the position ofa channel.( angle ) is an integer from 0 to 360, that + # * specifies the location of the sound in relation to the listener.( angle ) + # * will be reduced as neccesary( 540 becomes 180 degrees, -100 becomes 260 ). + # * Angle 0 is due north, and rotates clockwise as the value increases. + # * for efficiency, the precision of this effect may be limited( angles 1 + # * through 7 might all produce the same effect, 8 through 15 are equal, etc ). + # * ( distance ) is an integer between 0 and 255 that specifies the space + # * between the sound and the listener.The larger the number, the further + # * away the sound is .Using 255 does not guarantee that the channel will be + # * culled from the mixing process or be completely silent.For efficiency, + # * the precision of this effect may be limited( distance 0 through 5 might + # * all produce the same effect, 6 through 10 are equal, etc ).Setting( angle ) + # * and ( distance ) to 0 unregisters this effect, since the data would be + # * unchanged. + # * + # * if you need more precise positional audio, consider using OpenAL for + # * spatialized effects instead of SDL_mixer.This is only meant to be a + # * basic effect for simple "3D" games. + # * + # * if the audio device is configured for mono output, then you won't get + # * any effectiveness from the angle; however, distance attenuation on the + # * channel will still occur.While this effect will function with stereo + # * voices, it makes more sense to use voices with only one channel of sound, + # * so when they are mixed through this effect, the positioning will sound + # * correct.You can convert them to mono through SDL before giving them to + # * the mixer in the first place if you like. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the positioning will be done to the final mixed stream before passing it + # * on to the audio device. + # * + # * This is a convenience wrapper over Mix_SetDistance( ) and Mix_SetPanning( ). + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if position effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, + importc: "Mix_SetPosition", dynlib: MixerLibName.} + #* set the "distance" of a channel.( distance ) is an integer from 0 to 255 + # * that specifies the location of the sound in relation to the listener. + # * Distance 0 is overlapping the listener, and 255 is as far away as possible + # * A distance of 255 does not guarantee silence; in such a case , you might + # * want to try changing the chunk's volume, or just cull the sample from the + # * mixing process with Mix_HaltChannel( ). + # * for efficiency, the precision of this effect may be limited( distances 1 + # * through 7 might all produce the same effect, 8 through 15 are equal, etc ). + # * ( distance ) is an integer between 0 and 255 that specifies the space + # * between the sound and the listener.The larger the number, the further + # * away the sound is . + # * Setting( distance ) to 0 unregisters this effect, since the data would be + # * unchanged. + # * if you need more precise positional audio, consider using OpenAL for + # * spatialized effects instead of SDL_mixer.This is only meant to be a + # * basic effect for simple "3D" games. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the distance attenuation will be done to the final mixed stream before + # * passing it on to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if position effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetDistance*(channel: int, distance: Uint8): int{.cdecl, + importc: "Mix_SetDistance", dynlib: MixerLibName.} + # * + # * !!! FIXME : Haven't implemented, since the effect goes past the + # * end of the sound buffer.Will have to think about this. + # * - -ryan. + # * / + # { if 0 + # { * Causes an echo effect to be mixed into a sound.( echo ) is the amount + # * of echo to mix.0 is no echo, 255 is infinite( and probably not + # * what you want ). + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the reverbing will be done to the final mixed stream before passing it on + # * to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally.If you specify an echo + # * of zero, the effect is unregistered, as the data is already in that state. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if reversing effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * + # extern no_parse_DECLSPEC int Mix_SetReverb( int channel, Uint8 echo ); + # #E ndif + # * Causes a channel to reverse its stereo.This is handy if the user has his + # * speakers hooked up backwards, or you would like to have a minor bit of + # * psychedelia in your sound code. : )Calling this function with ( flip ) + # * set to non - zero reverses the chunks's usual channels. If (flip) is zero, + # * the effect is unregistered. + # * + # * This uses the Mix_RegisterEffect( )API internally, and thus is probably + # * more CPU intensive than having the user just plug in his speakers + # * correctly.Mix_SetReverseStereo( )returns without registering the effect + # * function if the audio device is not configured for stereo output. + # * + # * if you specify MIX_CHANNEL_POST for ( channel ), then this the effect is used + # * on the final mixed stream before sending it on to the audio device( a + # * posteffect ). + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if reversing effect is enabled.Note that an audio device in mono + # * mode is a no - op, but this call will return successful in that case . + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetReverseStereo*(channel: int, flip: int): int{.cdecl, + importc: "Mix_SetReverseStereo", dynlib: MixerLibName.} + # end of effects API. - -ryan. * + # Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate + # them dynamically to the next sample if requested with a -1 value below. + # Returns the number of reserved channels. + # +proc Mix_ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", + dynlib: MixerLibName.} + # Channel grouping functions + # Attach a tag to a channel. A tag can be assigned to several mixer + # channels, to form groups of channels. + # If 'tag' is -1, the tag is removed (actually -1 is the tag used to + # represent the group of all the channels). + # Returns true if everything was OK. + # +proc Mix_GroupChannel*(which: int, tag: int): int{.cdecl, + importc: "Mix_GroupChannel", dynlib: MixerLibName.} + # Assign several consecutive channels to a group +proc Mix_GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, + importc: "Mix_GroupChannels", dynlib: MixerLibName.} + # Finds the first available channel in a group of channels +proc Mix_GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", + dynlib: MixerLibName.} + # Returns the number of channels in a group. This is also a subtle + # way to get the total number of channels when 'tag' is -1 + # +proc Mix_GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", + dynlib: MixerLibName.} + # Finds the "oldest" sample playing in a group of channels +proc Mix_GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", + dynlib: MixerLibName.} + # Finds the "most recent" (i.e. last) sample playing in a group of channels +proc Mix_GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", + dynlib: MixerLibName.} + # The same as above, but the sound is played at most 'ticks' milliseconds +proc Mix_PlayChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, + ticks: int): int{.cdecl, + importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.} + # Play an audio chunk on a specific channel. + # If the specified channel is -1, play on the first free channel. + # If 'loops' is greater than zero, loop the sound that many times. + # If 'loops' is -1, loop inifinitely (~65000 times). + # Returns which channel was used to play the sound. + # +proc Mix_PlayChannel*(channel: int, chunk: PMix_Chunk, loops: int): int +proc Mix_PlayMusic*(music: PMix_Music, loops: int): int{.cdecl, + importc: "Mix_PlayMusic", dynlib: MixerLibName.} + # Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions +proc Mix_FadeInMusic*(music: PMix_Music, loops: int, ms: int): int{.cdecl, + importc: "Mix_FadeInMusic", dynlib: MixerLibName.} +proc Mix_FadeInChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, + ms: int, ticks: int): int{.cdecl, + importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.} +proc Mix_FadeInChannel*(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int + # Set the volume in the range of 0-128 of a specific channel or chunk. + # If the specified channel is -1, set volume for all channels. + # Returns the original volume. + # If the specified volume is -1, just return the current volume. + # +proc Mix_Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", + dynlib: MixerLibName.} +proc Mix_VolumeChunk*(chunk: PMix_Chunk, volume: int): int{.cdecl, + importc: "Mix_VolumeChunk", dynlib: MixerLibName.} +proc Mix_VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", + dynlib: MixerLibName.} + # Halt playing of a particular channel +proc Mix_HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", + dynlib: MixerLibName.} +proc Mix_HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", + dynlib: MixerLibName.} +proc Mix_HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", + dynlib: MixerLibName.} + # Change the expiration delay for a particular channel. + # The sample will stop playing after the 'ticks' milliseconds have elapsed, + # or remove the expiration if 'ticks' is -1 + # +proc Mix_ExpireChannel*(channel: int, ticks: int): int{.cdecl, + importc: "Mix_ExpireChannel", dynlib: MixerLibName.} + # Halt a channel, fading it out progressively till it's silent + # The ms parameter indicates the number of milliseconds the fading + # will take. + # +proc Mix_FadeOutChannel*(which: int, ms: int): int{.cdecl, + importc: "Mix_FadeOutChannel", dynlib: MixerLibName.} +proc Mix_FadeOutGroup*(tag: int, ms: int): int{.cdecl, + importc: "Mix_FadeOutGroup", dynlib: MixerLibName.} +proc Mix_FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", + dynlib: MixerLibName.} + # Query the fading status of a channel +proc Mix_FadingMusic*(): TMix_Fading{.cdecl, importc: "Mix_FadingMusic", + dynlib: MixerLibName.} +proc Mix_FadingChannel*(which: int): TMix_Fading{.cdecl, + importc: "Mix_FadingChannel", dynlib: MixerLibName.} + # Pause/Resume a particular channel +proc Mix_Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.} +proc Mix_Resume*(channel: int){.cdecl, importc: "Mix_Resume", + dynlib: MixerLibName.} +proc Mix_Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", + dynlib: MixerLibName.} + # Pause/Resume the music stream +proc Mix_PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.} +proc Mix_ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.} +proc Mix_RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.} +proc Mix_PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", + dynlib: MixerLibName.} + # Set the current position in the music stream. + # This returns 0 if successful, or -1 if it failed or isn't implemented. + # This function is only implemented for MOD music formats (set pattern + # order number) and for OGG music (set position in seconds), at the + # moment. + # +proc Mix_SetMusicPosition*(position: float64): int{.cdecl, + importc: "Mix_SetMusicPosition", dynlib: MixerLibName.} + # Check the status of a specific channel. + # If the specified channel is -1, check all channels. + # +proc Mix_Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", + dynlib: MixerLibName.} +proc Mix_PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", + dynlib: MixerLibName.} + # Stop music and set external music playback command +proc Mix_SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", + dynlib: MixerLibName.} + # Synchro value is set by MikMod from modules while playing +proc Mix_SetSynchroValue*(value: int): int{.cdecl, + importc: "Mix_SetSynchroValue", dynlib: MixerLibName.} +proc Mix_GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", + dynlib: MixerLibName.} + # + # Get the Mix_Chunk currently associated with a mixer channel + # Returns nil if it's an invalid channel, or there's no chunk associated. + # +proc Mix_GetChunk*(channel: int): PMix_Chunk{.cdecl, importc: "Mix_GetChunk", + dynlib: MixerLibName.} + # Close the mixer, halting all playing audio +proc Mix_CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.} + # We'll use SDL for reporting errors +proc Mix_SetError*(fmt: cstring) +proc Mix_GetError*(): cstring +# implementation + +proc MIXER_VERSION(X: var Tversion) = + X.major = MIXER_MAJOR_VERSION + X.minor = MIXER_MINOR_VERSION + X.patch = MIXER_PATCHLEVEL + +proc Mix_LoadWAV(filename: cstring): PMix_Chunk = + result = Mix_LoadWAV_RW(RWFromFile(filename, "rb"), 1) + +proc Mix_PlayChannel(channel: int, chunk: PMix_Chunk, loops: int): int = + result = Mix_PlayChannelTimed(channel, chunk, loops, - 1) + +proc Mix_FadeInChannel(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int = + result = Mix_FadeInChannelTimed(channel, chunk, loops, ms, - 1) + +proc Mix_SetError(fmt: cstring) = + SetError(fmt) + +proc Mix_GetError(): cstring = + result = GetError() diff --git a/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim b/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim new file mode 100644 index 000000000..571263014 --- /dev/null +++ b/lib/newwrap/sdl/sdl_mixer_nosmpeg.nim @@ -0,0 +1,598 @@ +#****************************************************************************** +# Copy of SDL_Mixer without smpeg dependency and mp3 support +#****************************************************************************** + +import + + +when defined(windows): + const + MixerLibName = "SDL_mixer.dll" +elif defined(macosx): + const + MixerLibName = "libSDL_mixer-1.2.0.dylib" +else: + const + MixerLibName = "libSDL_mixer.so" +const + MIXER_MAJOR_VERSION* = 1'i8 + MIXER_MINOR_VERSION* = 2'i8 + MIXER_PATCHLEVEL* = 7'i8 # Backwards compatibility + MIX_MAJOR_VERSION* = MIXER_MAJOR_VERSION + MIX_MINOR_VERSION* = MIXER_MINOR_VERSION + MIX_PATCHLEVEL* = MIXER_PATCHLEVEL # SDL_Mixer.h constants + # The default mixer has 8 simultaneous mixing channels + MIX_CHANNELS* = 8 # Good default values for a PC soundcard + MIX_DEFAULT_FREQUENCY* = 22050 + +when defined(IA32): + const + MIX_DEFAULT_FORMAT* = AUDIO_S16LSB +else: + const + MIX_DEFAULT_FORMAT* = AUDIO_S16MSB +const + MIX_DEFAULT_CHANNELS* = 2 + MIX_MAX_VOLUME* = 128 # Volume of a chunk + PATH_MAX* = 255 # mikmod.h constants + #* + # * Library version + # * + LIBMIKMOD_VERSION_MAJOR* = 3 + LIBMIKMOD_VERSION_MINOR* = 1 + LIBMIKMOD_REVISION* = 8 + LIBMIKMOD_VERSION* = ((LIBMIKMOD_VERSION_MAJOR shl 16) or + (LIBMIKMOD_VERSION_MINOR shl 8) or (LIBMIKMOD_REVISION)) + +type #music_cmd.h types + PMusicCMD* = ptr TMusicCMD + TMusicCMD*{.final.} = object #wavestream.h types + filename*: array[0..PATH_MAX - 1, char] + cmd*: array[0..PATH_MAX - 1, char] + pid*: TSYS_ThreadHandle + + PWAVStream* = ptr TWAVStream + TWAVStream*{.final.} = object #playmidi.h types + wavefp*: Pointer + start*: int32 + stop*: int32 + cvt*: TAudioCVT + + PMidiEvent* = ptr TMidiEvent + TMidiEvent*{.final.} = object + time*: int32 + channel*: uint8 + type_*: uint8 + a*: uint8 + b*: uint8 + + PMidiSong* = ptr TMidiSong + TMidiSong*{.final.} = object #music_ogg.h types + samples*: int32 + events*: PMidiEvent + + POGG_Music* = ptr TOGG_Music + TOGG_Music*{.final.} = object # mikmod.h types + #* + # * Error codes + # * + playing*: int + volume*: int #vf: OggVorbis_File; + section*: int + cvt*: TAudioCVT + len_available*: int + snd_available*: PUint8 + + TErrorEnum* = enum + MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING, + MMERR_SAMPLE_TOO_BIG, MMERR_OUT_OF_HANDLES, MMERR_UNKNOWN_WAVE_TYPE, + MMERR_LOADING_PATTERN, MMERR_LOADING_TRACK, MMERR_LOADING_HEADER, + MMERR_LOADING_SAMPLEINFO, MMERR_NOT_A_MODULE, MMERR_NOT_A_STREAM, + MMERR_MED_SYNTHSAMPLES, MMERR_ITPACK_INVALID_DATA, MMERR_DETECTING_DEVICE, + MMERR_INVALID_DEVICE, MMERR_INITIALIZING_MIXER, MMERR_OPENING_AUDIO, + MMERR_8BIT_ONLY, MMERR_16BIT_ONLY, MMERR_STEREO_ONLY, MMERR_ULAW, + MMERR_NON_BLOCK, MMERR_AF_AUDIO_PORT, MMERR_AIX_CONFIG_INIT, + MMERR_AIX_CONFIG_CONTROL, MMERR_AIX_CONFIG_START, MMERR_GUS_SETTINGS, + MMERR_GUS_RESET, MMERR_GUS_TIMER, MMERR_HP_SETSAMPLESIZE, MMERR_HP_SETSPEED, + MMERR_HP_CHANNELS, MMERR_HP_AUDIO_OUTPUT, MMERR_HP_AUDIO_DESC, + MMERR_HP_BUFFERSIZE, MMERR_OSS_SETFRAGMENT, MMERR_OSS_SETSAMPLESIZE, + MMERR_OSS_SETSTEREO, MMERR_OSS_SETSPEED, MMERR_SGI_SPEED, MMERR_SGI_16BIT, + MMERR_SGI_8BIT, MMERR_SGI_STEREO, MMERR_SGI_MONO, MMERR_SUN_INIT, + MMERR_OS2_MIXSETUP, MMERR_OS2_SEMAPHORE, MMERR_OS2_TIMER, MMERR_OS2_THREAD, + MMERR_DS_PRIORITY, MMERR_DS_BUFFER, MMERR_DS_FORMAT, MMERR_DS_NOTIFY, + MMERR_DS_EVENT, MMERR_DS_THREAD, MMERR_DS_UPDATE, MMERR_WINMM_HANDLE, + MMERR_WINMM_ALLOCATED, MMERR_WINMM_DEVICEID, MMERR_WINMM_FORMAT, + MMERR_WINMM_UNKNOWN, MMERR_MAC_SPEED, MMERR_MAC_START, MMERR_MAX + PMODULE* = ptr TMODULE + TMODULE*{.final.} = object + PUNIMOD* = ptr TUNIMOD + TUNIMOD* = TMODULE #SDL_mixer.h types + # The internal format for an audio chunk + PMix_Chunk* = ptr TMix_Chunk + TMix_Chunk*{.final.} = object + allocated*: int + abuf*: PUint8 + alen*: Uint32 + volume*: Uint8 # Per-sample volume, 0-128 + + Mix_Chunk* = TMix_Chunk # The different fading types supported + TMix_Fading* = enum + MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN + Mix_Fading* = TMix_Fading + TMix_MusicType* = enum + MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG + PMix_Music* = ptr TMix_Music + TMix_Music*{.final.} = object + type_*: TMix_MusicType + + TMixFunction* = proc (udata: Pointer, stream: PUint8, length: int): Pointer{. + cdecl.} # This macro can be used to fill a version structure with the compile-time + # version of the SDL_mixer library. + +proc MIXER_VERSION*(X: var TVersion) + # This function gets the version of the dynamically linked SDL_mixer library. + # It should NOT be used to fill a version structure, instead you should use the + # SDL_MIXER_VERSION() macro. +proc Mix_Linked_Version*(): Pversion{.cdecl, importc: "Mix_Linked_Version", + dynlib: MixerLibName.} + # Open the mixer with a certain audio format +proc Mix_OpenAudio*(frequency: int, format: Uint16, channels: int, + chunksize: int): int{.cdecl, importc: "Mix_OpenAudio", + dynlib: MixerLibName.} + # Dynamically change the number of channels managed by the mixer. + # If decreasing the number of channels, the upper channels are + # stopped. + # This function returns the new number of allocated channels. + # +proc Mix_AllocateChannels*(numchannels: int): int{.cdecl, + importc: "Mix_AllocateChannels", dynlib: MixerLibName.} + # Find out what the actual audio device parameters are. + # This function returns 1 if the audio has been opened, 0 otherwise. + # +proc Mix_QuerySpec*(frequency: var int, format: var Uint16, channels: var int): int{. + cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.} + # Load a wave file or a music (.mod .s3m .it .xm) file +proc Mix_LoadWAV_RW*(src: PRWops, freesrc: int): PMix_Chunk{.cdecl, + importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.} +proc Mix_LoadWAV*(filename: cstring): PMix_Chunk +proc Mix_LoadMUS*(filename: cstring): PMix_Music{.cdecl, importc: "Mix_LoadMUS", + dynlib: MixerLibName.} + # Load a wave file of the mixer format from a memory buffer +proc Mix_QuickLoad_WAV*(mem: PUint8): PMix_Chunk{.cdecl, + importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.} + # Free an audio chunk previously loaded +proc Mix_FreeChunk*(chunk: PMix_Chunk){.cdecl, importc: "Mix_FreeChunk", + dynlib: MixerLibName.} +proc Mix_FreeMusic*(music: PMix_Music){.cdecl, importc: "Mix_FreeMusic", + dynlib: MixerLibName.} + # Find out the music format of a mixer music, or the currently playing + # music, if 'music' is NULL. +proc Mix_GetMusicType*(music: PMix_Music): TMix_MusicType{.cdecl, + importc: "Mix_GetMusicType", dynlib: MixerLibName.} + # Set a function that is called after all mixing is performed. + # This can be used to provide real-time visual display of the audio stream + # or add a custom mixer filter for the stream data. + # +proc Mix_SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl, + importc: "Mix_SetPostMix", dynlib: MixerLibName.} + # Add your own music player or additional mixer function. + # If 'mix_func' is NULL, the default music player is re-enabled. + # +proc Mix_HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl, + importc: "Mix_HookMusic", dynlib: MixerLibName.} + # Add your own callback when the music has finished playing. + # +proc Mix_HookMusicFinished*(music_finished: Pointer){.cdecl, + importc: "Mix_HookMusicFinished", dynlib: MixerLibName.} + # Get a pointer to the user data for the current music hook +proc Mix_GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData", + dynlib: MixerLibName.} + #* Add your own callback when a channel has finished playing. NULL + # * to disable callback.* +type + TChannel_finished* = proc (channel: int){.cdecl.} + +proc Mix_ChannelFinished*(channel_finished: TChannel_finished){.cdecl, + importc: "Mix_ChannelFinished", dynlib: MixerLibName.} +const + MIX_CHANNEL_POST* = - 2 #* This is the format of a special effect callback: + # * + # * myeffect(int chan, void *stream, int len, void *udata); + # * + # * (chan) is the channel number that your effect is affecting. (stream) is + # * the buffer of data to work upon. (len) is the size of (stream), and + # * (udata) is a user-defined bit of data, which you pass as the last arg of + # * Mix_RegisterEffect(), and is passed back unmolested to your callback. + # * Your effect changes the contents of (stream) based on whatever parameters + # * are significant, or just leaves it be, if you prefer. You can do whatever + # * you like to the buffer, though, and it will continue in its changed state + # * down the mixing pipeline, through any other effect functions, then finally + # * to be mixed with the rest of the channels and music for the final output + # * stream. + # * + +type + TMix_EffectFunc* = proc (chan: int, stream: Pointer, length: int, + udata: Pointer): Pointer{.cdecl.} # * This is a callback that signifies that a channel has finished all its + # * loops and has completed playback. This gets called if the buffer + # * plays out normally, or if you call Mix_HaltChannel(), implicitly stop + # * a channel via + # Mix_AllocateChannels(), or unregister a callback while + # * it's still playing. + TMix_EffectDone* = proc (chan: int, udata: Pointer): Pointer{.cdecl.} #* Register a special effect function. At mixing time, the channel data is + # * copied into a buffer and passed through each registered effect function. + # * After it passes through all the functions, it is mixed into the final + # * output stream. The copy to buffer is performed once, then each effect + # * function performs on the output of the previous effect. Understand that + # * this extra copy to a buffer is not performed if there are no effects + # * registered for a given chunk, which saves CPU cycles, and any given + # * effect will be extra cycles, too, so it is crucial that your code run + # * fast. Also note that the data that your function is given is in the + # * format of the sound device, and not the format you gave to Mix_OpenAudio(), + # * although they may in reality be the same. This is an unfortunate but + # * necessary speed concern. Use Mix_QuerySpec() to determine if you can + # * handle the data before you register your effect, and take appropriate + # * actions. + # * You may also specify a callback (Mix_EffectDone_t) that is called when + # * the channel finishes playing. This gives you a more fine-grained control + # * than Mix_ChannelFinished(), in case you need to free effect-specific + # * resources, etc. If you don't need this, you can specify NULL. + # * You may set the callbacks before or after calling Mix_PlayChannel(). + # * Things like Mix_SetPanning() are just internal special effect functions, + # * so if you are using that, you've already incurred the overhead of a copy + # * to a separate buffer, and that these effects will be in the queue with + # * any functions you've registered. The list of registered effects for a + # * channel is reset when a chunk finishes playing, so you need to explicitly + # * set them with each call to Mix_PlayChannel*(). + # * You may also register a special effect function that is to be run after + # * final mixing occurs. The rules for these callbacks are identical to those + # * in Mix_RegisterEffect, but they are run after all the channels and the + # * music have been mixed into a single stream, whereas channel-specific + # * effects run on a given channel before any other mixing occurs. These + # * global effect callbacks are call "posteffects". Posteffects only have + # * their Mix_EffectDone_t function called when they are unregistered (since + # * the main output stream is never "done" in the same sense as a channel). + # * You must unregister them manually when you've had enough. Your callback + # * will be told that the channel being mixed is (MIX_CHANNEL_POST) if the + # * processing is considered a posteffect. + # * + # * After all these effects have finished processing, the callback registered + # * through Mix_SetPostMix() runs, and then the stream goes to the audio + # * device. + # * + # * returns zero if error (no such channel), nonzero if added. + # * Error messages can be retrieved from Mix_GetError(). + +proc Mix_RegisterEffect*(chan: int, f: TMix_EffectFunc, d: TMix_EffectDone, + arg: Pointer): int{.cdecl, + importc: "Mix_RegisterEffect", dynlib: MixerLibName.} + #* You may not need to call this explicitly, unless you need to stop an + # * effect from processing in the middle of a chunk's playback. + # * Posteffects are never implicitly unregistered as they are for channels, + # * but they may be explicitly unregistered through this function by + # * specifying MIX_CHANNEL_POST for a channel. + # * returns zero if error (no such channel or effect), nonzero if removed. + # * Error messages can be retrieved from Mix_GetError(). + # * +proc Mix_UnregisterEffect*(channel: int, f: TMix_EffectFunc): int{.cdecl, + importc: "Mix_UnregisterEffect", dynlib: MixerLibName.} + #* You may not need to call this explicitly, unless you need to stop all + # * effects from processing in the middle of a chunk's playback. Note that + # * this will also shut off some internal effect processing, since + # * Mix_SetPanning( ) and others may use this API under the hood.This is + # * called internally when a channel completes playback. + # * Posteffects are never implicitly unregistered as they are for channels, + # * but they may be explicitly unregistered through this function by + # * specifying MIX_CHANNEL_POST for a channel. + # * returns zero if error( no such channel ), nonzero if all effects removed. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_UnregisterAllEffects*(channel: int): int{.cdecl, + importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.} +const + MIX_EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED" # * These are the internally - defined mixing effects.They use the same API that + # * effects defined in the application use, but are provided here as a + # * convenience.Some effects can reduce their quality or use more memory in + # * the name of speed; to enable this, make sure the environment variable + # * MIX_EFFECTSMAXSPEED( see above ) is defined before you call + # * Mix_OpenAudio( ). + # * + #* set the panning of a channel.The left and right channels are specified + # * as integers between 0 and 255, quietest to loudest, respectively. + # * + # * Technically, this is just individual volume control for a sample with + # * two( stereo )channels, so it can be used for more than just panning. + # * if you want real panning, call it like this : + # * + # * Mix_SetPanning( channel, left, 255 - left ); + # * + # * ...which isn't so hard. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the panning will be done to the final mixed stream before passing it on + # * to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally, and returns without + # * registering the effect function if the audio device is not configured + # * for stereo output.Setting both( left ) and ( right ) to 255 causes this + # * effect to be unregistered, since that is the data's normal state. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if panning effect enabled.Note that an audio device in mono + # * mode is a no - op, but this call will return successful in that case . + # * Error messages can be retrieved from Mix_GetError( ). + +proc Mix_SetPanning*(channel: int, left: Uint8, right: Uint8): int{.cdecl, + importc: "Mix_SetPanning", dynlib: MixerLibName.} + # * set the position ofa channel.( angle ) is an integer from 0 to 360, that + # * specifies the location of the sound in relation to the listener.( angle ) + # * will be reduced as neccesary( 540 becomes 180 degrees, -100 becomes 260 ). + # * Angle 0 is due north, and rotates clockwise as the value increases. + # * for efficiency, the precision of this effect may be limited( angles 1 + # * through 7 might all produce the same effect, 8 through 15 are equal, etc ). + # * ( distance ) is an integer between 0 and 255 that specifies the space + # * between the sound and the listener.The larger the number, the further + # * away the sound is .Using 255 does not guarantee that the channel will be + # * culled from the mixing process or be completely silent.For efficiency, + # * the precision of this effect may be limited( distance 0 through 5 might + # * all produce the same effect, 6 through 10 are equal, etc ).Setting( angle ) + # * and ( distance ) to 0 unregisters this effect, since the data would be + # * unchanged. + # * + # * if you need more precise positional audio, consider using OpenAL for + # * spatialized effects instead of SDL_mixer.This is only meant to be a + # * basic effect for simple "3D" games. + # * + # * if the audio device is configured for mono output, then you won't get + # * any effectiveness from the angle; however, distance attenuation on the + # * channel will still occur.While this effect will function with stereo + # * voices, it makes more sense to use voices with only one channel of sound, + # * so when they are mixed through this effect, the positioning will sound + # * correct.You can convert them to mono through SDL before giving them to + # * the mixer in the first place if you like. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the positioning will be done to the final mixed stream before passing it + # * on to the audio device. + # * + # * This is a convenience wrapper over Mix_SetDistance( ) and Mix_SetPanning( ). + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if position effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetPosition*(channel: int, angle: Sint16, distance: Uint8): int{.cdecl, + importc: "Mix_SetPosition", dynlib: MixerLibName.} + #* set the "distance" of a channel.( distance ) is an integer from 0 to 255 + # * that specifies the location of the sound in relation to the listener. + # * Distance 0 is overlapping the listener, and 255 is as far away as possible + # * A distance of 255 does not guarantee silence; in such a case , you might + # * want to try changing the chunk's volume, or just cull the sample from the + # * mixing process with Mix_HaltChannel( ). + # * for efficiency, the precision of this effect may be limited( distances 1 + # * through 7 might all produce the same effect, 8 through 15 are equal, etc ). + # * ( distance ) is an integer between 0 and 255 that specifies the space + # * between the sound and the listener.The larger the number, the further + # * away the sound is . + # * Setting( distance ) to 0 unregisters this effect, since the data would be + # * unchanged. + # * if you need more precise positional audio, consider using OpenAL for + # * spatialized effects instead of SDL_mixer.This is only meant to be a + # * basic effect for simple "3D" games. + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the distance attenuation will be done to the final mixed stream before + # * passing it on to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if position effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetDistance*(channel: int, distance: Uint8): int{.cdecl, + importc: "Mix_SetDistance", dynlib: MixerLibName.} + # * + # * !!! FIXME : Haven't implemented, since the effect goes past the + # * end of the sound buffer.Will have to think about this. + # * - -ryan. + # * / + # { if 0 + # { * Causes an echo effect to be mixed into a sound.( echo ) is the amount + # * of echo to mix.0 is no echo, 255 is infinite( and probably not + # * what you want ). + # * + # * Setting( channel ) to MIX_CHANNEL_POST registers this as a posteffect, and + # * the reverbing will be done to the final mixed stream before passing it on + # * to the audio device. + # * + # * This uses the Mix_RegisterEffect( )API internally.If you specify an echo + # * of zero, the effect is unregistered, as the data is already in that state. + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if reversing effect is enabled. + # * Error messages can be retrieved from Mix_GetError( ). + # * + # extern no_parse_DECLSPEC int Mix_SetReverb( int channel, Uint8 echo ); + # #E ndif + # * Causes a channel to reverse its stereo.This is handy if the user has his + # * speakers hooked up backwards, or you would like to have a minor bit of + # * psychedelia in your sound code. : )Calling this function with ( flip ) + # * set to non - zero reverses the chunks's usual channels. If (flip) is zero, + # * the effect is unregistered. + # * + # * This uses the Mix_RegisterEffect( )API internally, and thus is probably + # * more CPU intensive than having the user just plug in his speakers + # * correctly.Mix_SetReverseStereo( )returns without registering the effect + # * function if the audio device is not configured for stereo output. + # * + # * if you specify MIX_CHANNEL_POST for ( channel ), then this the effect is used + # * on the final mixed stream before sending it on to the audio device( a + # * posteffect ). + # * + # * returns zero if error( no such channel or Mix_RegisterEffect( )fails ), + # * nonzero if reversing effect is enabled.Note that an audio device in mono + # * mode is a no - op, but this call will return successful in that case . + # * Error messages can be retrieved from Mix_GetError( ). + # * +proc Mix_SetReverseStereo*(channel: int, flip: int): int{.cdecl, + importc: "Mix_SetReverseStereo", dynlib: MixerLibName.} + # end of effects API. - -ryan. * + # Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate + # them dynamically to the next sample if requested with a -1 value below. + # Returns the number of reserved channels. + # +proc Mix_ReserveChannels*(num: int): int{.cdecl, importc: "Mix_ReserveChannels", + dynlib: MixerLibName.} + # Channel grouping functions + # Attach a tag to a channel. A tag can be assigned to several mixer + # channels, to form groups of channels. + # If 'tag' is -1, the tag is removed (actually -1 is the tag used to + # represent the group of all the channels). + # Returns true if everything was OK. + # +proc Mix_GroupChannel*(which: int, tag: int): int{.cdecl, + importc: "Mix_GroupChannel", dynlib: MixerLibName.} + # Assign several consecutive channels to a group +proc Mix_GroupChannels*(`from`: int, `to`: int, tag: int): int{.cdecl, + importc: "Mix_GroupChannels", dynlib: MixerLibName.} + # Finds the first available channel in a group of channels +proc Mix_GroupAvailable*(tag: int): int{.cdecl, importc: "Mix_GroupAvailable", + dynlib: MixerLibName.} + # Returns the number of channels in a group. This is also a subtle + # way to get the total number of channels when 'tag' is -1 + # +proc Mix_GroupCount*(tag: int): int{.cdecl, importc: "Mix_GroupCount", + dynlib: MixerLibName.} + # Finds the "oldest" sample playing in a group of channels +proc Mix_GroupOldest*(tag: int): int{.cdecl, importc: "Mix_GroupOldest", + dynlib: MixerLibName.} + # Finds the "most recent" (i.e. last) sample playing in a group of channels +proc Mix_GroupNewer*(tag: int): int{.cdecl, importc: "Mix_GroupNewer", + dynlib: MixerLibName.} + # The same as above, but the sound is played at most 'ticks' milliseconds +proc Mix_PlayChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, + ticks: int): int{.cdecl, + importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.} + # Play an audio chunk on a specific channel. + # If the specified channel is -1, play on the first free channel. + # If 'loops' is greater than zero, loop the sound that many times. + # If 'loops' is -1, loop inifinitely (~65000 times). + # Returns which channel was used to play the sound. + # +proc Mix_PlayChannel*(channel: int, chunk: PMix_Chunk, loops: int): int +proc Mix_PlayMusic*(music: PMix_Music, loops: int): int{.cdecl, + importc: "Mix_PlayMusic", dynlib: MixerLibName.} + # Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions +proc Mix_FadeInMusic*(music: PMix_Music, loops: int, ms: int): int{.cdecl, + importc: "Mix_FadeInMusic", dynlib: MixerLibName.} +proc Mix_FadeInChannelTimed*(channel: int, chunk: PMix_Chunk, loops: int, + ms: int, ticks: int): int{.cdecl, + importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.} +proc Mix_FadeInChannel*(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int + # Set the volume in the range of 0-128 of a specific channel or chunk. + # If the specified channel is -1, set volume for all channels. + # Returns the original volume. + # If the specified volume is -1, just return the current volume. + # +proc Mix_Volume*(channel: int, volume: int): int{.cdecl, importc: "Mix_Volume", + dynlib: MixerLibName.} +proc Mix_VolumeChunk*(chunk: PMix_Chunk, volume: int): int{.cdecl, + importc: "Mix_VolumeChunk", dynlib: MixerLibName.} +proc Mix_VolumeMusic*(volume: int): int{.cdecl, importc: "Mix_VolumeMusic", + dynlib: MixerLibName.} + # Halt playing of a particular channel +proc Mix_HaltChannel*(channel: int): int{.cdecl, importc: "Mix_HaltChannel", + dynlib: MixerLibName.} +proc Mix_HaltGroup*(tag: int): int{.cdecl, importc: "Mix_HaltGroup", + dynlib: MixerLibName.} +proc Mix_HaltMusic*(): int{.cdecl, importc: "Mix_HaltMusic", + dynlib: MixerLibName.} + # Change the expiration delay for a particular channel. + # The sample will stop playing after the 'ticks' milliseconds have elapsed, + # or remove the expiration if 'ticks' is -1 + # +proc Mix_ExpireChannel*(channel: int, ticks: int): int{.cdecl, + importc: "Mix_ExpireChannel", dynlib: MixerLibName.} + # Halt a channel, fading it out progressively till it's silent + # The ms parameter indicates the number of milliseconds the fading + # will take. + # +proc Mix_FadeOutChannel*(which: int, ms: int): int{.cdecl, + importc: "Mix_FadeOutChannel", dynlib: MixerLibName.} +proc Mix_FadeOutGroup*(tag: int, ms: int): int{.cdecl, + importc: "Mix_FadeOutGroup", dynlib: MixerLibName.} +proc Mix_FadeOutMusic*(ms: int): int{.cdecl, importc: "Mix_FadeOutMusic", + dynlib: MixerLibName.} + # Query the fading status of a channel +proc Mix_FadingMusic*(): TMix_Fading{.cdecl, importc: "Mix_FadingMusic", + dynlib: MixerLibName.} +proc Mix_FadingChannel*(which: int): TMix_Fading{.cdecl, + importc: "Mix_FadingChannel", dynlib: MixerLibName.} + # Pause/Resume a particular channel +proc Mix_Pause*(channel: int){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.} +proc Mix_Resume*(channel: int){.cdecl, importc: "Mix_Resume", + dynlib: MixerLibName.} +proc Mix_Paused*(channel: int): int{.cdecl, importc: "Mix_Paused", + dynlib: MixerLibName.} + # Pause/Resume the music stream +proc Mix_PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.} +proc Mix_ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.} +proc Mix_RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.} +proc Mix_PausedMusic*(): int{.cdecl, importc: "Mix_PausedMusic", + dynlib: MixerLibName.} + # Set the current position in the music stream. + # This returns 0 if successful, or -1 if it failed or isn't implemented. + # This function is only implemented for MOD music formats (set pattern + # order number) and for OGG music (set position in seconds), at the + # moment. + # +proc Mix_SetMusicPosition*(position: float64): int{.cdecl, + importc: "Mix_SetMusicPosition", dynlib: MixerLibName.} + # Check the status of a specific channel. + # If the specified channel is -1, check all channels. + # +proc Mix_Playing*(channel: int): int{.cdecl, importc: "Mix_Playing", + dynlib: MixerLibName.} +proc Mix_PlayingMusic*(): int{.cdecl, importc: "Mix_PlayingMusic", + dynlib: MixerLibName.} + # Stop music and set external music playback command +proc Mix_SetMusicCMD*(command: cstring): int{.cdecl, importc: "Mix_SetMusicCMD", + dynlib: MixerLibName.} + # Synchro value is set by MikMod from modules while playing +proc Mix_SetSynchroValue*(value: int): int{.cdecl, + importc: "Mix_SetSynchroValue", dynlib: MixerLibName.} +proc Mix_GetSynchroValue*(): int{.cdecl, importc: "Mix_GetSynchroValue", + dynlib: MixerLibName.} + # + # Get the Mix_Chunk currently associated with a mixer channel + # Returns nil if it's an invalid channel, or there's no chunk associated. + # +proc Mix_GetChunk*(channel: int): PMix_Chunk{.cdecl, importc: "Mix_GetChunk", + dynlib: MixerLibName.} + # Close the mixer, halting all playing audio +proc Mix_CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.} + # We'll use SDL for reporting errors +proc Mix_SetError*(fmt: cstring) +proc Mix_GetError*(): cstring +# implementation + +proc MIXER_VERSION(X: var Tversion) = + X.major = MIXER_MAJOR_VERSION + X.minor = MIXER_MINOR_VERSION + X.patch = MIXER_PATCHLEVEL + +proc Mix_LoadWAV(filename: cstring): PMix_Chunk = + result = Mix_LoadWAV_RW(RWFromFile(filename, "rb"), 1) + +proc Mix_PlayChannel(channel: int, chunk: PMix_Chunk, loops: int): int = + result = Mix_PlayChannelTimed(channel, chunk, loops, - 1) + +proc Mix_FadeInChannel(channel: int, chunk: PMix_Chunk, loops: int, ms: int): int = + result = Mix_FadeInChannelTimed(channel, chunk, loops, ms, - 1) + +proc Mix_SetError(fmt: cstring) = + SetError(fmt) + +proc Mix_GetError(): cstring = + result = GetError() diff --git a/lib/newwrap/sdl/sdl_net.nim b/lib/newwrap/sdl/sdl_net.nim new file mode 100644 index 000000000..09318bc79 --- /dev/null +++ b/lib/newwrap/sdl/sdl_net.nim @@ -0,0 +1,442 @@ +#****************************************************************************** +# +# $Id: sdl_net.pas,v 1.7 2005/01/01 02:14:21 savage Exp $ +# +# +# +# Borland Delphi SDL_Net - A x-platform network library for use with SDL. +# Conversion of the Simple DirectMedia Layer Network Headers +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : SDL_net.h +# +# The initial developer of this Pascal code was : +# Dominqiue Louis <Dominique@SavageSoftware.com.au> +# +# Portions created by Dominqiue Louis are +# Copyright (C) 2000 - 2001 Dominqiue Louis. +# +# +# Contributor(s) +# -------------- +# Matthias Thoma <ma.thoma@gmx.de> +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# +# +# +# +# +# +# +# Requires +# -------- +# SDL.pas somehere in your search path +# +# Programming Notes +# ----------------- +# +# +# +# +# Revision History +# ---------------- +# April 09 2001 - DL : Initial Translation +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# $Log: sdl_net.pas,v $ +# Revision 1.7 2005/01/01 02:14:21 savage +# Updated to v1.2.5 +# +# Revision 1.6 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.5 2004/05/10 14:10:04 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.4 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.3 2004/04/01 20:53:23 savage +# Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.2 2004/03/30 20:23:28 savage +# Tidied up use of UNIX compiler directive. +# +# Revision 1.1 2004/02/16 22:16:40 savage +# v1.0 changes +# +# +# +#****************************************************************************** + +import + + +when defined(windows): + const + NetLibName = "SDL_net.dll" +elif defined(macosx): + const + NetLibName = "libSDL_net.dylib" +else: + const + NetLibName = "libSDL_net.so" +const #* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL * + NET_MAJOR_VERSION* = 1'i8 + NET_MINOR_VERSION* = 2'i8 + NET_PATCHLEVEL* = 5'i8 # SDL_Net.h constants + #* Resolve a host name and port to an IP address in network form. + # If the function succeeds, it will return 0. + # If the host couldn't be resolved, the host portion of the returned + # address will be INADDR_NONE, and the function will return -1. + # If 'host' is NULL, the resolved host will be set to INADDR_ANY. + # * + INADDR_ANY* = 0x00000000 + INADDR_NONE* = 0xFFFFFFFF #*********************************************************************** + #* UDP network API * + #*********************************************************************** + #* The maximum channels on a a UDP socket * + NET_MAX_UDPCHANNELS* = 32 #* The maximum addresses bound to a single UDP socket channel * + NET_MAX_UDPADDRESSES* = 4 + +type # SDL_net.h types + #*********************************************************************** + #* IPv4 hostname resolution API * + #*********************************************************************** + PIPAddress* = ptr TIPAddress + TIPAddress*{.final.} = object #* TCP network API + host*: Uint32 # 32-bit IPv4 host address */ + port*: Uint16 # 16-bit protocol port */ + + PTCPSocket* = ptr TTCPSocket + TTCPSocket*{.final.} = object #*********************************************************************** + #* UDP network API * + #*********************************************************************** + ready*: int + channel*: int + remoteAddress*: TIPaddress + localAddress*: TIPaddress + sflag*: int + + PUDP_Channel* = ptr TUDP_Channel + TUDP_Channel*{.final.} = object + numbound*: int + address*: array[0..NET_MAX_UDPADDRESSES - 1, TIPAddress] + + PUDPSocket* = ptr TUDPSocket + TUDPSocket*{.final.} = object + ready*: int + channel*: int + address*: TIPAddress + binding*: array[0..NET_MAX_UDPCHANNELS - 1, TUDP_Channel] + + PUDPpacket* = ptr TUDPpacket + PPUDPpacket* = ptr PUDPpacket + TUDPpacket*{.final.} = object #*********************************************************************** + #* Hooks for checking sockets for available data * + #*********************************************************************** + channel*: int #* The src/dst channel of the packet * + data*: PUint8 #* The packet data * + length*: int #* The length of the packet data * + maxlen*: int #* The size of the data buffer * + status*: int #* packet status after sending * + address*: TIPAddress #* The source/dest address of an incoming/outgoing packet * + + PNet_Socket* = ptr TNet_Socket + TNet_Socket*{.final.} = object + ready*: int + channel*: int + + PNet_SocketSet* = ptr TNet_SocketSet + TNet_SocketSet*{.final.} = object #* Any network socket can be safely cast to this socket type * + numsockets*: int + maxsockets*: int + sockets*: PNet_Socket + + PNet_GenericSocket* = ptr TNet_GenericSocket + TNet_GenericSocket*{.final.} = object # This macro can be used to fill a version structure with the compile-time + # version of the SDL_net library. + ready*: int + + +proc NET_VERSION*(X: var Tversion) + #* Initialize/Cleanup the network API + # SDL must be initialized before calls to functions in this library, + # because this library uses utility functions from the SDL library. + #* +proc Net_Init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.} +proc Net_Quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.} + #* Resolve a host name and port to an IP address in network form. + # If the function succeeds, it will return 0. + # If the host couldn't be resolved, the host portion of the returned + # address will be INADDR_NONE, and the function will return -1. + # If 'host' is NULL, the resolved host will be set to INADDR_ANY. + # * +proc Net_ResolveHost*(address: var TIPaddress, host: cstring, port: Uint16): int{. + cdecl, importc: "SDLNet_ResolveHost", dynlib: NetLibName.} + #* Resolve an ip address to a host name in canonical form. + # If the ip couldn't be resolved, this function returns NULL, + # otherwise a pointer to a static buffer containing the hostname + # is returned. Note that this function is not thread-safe. + #* +proc Net_ResolveIP*(ip: var TIPaddress): cstring{.cdecl, + importc: "SDLNet_ResolveIP", dynlib: NetLibName.} + #*********************************************************************** + #* TCP network API * + #*********************************************************************** + #* Open a TCP network socket + # If ip.host is INADDR_NONE, this creates a local server socket on the + # given port, otherwise a TCP connection to the remote host and port is + # attempted. The address passed in should already be swapped to network + # byte order (addresses returned from SDLNet_ResolveHost() are already + # in the correct form). + # The newly created socket is returned, or NULL if there was an error. + #* +proc Net_TCP_Open*(ip: var TIPaddress): PTCPSocket{.cdecl, + importc: "SDLNet_TCP_Open", dynlib: NetLibName.} + #* Accept an incoming connection on the given server socket. + # The newly created socket is returned, or NULL if there was an error. + #* +proc Net_TCP_Accept*(server: PTCPsocket): PTCPSocket{.cdecl, + importc: "SDLNet_TCP_Accept", dynlib: NetLibName.} + #* Get the IP address of the remote system associated with the socket. + # If the socket is a server socket, this function returns NULL. + #* +proc Net_TCP_GetPeerAddress*(sock: PTCPsocket): PIPAddress{.cdecl, + importc: "SDLNet_TCP_GetPeerAddress", dynlib: NetLibName.} + #* Send 'len' bytes of 'data' over the non-server socket 'sock' + # This function returns the actual amount of data sent. If the return value + # is less than the amount of data sent, then either the remote connection was + # closed, or an unknown socket error occurred. + #* +proc Net_TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl, + importc: "SDLNet_TCP_Send", dynlib: NetLibName.} + #* Receive up to 'maxlen' bytes of data over the non-server socket 'sock', + # and store them in the buffer pointed to by 'data'. + # This function returns the actual amount of data received. If the return + # value is less than or equal to zero, then either the remote connection was + # closed, or an unknown socket error occurred. + #* +proc Net_TCP_Recv*(sock: PTCPsocket, data: Pointer, maxlen: int): int{.cdecl, + importc: "SDLNet_TCP_Recv", dynlib: NetLibName.} + #* Close a TCP network socket * +proc Net_TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close", + dynlib: NetLibName.} + #*********************************************************************** + #* UDP network API * + #*********************************************************************** + #* Allocate/resize/free a single UDP packet 'size' bytes long. + # The new packet is returned, or NULL if the function ran out of memory. + # * +proc Net_AllocPacket*(size: int): PUDPpacket{.cdecl, + importc: "SDLNet_AllocPacket", dynlib: NetLibName.} +proc Net_ResizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl, + importc: "SDLNet_ResizePacket", dynlib: NetLibName.} +proc Net_FreePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket", + dynlib: NetLibName.} + #* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets, + # each 'size' bytes long. + # A pointer to the first packet in the array is returned, or NULL if the + # function ran out of memory. + # * +proc Net_AllocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl, + importc: "SDLNet_AllocPacketV", dynlib: NetLibName.} +proc Net_FreePacketV*(packetV: PUDPpacket){.cdecl, + importc: "SDLNet_FreePacketV", dynlib: NetLibName.} + #* Open a UDP network socket + # If 'port' is non-zero, the UDP socket is bound to a local port. + # This allows other systems to send to this socket via a known port. + #* +proc Net_UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open", + dynlib: NetLibName.} + #* Bind the address 'address' to the requested channel on the UDP socket. + # If the channel is -1, then the first unbound channel will be bound with + # the given address as it's primary address. + # If the channel is already bound, this new address will be added to the + # list of valid source addresses for packets arriving on the channel. + # If the channel is not already bound, then the address becomes the primary + # address, to which all outbound packets on the channel are sent. + # This function returns the channel which was bound, or -1 on error. + #* +proc Net_UDP_Bind*(sock: PUDPsocket, channel: int, address: var TIPaddress): int{. + cdecl, importc: "SDLNet_UDP_Bind", dynlib: NetLibName.} + #* Unbind all addresses from the given channel * +proc Net_UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl, + importc: "SDLNet_UDP_Unbind", dynlib: NetLibName.} + #* Get the primary IP address of the remote system associated with the + # socket and channel. If the channel is -1, then the primary IP port + # of the UDP socket is returned -- this is only meaningful for sockets + # opened with a specific port. + # If the channel is not bound and not -1, this function returns NULL. + # * +proc Net_UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl, + importc: "SDLNet_UDP_GetPeerAddress", dynlib: NetLibName.} + #* Send a vector of packets to the the channels specified within the packet. + # If the channel specified in the packet is -1, the packet will be sent to + # the address in the 'src' member of the packet. + # Each packet will be updated with the status of the packet after it has + # been sent, -1 if the packet send failed. + # This function returns the number of packets sent. + #* +proc Net_UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{. + cdecl, importc: "SDLNet_UDP_SendV", dynlib: NetLibName.} + #* Send a single packet to the specified channel. + # If the channel specified in the packet is -1, the packet will be sent to + # the address in the 'src' member of the packet. + # The packet will be updated with the status of the packet after it has + # been sent. + # This function returns 1 if the packet was sent, or 0 on error. + #* +proc Net_UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{. + cdecl, importc: "SDLNet_UDP_Send", dynlib: NetLibName.} + #* Receive a vector of pending packets from the UDP socket. + # The returned packets contain the source address and the channel they arrived + # on. If they did not arrive on a bound channel, the the channel will be set + # to -1. + # The channels are checked in highest to lowest order, so if an address is + # bound to multiple channels, the highest channel with the source address + # bound will be returned. + # This function returns the number of packets read from the network, or -1 + # on error. This function does not block, so can return 0 packets pending. + #* +proc Net_UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl, + importc: "SDLNet_UDP_RecvV", dynlib: NetLibName.} + #* Receive a single packet from the UDP socket. + # The returned packet contains the source address and the channel it arrived + # on. If it did not arrive on a bound channel, the the channel will be set + # to -1. + # The channels are checked in highest to lowest order, so if an address is + # bound to multiple channels, the highest channel with the source address + # bound will be returned. + # This function returns the number of packets read from the network, or -1 + # on error. This function does not block, so can return 0 packets pending. + #* +proc Net_UDP_Recv*(sock: PUDPsocket, packet: PUDPpacket): int{.cdecl, + importc: "SDLNet_UDP_Recv", dynlib: NetLibName.} + #* Close a UDP network socket * +proc Net_UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close", + dynlib: NetLibName.} + #*********************************************************************** + #* Hooks for checking sockets for available data * + #*********************************************************************** + #* Allocate a socket set for use with SDLNet_CheckSockets() + # This returns a socket set for up to 'maxsockets' sockets, or NULL if + # the function ran out of memory. + # * +proc Net_AllocSocketSet*(maxsockets: int): PNet_SocketSet{.cdecl, + importc: "SDLNet_AllocSocketSet", dynlib: NetLibName.} + #* Add a socket to a set of sockets to be checked for available data * +proc Net_AddSocket*(theSet: PNet_SocketSet, sock: PNet_GenericSocket): int{. + cdecl, importc: "SDLNet_AddSocket", dynlib: NetLibName.} +proc Net_TCP_AddSocket*(theSet: PNet_SocketSet, sock: PTCPSocket): int +proc Net_UDP_AddSocket*(theSet: PNet_SocketSet, sock: PUDPSocket): int + #* Remove a socket from a set of sockets to be checked for available data * +proc Net_DelSocket*(theSet: PNet_SocketSet, sock: PNet_GenericSocket): int{. + cdecl, importc: "SDLNet_DelSocket", dynlib: NetLibName.} +proc Net_TCP_DelSocket*(theSet: PNet_SocketSet, sock: PTCPSocket): int + # SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock) +proc Net_UDP_DelSocket*(theSet: PNet_SocketSet, sock: PUDPSocket): int + #SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock) + #* This function checks to see if data is available for reading on the + # given set of sockets. If 'timeout' is 0, it performs a quick poll, + # otherwise the function returns when either data is available for + # reading, or the timeout in milliseconds has elapsed, which ever occurs + # first. This function returns the number of sockets ready for reading, + # or -1 if there was an error with the select() system call. + #* +proc Net_CheckSockets*(theSet: PNet_SocketSet, timeout: Sint32): int{.cdecl, + importc: "SDLNet_CheckSockets", dynlib: NetLibName.} + #* After calling SDLNet_CheckSockets(), you can use this function on a + # socket that was in the socket set, to find out if data is available + # for reading. + #* +proc Net_SocketReady*(sock: PNet_GenericSocket): bool + #* Free a set of sockets allocated by SDL_NetAllocSocketSet() * +proc Net_FreeSocketSet*(theSet: PNet_SocketSet){.cdecl, + importc: "SDLNet_FreeSocketSet", dynlib: NetLibName.} + #*********************************************************************** + #* Platform-independent data conversion functions * + #*********************************************************************** + #* Write a 16/32 bit value to network packet buffer * +proc Net_Write16*(value: Uint16, area: Pointer){.cdecl, + importc: "SDLNet_Write16", dynlib: NetLibName.} +proc Net_Write32*(value: Uint32, area: Pointer){.cdecl, + importc: "SDLNet_Write32", dynlib: NetLibName.} + #* Read a 16/32 bit value from network packet buffer * +proc Net_Read16*(area: Pointer): Uint16{.cdecl, importc: "SDLNet_Read16", + dynlib: NetLibName.} +proc Net_Read32*(area: Pointer): Uint32{.cdecl, importc: "SDLNet_Read32", + dynlib: NetLibName.} + #*********************************************************************** + #* Error reporting functions * + #*********************************************************************** + #* We'll use SDL's functions for error reporting * +proc Net_SetError*(fmt: cstring) +proc Net_GetError*(): cstring +# implementation + +proc NET_VERSION(X: var Tversion) = + X.major = NET_MAJOR_VERSION + X.minor = NET_MINOR_VERSION + X.patch = NET_PATCHLEVEL + +proc Net_TCP_AddSocket(theSet: PNet_SocketSet, sock: PTCPSocket): int = + result = Net_AddSocket(theSet, cast[PNet_GenericSocket](sock)) + +proc Net_UDP_AddSocket(theSet: PNet_SocketSet, sock: PUDPSocket): int = + result = Net_AddSocket(theSet, cast[PNet_GenericSocket](sock)) + +proc Net_TCP_DelSocket(theSet: PNet_SocketSet, sock: PTCPSocket): int = + result = Net_DelSocket(theSet, cast[PNet_GenericSocket](sock)) + +proc Net_UDP_DelSocket(theSet: PNet_SocketSet, sock: PUDPSocket): int = + result = Net_DelSocket(theSet, cast[PNet_GenericSocket](sock)) + +proc Net_SocketReady(sock: PNet_GenericSocket): bool = + result = ((sock != nil) and (sock.ready == 1)) + +proc Net_SetError(fmt: cstring) = + SetError(fmt) + +proc Net_GetError(): cstring = + result = GetError() diff --git a/lib/newwrap/sdl/sdl_ttf.nim b/lib/newwrap/sdl/sdl_ttf.nim new file mode 100644 index 000000000..410597317 --- /dev/null +++ b/lib/newwrap/sdl/sdl_ttf.nim @@ -0,0 +1,357 @@ +# +# $Id: sdl_ttf.pas,v 1.18 2007/06/01 11:16:33 savage Exp $ +# +# +#****************************************************************************** +# +# JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer +# Conversion of the Simple DirectMedia Layer Headers +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : SDL_ttf.h +# +# The initial developer of this Pascal code was : +# Dominqiue Louis <Dominique@SavageSoftware.com.au> +# +# Portions created by Dominqiue Louis are +# Copyright (C) 2000 - 2001 Dominqiue Louis. +# +# +# Contributor(s) +# -------------- +# Tom Jones <tigertomjones@gmx.de> His Project inspired this conversion +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# +# +# +# +# +# +# +# Requires +# -------- +# The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL.so +# They are available from... +# http://www.libsdl.org . +# +# Programming Notes +# ----------------- +# +# +# +# +# Revision History +# ---------------- +# December 08 2002 - DL : Fixed definition of TTF_RenderUnicode_Solid +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# $Log: sdl_ttf.pas,v $ +# Revision 1.18 2007/06/01 11:16:33 savage +# Added IFDEF UNIX for Workaround. +# +# Revision 1.17 2007/06/01 08:38:21 savage +# Added TTF_RenderText_Solid workaround as suggested by Michalis Kamburelis +# +# Revision 1.16 2007/05/29 21:32:14 savage +# Changes as suggested by Almindor for 64bit compatibility. +# +# Revision 1.15 2007/05/20 20:32:45 savage +# Initial Changes to Handle 64 Bits +# +# Revision 1.14 2006/12/02 00:19:01 savage +# Updated to latest version +# +# Revision 1.13 2005/04/10 11:48:33 savage +# Changes as suggested by Michalis, thanks. +# +# Revision 1.12 2005/01/05 01:47:14 savage +# Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively. +# +# Revision 1.11 2005/01/04 23:14:57 savage +# Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively. +# +# Revision 1.10 2005/01/02 19:07:32 savage +# Slight bug fix to use LongInt instead of Long ( Thanks Michalis Kamburelis ) +# +# Revision 1.9 2005/01/01 02:15:20 savage +# Updated to v2.0.7 +# +# Revision 1.8 2004/10/07 21:02:32 savage +# Fix for FPC +# +# Revision 1.7 2004/09/30 22:39:50 savage +# Added a true type font class which contains a wrap text function. +# Changed the sdl_ttf.pas header to reflect the future of jedi-sdl. +# +# Revision 1.6 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.5 2004/05/10 14:10:04 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.4 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.3 2004/04/01 20:53:24 savage +# Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.2 2004/03/30 20:23:28 savage +# Tidied up use of UNIX compiler directive. +# +# Revision 1.1 2004/02/16 22:16:40 savage +# v1.0 changes +# +# +# +#****************************************************************************** +# +# Define this to workaround a known bug in some freetype versions. +# The error manifests as TTF_RenderGlyph_Solid returning nil (error) +# and error message (in SDL_Error) is +# "Failed loading DPMSDisable: /usr/lib/libX11.so.6: undefined symbol: DPMSDisable" +# See [http://lists.libsdl.org/pipermail/sdl-libsdl.org/2007-March/060459.html] +# + +import + + +when defined(windows): + const + ttfLibName = "SDL_ttf.dll" +elif defined(macosx): + const + ttfLibName = "libSDL_ttf-2.0.0.dylib" +else: + const + ttfLibName = "libSDL_ttf.so" +const + TTF_MAJOR_VERSION* = 2'i8 + TTF_MINOR_VERSION* = 0'i8 + TTF_PATCHLEVEL* = 8'i8 # Backwards compatibility + TTF_MAJOR_VERSION* = TTF_MAJOR_VERSION + TTF_MINOR_VERSION* = TTF_MINOR_VERSION + TTF_PATCHLEVEL* = TTF_PATCHLEVEL #* + # Set and retrieve the font style + # This font style is implemented by modifying the font glyphs, and + # doesn't reflect any inherent properties of the truetype font file. + #* + TTF_STYLE_NORMAL* = 0x00000000 + TTF_STYLE_BOLD* = 0x00000001 + TTF_STYLE_ITALIC* = 0x00000002 + TTF_STYLE_UNDERLINE* = 0x00000004 # ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark) + UNICODE_BOM_NATIVE* = 0x0000FEFF + UNICODE_BOM_SWAPPED* = 0x0000FFFE + +type + PTTF_Font* = ptr TTTF_font + TTTF_Font*{.final.} = object # This macro can be used to fill a version structure with the compile-time + # version of the SDL_ttf library. + +proc TTF_VERSION*(X: var Tversion) + # This function gets the version of the dynamically linked SDL_ttf library. + # It should NOT be used to fill a version structure, instead you should use the + # SDL_TTF_VERSION() macro. +proc TTF_Linked_Version*(): Pversion{.cdecl, importc: "TTF_Linked_Version", + dynlib: ttfLibName.} + # This function tells the library whether UNICODE text is generally + # byteswapped. A UNICODE BOM character in a string will override + # this setting for the remainder of that string. + # +proc TTF_ByteSwappedUNICODE*(swapped: int){.cdecl, + importc: "TTF_ByteSwappedUNICODE", dynlib: ttfLibName.} + #returns 0 on succes, -1 if error occurs +proc TTF_Init*(): int{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.} + # + # Open a font file and create a font of the specified point size. + # Some .fon fonts will have several sizes embedded in the file, so the + # point size becomes the index of choosing which size. If the value + # is too high, the last indexed size will be the default. + # +proc TTF_OpenFont*(filename: cstring, ptsize: int): PTTF_Font{.cdecl, + importc: "TTF_OpenFont", dynlib: ttfLibName.} +proc TTF_OpenFontIndex*(filename: cstring, ptsize: int, index: int32): PTTF_Font{. + cdecl, importc: "TTF_OpenFontIndex", dynlib: ttfLibName.} +proc TTF_OpenFontRW*(src: PRWops, freesrc: int, ptsize: int): PTTF_Font{.cdecl, + importc: "TTF_OpenFontRW", dynlib: ttfLibName.} +proc TTF_OpenFontIndexRW*(src: PRWops, freesrc: int, ptsize: int, index: int32): PTTF_Font{. + cdecl, importc: "TTF_OpenFontIndexRW", dynlib: ttfLibName.} +proc TTF_GetFontStyle*(font: PTTF_Font): int{.cdecl, + importc: "TTF_GetFontStyle", dynlib: ttfLibName.} +proc TTF_SetFontStyle*(font: PTTF_Font, style: int){.cdecl, + importc: "TTF_SetFontStyle", dynlib: ttfLibName.} + # Get the total height of the font - usually equal to point size +proc TTF_FontHeight*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontHeight", + dynlib: ttfLibName.} + # Get the offset from the baseline to the top of the font + # This is a positive value, relative to the baseline. + # +proc TTF_FontAscent*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontAscent", + dynlib: ttfLibName.} + # Get the offset from the baseline to the bottom of the font + # This is a negative value, relative to the baseline. + # +proc TTF_FontDescent*(font: PTTF_Font): int{.cdecl, importc: "TTF_FontDescent", + dynlib: ttfLibName.} + # Get the recommended spacing between lines of text for this font +proc TTF_FontLineSkip*(font: PTTF_Font): int{.cdecl, + importc: "TTF_FontLineSkip", dynlib: ttfLibName.} + # Get the number of faces of the font +proc TTF_FontFaces*(font: PTTF_Font): int32{.cdecl, importc: "TTF_FontFaces", + dynlib: ttfLibName.} + # Get the font face attributes, if any +proc TTF_FontFaceIsFixedWidth*(font: PTTF_Font): int{.cdecl, + importc: "TTF_FontFaceIsFixedWidth", dynlib: ttfLibName.} +proc TTF_FontFaceFamilyName*(font: PTTF_Font): cstring{.cdecl, + importc: "TTF_FontFaceFamilyName", dynlib: ttfLibName.} +proc TTF_FontFaceStyleName*(font: PTTF_Font): cstring{.cdecl, + importc: "TTF_FontFaceStyleName", dynlib: ttfLibName.} + # Get the metrics (dimensions) of a glyph +proc TTF_GlyphMetrics*(font: PTTF_Font, ch: Uint16, minx: var int, + maxx: var int, miny: var int, maxy: var int, + advance: var int): int{.cdecl, + importc: "TTF_GlyphMetrics", dynlib: ttfLibName.} + # Get the dimensions of a rendered string of text +proc TTF_SizeText*(font: PTTF_Font, text: cstring, w: var int, y: var int): int{. + cdecl, importc: "TTF_SizeText", dynlib: ttfLibName.} +proc TTF_SizeUTF8*(font: PTTF_Font, text: cstring, w: var int, y: var int): int{. + cdecl, importc: "TTF_SizeUTF8", dynlib: ttfLibName.} +proc TTF_SizeUNICODE*(font: PTTF_Font, text: PUint16, w: var int, y: var int): int{. + cdecl, importc: "TTF_SizeUNICODE", dynlib: ttfLibName.} + # Create an 8-bit palettized surface and render the given text at + # fast quality with the given font and color. The 0 pixel is the + # colorkey, giving a transparent background, and the 1 pixel is set + # to the text color. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderUTF8_Solid*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderUTF8_Solid", dynlib: ttfLibName.} +proc TTF_RenderUNICODE_Solid*(font: PTTF_Font, text: PUint16, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderUNICODE_Solid", dynlib: ttfLibName.} + # + #Create an 8-bit palettized surface and render the given glyph at + # fast quality with the given font and color. The 0 pixel is the + # colorkey, giving a transparent background, and the 1 pixel is set + # to the text color. The glyph is rendered without any padding or + # centering in the X direction, and aligned normally in the Y direction. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderGlyph_Solid*(font: PTTF_Font, ch: Uint16, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderGlyph_Solid", dynlib: ttfLibName.} + # Create an 8-bit palettized surface and render the given text at + # high quality with the given font and colors. The 0 pixel is background, + # while other pixels have varying degrees of the foreground color. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderText_Shaded*(font: PTTF_Font, text: cstring, fg: TColor, + bg: TColor): PSurface{.cdecl, + importc: "TTF_RenderText_Shaded", dynlib: ttfLibName.} +proc TTF_RenderUTF8_Shaded*(font: PTTF_Font, text: cstring, fg: TColor, + bg: TColor): PSurface{.cdecl, + importc: "TTF_RenderUTF8_Shaded", dynlib: ttfLibName.} +proc TTF_RenderUNICODE_Shaded*(font: PTTF_Font, text: PUint16, fg: TColor, + bg: TColor): PSurface{.cdecl, + importc: "TTF_RenderUNICODE_Shaded", dynlib: ttfLibName.} + # Create an 8-bit palettized surface and render the given glyph at + # high quality with the given font and colors. The 0 pixel is background, + # while other pixels have varying degrees of the foreground color. + # The glyph is rendered without any padding or centering in the X + # direction, and aligned normally in the Y direction. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderGlyph_Shaded*(font: PTTF_Font, ch: Uint16, fg: TColor, bg: TColor): PSurface{. + cdecl, importc: "TTF_RenderGlyph_Shaded", dynlib: ttfLibName.} + # Create a 32-bit ARGB surface and render the given text at high quality, + # using alpha blending to dither the font with the given color. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderText_Blended*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderText_Blended", dynlib: ttfLibName.} +proc TTF_RenderUTF8_Blended*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderUTF8_Blended", dynlib: ttfLibName.} +proc TTF_RenderUNICODE_Blended*(font: PTTF_Font, text: PUint16, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderUNICODE_Blended", dynlib: ttfLibName.} + # Create a 32-bit ARGB surface and render the given glyph at high quality, + # using alpha blending to dither the font with the given color. + # The glyph is rendered without any padding or centering in the X + # direction, and aligned normally in the Y direction. + # This function returns the new surface, or NULL if there was an error. + # +proc TTF_RenderGlyph_Blended*(font: PTTF_Font, ch: Uint16, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderGlyph_Blended", dynlib: ttfLibName.} + # For compatibility with previous versions, here are the old functions + ##define TTF_RenderText(font, text, fg, bg) + # TTF_RenderText_Shaded(font, text, fg, bg) + ##define TTF_RenderUTF8(font, text, fg, bg) + # TTF_RenderUTF8_Shaded(font, text, fg, bg) + ##define TTF_RenderUNICODE(font, text, fg, bg) + # TTF_RenderUNICODE_Shaded(font, text, fg, bg) + # Close an opened font file +proc TTF_CloseFont*(font: PTTF_Font){.cdecl, importc: "TTF_CloseFont", + dynlib: ttfLibName.} + #De-initialize TTF engine +proc TTF_Quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.} + # Check if the TTF engine is initialized +proc TTF_WasInit*(): int{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.} + # We'll use SDL for reporting errors +proc TTF_SetError*(fmt: cstring) +proc TTF_GetError*(): cstring +# implementation + +proc TTF_VERSION(X: var Tversion) = + X.major = TTF_MAJOR_VERSION + X.minor = TTF_MINOR_VERSION + X.patch = TTF_PATCHLEVEL + +proc TTF_SetError(fmt: cstring) = + SetError(fmt) + +proc TTF_GetError(): cstring = + result = GetError() + +when not (defined(Workaround_TTF_RenderText_Solid)): + proc TTF_RenderText_Solid*(font: PTTF_Font, text: cstring, fg: TColor): PSurface{. + cdecl, importc: "TTF_RenderText_Solid", dynlib: ttfLibName.} +else: + proc TTF_RenderText_Solid(font: PTTF_Font, text: cstring, fg: TColor): PSurface = + var Black: TColor # initialized to zero + Result = TTF_RenderText_Shaded(font, text, fg, Black) diff --git a/lib/newwrap/sdl/smpeg.nim b/lib/newwrap/sdl/smpeg.nim new file mode 100644 index 000000000..5c9562201 --- /dev/null +++ b/lib/newwrap/sdl/smpeg.nim @@ -0,0 +1,339 @@ +#****************************************************************************** +# +# $Id: smpeg.pas,v 1.7 2004/08/14 22:54:30 savage Exp $ +# +# +# +# Borland Delphi SMPEG - SDL MPEG Player Library +# Conversion of the SMPEG - SDL MPEG Player Library +# +# Portions created by Sam Lantinga <slouken@devolution.com> are +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga +# 5635-34 Springhouse Dr. +# Pleasanton, CA 94588 (USA) +# +# All Rights Reserved. +# +# The original files are : smpeg.h +# +# The initial developer of this Pascal code was : +# Matthias Thoma <ma.thoma@gmx.de> +# +# Portions created by Matthias Thoma are +# Copyright (C) 2000 - 2001 Matthias Thoma. +# +# +# Contributor(s) +# -------------- +# Tom Jones <tigertomjones@gmx.de> His Project inspired this conversion +# Matthias Thoma <ma.thoma@gmx.de> +# +# Obtained through: +# Joint Endeavour of Delphi Innovators ( Project JEDI ) +# +# You may retrieve the latest version of this file at the Project +# JEDI home page, located at http://delphi-jedi.org +# +# The contents of this file are used with permission, 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/MPL-1.1.html +# +# Software distributed under the License is distributed on an +# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# Description +# ----------- +# +# +# +# +# +# +# +# Requires +# -------- +# The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL-1.2.so.0 +# They are available from... +# http://www.libsdl.org . +# +# Programming Notes +# ----------------- +# +# +# +# +# Revision History +# ---------------- +# May 08 2001 - MT : Initial conversion +# +# October 12 2001 - DA : Various changes as suggested by David Acklam +# +# April 03 2003 - DL : Added jedi-sdl.inc include file to support more +# Pascal compilers. Initial support is now included +# for GnuPascal, VirtualPascal, TMT and obviously +# continue support for Delphi Kylix and FreePascal. +# +# April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support +# Fixed all invalid calls to DLL. +# Changed constant names to: +# const +# STATUS_SMPEG_ERROR = -1; +# STATUS_SMPEG_STOPPED = 0; +# STATUS_SMPEG_PLAYING = 1; +# because SMPEG_ERROR is a function (_SMPEG_error +# isn't correct), and cannot be two elements with the +# same name +# +# April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added +# better TMT Pascal support and under instruction +# from Prof. Abimbola Olowofoyeku (The African Chief), +# I have added better Gnu Pascal support +# +# April 30 2003 - DL : under instruction from David Mears AKA +# Jason Siletto, I have added FPC Linux support. +# This was compiled with fpc 1.1, so remember to set +# include file path. ie. -Fi/usr/share/fpcsrc/rtl/* +# +# +# $Log: smpeg.pas,v $ +# Revision 1.7 2004/08/14 22:54:30 savage +# Updated so that Library name defines are correctly defined for MacOS X. +# +# Revision 1.6 2004/05/10 14:10:04 savage +# Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ). +# +# Revision 1.5 2004/04/13 09:32:08 savage +# Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary. +# +# Revision 1.4 2004/04/02 10:40:55 savage +# Changed Linux Shared Object name so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site. +# +# Revision 1.3 2004/03/31 22:20:02 savage +# Windows unit not used in this file, so it was removed to keep the code tidy. +# +# Revision 1.2 2004/03/30 20:23:28 savage +# Tidied up use of UNIX compiler directive. +# +# Revision 1.1 2004/02/14 23:35:42 savage +# version 1 of sdl_image, sdl_mixer and smpeg. +# +# +# +#****************************************************************************** + +import + + +when defined(windows): + const + SmpegLibName = "smpeg.dll" +elif defined(macosx): + const + SmpegLibName = "libsmpeg.dylib" +else: + const + SmpegLibName = "libsmpeg.so" +const + SMPEG_FILTER_INFO_MB_ERROR* = 1 + SMPEG_FILTER_INFO_PIXEL_ERROR* = 2 # Filter info from SMPEG + +type + SMPEG_FilterInfo*{.final.} = object + yuv_mb_square_error*: PUint16 + yuv_pixel_square_error*: PUint16 + + TSMPEG_FilterInfo* = SMPEG_FilterInfo + PSMPEG_FilterInfo* = ptr SMPEG_FilterInfo # MPEG filter definition + PSMPEG_Filter* = ptr TSMPEG_Filter # Callback functions for the filter + TSMPEG_FilterCallback* = proc (dest, source: POverlay, region: PRect, + filter_info: PSMPEG_FilterInfo, data: Pointer): Pointer{. + cdecl.} + TSMPEG_FilterDestroy* = proc (Filter: PSMPEG_Filter): Pointer{.cdecl.} # The filter + # + # definition itself + TSMPEG_Filter*{.final.} = object # The null filter (default). It simply copies the source rectangle to the video overlay. + flags*: Uint32 + data*: Pointer + callback*: TSMPEG_FilterCallback + destroy*: TSMPEG_FilterDestroy + + +proc SMPEGfilter_null*(): PSMPEG_Filter{.cdecl, importc: "SMPEGfilter_null", + dynlib: SmpegLibName.} + # The bilinear filter. A basic low-pass filter that will produce a smoother image. +proc SMPEGfilter_bilinear*(): PSMPEG_Filter{.cdecl, + importc: "SMPEGfilter_bilinear", dynlib: SmpegLibName.} + # The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness +proc SMPEGfilter_deblocking*(): PSMPEG_Filter{.cdecl, + importc: "SMPEGfilter_deblocking", dynlib: SmpegLibName.} + #------------------------------------------------------------------------------ + # SMPEG.h + #------------------------------------------------------------------------------ +const + SMPEG_MAJOR_VERSION* = 0'i8 + SMPEG_MINOR_VERSION* = 4'i8 + SMPEG_PATCHLEVEL* = 2'i8 + +type + SMPEG_version*{.final.} = object + major*: UInt8 + minor*: UInt8 + patch*: UInt8 + + TSMPEG_version* = SMPEG_version + PSMPEG_version* = ptr TSMPEG_version # This is the actual SMPEG object + TSMPEG*{.final.} = object + PSMPEG* = ptr TSMPEG # Used to get information about the SMPEG object + TSMPEG_Info*{.final.} = object + has_audio*: int + has_video*: int + width*: int + height*: int + current_frame*: int + current_fps*: float64 + audio_string*: array[0..79, char] + audio_current_frame*: int + current_offset*: UInt32 + total_size*: UInt32 + current_time*: float64 + total_time*: float64 + + PSMPEG_Info* = ptr TSMPEG_Info # Possible MPEG status codes + +const + STATUS_SMPEG_ERROR* = - 1 + STATUS_SMPEG_STOPPED* = 0 + STATUS_SMPEG_PLAYING* = 1 + +type + TSMPEGstatus* = int + PSMPEGstatus* = ptr int # Matches the declaration of SDL_UpdateRect() + TSMPEG_DisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): Pointer{. + cdecl.} # Create a new SMPEG object from an MPEG file. + # On return, if 'info' is not NULL, it will be filled with information + # about the MPEG object. + # This function returns a new SMPEG object. Use SMPEG_error() to find out + # whether or not there was a problem building the MPEG stream. + # The sdl_audio parameter indicates if SMPEG should initialize the SDL audio + # subsystem. If not, you will have to use the SMPEG_playaudio() function below + # to extract the decoded data. + +proc SMPEG_new*(theFile: cstring, info: PSMPEG_Info, audio: int): PSMPEG{.cdecl, + importc: "SMPEG_new", dynlib: SmpegLibName.} + # The same as above for a file descriptor +proc SMPEG_new_descr*(theFile: int, info: PSMPEG_Info, audio: int): PSMPEG{. + cdecl, importc: "SMPEG_new_descr", dynlib: SmpegLibName.} + # The same as above but for a raw chunk of data. SMPEG makes a copy of the + # data, so the application is free to delete after a successful call to this + # function. +proc SMPEG_new_data*(data: Pointer, size: int, info: PSMPEG_Info, audio: int): PSMPEG{. + cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.} + # Get current information about an SMPEG object +proc SMPEG_getinfo*(mpeg: PSMPEG, info: PSMPEG_Info){.cdecl, + importc: "SMPEG_getinfo", dynlib: SmpegLibName.} + #procedure SMPEG_getinfo(mpeg: PSMPEG; info: Pointer); + #cdecl; external SmpegLibName; + # Enable or disable audio playback in MPEG stream +proc SMPEG_enableaudio*(mpeg: PSMPEG, enable: int){.cdecl, + importc: "SMPEG_enableaudio", dynlib: SmpegLibName.} + # Enable or disable video playback in MPEG stream +proc SMPEG_enablevideo*(mpeg: PSMPEG, enable: int){.cdecl, + importc: "SMPEG_enablevideo", dynlib: SmpegLibName.} + # Delete an SMPEG object +proc SMPEG_delete*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_delete", + dynlib: SmpegLibName.} + # Get the current status of an SMPEG object +proc SMPEG_status*(mpeg: PSMPEG): TSMPEGstatus{.cdecl, importc: "SMPEG_status", + dynlib: SmpegLibName.} + # status + # Set the audio volume of an MPEG stream, in the range 0-100 +proc SMPEG_setvolume*(mpeg: PSMPEG, volume: int){.cdecl, + importc: "SMPEG_setvolume", dynlib: SmpegLibName.} + # Set the destination surface for MPEG video playback + # 'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL. + # 'callback' is a function called when an area of 'dst' needs to be updated. + # If 'callback' is NULL, the default function (SDL_UpdateRect) will be used. +proc SMPEG_setdisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: Pmutex, + callback: TSMPEG_DisplayCallback){.cdecl, + importc: "SMPEG_setdisplay", dynlib: SmpegLibName.} + # Set or clear looping play on an SMPEG object +proc SMPEG_loop*(mpeg: PSMPEG, repeat_: int){.cdecl, importc: "SMPEG_loop", + dynlib: SmpegLibName.} + # Scale pixel display on an SMPEG object +proc SMPEG_scaleXY*(mpeg: PSMPEG, width, height: int){.cdecl, + importc: "SMPEG_scaleXY", dynlib: SmpegLibName.} +proc SMPEG_scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale", + dynlib: SmpegLibName.} +proc SMPEG_Double*(mpeg: PSMPEG, doubleit: bool) + # Move the video display area within the destination surface +proc SMPEG_move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move", + dynlib: SmpegLibName.} + # Set the region of the video to be shown +proc SMPEG_setdisplayregion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl, + importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.} + # Play an SMPEG object +proc SMPEG_play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play", + dynlib: SmpegLibName.} + # Pause/Resume playback of an SMPEG object +proc SMPEG_pause*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_pause", + dynlib: SmpegLibName.} + # Stop playback of an SMPEG object +proc SMPEG_stop*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_stop", + dynlib: SmpegLibName.} + # Rewind the play position of an SMPEG object to the beginning of the MPEG +proc SMPEG_rewind*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_rewind", + dynlib: SmpegLibName.} + # Seek 'bytes' bytes in the MPEG stream +proc SMPEG_seek*(mpeg: PSMPEG, bytes: int){.cdecl, importc: "SMPEG_seek", + dynlib: SmpegLibName.} + # Skip 'seconds' seconds in the MPEG stream +proc SMPEG_skip*(mpeg: PSMPEG, seconds: float32){.cdecl, importc: "SMPEG_skip", + dynlib: SmpegLibName.} + # Render a particular frame in the MPEG video + # API CHANGE: This function no longer takes a target surface and position. + # Use SMPEG_setdisplay() and SMPEG_move() to set this information. +proc SMPEG_renderFrame*(mpeg: PSMPEG, framenum: int){.cdecl, + importc: "SMPEG_renderFrame", dynlib: SmpegLibName.} + # Render the last frame of an MPEG video +proc SMPEG_renderFinal*(mpeg: PSMPEG, dst: PSurface, x, y: int){.cdecl, + importc: "SMPEG_renderFinal", dynlib: SmpegLibName.} + # Set video filter +proc SMPEG_filter*(mpeg: PSMPEG, filter: PSMPEG_Filter): PSMPEG_Filter{.cdecl, + importc: "SMPEG_filter", dynlib: SmpegLibName.} + # Return NULL if there is no error in the MPEG stream, or an error message + # if there was a fatal error in the MPEG stream for the SMPEG object. +proc SMPEG_error*(mpeg: PSMPEG): cstring{.cdecl, importc: "SMPEG_error", + dynlib: SmpegLibName.} + # Exported callback function for audio playback. + # The function takes a buffer and the amount of data to fill, and returns + # the amount of data in bytes that was actually written. This will be the + # amount requested unless the MPEG audio has finished. + # +proc SMPEG_playAudio*(mpeg: PSMPEG, stream: PUInt8, length: int): int{.cdecl, + importc: "SMPEG_playAudio", dynlib: SmpegLibName.} + # Wrapper for SMPEG_playAudio() that can be passed to SDL and SDL_mixer +proc SMPEG_playAudioSDL*(mpeg: Pointer, stream: PUInt8, length: int){.cdecl, + importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.} + # Get the best SDL audio spec for the audio stream +proc SMPEG_wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl, + importc: "SMPEG_wantedSpec", dynlib: SmpegLibName.} + # Inform SMPEG of the actual SDL audio spec used for sound playback +proc SMPEG_actualSpec*(mpeg: PSMPEG, spec: PAudioSpec){.cdecl, + importc: "SMPEG_actualSpec", dynlib: SmpegLibName.} + # This macro can be used to fill a version structure with the compile-time + # version of the SDL library. +proc SMPEG_GETVERSION*(X: var TSMPEG_version) +# implementation + +proc SMPEG_double(mpeg: PSMPEG, doubleit: bool) = + if doubleit: SMPEG_scale(mpeg, 2) + else: SMPEG_scale(mpeg, 1) + +proc SMPEG_GETVERSION(X: var TSMPEG_version) = + X.major = SMPEG_MAJOR_VERSION + X.minor = SMPEG_MINOR_VERSION + X.patch = SMPEG_PATCHLEVEL diff --git a/lib/newwrap/sqlite3.nim b/lib/newwrap/sqlite3.nim new file mode 100644 index 000000000..f2912f05f --- /dev/null +++ b/lib/newwrap/sqlite3.nim @@ -0,0 +1,357 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +{.deadCodeElim: on.} +when defined(windows): + const + Lib = "sqlite3.dll" +elif defined(macosx): + const + Lib = "sqlite-3.6.13.dylib" +else: + const + Lib = "libsqlite3.so" +const + SQLITE_INTEGER* = 1 + SQLITE_FLOAT* = 2 + SQLITE_BLOB* = 4 + SQLITE_NULL* = 5 + SQLITE_TEXT* = 3 + TEXT* = 3 + SQLITE_UTF8* = 1 + SQLITE_UTF16LE* = 2 + SQLITE_UTF16BE* = 3 # Use native byte order + SQLITE_UTF16* = 4 # sqlite3_create_function only + SQLITE_ANY* = 5 #sqlite_exec return values + SQLITE_OK* = 0 + SQLITE_ERROR* = 1 # SQL error or missing database + SQLITE_INTERNAL* = 2 # An internal logic error in SQLite + SQLITE_PERM* = 3 # Access permission denied + SQLITE_ABORT* = 4 # Callback routine requested an abort + SQLITE_BUSY* = 5 # The database file is locked + SQLITE_LOCKED* = 6 # A table in the database is locked + SQLITE_NOMEM* = 7 # A malloc() failed + SQLITE_READONLY* = 8 # Attempt to write a readonly database + SQLITE_INTERRUPT* = 9 # Operation terminated by sqlite3_interrupt() + SQLITE_IOERR* = 10 # Some kind of disk I/O error occurred + SQLITE_CORRUPT* = 11 # The database disk image is malformed + SQLITE_NOTFOUND* = 12 # (Internal Only) Table or record not found + SQLITE_FULL* = 13 # Insertion failed because database is full + SQLITE_CANTOPEN* = 14 # Unable to open the database file + SQLITE_PROTOCOL* = 15 # Database lock protocol error + SQLITE_EMPTY* = 16 # Database is empty + SQLITE_SCHEMA* = 17 # The database schema changed + SQLITE_TOOBIG* = 18 # Too much data for one row of a table + SQLITE_CONSTRAINT* = 19 # Abort due to contraint violation + SQLITE_MISMATCH* = 20 # Data type mismatch + SQLITE_MISUSE* = 21 # Library used incorrectly + SQLITE_NOLFS* = 22 # Uses OS features not supported on host + SQLITE_AUTH* = 23 # Authorization denied + SQLITE_FORMAT* = 24 # Auxiliary database format error + SQLITE_RANGE* = 25 # 2nd parameter to sqlite3_bind out of range + SQLITE_NOTADB* = 26 # File opened that is not a database file + SQLITE_ROW* = 100 # sqlite3_step() has another row ready + SQLITE_DONE* = 101 # sqlite3_step() has finished executing + SQLITE_COPY* = 0 + SQLITE_CREATE_INDEX* = 1 + SQLITE_CREATE_TABLE* = 2 + SQLITE_CREATE_TEMP_INDEX* = 3 + SQLITE_CREATE_TEMP_TABLE* = 4 + SQLITE_CREATE_TEMP_TRIGGER* = 5 + SQLITE_CREATE_TEMP_VIEW* = 6 + SQLITE_CREATE_TRIGGER* = 7 + SQLITE_CREATE_VIEW* = 8 + SQLITE_DELETE* = 9 + SQLITE_DROP_INDEX* = 10 + SQLITE_DROP_TABLE* = 11 + SQLITE_DROP_TEMP_INDEX* = 12 + SQLITE_DROP_TEMP_TABLE* = 13 + SQLITE_DROP_TEMP_TRIGGER* = 14 + SQLITE_DROP_TEMP_VIEW* = 15 + SQLITE_DROP_TRIGGER* = 16 + SQLITE_DROP_VIEW* = 17 + SQLITE_INSERT* = 18 + SQLITE_PRAGMA* = 19 + SQLITE_READ* = 20 + SQLITE_SELECT* = 21 + SQLITE_TRANSACTION* = 22 + SQLITE_UPDATE* = 23 + SQLITE_ATTACH* = 24 + SQLITE_DETACH* = 25 + SQLITE_ALTER_TABLE* = 26 + SQLITE_REINDEX* = 27 + SQLITE_DENY* = 1 + SQLITE_IGNORE* = 2 # Original from sqlite3.h: + ##define SQLITE_STATIC ((void(*)(void *))0) + ##define SQLITE_TRANSIENT ((void(*)(void *))-1) + +const + SQLITE_STATIC* = nil + SQLITE_TRANSIENT* = cast[pointer](- 1) + +type + sqlite_int64* = int64 + PPPChar* = ptr ptr cstring + T{.pure, final.} = object + P* = ptr T + PPSqlite3* = ptr P + TSqlLite3Context{.pure, final.} = object + Pcontext* = ptr TSqlLite3Context + Tstmt{.pure, final.} = object + Pstmt* = ptr Tstmt + PPsqlite3_stmt* = ptr Pstmt + Tvalue{.pure, final.} = object + Pvalue* = ptr Tvalue + PPsqlite3_value* = ptr Pvalue #Callback function types + #Notice that most functions + #were named using as prefix the + #function name that uses them, + #rather than describing their functions + Tcallback* = proc (para1: pointer, para2: int32, para3: var cstring, + para4: var cstring): int32{.cdecl.} + Tbind_destructor_func* = proc (para1: pointer){.cdecl.} + Tcreate_function_step_func* = proc (para1: Pcontext, para2: int32, + para3: PPsqlite3_value){.cdecl.} + Tcreate_function_func_func* = proc (para1: Pcontext, para2: int32, + para3: PPsqlite3_value){.cdecl.} + Tcreate_function_final_func* = proc (para1: Pcontext){.cdecl.} + Tresult_func* = proc (para1: pointer){.cdecl.} + Tcreate_collation_func* = proc (para1: pointer, para2: int32, para3: pointer, + para4: int32, para5: pointer): int32{.cdecl.} + Tcollation_needed_func* = proc (para1: pointer, para2: P, eTextRep: int32, + para4: cstring){.cdecl.} + +proc close*(para1: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_close".} +proc exec*(para1: P, sql: cstring, para3: Tcallback, para4: pointer, + errmsg: var cstring): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_exec".} +proc last_insert_rowid*(para1: P): sqlite_int64{.cdecl, dynlib: Lib, + importc: "sqlite3_last_insert_rowid".} +proc changes*(para1: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_changes".} +proc total_changes*(para1: P): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_total_changes".} +proc interrupt*(para1: P){.cdecl, dynlib: Lib, importc: "sqlite3_interrupt".} +proc complete*(sql: cstring): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_complete".} +proc complete16*(sql: pointer): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_complete16".} +proc busy_handler*(para1: P, + para2: proc (para1: pointer, para2: int32): int32{.cdecl.}, + para3: pointer): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_busy_handler".} +proc busy_timeout*(para1: P, ms: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_busy_timeout".} +proc get_table*(para1: P, sql: cstring, resultp: var cstringArray, + nrow, ncolumn: var cint, errmsg: ptr cstring): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_get_table".} +proc free_table*(result: cstringArray){.cdecl, dynlib: Lib, + importc: "sqlite3_free_table".} + # Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf + # function sqlite3_mprintf(_para1:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_mprintf'; +proc mprintf*(para1: cstring): cstring{.cdecl, varargs, dynlib: Lib, + importc: "sqlite3_mprintf".} + #function sqlite3_vmprintf(_para1:Pchar; _para2:va_list):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_vmprintf'; +proc free*(z: cstring){.cdecl, dynlib: Lib, importc: "sqlite3_free".} + #function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf'; +proc snprintf*(para1: int32, para2: cstring, para3: cstring): cstring{.cdecl, + dynlib: Lib, varargs, importc: "sqlite3_snprintf".} +proc set_authorizer*(para1: P, xAuth: proc (para1: pointer, para2: int32, + para3: cstring, para4: cstring, para5: cstring, para6: cstring): int32{. + cdecl.}, pUserData: pointer): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_set_authorizer".} +proc trace*(para1: P, xTrace: proc (para1: pointer, para2: cstring){.cdecl.}, + para3: pointer): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_trace".} +proc progress_handler*(para1: P, para2: int32, + para3: proc (para1: pointer): int32{.cdecl.}, + para4: pointer){.cdecl, dynlib: Lib, + importc: "sqlite3_progress_handler".} +proc commit_hook*(para1: P, para2: proc (para1: pointer): int32{.cdecl.}, + para3: pointer): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_commit_hook".} +proc open*(filename: cstring, ppDb: var P): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_open".} +proc open16*(filename: pointer, ppDb: var P): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_open16".} +proc errcode*(db: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_errcode".} +proc errmsg*(para1: P): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_errmsg".} +proc errmsg16*(para1: P): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_errmsg16".} +proc prepare*(db: P, zSql: cstring, nBytes: int32, ppStmt: PPsqlite3_stmt, + pzTail: ptr cstring): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_prepare".} +proc prepare16*(db: P, zSql: pointer, nBytes: int32, ppStmt: PPsqlite3_stmt, + pzTail: var pointer): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_prepare16".} +proc bind_blob*(para1: Pstmt, para2: int32, para3: pointer, n: int32, + para5: Tbind_destructor_func): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_blob".} +proc bind_double*(para1: Pstmt, para2: int32, para3: float64): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_bind_double".} +proc bind_int*(para1: Pstmt, para2: int32, para3: int32): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_bind_int".} +proc bind_int64*(para1: Pstmt, para2: int32, para3: sqlite_int64): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_bind_int64".} +proc bind_null*(para1: Pstmt, para2: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_null".} +proc bind_text*(para1: Pstmt, para2: int32, para3: cstring, n: int32, + para5: Tbind_destructor_func): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_text".} +proc bind_text16*(para1: Pstmt, para2: int32, para3: pointer, para4: int32, + para5: Tbind_destructor_func): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_text16".} + #function sqlite3_bind_value(_para1:Psqlite3_stmt; _para2:longint; _para3:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_value'; + #These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT + #It's the c world man ;-) +proc bind_blob*(para1: Pstmt, para2: int32, para3: pointer, n: int32, + para5: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_blob".} +proc bind_text*(para1: Pstmt, para2: int32, para3: cstring, n: int32, + para5: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_text".} +proc bind_text16*(para1: Pstmt, para2: int32, para3: pointer, para4: int32, + para5: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_text16".} +proc bind_parameter_count*(para1: Pstmt): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_bind_parameter_count".} +proc bind_parameter_name*(para1: Pstmt, para2: int32): cstring{.cdecl, + dynlib: Lib, importc: "sqlite3_bind_parameter_name".} +proc bind_parameter_index*(para1: Pstmt, zName: cstring): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_bind_parameter_index".} + #function sqlite3_clear_bindings(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_clear_bindings'; +proc column_count*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_column_count".} +proc column_name*(para1: Pstmt, para2: int32): cstring{.cdecl, dynlib: Lib, + importc: "sqlite3_column_name".} +proc column_name16*(para1: Pstmt, para2: int32): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_column_name16".} +proc column_decltype*(para1: Pstmt, i: int32): cstring{.cdecl, dynlib: Lib, + importc: "sqlite3_column_decltype".} +proc column_decltype16*(para1: Pstmt, para2: int32): pointer{.cdecl, + dynlib: Lib, importc: "sqlite3_column_decltype16".} +proc step*(para1: Pstmt): int32{.cdecl, dynlib: Lib, importc: "sqlite3_step".} +proc data_count*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_data_count".} +proc column_blob*(para1: Pstmt, iCol: int32): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_column_blob".} +proc column_bytes*(para1: Pstmt, iCol: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_column_bytes".} +proc column_bytes16*(para1: Pstmt, iCol: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_column_bytes16".} +proc column_double*(para1: Pstmt, iCol: int32): float64{.cdecl, dynlib: Lib, + importc: "sqlite3_column_double".} +proc column_int*(para1: Pstmt, iCol: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_column_int".} +proc column_int64*(para1: Pstmt, iCol: int32): sqlite_int64{.cdecl, dynlib: Lib, + importc: "sqlite3_column_int64".} +proc column_text*(para1: Pstmt, iCol: int32): cstring{.cdecl, dynlib: Lib, + importc: "sqlite3_column_text".} +proc column_text16*(para1: Pstmt, iCol: int32): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_column_text16".} +proc column_type*(para1: Pstmt, iCol: int32): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_column_type".} +proc finalize*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_finalize".} +proc reset*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, importc: "sqlite3_reset".} +proc create_function*(para1: P, zFunctionName: cstring, nArg: int32, + eTextRep: int32, para5: pointer, + xFunc: Tcreate_function_func_func, + xStep: Tcreate_function_step_func, + xFinal: Tcreate_function_final_func): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_create_function".} +proc create_function16*(para1: P, zFunctionName: pointer, nArg: int32, + eTextRep: int32, para5: pointer, + xFunc: Tcreate_function_func_func, + xStep: Tcreate_function_step_func, + xFinal: Tcreate_function_final_func): int32{.cdecl, + dynlib: Lib, importc: "sqlite3_create_function16".} +proc aggregate_count*(para1: Pcontext): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_aggregate_count".} +proc value_blob*(para1: Pvalue): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_value_blob".} +proc value_bytes*(para1: Pvalue): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_value_bytes".} +proc value_bytes16*(para1: Pvalue): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_value_bytes16".} +proc value_double*(para1: Pvalue): float64{.cdecl, dynlib: Lib, + importc: "sqlite3_value_double".} +proc value_int*(para1: Pvalue): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_value_int".} +proc value_int64*(para1: Pvalue): sqlite_int64{.cdecl, dynlib: Lib, + importc: "sqlite3_value_int64".} +proc value_text*(para1: Pvalue): cstring{.cdecl, dynlib: Lib, + importc: "sqlite3_value_text".} +proc value_text16*(para1: Pvalue): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_value_text16".} +proc value_text16le*(para1: Pvalue): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_value_text16le".} +proc value_text16be*(para1: Pvalue): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_value_text16be".} +proc value_type*(para1: Pvalue): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_value_type".} +proc aggregate_context*(para1: Pcontext, nBytes: int32): pointer{.cdecl, + dynlib: Lib, importc: "sqlite3_aggregate_context".} +proc user_data*(para1: Pcontext): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_user_data".} +proc get_auxdata*(para1: Pcontext, para2: int32): pointer{.cdecl, dynlib: Lib, + importc: "sqlite3_get_auxdata".} +proc set_auxdata*(para1: Pcontext, para2: int32, para3: pointer, + para4: proc (para1: pointer){.cdecl.}){.cdecl, dynlib: Lib, + importc: "sqlite3_set_auxdata".} +proc result_blob*(para1: Pcontext, para2: pointer, para3: int32, + para4: Tresult_func){.cdecl, dynlib: Lib, + importc: "sqlite3_result_blob".} +proc result_double*(para1: Pcontext, para2: float64){.cdecl, dynlib: Lib, + importc: "sqlite3_result_double".} +proc result_error*(para1: Pcontext, para2: cstring, para3: int32){.cdecl, + dynlib: Lib, importc: "sqlite3_result_error".} +proc result_error16*(para1: Pcontext, para2: pointer, para3: int32){.cdecl, + dynlib: Lib, importc: "sqlite3_result_error16".} +proc result_int*(para1: Pcontext, para2: int32){.cdecl, dynlib: Lib, + importc: "sqlite3_result_int".} +proc result_int64*(para1: Pcontext, para2: sqlite_int64){.cdecl, dynlib: Lib, + importc: "sqlite3_result_int64".} +proc result_null*(para1: Pcontext){.cdecl, dynlib: Lib, + importc: "sqlite3_result_null".} +proc result_text*(para1: Pcontext, para2: cstring, para3: int32, + para4: Tresult_func){.cdecl, dynlib: Lib, + importc: "sqlite3_result_text".} +proc result_text16*(para1: Pcontext, para2: pointer, para3: int32, + para4: Tresult_func){.cdecl, dynlib: Lib, + importc: "sqlite3_result_text16".} +proc result_text16le*(para1: Pcontext, para2: pointer, para3: int32, + para4: Tresult_func){.cdecl, dynlib: Lib, + importc: "sqlite3_result_text16le".} +proc result_text16be*(para1: Pcontext, para2: pointer, para3: int32, + para4: Tresult_func){.cdecl, dynlib: Lib, + importc: "sqlite3_result_text16be".} +proc result_value*(para1: Pcontext, para2: Pvalue){.cdecl, dynlib: Lib, + importc: "sqlite3_result_value".} +proc create_collation*(para1: P, zName: cstring, eTextRep: int32, + para4: pointer, xCompare: Tcreate_collation_func): int32{. + cdecl, dynlib: Lib, importc: "sqlite3_create_collation".} +proc create_collation16*(para1: P, zName: cstring, eTextRep: int32, + para4: pointer, xCompare: Tcreate_collation_func): int32{. + cdecl, dynlib: Lib, importc: "sqlite3_create_collation16".} +proc collation_needed*(para1: P, para2: pointer, para3: Tcollation_needed_func): int32{. + cdecl, dynlib: Lib, importc: "sqlite3_collation_needed".} +proc collation_needed16*(para1: P, para2: pointer, para3: Tcollation_needed_func): int32{. + cdecl, dynlib: Lib, importc: "sqlite3_collation_needed16".} +proc libversion*(): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_libversion".} + #Alias for allowing better code portability (win32 is not working with external variables) +proc version*(): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_libversion".} + # Not published functions +proc libversion_number*(): int32{.cdecl, dynlib: Lib, + importc: "sqlite3_libversion_number".} + #function sqlite3_key(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_key'; + #function sqlite3_rekey(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_rekey'; + #function sqlite3_sleep(_para1:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_sleep'; + #function sqlite3_expired(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_expired'; + #function sqlite3_global_recover:longint;cdecl; external Sqlite3Lib name 'sqlite3_global_recover'; +# implementation diff --git a/lib/newwrap/tcl.nim b/lib/newwrap/tcl.nim new file mode 100644 index 000000000..d62a54c2d --- /dev/null +++ b/lib/newwrap/tcl.nim @@ -0,0 +1,860 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 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. +# *********************************************************************** +# + +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).dynlib" +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 + TCL_RESULT_SIZE* = 200 + MAX_ARGV* = 0x00007FFF + TCL_VERSION_MAJOR* = 0 + TCL_VERSION_MINOR* = 0 + TCL_NO_EVAL* = 0x00010000 + TCL_EVAL_GLOBAL* = 0x00020000 # Flag values passed to variable-related procedures. * + TCL_GLOBAL_ONLY* = 1 + TCL_NAMESPACE_ONLY* = 2 + TCL_APPEND_VALUE* = 4 + TCL_LIST_ELEMENT* = 8 + TCL_TRACE_READS* = 0x00000010 + TCL_TRACE_WRITES* = 0x00000020 + TCL_TRACE_UNSETS* = 0x00000040 + TCL_TRACE_DESTROYED* = 0x00000080 + TCL_INTERP_DESTROYED* = 0x00000100 + TCL_LEAVE_ERR_MSG* = 0x00000200 + TCL_PARSE_PART1* = 0x00000400 # Types for linked variables: * + TCL_LINK_INT* = 1 + TCL_LINK_DOUBLE* = 2 + TCL_LINK_BOOLEAN* = 3 + TCL_LINK_STRING* = 4 + TCL_LINK_READ_ONLY* = 0x00000080 + TCL_SMALL_HASH_TABLE* = 4 # Hash Table * + TCL_STRING_KEYS* = 0 + TCL_ONE_WORD_KEYS* = 1 # Const/enums Tcl_QueuePosition * + # typedef enum { + TCL_QUEUE_TAIL* = 0 + TCL_QUEUE_HEAD* = 1 + TCL_QUEUE_MARK* = 2 #} Tcl_QueuePosition; + # Event Flags + TCL_DONT_WAIT* = 1 shl 1 + TCL_WINDOW_EVENTS* = 1 shl 2 + TCL_FILE_EVENTS* = 1 shl 3 + TCL_TIMER_EVENTS* = 1 shl 4 + TCL_IDLE_EVENTS* = 1 shl 5 # WAS 0x10 ???? * + TCL_ALL_EVENTS* = not TCL_DONT_WAIT + TCL_VOLATILE* = 1 + TCL_STATIC* = 0 + TCL_DYNAMIC* = 3 # Channel + TCL_STDIN* = 1 shl 1 + TCL_STDOUT* = 1 shl 2 + TCL_STDERR* = 1 shl 3 + TCL_ENFORCE_MODE* = 1 shl 4 + TCL_READABLE* = 1 shl 1 + TCL_WRITABLE* = 1 shl 2 + TCL_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 + Tcl_Argv* = cstringArray + Tcl_ClientData* = pointer + Tcl_FreeProc* = proc (theBlock: pointer){.cdecl.} + PInterp* = ptr Tcl_Interp + Tcl_Interp*{.final.} = object # Event Definitions * + result*: cstring # Do not access this directly. Use + # * Tcl_GetStringResult since result + # * may be pointing to an object + # * + freeProc*: Tcl_FreeProc + errorLine*: int + + TEventSetupProc* = proc (clientData: Tcl_ClientData, flags: int){.cdecl.} + TEventCheckProc* = TEventSetupProc + PEvent* = ptr Tcl_Event + TEventProc* = proc (evPtr: PEvent, flags: int): int{.cdecl.} + Tcl_Event*{.final.} = object + prc*: TEventProc + nextPtr*: PEvent + ClientData*: TObject # ClientData is just pointer.* + + PTime* = ptr Tcl_Time + Tcl_Time*{.final.} = object + sec*: int32 # Seconds. * + usec*: int32 # Microseconds. * + + Tcl_TimerToken* = pointer + PInteger* = ptr int + PHashTable* = pointer + PHashEntry* = ptr Tcl_HashEntry + PPTcl_HashEntry* = ptr PHashEntry + Tcl_HashEntry*{.final.} = object + nextPtr*: PHashEntry + tablePtr*: PHashTable + bucketPtr*: PPTcl_HashEntry + clientData*: Tcl_ClientData + key*: cstring + + Tcl_HashFindProc* = proc (tablePtr: PHashTable, key: cstring): PHashEntry{. + cdecl.} + Tcl_HashCreateProc* = proc (tablePtr: PHashTable, key: cstring, + newPtr: PInteger): PHashEntry{.cdecl.} + PHashTable* = ptr Tcl_HashTable + Tcl_HashTable*{.final.} = object + buckets*: ppTcl_HashEntry + staticBuckets*: array[0..TCL_SMALL_HASH_TABLE - 1, PHashEntry] + numBuckets*: int + numEntries*: int + rebuildSize*: int + downShift*: int + mask*: int + keyType*: int + findProc*: Tcl_HashFindProc + createProc*: Tcl_HashCreateProc + + PHashSearch* = ptr Tcl_HashSearch + Tcl_HashSearch*{.final.} = object + tablePtr*: PHashTable + nextIndex*: int + nextEntryPtr*: PHashEntry + + TAppInitProc* = proc (interp: pInterp): int{.cdecl.} + TPackageInitProc* = proc (interp: pInterp): int{.cdecl.} + TCmdProc* = proc (clientData: Tcl_ClientData, interp: pInterp, argc: int, + argv: Tcl_Argv): int{.cdecl.} + TVarTraceProc* = proc (clientData: Tcl_ClientData, interp: pInterp, + varName: cstring, elemName: cstring, flags: int): cstring{. + cdecl.} + TFreeProc* = proc (theBlock: pointer){.cdecl.} + TInterpDeleteProc* = proc (clientData: Tcl_ClientData, interp: pInterp){.cdecl.} + TCmdDeleteProc* = proc (clientData: Tcl_ClientData){.cdecl.} + TNamespaceDeleteProc* = proc (clientData: Tcl_ClientData){.cdecl.} + +const + TCL_DSTRING_STATIC_SIZE* = 200 + +type + PDString* = ptr Tcl_DString + Tcl_DString*{.final.} = object + str*: cstring + len*: int + spaceAvl*: int + staticSpace*: array[0..TCL_DSTRING_STATIC_SIZE - 1, char] + + PChannel* = ptr Tcl_Channel + Tcl_Channel*{.final.} = object + TDriverBlockModeProc* = proc (instanceData: Tcl_ClientData, mode: int): int{. + cdecl.} + TDriverCloseProc* = proc (instanceData: Tcl_ClientData, interp: PInterp): int{. + cdecl.} + TDriverInputProc* = proc (instanceData: Tcl_ClientData, buf: cstring, + toRead: int, errorCodePtr: PInteger): int{.cdecl.} + TDriverOutputProc* = proc (instanceData: Tcl_ClientData, buf: cstring, + toWrite: int, errorCodePtr: PInteger): int{.cdecl.} + TDriverSeekProc* = proc (instanceData: Tcl_ClientData, offset: int32, + mode: int, errorCodePtr: PInteger): int{.cdecl.} + TDriverSetOptionProc* = proc (instanceData: Tcl_ClientData, interp: PInterp, + optionName: cstring, value: cstring): int{.cdecl.} + TDriverGetOptionProc* = proc (instanceData: Tcl_ClientData, interp: pInterp, + optionName: cstring, dsPtr: PDString): int{. + cdecl.} + TDriverWatchProc* = proc (instanceData: Tcl_ClientData, mask: int){.cdecl.} + TDriverGetHandleProc* = proc (instanceData: Tcl_ClientData, direction: int, + handlePtr: var Tcl_ClientData): int{.cdecl.} + PChannelType* = ptr Tcl_ChannelType + Tcl_ChannelType*{.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: Tcl_ClientData, mask: int){.cdecl.} + PObj* = ptr Tcl_Obj + PPTcl_Obj* = ptr PObj + Tcl_Obj*{.final.} = object + refCount*: int # ... + + TObjCmdProc* = proc (clientData: Tcl_ClientData, interp: PInterp, objc: int, + PPObj: PPTcl_Obj): int{.cdecl.} + PNamespace* = ptr Tcl_Namespace + Tcl_Namespace*{.final.} = object + name*: cstring + fullName*: cstring + clientData*: Tcl_ClientData + deleteProc*: TNamespaceDeleteProc + parentPtr*: PNamespace + + PCallFrame* = ptr Tcl_CallFrame + Tcl_CallFrame*{.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 Tcl_CmdInfo + Tcl_CmdInfo*{.final.} = object + isNativeObjectProc*: int + objProc*: TObjCmdProc + objClientData*: Tcl_ClientData + prc*: TCmdProc + clientData*: Tcl_ClientData + deleteProc*: TCmdDeleteProc + deleteData*: Tcl_ClientData + namespacePtr*: pNamespace + + pCommand* = ptr Tcl_Command + Tcl_Command*{.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: Tcl_ClientData){.cdecl.} + TIdleProc* = proc (clientData: Tcl_ClientData){.cdecl.} + TTimerProc* = TIdleProc + TCreateCloseHandler* = proc (channel: pChannel, prc: TClientDataProc, + clientData: Tcl_ClientData){.cdecl.} + TDeleteCloseHandler* = TCreateCloseHandler + TEventDeleteProc* = proc (evPtr: pEvent, clientData: Tcl_ClientData): int{. + cdecl.} + +proc Tcl_Alloc*(size: int): cstring{.cdecl, dynlib: dllName, + importc: "Tcl_Alloc".} +proc Tcl_CreateInterp*(): pInterp{.cdecl, dynlib: dllName, + importc: "Tcl_CreateInterp".} +proc Tcl_DeleteInterp*(interp: pInterp){.cdecl, dynlib: dllName, + importc: "Tcl_DeleteInterp".} +proc Tcl_ResetResult*(interp: pInterp){.cdecl, dynlib: dllName, + importc: "Tcl_ResetResult".} +proc Tcl_Eval*(interp: pInterp, script: cstring): int{.cdecl, dynlib: dllName, + importc: "Tcl_Eval".} +proc Tcl_EvalFile*(interp: pInterp, filename: cstring): int{.cdecl, + dynlib: dllName, importc: "Tcl_EvalFile".} +proc Tcl_AddErrorInfo*(interp: pInterp, message: cstring){.cdecl, + dynlib: dllName, importc: "Tcl_AddErrorInfo".} +proc Tcl_BackgroundError*(interp: pInterp){.cdecl, dynlib: dllName, + importc: "Tcl_BackgroundError".} +proc Tcl_CreateCommand*(interp: pInterp, name: cstring, cmdProc: TCmdProc, + clientData: Tcl_ClientData, deleteProc: TCmdDeleteProc): pCommand{. + cdecl, dynlib: dllName, importc: "Tcl_CreateCommand".} +proc Tcl_DeleteCommand*(interp: pInterp, name: cstring): int{.cdecl, + dynlib: dllName, importc: "Tcl_DeleteCommand".} +proc Tcl_CallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc, + clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_CallWhenDeleted".} +proc Tcl_DontCallWhenDeleted*(interp: pInterp, prc: TInterpDeleteProc, + clientData: Tcl_ClientData){.cdecl, + dynlib: dllName, importc: "Tcl_DontCallWhenDeleted".} +proc Tcl_CommandComplete*(cmd: cstring): int{.cdecl, dynlib: dllName, + importc: "Tcl_CommandComplete".} +proc Tcl_LinkVar*(interp: pInterp, varName: cstring, varAddr: pointer, typ: int): int{. + cdecl, dynlib: dllName, importc: "Tcl_LinkVar".} +proc Tcl_UnlinkVar*(interp: pInterp, varName: cstring){.cdecl, dynlib: dllName, + importc: "Tcl_UnlinkVar".} +proc Tcl_TraceVar*(interp: pInterp, varName: cstring, flags: int, + prc: TVarTraceProc, clientData: Tcl_ClientData): int{.cdecl, + dynlib: dllName, importc: "Tcl_TraceVar".} +proc Tcl_TraceVar2*(interp: pInterp, varName: cstring, elemName: cstring, + flags: int, prc: TVarTraceProc, clientData: Tcl_ClientData): int{. + cdecl, dynlib: dllName, importc: "Tcl_TraceVar2".} +proc Tcl_UntraceVar*(interp: pInterp, varName: cstring, flags: int, + prc: TVarTraceProc, clientData: Tcl_ClientData){.cdecl, + dynlib: dllName, importc: "Tcl_UntraceVar".} +proc Tcl_UntraceVar2*(interp: pInterp, varName: cstring, elemName: cstring, + flags: int, prc: TVarTraceProc, clientData: Tcl_ClientData){. + cdecl, dynlib: dllName, importc: "Tcl_UntraceVar2".} +proc Tcl_GetVar*(interp: pInterp, varName: cstring, flags: int): cstring{.cdecl, + dynlib: dllName, importc: "Tcl_GetVar".} +proc Tcl_GetVar2*(interp: pInterp, varName: cstring, elemName: cstring, + flags: int): cstring{.cdecl, dynlib: dllName, + importc: "Tcl_GetVar2".} +proc Tcl_SetVar*(interp: pInterp, varName: cstring, newValue: cstring, + flags: int): cstring{.cdecl, dynlib: dllName, + importc: "Tcl_SetVar".} +proc Tcl_SetVar2*(interp: pInterp, varName: cstring, elemName: cstring, + newValue: cstring, flags: int): cstring{.cdecl, + dynlib: dllName, importc: "Tcl_SetVar2".} +proc Tcl_UnsetVar*(interp: pInterp, varName: cstring, flags: int): int{.cdecl, + dynlib: dllName, importc: "Tcl_UnsetVar".} +proc Tcl_UnsetVar2*(interp: pInterp, varName: cstring, elemName: cstring, + flags: int): int{.cdecl, dynlib: dllName, + importc: "Tcl_UnsetVar2".} +proc Tcl_SetResult*(interp: pInterp, newValue: cstring, freeProc: TFreeProc){. + cdecl, dynlib: dllName, importc: "Tcl_SetResult".} +proc Tcl_FirstHashEntry*(hashTbl: pHashTable, searchInfo: var Tcl_HashSearch): pHashEntry{. + cdecl, dynlib: dllName, importc: "Tcl_FirstHashEntry".} +proc Tcl_NextHashEntry*(searchInfo: var Tcl_HashSearch): pHashEntry{.cdecl, + dynlib: dllName, importc: "Tcl_NextHashEntry".} +proc Tcl_InitHashTable*(hashTbl: pHashTable, keyType: int){.cdecl, + dynlib: dllName, importc: "Tcl_InitHashTable".} +proc Tcl_StringMatch*(str: cstring, pattern: cstring): int{.cdecl, + dynlib: dllName, importc: "Tcl_StringMatch".} +proc Tcl_GetErrno*(): int{.cdecl, dynlib: dllName, importc: "Tcl_GetErrno".} +proc Tcl_SetErrno*(val: int){.cdecl, dynlib: dllName, importc: "Tcl_SetErrno".} +proc Tcl_SetPanicProc*(prc: TPanicProc){.cdecl, dynlib: dllName, + importc: "Tcl_SetPanicProc".} +proc Tcl_PkgProvide*(interp: pInterp, name: cstring, version: cstring): int{. + cdecl, dynlib: dllName, importc: "Tcl_PkgProvide".} +proc Tcl_StaticPackage*(interp: pInterp, pkgName: cstring, + initProc: TPackageInitProc, + safeInitProc: TPackageInitProc){.cdecl, dynlib: dllName, + importc: "Tcl_StaticPackage".} +proc Tcl_CreateEventSource*(setupProc: TEventSetupProc, + checkProc: TEventCheckProc, + clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_CreateEventSource".} +proc Tcl_DeleteEventSource*(setupProc: TEventSetupProc, + checkProc: TEventCheckProc, + clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_DeleteEventSource".} +proc Tcl_QueueEvent*(evPtr: pEvent, pos: int){.cdecl, dynlib: dllName, + importc: "Tcl_QueueEvent".} +proc Tcl_SetMaxBlockTime*(timePtr: pTime){.cdecl, dynlib: dllName, + importc: "Tcl_SetMaxBlockTime".} +proc Tcl_DeleteEvents*(prc: TEventDeleteProc, clientData: Tcl_ClientData){. + cdecl, dynlib: dllName, importc: "Tcl_DeleteEvents".} +proc Tcl_DoOneEvent*(flags: int): int{.cdecl, dynlib: dllName, + importc: "Tcl_DoOneEvent".} +proc Tcl_DoWhenIdle*(prc: TIdleProc, clientData: Tcl_ClientData){.cdecl, + dynlib: dllName, importc: "Tcl_DoWhenIdle".} +proc Tcl_CancelIdleCall*(prc: TIdleProc, clientData: Tcl_ClientData){.cdecl, + dynlib: dllName, importc: "Tcl_CancelIdleCall".} +proc Tcl_CreateTimerHandler*(milliseconds: int, prc: TTimerProc, + clientData: Tcl_ClientData): Tcl_TimerToken{.cdecl, + dynlib: dllName, importc: "Tcl_CreateTimerHandler".} +proc Tcl_DeleteTimerHandler*(token: Tcl_TimerToken){.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 Tcl_SplitList*(interp: pInterp, list: cstring, argcPtr: var int, + argvPtr: var Tcl_Argv): int{.cdecl, dynlib: dllName, + importc: "Tcl_SplitList".} +proc Tcl_Merge*(argc: int, argv: Tcl_Argv): cstring{.cdecl, dynlib: dllName, + importc: "Tcl_Merge".} +proc Tcl_Free*(p: cstring){.cdecl, dynlib: dllName, importc: "Tcl_Free".} +proc Tcl_Init*(interp: pInterp): int{.cdecl, dynlib: dllName, + importc: "Tcl_Init".} + # procedure Tcl_InterpDeleteProc(clientData: Tcl_ClientData; interp: pTcl_Interp); cdecl; external dllName; +proc Tcl_GetAssocData*(interp: pInterp, key: cstring, prc: var TInterpDeleteProc): Tcl_ClientData{. + cdecl, dynlib: dllName, importc: "Tcl_GetAssocData".} +proc Tcl_DeleteAssocData*(interp: pInterp, key: cstring){.cdecl, + dynlib: dllName, importc: "Tcl_DeleteAssocData".} +proc Tcl_SetAssocData*(interp: pInterp, key: cstring, prc: TInterpDeleteProc, + clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_SetAssocData".} +proc Tcl_IsSafe*(interp: pInterp): int{.cdecl, dynlib: dllName, + importc: "Tcl_IsSafe".} +proc Tcl_MakeSafe*(interp: pInterp): int{.cdecl, dynlib: dllName, + importc: "Tcl_MakeSafe".} +proc Tcl_CreateSlave*(interp: pInterp, slaveName: cstring, isSafe: int): pInterp{. + cdecl, dynlib: dllName, importc: "Tcl_CreateSlave".} +proc Tcl_GetSlave*(interp: pInterp, slaveName: cstring): pInterp{.cdecl, + dynlib: dllName, importc: "Tcl_GetSlave".} +proc Tcl_GetMaster*(interp: pInterp): pInterp{.cdecl, dynlib: dllName, + importc: "Tcl_GetMaster".} +proc Tcl_GetInterpPath*(askingInterp: pInterp, slaveInterp: pInterp): int{. + cdecl, dynlib: dllName, importc: "Tcl_GetInterpPath".} +proc Tcl_CreateAlias*(slaveInterp: pInterp, srcCmd: cstring, + targetInterp: pInterp, targetCmd: cstring, argc: int, + argv: Tcl_Argv): int{.cdecl, dynlib: dllName, + importc: "Tcl_CreateAlias".} +proc Tcl_GetAlias*(interp: pInterp, srcCmd: cstring, targetInterp: var pInterp, + targetCmd: var cstring, argc: var int, argv: var Tcl_Argv): int{. + cdecl, dynlib: dllName, importc: "Tcl_GetAlias".} +proc Tcl_ExposeCommand*(interp: pInterp, hiddenCmdName: cstring, + cmdName: cstring): int{.cdecl, dynlib: dllName, + importc: "Tcl_ExposeCommand".} +proc Tcl_HideCommand*(interp: pInterp, cmdName: cstring, hiddenCmdName: cstring): int{. + cdecl, dynlib: dllName, importc: "Tcl_HideCommand".} +proc Tcl_EventuallyFree*(clientData: Tcl_ClientData, freeProc: TFreeProc){. + cdecl, dynlib: dllName, importc: "Tcl_EventuallyFree".} +proc Tcl_Preserve*(clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_Preserve".} +proc Tcl_Release*(clientData: Tcl_ClientData){.cdecl, dynlib: dllName, + importc: "Tcl_Release".} +proc Tcl_InterpDeleted*(interp: pInterp): int{.cdecl, dynlib: dllName, + importc: "Tcl_InterpDeleted".} +proc Tcl_GetCommandInfo*(interp: pInterp, cmdName: cstring, + info: var Tcl_CmdInfo): int{.cdecl, dynlib: dllName, + importc: "Tcl_GetCommandInfo".} +proc Tcl_SetCommandInfo*(interp: pInterp, cmdName: cstring, + info: var Tcl_CmdInfo): int{.cdecl, dynlib: dllName, + importc: "Tcl_SetCommandInfo".} +proc Tcl_FindExecutable*(path: cstring){.cdecl, dynlib: dllName, + importc: "Tcl_FindExecutable".} +proc Tcl_GetStringResult*(interp: pInterp): cstring{.cdecl, dynlib: dllName, + importc: "Tcl_GetStringResult".} + #v1.0 +proc Tcl_FindCommand*(interp: pInterp, cmdName: cstring, + contextNsPtr: pNamespace, flags: int): Tcl_Command{.cdecl, + dynlib: dllName, importc: "Tcl_FindCommand".} + #v1.0 +proc Tcl_DeleteCommandFromToken*(interp: pInterp, cmd: pCommand): int{.cdecl, + dynlib: dllName, importc: "Tcl_DeleteCommandFromToken".} +proc Tcl_CreateNamespace*(interp: pInterp, name: cstring, + clientData: Tcl_ClientData, + deleteProc: TNamespaceDeleteProc): pNamespace{.cdecl, + dynlib: dllName, importc: "Tcl_CreateNamespace".} + #v1.0 +proc Tcl_DeleteNamespace*(namespacePtr: pNamespace){.cdecl, dynlib: dllName, + importc: "Tcl_DeleteNamespace".} +proc Tcl_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 Tcl_GetCurrentNamespace*(interp: pInterp): pNamespace{.cdecl, + dynlib: dllName, importc: "Tcl_GetCurrentNamespace".} +proc Tcl_GetGlobalNamespace*(interp: pInterp): pNamespace{.cdecl, + dynlib: dllName, importc: "Tcl_GetGlobalNamespace".} +proc Tcl_PushCallFrame*(interp: pInterp, callFramePtr: var Tcl_CallFrame, + namespacePtr: pNamespace, isProcCallFrame: int): int{. + cdecl, dynlib: dllName, importc: "Tcl_PushCallFrame".} +proc Tcl_PopCallFrame*(interp: pInterp){.cdecl, dynlib: dllName, + importc: "Tcl_PopCallFrame".} +proc Tcl_VarEval*(interp: pInterp): int{.cdecl, varargs, dynlib: dllName, + importc: "Tcl_VarEval".} + # For TkConsole.c * +proc Tcl_RecordAndEval*(interp: pInterp, cmd: cstring, flags: int): int{.cdecl, + dynlib: dllName, importc: "Tcl_RecordAndEval".} +proc Tcl_GlobalEval*(interp: pInterp, command: cstring): int{.cdecl, + dynlib: dllName, importc: "Tcl_GlobalEval".} +proc Tcl_DStringFree*(dsPtr: pDString){.cdecl, dynlib: dllName, + importc: "Tcl_DStringFree".} +proc Tcl_DStringAppend*(dsPtr: pDString, str: cstring, length: int): cstring{. + cdecl, dynlib: dllName, importc: "Tcl_DStringAppend".} +proc Tcl_DStringAppendElement*(dsPtr: pDString, str: cstring): cstring{.cdecl, + dynlib: dllName, importc: "Tcl_DStringAppendElement".} +proc Tcl_DStringInit*(dsPtr: pDString){.cdecl, dynlib: dllName, + importc: "Tcl_DStringInit".} +proc Tcl_AppendResult*(interp: pInterp){.cdecl, varargs, dynlib: dllName, + importc: "Tcl_AppendResult".} + # actually a "C" var array +proc Tcl_SetStdChannel*(channel: pChannel, typ: int){.cdecl, dynlib: dllName, + importc: "Tcl_SetStdChannel".} +proc Tcl_SetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring, + newValue: cstring): int{.cdecl, dynlib: dllName, + importc: "Tcl_SetChannelOption".} +proc Tcl_GetChannelOption*(interp: pInterp, chan: pChannel, optionName: cstring, + dsPtr: pDString): int{.cdecl, dynlib: dllName, + importc: "Tcl_GetChannelOption".} +proc Tcl_CreateChannel*(typePtr: pChannelType, chanName: cstring, + instanceData: Tcl_ClientData, mask: int): pChannel{. + cdecl, dynlib: dllName, importc: "Tcl_CreateChannel".} +proc Tcl_RegisterChannel*(interp: pInterp, channel: pChannel){.cdecl, + dynlib: dllName, importc: "Tcl_RegisterChannel".} +proc Tcl_UnregisterChannel*(interp: pInterp, channel: pChannel): int{.cdecl, + dynlib: dllName, importc: "Tcl_UnregisterChannel".} +proc Tcl_CreateChannelHandler*(chan: pChannel, mask: int, prc: TChannelProc, + clientData: Tcl_ClientData){.cdecl, + dynlib: dllName, importc: "Tcl_CreateChannelHandler".} +proc Tcl_GetChannel*(interp: pInterp, chanName: cstring, modePtr: pInteger): pChannel{. + cdecl, dynlib: dllName, importc: "Tcl_GetChannel".} +proc Tcl_GetStdChannel*(typ: int): pChannel{.cdecl, dynlib: dllName, + importc: "Tcl_GetStdChannel".} +proc Tcl_Gets*(chan: pChannel, dsPtr: pDString): int{.cdecl, dynlib: dllName, + importc: "Tcl_Gets".} +proc Tcl_Write*(chan: pChannel, s: cstring, slen: int): int{.cdecl, + dynlib: dllName, importc: "Tcl_Write".} +proc Tcl_Flush*(chan: pChannel): int{.cdecl, dynlib: dllName, + importc: "Tcl_Flush".} + # TclWinLoadLibrary = function(name: PChar): HMODULE; cdecl; external dllName; +proc Tcl_CreateExitHandler*(prc: TClientDataProc, clientData: Tcl_ClientData){. + cdecl, dynlib: dllName, importc: "Tcl_CreateExitHandler".} +proc Tcl_DeleteExitHandler*(prc: TClientDataProc, clientData: Tcl_ClientData){. + cdecl, dynlib: dllName, importc: "Tcl_DeleteExitHandler".} +proc Tcl_GetStringFromObj*(pObj: pObj, pLen: pInteger): cstring{.cdecl, + dynlib: dllName, importc: "Tcl_GetStringFromObj".} +proc Tcl_CreateObjCommand*(interp: pInterp, name: cstring, cmdProc: TObjCmdProc, + clientData: Tcl_ClientData, + deleteProc: TCmdDeleteProc): pCommand{.cdecl, + dynlib: dllName, importc: "Tcl_CreateObjCommand".} +proc Tcl_NewStringObj*(bytes: cstring, length: int): pObj{.cdecl, + dynlib: dllName, importc: "Tcl_NewStringObj".} + # procedure TclFreeObj(pObj: pTcl_Obj); cdecl; external dllName; +proc Tcl_EvalObj*(interp: pInterp, pObj: pObj): int{.cdecl, dynlib: dllName, + importc: "Tcl_EvalObj".} +proc Tcl_GlobalEvalObj*(interp: pInterp, pObj: pObj): int{.cdecl, + dynlib: dllName, importc: "Tcl_GlobalEvalObj".} +proc TclRegComp*(exp: cstring): pointer{.cdecl, dynlib: dllName, + importc: "TclRegComp".} +proc TclRegExec*(prog: pointer, str: cstring, start: cstring): int{.cdecl, + dynlib: dllName, importc: "TclRegExec".} +proc TclRegError*(msg: cstring){.cdecl, dynlib: dllName, importc: "TclRegError".} +proc TclGetRegError*(): cstring{.cdecl, dynlib: dllName, + importc: "TclGetRegError".} +proc Tcl_RegExpRange*(prog: pointer, index: int, head: var cstring, + tail: var cstring){.cdecl, dynlib: dllName, + importc: "Tcl_RegExpRange".} +proc Tcl_GetCommandTable*(interp: pInterp): pHashTable = + if interp != nil: + result = cast[pHashTable](cast[int](interp) + sizeof(Tcl_Interp) + + sizeof(pointer)) + +proc Tcl_CreateHashEntry*(tablePtr: pHashTable, key: cstring, newPtr: pInteger): pHashEntry = + result = cast[pHashTable](tablePtr).createProc(tablePtr, key, newPtr) + +proc Tcl_FindHashEntry*(tablePtr: pHashTable, key: cstring): pHashEntry = + result = cast[pHashTable](tablePtr).findProc(tablePtr, key) + +proc Tcl_SetHashValue*(h: pHashEntry, clientData: Tcl_ClientData) = + h.clientData = clientData + +proc Tcl_GetHashValue*(h: pHashEntry): Tcl_ClientData = + result = h.clientData + +proc Tcl_IncrRefCount*(pObj: pObj) = + inc(pObj.refCount) + +proc Tcl_DecrRefCount*(pObj: pObj) = + dec(pObj.refCount) + if pObj.refCount <= 0: + dealloc(pObj) + +proc Tcl_IsShared*(pObj: pObj): bool = + return pObj.refCount > 1 + +proc Tcl_GetHashKey*(hashTbl: pHashTable, hashEntry: pHashEntry): cstring = + if hashTbl == nil or hashEntry == nil: + result = nil + else: + result = hashEntry.key diff --git a/lib/nimbase.h b/lib/nimbase.h index a0f08f4f3..dc0ac6e0f 100755 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -1,7 +1,7 @@ /* Nimrod's Runtime Library - (c) Copyright 2009 Andreas Rumpf + (c) Copyright 2010 Andreas Rumpf See the file "copying.txt", included in this distribution, for details about the copyright. diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim new file mode 100755 index 000000000..6df39f50b --- /dev/null +++ b/lib/pure/logging.nim @@ -0,0 +1,146 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This module implements a simple logger. It is based on the following design: +## * Runtime log formating is a bug: Sooner or later ever log file is parsed. +## * Keep it simple: If this library does not fullfill your needs, write your +## own. Trying to support every logging feature just leads to bloat. +## +## Format is:: +## +## DEBUG|INFO|... (2009-11-02 00:00:00)? (Component: )? Message +## +## + +type + TLevel* = enum ## logging level + lvlAll, ## all levels active + lvlDebug, ## debug level (and any above) active + lvlInfo, ## info level (and any above) active + lvlWarn, ## warn level (and any above) active + lvlError, ## error level (and any above) active + lvlFatal ## fatal level (and any above) active + +const + LevelNames*: array [TLevel, string] = [ + "DEBUG", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" + ] + +type + TLogger* = object of TObject ## abstract logger; the base type of all loggers + levelThreshold*: TLevel ## only messages of level >= levelThreshold + ## should be processed + TConsoleLogger* = object of TLogger ## logger that writes the messages to the + ## console + + TFileLogger* = object of TLogger ## logger that writes the messages to a file + f: TFile + + TRollingFileLogger* = object of + TFileLogger ## logger that writes the message to a file + maxlines: int # maximum number of lines + lines: seq[string] + +method log*(L: ref TLogger, level: TLevel, + frmt: string, args: openArray[string]) = + ## override this method in custom loggers. Default implementation does + ## nothing. + nil + +method log*(L: ref TConsoleLogger, level: TLevel, + frmt: string, args: openArray[string]) = + Writeln(stdout, LevelNames[level], " ", frmt % args) + +method log*(L: ref TFileLogger, level: TLevel, + frmt: string, args: openArray[string]) = + Writeln(L.f, LevelNames[level], " ", frmt % args) + +proc defaultFilename*(): string = + ## returns the default filename for a logger + var (path, name, ext) = splitFile(getApplicationFilename()) + result = changeFileExt(path / name & "_" & getDateStr(), "log") + +proc substituteLog*(frmt: string): string = + ## converts $date to the current date + ## converts $time to the current time + ## converts $app to getApplicationFilename() + ## converts + result = "" + var i = 0 + while i < frmt.len: + if frmt[i] != '$': + result.add(frmt[i]) + inc(i) + else: + inc(i) + var v = "" + var app = getApplicationFilename() + while frmt[i] in IdentChars: + v.add(toLower(frmt[i])) + inc(i) + case v + of "date": result.add(getDateStr()) + of "time": result.add(getClockStr()) + of "app": result.add(app) + of "appdir": result.add(app.splitFile.dir) + of "appname": result.add(app.splitFile.name) + + +proc newFileLogger(filename = defaultFilename(), + mode: TFileMode = fmAppend, + levelThreshold = lvlNone): ref TFileLogger = + new(result) + result.levelThreshold = levelThreshold + if not open(result.f, filename, mode): + raiseException(EIO, "cannot open for writing: " & filename) + +proc newRollingFileLogger(filename = defaultFilename(), + mode: TFileMode = fmAppend, + levelThreshold = lvlNone, + maxLines = 1000): ref TFileLogger = + new(result) + result.levelThreshold = levelThreshold + result.maxLines = maxLines + if not open(result.f, filename, mode): + raiseException(EIO, "cannot open for writing: " & filename) + +var + level* = lvlNone + handlers*: seq[ref TLogger] = @[] + +proc logLoop(level: TLevel, msg: string) = + for logger in items(handlers): + if level >= logger.levelThreshold: + log(logger, level, msg) + +template log*(level: TLevel, msg: string) = + ## logs a message of the given level + if level >= logging.Level: + (bind logLoop)(level, frmt, args) + +template debug*(msg: string) = + ## logs a debug message + log(lvlDebug, msg) + +template info*(msg: string) = + ## logs an info message + log(lvlInfo, msg) + +template warn*(msg: string) = + ## logs a warning message + log(lvlWarn, msg) + +template error*(msg: string) = + ## logs an error message + log(lvlError, msg) + +template fatal*(msg: string) = + ## logs a fatal error message and calls ``quit(msg)`` + log(lvlFatal, msg) + diff --git a/lib/pure/os.nim b/lib/pure/os.nim index afa145e9f..85ac9c83c 100755 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -635,22 +635,23 @@ proc copyFile*(dest, source: string) = if CopyFileA(source, dest, 0'i32) == 0'i32: OSError() else: # generic version of copyFile which works for any platform: - const - bufSize = 8192 # 8K buffer - var - d, s: TFile + const bufSize = 8000 # better for memory manager + var d, s: TFile if not open(s, source): OSError() if not open(d, dest, fmWrite): close(s) OSError() - var - buf: Pointer = alloc(bufsize) - bytesread, byteswritten: int + var buf = alloc(bufsize) while True: - bytesread = readBuffer(s, buf, bufsize) - byteswritten = writeBuffer(d, buf, bytesread) + var bytesread = readBuffer(s, buf, bufsize) + if bytesread > 0: + var byteswritten = writeBuffer(d, buf, bytesread) + if bytesread != bytesWritten: + dealloc(buf) + close(s) + close(d) + OSError() if bytesread != bufSize: break - if bytesread != bytesWritten: OSError() dealloc(buf) close(s) close(d) diff --git a/lib/pure/ropes.nim b/lib/pure/ropes.nim new file mode 100755 index 000000000..6655a9fda --- /dev/null +++ b/lib/pure/ropes.nim @@ -0,0 +1,375 @@ +# +# +# Nimrod's Runtime Library +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## This module contains support for a `rope`:idx: data type. +## Ropes can represent very long strings efficiently; especially concatenation +## is done in O(1) instead of O(n). They are essentially concatenation +## trees that are only flattened when converting to a native Nimrod +## string. The empty string is represented by ``nil``. Ropes are immutable and +## subtrees can be shared without copying. +## Leaves can be cached for better memory efficiency at the cost of a bit of +## runtime efficiency. + +{.deadCodeElim: on.} + +{.push debugger:off .} # the user does not want to trace a part + # of the standard library! + +# copied from excpt.nim, because I don't want to make this template public +template newException(exceptn, message: expr): expr = + block: # open a new scope + var + e: ref exceptn + new(e) + e.msg = message + e + +const + countCacheMisses = false + +var + cacheEnabled = false + +type + PRope* = ref TRope ## empty rope is represented by nil + TRope {.acyclic, final, pure.} = object + left, right: PRope + length: int + data: string # != nil if a leaf + +proc isConc(r: PRope): bool {.inline.} = return isNil(r.data) + +# Note that the left and right pointers are not needed for leafs. +# Leaves have relatively high memory overhead (~30 bytes on a 32 +# bit machine) and we produce many of them. This is why we cache and +# share leafs accross different rope trees. +# To cache them they are inserted in another tree, a splay tree for best +# performance. But for the caching tree we use the leaf's left and right +# pointers. + +proc len*(a: PRope): int = + ## the rope's length + if a == nil: result = 0 + else: result = a.length + +proc newRope(): PRope = new(result) +proc newRope(data: string): PRope = + new(result) + result.length = len(data) + result.data = data + +var + cache: PRope # the root of the cache tree + N: PRope # dummy rope needed for splay algorithm + +when countCacheMisses: + var misses, hits: int + +proc splay(s: string, tree: PRope, cmpres: var int): PRope = + var c: int + var t = tree + N.left = nil + N.right = nil # reset to nil + var le = N + var r = N + while true: + c = cmp(s, t.data) + if c < 0: + if (t.left != nil) and (s < t.left.data): + var y = t.left + t.left = y.right + y.right = t + t = y + if t.left == nil: break + r.left = t + r = t + t = t.left + elif c > 0: + if (t.right != nil) and (s > t.right.data): + var y = t.right + t.right = y.left + y.left = t + t = y + if t.right == nil: break + le.right = t + le = t + t = t.right + else: + break + cmpres = c + le.right = t.left + r.left = t.right + t.left = N.right + t.right = N.left + result = t + +proc insertInCache(s: string, tree: PRope): PRope = + var t = tree + if t == nil: + result = newRope(s) + when countCacheMisses: inc(misses) + return + var cmp: int + t = splay(s, t, cmp) + if cmp == 0: + # We get here if it's already in the Tree + # Don't add it again + result = t + when countCacheMisses: inc(hits) + else: + when countCacheMisses: inc(misses) + result = newRope(s) + if cmp < 0: + result.left = t.left + result.right = t + t.left = nil + else: + # i > t.item: + result.right = t.right + result.left = t + t.right = nil + +proc rope*(s: string): PRope = + ## Converts a string to a rope. + if s.len == 0: + result = nil + elif cacheEnabled: + result = insertInCache(s, cache) + cache = result + else: + result = newRope(s) + +proc rope*(i: BiggestInt): PRope = + ## Converts an int to a rope. + result = rope($i) + +proc rope*(f: BiggestFloat): PRope = + ## Converts a float to a rope. + result = rope($f) + +proc disableCache*() = + ## the cache is discarded and disabled. The GC will reuse its used memory. + cache = nil + cacheEnabled = false + +proc enableCache*() = + ## Enables the caching of leaves. This reduces the memory footprint at + ## the cost of runtime efficiency. + cacheEnabled = true + +proc `&`*(a, b: PRope): PRope = + ## the concatenation operator for ropes. + if a == nil: + result = b + elif b == nil: + result = a + else: + result = newRope() + result.length = a.length + b.length + when false: + # XXX rebalancing would be nice, but is too expensive. + result.left = a.left + var x = newRope() + x.left = a.right + x.right = b + result.right = x + else: + result.left = a + result.right = b + +proc `&`*(a: PRope, b: string): PRope = + ## the concatenation operator for ropes. + result = a & rope(b) + +proc `&`*(a: string, b: PRope): PRope = + ## the concatenation operator for ropes. + result = rope(a) & b + +proc `&`*(a: openarray[PRope]): PRope = + ## the concatenation operator for an openarray of ropes. + for i in countup(0, high(a)): result = result & a[i] + +proc add*(a: var PRope, b: PRope) = + ## adds `b` to the rope `a`. + a = a & b + +proc add*(a: var PRope, b: string) = + ## adds `b` to the rope `a`. + a = a & b + +proc `[]`*(r: PRope, i: int): char = + ## returns the character at position `i` in the rope `r`. This is quite + ## expensive! Worst-case: O(n). If ``i >= r.len``, ``\0`` is returned. + var x = r + var j = i + if x == nil: return + while true: + if not isConc(x): + if x.data.len <% j: return x.data[j] + return '\0' + else: + if x.left.len >% j: + x = x.left + else: + x = x.right + dec(j, x.len) + +iterator leaves*(r: PRope): string = + ## iterates over any leaf string in the rope `r`. + if r != nil: + var stack = @[r] + while stack.len > 0: + var it = stack.pop + while isConc(it): + stack.add(it.right) + it = it.left + assert(it != nil) + assert(it.data != nil) + yield it.data + +iterator items*(r: PRope): char = + ## iterates over any character in the rope `r`. + for s in leaves(r): + for c in items(s): yield c + +proc write*(f: TFile, r: PRope) = + ## writes a rope to a file. + for s in leaves(r): write(f, s) + +proc `$`*(r: PRope): string = + ## converts a rope back to a string. + result = newString(r.len) + setLen(result, 0) + for s in leaves(r): add(result, s) + +when false: + # Format string caching seems reasonable: All leaves can be shared and format + # string parsing has to be done only once. A compiled format string is stored + # as a rope. A negative length is used for the index into the args array. + proc compiledArg(idx: int): PRope = + new(result) + result.length = -idx + + proc compileFrmt(frmt: string): PRope = + var i = 0 + var length = len(frmt) + result = nil + var num = 0 + while i < length: + if frmt[i] == '$': + inc(i) + case frmt[i] + of '$': + add(result, "$") + inc(i) + of '#': + inc(i) + add(result, compiledArg(num+1)) + inc(num) + of '0'..'9': + var j = 0 + while true: + j = j * 10 + ord(frmt[i]) - ord('0') + inc(i) + if frmt[i] notin {'0'..'9'}: break + num = j + add(s, compiledArg(j)) + of '{': + inc(i) + var j = 0 + while frmt[i] in {'0'..'9'}: + j = j * 10 + ord(frmt[i]) - ord('0') + inc(i) + if frmt[i] == '}': inc(i) + else: raise newException(EInvalidValue, "invalid format string") + num = j + add(s, compiledArg(j)) + else: raise newException(EInvalidValue, "invalid format string") + var start = i + while i < length: + if frmt[i] != '$': inc(i) + else: break + if i - 1 >= start: + add(result, copy(frmt, start, i-1)) + +proc `%`*(frmt: string, args: openarray[PRope]): PRope = + ## `%` substitution operator for ropes. Does not support the ``$identifier`` + ## nor ``${identifier}`` notations. + var i = 0 + var length = len(frmt) + result = nil + var num = 0 + while i < length: + if frmt[i] == '$': + inc(i) + case frmt[i] + of '$': + add(result, "$") + inc(i) + of '#': + inc(i) + add(result, args[num]) + inc(num) + of '0'..'9': + var j = 0 + while true: + j = j * 10 + ord(frmt[i]) - ord('0') + inc(i) + if frmt[i] notin {'0'..'9'}: break + num = j + add(result, args[j-1]) + of '{': + inc(i) + var j = 0 + while frmt[i] in {'0'..'9'}: + j = j * 10 + ord(frmt[i]) - ord('0') + inc(i) + if frmt[i] == '}': inc(i) + else: raise newException(EInvalidValue, "invalid format string") + num = j + add(result, args[j-1]) + else: raise newException(EInvalidValue, "invalid format string") + var start = i + while i < length: + if frmt[i] != '$': inc(i) + else: break + if i - 1 >= start: + add(result, copy(frmt, start, i - 1)) + +proc addf*(c: var PRope, frmt: string, args: openarray[PRope]) = + ## shortcut for ``add(c, frmt % args)``. + add(c, frmt % args) + +proc equalsFile*(r: PRope, f: TFile): bool = + ## returns true if the contents of the file `f` equal `r`. + var bufSize = 1024 # reasonable start value + var buf = alloc(BufSize) + for s in leaves(r): + if s.len > bufSize: + bufSize = max(bufSize * 2, s.len) + buf = realloc(buf, bufSize) + var readBytes = readBuffer(f, buf, s.len) + result = readBytes == s.len and equalMem(buf, cstring(s), s.len) + if not result: break + if result: + result = readBuffer(f, buf, 1) == 0 # really at the end of file? + dealloc(buf) + +proc equalsFile*(r: PRope, f: string): bool = + ## returns true if the contents of the file `f` equal `r`. If `f` does not + ## exist, false is returned. + var bin: TFile + result = open(bin, f) + if result: + result = equalsFile(r, bin) + close(bin) + +new(N) # init dummy node for splay algorithm + +{.pop.} \ No newline at end of file diff --git a/lib/pure/sockets.nim b/lib/pure/sockets.nim new file mode 100644 index 000000000..0f9221b37 --- /dev/null +++ b/lib/pure/sockets.nim @@ -0,0 +1,206 @@ +# +# +# 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 implements a simple portable type-safe sockets layer. **Note**: +## This module is incomplete and probably buggy. It does not work on Windows +## yet. Help if you are interested. + +# TODO: +# getservbyname(name, proto) +# getservbyport(port, proto) +# gethostbyname(name) +# gethostbyaddr(addr) +# shutdown(sock, how) +# connect(sock, address, port) +# select({ socket, ... }, timeout) + +# sendto +# recvfrom + +# bind(socket, address, port) + +# getsockopt(socket, level, optname) +# setsockopt(socket, level, optname, value) + +import os + +when defined(Windows): + import winlean +else: + import posix + +type + TSocket* = distinct cint ## socket type + TPort* = distinct int16 ## port type + + TDomain* = enum ## domain, which specifies the protocol family of the + ## created socket. Other domains than those that are listed + ## here are unsupported. + AF_UNIX, ## for local socket (using a file). + AF_INET, ## for network protocol IPv4 or + AF_INET6 ## for network protocol IPv6. + + TType* = enum ## second argument to `socket` proc + SOCK_STREAM, ## reliable stream-oriented service or Stream Sockets + SOCK_DGRAM, ## datagram service or Datagram Sockets + SOCK_SEQPACKET, ## reliable sequenced packet service, or + SOCK_RAW ## raw protocols atop the network layer. + + TProtocol* = enum ## third argument to `socket` proc + IPPROTO_TCP, ## Transmission control protocol. + IPPROTO_UDP, ## User datagram protocol. + IPPROTO_IP, ## Internet protocol. + IPPROTO_IPV6, ## Internet Protocol Version 6. + IPPROTO_RAW, ## Raw IP Packets Protocol. + IPPROTO_ICMP ## Control message protocol. + +const + InvalidSocket* = TSocket(-1'i32) ## invalid socket number + +proc `==`*(a, b: TSocket): bool {.borrow.} +proc `==`*(a, b: TPort): bool {.borrow.} + +proc ToInt(domain: TDomain): cint = + case domain + of AF_UNIX: result = posix.AF_UNIX + of AF_INET: result = posix.AF_INET + of AF_INET6: result = posix.AF_INET6 + +proc ToInt(typ: TType): cint = + case typ + of SOCK_STREAM: result = posix.SOCK_STREAM + of SOCK_DGRAM: result = posix.SOCK_DGRAM + of SOCK_SEQPACKET: result = posix.SOCK_SEQPACKET + of SOCK_RAW: result = posix.SOCK_RAW + +proc ToInt(p: TProtocol): cint = + case p + of IPPROTO_TCP: result = posix.IPPROTO_TCP + of IPPROTO_UDP: result = posix.IPPROTO_UDP + of IPPROTO_IP: result = posix.IPPROTO_IP + of IPPROTO_IPV6: result = posix.IPPROTO_IPV6 + of IPPROTO_RAW: result = posix.IPPROTO_RAW + of IPPROTO_ICMP: result = posix.IPPROTO_ICMP + +proc socket*(domain: TDomain = AF_INET6, typ: TType = SOCK_STREAM, + protocol: TProtocol = IPPROTO_TCP): TSocket = + ## creates a new socket; returns `InvalidSocket` if an error occurs. + result = TSocket(posix.socket(ToInt(domain), ToInt(typ), ToInt(protocol))) + +proc listen*(socket: TSocket, attempts = 5) = + ## listens to socket. + if posix.listen(cint(socket), cint(attempts)) < 0'i32: OSError() + +proc bindAddr*(socket: TSocket, port = TPort(0)) = + var name: Tsockaddr_in + name.sin_family = posix.AF_INET + name.sin_port = htons(int16(port)) + name.sin_addr.s_addr = htonl(INADDR_ANY) + if bindSocket(cint(socket), cast[ptr TSockAddr](addr(name)), + sizeof(name)) < 0'i32: + OSError() + +proc getSockName*(socket: TSocket): TPort = + var name: Tsockaddr_in + name.sin_family = posix.AF_INET + #name.sin_port = htons(cint16(port)) + #name.sin_addr.s_addr = htonl(INADDR_ANY) + var namelen: cint = sizeof(name) + if getsockname(cint(socket), cast[ptr TSockAddr](addr(name)), + addr(namelen)) == -1'i32: + OSError() + result = TPort(ntohs(name.sin_port)) + +proc accept*(server: TSocket): TSocket = + ## waits for a client and returns its socket + var client: Tsockaddr_in + var clientLen: TsockLen = sizeof(client) + result = TSocket(accept(cint(server), cast[ptr TSockAddr](addr(client)), + addr(clientLen))) + +proc close*(socket: TSocket) = + ## closes a socket. + when defined(windows): + discard winlean.closeSocket(cint(socket)) + else: + discard posix.close(cint(socket)) + +proc recvLine*(socket: TSocket, line: var string): bool = + ## returns false if no further data is available. + setLen(line, 0) + while true: + var c: char + var n = recv(cint(socket), addr(c), 1, 0'i32) + if n <= 0: return + if c == '\r': + n = recv(cint(socket), addr(c), 1, MSG_PEEK) + if n > 0 and c == '\L': + discard recv(cint(socket), addr(c), 1, 0'i32) + elif n <= 0: return false + return true + elif c == '\L': return true + add(line, c) + +proc recv*(socket: TSocket, data: pointer, size: int): int = + ## receive data from a socket + result = posix.recv(cint(socket), data, size, 0'i32) + +proc recv*(socket: TSocket): string = + ## receive all the data from the socket + const bufSize = 200 + var buf = newString(bufSize) + result = "" + while true: + var bytesRead = recv(socket, cstring(buf), bufSize-1) + buf[bytesRead] = '\0' # might not be necessary + setLen(buf, bytesRead) + add(result, buf) + if bytesRead != bufSize-1: break + +proc skip*(socket: TSocket) = + ## skips all the data that is pending for the socket + const bufSize = 200 + var buf = alloc(bufSize) + while recv(socket, buf, bufSize) == bufSize: nil + dealloc(buf) + +proc send*(socket: TSocket, data: pointer, size: int): int = + result = posix.send(cint(socket), data, size, 0'i32) + +proc send*(socket: TSocket, data: string) = + if send(socket, cstring(data), data.len) != data.len: OSError() + +proc ntohl*(x: int32): int32 = + ## Convert 32-bit integers from network to host byte order. + ## On machines where the host byte order is the same as network byte order, + ## this is a no-op; otherwise, it performs a 4-byte swap operation. + when cpuEndian == bigEndian: result = x + else: result = (x shr 24'i32) or + (x shr 8'i32 and 0xff00'i32) or + (x shl 8'i32 and 0xff0000'i32) or + (x shl 24'i32) + +proc ntohs*(x: int16): int16 = + ## Convert 16-bit integers from network to host byte order. On machines + ## where the host byte order is the same as network byte order, this is + ## a no-op; otherwise, it performs a 2-byte swap operation. + when cpuEndian == bigEndian: result = x + else: result = (x shr 8'i16) or (x shl 8'i16) + +proc htonl*(x: int32): int32 = + ## Convert 32-bit integers from host to network byte order. On machines + ## where the host byte order is the same as network byte order, this is + ## a no-op; otherwise, it performs a 4-byte swap operation. + result = sockets.ntohl(x) + +proc htons*(x: int16): int16 = + ## Convert 16-bit positive integers from host to network byte order. + ## On machines where the host byte order is the same as network byte + ## order, this is a no-op; otherwise, it performs a 2-byte swap operation. + result = sockets.ntohs(x) diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index 10cd0b933..8ea59637a 100755 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -7,10 +7,10 @@ # distribution, for details about the copyright. # -## The ``strtabs`` module implements an efficient hash table that is a mapping -## from strings to strings. Supports a case-sensitive, case-insensitive and -## style-insensitive mode. An efficient string substitution operator ``%`` -## for the string table is also provided. +## The ``strtabs`` module implements an efficient hash table that is a mapping +## from strings to strings. Supports a case-sensitive, case-insensitive and +## style-insensitive mode. An efficient string substitution operator ``%`` +## for the string table is also provided. import os, hashes, strutils diff --git a/lib/system.nim b/lib/system.nim index 157c11477..25e914b63 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 293491fe9..01d98c205 100755 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -9,8 +9,7 @@ # Exception handling code. This is difficult because it has -# to work if there is no more memory. Thus we have to use -# a static string. Do not use ``sprintf``, etc. as they are +# to work if there is no more memory. Do not use ``sprintf``, etc. as they are # unsafe! when not defined(windows) or not defined(guiapp): diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 40e6e7b11..d6ef9ffbb 100755 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -155,6 +155,7 @@ type dwReserved1: int32 cFileName*: array[0..(MAX_PATH) - 1, char] cAlternateFileName*: array[0..13, char] + proc FindFirstFileA*(lpFileName: cstring, lpFindFileData: var TWIN32_FIND_DATA): THANDLE {. stdcall, dynlib: "kernel32", importc: "FindFirstFileA".} diff --git a/lib/wrappers/tcl.nim b/lib/wrappers/tcl.nim index 3539bf92e..0d9d08507 100755 --- a/lib/wrappers/tcl.nim +++ b/lib/wrappers/tcl.nim @@ -51,7 +51,7 @@ const TCL_VERSION_MAJOR* = 0 TCL_VERSION_MINOR* = 0 TCL_NO_EVAL* = 0x00010000 - TCL_EVAL_GLOBAL* = 0x00020000 #* Flag values passed to variable-related procedures. * + TCL_EVAL_GLOBAL* = 0x00020000 # Flag values passed to variable-related procedures. * TCL_GLOBAL_ONLY* = 1 TCL_NAMESPACE_ONLY* = 2 TCL_APPEND_VALUE* = 4 @@ -62,15 +62,15 @@ const TCL_TRACE_DESTROYED* = 0x00000080 TCL_INTERP_DESTROYED* = 0x00000100 TCL_LEAVE_ERR_MSG* = 0x00000200 - TCL_PARSE_PART1* = 0x00000400 #* Types for linked variables: * + TCL_PARSE_PART1* = 0x00000400 # Types for linked variables: * TCL_LINK_INT* = 1 TCL_LINK_DOUBLE* = 2 TCL_LINK_BOOLEAN* = 3 TCL_LINK_STRING* = 4 TCL_LINK_READ_ONLY* = 0x00000080 - TCL_SMALL_HASH_TABLE* = 4 #* Hash Table * + TCL_SMALL_HASH_TABLE* = 4 # Hash Table * TCL_STRING_KEYS* = 0 - TCL_ONE_WORD_KEYS* = 1 #* Const/enums Tcl_QueuePosition * + TCL_ONE_WORD_KEYS* = 1 # Const/enums Tcl_QueuePosition * # typedef enum { TCL_QUEUE_TAIL* = 0 TCL_QUEUE_HEAD* = 1 @@ -80,7 +80,7 @@ const TCL_WINDOW_EVENTS* = 1 shl 2 TCL_FILE_EVENTS* = 1 shl 3 TCL_TIMER_EVENTS* = 1 shl 4 - TCL_IDLE_EVENTS* = 1 shl 5 #* WAS 0x10 ???? * + TCL_IDLE_EVENTS* = 1 shl 5 # WAS 0x10 ???? * TCL_ALL_EVENTS* = not TCL_DONT_WAIT TCL_VOLATILE* = 1 @@ -92,7 +92,7 @@ const TCL_ENFORCE_MODE* = 1 shl 4 TCL_READABLE* = 1 shl 1 TCL_WRITABLE* = 1 shl 2 - TCL_EXCEPTION* = 1 shl 3 #* POSIX * + TCL_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. @@ -101,277 +101,277 @@ const # 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::.. - # * + 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 Tcl_Argv* = cstringArray Tcl_ClientData* = pointer Tcl_FreeProc* = proc (theBlock: pointer){.cdecl.} PTcl_Interp* = ptr Tcl_Interp - Tcl_Interp*{.final.} = object #* Event Definitions * - result*: cstring #* Do not access this directly. Use + Tcl_Interp*{.final.} = object # Event Definitions * + result*: cstring # Do not access this directly. Use # * Tcl_GetStringResult since result # * may be pointing to an object # * @@ -385,12 +385,12 @@ type Tcl_Event*{.final.} = object prc*: TTcl_EventProc nextPtr*: PTcl_Event - ClientData*: TObject #* ClientData is just pointer.* + ClientData*: TObject # ClientData is just pointer.* PTcl_Time* = ptr Tcl_Time Tcl_Time*{.final.} = object - sec*: int32 # * Seconds. * - usec*: int32 # * Microseconds. * + sec*: int32 # Seconds. * + usec*: int32 # Microseconds. * Tcl_TimerToken* = pointer PInteger* = ptr int @@ -749,7 +749,7 @@ proc Tcl_PushCallFrame*(interp: pTcl_Interp, callFramePtr: var Tcl_CallFrame, proc Tcl_PopCallFrame*(interp: pTcl_Interp){.cdecl, dynlib: dllName, importc.} proc Tcl_VarEval*(interp: pTcl_Interp): int{.cdecl, varargs, dynlib: dllName, importc.} - #* For TkConsole.c * + # For TkConsole.c * proc Tcl_RecordAndEval*(interp: pTcl_Interp, cmd: cstring, flags: int): int{. cdecl, dynlib: dllName, importc.} proc Tcl_GlobalEval*(interp: pTcl_Interp, command: cstring): int{.cdecl, diff --git a/llvm/llvm.h b/llvm/llvm.h new file mode 100755 index 000000000..a873b44eb --- /dev/null +++ b/llvm/llvm.h @@ -0,0 +1,1418 @@ +/* Core.h */ +/* Opaque types. */ + +/** + * The top-level container for all LLVM global data. See the LLVMContext class. + */ +typedef struct LLVMOpaqueContext *LLVMContextRef; + +/** + * The top-level container for all other LLVM Intermediate Representation (IR) + * objects. See the llvm::Module class. + */ +typedef struct LLVMOpaqueModule *LLVMModuleRef; + +/** + * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type + * class. + */ +typedef struct LLVMOpaqueType *LLVMTypeRef; + +/** + * When building recursive types using LLVMRefineType, LLVMTypeRef values may + * become invalid; use LLVMTypeHandleRef to resolve this problem. See the + * llvm::AbstractTypeHolder class. + */ +typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef; + +typedef struct LLVMOpaqueValue *LLVMValueRef; +typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; +typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; + +/* Used to provide a module to JIT or interpreter. + * See the llvm::ModuleProvider class. + */ +typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef; + +/* Used to provide a module to JIT or interpreter. + * See the llvm::MemoryBuffer class. + */ +typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef; + +/** See the llvm::PassManagerBase class. */ +typedef struct LLVMOpaquePassManager *LLVMPassManagerRef; + +/** + * Used to iterate through the uses of a Value, allowing access to all Values + * that use this Value. See the llvm::Use and llvm::value_use_iterator classes. + */ +typedef struct LLVMOpaqueUseIterator *LLVMUseIteratorRef; + +typedef enum { + LLVMZExtAttribute = 1<<0, + LLVMSExtAttribute = 1<<1, + LLVMNoReturnAttribute = 1<<2, + LLVMInRegAttribute = 1<<3, + LLVMStructRetAttribute = 1<<4, + LLVMNoUnwindAttribute = 1<<5, + LLVMNoAliasAttribute = 1<<6, + LLVMByValAttribute = 1<<7, + LLVMNestAttribute = 1<<8, + LLVMReadNoneAttribute = 1<<9, + LLVMReadOnlyAttribute = 1<<10, + LLVMNoInlineAttribute = 1<<11, + LLVMAlwaysInlineAttribute = 1<<12, + LLVMOptimizeForSizeAttribute = 1<<13, + LLVMStackProtectAttribute = 1<<14, + LLVMStackProtectReqAttribute = 1<<15, + LLVMNoCaptureAttribute = 1<<21, + LLVMNoRedZoneAttribute = 1<<22, + LLVMNoImplicitFloatAttribute = 1<<23, + LLVMNakedAttribute = 1<<24, + LLVMInlineHintAttribute = 1<<25 +} LLVMAttribute; + +typedef enum { + LLVMRet = 1, + LLVMBr = 2, + LLVMSwitch = 3, + LLVMInvoke = 4, + LLVMUnwind = 5, + LLVMUnreachable = 6, + LLVMAdd = 7, + LLVMFAdd = 8, + LLVMSub = 9, + LLVMFSub = 10, + LLVMMul = 11, + LLVMFMul = 12, + LLVMUDiv = 13, + LLVMSDiv = 14, + LLVMFDiv = 15, + LLVMURem = 16, + LLVMSRem = 17, + LLVMFRem = 18, + LLVMShl = 19, + LLVMLShr = 20, + LLVMAShr = 21, + LLVMAnd = 22, + LLVMOr = 23, + LLVMXor = 24, + LLVMMalloc = 25, + LLVMFree = 26, + LLVMAlloca = 27, + LLVMLoad = 28, + LLVMStore = 29, + LLVMGetElementPtr = 30, + LLVMTrunk = 31, + LLVMZExt = 32, + LLVMSExt = 33, + LLVMFPToUI = 34, + LLVMFPToSI = 35, + LLVMUIToFP = 36, + LLVMSIToFP = 37, + LLVMFPTrunc = 38, + LLVMFPExt = 39, + LLVMPtrToInt = 40, + LLVMIntToPtr = 41, + LLVMBitCast = 42, + LLVMICmp = 43, + LLVMFCmp = 44, + LLVMPHI = 45, + LLVMCall = 46, + LLVMSelect = 47, + LLVMVAArg = 50, + LLVMExtractElement = 51, + LLVMInsertElement = 52, + LLVMShuffleVector = 53, + LLVMExtractValue = 54, + LLVMInsertValue = 55 +} LLVMOpcode; + +typedef enum { + LLVMVoidTypeKind, /**< type with no size */ + LLVMFloatTypeKind, /**< 32 bit floating point type */ + LLVMDoubleTypeKind, /**< 64 bit floating point type */ + LLVMX86_FP80TypeKind, /**< 80 bit floating point type (X87) */ + LLVMFP128TypeKind, /**< 128 bit floating point type (112-bit mantissa)*/ + LLVMPPC_FP128TypeKind, /**< 128 bit floating point type (two 64-bits) */ + LLVMLabelTypeKind, /**< Labels */ + LLVMIntegerTypeKind, /**< Arbitrary bit width integers */ + LLVMFunctionTypeKind, /**< Functions */ + LLVMStructTypeKind, /**< Structures */ + LLVMArrayTypeKind, /**< Arrays */ + LLVMPointerTypeKind, /**< Pointers */ + LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */ + LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */ + LLVMMetadataTypeKind /**< Metadata */ +} LLVMTypeKind; + +typedef enum { + LLVMExternalLinkage, /**< Externally visible function */ + LLVMAvailableExternallyLinkage, + LLVMLinkOnceAnyLinkage, /**< Keep one copy of function when linking (inline)*/ + LLVMLinkOnceODRLinkage, /**< Same, but only replaced by something + equivalent. */ + LLVMWeakAnyLinkage, /**< Keep one copy of function when linking (weak) */ + LLVMWeakODRLinkage, /**< Same, but only replaced by something + equivalent. */ + LLVMAppendingLinkage, /**< Special purpose, only applies to global arrays */ + LLVMInternalLinkage, /**< Rename collisions when linking (static + functions) */ + LLVMPrivateLinkage, /**< Like Internal, but omit from symbol table */ + LLVMDLLImportLinkage, /**< Function to be imported from DLL */ + LLVMDLLExportLinkage, /**< Function to be accessible from DLL */ + LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */ + LLVMGhostLinkage, /**< Stand-in functions for streaming fns from + bitcode */ + LLVMCommonLinkage, /**< Tentative definitions */ + LLVMLinkerPrivateLinkage /**< Like Private, but linker removes. */ +} LLVMLinkage; + +typedef enum { + LLVMDefaultVisibility, /**< The GV is visible */ + LLVMHiddenVisibility, /**< The GV is hidden */ + LLVMProtectedVisibility /**< The GV is protected */ +} LLVMVisibility; + +typedef enum { + LLVMCCallConv = 0, + LLVMFastCallConv = 8, + LLVMColdCallConv = 9, + LLVMX86StdcallCallConv = 64, + LLVMX86FastcallCallConv = 65 +} LLVMCallConv; + +typedef enum { + LLVMIntEQ = 32, /**< equal */ + LLVMIntNE, /**< not equal */ + LLVMIntUGT, /**< unsigned greater than */ + LLVMIntUGE, /**< unsigned greater or equal */ + LLVMIntULT, /**< unsigned less than */ + LLVMIntULE, /**< unsigned less or equal */ + LLVMIntSGT, /**< signed greater than */ + LLVMIntSGE, /**< signed greater or equal */ + LLVMIntSLT, /**< signed less than */ + LLVMIntSLE /**< signed less or equal */ +} LLVMIntPredicate; + +typedef enum { + LLVMRealPredicateFalse, /**< Always false (always folded) */ + LLVMRealOEQ, /**< True if ordered and equal */ + LLVMRealOGT, /**< True if ordered and greater than */ + LLVMRealOGE, /**< True if ordered and greater than or equal */ + LLVMRealOLT, /**< True if ordered and less than */ + LLVMRealOLE, /**< True if ordered and less than or equal */ + LLVMRealONE, /**< True if ordered and operands are unequal */ + LLVMRealORD, /**< True if ordered (no nans) */ + LLVMRealUNO, /**< True if unordered: isnan(X) | isnan(Y) */ + LLVMRealUEQ, /**< True if unordered or equal */ + LLVMRealUGT, /**< True if unordered or greater than */ + LLVMRealUGE, /**< True if unordered, greater than, or equal */ + LLVMRealULT, /**< True if unordered or less than */ + LLVMRealULE, /**< True if unordered, less than, or equal */ + LLVMRealUNE, /**< True if unordered or not equal */ + LLVMRealPredicateTrue /**< Always true (always folded) */ +} LLVMRealPredicate; + + +/*===-- Error handling ----------------------------------------------------===*/ + +void LLVMDisposeMessage(char *Message); + + +/*===-- Modules -----------------------------------------------------------===*/ + +/* Create and destroy contexts. */ +LLVMContextRef LLVMContextCreate(void); +LLVMContextRef LLVMGetGlobalContext(void); +void LLVMContextDispose(LLVMContextRef C); + +/* Create and destroy modules. */ +/** See llvm::Module::Module. */ +LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); +LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, + LLVMContextRef C); + +/** See llvm::Module::~Module. */ +void LLVMDisposeModule(LLVMModuleRef M); + +/** Data layout. See Module::getDataLayout. */ +const char *LLVMGetDataLayout(LLVMModuleRef M); +void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple); + +/** Target triple. See Module::getTargetTriple. */ +const char *LLVMGetTarget(LLVMModuleRef M); +void LLVMSetTarget(LLVMModuleRef M, const char *Triple); + +/** See Module::addTypeName. */ +int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty); +void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name); +LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); + +/** See Module::dump. */ +void LLVMDumpModule(LLVMModuleRef M); + + +/*===-- Types -------------------------------------------------------------===*/ + +/* LLVM types conform to the following hierarchy: + * + * types: + * integer type + * real type + * function type + * sequence types: + * array type + * pointer type + * vector type + * void type + * label type + * opaque type + */ + +/** See llvm::LLVMTypeKind::getTypeID. */ +LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty); + +/** See llvm::LLVMType::getContext. */ +LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty); + +/* Operations on integer types */ +LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits); + +LLVMTypeRef LLVMInt1Type(void); +LLVMTypeRef LLVMInt8Type(void); +LLVMTypeRef LLVMInt16Type(void); +LLVMTypeRef LLVMInt32Type(void); +LLVMTypeRef LLVMInt64Type(void); +LLVMTypeRef LLVMIntType(unsigned NumBits); +unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); + +/* Operations on real types */ +LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C); + +LLVMTypeRef LLVMFloatType(void); +LLVMTypeRef LLVMDoubleType(void); +LLVMTypeRef LLVMX86FP80Type(void); +LLVMTypeRef LLVMFP128Type(void); +LLVMTypeRef LLVMPPCFP128Type(void); + +/* Operations on function types */ +LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, + LLVMTypeRef *ParamTypes, unsigned ParamCount, + int IsVarArg); +int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); +LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy); +unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); +void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); + +/* Operations on struct types */ +LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, + unsigned ElementCount, int Packed); +LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, + int Packed); +unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); +void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); +int LLVMIsPackedStruct(LLVMTypeRef StructTy); + +/* Operations on array, pointer, and vector types (sequence types) */ +LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); +LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace); +LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount); + +LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty); +unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); +unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy); +unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); + +/* Operations on other types */ +LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C); +LLVMTypeRef LLVMOpaqueTypeInContext(LLVMContextRef C); + +LLVMTypeRef LLVMVoidType(void); +LLVMTypeRef LLVMLabelType(void); +LLVMTypeRef LLVMOpaqueType(void); + +/* Operations on type handles */ +LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy); +void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy); +LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle); +void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle); + + + +/* Operations on all values */ +LLVMTypeRef LLVMTypeOf(LLVMValueRef Val); +const char *LLVMGetValueName(LLVMValueRef Val); +void LLVMSetValueName(LLVMValueRef Val, const char *Name); +void LLVMDumpValue(LLVMValueRef Val); +void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal); + +/* Conversion functions. Return the input value if it is an instance of the + specified class, otherwise NULL. See llvm::dyn_cast_or_null<>. */ +LLVMValueRef LLVMIsAArgument(LLVMValueRef Val); +LLVMValueRef LLVMIsABasicBlock(LLVMValueRef Val); +LLVMValueRef LLVMIsAInlineAsm(LLVMValueRef Val); +LLVMValueRef LLVMIsAUser(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstant(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantAggregateZero(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantArray(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantExpr(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantFP(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantInt(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantPointerNull(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantStruct(LLVMValueRef Val); +LLVMValueRef LLVMIsAConstantVector(LLVMValueRef Val); +LLVMValueRef LLVMIsAGlobalValue(LLVMValueRef Val); +LLVMValueRef LLVMIsAFunction(LLVMValueRef Val); +LLVMValueRef LLVMIsAGlobalAlias(LLVMValueRef Val); +LLVMValueRef LLVMIsAGlobalVariable(LLVMValueRef Val); +LLVMValueRef LLVMIsAUndefValue(LLVMValueRef Val); +LLVMValueRef LLVMIsAInstruction(LLVMValueRef Val); +LLVMValueRef LLVMIsABinaryOperator(LLVMValueRef Val); +LLVMValueRef LLVMIsACallInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAIntrinsicInst(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgInfoIntrinsic(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgDeclareInst(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgFuncStartInst(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgRegionEndInst(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgRegionStartInst(LLVMValueRef Val); +LLVMValueRef LLVMIsADbgStopPointInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAEHSelectorInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAMemIntrinsic(LLVMValueRef Val); +LLVMValueRef LLVMIsAMemCpyInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAMemMoveInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAMemSetInst(LLVMValueRef Val); +LLVMValueRef LLVMIsACmpInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFCmpInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAICmpInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAExtractElementInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAGetElementPtrInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAInsertElementInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAInsertValueInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAPHINode(LLVMValueRef Val); +LLVMValueRef LLVMIsASelectInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAShuffleVectorInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAStoreInst(LLVMValueRef Val); +LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Val); +LLVMValueRef LLVMIsABranchInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAInvokeInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAReturnInst(LLVMValueRef Val); +LLVMValueRef LLVMIsASwitchInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAUnreachableInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAUnwindInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAUnaryInstruction(LLVMValueRef Val); +LLVMValueRef LLVMIsAAllocationInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAAllocaInst(LLVMValueRef Val); +LLVMValueRef LLVMIsACastInst(LLVMValueRef Val); +LLVMValueRef LLVMIsABitCastInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFPExtInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFPToSIInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFPToUIInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFPTruncInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAIntToPtrInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAPtrToIntInst(LLVMValueRef Val); +LLVMValueRef LLVMIsASExtInst(LLVMValueRef Val); +LLVMValueRef LLVMIsASIToFPInst(LLVMValueRef Val); +LLVMValueRef LLVMIsATruncInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAUIToFPInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAZExtInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAExtractValueInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAFreeInst(LLVMValueRef Val); +LLVMValueRef LLVMIsALoadInst(LLVMValueRef Val); +LLVMValueRef LLVMIsAVAArgInst(LLVMValueRef Val); + + +/* Operations on Uses */ +LLVMUseIteratorRef LLVMGetFirstUse(LLVMValueRef Val); +LLVMUseIteratorRef LLVMGetNextUse(LLVMUseIteratorRef U); +LLVMValueRef LLVMGetUser(LLVMUseIteratorRef U); +LLVMValueRef LLVMGetUsedValue(LLVMUseIteratorRef U); + +/* Operations on Users */ +LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index); + +/* Operations on constants of any type */ +LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */ +LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty); /* only for int/vector */ +LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty); +int LLVMIsConstant(LLVMValueRef Val); +int LLVMIsNull(LLVMValueRef Val); +int LLVMIsUndef(LLVMValueRef Val); +LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty); + +/* Operations on scalar constants */ +LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, + int SignExtend); +LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text, + uint8_t Radix); +LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text, + unsigned SLen, uint8_t Radix); +LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N); +LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text); +LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text, + unsigned SLen); +unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal); +long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal); + + +/* Operations on composite constants */ +LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, + unsigned Length, int DontNullTerminate); +LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, + LLVMValueRef *ConstantVals, + unsigned Count, int Packed); + +LLVMValueRef LLVMConstString(const char *Str, unsigned Length, + int DontNullTerminate); +LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, + LLVMValueRef *ConstantVals, unsigned Length); +LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, + int Packed); +LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size); + +/* Constant expressions */ +LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal); +LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty); +LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty); +LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal); +LLVMValueRef LLVMConstFNeg(LLVMValueRef ConstantVal); +LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal); +LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstUDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstExactSDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFDiv(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstURem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstSRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFRem(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, + LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, + LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant); +LLVMValueRef LLVMConstGEP(LLVMValueRef ConstantVal, + LLVMValueRef *ConstantIndices, unsigned NumIndices); +LLVMValueRef LLVMConstInBoundsGEP(LLVMValueRef ConstantVal, + LLVMValueRef *ConstantIndices, + unsigned NumIndices); +LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal, + LLVMTypeRef ToType); +LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal, + LLVMTypeRef ToType); +LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, + LLVMTypeRef ToType); +LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, + LLVMTypeRef ToType); +LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType, + unsigned isSigned); +LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType); +LLVMValueRef LLVMConstSelect(LLVMValueRef ConstantCondition, + LLVMValueRef ConstantIfTrue, + LLVMValueRef ConstantIfFalse); +LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, + LLVMValueRef IndexConstant); +LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, + LLVMValueRef ElementValueConstant, + LLVMValueRef IndexConstant); +LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, + LLVMValueRef VectorBConstant, + LLVMValueRef MaskConstant); +LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, + unsigned NumIdx); +LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, + LLVMValueRef ElementValueConstant, + unsigned *IdxList, unsigned NumIdx); +LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, + const char *AsmString, const char *Constraints, + int HasSideEffects); + +/* Operations on global variables, functions, and aliases (globals) */ +LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); +int LLVMIsDeclaration(LLVMValueRef Global); +LLVMLinkage LLVMGetLinkage(LLVMValueRef Global); +void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage); +const char *LLVMGetSection(LLVMValueRef Global); +void LLVMSetSection(LLVMValueRef Global, const char *Section); +LLVMVisibility LLVMGetVisibility(LLVMValueRef Global); +void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz); +unsigned LLVMGetAlignment(LLVMValueRef Global); +void LLVMSetAlignment(LLVMValueRef Global, unsigned Bytes); + +/* Operations on global variables */ +LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name); +LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name); +LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M); +LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M); +LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar); +LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar); +void LLVMDeleteGlobal(LLVMValueRef GlobalVar); +LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar); +void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal); +int LLVMIsThreadLocal(LLVMValueRef GlobalVar); +void LLVMSetThreadLocal(LLVMValueRef GlobalVar, int IsThreadLocal); +int LLVMIsGlobalConstant(LLVMValueRef GlobalVar); +void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, int IsConstant); + +/* Operations on aliases */ +LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee, + const char *Name); + +/* Operations on functions */ +LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, + LLVMTypeRef FunctionTy); +LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name); +LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M); +LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M); +LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn); +LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn); +void LLVMDeleteFunction(LLVMValueRef Fn); +unsigned LLVMGetIntrinsicID(LLVMValueRef Fn); +unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn); +void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC); +const char *LLVMGetGC(LLVMValueRef Fn); +void LLVMSetGC(LLVMValueRef Fn, const char *Name); +void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA); +LLVMAttribute LLVMGetFunctionAttr(LLVMValueRef Fn); +void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA); + +/* Operations on parameters */ +unsigned LLVMCountParams(LLVMValueRef Fn); +void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params); +LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index); +LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst); +LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn); +LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn); +LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg); +LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg); +void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA); +void LLVMRemoveAttribute(LLVMValueRef Arg, LLVMAttribute PA); +LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg); +void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align); + +/* Operations on basic blocks */ +LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB); +int LLVMValueIsBasicBlock(LLVMValueRef Val); +LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val); +LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB); +unsigned LLVMCountBasicBlocks(LLVMValueRef Fn); +void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks); +LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn); +LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn); +LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB); +LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB); +LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn); + +LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, + LLVMValueRef Fn, + const char *Name); +LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, + LLVMBasicBlockRef BB, + const char *Name); + +LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name); +LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB, + const char *Name); +void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB); + +/* Operations on instructions */ +LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst); +LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB); +LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB); +LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); +LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst); + +/* Operations on call sites */ +void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); +unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr); +void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, LLVMAttribute); +void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index, + LLVMAttribute); +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, + unsigned align); + +/* Operations on call instructions (only) */ +int LLVMIsTailCall(LLVMValueRef CallInst); +void LLVMSetTailCall(LLVMValueRef CallInst, int IsTailCall); + +/* Operations on phi nodes */ +void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, + LLVMBasicBlockRef *IncomingBlocks, unsigned Count); +unsigned LLVMCountIncoming(LLVMValueRef PhiNode); +LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index); +LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index); + +/*===-- Instruction builders ----------------------------------------------===*/ + +/* An instruction builder represents a point within a basic block, and is the + * exclusive means of building instructions using the C interface. + */ + +LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C); +LLVMBuilderRef LLVMCreateBuilder(void); +void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, + LLVMValueRef Instr); +void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr); +void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block); +LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder); +void LLVMClearInsertionPosition(LLVMBuilderRef Builder); +void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr); +void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, + const char *Name); +void LLVMDisposeBuilder(LLVMBuilderRef Builder); + +/* Terminators */ +LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef); +LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V); +LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals, + unsigned N); +LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest); +LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If, + LLVMBasicBlockRef Then, LLVMBasicBlockRef Else); +LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V, + LLVMBasicBlockRef Else, unsigned NumCases); +LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn, + LLVMValueRef *Args, unsigned NumArgs, + LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, + const char *Name); +LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef); +LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); + +/* Add a case to the switch instruction */ +void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, + LLVMBasicBlockRef Dest); + +/* Arithmetic */ +LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); +LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name); +LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name); + +/* Memory */ +LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty, + LLVMValueRef Val, const char *Name); +LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty, + LLVMValueRef Val, const char *Name); +LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal); +LLVMValueRef LLVMBuildLoad(LLVMBuilderRef, LLVMValueRef PointerVal, + const char *Name); +LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr); +LLVMValueRef LLVMBuildGEP(LLVMBuilderRef B, LLVMValueRef Pointer, + LLVMValueRef *Indices, unsigned NumIndices, + const char *Name); +LLVMValueRef LLVMBuildInBoundsGEP(LLVMBuilderRef B, LLVMValueRef Pointer, + LLVMValueRef *Indices, unsigned NumIndices, + const char *Name); +LLVMValueRef LLVMBuildStructGEP(LLVMBuilderRef B, LLVMValueRef Pointer, + unsigned Idx, const char *Name); +LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, + const char *Name); +LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, + const char *Name); + +/* Casts */ +LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); +LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val, + LLVMTypeRef DestTy, const char *Name); + +/* Comparisons */ +LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op, + LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); +LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op, + LLVMValueRef LHS, LLVMValueRef RHS, + const char *Name); + +/* Miscellaneous instructions */ +LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name); +LLVMValueRef LLVMBuildCall(LLVMBuilderRef, LLVMValueRef Fn, + LLVMValueRef *Args, unsigned NumArgs, + const char *Name); +LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If, + LLVMValueRef Then, LLVMValueRef Else, + const char *Name); +LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty, + const char *Name); +LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal, + LLVMValueRef Index, const char *Name); +LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal, + LLVMValueRef EltVal, LLVMValueRef Index, + const char *Name); +LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, + LLVMValueRef V2, LLVMValueRef Mask, + const char *Name); +LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, + unsigned Index, const char *Name); +LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, + LLVMValueRef EltVal, unsigned Index, + const char *Name); + +LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val, + const char *Name); +LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val, + const char *Name); +LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, + LLVMValueRef RHS, const char *Name); + + +/*===-- Module providers --------------------------------------------------===*/ + +/* Encapsulates the module M in a module provider, taking ownership of the + * module. + * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider. + */ +LLVMModuleProviderRef +LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M); + +/* Destroys the module provider MP as well as the contained module. + * See the destructor llvm::ModuleProvider::~ModuleProvider. + */ +void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP); + + +/*===-- Memory buffers ----------------------------------------------------===*/ + +int LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, + LLVMMemoryBufferRef *OutMemBuf, + char **OutMessage); +int LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, + char **OutMessage); +void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); + + +/*===-- Pass Managers -----------------------------------------------------===*/ + +/** Constructs a new whole-module pass pipeline. This type of pipeline is + suitable for link-time optimization and whole-module transformations. + See llvm::PassManager::PassManager. */ +LLVMPassManagerRef LLVMCreatePassManager(void); + +/** Constructs a new function-by-function pass pipeline over the module + provider. It does not take ownership of the module provider. This type of + pipeline is suitable for code generation and JIT compilation tasks. + See llvm::FunctionPassManager::FunctionPassManager. */ +LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP); + +/** Initializes, executes on the provided module, and finalizes all of the + passes scheduled in the pass manager. Returns 1 if any of the passes + modified the module, 0 otherwise. See llvm::PassManager::run(Module&). */ +int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M); + +/** Initializes all of the function passes scheduled in the function pass + manager. Returns 1 if any of the passes modified the module, 0 otherwise. + See llvm::FunctionPassManager::doInitialization. */ +int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM); + +/** Executes all of the function passes scheduled in the function pass manager + on the provided function. Returns 1 if any of the passes modified the + function, false otherwise. + See llvm::FunctionPassManager::run(Function&). */ +int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F); + +/** Finalizes all of the function passes scheduled in in the function pass + manager. Returns 1 if any of the passes modified the module, 0 otherwise. + See llvm::FunctionPassManager::doFinalization. */ +int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM); + +/** Frees the memory of a pass pipeline. For function pipelines, does not free + the module provider. + See llvm::PassManagerBase::~PassManagerBase. */ +void LLVMDisposePassManager(LLVMPassManagerRef PM); + + + +/* Analysis.h */ + +typedef enum { + LLVMAbortProcessAction, /* verifier will print to stderr and abort() */ + LLVMPrintMessageAction, /* verifier will print to stderr and return 1 */ + LLVMReturnStatusAction /* verifier will just return 1 */ +} LLVMVerifierFailureAction; + + +/* Verifies that a module is valid, taking the specified action if not. + Optionally returns a human-readable description of any invalid constructs. + OutMessage must be disposed with LLVMDisposeMessage. */ +int LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action, + char **OutMessage); + +/* Verifies that a single function is valid, taking the specified action. Useful + for debugging. */ +int LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action); + +/* Open up a ghostview window that displays the CFG of the current function. + Useful for debugging. */ +void LLVMViewFunctionCFG(LLVMValueRef Fn); +void LLVMViewFunctionCFGOnly(LLVMValueRef Fn); + +/* BitReader.h */ + +/* Builds a module from the bitcode in the specified memory buffer, returning a + reference to the module via the OutModule parameter. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. */ +int LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, + LLVMModuleRef *OutModule, char **OutMessage); + +int LLVMParseBitcodeInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, + LLVMModuleRef *OutModule, char **OutMessage); + +/* Reads a module from the specified path, returning via the OutMP parameter + a module provider which performs lazy deserialization. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. */ +int LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf, + LLVMModuleProviderRef *OutMP, + char **OutMessage); + +int LLVMGetBitcodeModuleProviderInContext(LLVMContextRef ContextRef, + LLVMMemoryBufferRef MemBuf, + LLVMModuleProviderRef *OutMP, + char **OutMessage); + +/* BitWriter.h */ + +/*===-- Operations on modules ---------------------------------------------===*/ + +/* Writes a module to an open file descriptor. Returns 0 on success. + Closes the Handle. Use dup first if this is not what you want. */ +int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle); + +/* Writes a module to the specified path. Returns 0 on success. */ +int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path); + + +/* Target.h */ + +#define LLVMBigEndian 0 +#define LLVMLittleEndian 1 +typedef int LLVMByteOrdering; + +typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef; +typedef struct LLVMStructLayout *LLVMStructLayoutRef; + +/*===-- Target Data -------------------------------------------------------===*/ + +/** Creates target data from a target layout string. + See the constructor llvm::TargetData::TargetData. */ +LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep); + +/** Adds target data information to a pass manager. This does not take ownership + of the target data. + See the method llvm::PassManagerBase::add. */ +void LLVMAddTargetData(LLVMTargetDataRef, LLVMPassManagerRef); + +/** Converts target data to a target layout string. The string must be disposed + with LLVMDisposeMessage. + See the constructor llvm::TargetData::TargetData. */ +char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef); + +/** Returns the byte order of a target, either LLVMBigEndian or + LLVMLittleEndian. + See the method llvm::TargetData::isLittleEndian. */ +LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef); + +/** Returns the pointer size in bytes for a target. + See the method llvm::TargetData::getPointerSize. */ +unsigned LLVMPointerSize(LLVMTargetDataRef); + +/** Returns the integer type that is the same size as a pointer on a target. + See the method llvm::TargetData::getIntPtrType. */ +LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef); + +/** Computes the size of a type in bytes for a target. + See the method llvm::TargetData::getTypeSizeInBits. */ +unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the storage size of a type in bytes for a target. + See the method llvm::TargetData::getTypeStoreSize. */ +unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the ABI size of a type in bytes for a target. + See the method llvm::TargetData::getTypeAllocSize. */ +unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the ABI alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. */ +unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the call frame alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. */ +unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the preferred alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. */ +unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef); + +/** Computes the preferred alignment of a global variable in bytes for a target. + See the method llvm::TargetData::getPreferredAlignment. */ +unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef, + LLVMValueRef GlobalVar); + +/** Computes the structure element that contains the byte offset for a target. + See the method llvm::StructLayout::getElementContainingOffset. */ +unsigned LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy, + unsigned long long Offset); + +/** Computes the byte offset of the indexed struct element for a target. + See the method llvm::StructLayout::getElementContainingOffset. */ +unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy, + unsigned Element); + +/** Struct layouts are speculatively cached. If a TargetDataRef is alive when + types are being refined and removed, this method must be called whenever a + struct type is removed to avoid a dangling pointer in this cache. + See the method llvm::TargetData::InvalidateStructLayoutInfo. */ +void LLVMInvalidateStructLayout(LLVMTargetDataRef, LLVMTypeRef StructTy); + +/** Deallocates a TargetData. + See the destructor llvm::TargetData::~TargetData. */ +void LLVMDisposeTargetData(LLVMTargetDataRef); + + +/* ExecutionEngine.h */ +void LLVMLinkInJIT(void); +void LLVMLinkInInterpreter(void); + +typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; +typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; + +/*===-- Operations on generic values --------------------------------------===*/ + +LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, + unsigned long long N, + int IsSigned); + +LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P); + +LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N); + +unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef); + +unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal, + int IsSigned); + +void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal); + +double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal); + +void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal); + +/*===-- Operations on execution engines -----------------------------------===*/ + +int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE, + LLVMModuleProviderRef MP, + char **OutError); + +int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp, + LLVMModuleProviderRef MP, + char **OutError); + +int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT, + LLVMModuleProviderRef MP, + unsigned OptLevel, + char **OutError); + +void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE); + +void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE); + +void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE); + +int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F, + unsigned ArgC, const char * const *ArgV, + const char * const *EnvP); + +LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F, + unsigned NumArgs, + LLVMGenericValueRef *Args); + +void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F); + +void LLVMAddModuleProvider(LLVMExecutionEngineRef EE, LLVMModuleProviderRef MP); + +int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE, + LLVMModuleProviderRef MP, + LLVMModuleRef *OutMod, char **OutError); + +int LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, + LLVMValueRef *OutFn); + +LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE); + +void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, + void* Addr); + +void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global); + + +/* LinkTimeOptimizer.h */ +/// This provides a dummy type for pointers to the LTO object. +typedef void* llvm_lto_t; + +/// This provides a C-visible enumerator to manage status codes. +/// This should map exactly onto the C++ enumerator LTOStatus. +typedef enum llvm_lto_status { + LLVM_LTO_UNKNOWN, + LLVM_LTO_OPT_SUCCESS, + LLVM_LTO_READ_SUCCESS, + LLVM_LTO_READ_FAILURE, + LLVM_LTO_WRITE_FAILURE, + LLVM_LTO_NO_TARGET, + LLVM_LTO_NO_WORK, + LLVM_LTO_MODULE_MERGE_FAILURE, + LLVM_LTO_ASM_FAILURE, + + // Added C-specific error codes + LLVM_LTO_NULL_OBJECT +} llvm_lto_status_t; + +/// This provides C interface to initialize link time optimizer. This allows +/// linker to use dlopen() interface to dynamically load LinkTimeOptimizer. +/// extern "C" helps, because dlopen() interface uses name to find the symbol. +extern llvm_lto_t llvm_create_optimizer(void); +extern void llvm_destroy_optimizer(llvm_lto_t lto); + +extern llvm_lto_status_t llvm_read_object_file + (llvm_lto_t lto, const char* input_filename); +extern llvm_lto_status_t llvm_optimize_modules + (llvm_lto_t lto, const char* output_filename); + +/* lto.h */ + +#define LTO_API_VERSION 3 + +typedef enum { + LTO_SYMBOL_ALIGNMENT_MASK = 0x0000001F, /* log2 of alignment */ + LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0, + LTO_SYMBOL_PERMISSIONS_CODE = 0x000000A0, + LTO_SYMBOL_PERMISSIONS_DATA = 0x000000C0, + LTO_SYMBOL_PERMISSIONS_RODATA = 0x00000080, + LTO_SYMBOL_DEFINITION_MASK = 0x00000700, + LTO_SYMBOL_DEFINITION_REGULAR = 0x00000100, + LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200, + LTO_SYMBOL_DEFINITION_WEAK = 0x00000300, + LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400, + LTO_SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500, + LTO_SYMBOL_SCOPE_MASK = 0x00003800, + LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800, + LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000, + LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000, + LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800 +} lto_symbol_attributes; + +typedef enum { + LTO_DEBUG_MODEL_NONE = 0, + LTO_DEBUG_MODEL_DWARF = 1 +} lto_debug_model; + +typedef enum { + LTO_CODEGEN_PIC_MODEL_STATIC = 0, + LTO_CODEGEN_PIC_MODEL_DYNAMIC = 1, + LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2 +} lto_codegen_model; + + +/** opaque reference to a loaded object module */ +typedef struct LTOModule* lto_module_t; + +/** opaque reference to a code generator */ +typedef struct LTOCodeGenerator* lto_code_gen_t; + +/** + * Returns a printable string. + */ +extern const char* +lto_get_version(void); + + +/** + * Returns the last error string or NULL if last operation was sucessful. + */ +extern const char* +lto_get_error_message(void); + +/** + * Checks if a file is a loadable object file. + */ +extern bool +lto_module_is_object_file(const char* path); + + +/** + * Checks if a file is a loadable object compiled for requested target. + */ +extern bool +lto_module_is_object_file_for_target(const char* path, + const char* target_triple_prefix); + + +/** + * Checks if a buffer is a loadable object file. + */ +extern bool +lto_module_is_object_file_in_memory(const void* mem, size_t length); + + +/** + * Checks if a buffer is a loadable object compiled for requested target. + */ +extern bool +lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length, + const char* target_triple_prefix); + + +/** + * Loads an object file from disk. + * Returns NULL on error (check lto_get_error_message() for details). + */ +extern lto_module_t +lto_module_create(const char* path); + + +/** + * Loads an object file from memory. + * Returns NULL on error (check lto_get_error_message() for details). + */ +extern lto_module_t +lto_module_create_from_memory(const void* mem, size_t length); + + +/** + * Frees all memory internally allocated by the module. + * Upon return the lto_module_t is no longer valid. + */ +extern void +lto_module_dispose(lto_module_t mod); + + +/** + * Returns triple string which the object module was compiled under. + */ +extern const char* +lto_module_get_target_triple(lto_module_t mod); + + +/** + * Returns the number of symbols in the object module. + */ +extern unsigned int +lto_module_get_num_symbols(lto_module_t mod); + + +/** + * Returns the name of the ith symbol in the object module. + */ +extern const char* +lto_module_get_symbol_name(lto_module_t mod, unsigned int index); + + +/** + * Returns the attributes of the ith symbol in the object module. + */ +extern lto_symbol_attributes +lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index); + + +/** + * Instantiates a code generator. + * Returns NULL on error (check lto_get_error_message() for details). + */ +extern lto_code_gen_t +lto_codegen_create(void); + + +/** + * Frees all code generator and all memory it internally allocated. + * Upon return the lto_code_gen_t is no longer valid. + */ +extern void +lto_codegen_dispose(lto_code_gen_t); + + + +/** + * Add an object module to the set of modules for which code will be generated. + * Returns true on error (check lto_get_error_message() for details). + */ +extern bool +lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod); + + + +/** + * Sets if debug info should be generated. + * Returns true on error (check lto_get_error_message() for details). + */ +extern bool +lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model); + + +/** + * Sets which PIC code model to generated. + * Returns true on error (check lto_get_error_message() for details). + */ +extern bool +lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model); + + +/** + * Sets the location of the "gcc" to run. If not set, libLTO will search for + * "gcc" on the path. + */ +extern void +lto_codegen_set_gcc_path(lto_code_gen_t cg, const char* path); + + +/** + * Sets the location of the assembler tool to run. If not set, libLTO + * will use gcc to invoke the assembler. + */ +extern void +lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path); + + +/** + * Adds to a list of all global symbols that must exist in the final + * generated code. If a function is not listed, it might be + * inlined into every usage and optimized away. + */ +extern void +lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol); + + +/** + * Writes a new object file at the specified path that contains the + * merged contents of all modules added so far. + * Returns true on error (check lto_get_error_message() for details). + */ +extern bool +lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path); + + +/** + * Generates code for all added modules into one native object file. + * On sucess returns a pointer to a generated mach-o/ELF buffer and + * length set to the buffer size. The buffer is owned by the + * lto_code_gen_t and will be freed when lto_codegen_dispose() + * is called, or lto_codegen_compile() is called again. + * On failure, returns NULL (check lto_get_error_message() for details). + */ +extern const void* +lto_codegen_compile(lto_code_gen_t cg, size_t* length); + + +/** + * Sets options to help debug codegen bugs. + */ +extern void +lto_codegen_debug_options(lto_code_gen_t cg, const char *); + + + + diff --git a/llvm/llvm.nim b/llvm/llvm.nim new file mode 100644 index 000000000..d010457f8 --- /dev/null +++ b/llvm/llvm.nim @@ -0,0 +1,1452 @@ +const + libname* = "llvm.dll" #Setup as you need + +type + OpaqueContext {.pure.} = object + OpaqueModule {.pure.} = object + TOpaqueType {.pure.} = object + OpaqueTypeHandle {.pure.} = object + OpaqueValue {.pure.} = object + OpaqueBasicBlock {.pure.} = object + OpaqueBuilder {.pure.} = object + OpaqueModuleProvider {.pure.} = object + OpaqueMemoryBuffer {.pure.} = object + OpaquePassManager {.pure.} = object + OpaqueUseIterator {.pure.} = object + + ContextRef* = OpaqueContext + ModuleRef* = OpaqueModule + TypeRef* = TOpaqueType + TypeHandleRef* = OpaqueTypeHandle + ValueRef* = OpaqueValue + BasicBlockRef* = OpaqueBasicBlock + BuilderRef* = OpaqueBuilder + ModuleProviderRef* = OpaqueModuleProvider + MemoryBufferRef* = OpaqueMemoryBuffer + PassManagerRef* = OpaquePassManager + UseIteratorRef* = OpaqueUseIterator + Attribute* = enum + ZExtAttribute = 1 shl 0, SExtAttribute = 1 shl 1, + NoReturnAttribute = 1 shl 2, InRegAttribute = 1 shl 3, + StructRetAttribute = 1 shl 4, NoUnwindAttribute = 1 shl 5, + NoAliasAttribute = 1 shl 6, ByValAttribute = 1 shl 7, + NestAttribute = 1 shl 8, ReadNoneAttribute = 1 shl 9, + ReadOnlyAttribute = 1 shl 10, NoInlineAttribute = 1 shl 11, + AlwaysInlineAttribute = 1 shl 12, OptimizeForSizeAttribute = 1 shl 13, + StackProtectAttribute = 1 shl 14, StackProtectReqAttribute = 1 shl 15, + NoCaptureAttribute = 1 shl 21, NoRedZoneAttribute = 1 shl 22, + NoImplicitFloatAttribute = 1 shl 23, NakedAttribute = 1 shl 24, + InlineHintAttribute = 1 shl 25 + Opcode* = enum + opcRet = 1, opcBr = 2, opcSwitch = 3, opcInvoke = 4, opcUnwind = 5, + opcUnreachable = 6, + opcAdd = 7, opcFAdd = 8, opcSub = 9, opcFSub = 10, opcMul = 11, + opcFMul = 12, opcUDiv = 13, + opcSDiv = 14, opcFDiv = 15, opcURem = 16, opcSRem = 17, opcFRem = 18, + opcShl = 19, + opcLShr = 20, opcAShr = 21, opcAnd = 22, opcOr = 23, opcXor = 24, + opcMalloc = 25, opcFree = 26, opcAlloca = 27, + opcLoad = 28, opcStore = 29, + opcGetElementPtr = 30, opcTrunk = 31, opcZExt = 32, opcSExt = 33, + opcFPToUI = 34, opcFPToSI = 35, opcUIToFP = 36, opcSIToFP = 37, + opcFPTrunc = 38, opcFPExt = 39, opcPtrToInt = 40, opcIntToPtr = 41, + opcBitCast = 42, opcICmp = 43, + opcFCmp = 44, opcPHI = 45, opcCall = 46, opcSelect = 47, opcVAArg = 50, + opcExtractElement = 51, opcInsertElement = 52, opcShuffleVector = 53, + opcExtractValue = 54, opcInsertValue = 55 + TypeKind* = enum + VoidTypeKind, FloatTypeKind, DoubleTypeKind, X86_FP80TypeKind, + FP128TypeKind, PPC_FP128TypeKind, LabelTypeKind, IntegerTypeKind, + FunctionTypeKind, StructTypeKind, ArrayTypeKind, PointerTypeKind, + OpaqueTypeKind, VectorTypeKind, MetadataTypeKind + TLinkage* = enum + ExternalLinkage, ## Externally visible function + AvailableExternallyLinkage, ## Keep one copy of function when linking (inline) + LinkOnceAnyLinkage, ## Same, but only replaced by something equivalent. + LinkOnceODRLinkage, ## Keep one copy of function when linking (weak) + WeakAnyLinkage, ## Same, but only replaced by something equivalent. + WeakODRLinkage, ## Special purpose, only applies to global arrays + AppendingLinkage, ## Rename collisions when linking (static functions) + InternalLinkage, ## + PrivateLinkage, ## Like Internal, but omit from symbol table + DLLImportLinkage, ## Function to be imported from DLL + DLLExportLinkage, ## Function to be accessible from DLL + ExternalWeakLinkage, ## ExternalWeak linkage description + GhostLinkage, ## Stand-in functions for streaming fns from bitcode + CommonLinkage, ## Tentative definitions + LinkerPrivateLinkage ## Like Private, but linker removes. + TVisibility* = enum + DefaultVisibility, + HiddenVisibility, + ProtectedVisibility + TCallConv* = enum + CCallConv = 0, FastCallConv = 8, ColdCallConv = 9, X86StdcallCallConv = 64, + X86FastcallCallConv = 65 + IntPredicate* = enum + IntEQ = 32, IntNE, IntUGT, IntUGE, IntULT, IntULE, IntSGT, IntSGE, IntSLT, + IntSLE + RealPredicate* = enum + RealPredicateFalse, RealOEQ, RealOGT, RealOGE, RealOLT, RealOLE, RealONE, + RealORD, RealUNO, RealUEQ, RealUGT, RealUGE, RealULT, RealULE, RealUNE, + RealPredicateTrue + +#===-- Error handling ----------------------------------------------------=== + +proc DisposeMessage*(Message: cstring){.cdecl, dynlib: libname, + importc: "LLVMDisposeMessage".} + +#===-- Modules -----------------------------------------------------------=== +# Create and destroy contexts. +proc ContextCreate*(): ContextRef{.cdecl, dynlib: libname, + importc: "LLVMContextCreate".} +proc GetGlobalContext*(): ContextRef{.cdecl, dynlib: libname, + importc: "LLVMGetGlobalContext".} +proc ContextDispose*(C: ContextRef){.cdecl, dynlib: libname, + importc: "LLVMContextDispose".} + # Create and destroy modules. + # See llvm::Module::Module. +proc ModuleCreateWithName*(ModuleID: cstring): ModuleRef{.cdecl, + dynlib: libname, importc: "LLVMModuleCreateWithName".} +proc ModuleCreateWithNameInContext*(ModuleID: cstring, C: ContextRef): ModuleRef{. + cdecl, dynlib: libname, importc: "LLVMModuleCreateWithNameInContext".} + # See llvm::Module::~Module. +proc DisposeModule*(M: ModuleRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeModule".} + # Data layout. See Module::getDataLayout. +proc GetDataLayout*(M: ModuleRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetDataLayout".} +proc SetDataLayout*(M: ModuleRef, Triple: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetDataLayout".} + # Target triple. See Module::getTargetTriple. +proc GetTarget*(M: ModuleRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetTarget".} +proc SetTarget*(M: ModuleRef, Triple: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetTarget".} + # See Module::addTypeName. +proc AddTypeName*(M: ModuleRef, Name: cstring, Ty: TypeRef): int32{.cdecl, + dynlib: libname, importc: "LLVMAddTypeName".} +proc DeleteTypeName*(M: ModuleRef, Name: cstring){.cdecl, dynlib: libname, + importc: "LLVMDeleteTypeName".} +proc GetTypeByName*(M: ModuleRef, Name: cstring): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMGetTypeByName".} + # See Module::dump. +proc DumpModule*(M: ModuleRef){.cdecl, dynlib: libname, + importc: "LLVMDumpModule".} + #===-- Types -------------------------------------------------------------=== + # LLVM types conform to the following hierarchy: + # * + # * types: + # * integer type + # * real type + # * function type + # * sequence types: + # * array type + # * pointer type + # * vector type + # * void type + # * label type + # * opaque type + # + # See llvm::LLVMTypeKind::getTypeID. +proc GetTypeKind*(Ty: TypeRef): TypeKind{.cdecl, dynlib: libname, + importc: "LLVMGetTypeKind".} + # See llvm::LLVMType::getContext. +proc GetTypeContext*(Ty: TypeRef): ContextRef{.cdecl, dynlib: libname, + importc: "LLVMGetTypeContext".} + # Operations on integer types +proc Int1TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt1TypeInContext".} +proc Int8TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt8TypeInContext".} +proc Int16TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt16TypeInContext".} +proc Int32TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt32TypeInContext".} +proc Int64TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt64TypeInContext".} +proc IntTypeInContext*(C: ContextRef, NumBits: int32): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMIntTypeInContext".} +proc Int1Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMInt1Type".} +proc Int8Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMInt8Type".} +proc Int16Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMInt16Type".} +proc Int32Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMInt32Type".} +proc Int64Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMInt64Type".} +proc IntType*(NumBits: int32): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMIntType".} +proc GetIntTypeWidth*(IntegerTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetIntTypeWidth".} + # Operations on real types +proc FloatTypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMFloatTypeInContext".} +proc DoubleTypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMDoubleTypeInContext".} +proc X86FP80TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMX86FP80TypeInContext".} +proc FP128TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMFP128TypeInContext".} +proc PPCFP128TypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMPPCFP128TypeInContext".} +proc FloatType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMFloatType".} +proc DoubleType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMDoubleType".} +proc X86FP80Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMX86FP80Type".} +proc FP128Type*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMFP128Type".} +proc PPCFP128Type*(): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMPPCFP128Type".} + # Operations on function types +proc FunctionType*(ReturnType: TypeRef, ParamTypes: ptr TypeRef, + ParamCount: int32, IsVarArg: int32): TypeRef {. + cdecl, dynlib: libname, importc: "LLVMFunctionType".} +proc IsFunctionVarArg*(FunctionTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsFunctionVarArg".} +proc GetReturnType*(FunctionTy: TypeRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMGetReturnType".} +proc CountParamTypes*(FunctionTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMCountParamTypes".} +proc GetParamTypes*(FunctionTy: TypeRef, Dest: ptr TypeRef){.cdecl, + dynlib: libname, importc: "LLVMGetParamTypes".} + # Operations on struct types +proc StructTypeInContext*(C: ContextRef, ElementTypes: ptr TypeRef, + ElementCount: int32, isPacked: int32): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMStructTypeInContext".} +proc StructType*(ElementTypes: ptr TypeRef, ElementCount: int32, isPacked: int32): TypeRef{. + cdecl, dynlib: libname, importc: "LLVMStructType".} +proc CountStructElementTypes*(StructTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMCountStructElementTypes".} +proc GetStructElementTypes*(StructTy: TypeRef, Dest: ptr TypeRef){.cdecl, + dynlib: libname, importc: "LLVMGetStructElementTypes".} +proc IsPackedStruct*(StructTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsPackedStruct".} + # Operations on array, pointer, and vector types (sequence types) +proc ArrayType*(ElementType: TypeRef, ElementCount: int32): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMArrayType".} +proc PointerType*(ElementType: TypeRef, AddressSpace: int32): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMPointerType".} +proc VectorType*(ElementType: TypeRef, ElementCount: int32): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMVectorType".} +proc GetElementType*(Ty: TypeRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMGetElementType".} +proc GetArrayLength*(ArrayTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetArrayLength".} +proc GetPointerAddressSpace*(PointerTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetPointerAddressSpace".} +proc GetVectorSize*(VectorTy: TypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetVectorSize".} + # Operations on other types +proc VoidTypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMVoidTypeInContext".} +proc LabelTypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMLabelTypeInContext".} +proc OpaqueTypeInContext*(C: ContextRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMOpaqueTypeInContext".} +proc VoidType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMVoidType".} +proc LabelType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMLabelType".} +proc OpaqueType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMOpaqueType".} + # Operations on type handles +proc CreateTypeHandle*(PotentiallyAbstractTy: TypeRef): TypeHandleRef{.cdecl, + dynlib: libname, importc: "LLVMCreateTypeHandle".} +proc RefineType*(AbstractTy: TypeRef, ConcreteTy: TypeRef){.cdecl, + dynlib: libname, importc: "LLVMRefineType".} +proc ResolveTypeHandle*(TypeHandle: TypeHandleRef): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMResolveTypeHandle".} +proc DisposeTypeHandle*(TypeHandle: TypeHandleRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeTypeHandle".} + # Operations on all values +proc TypeOf*(Val: ValueRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMTypeOf".} +proc GetValueName*(Val: ValueRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetValueName".} +proc SetValueName*(Val: ValueRef, Name: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetValueName".} +proc DumpValue*(Val: ValueRef){.cdecl, dynlib: libname, importc: "LLVMDumpValue".} +proc ReplaceAllUsesWith*(OldVal: ValueRef, NewVal: ValueRef){.cdecl, + dynlib: libname, importc: "LLVMReplaceAllUsesWith".} + # Conversion functions. Return the input value if it is an instance of the + # specified class, otherwise NULL. See llvm::dyn_cast_or_null<>. +proc IsAArgument*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAArgument".} +proc IsABasicBlock*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsABasicBlock".} +proc IsAInlineAsm*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInlineAsm".} +proc IsAUser*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUser".} +proc IsAConstant*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstant".} +proc IsAConstantAggregateZero*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantAggregateZero".} +proc IsAConstantArray*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantArray".} +proc IsAConstantExpr*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantExpr".} +proc IsAConstantFP*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantFP".} +proc IsAConstantInt*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantInt".} +proc IsAConstantPointerNull*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantPointerNull".} +proc IsAConstantStruct*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantStruct".} +proc IsAConstantVector*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstantVector".} +proc IsAGlobalValue*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAGlobalValue".} +proc IsAFunction*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFunction".} +proc IsAGlobalAlias*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAGlobalAlias".} +proc IsAGlobalVariable*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAGlobalVariable".} +proc IsAUndefValue*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUndefValue".} +proc IsAInstruction*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInstruction".} +proc IsABinaryOperator*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsABinaryOperator".} +proc IsACallInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACallInst".} +proc IsAIntrinsicInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAIntrinsicInst".} +proc IsADbgInfoIntrinsic*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgInfoIntrinsic".} +proc IsADbgDeclareInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgDeclareInst".} +proc IsADbgFuncStartInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgFuncStartInst".} +proc IsADbgRegionEndInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgRegionEndInst".} +proc IsADbgRegionStartInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgRegionStartInst".} +proc IsADbgStopPointInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsADbgStopPointInst".} +proc IsAEHSelectorInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAEHSelectorInst".} +proc IsAMemIntrinsic*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAMemIntrinsic".} +proc IsAMemCpyInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAMemCpyInst".} +proc IsAMemMoveInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAMemMoveInst".} +proc IsAMemSetInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAMemSetInst".} +proc IsACmpInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACmpInst".} +proc IsAFCmpInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFCmpInst".} +proc IsAICmpInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAICmpInst".} +proc IsAExtractElementInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAExtractElementInst".} +proc IsAGetElementPtrInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAGetElementPtrInst".} +proc IsAInsertElementInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInsertElementInst".} +proc IsAInsertValueInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInsertValueInst".} +proc IsAPHINode*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAPHINode".} +proc IsASelectInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsASelectInst".} +proc IsAShuffleVectorInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAShuffleVectorInst".} +proc IsAStoreInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAStoreInst".} +proc IsATerminatorInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsATerminatorInst".} +proc IsABranchInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsABranchInst".} +proc IsAInvokeInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInvokeInst".} +proc IsAReturnInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAReturnInst".} +proc IsASwitchInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsASwitchInst".} +proc IsAUnreachableInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUnreachableInst".} +proc IsAUnwindInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUnwindInst".} +proc IsAUnaryInstruction*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUnaryInstruction".} +proc IsAAllocationInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAAllocationInst".} +proc IsAAllocaInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAAllocaInst".} +proc IsACastInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACastInst".} +proc IsABitCastInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsABitCastInst".} +proc IsAFPExtInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFPExtInst".} +proc IsAFPToSIInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFPToSIInst".} +proc IsAFPToUIInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFPToUIInst".} +proc IsAFPTruncInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFPTruncInst".} +proc IsAIntToPtrInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAIntToPtrInst".} +proc IsAPtrToIntInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAPtrToIntInst".} +proc IsASExtInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsASExtInst".} +proc IsASIToFPInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsASIToFPInst".} +proc IsATruncInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsATruncInst".} +proc IsAUIToFPInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUIToFPInst".} +proc IsAZExtInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAZExtInst".} +proc IsAExtractValueInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAExtractValueInst".} +proc IsAFreeInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFreeInst".} +proc IsALoadInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsALoadInst".} +proc IsAVAArgInst*(Val: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAVAArgInst".} + # Operations on Uses +proc GetFirstUse*(Val: ValueRef): UseIteratorRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstUse".} +proc GetNextUse*(U: UseIteratorRef): UseIteratorRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextUse".} +proc GetUser*(U: UseIteratorRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetUser".} +proc GetUsedValue*(U: UseIteratorRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetUsedValue".} + # Operations on Users +proc GetOperand*(Val: ValueRef, Index: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetOperand".} + # Operations on constants of any type +proc ConstNull*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstNull".} + # all zeroes +proc ConstAllOnes*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstAllOnes".} + # only for int/vector +proc GetUndef*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetUndef".} +proc IsConstant*(Val: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsConstant".} +proc IsNull*(Val: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsNull".} +proc IsUndef*(Val: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsUndef".} +proc ConstPointerNull*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstPointerNull".} + # Operations on scalar constants +proc ConstInt*(IntTy: TypeRef, N: int64, SignExtend: int32): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstInt".} +proc ConstIntOfString*(IntTy: TypeRef, Text: cstring, Radix: byte): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstIntOfString".} +proc ConstIntOfStringAndSize*(IntTy: TypeRef, Text: cstring, SLen: int32, + Radix: byte): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstIntOfStringAndSize".} +proc ConstReal*(RealTy: TypeRef, N: float64): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstReal".} +proc ConstRealOfString*(RealTy: TypeRef, Text: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstRealOfString".} +proc ConstRealOfStringAndSize*(RealTy: TypeRef, Text: cstring, SLen: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstRealOfStringAndSize".} +proc ConstIntGetZExtValue*(ConstantVal: ValueRef): int64{.cdecl, + dynlib: libname, importc: "LLVMConstIntGetZExtValue".} +proc ConstIntGetSExtValue*(ConstantVal: ValueRef): int64{.cdecl, + dynlib: libname, importc: "LLVMConstIntGetSExtValue".} + # Operations on composite constants +proc ConstStringInContext*(C: ContextRef, Str: cstring, len: int32, + DontNullTerminate: int32): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstStringInContext".} +proc ConstStructInContext*(C: ContextRef, ConstantVals: ptr ValueRef, + Count: int32, + isPacked: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstStructInContext".} +proc ConstString*(Str: cstring, len: int32, DontNullTerminate: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstString".} +proc ConstArray*(ElementTy: TypeRef, ConstantVals: ptr ValueRef, len: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstArray".} +proc ConstStruct*(ConstantVals: ptr ValueRef, Count: int32, isPacked: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstStruct".} +proc ConstVector*(ScalarConstantVals: ptr ValueRef, Size: int32): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstVector".} + # Constant expressions +proc GetConstOpcode*(ConstantVal: ValueRef): Opcode{.cdecl, dynlib: libname, + importc: "LLVMGetConstOpcode".} +proc AlignOf*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMAlignOf".} +proc SizeOf*(Ty: TypeRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMSizeOf".} +proc ConstNeg*(ConstantVal: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstNeg".} +proc ConstFNeg*(ConstantVal: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstFNeg".} +proc ConstNot*(ConstantVal: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstNot".} +proc ConstAdd*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstAdd".} +proc ConstNSWAdd*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstNSWAdd".} +proc ConstFAdd*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFAdd".} +proc ConstSub*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSub".} +proc ConstFSub*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFSub".} +proc ConstMul*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstMul".} +proc ConstFMul*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFMul".} +proc ConstUDiv*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstUDiv".} +proc ConstSDiv*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSDiv".} +proc ConstExactSDiv*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstExactSDiv".} +proc ConstFDiv*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFDiv".} +proc ConstURem*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstURem".} +proc ConstSRem*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSRem".} +proc ConstFRem*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFRem".} +proc ConstAnd*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstAnd".} +proc ConstOr*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstOr".} +proc ConstXor*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstXor".} +proc ConstICmp*(Predicate: IntPredicate, LHSConstant: ValueRef, + RHSConstant: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstICmp".} +proc ConstFCmp*(Predicate: RealPredicate, LHSConstant: ValueRef, + RHSConstant: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstFCmp".} +proc ConstShl*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstShl".} +proc ConstLShr*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstLShr".} +proc ConstAShr*(LHSConstant: ValueRef, RHSConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstAShr".} +proc ConstGEP*(ConstantVal: ValueRef, ConstantIndices: ptr ValueRef, + NumIndices: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstGEP".} +proc ConstInBoundsGEP*(ConstantVal: ValueRef, ConstantIndices: ptr ValueRef, + NumIndices: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstInBoundsGEP".} +proc ConstTrunc*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstTrunc".} +proc ConstSExt*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSExt".} +proc ConstZExt*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstZExt".} +proc ConstFPTrunc*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFPTrunc".} +proc ConstFPExt*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFPExt".} +proc ConstUIToFP*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstUIToFP".} +proc ConstSIToFP*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSIToFP".} +proc ConstFPToUI*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFPToUI".} +proc ConstFPToSI*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFPToSI".} +proc ConstPtrToInt*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstPtrToInt".} +proc ConstIntToPtr*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstIntToPtr".} +proc ConstBitCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstBitCast".} +proc ConstZExtOrBitCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstZExtOrBitCast".} +proc ConstSExtOrBitCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSExtOrBitCast".} +proc ConstTruncOrBitCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstTruncOrBitCast".} +proc ConstPointerCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstPointerCast".} +proc ConstIntCast*(ConstantVal: ValueRef, ToType: TypeRef, isSigned: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstIntCast".} +proc ConstFPCast*(ConstantVal: ValueRef, ToType: TypeRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFPCast".} +proc ConstSelect*(ConstantCondition: ValueRef, ConstantIfTrue: ValueRef, + ConstantIfFalse: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstSelect".} +proc ConstExtractElement*(VectorConstant: ValueRef, IndexConstant: ValueRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstExtractElement".} +proc ConstInsertElement*(VectorConstant: ValueRef, + ElementValueConstant: ValueRef, IndexConstant: ValueRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstInsertElement".} +proc ConstShuffleVector*(VectorAConstant: ValueRef, VectorBConstant: ValueRef, + MaskConstant: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstShuffleVector".} +proc ConstExtractValue*(AggConstant: ValueRef, IdxList: ptr int32, NumIdx: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstExtractValue".} +proc ConstInsertValue*(AggConstant: ValueRef, ElementValueConstant: ValueRef, + IdxList: ptr int32, NumIdx: int32): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstInsertValue".} +proc ConstInlineAsm*(Ty: TypeRef, AsmString: cstring, Constraints: cstring, + HasSideEffects: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstInlineAsm".} + # Operations on global variables, functions, and aliases (globals) +proc GetGlobalParent*(Global: ValueRef): ModuleRef{.cdecl, dynlib: libname, + importc: "LLVMGetGlobalParent".} +proc IsDeclaration*(Global: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsDeclaration".} +proc GetLinkage*(Global: ValueRef): TLinkage{.cdecl, dynlib: libname, + importc: "LLVMGetLinkage".} +proc SetLinkage*(Global: ValueRef, Linkage: TLinkage){.cdecl, dynlib: libname, + importc: "LLVMSetLinkage".} +proc GetSection*(Global: ValueRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetSection".} +proc SetSection*(Global: ValueRef, Section: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetSection".} +proc GetVisibility*(Global: ValueRef): TVisibility{.cdecl, dynlib: libname, + importc: "LLVMGetVisibility".} +proc SetVisibility*(Global: ValueRef, Viz: TVisibility){.cdecl, dynlib: libname, + importc: "LLVMSetVisibility".} +proc GetAlignment*(Global: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetAlignment".} +proc SetAlignment*(Global: ValueRef, Bytes: int32){.cdecl, dynlib: libname, + importc: "LLVMSetAlignment".} + # Operations on global variables +proc AddGlobal*(M: ModuleRef, Ty: TypeRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMAddGlobal".} +proc GetNamedGlobal*(M: ModuleRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNamedGlobal".} +proc GetFirstGlobal*(M: ModuleRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstGlobal".} +proc GetLastGlobal*(M: ModuleRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastGlobal".} +proc GetNextGlobal*(GlobalVar: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextGlobal".} +proc GetPreviousGlobal*(GlobalVar: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetPreviousGlobal".} +proc DeleteGlobal*(GlobalVar: ValueRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteGlobal".} +proc GetInitializer*(GlobalVar: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetInitializer".} +proc SetInitializer*(GlobalVar: ValueRef, ConstantVal: ValueRef){.cdecl, + dynlib: libname, importc: "LLVMSetInitializer".} +proc IsThreadLocal*(GlobalVar: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsThreadLocal".} +proc SetThreadLocal*(GlobalVar: ValueRef, IsThreadLocal: int32){.cdecl, + dynlib: libname, importc: "LLVMSetThreadLocal".} +proc IsGlobalConstant*(GlobalVar: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsGlobalConstant".} +proc SetGlobalConstant*(GlobalVar: ValueRef, IsConstant: int32){.cdecl, + dynlib: libname, importc: "LLVMSetGlobalConstant".} + # Operations on aliases +proc AddAlias*(M: ModuleRef, Ty: TypeRef, Aliasee: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMAddAlias".} + # Operations on functions +proc AddFunction*(M: ModuleRef, Name: cstring, FunctionTy: TypeRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMAddFunction".} +proc GetNamedFunction*(M: ModuleRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNamedFunction".} +proc GetFirstFunction*(M: ModuleRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstFunction".} +proc GetLastFunction*(M: ModuleRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastFunction".} +proc GetNextFunction*(Fn: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextFunction".} +proc GetPreviousFunction*(Fn: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetPreviousFunction".} +proc DeleteFunction*(Fn: ValueRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteFunction".} +proc GetIntrinsicID*(Fn: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetIntrinsicID".} +proc GetFunctionCallConv*(Fn: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetFunctionCallConv".} +proc SetFunctionCallConv*(Fn: ValueRef, CC: int32){.cdecl, dynlib: libname, + importc: "LLVMSetFunctionCallConv".} +proc GetGC*(Fn: ValueRef): cstring{.cdecl, dynlib: libname, importc: "LLVMGetGC".} +proc SetGC*(Fn: ValueRef, Name: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetGC".} +proc AddFunctionAttr*(Fn: ValueRef, PA: Attribute){.cdecl, dynlib: libname, + importc: "LLVMAddFunctionAttr".} +proc GetFunctionAttr*(Fn: ValueRef): Attribute{.cdecl, dynlib: libname, + importc: "LLVMGetFunctionAttr".} +proc RemoveFunctionAttr*(Fn: ValueRef, PA: Attribute){.cdecl, dynlib: libname, + importc: "LLVMRemoveFunctionAttr".} + # Operations on parameters +proc CountParams*(Fn: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMCountParams".} +proc GetParams*(Fn: ValueRef, Params: ptr ValueRef){.cdecl, dynlib: libname, + importc: "LLVMGetParams".} +proc GetParam*(Fn: ValueRef, Index: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetParam".} +proc GetParamParent*(Inst: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetParamParent".} +proc GetFirstParam*(Fn: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstParam".} +proc GetLastParam*(Fn: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastParam".} +proc GetNextParam*(Arg: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextParam".} +proc GetPreviousParam*(Arg: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetPreviousParam".} +proc AddAttribute*(Arg: ValueRef, PA: Attribute){.cdecl, dynlib: libname, + importc: "LLVMAddAttribute".} +proc RemoveAttribute*(Arg: ValueRef, PA: Attribute){.cdecl, dynlib: libname, + importc: "LLVMRemoveAttribute".} +proc GetAttribute*(Arg: ValueRef): Attribute{.cdecl, dynlib: libname, + importc: "LLVMGetAttribute".} +proc SetParamAlignment*(Arg: ValueRef, align: int32){.cdecl, dynlib: libname, + importc: "LLVMSetParamAlignment".} + # Operations on basic blocks +proc BasicBlockAsValue*(BB: BasicBlockRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBasicBlockAsValue".} +proc ValueIsBasicBlock*(Val: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMValueIsBasicBlock".} +proc ValueAsBasicBlock*(Val: ValueRef): BasicBlockRef{.cdecl, dynlib: libname, + importc: "LLVMValueAsBasicBlock".} +proc GetBasicBlockParent*(BB: BasicBlockRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetBasicBlockParent".} +proc CountBasicBlocks*(Fn: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMCountBasicBlocks".} +proc GetBasicBlocks*(Fn: ValueRef, BasicBlocks: ptr BasicBlockRef){.cdecl, + dynlib: libname, importc: "LLVMGetBasicBlocks".} +proc GetFirstBasicBlock*(Fn: ValueRef): BasicBlockRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstBasicBlock".} +proc GetLastBasicBlock*(Fn: ValueRef): BasicBlockRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastBasicBlock".} +proc GetNextBasicBlock*(BB: BasicBlockRef): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextBasicBlock".} +proc GetPreviousBasicBlock*(BB: BasicBlockRef): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetPreviousBasicBlock".} +proc GetEntryBasicBlock*(Fn: ValueRef): BasicBlockRef{.cdecl, dynlib: libname, + importc: "LLVMGetEntryBasicBlock".} +proc AppendBasicBlockInContext*(C: ContextRef, Fn: ValueRef, Name: cstring): BasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMAppendBasicBlockInContext".} +proc InsertBasicBlockInContext*(C: ContextRef, BB: BasicBlockRef, Name: cstring): BasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMInsertBasicBlockInContext".} +proc AppendBasicBlock*(Fn: ValueRef, Name: cstring): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMAppendBasicBlock".} +proc InsertBasicBlock*(InsertBeforeBB: BasicBlockRef, Name: cstring): BasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMInsertBasicBlock".} +proc DeleteBasicBlock*(BB: BasicBlockRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteBasicBlock".} + # Operations on instructions +proc GetInstructionParent*(Inst: ValueRef): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetInstructionParent".} +proc GetFirstInstruction*(BB: BasicBlockRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstInstruction".} +proc GetLastInstruction*(BB: BasicBlockRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastInstruction".} +proc GetNextInstruction*(Inst: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextInstruction".} +proc GetPreviousInstruction*(Inst: ValueRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetPreviousInstruction".} + # Operations on call sites +proc SetInstructionCallConv*(Instr: ValueRef, CC: int32){.cdecl, + dynlib: libname, importc: "LLVMSetInstructionCallConv".} +proc GetInstructionCallConv*(Instr: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMGetInstructionCallConv".} +proc AddInstrAttribute*(Instr: ValueRef, index: int32, para3: Attribute){.cdecl, + dynlib: libname, importc: "LLVMAddInstrAttribute".} +proc RemoveInstrAttribute*(Instr: ValueRef, index: int32, para3: Attribute){. + cdecl, dynlib: libname, importc: "LLVMRemoveInstrAttribute".} +proc SetInstrParamAlignment*(Instr: ValueRef, index: int32, align: int32){. + cdecl, dynlib: libname, importc: "LLVMSetInstrParamAlignment".} + # Operations on call instructions (only) +proc IsTailCall*(CallInst: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsTailCall".} +proc SetTailCall*(CallInst: ValueRef, IsTailCall: int32){.cdecl, + dynlib: libname, importc: "LLVMSetTailCall".} + # Operations on phi nodes +proc AddIncoming*(PhiNode: ValueRef, IncomingValues: ptr ValueRef, + IncomingBlocks: ptr BasicBlockRef, Count: int32){.cdecl, + dynlib: libname, importc: "LLVMAddIncoming".} +proc CountIncoming*(PhiNode: ValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMCountIncoming".} +proc GetIncomingValue*(PhiNode: ValueRef, Index: int32): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetIncomingValue".} +proc GetIncomingBlock*(PhiNode: ValueRef, Index: int32): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetIncomingBlock".} + #===-- Instruction builders ----------------------------------------------=== + # An instruction builder represents a point within a basic block, and is the + # * exclusive means of building instructions using the C interface. + # +proc CreateBuilderInContext*(C: ContextRef): BuilderRef{.cdecl, dynlib: libname, + importc: "LLVMCreateBuilderInContext".} +proc CreateBuilder*(): BuilderRef{.cdecl, dynlib: libname, + importc: "LLVMCreateBuilder".} +proc PositionBuilder*(Builder: BuilderRef, theBlock: BasicBlockRef, + Instr: ValueRef){.cdecl, dynlib: libname, + importc: "LLVMPositionBuilder".} +proc PositionBuilderBefore*(Builder: BuilderRef, Instr: ValueRef){.cdecl, + dynlib: libname, importc: "LLVMPositionBuilderBefore".} +proc PositionBuilderAtEnd*(Builder: BuilderRef, theBlock: BasicBlockRef){.cdecl, + dynlib: libname, importc: "LLVMPositionBuilderAtEnd".} +proc GetInsertBlock*(Builder: BuilderRef): BasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetInsertBlock".} +proc ClearInsertionPosition*(Builder: BuilderRef){.cdecl, dynlib: libname, + importc: "LLVMClearInsertionPosition".} +proc InsertIntoBuilder*(Builder: BuilderRef, Instr: ValueRef){.cdecl, + dynlib: libname, importc: "LLVMInsertIntoBuilder".} +proc InsertIntoBuilderWithName*(Builder: BuilderRef, Instr: ValueRef, + Name: cstring){.cdecl, dynlib: libname, + importc: "LLVMInsertIntoBuilderWithName".} +proc DisposeBuilder*(Builder: BuilderRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeBuilder".} + # Terminators +proc BuildRetVoid*(para1: BuilderRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildRetVoid".} +proc BuildRet*(para1: BuilderRef, V: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildRet".} +proc BuildAggregateRet*(para1: BuilderRef, RetVals: ptr ValueRef, N: int32): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAggregateRet".} +proc BuildBr*(para1: BuilderRef, Dest: BasicBlockRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildBr".} +proc BuildCondBr*(para1: BuilderRef, Cond: ValueRef, ThenBranch: BasicBlockRef, + ElseBranch: BasicBlockRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildCondBr".} +proc BuildSwitch*(para1: BuilderRef, V: ValueRef, ElseBranch: BasicBlockRef, + NumCases: int32): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSwitch".} +proc BuildInvoke*(para1: BuilderRef, Fn: ValueRef, Args: ptr ValueRef, + NumArgs: int32, ThenBranch: BasicBlockRef, + Catch: BasicBlockRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildInvoke".} +proc BuildUnwind*(para1: BuilderRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildUnwind".} +proc BuildUnreachable*(para1: BuilderRef): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildUnreachable".} + # Add a case to the switch instruction +proc AddCase*(Switch: ValueRef, OnVal: ValueRef, Dest: BasicBlockRef){.cdecl, + dynlib: libname, importc: "LLVMAddCase".} + # Arithmetic +proc BuildAdd*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAdd".} +proc BuildNSWAdd*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildNSWAdd".} +proc BuildFAdd*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFAdd".} +proc BuildSub*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSub".} +proc BuildFSub*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFSub".} +proc BuildMul*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildMul".} +proc BuildFMul*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFMul".} +proc BuildUDiv*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildUDiv".} +proc BuildSDiv*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSDiv".} +proc BuildExactSDiv*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildExactSDiv".} +proc BuildFDiv*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFDiv".} +proc BuildURem*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildURem".} +proc BuildSRem*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSRem".} +proc BuildFRem*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFRem".} +proc BuildShl*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildShl".} +proc BuildLShr*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildLShr".} +proc BuildAShr*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAShr".} +proc BuildAnd*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAnd".} +proc BuildOr*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildOr".} +proc BuildXor*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildXor".} +proc BuildNeg*(para1: BuilderRef, V: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildNeg".} +proc BuildFNeg*(para1: BuilderRef, V: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFNeg".} +proc BuildNot*(para1: BuilderRef, V: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildNot".} + # Memory +proc BuildMalloc*(para1: BuilderRef, Ty: TypeRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildMalloc".} +proc BuildArrayMalloc*(para1: BuilderRef, Ty: TypeRef, Val: ValueRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildArrayMalloc".} +proc BuildAlloca*(para1: BuilderRef, Ty: TypeRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAlloca".} +proc BuildArrayAlloca*(para1: BuilderRef, Ty: TypeRef, Val: ValueRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildArrayAlloca".} +proc BuildFree*(para1: BuilderRef, PointerVal: ValueRef): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFree".} +proc BuildLoad*(para1: BuilderRef, PointerVal: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildLoad".} +proc BuildStore*(para1: BuilderRef, Val: ValueRef, thePtr: ValueRef): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildStore".} +proc BuildGEP*(B: BuilderRef, Pointer: ValueRef, Indices: ptr ValueRef, + NumIndices: int32, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildGEP".} +proc BuildInBoundsGEP*(B: BuilderRef, Pointer: ValueRef, Indices: ptr ValueRef, + NumIndices: int32, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildInBoundsGEP".} +proc BuildStructGEP*(B: BuilderRef, Pointer: ValueRef, Idx: int32, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildStructGEP".} +proc BuildGlobalString*(B: BuilderRef, Str: cstring, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildGlobalString".} +proc BuildGlobalStringPtr*(B: BuilderRef, Str: cstring, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildGlobalStringPtr".} + # Casts +proc BuildTrunc*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildTrunc".} +proc BuildZExt*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildZExt".} +proc BuildSExt*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSExt".} +proc BuildFPToUI*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFPToUI".} +proc BuildFPToSI*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFPToSI".} +proc BuildUIToFP*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildUIToFP".} +proc BuildSIToFP*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSIToFP".} +proc BuildFPTrunc*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFPTrunc".} +proc BuildFPExt*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFPExt".} +proc BuildPtrToInt*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildPtrToInt".} +proc BuildIntToPtr*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildIntToPtr".} +proc BuildBitCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildBitCast".} +proc BuildZExtOrBitCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildZExtOrBitCast".} +proc BuildSExtOrBitCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSExtOrBitCast".} +proc BuildTruncOrBitCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildTruncOrBitCast".} +proc BuildPointerCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildPointerCast".} +proc BuildIntCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildIntCast".} +proc BuildFPCast*(para1: BuilderRef, Val: ValueRef, DestTy: TypeRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFPCast".} + # Comparisons +proc BuildICmp*(para1: BuilderRef, Op: IntPredicate, LHS: ValueRef, + RHS: ValueRef, Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildICmp".} +proc BuildFCmp*(para1: BuilderRef, Op: RealPredicate, LHS: ValueRef, + RHS: ValueRef, Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFCmp".} + # Miscellaneous instructions +proc BuildPhi*(para1: BuilderRef, Ty: TypeRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildPhi".} +proc BuildCall*(para1: BuilderRef, Fn: ValueRef, Args: ptr ValueRef, + NumArgs: int32, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildCall".} +proc BuildSelect*(para1: BuilderRef, Cond: ValueRef, ThenBranch: ValueRef, + ElseBranch: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildSelect".} +proc BuildVAArg*(para1: BuilderRef, List: ValueRef, Ty: TypeRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildVAArg".} +proc BuildExtractElement*(para1: BuilderRef, VecVal: ValueRef, Index: ValueRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildExtractElement".} +proc BuildInsertElement*(para1: BuilderRef, VecVal: ValueRef, EltVal: ValueRef, + Index: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildInsertElement".} +proc BuildShuffleVector*(para1: BuilderRef, V1: ValueRef, V2: ValueRef, + Mask: ValueRef, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildShuffleVector".} +proc BuildExtractValue*(para1: BuilderRef, AggVal: ValueRef, Index: int32, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildExtractValue".} +proc BuildInsertValue*(para1: BuilderRef, AggVal: ValueRef, EltVal: ValueRef, + Index: int32, Name: cstring): ValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildInsertValue".} +proc BuildIsNull*(para1: BuilderRef, Val: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildIsNull".} +proc BuildIsNotNull*(para1: BuilderRef, Val: ValueRef, Name: cstring): ValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildIsNotNull".} +proc BuildPtrDiff*(para1: BuilderRef, LHS: ValueRef, RHS: ValueRef, + Name: cstring): ValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildPtrDiff".} + #===-- Module providers --------------------------------------------------=== + # Encapsulates the module M in a module provider, taking ownership of the + # module. + # See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider. + # +proc CreateModuleProviderForExistingModule*(M: ModuleRef): ModuleProviderRef{. + cdecl, dynlib: libname, importc: "LLVMCreateModuleProviderForExistingModule".} + # Destroys the module provider MP as well as the contained module. + # See the destructor llvm::ModuleProvider::~ModuleProvider. + # +proc DisposeModuleProvider*(MP: ModuleProviderRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeModuleProvider".} + #===-- Memory buffers ----------------------------------------------------=== +proc CreateMemoryBufferWithContentsOfFile*(Path: cstring, + OutMemBuf: ptr MemoryBufferRef, OutMessage: var cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMCreateMemoryBufferWithContentsOfFile".} +proc CreateMemoryBufferWithSTDIN*(OutMemBuf: ptr MemoryBufferRef, + OutMessage: var cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMCreateMemoryBufferWithSTDIN".} +proc DisposeMemoryBuffer*(MemBuf: MemoryBufferRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeMemoryBuffer".} + #===-- Pass Managers -----------------------------------------------------=== + # Constructs a new whole-module pass pipeline. This type of pipeline is + # suitable for link-time optimization and whole-module transformations. + # See llvm::PassManager::PassManager. +proc CreatePassManager*(): PassManagerRef{.cdecl, dynlib: libname, + importc: "LLVMCreatePassManager".} + # Constructs a new function-by-function pass pipeline over the module + # provider. It does not take ownership of the module provider. This type of + # pipeline is suitable for code generation and JIT compilation tasks. + # See llvm::FunctionPassManager::FunctionPassManager. +proc CreateFunctionPassManager*(MP: ModuleProviderRef): PassManagerRef{.cdecl, + dynlib: libname, importc: "LLVMCreateFunctionPassManager".} + # Initializes, executes on the provided module, and finalizes all of the + # passes scheduled in the pass manager. Returns 1 if any of the passes + # modified the module, 0 otherwise. See llvm::PassManager::run(Module&). +proc RunPassManager*(PM: PassManagerRef, M: ModuleRef): int32{.cdecl, + dynlib: libname, importc: "LLVMRunPassManager".} + # Initializes all of the function passes scheduled in the function pass + # manager. Returns 1 if any of the passes modified the module, 0 otherwise. + # See llvm::FunctionPassManager::doInitialization. +proc InitializeFunctionPassManager*(FPM: PassManagerRef): int32{.cdecl, + dynlib: libname, importc: "LLVMInitializeFunctionPassManager".} + # Executes all of the function passes scheduled in the function pass manager + # on the provided function. Returns 1 if any of the passes modified the + # function, false otherwise. + # See llvm::FunctionPassManager::run(Function&). +proc RunFunctionPassManager*(FPM: PassManagerRef, F: ValueRef): int32{.cdecl, + dynlib: libname, importc: "LLVMRunFunctionPassManager".} + # Finalizes all of the function passes scheduled in in the function pass + # manager. Returns 1 if any of the passes modified the module, 0 otherwise. + # See llvm::FunctionPassManager::doFinalization. +proc FinalizeFunctionPassManager*(FPM: PassManagerRef): int32{.cdecl, + dynlib: libname, importc: "LLVMFinalizeFunctionPassManager".} + # Frees the memory of a pass pipeline. For function pipelines, does not free + # the module provider. + # See llvm::PassManagerBase::~PassManagerBase. +proc DisposePassManager*(PM: PassManagerRef){.cdecl, dynlib: libname, + importc: "LLVMDisposePassManager".} + # Analysis.h + # verifier will print to stderr and abort() + # verifier will print to stderr and return 1 + # verifier will just return 1 +type + VerifierFailureAction* = enum # Verifies that a module is valid, taking the specified action if not. + # Optionally returns a human-readable description of any invalid constructs. + # OutMessage must be disposed with LLVMDisposeMessage. + AbortProcessAction, PrintMessageAction, ReturnStatusAction + +proc VerifyModule*(M: ModuleRef, Action: VerifierFailureAction, + OutMessage: var cstring): int32{.cdecl, dynlib: libname, + importc: "LLVMVerifyModule".} + # Verifies that a single function is valid, taking the specified action. Useful + # for debugging. +proc VerifyFunction*(Fn: ValueRef, Action: VerifierFailureAction): int32{.cdecl, + dynlib: libname, importc: "LLVMVerifyFunction".} + # Open up a ghostview window that displays the CFG of the current function. + # Useful for debugging. +proc ViewFunctionCFG*(Fn: ValueRef){.cdecl, dynlib: libname, + importc: "LLVMViewFunctionCFG".} +proc ViewFunctionCFGOnly*(Fn: ValueRef){.cdecl, dynlib: libname, + importc: "LLVMViewFunctionCFGOnly".} + # BitReader.h + # Builds a module from the bitcode in the specified memory buffer, returning a + # reference to the module via the OutModule parameter. Returns 0 on success. + # Optionally returns a human-readable error message via OutMessage. +proc ParseBitcode*(MemBuf: MemoryBufferRef, OutModule: var ModuleRef, + OutMessage: var cstring): int32{.cdecl, dynlib: libname, + importc: "LLVMParseBitcode".} +proc ParseBitcodeInContext*(ContextRef: ContextRef, MemBuf: MemoryBufferRef, + OutModule: var ModuleRef, OutMessage: var cstring): int32{. + cdecl, dynlib: libname, importc: "LLVMParseBitcodeInContext".} + # Reads a module from the specified path, returning via the OutMP parameter + # a module provider which performs lazy deserialization. Returns 0 on success. + # Optionally returns a human-readable error message via OutMessage. +proc GetBitcodeModuleProvider*(MemBuf: MemoryBufferRef, + OutMP: var ModuleProviderRef, + OutMessage: var cstring): int32{. + cdecl, dynlib: libname, importc: "LLVMGetBitcodeModuleProvider".} +proc GetBitcodeModuleProviderInContext*(ContextRef: ContextRef, + MemBuf: MemoryBufferRef, + OutMP: var ModuleProviderRef, + OutMessage: var cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMGetBitcodeModuleProviderInContext".} + # BitWriter.h + #===-- Operations on modules ---------------------------------------------=== + # Writes a module to an open file descriptor. Returns 0 on success. + # Closes the Handle. Use dup first if this is not what you want. +proc WriteBitcodeToFileHandle*(M: ModuleRef, Handle: int32): int32{.cdecl, + dynlib: libname, importc: "LLVMWriteBitcodeToFileHandle".} + # Writes a module to the specified path. Returns 0 on success. +proc WriteBitcodeToFile*(M: ModuleRef, Path: cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMWriteBitcodeToFile".} + # Target.h +const + BigEndian* = 0 + LittleEndian* = 1 + +type + ByteOrdering* = int32 + OpaqueTargetData {.pure} = object + StructLayout {.pure} = object + TargetDataRef* = ref OpaqueTargetData + StructLayoutRef* = ref StructLayout + + +#===-- Target Data -------------------------------------------------------=== +# Creates target data from a target layout string. +# See the constructor llvm::TargetData::TargetData. + +proc CreateTargetData*(StringRep: cstring): TargetDataRef{.cdecl, + dynlib: libname, importc: "LLVMCreateTargetData".} + # Adds target data information to a pass manager. This does not take ownership + # of the target data. + # See the method llvm::PassManagerBase::add. +proc AddTargetData*(para1: TargetDataRef, para2: PassManagerRef){.cdecl, + dynlib: libname, importc: "LLVMAddTargetData".} + # Converts target data to a target layout string. The string must be disposed + # with LLVMDisposeMessage. + # See the constructor llvm::TargetData::TargetData. +proc CopyStringRepOfTargetData*(para1: TargetDataRef): cstring{.cdecl, + dynlib: libname, importc: "LLVMCopyStringRepOfTargetData".} + # Returns the byte order of a target, either LLVMBigEndian or + # LLVMLittleEndian. + # See the method llvm::TargetData::isLittleEndian. +proc ByteOrder*(para1: TargetDataRef): ByteOrdering{.cdecl, dynlib: libname, + importc: "LLVMByteOrder".} + # Returns the pointer size in bytes for a target. + # See the method llvm::TargetData::getPointerSize. +proc PointerSize*(para1: TargetDataRef): int32{.cdecl, dynlib: libname, + importc: "LLVMPointerSize".} + # Returns the integer type that is the same size as a pointer on a target. + # See the method llvm::TargetData::getIntPtrType. +proc IntPtrType*(para1: TargetDataRef): TypeRef{.cdecl, dynlib: libname, + importc: "LLVMIntPtrType".} + # Computes the size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeSizeInBits. +proc SizeOfTypeInBits*(para1: TargetDataRef, para2: TypeRef): int64{.cdecl, + dynlib: libname, importc: "LLVMSizeOfTypeInBits".} + # Computes the storage size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeStoreSize. +proc StoreSizeOfType*(para1: TargetDataRef, para2: TypeRef): int64{.cdecl, + dynlib: libname, importc: "LLVMStoreSizeOfType".} + # Computes the ABI size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeAllocSize. +proc ABISizeOfType*(para1: TargetDataRef, para2: TypeRef): int64{.cdecl, + dynlib: libname, importc: "LLVMABISizeOfType".} + # Computes the ABI alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc ABIAlignmentOfType*(para1: TargetDataRef, para2: TypeRef): int32{.cdecl, + dynlib: libname, importc: "LLVMABIAlignmentOfType".} + # Computes the call frame alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc CallFrameAlignmentOfType*(para1: TargetDataRef, para2: TypeRef): int32{. + cdecl, dynlib: libname, importc: "LLVMCallFrameAlignmentOfType".} + # Computes the preferred alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc PreferredAlignmentOfType*(para1: TargetDataRef, para2: TypeRef): int32{. + cdecl, dynlib: libname, importc: "LLVMPreferredAlignmentOfType".} + # Computes the preferred alignment of a global variable in bytes for a target. + # See the method llvm::TargetData::getPreferredAlignment. +proc PreferredAlignmentOfGlobal*(para1: TargetDataRef, GlobalVar: ValueRef): int32{. + cdecl, dynlib: libname, importc: "LLVMPreferredAlignmentOfGlobal".} + # Computes the structure element that contains the byte offset for a target. + # See the method llvm::StructLayout::getElementContainingOffset. +proc ElementAtOffset*(para1: TargetDataRef, StructTy: TypeRef, Offset: int64): int32{. + cdecl, dynlib: libname, importc: "LLVMElementAtOffset".} + # Computes the byte offset of the indexed struct element for a target. + # See the method llvm::StructLayout::getElementContainingOffset. +proc OffsetOfElement*(para1: TargetDataRef, StructTy: TypeRef, Element: int32): int64{. + cdecl, dynlib: libname, importc: "LLVMOffsetOfElement".} + # Struct layouts are speculatively cached. If a TargetDataRef is alive when + # types are being refined and removed, this method must be called whenever a + # struct type is removed to avoid a dangling pointer in this cache. + # See the method llvm::TargetData::InvalidateStructLayoutInfo. +proc InvalidateStructLayout*(para1: TargetDataRef, StructTy: TypeRef){.cdecl, + dynlib: libname, importc: "LLVMInvalidateStructLayout".} + # Deallocates a TargetData. + # See the destructor llvm::TargetData::~TargetData. +proc DisposeTargetData*(para1: TargetDataRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeTargetData".} + # ExecutionEngine.h +proc LinkInJIT*(){.cdecl, dynlib: libname, importc: "LLVMLinkInJIT".} +proc LinkInInterpreter*(){.cdecl, dynlib: libname, + importc: "LLVMLinkInInterpreter".} +type + OpaqueGenericValue {.pure} = object + OpaqueExecutionEngine {.pure} = object + GenericValueRef* = OpaqueGenericValue + ExecutionEngineRef* = OpaqueExecutionEngine + +#===-- Operations on generic values --------------------------------------=== + +proc CreateGenericValueOfInt*(Ty: TypeRef, N: int64, IsSigned: int32): GenericValueRef{. + cdecl, dynlib: libname, importc: "LLVMCreateGenericValueOfInt".} +proc CreateGenericValueOfPointer*(P: pointer): GenericValueRef{.cdecl, + dynlib: libname, importc: "LLVMCreateGenericValueOfPointer".} +proc CreateGenericValueOfFloat*(Ty: TypeRef, N: float64): GenericValueRef{. + cdecl, dynlib: libname, importc: "LLVMCreateGenericValueOfFloat".} +proc GenericValueIntWidth*(GenValRef: GenericValueRef): int32{.cdecl, + dynlib: libname, importc: "LLVMGenericValueIntWidth".} +proc GenericValueToInt*(GenVal: GenericValueRef, IsSigned: int32): int64{.cdecl, + dynlib: libname, importc: "LLVMGenericValueToInt".} +proc GenericValueToPointer*(GenVal: GenericValueRef): pointer{.cdecl, + dynlib: libname, importc: "LLVMGenericValueToPointer".} +proc GenericValueToFloat*(TyRef: TypeRef, GenVal: GenericValueRef): float64{. + cdecl, dynlib: libname, importc: "LLVMGenericValueToFloat".} +proc DisposeGenericValue*(GenVal: GenericValueRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeGenericValue".} + +#===-- Operations on execution engines -----------------------------------=== +proc CreateExecutionEngine*(OutEE: var ExecutionEngineRef, MP: ModuleProviderRef, + OutError: var cstring): int32{.cdecl, dynlib: libname, + importc: "LLVMCreateExecutionEngine".} +proc CreateInterpreter*(OutInterp: var ExecutionEngineRef, MP: ModuleProviderRef, + OutError: var cstring): int32{.cdecl, dynlib: libname, + importc: "LLVMCreateInterpreter".} +proc CreateJITCompiler*(OutJIT: var ExecutionEngineRef, MP: ModuleProviderRef, + OptLevel: int32, OutError: var cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMCreateJITCompiler".} +proc DisposeExecutionEngine*(EE: ExecutionEngineRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeExecutionEngine".} +proc RunStaticConstructors*(EE: ExecutionEngineRef){.cdecl, dynlib: libname, + importc: "LLVMRunStaticConstructors".} +proc RunStaticDestructors*(EE: ExecutionEngineRef){.cdecl, dynlib: libname, + importc: "LLVMRunStaticDestructors".} + +proc RunFunctionAsMain*(EE: ExecutionEngineRef, F: ValueRef, ArgC: int32, + ArgV: cstringArray, EnvP: cstringArray): int32{.cdecl, + dynlib: libname, importc: "LLVMRunFunctionAsMain".} +proc RunFunction*(EE: ExecutionEngineRef, F: ValueRef, NumArgs: int32, + Args: ptr GenericValueRef): GenericValueRef{.cdecl, + dynlib: libname, importc: "LLVMRunFunction".} +proc FreeMachineCodeForFunction*(EE: ExecutionEngineRef, F: ValueRef){.cdecl, + dynlib: libname, importc: "LLVMFreeMachineCodeForFunction".} +proc AddModuleProvider*(EE: ExecutionEngineRef, MP: ModuleProviderRef){.cdecl, + dynlib: libname, importc: "LLVMAddModuleProvider".} +proc RemoveModuleProvider*(EE: ExecutionEngineRef, MP: ModuleProviderRef, + OutMod: var ModuleRef, OutError: var cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMRemoveModuleProvider".} +proc FindFunction*(EE: ExecutionEngineRef, Name: cstring, OutFn: var ValueRef): int32{. + cdecl, dynlib: libname, importc: "LLVMFindFunction".} +proc GetExecutionEngineTargetData*(EE: ExecutionEngineRef): TargetDataRef{. + cdecl, dynlib: libname, importc: "LLVMGetExecutionEngineTargetData".} +proc AddGlobalMapping*(EE: ExecutionEngineRef, Global: ValueRef, + theAddr: pointer){.cdecl, dynlib: libname, + importc: "LLVMAddGlobalMapping".} +proc GetPointerToGlobal*(EE: ExecutionEngineRef, Global: ValueRef): pointer{. + cdecl, dynlib: libname, importc: "LLVMGetPointerToGlobal".} + +# LinkTimeOptimizer.h +# This provides a dummy type for pointers to the LTO object. +type + lto_t* = pointer + lto_status* = enum + LTO_UNKNOWN, LTO_OPT_SUCCESS, LTO_READ_SUCCESS, LTO_READ_FAILURE, + LTO_WRITE_FAILURE, LTO_NO_TARGET, LTO_NO_WORK, LTO_MODULE_MERGE_FAILURE, + LTO_ASM_FAILURE, LTO_NULL_OBJECT + lto_status_t* = lto_status + # This provides C interface to initialize link time optimizer. This allows + # linker to use dlopen() interface to dynamically load LinkTimeOptimizer. + # extern "C" helps, because dlopen() interface uses name to find the symbol. + +proc create_optimizer*(): lto_t{.cdecl, dynlib: libname, + importc: "llvm_create_optimizer".} +proc destroy_optimizer*(lto: lto_t){.cdecl, dynlib: libname, + importc: "llvm_destroy_optimizer".} +proc read_object_file*(lto: lto_t, input_filename: cstring): lto_status_t{. + cdecl, dynlib: libname, importc: "llvm_read_object_file".} +proc optimize_modules*(lto: lto_t, output_filename: cstring): lto_status_t{. + cdecl, dynlib: libname, importc: "llvm_optimize_modules".} + +# lto.h +const + LTO_API_VERSION* = 3 # log2 of alignment + +type + lto_symbol_attributes* = enum + SYMBOL_ALIGNMENT_MASK = 0x0000001F, + SYMBOL_PERMISSIONS_RODATA = 0x00000080, + SYMBOL_PERMISSIONS_CODE = 0x000000A0, + SYMBOL_PERMISSIONS_DATA = 0x000000C0, + SYMBOL_PERMISSIONS_MASK = 0x000000E0, + + SYMBOL_DEFINITION_REGULAR = 0x00000100, + SYMBOL_DEFINITION_TENTATIVE = 0x00000200, + SYMBOL_DEFINITION_WEAK = 0x00000300, + SYMBOL_DEFINITION_UNDEFINED = 0x00000400, + SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500, + SYMBOL_DEFINITION_MASK = 0x00000700, + SYMBOL_SCOPE_INTERNAL = 0x00000800, + + SYMBOL_SCOPE_HIDDEN = 0x00001000, + SYMBOL_SCOPE_DEFAULT = 0x00001800, + SYMBOL_SCOPE_PROTECTED = 0x00002000, + SYMBOL_SCOPE_MASK = 0x00003800, + lto_debug_model* = enum + DEBUG_MODEL_NONE = 0, DEBUG_MODEL_DWARF = 1 + lto_codegen_model* = enum + CODEGEN_PIC_MODEL_STATIC = 0, CODEGEN_PIC_MODEL_DYNAMIC = 1, + CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2 + + LTOModule {.pure} = object + LTOCodeGenerator {.pure} = object + lto_module_t* = ref LTOModule + lto_code_gen_t* = ref LTOCodeGenerator + +proc lto_get_version*(): cstring{.cdecl, dynlib: libname, + importc: "lto_get_version".} + # + # Returns the last error string or NULL if last operation was sucessful. + # +proc lto_get_error_message*(): cstring{.cdecl, dynlib: libname, + importc: "lto_get_error_message".} + # + # Checks if a file is a loadable object file. + # +proc lto_module_is_object_file*(path: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file".} + # + # Checks if a file is a loadable object compiled for requested target. + # +proc lto_module_is_object_file_for_target*(path: cstring, + target_triple_prefix: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file_for_target".} + # + # Checks if a buffer is a loadable object file. + # +proc lto_module_is_object_file_in_memory*(mem: pointer, len: int): bool{. + cdecl, dynlib: libname, importc: "lto_module_is_object_file_in_memory".} + # + # Checks if a buffer is a loadable object compiled for requested target. + # +proc lto_module_is_object_file_in_memory_for_target*(mem: pointer, len: int, + target_triple_prefix: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file_in_memory_for_target".} + # + # Loads an object file from disk. + # Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_module_create*(path: cstring): lto_module_t{.cdecl, dynlib: libname, + importc: "lto_module_create".} + # + # Loads an object file from memory. + # Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_module_create_from_memory*(mem: pointer, len: int): lto_module_t{. + cdecl, dynlib: libname, importc: "lto_module_create_from_memory".} + # + # Frees all memory internally allocated by the module. + # Upon return the lto_module_t is no longer valid. + # +proc lto_module_dispose*(module: lto_module_t){.cdecl, dynlib: libname, + importc: "lto_module_dispose".} + # + # Returns triple string which the object module was compiled under. + # +proc lto_module_get_target_triple*(module: lto_module_t): cstring{.cdecl, + dynlib: libname, importc: "lto_module_get_target_triple".} + # + # Returns the number of symbols in the object module. + # +proc lto_module_get_num_symbols*(module: lto_module_t): int32{.cdecl, + dynlib: libname, importc: "lto_module_get_num_symbols".} + # + # Returns the name of the ith symbol in the object module. + # +proc lto_module_get_symbol_name*(module: lto_module_t, index: int32): cstring{. + cdecl, dynlib: libname, importc: "lto_module_get_symbol_name".} + # + # Returns the attributes of the ith symbol in the object module. + # +proc lto_module_get_symbol_attribute*(module: lto_module_t, index: int32): lto_symbol_attributes{. + cdecl, dynlib: libname, importc: "lto_module_get_symbol_attribute".} + # + # Instantiates a code generator. + # Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_codegen_create*(): lto_code_gen_t{.cdecl, dynlib: libname, + importc: "lto_codegen_create".} + # + # Frees all code generator and all memory it internally allocated. + # Upon return the lto_code_gen_t is no longer valid. + # +proc lto_codegen_dispose*(para1: lto_code_gen_t){.cdecl, dynlib: libname, + importc: "lto_codegen_dispose".} + # + # Add an object module to the set of modules for which code will be generated. + # Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_add_module*(cg: lto_code_gen_t, module: lto_module_t): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_add_module".} + # + # Sets if debug info should be generated. + # Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_set_debug_model*(cg: lto_code_gen_t, para2: lto_debug_model): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_set_debug_model".} + # + # Sets which PIC code model to generated. + # Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_set_pic_model*(cg: lto_code_gen_t, para2: lto_codegen_model): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_set_pic_model".} + # + # Sets the location of the "gcc" to run. If not set, libLTO will search for + # "gcc" on the path. + # +proc lto_codegen_set_gcc_path*(cg: lto_code_gen_t, path: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_set_gcc_path".} + # + # Sets the location of the assembler tool to run. If not set, libLTO + # will use gcc to invoke the assembler. + # +proc lto_codegen_set_assembler_path*(cg: lto_code_gen_t, path: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_set_assembler_path".} + # + # Adds to a list of all global symbols that must exist in the final + # generated code. If a function is not listed, it might be + # inlined into every usage and optimized away. + # +proc lto_codegen_add_must_preserve_symbol*(cg: lto_code_gen_t, symbol: cstring){. + cdecl, dynlib: libname, importc: "lto_codegen_add_must_preserve_symbol".} + # + # Writes a new object file at the specified path that contains the + # merged contents of all modules added so far. + # Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_write_merged_modules*(cg: lto_code_gen_t, path: cstring): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_write_merged_modules".} + # + # Generates code for all added modules into one native object file. + # On sucess returns a pointer to a generated mach-o/ELF buffer and + # length set to the buffer size. The buffer is owned by the + # lto_code_gen_t and will be freed when lto_codegen_dispose() + # is called, or lto_codegen_compile() is called again. + # On failure, returns NULL (check lto_get_error_message() for details). + # +proc lto_codegen_compile*(cg: lto_code_gen_t, len: var int): pointer{.cdecl, + dynlib: libname, importc: "lto_codegen_compile".} + # + # Sets options to help debug codegen bugs. + # +proc lto_codegen_debug_options*(cg: lto_code_gen_t, para2: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_debug_options".} diff --git a/llvm/llvm.pas b/llvm/llvm.pas new file mode 100755 index 000000000..ad1398b83 --- /dev/null +++ b/llvm/llvm.pas @@ -0,0 +1,1034 @@ +unit llvm; + +interface + +const + libname=''; {Setup as you need} + +type + Pdword = ^dword; + PLLVMBasicBlockRef = ^LLVMBasicBlockRef; + PLLVMExecutionEngineRef = ^LLVMExecutionEngineRef; + PLLVMGenericValueRef = ^LLVMGenericValueRef; + PLLVMMemoryBufferRef = ^LLVMMemoryBufferRef; + PLLVMModuleProviderRef = ^LLVMModuleProviderRef; + PLLVMModuleRef = ^LLVMModuleRef; + PLLVMTypeRef = ^LLVMTypeRef; + PLLVMValueRef = ^LLVMValueRef; + +{ Core.h } +{ Opaque types. } +{* + * The top-level container for all LLVM global data. See the LLVMContext class. + } +type + + LLVMContextRef = LLVMOpaqueContext; +{* + * The top-level container for all other LLVM Intermediate Representation (IR) + * objects. See the llvm::Module class. + } + + LLVMModuleRef = LLVMOpaqueModule; +{* + * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type + * class. + } + + LLVMTypeRef = LLVMOpaqueType; +{* + * When building recursive types using LLVMRefineType, LLVMTypeRef values may + * become invalid; use LLVMTypeHandleRef to resolve this problem. See the + * llvm::AbstractTypeHolder class. + } + + LLVMTypeHandleRef = LLVMOpaqueTypeHandle; + + LLVMValueRef = LLVMOpaqueValue; + + LLVMBasicBlockRef = LLVMOpaqueBasicBlock; + + LLVMBuilderRef = LLVMOpaqueBuilder; +{ Used to provide a module to JIT or interpreter. + * See the llvm::ModuleProvider class. + } + + LLVMModuleProviderRef = LLVMOpaqueModuleProvider; +{ Used to provide a module to JIT or interpreter. + * See the llvm::MemoryBuffer class. + } + + LLVMMemoryBufferRef = LLVMOpaqueMemoryBuffer; +{* See the llvm::PassManagerBase class. } + + LLVMPassManagerRef = LLVMOpaquePassManager; +{* + * Used to iterate through the uses of a Value, allowing access to all Values + * that use this Value. See the llvm::Use and llvm::value_use_iterator classes. + } + + LLVMUseIteratorRef = LLVMOpaqueUseIterator; + + LLVMAttribute = (LLVMZExtAttribute := 1 shl 0,LLVMSExtAttribute := 1 shl 1, + LLVMNoReturnAttribute := 1 shl 2,LLVMInRegAttribute := 1 shl 3, + LLVMStructRetAttribute := 1 shl 4,LLVMNoUnwindAttribute := 1 shl 5, + LLVMNoAliasAttribute := 1 shl 6,LLVMByValAttribute := 1 shl 7, + LLVMNestAttribute := 1 shl 8,LLVMReadNoneAttribute := 1 shl 9, + LLVMReadOnlyAttribute := 1 shl 10,LLVMNoInlineAttribute := 1 shl 11, + LLVMAlwaysInlineAttribute := 1 shl 12,LLVMOptimizeForSizeAttribute := 1 shl 13, + LLVMStackProtectAttribute := 1 shl 14,LLVMStackProtectReqAttribute := 1 shl 15, + LLVMNoCaptureAttribute := 1 shl 21,LLVMNoRedZoneAttribute := 1 shl 22, + LLVMNoImplicitFloatAttribute := 1 shl 23,LLVMNakedAttribute := 1 shl 24, + LLVMInlineHintAttribute := 1 shl 25); + + LLVMOpcode = (LLVMRet := 1,LLVMBr := 2,LLVMSwitch := 3, + LLVMInvoke := 4,LLVMUnwind := 5,LLVMUnreachable := 6, + LLVMAdd := 7,LLVMFAdd := 8,LLVMSub := 9, + LLVMFSub := 10,LLVMMul := 11,LLVMFMul := 12, + LLVMUDiv := 13,LLVMSDiv := 14,LLVMFDiv := 15, + LLVMURem := 16,LLVMSRem := 17,LLVMFRem := 18, + LLVMShl := 19,LLVMLShr := 20,LLVMAShr := 21, + LLVMAnd := 22,LLVMOr := 23,LLVMXor := 24, + LLVMMalloc := 25,LLVMFree := 26,LLVMAlloca := 27, + LLVMLoad := 28,LLVMStore := 29,LLVMGetElementPtr := 30, + LLVMTrunk := 31,LLVMZExt := 32,LLVMSExt := 33, + LLVMFPToUI := 34,LLVMFPToSI := 35,LLVMUIToFP := 36, + LLVMSIToFP := 37,LLVMFPTrunc := 38,LLVMFPExt := 39, + LLVMPtrToInt := 40,LLVMIntToPtr := 41, + LLVMBitCast := 42,LLVMICmp := 43,LLVMFCmp := 44, + LLVMPHI := 45,LLVMCall := 46,LLVMSelect := 47, + LLVMVAArg := 50,LLVMExtractElement := 51, + LLVMInsertElement := 52,LLVMShuffleVector := 53, + LLVMExtractValue := 54,LLVMInsertValue := 55 + ); +{*< type with no size } +{*< 32 bit floating point type } +{*< 64 bit floating point type } +{*< 80 bit floating point type (X87) } +{*< 128 bit floating point type (112-bit mantissa) } +{*< 128 bit floating point type (two 64-bits) } +{*< Labels } +{*< Arbitrary bit width integers } +{*< Functions } +{*< Structures } +{*< Arrays } +{*< Pointers } +{*< Opaque: type with unknown structure } +{*< SIMD 'packed' format, or other vector type } +{*< Metadata } + + LLVMTypeKind = (LLVMVoidTypeKind,LLVMFloatTypeKind,LLVMDoubleTypeKind, + LLVMX86_FP80TypeKind,LLVMFP128TypeKind, + LLVMPPC_FP128TypeKind,LLVMLabelTypeKind, + LLVMIntegerTypeKind,LLVMFunctionTypeKind, + LLVMStructTypeKind,LLVMArrayTypeKind,LLVMPointerTypeKind, + LLVMOpaqueTypeKind,LLVMVectorTypeKind, + LLVMMetadataTypeKind); +{*< Externally visible function } +{*< Keep one copy of function when linking (inline) } +{*< Same, but only replaced by something + equivalent. } +{*< Keep one copy of function when linking (weak) } +{*< Same, but only replaced by something + equivalent. } +{*< Special purpose, only applies to global arrays } +{*< Rename collisions when linking (static + functions) } +{*< Like Internal, but omit from symbol table } +{*< Function to be imported from DLL } +{*< Function to be accessible from DLL } +{*< ExternalWeak linkage description } +{*< Stand-in functions for streaming fns from + bitcode } +{*< Tentative definitions } +{*< Like Private, but linker removes. } + + LLVMLinkage = (LLVMExternalLinkage,LLVMAvailableExternallyLinkage, + LLVMLinkOnceAnyLinkage,LLVMLinkOnceODRLinkage, + LLVMWeakAnyLinkage,LLVMWeakODRLinkage, + LLVMAppendingLinkage,LLVMInternalLinkage, + LLVMPrivateLinkage,LLVMDLLImportLinkage, + LLVMDLLExportLinkage,LLVMExternalWeakLinkage, + LLVMGhostLinkage,LLVMCommonLinkage,LLVMLinkerPrivateLinkage + ); +{*< The GV is visible } +{*< The GV is hidden } +{*< The GV is protected } + + LLVMVisibility = (LLVMDefaultVisibility,LLVMHiddenVisibility, + LLVMProtectedVisibility); + + LLVMCallConv = (LLVMCCallConv := 0,LLVMFastCallConv := 8, + LLVMColdCallConv := 9,LLVMX86StdcallCallConv := 64, + LLVMX86FastcallCallConv := 65); +{*< equal } +{*< not equal } +{*< unsigned greater than } +{*< unsigned greater or equal } +{*< unsigned less than } +{*< unsigned less or equal } +{*< signed greater than } +{*< signed greater or equal } +{*< signed less than } +{*< signed less or equal } + + LLVMIntPredicate = (LLVMIntEQ := 32,LLVMIntNE,LLVMIntUGT,LLVMIntUGE, + LLVMIntULT,LLVMIntULE,LLVMIntSGT,LLVMIntSGE, + LLVMIntSLT,LLVMIntSLE); +{*< Always false (always folded) } +{*< True if ordered and equal } +{*< True if ordered and greater than } +{*< True if ordered and greater than or equal } +{*< True if ordered and less than } +{*< True if ordered and less than or equal } +{*< True if ordered and operands are unequal } +{*< True if ordered (no nans) } +{*< True if unordered: isnan(X) | isnan(Y) } +{*< True if unordered or equal } +{*< True if unordered or greater than } +{*< True if unordered, greater than, or equal } +{*< True if unordered or less than } +{*< True if unordered, less than, or equal } +{*< True if unordered or not equal } +{*< Always true (always folded) } + + LLVMRealPredicate = (LLVMRealPredicateFalse,LLVMRealOEQ,LLVMRealOGT, + LLVMRealOGE,LLVMRealOLT,LLVMRealOLE,LLVMRealONE, + LLVMRealORD,LLVMRealUNO,LLVMRealUEQ,LLVMRealUGT, + LLVMRealUGE,LLVMRealULT,LLVMRealULE,LLVMRealUNE, + LLVMRealPredicateTrue); +{===-- Error handling ----------------------------------------------------=== } + +procedure LLVMDisposeMessage(Message:pchar);cdecl;external libname name 'LLVMDisposeMessage'; +{===-- Modules -----------------------------------------------------------=== } +{ Create and destroy contexts. } +function LLVMContextCreate:LLVMContextRef;cdecl;external libname name 'LLVMContextCreate'; +function LLVMGetGlobalContext:LLVMContextRef;cdecl;external libname name 'LLVMGetGlobalContext'; +procedure LLVMContextDispose(C:LLVMContextRef);cdecl;external libname name 'LLVMContextDispose'; +{ Create and destroy modules. }{* See llvm::Module::Module. } +function LLVMModuleCreateWithName(ModuleID:pchar):LLVMModuleRef;cdecl;external libname name 'LLVMModuleCreateWithName'; +function LLVMModuleCreateWithNameInContext(ModuleID:pchar; C:LLVMContextRef):LLVMModuleRef;cdecl;external libname name 'LLVMModuleCreateWithNameInContext'; +{* See llvm::Module::~Module. } +procedure LLVMDisposeModule(M:LLVMModuleRef);cdecl;external libname name 'LLVMDisposeModule'; +{* Data layout. See Module::getDataLayout. } +function LLVMGetDataLayout(M:LLVMModuleRef):pchar;cdecl;external libname name 'LLVMGetDataLayout'; +procedure LLVMSetDataLayout(M:LLVMModuleRef; Triple:pchar);cdecl;external libname name 'LLVMSetDataLayout'; +{* Target triple. See Module::getTargetTriple. } +function LLVMGetTarget(M:LLVMModuleRef):pchar;cdecl;external libname name 'LLVMGetTarget'; +procedure LLVMSetTarget(M:LLVMModuleRef; Triple:pchar);cdecl;external libname name 'LLVMSetTarget'; +{* See Module::addTypeName. } +function LLVMAddTypeName(M:LLVMModuleRef; Name:pchar; Ty:LLVMTypeRef):longint;cdecl;external libname name 'LLVMAddTypeName'; +procedure LLVMDeleteTypeName(M:LLVMModuleRef; Name:pchar);cdecl;external libname name 'LLVMDeleteTypeName'; +function LLVMGetTypeByName(M:LLVMModuleRef; Name:pchar):LLVMTypeRef;cdecl;external libname name 'LLVMGetTypeByName'; +{* See Module::dump. } +procedure LLVMDumpModule(M:LLVMModuleRef);cdecl;external libname name 'LLVMDumpModule'; +{===-- Types -------------------------------------------------------------=== } +{ LLVM types conform to the following hierarchy: + * + * types: + * integer type + * real type + * function type + * sequence types: + * array type + * pointer type + * vector type + * void type + * label type + * opaque type + } +{* See llvm::LLVMTypeKind::getTypeID. } +function LLVMGetTypeKind(Ty:LLVMTypeRef):LLVMTypeKind;cdecl;external libname name 'LLVMGetTypeKind'; +{* See llvm::LLVMType::getContext. } +function LLVMGetTypeContext(Ty:LLVMTypeRef):LLVMContextRef;cdecl;external libname name 'LLVMGetTypeContext'; +{ Operations on integer types } +function LLVMInt1TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMInt1TypeInContext'; +function LLVMInt8TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMInt8TypeInContext'; +function LLVMInt16TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMInt16TypeInContext'; +function LLVMInt32TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMInt32TypeInContext'; +function LLVMInt64TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMInt64TypeInContext'; +function LLVMIntTypeInContext(C:LLVMContextRef; NumBits:dword):LLVMTypeRef;cdecl;external libname name 'LLVMIntTypeInContext'; +function LLVMInt1Type:LLVMTypeRef;cdecl;external libname name 'LLVMInt1Type'; +function LLVMInt8Type:LLVMTypeRef;cdecl;external libname name 'LLVMInt8Type'; +function LLVMInt16Type:LLVMTypeRef;cdecl;external libname name 'LLVMInt16Type'; +function LLVMInt32Type:LLVMTypeRef;cdecl;external libname name 'LLVMInt32Type'; +function LLVMInt64Type:LLVMTypeRef;cdecl;external libname name 'LLVMInt64Type'; +function LLVMIntType(NumBits:dword):LLVMTypeRef;cdecl;external libname name 'LLVMIntType'; +function LLVMGetIntTypeWidth(IntegerTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMGetIntTypeWidth'; +{ Operations on real types } +function LLVMFloatTypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMFloatTypeInContext'; +function LLVMDoubleTypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMDoubleTypeInContext'; +function LLVMX86FP80TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMX86FP80TypeInContext'; +function LLVMFP128TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMFP128TypeInContext'; +function LLVMPPCFP128TypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMPPCFP128TypeInContext'; +function LLVMFloatType:LLVMTypeRef;cdecl;external libname name 'LLVMFloatType'; +function LLVMDoubleType:LLVMTypeRef;cdecl;external libname name 'LLVMDoubleType'; +function LLVMX86FP80Type:LLVMTypeRef;cdecl;external libname name 'LLVMX86FP80Type'; +function LLVMFP128Type:LLVMTypeRef;cdecl;external libname name 'LLVMFP128Type'; +function LLVMPPCFP128Type:LLVMTypeRef;cdecl;external libname name 'LLVMPPCFP128Type'; +{ Operations on function types } +function LLVMFunctionType(ReturnType:LLVMTypeRef; ParamTypes:pLLVMTypeRef; ParamCount:dword; IsVarArg:longint):LLVMTypeRef;cdecl;external libname name 'LLVMFunctionType'; +function LLVMIsFunctionVarArg(FunctionTy:LLVMTypeRef):longint;cdecl;external libname name 'LLVMIsFunctionVarArg'; +function LLVMGetReturnType(FunctionTy:LLVMTypeRef):LLVMTypeRef;cdecl;external libname name 'LLVMGetReturnType'; +function LLVMCountParamTypes(FunctionTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMCountParamTypes'; +procedure LLVMGetParamTypes(FunctionTy:LLVMTypeRef; Dest:pLLVMTypeRef);cdecl;external libname name 'LLVMGetParamTypes'; +{ Operations on struct types } +function LLVMStructTypeInContext(C:LLVMContextRef; ElementTypes:pLLVMTypeRef; + ElementCount:dword; + isPacked:longint):LLVMTypeRef;cdecl;external libname name 'LLVMStructTypeInContext'; +function LLVMStructType(ElementTypes:pLLVMTypeRef; ElementCount:dword; + isPacked:longint):LLVMTypeRef;cdecl;external libname name 'LLVMStructType'; +function LLVMCountStructElementTypes(StructTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMCountStructElementTypes'; +procedure LLVMGetStructElementTypes(StructTy:LLVMTypeRef; Dest:pLLVMTypeRef);cdecl;external libname name 'LLVMGetStructElementTypes'; +function LLVMIsPackedStruct(StructTy:LLVMTypeRef):longint;cdecl;external libname name 'LLVMIsPackedStruct'; +{ Operations on array, pointer, and vector types (sequence types) } +function LLVMArrayType(ElementType:LLVMTypeRef; ElementCount:dword):LLVMTypeRef;cdecl;external libname name 'LLVMArrayType'; +function LLVMPointerType(ElementType:LLVMTypeRef; AddressSpace:dword):LLVMTypeRef;cdecl;external libname name 'LLVMPointerType'; +function LLVMVectorType(ElementType:LLVMTypeRef; ElementCount:dword):LLVMTypeRef;cdecl;external libname name 'LLVMVectorType'; +function LLVMGetElementType(Ty:LLVMTypeRef):LLVMTypeRef;cdecl;external libname name 'LLVMGetElementType'; +function LLVMGetArrayLength(ArrayTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMGetArrayLength'; +function LLVMGetPointerAddressSpace(PointerTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMGetPointerAddressSpace'; +function LLVMGetVectorSize(VectorTy:LLVMTypeRef):dword;cdecl;external libname name 'LLVMGetVectorSize'; +{ Operations on other types } +function LLVMVoidTypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMVoidTypeInContext'; +function LLVMLabelTypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMLabelTypeInContext'; +function LLVMOpaqueTypeInContext(C:LLVMContextRef):LLVMTypeRef;cdecl;external libname name 'LLVMOpaqueTypeInContext'; +function LLVMVoidType:LLVMTypeRef;cdecl;external libname name 'LLVMVoidType'; +function LLVMLabelType:LLVMTypeRef;cdecl;external libname name 'LLVMLabelType'; +function LLVMOpaqueType:LLVMTypeRef;cdecl;external libname name 'LLVMOpaqueType'; +{ Operations on type handles } +function LLVMCreateTypeHandle(PotentiallyAbstractTy:LLVMTypeRef):LLVMTypeHandleRef;cdecl;external libname name 'LLVMCreateTypeHandle'; +procedure LLVMRefineType(AbstractTy:LLVMTypeRef; ConcreteTy:LLVMTypeRef);cdecl;external libname name 'LLVMRefineType'; +function LLVMResolveTypeHandle(TypeHandle:LLVMTypeHandleRef):LLVMTypeRef;cdecl;external libname name 'LLVMResolveTypeHandle'; +procedure LLVMDisposeTypeHandle(TypeHandle:LLVMTypeHandleRef);cdecl;external libname name 'LLVMDisposeTypeHandle'; +{ Operations on all values } +function LLVMTypeOf(Val:LLVMValueRef):LLVMTypeRef;cdecl;external libname name 'LLVMTypeOf'; +function LLVMGetValueName(Val:LLVMValueRef):pchar;cdecl;external libname name 'LLVMGetValueName'; +procedure LLVMSetValueName(Val:LLVMValueRef; Name:pchar);cdecl;external libname name 'LLVMSetValueName'; +procedure LLVMDumpValue(Val:LLVMValueRef);cdecl;external libname name 'LLVMDumpValue'; +procedure LLVMReplaceAllUsesWith(OldVal:LLVMValueRef; NewVal:LLVMValueRef);cdecl;external libname name 'LLVMReplaceAllUsesWith'; +{ Conversion functions. Return the input value if it is an instance of the + specified class, otherwise NULL. See llvm::dyn_cast_or_null<>. } +function LLVMIsAArgument(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAArgument'; +function LLVMIsABasicBlock(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsABasicBlock'; +function LLVMIsAInlineAsm(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAInlineAsm'; +function LLVMIsAUser(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUser'; +function LLVMIsAConstant(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstant'; +function LLVMIsAConstantAggregateZero(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantAggregateZero'; +function LLVMIsAConstantArray(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantArray'; +function LLVMIsAConstantExpr(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantExpr'; +function LLVMIsAConstantFP(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantFP'; +function LLVMIsAConstantInt(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantInt'; +function LLVMIsAConstantPointerNull(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantPointerNull'; +function LLVMIsAConstantStruct(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantStruct'; +function LLVMIsAConstantVector(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAConstantVector'; +function LLVMIsAGlobalValue(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAGlobalValue'; +function LLVMIsAFunction(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFunction'; +function LLVMIsAGlobalAlias(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAGlobalAlias'; +function LLVMIsAGlobalVariable(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAGlobalVariable'; +function LLVMIsAUndefValue(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUndefValue'; +function LLVMIsAInstruction(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAInstruction'; +function LLVMIsABinaryOperator(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsABinaryOperator'; +function LLVMIsACallInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsACallInst'; +function LLVMIsAIntrinsicInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAIntrinsicInst'; +function LLVMIsADbgInfoIntrinsic(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgInfoIntrinsic'; +function LLVMIsADbgDeclareInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgDeclareInst'; +function LLVMIsADbgFuncStartInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgFuncStartInst'; +function LLVMIsADbgRegionEndInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgRegionEndInst'; +function LLVMIsADbgRegionStartInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgRegionStartInst'; +function LLVMIsADbgStopPointInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsADbgStopPointInst'; +function LLVMIsAEHSelectorInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAEHSelectorInst'; +function LLVMIsAMemIntrinsic(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAMemIntrinsic'; +function LLVMIsAMemCpyInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAMemCpyInst'; +function LLVMIsAMemMoveInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAMemMoveInst'; +function LLVMIsAMemSetInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAMemSetInst'; +function LLVMIsACmpInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsACmpInst'; +function LLVMIsAFCmpInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFCmpInst'; +function LLVMIsAICmpInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAICmpInst'; +function LLVMIsAExtractElementInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAExtractElementInst'; +function LLVMIsAGetElementPtrInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAGetElementPtrInst'; +function LLVMIsAInsertElementInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAInsertElementInst'; +function LLVMIsAInsertValueInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAInsertValueInst'; +function LLVMIsAPHINode(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAPHINode'; +function LLVMIsASelectInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsASelectInst'; +function LLVMIsAShuffleVectorInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAShuffleVectorInst'; +function LLVMIsAStoreInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAStoreInst'; +function LLVMIsATerminatorInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsATerminatorInst'; +function LLVMIsABranchInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsABranchInst'; +function LLVMIsAInvokeInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAInvokeInst'; +function LLVMIsAReturnInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAReturnInst'; +function LLVMIsASwitchInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsASwitchInst'; +function LLVMIsAUnreachableInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUnreachableInst'; +function LLVMIsAUnwindInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUnwindInst'; +function LLVMIsAUnaryInstruction(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUnaryInstruction'; +function LLVMIsAAllocationInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAAllocationInst'; +function LLVMIsAAllocaInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAAllocaInst'; +function LLVMIsACastInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsACastInst'; +function LLVMIsABitCastInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsABitCastInst'; +function LLVMIsAFPExtInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFPExtInst'; +function LLVMIsAFPToSIInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFPToSIInst'; +function LLVMIsAFPToUIInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFPToUIInst'; +function LLVMIsAFPTruncInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFPTruncInst'; +function LLVMIsAIntToPtrInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAIntToPtrInst'; +function LLVMIsAPtrToIntInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAPtrToIntInst'; +function LLVMIsASExtInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsASExtInst'; +function LLVMIsASIToFPInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsASIToFPInst'; +function LLVMIsATruncInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsATruncInst'; +function LLVMIsAUIToFPInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAUIToFPInst'; +function LLVMIsAZExtInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAZExtInst'; +function LLVMIsAExtractValueInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAExtractValueInst'; +function LLVMIsAFreeInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAFreeInst'; +function LLVMIsALoadInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsALoadInst'; +function LLVMIsAVAArgInst(Val:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMIsAVAArgInst'; +{ Operations on Uses } +function LLVMGetFirstUse(Val:LLVMValueRef):LLVMUseIteratorRef;cdecl;external libname name 'LLVMGetFirstUse'; +function LLVMGetNextUse(U:LLVMUseIteratorRef):LLVMUseIteratorRef;cdecl;external libname name 'LLVMGetNextUse'; +function LLVMGetUser(U:LLVMUseIteratorRef):LLVMValueRef;cdecl;external libname name 'LLVMGetUser'; +function LLVMGetUsedValue(U:LLVMUseIteratorRef):LLVMValueRef;cdecl;external libname name 'LLVMGetUsedValue'; +{ Operations on Users } +function LLVMGetOperand(Val:LLVMValueRef; Index:dword):LLVMValueRef;cdecl;external libname name 'LLVMGetOperand'; +{ Operations on constants of any type } +function LLVMConstNull(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstNull'; +{ all zeroes } +function LLVMConstAllOnes(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstAllOnes'; +{ only for int/vector } +function LLVMGetUndef(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMGetUndef'; +function LLVMIsConstant(Val:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsConstant'; +function LLVMIsNull(Val:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsNull'; +function LLVMIsUndef(Val:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsUndef'; +function LLVMConstPointerNull(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstPointerNull'; +{ Operations on scalar constants } +function LLVMConstInt(IntTy:LLVMTypeRef; N:qword; SignExtend:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstInt'; +function LLVMConstIntOfString(IntTy:LLVMTypeRef; Text:pchar; Radix:uint8_t):LLVMValueRef;cdecl;external libname name 'LLVMConstIntOfString'; +function LLVMConstIntOfStringAndSize(IntTy:LLVMTypeRef; Text:pchar; SLen:dword; Radix:uint8_t):LLVMValueRef;cdecl;external libname name 'LLVMConstIntOfStringAndSize'; +function LLVMConstReal(RealTy:LLVMTypeRef; N:double):LLVMValueRef;cdecl;external libname name 'LLVMConstReal'; +function LLVMConstRealOfString(RealTy:LLVMTypeRef; Text:pchar):LLVMValueRef;cdecl;external libname name 'LLVMConstRealOfString'; +function LLVMConstRealOfStringAndSize(RealTy:LLVMTypeRef; Text:pchar; SLen:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstRealOfStringAndSize'; +function LLVMConstIntGetZExtValue(ConstantVal:LLVMValueRef):qword;cdecl;external libname name 'LLVMConstIntGetZExtValue'; +function LLVMConstIntGetSExtValue(ConstantVal:LLVMValueRef):int64;cdecl;external libname name 'LLVMConstIntGetSExtValue'; +{ Operations on composite constants } +function LLVMConstStringInContext(C:LLVMContextRef; Str:pchar; Length:dword; DontNullTerminate:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstStringInContext'; +function LLVMConstStructInContext(C:LLVMContextRef; + ConstantVals:pLLVMValueRef; Count:dword; isPacked:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstStructInContext'; +function LLVMConstString(Str:pchar; Length:dword; DontNullTerminate:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstString'; +function LLVMConstArray(ElementTy:LLVMTypeRef; ConstantVals:pLLVMValueRef; Length:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstArray'; +function LLVMConstStruct(ConstantVals:pLLVMValueRef; Count:dword; isPacked:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstStruct'; +function LLVMConstVector(ScalarConstantVals:pLLVMValueRef; Size:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstVector'; +{ Constant expressions } +function LLVMGetConstOpcode(ConstantVal:LLVMValueRef):LLVMOpcode;cdecl;external libname name 'LLVMGetConstOpcode'; +function LLVMAlignOf(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMAlignOf'; +function LLVMSizeOf(Ty:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMSizeOf'; +function LLVMConstNeg(ConstantVal:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstNeg'; +function LLVMConstFNeg(ConstantVal:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFNeg'; +function LLVMConstNot(ConstantVal:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstNot'; +function LLVMConstAdd(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstAdd'; +function LLVMConstNSWAdd(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstNSWAdd'; +function LLVMConstFAdd(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFAdd'; +function LLVMConstSub(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSub'; +function LLVMConstFSub(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFSub'; +function LLVMConstMul(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstMul'; +function LLVMConstFMul(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFMul'; +function LLVMConstUDiv(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstUDiv'; +function LLVMConstSDiv(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSDiv'; +function LLVMConstExactSDiv(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstExactSDiv'; +function LLVMConstFDiv(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFDiv'; +function LLVMConstURem(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstURem'; +function LLVMConstSRem(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSRem'; +function LLVMConstFRem(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFRem'; +function LLVMConstAnd(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstAnd'; +function LLVMConstOr(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstOr'; +function LLVMConstXor(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstXor'; +function LLVMConstICmp(Predicate:LLVMIntPredicate; LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstICmp'; +function LLVMConstFCmp(Predicate:LLVMRealPredicate; LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFCmp'; +function LLVMConstShl(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstShl'; +function LLVMConstLShr(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstLShr'; +function LLVMConstAShr(LHSConstant:LLVMValueRef; RHSConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstAShr'; +function LLVMConstGEP(ConstantVal:LLVMValueRef; ConstantIndices:pLLVMValueRef; NumIndices:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstGEP'; +function LLVMConstInBoundsGEP(ConstantVal:LLVMValueRef; ConstantIndices:pLLVMValueRef; NumIndices:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstInBoundsGEP'; +function LLVMConstTrunc(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstTrunc'; +function LLVMConstSExt(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSExt'; +function LLVMConstZExt(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstZExt'; +function LLVMConstFPTrunc(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFPTrunc'; +function LLVMConstFPExt(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFPExt'; +function LLVMConstUIToFP(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstUIToFP'; +function LLVMConstSIToFP(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSIToFP'; +function LLVMConstFPToUI(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFPToUI'; +function LLVMConstFPToSI(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFPToSI'; +function LLVMConstPtrToInt(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstPtrToInt'; +function LLVMConstIntToPtr(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstIntToPtr'; +function LLVMConstBitCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstBitCast'; +function LLVMConstZExtOrBitCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstZExtOrBitCast'; +function LLVMConstSExtOrBitCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSExtOrBitCast'; +function LLVMConstTruncOrBitCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstTruncOrBitCast'; +function LLVMConstPointerCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstPointerCast'; +function LLVMConstIntCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef; isSigned:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstIntCast'; +function LLVMConstFPCast(ConstantVal:LLVMValueRef; ToType:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMConstFPCast'; +function LLVMConstSelect(ConstantCondition:LLVMValueRef; ConstantIfTrue:LLVMValueRef; ConstantIfFalse:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstSelect'; +function LLVMConstExtractElement(VectorConstant:LLVMValueRef; IndexConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstExtractElement'; +function LLVMConstInsertElement(VectorConstant:LLVMValueRef; ElementValueConstant:LLVMValueRef; IndexConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstInsertElement'; +function LLVMConstShuffleVector(VectorAConstant:LLVMValueRef; VectorBConstant:LLVMValueRef; MaskConstant:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMConstShuffleVector'; +function LLVMConstExtractValue(AggConstant:LLVMValueRef; IdxList:pdword; NumIdx:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstExtractValue'; +function LLVMConstInsertValue(AggConstant:LLVMValueRef; ElementValueConstant:LLVMValueRef; IdxList:pdword; NumIdx:dword):LLVMValueRef;cdecl;external libname name 'LLVMConstInsertValue'; + +function LLVMConstInlineAsm(Ty:LLVMTypeRef; AsmString:pchar; Constraints:pchar; HasSideEffects:longint):LLVMValueRef;cdecl;external libname name 'LLVMConstInlineAsm'; +{ Operations on global variables, functions, and aliases (globals) } +function LLVMGetGlobalParent(Global:LLVMValueRef):LLVMModuleRef;cdecl;external libname name 'LLVMGetGlobalParent'; +function LLVMIsDeclaration(Global:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsDeclaration'; +function LLVMGetLinkage(Global:LLVMValueRef):LLVMLinkage;cdecl;external libname name 'LLVMGetLinkage'; +procedure LLVMSetLinkage(Global:LLVMValueRef; Linkage:LLVMLinkage);cdecl;external libname name 'LLVMSetLinkage'; +function LLVMGetSection(Global:LLVMValueRef):pchar;cdecl;external libname name 'LLVMGetSection'; +procedure LLVMSetSection(Global:LLVMValueRef; Section:pchar);cdecl;external libname name 'LLVMSetSection'; +function LLVMGetVisibility(Global:LLVMValueRef):LLVMVisibility;cdecl;external libname name 'LLVMGetVisibility'; +procedure LLVMSetVisibility(Global:LLVMValueRef; Viz:LLVMVisibility);cdecl;external libname name 'LLVMSetVisibility'; +function LLVMGetAlignment(Global:LLVMValueRef):dword;cdecl;external libname name 'LLVMGetAlignment'; +procedure LLVMSetAlignment(Global:LLVMValueRef; Bytes:dword);cdecl;external libname name 'LLVMSetAlignment'; +{ Operations on global variables } + +function LLVMAddGlobal(M:LLVMModuleRef; Ty:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMAddGlobal'; + +function LLVMGetNamedGlobal(M:LLVMModuleRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMGetNamedGlobal'; +function LLVMGetFirstGlobal(M:LLVMModuleRef):LLVMValueRef;cdecl;external libname name 'LLVMGetFirstGlobal'; +function LLVMGetLastGlobal(M:LLVMModuleRef):LLVMValueRef;cdecl;external libname name 'LLVMGetLastGlobal'; +function LLVMGetNextGlobal(GlobalVar:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetNextGlobal'; +function LLVMGetPreviousGlobal(GlobalVar:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetPreviousGlobal'; +procedure LLVMDeleteGlobal(GlobalVar:LLVMValueRef);cdecl;external libname name 'LLVMDeleteGlobal'; +function LLVMGetInitializer(GlobalVar:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetInitializer'; +procedure LLVMSetInitializer(GlobalVar:LLVMValueRef; ConstantVal:LLVMValueRef);cdecl;external libname name 'LLVMSetInitializer'; +function LLVMIsThreadLocal(GlobalVar:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsThreadLocal'; +procedure LLVMSetThreadLocal(GlobalVar:LLVMValueRef; IsThreadLocal:longint);cdecl;external libname name 'LLVMSetThreadLocal'; +function LLVMIsGlobalConstant(GlobalVar:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsGlobalConstant'; +procedure LLVMSetGlobalConstant(GlobalVar:LLVMValueRef; IsConstant:longint);cdecl;external libname name 'LLVMSetGlobalConstant'; +{ Operations on aliases } +function LLVMAddAlias(M:LLVMModuleRef; Ty:LLVMTypeRef; Aliasee:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMAddAlias'; +{ Operations on functions } +function LLVMAddFunction(M:LLVMModuleRef; Name:pchar; FunctionTy:LLVMTypeRef):LLVMValueRef;cdecl;external libname name 'LLVMAddFunction'; +function LLVMGetNamedFunction(M:LLVMModuleRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMGetNamedFunction'; +function LLVMGetFirstFunction(M:LLVMModuleRef):LLVMValueRef;cdecl;external libname name 'LLVMGetFirstFunction'; +function LLVMGetLastFunction(M:LLVMModuleRef):LLVMValueRef;cdecl;external libname name 'LLVMGetLastFunction'; +function LLVMGetNextFunction(Fn:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetNextFunction'; +function LLVMGetPreviousFunction(Fn:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetPreviousFunction'; +procedure LLVMDeleteFunction(Fn:LLVMValueRef);cdecl;external libname name 'LLVMDeleteFunction'; +function LLVMGetIntrinsicID(Fn:LLVMValueRef):dword;cdecl;external libname name 'LLVMGetIntrinsicID'; +function LLVMGetFunctionCallConv(Fn:LLVMValueRef):dword;cdecl;external libname name 'LLVMGetFunctionCallConv'; +procedure LLVMSetFunctionCallConv(Fn:LLVMValueRef; CC:dword);cdecl;external libname name 'LLVMSetFunctionCallConv'; +function LLVMGetGC(Fn:LLVMValueRef):pchar;cdecl;external libname name 'LLVMGetGC'; +procedure LLVMSetGC(Fn:LLVMValueRef; Name:pchar);cdecl;external libname name 'LLVMSetGC'; +procedure LLVMAddFunctionAttr(Fn:LLVMValueRef; PA:LLVMAttribute);cdecl;external libname name 'LLVMAddFunctionAttr'; +function LLVMGetFunctionAttr(Fn:LLVMValueRef):LLVMAttribute;cdecl;external libname name 'LLVMGetFunctionAttr'; +procedure LLVMRemoveFunctionAttr(Fn:LLVMValueRef; PA:LLVMAttribute);cdecl;external libname name 'LLVMRemoveFunctionAttr'; +{ Operations on parameters } +function LLVMCountParams(Fn:LLVMValueRef):dword;cdecl;external libname name 'LLVMCountParams'; +procedure LLVMGetParams(Fn:LLVMValueRef; Params:pLLVMValueRef);cdecl;external libname name 'LLVMGetParams'; +function LLVMGetParam(Fn:LLVMValueRef; Index:dword):LLVMValueRef;cdecl;external libname name 'LLVMGetParam'; +function LLVMGetParamParent(Inst:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetParamParent'; +function LLVMGetFirstParam(Fn:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetFirstParam'; +function LLVMGetLastParam(Fn:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetLastParam'; +function LLVMGetNextParam(Arg:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetNextParam'; +function LLVMGetPreviousParam(Arg:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetPreviousParam'; +procedure LLVMAddAttribute(Arg:LLVMValueRef; PA:LLVMAttribute);cdecl;external libname name 'LLVMAddAttribute'; +procedure LLVMRemoveAttribute(Arg:LLVMValueRef; PA:LLVMAttribute);cdecl;external libname name 'LLVMRemoveAttribute'; +function LLVMGetAttribute(Arg:LLVMValueRef):LLVMAttribute;cdecl;external libname name 'LLVMGetAttribute'; +procedure LLVMSetParamAlignment(Arg:LLVMValueRef; align:dword);cdecl;external libname name 'LLVMSetParamAlignment'; +{ Operations on basic blocks } +function LLVMBasicBlockAsValue(BB:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMBasicBlockAsValue'; +function LLVMValueIsBasicBlock(Val:LLVMValueRef):longint;cdecl;external libname name 'LLVMValueIsBasicBlock'; +function LLVMValueAsBasicBlock(Val:LLVMValueRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMValueAsBasicBlock'; +function LLVMGetBasicBlockParent(BB:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMGetBasicBlockParent'; +function LLVMCountBasicBlocks(Fn:LLVMValueRef):dword;cdecl;external libname name 'LLVMCountBasicBlocks'; +procedure LLVMGetBasicBlocks(Fn:LLVMValueRef; BasicBlocks:pLLVMBasicBlockRef);cdecl;external libname name 'LLVMGetBasicBlocks'; +function LLVMGetFirstBasicBlock(Fn:LLVMValueRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetFirstBasicBlock'; +function LLVMGetLastBasicBlock(Fn:LLVMValueRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetLastBasicBlock'; +function LLVMGetNextBasicBlock(BB:LLVMBasicBlockRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetNextBasicBlock'; +function LLVMGetPreviousBasicBlock(BB:LLVMBasicBlockRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetPreviousBasicBlock'; +function LLVMGetEntryBasicBlock(Fn:LLVMValueRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetEntryBasicBlock'; +function LLVMAppendBasicBlockInContext(C:LLVMContextRef; Fn:LLVMValueRef; Name:pchar):LLVMBasicBlockRef;cdecl;external libname name 'LLVMAppendBasicBlockInContext'; +function LLVMInsertBasicBlockInContext(C:LLVMContextRef; BB:LLVMBasicBlockRef; Name:pchar):LLVMBasicBlockRef;cdecl;external libname name 'LLVMInsertBasicBlockInContext'; +function LLVMAppendBasicBlock(Fn:LLVMValueRef; Name:pchar):LLVMBasicBlockRef;cdecl;external libname name 'LLVMAppendBasicBlock'; +function LLVMInsertBasicBlock(InsertBeforeBB:LLVMBasicBlockRef; Name:pchar):LLVMBasicBlockRef;cdecl;external libname name 'LLVMInsertBasicBlock'; +procedure LLVMDeleteBasicBlock(BB:LLVMBasicBlockRef);cdecl;external libname name 'LLVMDeleteBasicBlock'; +{ Operations on instructions } +function LLVMGetInstructionParent(Inst:LLVMValueRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetInstructionParent'; +function LLVMGetFirstInstruction(BB:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMGetFirstInstruction'; +function LLVMGetLastInstruction(BB:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMGetLastInstruction'; +function LLVMGetNextInstruction(Inst:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetNextInstruction'; +function LLVMGetPreviousInstruction(Inst:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMGetPreviousInstruction'; +{ Operations on call sites } +procedure LLVMSetInstructionCallConv(Instr:LLVMValueRef; CC:dword);cdecl;external libname name 'LLVMSetInstructionCallConv'; +function LLVMGetInstructionCallConv(Instr:LLVMValueRef):dword;cdecl;external libname name 'LLVMGetInstructionCallConv'; +procedure LLVMAddInstrAttribute(Instr:LLVMValueRef; index:dword; para3:LLVMAttribute);cdecl;external libname name 'LLVMAddInstrAttribute'; +procedure LLVMRemoveInstrAttribute(Instr:LLVMValueRef; index:dword; para3:LLVMAttribute);cdecl;external libname name 'LLVMRemoveInstrAttribute'; +procedure LLVMSetInstrParamAlignment(Instr:LLVMValueRef; index:dword; align:dword);cdecl;external libname name 'LLVMSetInstrParamAlignment'; +{ Operations on call instructions (only) } +function LLVMIsTailCall(CallInst:LLVMValueRef):longint;cdecl;external libname name 'LLVMIsTailCall'; +procedure LLVMSetTailCall(CallInst:LLVMValueRef; IsTailCall:longint);cdecl;external libname name 'LLVMSetTailCall'; +{ Operations on phi nodes } +procedure LLVMAddIncoming(PhiNode:LLVMValueRef; IncomingValues:pLLVMValueRef; IncomingBlocks:pLLVMBasicBlockRef; Count:dword);cdecl;external libname name 'LLVMAddIncoming'; +function LLVMCountIncoming(PhiNode:LLVMValueRef):dword;cdecl;external libname name 'LLVMCountIncoming'; +function LLVMGetIncomingValue(PhiNode:LLVMValueRef; Index:dword):LLVMValueRef;cdecl;external libname name 'LLVMGetIncomingValue'; +function LLVMGetIncomingBlock(PhiNode:LLVMValueRef; Index:dword):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetIncomingBlock'; +{===-- Instruction builders ----------------------------------------------=== } +{ An instruction builder represents a point within a basic block, and is the + * exclusive means of building instructions using the C interface. + } +function LLVMCreateBuilderInContext(C:LLVMContextRef):LLVMBuilderRef;cdecl;external libname name 'LLVMCreateBuilderInContext'; +function LLVMCreateBuilder:LLVMBuilderRef;cdecl;external libname name 'LLVMCreateBuilder'; +procedure LLVMPositionBuilder(Builder:LLVMBuilderRef; Block:LLVMBasicBlockRef; Instr:LLVMValueRef);cdecl;external libname name 'LLVMPositionBuilder'; +procedure LLVMPositionBuilderBefore(Builder:LLVMBuilderRef; Instr:LLVMValueRef);cdecl;external libname name 'LLVMPositionBuilderBefore'; +procedure LLVMPositionBuilderAtEnd(Builder:LLVMBuilderRef; Block:LLVMBasicBlockRef);cdecl;external libname name 'LLVMPositionBuilderAtEnd'; +function LLVMGetInsertBlock(Builder:LLVMBuilderRef):LLVMBasicBlockRef;cdecl;external libname name 'LLVMGetInsertBlock'; +procedure LLVMClearInsertionPosition(Builder:LLVMBuilderRef);cdecl;external libname name 'LLVMClearInsertionPosition'; +procedure LLVMInsertIntoBuilder(Builder:LLVMBuilderRef; Instr:LLVMValueRef);cdecl;external libname name 'LLVMInsertIntoBuilder'; +procedure LLVMInsertIntoBuilderWithName(Builder:LLVMBuilderRef; Instr:LLVMValueRef; Name:pchar);cdecl;external libname name 'LLVMInsertIntoBuilderWithName'; +procedure LLVMDisposeBuilder(Builder:LLVMBuilderRef);cdecl;external libname name 'LLVMDisposeBuilder'; +{ Terminators } +function LLVMBuildRetVoid(para1:LLVMBuilderRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildRetVoid'; +function LLVMBuildRet(para1:LLVMBuilderRef; V:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildRet'; +function LLVMBuildAggregateRet(para1:LLVMBuilderRef; RetVals:pLLVMValueRef; N:dword):LLVMValueRef;cdecl;external libname name 'LLVMBuildAggregateRet'; +function LLVMBuildBr(para1:LLVMBuilderRef; Dest:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildBr'; +function LLVMBuildCondBr(para1:LLVMBuilderRef; Cond:LLVMValueRef; + ThenBranch:LLVMBasicBlockRef; ElseBranch:LLVMBasicBlockRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildCondBr'; +function LLVMBuildSwitch(para1:LLVMBuilderRef; V:LLVMValueRef; ElseBranch:LLVMBasicBlockRef; NumCases:dword):LLVMValueRef;cdecl;external libname name 'LLVMBuildSwitch'; +function LLVMBuildInvoke(para1:LLVMBuilderRef; Fn:LLVMValueRef; Args:pLLVMValueRef; NumArgs:dword; ThenBranch:LLVMBasicBlockRef; + Catch:LLVMBasicBlockRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildInvoke'; +function LLVMBuildUnwind(para1:LLVMBuilderRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildUnwind'; +function LLVMBuildUnreachable(para1:LLVMBuilderRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildUnreachable'; +{ Add a case to the switch instruction } +procedure LLVMAddCase(Switch:LLVMValueRef; OnVal:LLVMValueRef; Dest:LLVMBasicBlockRef);cdecl;external libname name 'LLVMAddCase'; +{ Arithmetic } +function LLVMBuildAdd(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildAdd'; +function LLVMBuildNSWAdd(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildNSWAdd'; +function LLVMBuildFAdd(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFAdd'; +function LLVMBuildSub(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSub'; +function LLVMBuildFSub(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFSub'; +function LLVMBuildMul(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildMul'; +function LLVMBuildFMul(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFMul'; +function LLVMBuildUDiv(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildUDiv'; +function LLVMBuildSDiv(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSDiv'; +function LLVMBuildExactSDiv(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildExactSDiv'; +function LLVMBuildFDiv(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFDiv'; +function LLVMBuildURem(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildURem'; +function LLVMBuildSRem(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSRem'; +function LLVMBuildFRem(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFRem'; +function LLVMBuildShl(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildShl'; +function LLVMBuildLShr(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildLShr'; +function LLVMBuildAShr(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildAShr'; +function LLVMBuildAnd(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildAnd'; +function LLVMBuildOr(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildOr'; +function LLVMBuildXor(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildXor'; +function LLVMBuildNeg(para1:LLVMBuilderRef; V:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildNeg'; +function LLVMBuildFNeg(para1:LLVMBuilderRef; V:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFNeg'; +function LLVMBuildNot(para1:LLVMBuilderRef; V:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildNot'; +{ Memory } +function LLVMBuildMalloc(para1:LLVMBuilderRef; Ty:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildMalloc'; +function LLVMBuildArrayMalloc(para1:LLVMBuilderRef; Ty:LLVMTypeRef; Val:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildArrayMalloc'; +function LLVMBuildAlloca(para1:LLVMBuilderRef; Ty:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildAlloca'; +function LLVMBuildArrayAlloca(para1:LLVMBuilderRef; Ty:LLVMTypeRef; Val:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildArrayAlloca'; +function LLVMBuildFree(para1:LLVMBuilderRef; PointerVal:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildFree'; +function LLVMBuildLoad(para1:LLVMBuilderRef; PointerVal:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildLoad'; +function LLVMBuildStore(para1:LLVMBuilderRef; Val:LLVMValueRef; Ptr:LLVMValueRef):LLVMValueRef;cdecl;external libname name 'LLVMBuildStore'; +function LLVMBuildGEP(B:LLVMBuilderRef; Pointer:LLVMValueRef; Indices:pLLVMValueRef; NumIndices:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildGEP'; +function LLVMBuildInBoundsGEP(B:LLVMBuilderRef; Pointer:LLVMValueRef; Indices:pLLVMValueRef; NumIndices:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildInBoundsGEP'; +function LLVMBuildStructGEP(B:LLVMBuilderRef; Pointer:LLVMValueRef; Idx:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildStructGEP'; +function LLVMBuildGlobalString(B:LLVMBuilderRef; Str:pchar; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildGlobalString'; +function LLVMBuildGlobalStringPtr(B:LLVMBuilderRef; Str:pchar; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildGlobalStringPtr'; +{ Casts } +function LLVMBuildTrunc(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildTrunc'; +function LLVMBuildZExt(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildZExt'; +function LLVMBuildSExt(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSExt'; +function LLVMBuildFPToUI(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFPToUI'; +function LLVMBuildFPToSI(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFPToSI'; +function LLVMBuildUIToFP(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildUIToFP'; +function LLVMBuildSIToFP(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSIToFP'; +function LLVMBuildFPTrunc(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFPTrunc'; +function LLVMBuildFPExt(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFPExt'; +function LLVMBuildPtrToInt(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildPtrToInt'; +function LLVMBuildIntToPtr(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildIntToPtr'; +function LLVMBuildBitCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildBitCast'; +function LLVMBuildZExtOrBitCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildZExtOrBitCast'; +function LLVMBuildSExtOrBitCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSExtOrBitCast'; +function LLVMBuildTruncOrBitCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildTruncOrBitCast'; +function LLVMBuildPointerCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildPointerCast'; +function LLVMBuildIntCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildIntCast'; +function LLVMBuildFPCast(para1:LLVMBuilderRef; Val:LLVMValueRef; DestTy:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFPCast'; +{ Comparisons } +function LLVMBuildICmp(para1:LLVMBuilderRef; Op:LLVMIntPredicate; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildICmp'; +function LLVMBuildFCmp(para1:LLVMBuilderRef; Op:LLVMRealPredicate; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildFCmp'; +{ Miscellaneous instructions } +function LLVMBuildPhi(para1:LLVMBuilderRef; Ty:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildPhi'; +function LLVMBuildCall(para1:LLVMBuilderRef; Fn:LLVMValueRef; Args:pLLVMValueRef; NumArgs:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildCall'; +function LLVMBuildSelect(para1:LLVMBuilderRef; Cond:LLVMValueRef; ThenBranch:LLVMValueRef; ElseBranch:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildSelect'; +function LLVMBuildVAArg(para1:LLVMBuilderRef; List:LLVMValueRef; Ty:LLVMTypeRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildVAArg'; +function LLVMBuildExtractElement(para1:LLVMBuilderRef; VecVal:LLVMValueRef; Index:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildExtractElement'; +function LLVMBuildInsertElement(para1:LLVMBuilderRef; VecVal:LLVMValueRef; EltVal:LLVMValueRef; Index:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildInsertElement'; +function LLVMBuildShuffleVector(para1:LLVMBuilderRef; V1:LLVMValueRef; V2:LLVMValueRef; Mask:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildShuffleVector'; +function LLVMBuildExtractValue(para1:LLVMBuilderRef; AggVal:LLVMValueRef; Index:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildExtractValue'; +function LLVMBuildInsertValue(para1:LLVMBuilderRef; AggVal:LLVMValueRef; EltVal:LLVMValueRef; Index:dword; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildInsertValue'; +function LLVMBuildIsNull(para1:LLVMBuilderRef; Val:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildIsNull'; +function LLVMBuildIsNotNull(para1:LLVMBuilderRef; Val:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildIsNotNull'; +function LLVMBuildPtrDiff(para1:LLVMBuilderRef; LHS:LLVMValueRef; RHS:LLVMValueRef; Name:pchar):LLVMValueRef;cdecl;external libname name 'LLVMBuildPtrDiff'; +{===-- Module providers --------------------------------------------------=== } +{ Encapsulates the module M in a module provider, taking ownership of the + * module. + * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider. + } +function LLVMCreateModuleProviderForExistingModule(M:LLVMModuleRef):LLVMModuleProviderRef;cdecl;external libname name 'LLVMCreateModuleProviderForExistingModule'; +{ Destroys the module provider MP as well as the contained module. + * See the destructor llvm::ModuleProvider::~ModuleProvider. + } +procedure LLVMDisposeModuleProvider(MP:LLVMModuleProviderRef);cdecl;external libname name 'LLVMDisposeModuleProvider'; +{===-- Memory buffers ----------------------------------------------------=== } +function LLVMCreateMemoryBufferWithContentsOfFile(Path:pchar; OutMemBuf:pLLVMMemoryBufferRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMCreateMemoryBufferWithContentsOfFile'; +function LLVMCreateMemoryBufferWithSTDIN(OutMemBuf:pLLVMMemoryBufferRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMCreateMemoryBufferWithSTDIN'; +procedure LLVMDisposeMemoryBuffer(MemBuf:LLVMMemoryBufferRef);cdecl;external libname name 'LLVMDisposeMemoryBuffer'; +{===-- Pass Managers -----------------------------------------------------=== } +{* Constructs a new whole-module pass pipeline. This type of pipeline is + suitable for link-time optimization and whole-module transformations. + See llvm::PassManager::PassManager. } +function LLVMCreatePassManager:LLVMPassManagerRef;cdecl;external libname name 'LLVMCreatePassManager'; +{* Constructs a new function-by-function pass pipeline over the module + provider. It does not take ownership of the module provider. This type of + pipeline is suitable for code generation and JIT compilation tasks. + See llvm::FunctionPassManager::FunctionPassManager. } +function LLVMCreateFunctionPassManager(MP:LLVMModuleProviderRef):LLVMPassManagerRef;cdecl;external libname name 'LLVMCreateFunctionPassManager'; +{* Initializes, executes on the provided module, and finalizes all of the + passes scheduled in the pass manager. Returns 1 if any of the passes + modified the module, 0 otherwise. See llvm::PassManager::run(Module&). } +function LLVMRunPassManager(PM:LLVMPassManagerRef; M:LLVMModuleRef):longint;cdecl;external libname name 'LLVMRunPassManager'; +{* Initializes all of the function passes scheduled in the function pass + manager. Returns 1 if any of the passes modified the module, 0 otherwise. + See llvm::FunctionPassManager::doInitialization. } +function LLVMInitializeFunctionPassManager(FPM:LLVMPassManagerRef):longint;cdecl;external libname name 'LLVMInitializeFunctionPassManager'; +{* Executes all of the function passes scheduled in the function pass manager + on the provided function. Returns 1 if any of the passes modified the + function, false otherwise. + See llvm::FunctionPassManager::run(Function&). } +function LLVMRunFunctionPassManager(FPM:LLVMPassManagerRef; F:LLVMValueRef):longint;cdecl;external libname name 'LLVMRunFunctionPassManager'; +{* Finalizes all of the function passes scheduled in in the function pass + manager. Returns 1 if any of the passes modified the module, 0 otherwise. + See llvm::FunctionPassManager::doFinalization. } +function LLVMFinalizeFunctionPassManager(FPM:LLVMPassManagerRef):longint;cdecl;external libname name 'LLVMFinalizeFunctionPassManager'; +{* Frees the memory of a pass pipeline. For function pipelines, does not free + the module provider. + See llvm::PassManagerBase::~PassManagerBase. } +procedure LLVMDisposePassManager(PM:LLVMPassManagerRef);cdecl;external libname name 'LLVMDisposePassManager'; +{ Analysis.h } +{ verifier will print to stderr and abort() } +{ verifier will print to stderr and return 1 } +{ verifier will just return 1 } +type + + LLVMVerifierFailureAction = (LLVMAbortProcessAction,LLVMPrintMessageAction, + LLVMReturnStatusAction); +{ Verifies that a module is valid, taking the specified action if not. + Optionally returns a human-readable description of any invalid constructs. + OutMessage must be disposed with LLVMDisposeMessage. } + +function LLVMVerifyModule(M:LLVMModuleRef; Action:LLVMVerifierFailureAction; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMVerifyModule'; +{ Verifies that a single function is valid, taking the specified action. Useful + for debugging. } +function LLVMVerifyFunction(Fn:LLVMValueRef; Action:LLVMVerifierFailureAction):longint;cdecl;external libname name 'LLVMVerifyFunction'; +{ Open up a ghostview window that displays the CFG of the current function. + Useful for debugging. } +procedure LLVMViewFunctionCFG(Fn:LLVMValueRef);cdecl;external libname name 'LLVMViewFunctionCFG'; +procedure LLVMViewFunctionCFGOnly(Fn:LLVMValueRef);cdecl;external libname name 'LLVMViewFunctionCFGOnly'; +{ BitReader.h } +{ Builds a module from the bitcode in the specified memory buffer, returning a + reference to the module via the OutModule parameter. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. }function LLVMParseBitcode(MemBuf:LLVMMemoryBufferRef; OutModule:pLLVMModuleRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMParseBitcode'; +function LLVMParseBitcodeInContext(ContextRef:LLVMContextRef; MemBuf:LLVMMemoryBufferRef; OutModule:pLLVMModuleRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMParseBitcodeInContext'; +{ Reads a module from the specified path, returning via the OutMP parameter + a module provider which performs lazy deserialization. Returns 0 on success. + Optionally returns a human-readable error message via OutMessage. }function LLVMGetBitcodeModuleProvider(MemBuf:LLVMMemoryBufferRef; OutMP:pLLVMModuleProviderRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMGetBitcodeModuleProvider'; +function LLVMGetBitcodeModuleProviderInContext(ContextRef:LLVMContextRef; MemBuf:LLVMMemoryBufferRef; OutMP:pLLVMModuleProviderRef; OutMessage:Ppchar):longint;cdecl;external libname name 'LLVMGetBitcodeModuleProviderInContext'; +{ BitWriter.h } +{===-- Operations on modules ---------------------------------------------=== } +{ Writes a module to an open file descriptor. Returns 0 on success. + Closes the Handle. Use dup first if this is not what you want. }function LLVMWriteBitcodeToFileHandle(M:LLVMModuleRef; Handle:longint):longint;cdecl;external libname name 'LLVMWriteBitcodeToFileHandle'; +{ Writes a module to the specified path. Returns 0 on success. }function LLVMWriteBitcodeToFile(M:LLVMModuleRef; Path:pchar):longint;cdecl;external libname name 'LLVMWriteBitcodeToFile'; +{ Target.h } + +const + LLVMBigEndian = 0; + LLVMLittleEndian = 1; +type + + LLVMByteOrdering = longint; + + LLVMTargetDataRef = LLVMOpaqueTargetData; + + LLVMStructLayoutRef = LLVMStructLayout; +{===-- Target Data -------------------------------------------------------=== } +{* Creates target data from a target layout string. + See the constructor llvm::TargetData::TargetData. } + +function LLVMCreateTargetData(StringRep:pchar):LLVMTargetDataRef;cdecl;external libname name 'LLVMCreateTargetData'; +{* Adds target data information to a pass manager. This does not take ownership + of the target data. + See the method llvm::PassManagerBase::add. } +procedure LLVMAddTargetData(para1:LLVMTargetDataRef; para2:LLVMPassManagerRef);cdecl;external libname name 'LLVMAddTargetData'; +{* Converts target data to a target layout string. The string must be disposed + with LLVMDisposeMessage. + See the constructor llvm::TargetData::TargetData. } +function LLVMCopyStringRepOfTargetData(para1:LLVMTargetDataRef):pchar;cdecl;external libname name 'LLVMCopyStringRepOfTargetData'; +{* Returns the byte order of a target, either LLVMBigEndian or + LLVMLittleEndian. + See the method llvm::TargetData::isLittleEndian. } +function LLVMByteOrder(para1:LLVMTargetDataRef):LLVMByteOrdering;cdecl;external libname name 'LLVMByteOrder'; +{* Returns the pointer size in bytes for a target. + See the method llvm::TargetData::getPointerSize. } +function LLVMPointerSize(para1:LLVMTargetDataRef):dword;cdecl;external libname name 'LLVMPointerSize'; +{* Returns the integer type that is the same size as a pointer on a target. + See the method llvm::TargetData::getIntPtrType. } +function LLVMIntPtrType(para1:LLVMTargetDataRef):LLVMTypeRef;cdecl;external libname name 'LLVMIntPtrType'; +{* Computes the size of a type in bytes for a target. + See the method llvm::TargetData::getTypeSizeInBits. } +function LLVMSizeOfTypeInBits(para1:LLVMTargetDataRef; para2:LLVMTypeRef):qword;cdecl;external libname name 'LLVMSizeOfTypeInBits'; +{* Computes the storage size of a type in bytes for a target. + See the method llvm::TargetData::getTypeStoreSize. } +function LLVMStoreSizeOfType(para1:LLVMTargetDataRef; para2:LLVMTypeRef):qword;cdecl;external libname name 'LLVMStoreSizeOfType'; +{* Computes the ABI size of a type in bytes for a target. + See the method llvm::TargetData::getTypeAllocSize. } +function LLVMABISizeOfType(para1:LLVMTargetDataRef; para2:LLVMTypeRef):qword;cdecl;external libname name 'LLVMABISizeOfType'; +{* Computes the ABI alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. } +function LLVMABIAlignmentOfType(para1:LLVMTargetDataRef; para2:LLVMTypeRef):dword;cdecl;external libname name 'LLVMABIAlignmentOfType'; +{* Computes the call frame alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. } +function LLVMCallFrameAlignmentOfType(para1:LLVMTargetDataRef; para2:LLVMTypeRef):dword;cdecl;external libname name 'LLVMCallFrameAlignmentOfType'; +{* Computes the preferred alignment of a type in bytes for a target. + See the method llvm::TargetData::getTypeABISize. } +function LLVMPreferredAlignmentOfType(para1:LLVMTargetDataRef; para2:LLVMTypeRef):dword;cdecl;external libname name 'LLVMPreferredAlignmentOfType'; +{* Computes the preferred alignment of a global variable in bytes for a target. + See the method llvm::TargetData::getPreferredAlignment. } +function LLVMPreferredAlignmentOfGlobal(para1:LLVMTargetDataRef; GlobalVar:LLVMValueRef):dword;cdecl;external libname name 'LLVMPreferredAlignmentOfGlobal'; +{* Computes the structure element that contains the byte offset for a target. + See the method llvm::StructLayout::getElementContainingOffset. } +function LLVMElementAtOffset(para1:LLVMTargetDataRef; StructTy:LLVMTypeRef; Offset:qword):dword;cdecl;external libname name 'LLVMElementAtOffset'; +{* Computes the byte offset of the indexed struct element for a target. + See the method llvm::StructLayout::getElementContainingOffset. } +function LLVMOffsetOfElement(para1:LLVMTargetDataRef; StructTy:LLVMTypeRef; Element:dword):qword;cdecl;external libname name 'LLVMOffsetOfElement'; +{* Struct layouts are speculatively cached. If a TargetDataRef is alive when + types are being refined and removed, this method must be called whenever a + struct type is removed to avoid a dangling pointer in this cache. + See the method llvm::TargetData::InvalidateStructLayoutInfo. } +procedure LLVMInvalidateStructLayout(para1:LLVMTargetDataRef; StructTy:LLVMTypeRef);cdecl;external libname name 'LLVMInvalidateStructLayout'; +{* Deallocates a TargetData. + See the destructor llvm::TargetData::~TargetData. } +procedure LLVMDisposeTargetData(para1:LLVMTargetDataRef);cdecl;external libname name 'LLVMDisposeTargetData'; +{ ExecutionEngine.h } +procedure LLVMLinkInJIT;cdecl;external libname name 'LLVMLinkInJIT'; +procedure LLVMLinkInInterpreter;cdecl;external libname name 'LLVMLinkInInterpreter'; +type + + LLVMGenericValueRef = LLVMOpaqueGenericValue; + + LLVMExecutionEngineRef = LLVMOpaqueExecutionEngine; +{===-- Operations on generic values --------------------------------------=== } + +function LLVMCreateGenericValueOfInt(Ty:LLVMTypeRef; N:qword; IsSigned:longint):LLVMGenericValueRef;cdecl;external libname name 'LLVMCreateGenericValueOfInt'; +function LLVMCreateGenericValueOfPointer(P:pointer):LLVMGenericValueRef;cdecl;external libname name 'LLVMCreateGenericValueOfPointer'; +function LLVMCreateGenericValueOfFloat(Ty:LLVMTypeRef; N:double):LLVMGenericValueRef;cdecl;external libname name 'LLVMCreateGenericValueOfFloat'; +function LLVMGenericValueIntWidth(GenValRef:LLVMGenericValueRef):dword;cdecl;external libname name 'LLVMGenericValueIntWidth'; +function LLVMGenericValueToInt(GenVal:LLVMGenericValueRef; IsSigned:longint):qword;cdecl;external libname name 'LLVMGenericValueToInt'; +function LLVMGenericValueToPointer(GenVal:LLVMGenericValueRef):pointer;cdecl;external libname name 'LLVMGenericValueToPointer'; +function LLVMGenericValueToFloat(TyRef:LLVMTypeRef; GenVal:LLVMGenericValueRef):double;cdecl;external libname name 'LLVMGenericValueToFloat'; +procedure LLVMDisposeGenericValue(GenVal:LLVMGenericValueRef);cdecl;external libname name 'LLVMDisposeGenericValue'; +{===-- Operations on execution engines -----------------------------------=== } +function LLVMCreateExecutionEngine(OutEE:pLLVMExecutionEngineRef; MP:LLVMModuleProviderRef; OutError:Ppchar):longint;cdecl;external libname name 'LLVMCreateExecutionEngine'; +function LLVMCreateInterpreter(OutInterp:pLLVMExecutionEngineRef; MP:LLVMModuleProviderRef; OutError:Ppchar):longint;cdecl;external libname name 'LLVMCreateInterpreter'; +function LLVMCreateJITCompiler(OutJIT:pLLVMExecutionEngineRef; MP:LLVMModuleProviderRef; OptLevel:dword; OutError:Ppchar):longint;cdecl;external libname name 'LLVMCreateJITCompiler'; +procedure LLVMDisposeExecutionEngine(EE:LLVMExecutionEngineRef);cdecl;external libname name 'LLVMDisposeExecutionEngine'; +procedure LLVMRunStaticConstructors(EE:LLVMExecutionEngineRef);cdecl;external libname name 'LLVMRunStaticConstructors'; +procedure LLVMRunStaticDestructors(EE:LLVMExecutionEngineRef);cdecl;external libname name 'LLVMRunStaticDestructors'; +(* Const before declarator ignored *) +(* Const before declarator ignored *) +function LLVMRunFunctionAsMain(EE:LLVMExecutionEngineRef; F:LLVMValueRef; ArgC:dword; ArgV:Ppchar; EnvP:Ppchar):longint;cdecl;external libname name 'LLVMRunFunctionAsMain'; +function LLVMRunFunction(EE:LLVMExecutionEngineRef; F:LLVMValueRef; NumArgs:dword; Args:pLLVMGenericValueRef):LLVMGenericValueRef;cdecl;external libname name 'LLVMRunFunction'; +procedure LLVMFreeMachineCodeForFunction(EE:LLVMExecutionEngineRef; F:LLVMValueRef);cdecl;external libname name 'LLVMFreeMachineCodeForFunction'; +procedure LLVMAddModuleProvider(EE:LLVMExecutionEngineRef; MP:LLVMModuleProviderRef);cdecl;external libname name 'LLVMAddModuleProvider'; +function LLVMRemoveModuleProvider(EE:LLVMExecutionEngineRef; MP:LLVMModuleProviderRef; OutMod:pLLVMModuleRef; OutError:Ppchar):longint;cdecl;external libname name 'LLVMRemoveModuleProvider'; +function LLVMFindFunction(EE:LLVMExecutionEngineRef; Name:pchar; OutFn:pLLVMValueRef):longint;cdecl;external libname name 'LLVMFindFunction'; +function LLVMGetExecutionEngineTargetData(EE:LLVMExecutionEngineRef):LLVMTargetDataRef;cdecl;external libname name 'LLVMGetExecutionEngineTargetData'; +procedure LLVMAddGlobalMapping(EE:LLVMExecutionEngineRef; Global:LLVMValueRef; Addr:pointer);cdecl;external libname name 'LLVMAddGlobalMapping'; +function LLVMGetPointerToGlobal(EE:LLVMExecutionEngineRef; Global:LLVMValueRef):pointer;cdecl;external libname name 'LLVMGetPointerToGlobal'; +{ LinkTimeOptimizer.h } +{/ This provides a dummy type for pointers to the LTO object. } +type + + llvm_lto_t = pointer; +{/ This provides a C-visible enumerator to manage status codes. } +{/ This should map exactly onto the C++ enumerator LTOStatus. } +{ Added C-specific error codes } + + llvm_lto_status = (LLVM_LTO_UNKNOWN,LLVM_LTO_OPT_SUCCESS, + LLVM_LTO_READ_SUCCESS,LLVM_LTO_READ_FAILURE, + LLVM_LTO_WRITE_FAILURE,LLVM_LTO_NO_TARGET, + LLVM_LTO_NO_WORK,LLVM_LTO_MODULE_MERGE_FAILURE, + LLVM_LTO_ASM_FAILURE,LLVM_LTO_NULL_OBJECT + ); + llvm_lto_status_t = llvm_lto_status; +{/ This provides C interface to initialize link time optimizer. This allows } +{/ linker to use dlopen() interface to dynamically load LinkTimeOptimizer. } +{/ extern "C" helps, because dlopen() interface uses name to find the symbol. } + +function llvm_create_optimizer:llvm_lto_t;cdecl;external libname name 'llvm_create_optimizer'; +procedure llvm_destroy_optimizer(lto:llvm_lto_t);cdecl;external libname name 'llvm_destroy_optimizer'; +function llvm_read_object_file(lto:llvm_lto_t; input_filename:pchar):llvm_lto_status_t;cdecl;external libname name 'llvm_read_object_file'; +function llvm_optimize_modules(lto:llvm_lto_t; output_filename:pchar):llvm_lto_status_t;cdecl;external libname name 'llvm_optimize_modules'; +{ lto.h } + +const + LTO_API_VERSION = 3; +{ log2 of alignment } +type + + lto_symbol_attributes = (LTO_SYMBOL_ALIGNMENT_MASK := $0000001F,LTO_SYMBOL_PERMISSIONS_MASK := $000000E0, + LTO_SYMBOL_PERMISSIONS_CODE := $000000A0,LTO_SYMBOL_PERMISSIONS_DATA := $000000C0, + LTO_SYMBOL_PERMISSIONS_RODATA := $00000080,LTO_SYMBOL_DEFINITION_MASK := $00000700, + LTO_SYMBOL_DEFINITION_REGULAR := $00000100,LTO_SYMBOL_DEFINITION_TENTATIVE := $00000200, + LTO_SYMBOL_DEFINITION_WEAK := $00000300,LTO_SYMBOL_DEFINITION_UNDEFINED := $00000400, + LTO_SYMBOL_DEFINITION_WEAKUNDEF := $00000500, + LTO_SYMBOL_SCOPE_MASK := $00003800,LTO_SYMBOL_SCOPE_INTERNAL := $00000800, + LTO_SYMBOL_SCOPE_HIDDEN := $00001000,LTO_SYMBOL_SCOPE_PROTECTED := $00002000, + LTO_SYMBOL_SCOPE_DEFAULT := $00001800); + + lto_debug_model = (LTO_DEBUG_MODEL_NONE := 0,LTO_DEBUG_MODEL_DWARF := 1 + ); + + lto_codegen_model = (LTO_CODEGEN_PIC_MODEL_STATIC := 0,LTO_CODEGEN_PIC_MODEL_DYNAMIC := 1, + LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC := 2 + ); +{* opaque reference to a loaded object module } + + lto_module_t = LTOModule; +{* opaque reference to a code generator } + + lto_code_gen_t = LTOCodeGenerator; +{* + * Returns a printable string. + } + +function lto_get_version:pchar;cdecl;external libname name 'lto_get_version'; +{* + * Returns the last error string or NULL if last operation was sucessful. + } +function lto_get_error_message:pchar;cdecl;external libname name 'lto_get_error_message'; +{* + * Checks if a file is a loadable object file. + } +function lto_module_is_object_file(path:pchar):bool;cdecl;external libname name 'lto_module_is_object_file'; +{* + * Checks if a file is a loadable object compiled for requested target. + } +function lto_module_is_object_file_for_target(path:pchar; target_triple_prefix:pchar):bool;cdecl;external libname name 'lto_module_is_object_file_for_target'; +{* + * Checks if a buffer is a loadable object file. + } +function lto_module_is_object_file_in_memory(mem:pointer; length:size_t):bool;cdecl;external libname name 'lto_module_is_object_file_in_memory'; +{* + * Checks if a buffer is a loadable object compiled for requested target. + } +function lto_module_is_object_file_in_memory_for_target(mem:pointer; length:size_t; target_triple_prefix:pchar):bool;cdecl;external libname name 'lto_module_is_object_file_in_memory_for_target'; +{* + * Loads an object file from disk. + * Returns NULL on error (check lto_get_error_message() for details). + } +function lto_module_create(path:pchar):lto_module_t;cdecl;external libname name 'lto_module_create'; +{* + * Loads an object file from memory. + * Returns NULL on error (check lto_get_error_message() for details). + } +function lto_module_create_from_memory(mem:pointer; length:size_t):lto_module_t;cdecl;external libname name 'lto_module_create_from_memory'; +{* + * Frees all memory internally allocated by the module. + * Upon return the lto_module_t is no longer valid. + } +procedure lto_module_dispose(module:lto_module_t);cdecl;external libname name 'lto_module_dispose'; +{* + * Returns triple string which the object module was compiled under. + } +function lto_module_get_target_triple(module:lto_module_t):pchar;cdecl;external libname name 'lto_module_get_target_triple'; +{* + * Returns the number of symbols in the object module. + } +function lto_module_get_num_symbols(module:lto_module_t):dword;cdecl;external libname name 'lto_module_get_num_symbols'; +{* + * Returns the name of the ith symbol in the object module. + } +function lto_module_get_symbol_name(module:lto_module_t; index:dword):pchar;cdecl;external libname name 'lto_module_get_symbol_name'; +{* + * Returns the attributes of the ith symbol in the object module. + } +function lto_module_get_symbol_attribute(module:lto_module_t; index:dword):lto_symbol_attributes;cdecl;external libname name 'lto_module_get_symbol_attribute'; +{* + * Instantiates a code generator. + * Returns NULL on error (check lto_get_error_message() for details). + } +function lto_codegen_create:lto_code_gen_t;cdecl;external libname name 'lto_codegen_create'; +{* + * Frees all code generator and all memory it internally allocated. + * Upon return the lto_code_gen_t is no longer valid. + } +procedure lto_codegen_dispose(para1:lto_code_gen_t);cdecl;external libname name 'lto_codegen_dispose'; +{* + * Add an object module to the set of modules for which code will be generated. + * Returns true on error (check lto_get_error_message() for details). + } +function lto_codegen_add_module(cg:lto_code_gen_t; module:lto_module_t):bool;cdecl;external libname name 'lto_codegen_add_module'; +{* + * Sets if debug info should be generated. + * Returns true on error (check lto_get_error_message() for details). + } +function lto_codegen_set_debug_model(cg:lto_code_gen_t; para2:lto_debug_model):bool;cdecl;external libname name 'lto_codegen_set_debug_model'; +{* + * Sets which PIC code model to generated. + * Returns true on error (check lto_get_error_message() for details). + } +function lto_codegen_set_pic_model(cg:lto_code_gen_t; + para2: lto_codegen_model): bool; +cdecl;external libname name 'lto_codegen_set_pic_model'; +{* + * Sets the location of the "gcc" to run. If not set, libLTO will search for + * "gcc" on the path. + } +procedure lto_codegen_set_gcc_path(cg:lto_code_gen_t; path:pchar); +cdecl;external libname name 'lto_codegen_set_gcc_path'; +{* + * Sets the location of the assembler tool to run. If not set, libLTO + * will use gcc to invoke the assembler. + } +procedure lto_codegen_set_assembler_path(cg:lto_code_gen_t; path:pchar); +cdecl;external libname name 'lto_codegen_set_assembler_path'; +{* + * Adds to a list of all global symbols that must exist in the final + * generated code. If a function is not listed, it might be + * inlined into every usage and optimized away. + } +procedure lto_codegen_add_must_preserve_symbol(cg:lto_code_gen_t; symbol:pchar); +cdecl;external libname name 'lto_codegen_add_must_preserve_symbol'; +{* + * Writes a new object file at the specified path that contains the + * merged contents of all modules added so far. + * Returns true on error (check lto_get_error_message() for details). + } +function lto_codegen_write_merged_modules(cg:lto_code_gen_t; path:pchar):bool; +cdecl;external libname name 'lto_codegen_write_merged_modules'; +{* + * Generates code for all added modules into one native object file. + * On sucess returns a pointer to a generated mach-o/ELF buffer and + * length set to the buffer size. The buffer is owned by the + * lto_code_gen_t and will be freed when lto_codegen_dispose() + * is called, or lto_codegen_compile() is called again. + * On failure, returns NULL (check lto_get_error_message() for details). + } +function lto_codegen_compile(cg:lto_code_gen_t; var length: int): pointer; +cdecl; external libname name 'lto_codegen_compile'; +{* + * Sets options to help debug codegen bugs. + } +procedure lto_codegen_debug_options(cg: lto_code_gen_t; para2: Pchar); +cdecl;external libname name 'lto_codegen_debug_options'; + +implementation + +end. diff --git a/llvm/llvm_orig.nim b/llvm/llvm_orig.nim new file mode 100644 index 000000000..8e09f9c68 --- /dev/null +++ b/llvm/llvm_orig.nim @@ -0,0 +1,1569 @@ + +const + libname* = "" #Setup as you need + +type + PLLVMBasicBlockRef* = ptr LLVMBasicBlockRef + PLLVMExecutionEngineRef* = ptr LLVMExecutionEngineRef + PLLVMGenericValueRef* = ptr LLVMGenericValueRef + PLLVMMemoryBufferRef* = ptr LLVMMemoryBufferRef + PLLVMModuleProviderRef* = ptr LLVMModuleProviderRef + PLLVMModuleRef* = ptr LLVMModuleRef + PLLVMTypeRef* = ptr LLVMTypeRef + PLLVMValueRef* = ptr LLVMValueRef # Core.h + # Opaque types. + #* + # * The top-level container for all LLVM global data. See the LLVMContext class. + # + +type + LLVMContextRef* = LLVMOpaqueContext #* + # * The top-level container for all other LLVM Intermediate Representation (IR) + # * objects. See the llvm::Module class. + # + LLVMModuleRef* = LLVMOpaqueModule #* + # * Each value in the LLVM IR has a type, an LLVMTypeRef. See the llvm::Type + # * class. + # + LLVMTypeRef* = LLVMOpaqueType #* + # * When building recursive types using LLVMRefineType, LLVMTypeRef values may + # * become invalid; use LLVMTypeHandleRef to resolve this problem. See the + # * llvm::AbstractTypeHolder class. + # + LLVMTypeHandleRef* = LLVMOpaqueTypeHandle + LLVMValueRef* = LLVMOpaqueValue + LLVMBasicBlockRef* = LLVMOpaqueBasicBlock + LLVMBuilderRef* = LLVMOpaqueBuilder # Used to provide a module to JIT or interpreter. + # * See the llvm::ModuleProvider class. + # + LLVMModuleProviderRef* = LLVMOpaqueModuleProvider # Used to provide a module to JIT or interpreter. + # * See the llvm::MemoryBuffer class. + # + LLVMMemoryBufferRef* = LLVMOpaqueMemoryBuffer #* See the llvm::PassManagerBase class. + LLVMPassManagerRef* = LLVMOpaquePassManager #* + # * Used to iterate through the uses of a Value, allowing access to all Values + # * that use this Value. See the llvm::Use and llvm::value_use_iterator classes. + # + LLVMUseIteratorRef* = LLVMOpaqueUseIterator + LLVMAttribute* = enum + LLVMZExtAttribute = 1 shl 0, LLVMSExtAttribute = 1 shl 1, + LLVMNoReturnAttribute = 1 shl 2, LLVMInRegAttribute = 1 shl 3, + LLVMStructRetAttribute = 1 shl 4, LLVMNoUnwindAttribute = 1 shl 5, + LLVMNoAliasAttribute = 1 shl 6, LLVMByValAttribute = 1 shl 7, + LLVMNestAttribute = 1 shl 8, LLVMReadNoneAttribute = 1 shl 9, + LLVMReadOnlyAttribute = 1 shl 10, LLVMNoInlineAttribute = 1 shl 11, + LLVMAlwaysInlineAttribute = 1 shl 12, + LLVMOptimizeForSizeAttribute = 1 shl 13, + LLVMStackProtectAttribute = 1 shl 14, + LLVMStackProtectReqAttribute = 1 shl 15, LLVMNoCaptureAttribute = 1 shl + 21, LLVMNoRedZoneAttribute = 1 shl 22, + LLVMNoImplicitFloatAttribute = 1 shl 23, LLVMNakedAttribute = 1 shl 24, + LLVMInlineHintAttribute = 1 shl 25 + LLVMOpcode* = enum #*< type with no size + #*< 32 bit floating point type + #*< 64 bit floating point type + #*< 80 bit floating point type (X87) + #*< 128 bit floating point type (112-bit mantissa) + #*< 128 bit floating point type (two 64-bits) + #*< Labels + #*< Arbitrary bit width integers + #*< Functions + #*< Structures + #*< Arrays + #*< Pointers + #*< Opaque: type with unknown structure + #*< SIMD 'packed' format, or other vector type + #*< Metadata + LLVMRet = 1, LLVMBr = 2, LLVMSwitch = 3, LLVMInvoke = 4, LLVMUnwind = 5, + LLVMUnreachable = 6, LLVMAdd = 7, LLVMFAdd = 8, LLVMSub = 9, LLVMFSub = 10, + LLVMMul = 11, LLVMFMul = 12, LLVMUDiv = 13, LLVMSDiv = 14, LLVMFDiv = 15, + LLVMURem = 16, LLVMSRem = 17, LLVMFRem = 18, LLVMShl = 19, LLVMLShr = 20, + LLVMAShr = 21, LLVMAnd = 22, LLVMOr = 23, LLVMXor = 24, LLVMMalloc = 25, + LLVMFree = 26, LLVMAlloca = 27, LLVMLoad = 28, LLVMStore = 29, + LLVMGetElementPtr = 30, LLVMTrunk = 31, LLVMZExt = 32, LLVMSExt = 33, + LLVMFPToUI = 34, LLVMFPToSI = 35, LLVMUIToFP = 36, LLVMSIToFP = 37, + LLVMFPTrunc = 38, LLVMFPExt = 39, LLVMPtrToInt = 40, LLVMIntToPtr = 41, + LLVMBitCast = 42, LLVMICmp = 43, LLVMFCmp = 44, LLVMPHI = 45, LLVMCall = 46, + LLVMSelect = 47, LLVMVAArg = 50, LLVMExtractElement = 51, + LLVMInsertElement = 52, LLVMShuffleVector = 53, LLVMExtractValue = 54, + LLVMInsertValue = 55 + LLVMTypeKind* = enum #*< Externally visible function + #*< Keep one copy of function when linking (inline) + #*< Same, but only replaced by something + # equivalent. + #*< Keep one copy of function when linking (weak) + #*< Same, but only replaced by something + # equivalent. + #*< Special purpose, only applies to global arrays + #*< Rename collisions when linking (static + # functions) + #*< Like Internal, but omit from symbol table + #*< Function to be imported from DLL + #*< Function to be accessible from DLL + #*< ExternalWeak linkage description + #*< Stand-in functions for streaming fns from + # bitcode + #*< Tentative definitions + #*< Like Private, but linker removes. + LLVMVoidTypeKind, LLVMFloatTypeKind, LLVMDoubleTypeKind, + LLVMX86_FP80TypeKind, LLVMFP128TypeKind, LLVMPPC_FP128TypeKind, + LLVMLabelTypeKind, LLVMIntegerTypeKind, LLVMFunctionTypeKind, + LLVMStructTypeKind, LLVMArrayTypeKind, LLVMPointerTypeKind, + LLVMOpaqueTypeKind, LLVMVectorTypeKind, LLVMMetadataTypeKind + LLVMLinkage* = enum #*< The GV is visible + #*< The GV is hidden + #*< The GV is protected + LLVMExternalLinkage, LLVMAvailableExternallyLinkage, LLVMLinkOnceAnyLinkage, + LLVMLinkOnceODRLinkage, LLVMWeakAnyLinkage, LLVMWeakODRLinkage, + LLVMAppendingLinkage, LLVMInternalLinkage, LLVMPrivateLinkage, + LLVMDLLImportLinkage, LLVMDLLExportLinkage, LLVMExternalWeakLinkage, + LLVMGhostLinkage, LLVMCommonLinkage, LLVMLinkerPrivateLinkage + LLVMVisibility* = enum + LLVMDefaultVisibility, LLVMHiddenVisibility, LLVMProtectedVisibility + LLVMCallConv* = enum #*< equal + #*< not equal + #*< unsigned greater than + #*< unsigned greater or equal + #*< unsigned less than + #*< unsigned less or equal + #*< signed greater than + #*< signed greater or equal + #*< signed less than + #*< signed less or equal + LLVMCCallConv = 0, LLVMFastCallConv = 8, LLVMColdCallConv = 9, + LLVMX86StdcallCallConv = 64, LLVMX86FastcallCallConv = 65 + LLVMIntPredicate* = enum #*< Always false (always folded) + #*< True if ordered and equal + #*< True if ordered and greater than + #*< True if ordered and greater than or equal + #*< True if ordered and less than + #*< True if ordered and less than or equal + #*< True if ordered and operands are unequal + #*< True if ordered (no nans) + #*< True if unordered: isnan(X) | isnan(Y) + #*< True if unordered or equal + #*< True if unordered or greater than + #*< True if unordered, greater than, or equal + #*< True if unordered or less than + #*< True if unordered, less than, or equal + #*< True if unordered or not equal + #*< Always true (always folded) + LLVMIntEQ = 32, LLVMIntNE, LLVMIntUGT, LLVMIntUGE, LLVMIntULT, LLVMIntULE, + LLVMIntSGT, LLVMIntSGE, LLVMIntSLT, LLVMIntSLE + LLVMRealPredicate* = enum #===-- Error handling ----------------------------------------------------=== + LLVMRealPredicateFalse, LLVMRealOEQ, LLVMRealOGT, LLVMRealOGE, LLVMRealOLT, + LLVMRealOLE, LLVMRealONE, LLVMRealORD, LLVMRealUNO, LLVMRealUEQ, + LLVMRealUGT, LLVMRealUGE, LLVMRealULT, LLVMRealULE, LLVMRealUNE, + LLVMRealPredicateTrue + +proc LLVMDisposeMessage*(Message: cstring){.cdecl, dynlib: libname, + importc: "LLVMDisposeMessage".} + #===-- Modules -----------------------------------------------------------=== + # Create and destroy contexts. +proc LLVMContextCreate*(): LLVMContextRef{.cdecl, dynlib: libname, + importc: "LLVMContextCreate".} +proc LLVMGetGlobalContext*(): LLVMContextRef{.cdecl, dynlib: libname, + importc: "LLVMGetGlobalContext".} +proc LLVMContextDispose*(C: LLVMContextRef){.cdecl, dynlib: libname, + importc: "LLVMContextDispose".} + # Create and destroy modules. + #* See llvm::Module::Module. +proc LLVMModuleCreateWithName*(ModuleID: cstring): LLVMModuleRef{.cdecl, + dynlib: libname, importc: "LLVMModuleCreateWithName".} +proc LLVMModuleCreateWithNameInContext*(ModuleID: cstring, C: LLVMContextRef): LLVMModuleRef{. + cdecl, dynlib: libname, importc: "LLVMModuleCreateWithNameInContext".} + #* See llvm::Module::~Module. +proc LLVMDisposeModule*(M: LLVMModuleRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeModule".} + #* Data layout. See Module::getDataLayout. +proc LLVMGetDataLayout*(M: LLVMModuleRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetDataLayout".} +proc LLVMSetDataLayout*(M: LLVMModuleRef, Triple: cstring){.cdecl, + dynlib: libname, importc: "LLVMSetDataLayout".} + #* Target triple. See Module::getTargetTriple. +proc LLVMGetTarget*(M: LLVMModuleRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetTarget".} +proc LLVMSetTarget*(M: LLVMModuleRef, Triple: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetTarget".} + #* See Module::addTypeName. +proc LLVMAddTypeName*(M: LLVMModuleRef, Name: cstring, Ty: LLVMTypeRef): int32{. + cdecl, dynlib: libname, importc: "LLVMAddTypeName".} +proc LLVMDeleteTypeName*(M: LLVMModuleRef, Name: cstring){.cdecl, + dynlib: libname, importc: "LLVMDeleteTypeName".} +proc LLVMGetTypeByName*(M: LLVMModuleRef, Name: cstring): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMGetTypeByName".} + #* See Module::dump. +proc LLVMDumpModule*(M: LLVMModuleRef){.cdecl, dynlib: libname, + importc: "LLVMDumpModule".} + #===-- Types -------------------------------------------------------------=== + # LLVM types conform to the following hierarchy: + # * + # * types: + # * integer type + # * real type + # * function type + # * sequence types: + # * array type + # * pointer type + # * vector type + # * void type + # * label type + # * opaque type + # + #* See llvm::LLVMTypeKind::getTypeID. +proc LLVMGetTypeKind*(Ty: LLVMTypeRef): LLVMTypeKind{.cdecl, dynlib: libname, + importc: "LLVMGetTypeKind".} + #* See llvm::LLVMType::getContext. +proc LLVMGetTypeContext*(Ty: LLVMTypeRef): LLVMContextRef{.cdecl, + dynlib: libname, importc: "LLVMGetTypeContext".} + # Operations on integer types +proc LLVMInt1TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMInt1TypeInContext".} +proc LLVMInt8TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMInt8TypeInContext".} +proc LLVMInt16TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMInt16TypeInContext".} +proc LLVMInt32TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMInt32TypeInContext".} +proc LLVMInt64TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMInt64TypeInContext".} +proc LLVMIntTypeInContext*(C: LLVMContextRef, NumBits: dword): LLVMTypeRef{. + cdecl, dynlib: libname, importc: "LLVMIntTypeInContext".} +proc LLVMInt1Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt1Type".} +proc LLVMInt8Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt8Type".} +proc LLVMInt16Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt16Type".} +proc LLVMInt32Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt32Type".} +proc LLVMInt64Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMInt64Type".} +proc LLVMIntType*(NumBits: dword): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMIntType".} +proc LLVMGetIntTypeWidth*(IntegerTy: LLVMTypeRef): dword{.cdecl, + dynlib: libname, importc: "LLVMGetIntTypeWidth".} + # Operations on real types +proc LLVMFloatTypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMFloatTypeInContext".} +proc LLVMDoubleTypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMDoubleTypeInContext".} +proc LLVMX86FP80TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMX86FP80TypeInContext".} +proc LLVMFP128TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMFP128TypeInContext".} +proc LLVMPPCFP128TypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMPPCFP128TypeInContext".} +proc LLVMFloatType*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMFloatType".} +proc LLVMDoubleType*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMDoubleType".} +proc LLVMX86FP80Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMX86FP80Type".} +proc LLVMFP128Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMFP128Type".} +proc LLVMPPCFP128Type*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMPPCFP128Type".} + # Operations on function types +proc LLVMFunctionType*(ReturnType: LLVMTypeRef, ParamTypes: pLLVMTypeRef, + ParamCount: dword, IsVarArg: int32): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMFunctionType".} +proc LLVMIsFunctionVarArg*(FunctionTy: LLVMTypeRef): int32{.cdecl, + dynlib: libname, importc: "LLVMIsFunctionVarArg".} +proc LLVMGetReturnType*(FunctionTy: LLVMTypeRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMGetReturnType".} +proc LLVMCountParamTypes*(FunctionTy: LLVMTypeRef): dword{.cdecl, + dynlib: libname, importc: "LLVMCountParamTypes".} +proc LLVMGetParamTypes*(FunctionTy: LLVMTypeRef, Dest: pLLVMTypeRef){.cdecl, + dynlib: libname, importc: "LLVMGetParamTypes".} + # Operations on struct types +proc LLVMStructTypeInContext*(C: LLVMContextRef, ElementTypes: pLLVMTypeRef, + ElementCount: dword, isPacked: int32): LLVMTypeRef{. + cdecl, dynlib: libname, importc: "LLVMStructTypeInContext".} +proc LLVMStructType*(ElementTypes: pLLVMTypeRef, ElementCount: dword, + isPacked: int32): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMStructType".} +proc LLVMCountStructElementTypes*(StructTy: LLVMTypeRef): dword{.cdecl, + dynlib: libname, importc: "LLVMCountStructElementTypes".} +proc LLVMGetStructElementTypes*(StructTy: LLVMTypeRef, Dest: pLLVMTypeRef){. + cdecl, dynlib: libname, importc: "LLVMGetStructElementTypes".} +proc LLVMIsPackedStruct*(StructTy: LLVMTypeRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsPackedStruct".} + # Operations on array, pointer, and vector types (sequence types) +proc LLVMArrayType*(ElementType: LLVMTypeRef, ElementCount: dword): LLVMTypeRef{. + cdecl, dynlib: libname, importc: "LLVMArrayType".} +proc LLVMPointerType*(ElementType: LLVMTypeRef, AddressSpace: dword): LLVMTypeRef{. + cdecl, dynlib: libname, importc: "LLVMPointerType".} +proc LLVMVectorType*(ElementType: LLVMTypeRef, ElementCount: dword): LLVMTypeRef{. + cdecl, dynlib: libname, importc: "LLVMVectorType".} +proc LLVMGetElementType*(Ty: LLVMTypeRef): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMGetElementType".} +proc LLVMGetArrayLength*(ArrayTy: LLVMTypeRef): dword{.cdecl, dynlib: libname, + importc: "LLVMGetArrayLength".} +proc LLVMGetPointerAddressSpace*(PointerTy: LLVMTypeRef): dword{.cdecl, + dynlib: libname, importc: "LLVMGetPointerAddressSpace".} +proc LLVMGetVectorSize*(VectorTy: LLVMTypeRef): dword{.cdecl, dynlib: libname, + importc: "LLVMGetVectorSize".} + # Operations on other types +proc LLVMVoidTypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMVoidTypeInContext".} +proc LLVMLabelTypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMLabelTypeInContext".} +proc LLVMOpaqueTypeInContext*(C: LLVMContextRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMOpaqueTypeInContext".} +proc LLVMVoidType*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMVoidType".} +proc LLVMLabelType*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMLabelType".} +proc LLVMOpaqueType*(): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMOpaqueType".} + # Operations on type handles +proc LLVMCreateTypeHandle*(PotentiallyAbstractTy: LLVMTypeRef): LLVMTypeHandleRef{. + cdecl, dynlib: libname, importc: "LLVMCreateTypeHandle".} +proc LLVMRefineType*(AbstractTy: LLVMTypeRef, ConcreteTy: LLVMTypeRef){.cdecl, + dynlib: libname, importc: "LLVMRefineType".} +proc LLVMResolveTypeHandle*(TypeHandle: LLVMTypeHandleRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMResolveTypeHandle".} +proc LLVMDisposeTypeHandle*(TypeHandle: LLVMTypeHandleRef){.cdecl, + dynlib: libname, importc: "LLVMDisposeTypeHandle".} + # Operations on all values +proc LLVMTypeOf*(Val: LLVMValueRef): LLVMTypeRef{.cdecl, dynlib: libname, + importc: "LLVMTypeOf".} +proc LLVMGetValueName*(Val: LLVMValueRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetValueName".} +proc LLVMSetValueName*(Val: LLVMValueRef, Name: cstring){.cdecl, + dynlib: libname, importc: "LLVMSetValueName".} +proc LLVMDumpValue*(Val: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMDumpValue".} +proc LLVMReplaceAllUsesWith*(OldVal: LLVMValueRef, NewVal: LLVMValueRef){.cdecl, + dynlib: libname, importc: "LLVMReplaceAllUsesWith".} + # Conversion functions. Return the input value if it is an instance of the + # specified class, otherwise NULL. See llvm::dyn_cast_or_null<>. +proc LLVMIsAArgument*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAArgument".} +proc LLVMIsABasicBlock*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsABasicBlock".} +proc LLVMIsAInlineAsm*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAInlineAsm".} +proc LLVMIsAUser*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAUser".} +proc LLVMIsAConstant*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAConstant".} +proc LLVMIsAConstantAggregateZero*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantAggregateZero".} +proc LLVMIsAConstantArray*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantArray".} +proc LLVMIsAConstantExpr*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantExpr".} +proc LLVMIsAConstantFP*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantFP".} +proc LLVMIsAConstantInt*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantInt".} +proc LLVMIsAConstantPointerNull*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantPointerNull".} +proc LLVMIsAConstantStruct*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantStruct".} +proc LLVMIsAConstantVector*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAConstantVector".} +proc LLVMIsAGlobalValue*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAGlobalValue".} +proc LLVMIsAFunction*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFunction".} +proc LLVMIsAGlobalAlias*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAGlobalAlias".} +proc LLVMIsAGlobalVariable*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAGlobalVariable".} +proc LLVMIsAUndefValue*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAUndefValue".} +proc LLVMIsAInstruction*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAInstruction".} +proc LLVMIsABinaryOperator*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsABinaryOperator".} +proc LLVMIsACallInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACallInst".} +proc LLVMIsAIntrinsicInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAIntrinsicInst".} +proc LLVMIsADbgInfoIntrinsic*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgInfoIntrinsic".} +proc LLVMIsADbgDeclareInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgDeclareInst".} +proc LLVMIsADbgFuncStartInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgFuncStartInst".} +proc LLVMIsADbgRegionEndInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgRegionEndInst".} +proc LLVMIsADbgRegionStartInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgRegionStartInst".} +proc LLVMIsADbgStopPointInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsADbgStopPointInst".} +proc LLVMIsAEHSelectorInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAEHSelectorInst".} +proc LLVMIsAMemIntrinsic*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAMemIntrinsic".} +proc LLVMIsAMemCpyInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAMemCpyInst".} +proc LLVMIsAMemMoveInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAMemMoveInst".} +proc LLVMIsAMemSetInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAMemSetInst".} +proc LLVMIsACmpInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACmpInst".} +proc LLVMIsAFCmpInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFCmpInst".} +proc LLVMIsAICmpInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAICmpInst".} +proc LLVMIsAExtractElementInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAExtractElementInst".} +proc LLVMIsAGetElementPtrInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAGetElementPtrInst".} +proc LLVMIsAInsertElementInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAInsertElementInst".} +proc LLVMIsAInsertValueInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAInsertValueInst".} +proc LLVMIsAPHINode*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAPHINode".} +proc LLVMIsASelectInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsASelectInst".} +proc LLVMIsAShuffleVectorInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAShuffleVectorInst".} +proc LLVMIsAStoreInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAStoreInst".} +proc LLVMIsATerminatorInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsATerminatorInst".} +proc LLVMIsABranchInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsABranchInst".} +proc LLVMIsAInvokeInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAInvokeInst".} +proc LLVMIsAReturnInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAReturnInst".} +proc LLVMIsASwitchInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsASwitchInst".} +proc LLVMIsAUnreachableInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAUnreachableInst".} +proc LLVMIsAUnwindInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAUnwindInst".} +proc LLVMIsAUnaryInstruction*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAUnaryInstruction".} +proc LLVMIsAAllocationInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAAllocationInst".} +proc LLVMIsAAllocaInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAAllocaInst".} +proc LLVMIsACastInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsACastInst".} +proc LLVMIsABitCastInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsABitCastInst".} +proc LLVMIsAFPExtInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFPExtInst".} +proc LLVMIsAFPToSIInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAFPToSIInst".} +proc LLVMIsAFPToUIInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAFPToUIInst".} +proc LLVMIsAFPTruncInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAFPTruncInst".} +proc LLVMIsAIntToPtrInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAIntToPtrInst".} +proc LLVMIsAPtrToIntInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAPtrToIntInst".} +proc LLVMIsASExtInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsASExtInst".} +proc LLVMIsASIToFPInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsASIToFPInst".} +proc LLVMIsATruncInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsATruncInst".} +proc LLVMIsAUIToFPInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAUIToFPInst".} +proc LLVMIsAZExtInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAZExtInst".} +proc LLVMIsAExtractValueInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMIsAExtractValueInst".} +proc LLVMIsAFreeInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAFreeInst".} +proc LLVMIsALoadInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsALoadInst".} +proc LLVMIsAVAArgInst*(Val: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMIsAVAArgInst".} + # Operations on Uses +proc LLVMGetFirstUse*(Val: LLVMValueRef): LLVMUseIteratorRef{.cdecl, + dynlib: libname, importc: "LLVMGetFirstUse".} +proc LLVMGetNextUse*(U: LLVMUseIteratorRef): LLVMUseIteratorRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextUse".} +proc LLVMGetUser*(U: LLVMUseIteratorRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetUser".} +proc LLVMGetUsedValue*(U: LLVMUseIteratorRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetUsedValue".} + # Operations on Users +proc LLVMGetOperand*(Val: LLVMValueRef, Index: dword): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetOperand".} + # Operations on constants of any type +proc LLVMConstNull*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstNull".} + # all zeroes +proc LLVMConstAllOnes*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstAllOnes".} + # only for int/vector +proc LLVMGetUndef*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetUndef".} +proc LLVMIsConstant*(Val: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsConstant".} +proc LLVMIsNull*(Val: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsNull".} +proc LLVMIsUndef*(Val: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsUndef".} +proc LLVMConstPointerNull*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstPointerNull".} + # Operations on scalar constants +proc LLVMConstInt*(IntTy: LLVMTypeRef, N: qword, SignExtend: int32): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstInt".} +proc LLVMConstIntOfString*(IntTy: LLVMTypeRef, Text: cstring, Radix: uint8_t): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstIntOfString".} +proc LLVMConstIntOfStringAndSize*(IntTy: LLVMTypeRef, Text: cstring, + SLen: dword, Radix: uint8_t): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstIntOfStringAndSize".} +proc LLVMConstReal*(RealTy: LLVMTypeRef, N: float64): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstReal".} +proc LLVMConstRealOfString*(RealTy: LLVMTypeRef, Text: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstRealOfString".} +proc LLVMConstRealOfStringAndSize*(RealTy: LLVMTypeRef, Text: cstring, + SLen: dword): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstRealOfStringAndSize".} +proc LLVMConstIntGetZExtValue*(ConstantVal: LLVMValueRef): qword{.cdecl, + dynlib: libname, importc: "LLVMConstIntGetZExtValue".} +proc LLVMConstIntGetSExtValue*(ConstantVal: LLVMValueRef): int64{.cdecl, + dynlib: libname, importc: "LLVMConstIntGetSExtValue".} + # Operations on composite constants +proc LLVMConstStringInContext*(C: LLVMContextRef, Str: cstring, len: dword, + DontNullTerminate: int32): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstStringInContext".} +proc LLVMConstStructInContext*(C: LLVMContextRef, ConstantVals: pLLVMValueRef, + Count: dword, isPacked: int32): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstStructInContext".} +proc LLVMConstString*(Str: cstring, len: dword, DontNullTerminate: int32): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstString".} +proc LLVMConstArray*(ElementTy: LLVMTypeRef, ConstantVals: pLLVMValueRef, + len: dword): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstArray".} +proc LLVMConstStruct*(ConstantVals: pLLVMValueRef, Count: dword, isPacked: int32): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstStruct".} +proc LLVMConstVector*(ScalarConstantVals: pLLVMValueRef, Size: dword): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstVector".} + # Constant expressions +proc LLVMGetConstOpcode*(ConstantVal: LLVMValueRef): LLVMOpcode{.cdecl, + dynlib: libname, importc: "LLVMGetConstOpcode".} +proc LLVMAlignOf*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMAlignOf".} +proc LLVMSizeOf*(Ty: LLVMTypeRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMSizeOf".} +proc LLVMConstNeg*(ConstantVal: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstNeg".} +proc LLVMConstFNeg*(ConstantVal: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFNeg".} +proc LLVMConstNot*(ConstantVal: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstNot".} +proc LLVMConstAdd*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstAdd".} +proc LLVMConstNSWAdd*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstNSWAdd".} +proc LLVMConstFAdd*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFAdd".} +proc LLVMConstSub*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSub".} +proc LLVMConstFSub*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFSub".} +proc LLVMConstMul*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstMul".} +proc LLVMConstFMul*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFMul".} +proc LLVMConstUDiv*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstUDiv".} +proc LLVMConstSDiv*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSDiv".} +proc LLVMConstExactSDiv*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstExactSDiv".} +proc LLVMConstFDiv*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFDiv".} +proc LLVMConstURem*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstURem".} +proc LLVMConstSRem*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSRem".} +proc LLVMConstFRem*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFRem".} +proc LLVMConstAnd*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstAnd".} +proc LLVMConstOr*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstOr".} +proc LLVMConstXor*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstXor".} +proc LLVMConstICmp*(Predicate: LLVMIntPredicate, LHSConstant: LLVMValueRef, + RHSConstant: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstICmp".} +proc LLVMConstFCmp*(Predicate: LLVMRealPredicate, LHSConstant: LLVMValueRef, + RHSConstant: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstFCmp".} +proc LLVMConstShl*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstShl".} +proc LLVMConstLShr*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstLShr".} +proc LLVMConstAShr*(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstAShr".} +proc LLVMConstGEP*(ConstantVal: LLVMValueRef, ConstantIndices: pLLVMValueRef, + NumIndices: dword): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstGEP".} +proc LLVMConstInBoundsGEP*(ConstantVal: LLVMValueRef, + ConstantIndices: pLLVMValueRef, NumIndices: dword): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstInBoundsGEP".} +proc LLVMConstTrunc*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstTrunc".} +proc LLVMConstSExt*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSExt".} +proc LLVMConstZExt*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstZExt".} +proc LLVMConstFPTrunc*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFPTrunc".} +proc LLVMConstFPExt*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFPExt".} +proc LLVMConstUIToFP*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstUIToFP".} +proc LLVMConstSIToFP*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSIToFP".} +proc LLVMConstFPToUI*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFPToUI".} +proc LLVMConstFPToSI*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFPToSI".} +proc LLVMConstPtrToInt*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstPtrToInt".} +proc LLVMConstIntToPtr*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstIntToPtr".} +proc LLVMConstBitCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstBitCast".} +proc LLVMConstZExtOrBitCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstZExtOrBitCast".} +proc LLVMConstSExtOrBitCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstSExtOrBitCast".} +proc LLVMConstTruncOrBitCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstTruncOrBitCast".} +proc LLVMConstPointerCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstPointerCast".} +proc LLVMConstIntCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef, + isSigned: dword): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstIntCast".} +proc LLVMConstFPCast*(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstFPCast".} +proc LLVMConstSelect*(ConstantCondition: LLVMValueRef, + ConstantIfTrue: LLVMValueRef, + ConstantIfFalse: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstSelect".} +proc LLVMConstExtractElement*(VectorConstant: LLVMValueRef, + IndexConstant: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstExtractElement".} +proc LLVMConstInsertElement*(VectorConstant: LLVMValueRef, + ElementValueConstant: LLVMValueRef, + IndexConstant: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstInsertElement".} +proc LLVMConstShuffleVector*(VectorAConstant: LLVMValueRef, + VectorBConstant: LLVMValueRef, + MaskConstant: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstShuffleVector".} +proc LLVMConstExtractValue*(AggConstant: LLVMValueRef, IdxList: pdword, + NumIdx: dword): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMConstExtractValue".} +proc LLVMConstInsertValue*(AggConstant: LLVMValueRef, + ElementValueConstant: LLVMValueRef, IdxList: pdword, + NumIdx: dword): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMConstInsertValue".} +proc LLVMConstInlineAsm*(Ty: LLVMTypeRef, AsmString: cstring, + Constraints: cstring, HasSideEffects: int32): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMConstInlineAsm".} + # Operations on global variables, functions, and aliases (globals) +proc LLVMGetGlobalParent*(Global: LLVMValueRef): LLVMModuleRef{.cdecl, + dynlib: libname, importc: "LLVMGetGlobalParent".} +proc LLVMIsDeclaration*(Global: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsDeclaration".} +proc LLVMGetLinkage*(Global: LLVMValueRef): LLVMLinkage{.cdecl, dynlib: libname, + importc: "LLVMGetLinkage".} +proc LLVMSetLinkage*(Global: LLVMValueRef, Linkage: LLVMLinkage){.cdecl, + dynlib: libname, importc: "LLVMSetLinkage".} +proc LLVMGetSection*(Global: LLVMValueRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetSection".} +proc LLVMSetSection*(Global: LLVMValueRef, Section: cstring){.cdecl, + dynlib: libname, importc: "LLVMSetSection".} +proc LLVMGetVisibility*(Global: LLVMValueRef): LLVMVisibility{.cdecl, + dynlib: libname, importc: "LLVMGetVisibility".} +proc LLVMSetVisibility*(Global: LLVMValueRef, Viz: LLVMVisibility){.cdecl, + dynlib: libname, importc: "LLVMSetVisibility".} +proc LLVMGetAlignment*(Global: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMGetAlignment".} +proc LLVMSetAlignment*(Global: LLVMValueRef, Bytes: dword){.cdecl, + dynlib: libname, importc: "LLVMSetAlignment".} + # Operations on global variables +proc LLVMAddGlobal*(M: LLVMModuleRef, Ty: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMAddGlobal".} +proc LLVMGetNamedGlobal*(M: LLVMModuleRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNamedGlobal".} +proc LLVMGetFirstGlobal*(M: LLVMModuleRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetFirstGlobal".} +proc LLVMGetLastGlobal*(M: LLVMModuleRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastGlobal".} +proc LLVMGetNextGlobal*(GlobalVar: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextGlobal".} +proc LLVMGetPreviousGlobal*(GlobalVar: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetPreviousGlobal".} +proc LLVMDeleteGlobal*(GlobalVar: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteGlobal".} +proc LLVMGetInitializer*(GlobalVar: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetInitializer".} +proc LLVMSetInitializer*(GlobalVar: LLVMValueRef, ConstantVal: LLVMValueRef){. + cdecl, dynlib: libname, importc: "LLVMSetInitializer".} +proc LLVMIsThreadLocal*(GlobalVar: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsThreadLocal".} +proc LLVMSetThreadLocal*(GlobalVar: LLVMValueRef, IsThreadLocal: int32){.cdecl, + dynlib: libname, importc: "LLVMSetThreadLocal".} +proc LLVMIsGlobalConstant*(GlobalVar: LLVMValueRef): int32{.cdecl, + dynlib: libname, importc: "LLVMIsGlobalConstant".} +proc LLVMSetGlobalConstant*(GlobalVar: LLVMValueRef, IsConstant: int32){.cdecl, + dynlib: libname, importc: "LLVMSetGlobalConstant".} + # Operations on aliases +proc LLVMAddAlias*(M: LLVMModuleRef, Ty: LLVMTypeRef, Aliasee: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMAddAlias".} + # Operations on functions +proc LLVMAddFunction*(M: LLVMModuleRef, Name: cstring, FunctionTy: LLVMTypeRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMAddFunction".} +proc LLVMGetNamedFunction*(M: LLVMModuleRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMGetNamedFunction".} +proc LLVMGetFirstFunction*(M: LLVMModuleRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetFirstFunction".} +proc LLVMGetLastFunction*(M: LLVMModuleRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetLastFunction".} +proc LLVMGetNextFunction*(Fn: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextFunction".} +proc LLVMGetPreviousFunction*(Fn: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetPreviousFunction".} +proc LLVMDeleteFunction*(Fn: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteFunction".} +proc LLVMGetIntrinsicID*(Fn: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMGetIntrinsicID".} +proc LLVMGetFunctionCallConv*(Fn: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMGetFunctionCallConv".} +proc LLVMSetFunctionCallConv*(Fn: LLVMValueRef, CC: dword){.cdecl, + dynlib: libname, importc: "LLVMSetFunctionCallConv".} +proc LLVMGetGC*(Fn: LLVMValueRef): cstring{.cdecl, dynlib: libname, + importc: "LLVMGetGC".} +proc LLVMSetGC*(Fn: LLVMValueRef, Name: cstring){.cdecl, dynlib: libname, + importc: "LLVMSetGC".} +proc LLVMAddFunctionAttr*(Fn: LLVMValueRef, PA: LLVMAttribute){.cdecl, + dynlib: libname, importc: "LLVMAddFunctionAttr".} +proc LLVMGetFunctionAttr*(Fn: LLVMValueRef): LLVMAttribute{.cdecl, + dynlib: libname, importc: "LLVMGetFunctionAttr".} +proc LLVMRemoveFunctionAttr*(Fn: LLVMValueRef, PA: LLVMAttribute){.cdecl, + dynlib: libname, importc: "LLVMRemoveFunctionAttr".} + # Operations on parameters +proc LLVMCountParams*(Fn: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMCountParams".} +proc LLVMGetParams*(Fn: LLVMValueRef, Params: pLLVMValueRef){.cdecl, + dynlib: libname, importc: "LLVMGetParams".} +proc LLVMGetParam*(Fn: LLVMValueRef, Index: dword): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetParam".} +proc LLVMGetParamParent*(Inst: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetParamParent".} +proc LLVMGetFirstParam*(Fn: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetFirstParam".} +proc LLVMGetLastParam*(Fn: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetLastParam".} +proc LLVMGetNextParam*(Arg: LLVMValueRef): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMGetNextParam".} +proc LLVMGetPreviousParam*(Arg: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetPreviousParam".} +proc LLVMAddAttribute*(Arg: LLVMValueRef, PA: LLVMAttribute){.cdecl, + dynlib: libname, importc: "LLVMAddAttribute".} +proc LLVMRemoveAttribute*(Arg: LLVMValueRef, PA: LLVMAttribute){.cdecl, + dynlib: libname, importc: "LLVMRemoveAttribute".} +proc LLVMGetAttribute*(Arg: LLVMValueRef): LLVMAttribute{.cdecl, + dynlib: libname, importc: "LLVMGetAttribute".} +proc LLVMSetParamAlignment*(Arg: LLVMValueRef, align: dword){.cdecl, + dynlib: libname, importc: "LLVMSetParamAlignment".} + # Operations on basic blocks +proc LLVMBasicBlockAsValue*(BB: LLVMBasicBlockRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBasicBlockAsValue".} +proc LLVMValueIsBasicBlock*(Val: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMValueIsBasicBlock".} +proc LLVMValueAsBasicBlock*(Val: LLVMValueRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMValueAsBasicBlock".} +proc LLVMGetBasicBlockParent*(BB: LLVMBasicBlockRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetBasicBlockParent".} +proc LLVMCountBasicBlocks*(Fn: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMCountBasicBlocks".} +proc LLVMGetBasicBlocks*(Fn: LLVMValueRef, BasicBlocks: pLLVMBasicBlockRef){. + cdecl, dynlib: libname, importc: "LLVMGetBasicBlocks".} +proc LLVMGetFirstBasicBlock*(Fn: LLVMValueRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetFirstBasicBlock".} +proc LLVMGetLastBasicBlock*(Fn: LLVMValueRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetLastBasicBlock".} +proc LLVMGetNextBasicBlock*(BB: LLVMBasicBlockRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextBasicBlock".} +proc LLVMGetPreviousBasicBlock*(BB: LLVMBasicBlockRef): LLVMBasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMGetPreviousBasicBlock".} +proc LLVMGetEntryBasicBlock*(Fn: LLVMValueRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetEntryBasicBlock".} +proc LLVMAppendBasicBlockInContext*(C: LLVMContextRef, Fn: LLVMValueRef, + Name: cstring): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMAppendBasicBlockInContext".} +proc LLVMInsertBasicBlockInContext*(C: LLVMContextRef, BB: LLVMBasicBlockRef, + Name: cstring): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMInsertBasicBlockInContext".} +proc LLVMAppendBasicBlock*(Fn: LLVMValueRef, Name: cstring): LLVMBasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMAppendBasicBlock".} +proc LLVMInsertBasicBlock*(InsertBeforeBB: LLVMBasicBlockRef, Name: cstring): LLVMBasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMInsertBasicBlock".} +proc LLVMDeleteBasicBlock*(BB: LLVMBasicBlockRef){.cdecl, dynlib: libname, + importc: "LLVMDeleteBasicBlock".} + # Operations on instructions +proc LLVMGetInstructionParent*(Inst: LLVMValueRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetInstructionParent".} +proc LLVMGetFirstInstruction*(BB: LLVMBasicBlockRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetFirstInstruction".} +proc LLVMGetLastInstruction*(BB: LLVMBasicBlockRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetLastInstruction".} +proc LLVMGetNextInstruction*(Inst: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetNextInstruction".} +proc LLVMGetPreviousInstruction*(Inst: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMGetPreviousInstruction".} + # Operations on call sites +proc LLVMSetInstructionCallConv*(Instr: LLVMValueRef, CC: dword){.cdecl, + dynlib: libname, importc: "LLVMSetInstructionCallConv".} +proc LLVMGetInstructionCallConv*(Instr: LLVMValueRef): dword{.cdecl, + dynlib: libname, importc: "LLVMGetInstructionCallConv".} +proc LLVMAddInstrAttribute*(Instr: LLVMValueRef, index: dword, + para3: LLVMAttribute){.cdecl, dynlib: libname, + importc: "LLVMAddInstrAttribute".} +proc LLVMRemoveInstrAttribute*(Instr: LLVMValueRef, index: dword, + para3: LLVMAttribute){.cdecl, dynlib: libname, + importc: "LLVMRemoveInstrAttribute".} +proc LLVMSetInstrParamAlignment*(Instr: LLVMValueRef, index: dword, align: dword){. + cdecl, dynlib: libname, importc: "LLVMSetInstrParamAlignment".} + # Operations on call instructions (only) +proc LLVMIsTailCall*(CallInst: LLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMIsTailCall".} +proc LLVMSetTailCall*(CallInst: LLVMValueRef, IsTailCall: int32){.cdecl, + dynlib: libname, importc: "LLVMSetTailCall".} + # Operations on phi nodes +proc LLVMAddIncoming*(PhiNode: LLVMValueRef, IncomingValues: pLLVMValueRef, + IncomingBlocks: pLLVMBasicBlockRef, Count: dword){.cdecl, + dynlib: libname, importc: "LLVMAddIncoming".} +proc LLVMCountIncoming*(PhiNode: LLVMValueRef): dword{.cdecl, dynlib: libname, + importc: "LLVMCountIncoming".} +proc LLVMGetIncomingValue*(PhiNode: LLVMValueRef, Index: dword): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMGetIncomingValue".} +proc LLVMGetIncomingBlock*(PhiNode: LLVMValueRef, Index: dword): LLVMBasicBlockRef{. + cdecl, dynlib: libname, importc: "LLVMGetIncomingBlock".} + #===-- Instruction builders ----------------------------------------------=== + # An instruction builder represents a point within a basic block, and is the + # * exclusive means of building instructions using the C interface. + # +proc LLVMCreateBuilderInContext*(C: LLVMContextRef): LLVMBuilderRef{.cdecl, + dynlib: libname, importc: "LLVMCreateBuilderInContext".} +proc LLVMCreateBuilder*(): LLVMBuilderRef{.cdecl, dynlib: libname, + importc: "LLVMCreateBuilder".} +proc LLVMPositionBuilder*(Builder: LLVMBuilderRef, theBlock: LLVMBasicBlockRef, + Instr: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMPositionBuilder".} +proc LLVMPositionBuilderBefore*(Builder: LLVMBuilderRef, Instr: LLVMValueRef){. + cdecl, dynlib: libname, importc: "LLVMPositionBuilderBefore".} +proc LLVMPositionBuilderAtEnd*(Builder: LLVMBuilderRef, theBlock: LLVMBasicBlockRef){. + cdecl, dynlib: libname, importc: "LLVMPositionBuilderAtEnd".} +proc LLVMGetInsertBlock*(Builder: LLVMBuilderRef): LLVMBasicBlockRef{.cdecl, + dynlib: libname, importc: "LLVMGetInsertBlock".} +proc LLVMClearInsertionPosition*(Builder: LLVMBuilderRef){.cdecl, + dynlib: libname, importc: "LLVMClearInsertionPosition".} +proc LLVMInsertIntoBuilder*(Builder: LLVMBuilderRef, Instr: LLVMValueRef){. + cdecl, dynlib: libname, importc: "LLVMInsertIntoBuilder".} +proc LLVMInsertIntoBuilderWithName*(Builder: LLVMBuilderRef, + Instr: LLVMValueRef, Name: cstring){.cdecl, + dynlib: libname, importc: "LLVMInsertIntoBuilderWithName".} +proc LLVMDisposeBuilder*(Builder: LLVMBuilderRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeBuilder".} + # Terminators +proc LLVMBuildRetVoid*(para1: LLVMBuilderRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildRetVoid".} +proc LLVMBuildRet*(para1: LLVMBuilderRef, V: LLVMValueRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildRet".} +proc LLVMBuildAggregateRet*(para1: LLVMBuilderRef, RetVals: pLLVMValueRef, + N: dword): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildAggregateRet".} +proc LLVMBuildBr*(para1: LLVMBuilderRef, Dest: LLVMBasicBlockRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildBr".} +proc LLVMBuildCondBr*(para1: LLVMBuilderRef, Cond: LLVMValueRef, + ThenBranch: LLVMBasicBlockRef, + ElseBranch: LLVMBasicBlockRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildCondBr".} +proc LLVMBuildSwitch*(para1: LLVMBuilderRef, V: LLVMValueRef, + ElseBranch: LLVMBasicBlockRef, NumCases: dword): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSwitch".} +proc LLVMBuildInvoke*(para1: LLVMBuilderRef, Fn: LLVMValueRef, + Args: pLLVMValueRef, NumArgs: dword, + ThenBranch: LLVMBasicBlockRef, Catch: LLVMBasicBlockRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildInvoke".} +proc LLVMBuildUnwind*(para1: LLVMBuilderRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildUnwind".} +proc LLVMBuildUnreachable*(para1: LLVMBuilderRef): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildUnreachable".} + # Add a case to the switch instruction +proc LLVMAddCase*(Switch: LLVMValueRef, OnVal: LLVMValueRef, + Dest: LLVMBasicBlockRef){.cdecl, dynlib: libname, + importc: "LLVMAddCase".} + # Arithmetic +proc LLVMBuildAdd*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildAdd".} +proc LLVMBuildNSWAdd*(para1: LLVMBuilderRef, LHS: LLVMValueRef, + RHS: LLVMValueRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildNSWAdd".} +proc LLVMBuildFAdd*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFAdd".} +proc LLVMBuildSub*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSub".} +proc LLVMBuildFSub*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFSub".} +proc LLVMBuildMul*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildMul".} +proc LLVMBuildFMul*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFMul".} +proc LLVMBuildUDiv*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildUDiv".} +proc LLVMBuildSDiv*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSDiv".} +proc LLVMBuildExactSDiv*(para1: LLVMBuilderRef, LHS: LLVMValueRef, + RHS: LLVMValueRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildExactSDiv".} +proc LLVMBuildFDiv*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFDiv".} +proc LLVMBuildURem*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildURem".} +proc LLVMBuildSRem*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSRem".} +proc LLVMBuildFRem*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildFRem".} +proc LLVMBuildShl*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildShl".} +proc LLVMBuildLShr*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildLShr".} +proc LLVMBuildAShr*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildAShr".} +proc LLVMBuildAnd*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildAnd".} +proc LLVMBuildOr*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildOr".} +proc LLVMBuildXor*(para1: LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildXor".} +proc LLVMBuildNeg*(para1: LLVMBuilderRef, V: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildNeg".} +proc LLVMBuildFNeg*(para1: LLVMBuilderRef, V: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFNeg".} +proc LLVMBuildNot*(para1: LLVMBuilderRef, V: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildNot".} + # Memory +proc LLVMBuildMalloc*(para1: LLVMBuilderRef, Ty: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildMalloc".} +proc LLVMBuildArrayMalloc*(para1: LLVMBuilderRef, Ty: LLVMTypeRef, + Val: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildArrayMalloc".} +proc LLVMBuildAlloca*(para1: LLVMBuilderRef, Ty: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildAlloca".} +proc LLVMBuildArrayAlloca*(para1: LLVMBuilderRef, Ty: LLVMTypeRef, + Val: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildArrayAlloca".} +proc LLVMBuildFree*(para1: LLVMBuilderRef, PointerVal: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFree".} +proc LLVMBuildLoad*(para1: LLVMBuilderRef, PointerVal: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildLoad".} +proc LLVMBuildStore*(para1: LLVMBuilderRef, Val: LLVMValueRef, + thePtr: LLVMValueRef): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildStore".} +proc LLVMBuildGEP*(B: LLVMBuilderRef, Pointer: LLVMValueRef, + Indices: pLLVMValueRef, NumIndices: dword, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildGEP".} +proc LLVMBuildInBoundsGEP*(B: LLVMBuilderRef, Pointer: LLVMValueRef, + Indices: pLLVMValueRef, NumIndices: dword, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildInBoundsGEP".} +proc LLVMBuildStructGEP*(B: LLVMBuilderRef, Pointer: LLVMValueRef, Idx: dword, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildStructGEP".} +proc LLVMBuildGlobalString*(B: LLVMBuilderRef, Str: cstring, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildGlobalString".} +proc LLVMBuildGlobalStringPtr*(B: LLVMBuilderRef, Str: cstring, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildGlobalStringPtr".} + # Casts +proc LLVMBuildTrunc*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildTrunc".} +proc LLVMBuildZExt*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildZExt".} +proc LLVMBuildSExt*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildSExt".} +proc LLVMBuildFPToUI*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFPToUI".} +proc LLVMBuildFPToSI*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFPToSI".} +proc LLVMBuildUIToFP*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildUIToFP".} +proc LLVMBuildSIToFP*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildSIToFP".} +proc LLVMBuildFPTrunc*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFPTrunc".} +proc LLVMBuildFPExt*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFPExt".} +proc LLVMBuildPtrToInt*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildPtrToInt".} +proc LLVMBuildIntToPtr*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildIntToPtr".} +proc LLVMBuildBitCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildBitCast".} +proc LLVMBuildZExtOrBitCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildZExtOrBitCast".} +proc LLVMBuildSExtOrBitCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildSExtOrBitCast".} +proc LLVMBuildTruncOrBitCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildTruncOrBitCast".} +proc LLVMBuildPointerCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildPointerCast".} +proc LLVMBuildIntCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildIntCast".} +proc LLVMBuildFPCast*(para1: LLVMBuilderRef, Val: LLVMValueRef, + DestTy: LLVMTypeRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildFPCast".} + # Comparisons +proc LLVMBuildICmp*(para1: LLVMBuilderRef, Op: LLVMIntPredicate, + LHS: LLVMValueRef, RHS: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildICmp".} +proc LLVMBuildFCmp*(para1: LLVMBuilderRef, Op: LLVMRealPredicate, + LHS: LLVMValueRef, RHS: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildFCmp".} + # Miscellaneous instructions +proc LLVMBuildPhi*(para1: LLVMBuilderRef, Ty: LLVMTypeRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildPhi".} +proc LLVMBuildCall*(para1: LLVMBuilderRef, Fn: LLVMValueRef, + Args: pLLVMValueRef, NumArgs: dword, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildCall".} +proc LLVMBuildSelect*(para1: LLVMBuilderRef, Cond: LLVMValueRef, + ThenBranch: LLVMValueRef, ElseBranch: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildSelect".} +proc LLVMBuildVAArg*(para1: LLVMBuilderRef, List: LLVMValueRef, Ty: LLVMTypeRef, + Name: cstring): LLVMValueRef{.cdecl, dynlib: libname, + importc: "LLVMBuildVAArg".} +proc LLVMBuildExtractElement*(para1: LLVMBuilderRef, VecVal: LLVMValueRef, + Index: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildExtractElement".} +proc LLVMBuildInsertElement*(para1: LLVMBuilderRef, VecVal: LLVMValueRef, + EltVal: LLVMValueRef, Index: LLVMValueRef, + Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildInsertElement".} +proc LLVMBuildShuffleVector*(para1: LLVMBuilderRef, V1: LLVMValueRef, + V2: LLVMValueRef, Mask: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildShuffleVector".} +proc LLVMBuildExtractValue*(para1: LLVMBuilderRef, AggVal: LLVMValueRef, + Index: dword, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildExtractValue".} +proc LLVMBuildInsertValue*(para1: LLVMBuilderRef, AggVal: LLVMValueRef, + EltVal: LLVMValueRef, Index: dword, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildInsertValue".} +proc LLVMBuildIsNull*(para1: LLVMBuilderRef, Val: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildIsNull".} +proc LLVMBuildIsNotNull*(para1: LLVMBuilderRef, Val: LLVMValueRef, Name: cstring): LLVMValueRef{. + cdecl, dynlib: libname, importc: "LLVMBuildIsNotNull".} +proc LLVMBuildPtrDiff*(para1: LLVMBuilderRef, LHS: LLVMValueRef, + RHS: LLVMValueRef, Name: cstring): LLVMValueRef{.cdecl, + dynlib: libname, importc: "LLVMBuildPtrDiff".} + #===-- Module providers --------------------------------------------------=== + # Encapsulates the module M in a module provider, taking ownership of the + # * module. + # * See the constructor llvm::ExistingModuleProvider::ExistingModuleProvider. + # +proc LLVMCreateModuleProviderForExistingModule*(M: LLVMModuleRef): LLVMModuleProviderRef{. + cdecl, dynlib: libname, importc: "LLVMCreateModuleProviderForExistingModule".} + # Destroys the module provider MP as well as the contained module. + # * See the destructor llvm::ModuleProvider::~ModuleProvider. + # +proc LLVMDisposeModuleProvider*(MP: LLVMModuleProviderRef){.cdecl, + dynlib: libname, importc: "LLVMDisposeModuleProvider".} + #===-- Memory buffers ----------------------------------------------------=== +proc LLVMCreateMemoryBufferWithContentsOfFile*(Path: cstring, + OutMemBuf: pLLVMMemoryBufferRef, OutMessage: Ppchar): int32{.cdecl, + dynlib: libname, importc: "LLVMCreateMemoryBufferWithContentsOfFile".} +proc LLVMCreateMemoryBufferWithSTDIN*(OutMemBuf: pLLVMMemoryBufferRef, + OutMessage: Ppchar): int32{.cdecl, + dynlib: libname, importc: "LLVMCreateMemoryBufferWithSTDIN".} +proc LLVMDisposeMemoryBuffer*(MemBuf: LLVMMemoryBufferRef){.cdecl, + dynlib: libname, importc: "LLVMDisposeMemoryBuffer".} + #===-- Pass Managers -----------------------------------------------------=== + #* Constructs a new whole-module pass pipeline. This type of pipeline is + # suitable for link-time optimization and whole-module transformations. + # See llvm::PassManager::PassManager. +proc LLVMCreatePassManager*(): LLVMPassManagerRef{.cdecl, dynlib: libname, + importc: "LLVMCreatePassManager".} + #* Constructs a new function-by-function pass pipeline over the module + # provider. It does not take ownership of the module provider. This type of + # pipeline is suitable for code generation and JIT compilation tasks. + # See llvm::FunctionPassManager::FunctionPassManager. +proc LLVMCreateFunctionPassManager*(MP: LLVMModuleProviderRef): LLVMPassManagerRef{. + cdecl, dynlib: libname, importc: "LLVMCreateFunctionPassManager".} + #* Initializes, executes on the provided module, and finalizes all of the + # passes scheduled in the pass manager. Returns 1 if any of the passes + # modified the module, 0 otherwise. See llvm::PassManager::run(Module&). +proc LLVMRunPassManager*(PM: LLVMPassManagerRef, M: LLVMModuleRef): int32{. + cdecl, dynlib: libname, importc: "LLVMRunPassManager".} + #* Initializes all of the function passes scheduled in the function pass + # manager. Returns 1 if any of the passes modified the module, 0 otherwise. + # See llvm::FunctionPassManager::doInitialization. +proc LLVMInitializeFunctionPassManager*(FPM: LLVMPassManagerRef): int32{.cdecl, + dynlib: libname, importc: "LLVMInitializeFunctionPassManager".} + #* Executes all of the function passes scheduled in the function pass manager + # on the provided function. Returns 1 if any of the passes modified the + # function, false otherwise. + # See llvm::FunctionPassManager::run(Function&). +proc LLVMRunFunctionPassManager*(FPM: LLVMPassManagerRef, F: LLVMValueRef): int32{. + cdecl, dynlib: libname, importc: "LLVMRunFunctionPassManager".} + #* Finalizes all of the function passes scheduled in in the function pass + # manager. Returns 1 if any of the passes modified the module, 0 otherwise. + # See llvm::FunctionPassManager::doFinalization. +proc LLVMFinalizeFunctionPassManager*(FPM: LLVMPassManagerRef): int32{.cdecl, + dynlib: libname, importc: "LLVMFinalizeFunctionPassManager".} + #* Frees the memory of a pass pipeline. For function pipelines, does not free + # the module provider. + # See llvm::PassManagerBase::~PassManagerBase. +proc LLVMDisposePassManager*(PM: LLVMPassManagerRef){.cdecl, dynlib: libname, + importc: "LLVMDisposePassManager".} + # Analysis.h + # verifier will print to stderr and abort() + # verifier will print to stderr and return 1 + # verifier will just return 1 +type + LLVMVerifierFailureAction* = enum # Verifies that a module is valid, taking the specified action if not. + # Optionally returns a human-readable description of any invalid constructs. + # OutMessage must be disposed with LLVMDisposeMessage. + LLVMAbortProcessAction, LLVMPrintMessageAction, LLVMReturnStatusAction + +proc LLVMVerifyModule*(M: LLVMModuleRef, Action: LLVMVerifierFailureAction, + OutMessage: Ppchar): int32{.cdecl, dynlib: libname, + importc: "LLVMVerifyModule".} + # Verifies that a single function is valid, taking the specified action. Useful + # for debugging. +proc LLVMVerifyFunction*(Fn: LLVMValueRef, Action: LLVMVerifierFailureAction): int32{. + cdecl, dynlib: libname, importc: "LLVMVerifyFunction".} + # Open up a ghostview window that displays the CFG of the current function. + # Useful for debugging. +proc LLVMViewFunctionCFG*(Fn: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMViewFunctionCFG".} +proc LLVMViewFunctionCFGOnly*(Fn: LLVMValueRef){.cdecl, dynlib: libname, + importc: "LLVMViewFunctionCFGOnly".} + # BitReader.h + # Builds a module from the bitcode in the specified memory buffer, returning a + # reference to the module via the OutModule parameter. Returns 0 on success. + # Optionally returns a human-readable error message via OutMessage. +proc LLVMParseBitcode*(MemBuf: LLVMMemoryBufferRef, OutModule: pLLVMModuleRef, + OutMessage: Ppchar): int32{.cdecl, dynlib: libname, + importc: "LLVMParseBitcode".} +proc LLVMParseBitcodeInContext*(ContextRef: LLVMContextRef, + MemBuf: LLVMMemoryBufferRef, + OutModule: pLLVMModuleRef, OutMessage: Ppchar): int32{. + cdecl, dynlib: libname, importc: "LLVMParseBitcodeInContext".} + # Reads a module from the specified path, returning via the OutMP parameter + # a module provider which performs lazy deserialization. Returns 0 on success. + # Optionally returns a human-readable error message via OutMessage. +proc LLVMGetBitcodeModuleProvider*(MemBuf: LLVMMemoryBufferRef, + OutMP: pLLVMModuleProviderRef, + OutMessage: Ppchar): int32{.cdecl, + dynlib: libname, importc: "LLVMGetBitcodeModuleProvider".} +proc LLVMGetBitcodeModuleProviderInContext*(ContextRef: LLVMContextRef, + MemBuf: LLVMMemoryBufferRef, OutMP: pLLVMModuleProviderRef, + OutMessage: Ppchar): int32{.cdecl, dynlib: libname, importc: "LLVMGetBitcodeModuleProviderInContext".} + # BitWriter.h + #===-- Operations on modules ---------------------------------------------=== + # Writes a module to an open file descriptor. Returns 0 on success. + # Closes the Handle. Use dup first if this is not what you want. +proc LLVMWriteBitcodeToFileHandle*(M: LLVMModuleRef, Handle: int32): int32{. + cdecl, dynlib: libname, importc: "LLVMWriteBitcodeToFileHandle".} + # Writes a module to the specified path. Returns 0 on success. +proc LLVMWriteBitcodeToFile*(M: LLVMModuleRef, Path: cstring): int32{.cdecl, + dynlib: libname, importc: "LLVMWriteBitcodeToFile".} + # Target.h +const + LLVMBigEndian* = 0 + LLVMLittleEndian* = 1 + +type + LLVMByteOrdering* = int32 + LLVMTargetDataRef* = LLVMOpaqueTargetData + LLVMStructLayoutRef* = LLVMStructLayout #===-- Target Data -------------------------------------------------------=== + #* Creates target data from a target layout string. + # See the constructor llvm::TargetData::TargetData. + +proc LLVMCreateTargetData*(StringRep: cstring): LLVMTargetDataRef{.cdecl, + dynlib: libname, importc: "LLVMCreateTargetData".} + #* Adds target data information to a pass manager. This does not take ownership + # of the target data. + # See the method llvm::PassManagerBase::add. +proc LLVMAddTargetData*(para1: LLVMTargetDataRef, para2: LLVMPassManagerRef){. + cdecl, dynlib: libname, importc: "LLVMAddTargetData".} + #* Converts target data to a target layout string. The string must be disposed + # with LLVMDisposeMessage. + # See the constructor llvm::TargetData::TargetData. +proc LLVMCopyStringRepOfTargetData*(para1: LLVMTargetDataRef): cstring{.cdecl, + dynlib: libname, importc: "LLVMCopyStringRepOfTargetData".} + #* Returns the byte order of a target, either LLVMBigEndian or + # LLVMLittleEndian. + # See the method llvm::TargetData::isLittleEndian. +proc LLVMByteOrder*(para1: LLVMTargetDataRef): LLVMByteOrdering{.cdecl, + dynlib: libname, importc: "LLVMByteOrder".} + #* Returns the pointer size in bytes for a target. + # See the method llvm::TargetData::getPointerSize. +proc LLVMPointerSize*(para1: LLVMTargetDataRef): dword{.cdecl, dynlib: libname, + importc: "LLVMPointerSize".} + #* Returns the integer type that is the same size as a pointer on a target. + # See the method llvm::TargetData::getIntPtrType. +proc LLVMIntPtrType*(para1: LLVMTargetDataRef): LLVMTypeRef{.cdecl, + dynlib: libname, importc: "LLVMIntPtrType".} + #* Computes the size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeSizeInBits. +proc LLVMSizeOfTypeInBits*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): qword{. + cdecl, dynlib: libname, importc: "LLVMSizeOfTypeInBits".} + #* Computes the storage size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeStoreSize. +proc LLVMStoreSizeOfType*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): qword{. + cdecl, dynlib: libname, importc: "LLVMStoreSizeOfType".} + #* Computes the ABI size of a type in bytes for a target. + # See the method llvm::TargetData::getTypeAllocSize. +proc LLVMABISizeOfType*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): qword{. + cdecl, dynlib: libname, importc: "LLVMABISizeOfType".} + #* Computes the ABI alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc LLVMABIAlignmentOfType*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): dword{. + cdecl, dynlib: libname, importc: "LLVMABIAlignmentOfType".} + #* Computes the call frame alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc LLVMCallFrameAlignmentOfType*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): dword{. + cdecl, dynlib: libname, importc: "LLVMCallFrameAlignmentOfType".} + #* Computes the preferred alignment of a type in bytes for a target. + # See the method llvm::TargetData::getTypeABISize. +proc LLVMPreferredAlignmentOfType*(para1: LLVMTargetDataRef, para2: LLVMTypeRef): dword{. + cdecl, dynlib: libname, importc: "LLVMPreferredAlignmentOfType".} + #* Computes the preferred alignment of a global variable in bytes for a target. + # See the method llvm::TargetData::getPreferredAlignment. +proc LLVMPreferredAlignmentOfGlobal*(para1: LLVMTargetDataRef, + GlobalVar: LLVMValueRef): dword{.cdecl, + dynlib: libname, importc: "LLVMPreferredAlignmentOfGlobal".} + #* Computes the structure element that contains the byte offset for a target. + # See the method llvm::StructLayout::getElementContainingOffset. +proc LLVMElementAtOffset*(para1: LLVMTargetDataRef, StructTy: LLVMTypeRef, + Offset: qword): dword{.cdecl, dynlib: libname, + importc: "LLVMElementAtOffset".} + #* Computes the byte offset of the indexed struct element for a target. + # See the method llvm::StructLayout::getElementContainingOffset. +proc LLVMOffsetOfElement*(para1: LLVMTargetDataRef, StructTy: LLVMTypeRef, + Element: dword): qword{.cdecl, dynlib: libname, + importc: "LLVMOffsetOfElement".} + #* Struct layouts are speculatively cached. If a TargetDataRef is alive when + # types are being refined and removed, this method must be called whenever a + # struct type is removed to avoid a dangling pointer in this cache. + # See the method llvm::TargetData::InvalidateStructLayoutInfo. +proc LLVMInvalidateStructLayout*(para1: LLVMTargetDataRef, StructTy: LLVMTypeRef){. + cdecl, dynlib: libname, importc: "LLVMInvalidateStructLayout".} + #* Deallocates a TargetData. + # See the destructor llvm::TargetData::~TargetData. +proc LLVMDisposeTargetData*(para1: LLVMTargetDataRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeTargetData".} + # ExecutionEngine.h +proc LLVMLinkInJIT*(){.cdecl, dynlib: libname, importc: "LLVMLinkInJIT".} +proc LLVMLinkInInterpreter*(){.cdecl, dynlib: libname, + importc: "LLVMLinkInInterpreter".} +type + LLVMGenericValueRef* = LLVMOpaqueGenericValue + LLVMExecutionEngineRef* = LLVMOpaqueExecutionEngine #===-- Operations on generic values --------------------------------------=== + +proc LLVMCreateGenericValueOfInt*(Ty: LLVMTypeRef, N: qword, IsSigned: int32): LLVMGenericValueRef{. + cdecl, dynlib: libname, importc: "LLVMCreateGenericValueOfInt".} +proc LLVMCreateGenericValueOfPointer*(P: pointer): LLVMGenericValueRef{.cdecl, + dynlib: libname, importc: "LLVMCreateGenericValueOfPointer".} +proc LLVMCreateGenericValueOfFloat*(Ty: LLVMTypeRef, N: float64): LLVMGenericValueRef{. + cdecl, dynlib: libname, importc: "LLVMCreateGenericValueOfFloat".} +proc LLVMGenericValueIntWidth*(GenValRef: LLVMGenericValueRef): dword{.cdecl, + dynlib: libname, importc: "LLVMGenericValueIntWidth".} +proc LLVMGenericValueToInt*(GenVal: LLVMGenericValueRef, IsSigned: int32): qword{. + cdecl, dynlib: libname, importc: "LLVMGenericValueToInt".} +proc LLVMGenericValueToPointer*(GenVal: LLVMGenericValueRef): pointer{.cdecl, + dynlib: libname, importc: "LLVMGenericValueToPointer".} +proc LLVMGenericValueToFloat*(TyRef: LLVMTypeRef, GenVal: LLVMGenericValueRef): float64{. + cdecl, dynlib: libname, importc: "LLVMGenericValueToFloat".} +proc LLVMDisposeGenericValue*(GenVal: LLVMGenericValueRef){.cdecl, + dynlib: libname, importc: "LLVMDisposeGenericValue".} + #===-- Operations on execution engines -----------------------------------=== +proc LLVMCreateExecutionEngine*(OutEE: pLLVMExecutionEngineRef, + MP: LLVMModuleProviderRef, OutError: Ppchar): int32{. + cdecl, dynlib: libname, importc: "LLVMCreateExecutionEngine".} +proc LLVMCreateInterpreter*(OutInterp: pLLVMExecutionEngineRef, + MP: LLVMModuleProviderRef, OutError: Ppchar): int32{. + cdecl, dynlib: libname, importc: "LLVMCreateInterpreter".} +proc LLVMCreateJITCompiler*(OutJIT: pLLVMExecutionEngineRef, + MP: LLVMModuleProviderRef, OptLevel: dword, + OutError: Ppchar): int32{.cdecl, dynlib: libname, + importc: "LLVMCreateJITCompiler".} +proc LLVMDisposeExecutionEngine*(EE: LLVMExecutionEngineRef){.cdecl, + dynlib: libname, importc: "LLVMDisposeExecutionEngine".} +proc LLVMRunStaticConstructors*(EE: LLVMExecutionEngineRef){.cdecl, + dynlib: libname, importc: "LLVMRunStaticConstructors".} +proc LLVMRunStaticDestructors*(EE: LLVMExecutionEngineRef){.cdecl, + dynlib: libname, importc: "LLVMRunStaticDestructors".} + # Const before declarator ignored + # Const before declarator ignored +proc LLVMRunFunctionAsMain*(EE: LLVMExecutionEngineRef, F: LLVMValueRef, + ArgC: dword, ArgV: Ppchar, EnvP: Ppchar): int32{. + cdecl, dynlib: libname, importc: "LLVMRunFunctionAsMain".} +proc LLVMRunFunction*(EE: LLVMExecutionEngineRef, F: LLVMValueRef, + NumArgs: dword, Args: pLLVMGenericValueRef): LLVMGenericValueRef{. + cdecl, dynlib: libname, importc: "LLVMRunFunction".} +proc LLVMFreeMachineCodeForFunction*(EE: LLVMExecutionEngineRef, F: LLVMValueRef){. + cdecl, dynlib: libname, importc: "LLVMFreeMachineCodeForFunction".} +proc LLVMAddModuleProvider*(EE: LLVMExecutionEngineRef, + MP: LLVMModuleProviderRef){.cdecl, dynlib: libname, + importc: "LLVMAddModuleProvider".} +proc LLVMRemoveModuleProvider*(EE: LLVMExecutionEngineRef, + MP: LLVMModuleProviderRef, + OutMod: pLLVMModuleRef, OutError: Ppchar): int32{. + cdecl, dynlib: libname, importc: "LLVMRemoveModuleProvider".} +proc LLVMFindFunction*(EE: LLVMExecutionEngineRef, Name: cstring, + OutFn: pLLVMValueRef): int32{.cdecl, dynlib: libname, + importc: "LLVMFindFunction".} +proc LLVMGetExecutionEngineTargetData*(EE: LLVMExecutionEngineRef): LLVMTargetDataRef{. + cdecl, dynlib: libname, importc: "LLVMGetExecutionEngineTargetData".} +proc LLVMAddGlobalMapping*(EE: LLVMExecutionEngineRef, Global: LLVMValueRef, + theAddr: pointer){.cdecl, dynlib: libname, + importc: "LLVMAddGlobalMapping".} +proc LLVMGetPointerToGlobal*(EE: LLVMExecutionEngineRef, Global: LLVMValueRef): pointer{. + cdecl, dynlib: libname, importc: "LLVMGetPointerToGlobal".} + # LinkTimeOptimizer.h + #/ This provides a dummy type for pointers to the LTO object. +type + llvm_lto_t* = pointer #/ This provides a C-visible enumerator to manage status codes. + #/ This should map exactly onto the C++ enumerator LTOStatus. + # Added C-specific error codes + llvm_lto_status* = enum + LLVM_LTO_UNKNOWN, LLVM_LTO_OPT_SUCCESS, LLVM_LTO_READ_SUCCESS, + LLVM_LTO_READ_FAILURE, LLVM_LTO_WRITE_FAILURE, LLVM_LTO_NO_TARGET, + LLVM_LTO_NO_WORK, LLVM_LTO_MODULE_MERGE_FAILURE, LLVM_LTO_ASM_FAILURE, + LLVM_LTO_NULL_OBJECT + llvm_lto_status_t* = llvm_lto_status #/ This provides C interface to initialize link time optimizer. This allows + #/ linker to use dlopen() interface to dynamically load LinkTimeOptimizer. + #/ extern "C" helps, because dlopen() interface uses name to find the symbol. + +proc llvm_create_optimizer*(): llvm_lto_t{.cdecl, dynlib: libname, + importc: "llvm_create_optimizer".} +proc llvm_destroy_optimizer*(lto: llvm_lto_t){.cdecl, dynlib: libname, + importc: "llvm_destroy_optimizer".} +proc llvm_read_object_file*(lto: llvm_lto_t, input_filename: cstring): llvm_lto_status_t{. + cdecl, dynlib: libname, importc: "llvm_read_object_file".} +proc llvm_optimize_modules*(lto: llvm_lto_t, output_filename: cstring): llvm_lto_status_t{. + cdecl, dynlib: libname, importc: "llvm_optimize_modules".} + # lto.h +const + LTO_API_VERSION* = 3 # log2 of alignment + +type + lto_symbol_attributes* = enum + LTO_SYMBOL_ALIGNMENT_MASK = 0x0000001F, + LTO_SYMBOL_PERMISSIONS_MASK = 0x000000E0, + LTO_SYMBOL_PERMISSIONS_CODE = 0x000000A0, + LTO_SYMBOL_PERMISSIONS_DATA = 0x000000C0, + LTO_SYMBOL_PERMISSIONS_RODATA = 0x00000080, + LTO_SYMBOL_DEFINITION_MASK = 0x00000700, + LTO_SYMBOL_DEFINITION_REGULAR = 0x00000100, + LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200, + LTO_SYMBOL_DEFINITION_WEAK = 0x00000300, + LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400, + LTO_SYMBOL_DEFINITION_WEAKUNDEF = 0x00000500, + LTO_SYMBOL_SCOPE_MASK = 0x00003800, LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800, + LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000, + LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000, + LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800 + lto_debug_model* = enum + LTO_DEBUG_MODEL_NONE = 0, LTO_DEBUG_MODEL_DWARF = 1 + lto_codegen_model* = enum #* opaque reference to a loaded object module + LTO_CODEGEN_PIC_MODEL_STATIC = 0, LTO_CODEGEN_PIC_MODEL_DYNAMIC = 1, + LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC = 2 + lto_module_t* = LTOModule #* opaque reference to a code generator + lto_code_gen_t* = LTOCodeGenerator #* + # * Returns a printable string. + # + +proc lto_get_version*(): cstring{.cdecl, dynlib: libname, + importc: "lto_get_version".} + #* + # * Returns the last error string or NULL if last operation was sucessful. + # +proc lto_get_error_message*(): cstring{.cdecl, dynlib: libname, + importc: "lto_get_error_message".} + #* + # * Checks if a file is a loadable object file. + # +proc lto_module_is_object_file*(path: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file".} + #* + # * Checks if a file is a loadable object compiled for requested target. + # +proc lto_module_is_object_file_for_target*(path: cstring, + target_triple_prefix: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file_for_target".} + #* + # * Checks if a buffer is a loadable object file. + # +proc lto_module_is_object_file_in_memory*(mem: pointer, len: size_t): bool{. + cdecl, dynlib: libname, importc: "lto_module_is_object_file_in_memory".} + #* + # * Checks if a buffer is a loadable object compiled for requested target. + # +proc lto_module_is_object_file_in_memory_for_target*(mem: pointer, len: size_t, + target_triple_prefix: cstring): bool{.cdecl, dynlib: libname, + importc: "lto_module_is_object_file_in_memory_for_target".} + #* + # * Loads an object file from disk. + # * Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_module_create*(path: cstring): lto_module_t{.cdecl, dynlib: libname, + importc: "lto_module_create".} + #* + # * Loads an object file from memory. + # * Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_module_create_from_memory*(mem: pointer, len: size_t): lto_module_t{. + cdecl, dynlib: libname, importc: "lto_module_create_from_memory".} + #* + # * Frees all memory internally allocated by the module. + # * Upon return the lto_module_t is no longer valid. + # +proc lto_module_dispose*(module: lto_module_t){.cdecl, dynlib: libname, + importc: "lto_module_dispose".} + #* + # * Returns triple string which the object module was compiled under. + # +proc lto_module_get_target_triple*(module: lto_module_t): cstring{.cdecl, + dynlib: libname, importc: "lto_module_get_target_triple".} + #* + # * Returns the number of symbols in the object module. + # +proc lto_module_get_num_symbols*(module: lto_module_t): dword{.cdecl, + dynlib: libname, importc: "lto_module_get_num_symbols".} + #* + # * Returns the name of the ith symbol in the object module. + # +proc lto_module_get_symbol_name*(module: lto_module_t, index: dword): cstring{. + cdecl, dynlib: libname, importc: "lto_module_get_symbol_name".} + #* + # * Returns the attributes of the ith symbol in the object module. + # +proc lto_module_get_symbol_attribute*(module: lto_module_t, index: dword): lto_symbol_attributes{. + cdecl, dynlib: libname, importc: "lto_module_get_symbol_attribute".} + #* + # * Instantiates a code generator. + # * Returns NULL on error (check lto_get_error_message() for details). + # +proc lto_codegen_create*(): lto_code_gen_t{.cdecl, dynlib: libname, + importc: "lto_codegen_create".} + #* + # * Frees all code generator and all memory it internally allocated. + # * Upon return the lto_code_gen_t is no longer valid. + # +proc lto_codegen_dispose*(para1: lto_code_gen_t){.cdecl, dynlib: libname, + importc: "lto_codegen_dispose".} + #* + # * Add an object module to the set of modules for which code will be generated. + # * Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_add_module*(cg: lto_code_gen_t, module: lto_module_t): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_add_module".} + #* + # * Sets if debug info should be generated. + # * Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_set_debug_model*(cg: lto_code_gen_t, para2: lto_debug_model): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_set_debug_model".} + #* + # * Sets which PIC code model to generated. + # * Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_set_pic_model*(cg: lto_code_gen_t, para2: lto_codegen_model): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_set_pic_model".} + #* + # * Sets the location of the "gcc" to run. If not set, libLTO will search for + # * "gcc" on the path. + # +proc lto_codegen_set_gcc_path*(cg: lto_code_gen_t, path: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_set_gcc_path".} + #* + # * Sets the location of the assembler tool to run. If not set, libLTO + # * will use gcc to invoke the assembler. + # +proc lto_codegen_set_assembler_path*(cg: lto_code_gen_t, path: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_set_assembler_path".} + #* + # * Adds to a list of all global symbols that must exist in the final + # * generated code. If a function is not listed, it might be + # * inlined into every usage and optimized away. + # +proc lto_codegen_add_must_preserve_symbol*(cg: lto_code_gen_t, symbol: cstring){. + cdecl, dynlib: libname, importc: "lto_codegen_add_must_preserve_symbol".} + #* + # * Writes a new object file at the specified path that contains the + # * merged contents of all modules added so far. + # * Returns true on error (check lto_get_error_message() for details). + # +proc lto_codegen_write_merged_modules*(cg: lto_code_gen_t, path: cstring): bool{. + cdecl, dynlib: libname, importc: "lto_codegen_write_merged_modules".} + #* + # * Generates code for all added modules into one native object file. + # * On sucess returns a pointer to a generated mach-o/ELF buffer and + # * length set to the buffer size. The buffer is owned by the + # * lto_code_gen_t and will be freed when lto_codegen_dispose() + # * is called, or lto_codegen_compile() is called again. + # * On failure, returns NULL (check lto_get_error_message() for details). + # +proc lto_codegen_compile*(cg: lto_code_gen_t, len: var int): pointer{.cdecl, + dynlib: libname, importc: "lto_codegen_compile".} + #* + # * Sets options to help debug codegen bugs. + # +proc lto_codegen_debug_options*(cg: lto_code_gen_t, para2: cstring){.cdecl, + dynlib: libname, importc: "lto_codegen_debug_options".} +# implementation diff --git a/readme.txt b/readme.txt index 963ce8b14..56821bece 100755 --- a/readme.txt +++ b/readme.txt @@ -17,5 +17,5 @@ priority). See the file ``install.txt`` for installation instructions. See the file ``doc/intern.txt`` for the internal documentation for developers. -Copyright (c) 2004-2009 Andreas Rumpf. +Copyright (c) 2004-2010 Andreas Rumpf. All rights reserved. diff --git a/rod/ast.nim b/rod/ast.nim index 17e20dd2b..0be562980 100755 --- a/rod/ast.nim +++ b/rod/ast.nim @@ -855,6 +855,17 @@ proc sonsLen(n: PNode): int = if isNil(n.sons): result = 0 else: result = len(n.sons) +proc len*(n: PNode): int {.inline.} = + if isNil(n.sons): result = 0 + else: result = len(n.sons) + +proc add*(father, son: PNode) = + if isNil(father.sons): father.sons = @[] + add(father.sons, son) + +proc `[]`*(n: PNode, i: int): PNode {.inline.} = + result = n.sons[i] + proc newSons(father: PNode, length: int) = if isNil(father.sons): father.sons = @[] setlen(father.sons, len(father.sons) + length) @@ -985,8 +996,7 @@ proc IntSetInit(s: var TIntSet) = s.head = nil proc IntSetGet(t: TIntSet, key: int): PTrunk = - var h: int - h = key and t.max + var h = key and t.max while t.data[h] != nil: if t.data[h].key == key: return t.data[h] @@ -994,8 +1004,7 @@ proc IntSetGet(t: TIntSet, key: int): PTrunk = result = nil proc IntSetRawInsert(t: TIntSet, data: var TTrunkSeq, desc: PTrunk) = - var h: int - h = desc.key and t.max + var h = desc.key and t.max while data[h] != nil: assert(data[h] != desc) h = nextTry(h, t.max) diff --git a/rod/ccgexprs.nim b/rod/ccgexprs.nim index aa6ec2ed0..ecff707ae 100755 --- a/rod/ccgexprs.nim +++ b/rod/ccgexprs.nim @@ -39,9 +39,6 @@ proc getStrLit(m: BModule, s: string): PRope = [result, makeCString(s), ToRope(len(s))]) proc genLiteral(p: BProc, v: PNode, ty: PType): PRope = - var - f: biggestFloat - id: int if ty == nil: internalError(v.info, "genLiteral: ty is nil") case v.kind of nkCharLit..nkInt64Lit: @@ -69,7 +66,7 @@ proc genLiteral(p: BProc, v: PNode, ty: PType): PRope = result = toRope("0") of nkStrLit..nkTripleStrLit: if skipTypes(ty, abstractVarRange).kind == tyString: - id = NodeTableTestOrSet(p.module.dataCache, v, gid) + var id = NodeTableTestOrSet(p.module.dataCache, v, gid) if id == gid: # string literal not found in the cache: useMagic(p.module, "NimStringDesc") @@ -79,7 +76,7 @@ proc genLiteral(p: BProc, v: PNode, ty: PType): PRope = else: result = makeCString(v.strVal) of nkFloatLit..nkFloat64Lit: - f = v.floatVal + var f = v.floatVal if f != f: result = toRope("NAN") elif f == 0.0: diff --git a/rod/ccgtypes.nim b/rod/ccgtypes.nim index 8ff7bdb6d..5034bf67b 100755 --- a/rod/ccgtypes.nim +++ b/rod/ccgtypes.nim @@ -344,8 +344,7 @@ proc getRecordDesc(m: BModule, typ: PType, name: PRope, if typ.kind == tyObject: useMagic(m, "TNimType") if typ.sons[0] == nil: - if (typ.sym != nil) and (sfPure in typ.sym.flags) or - (tfFinal in typ.flags): + if typ.sym != nil and sfPure in typ.sym.flags or tfFinal in typ.flags: result = ropef("struct $1 {$n", [name]) else: result = ropef("struct $1 {$nTNimType* m_type;$n", [name]) diff --git a/rod/cgen.nim b/rod/cgen.nim index 5399cdccf..15fa1b17e 100755 --- a/rod/cgen.nim +++ b/rod/cgen.nim @@ -520,7 +520,7 @@ proc genProcAux(m: BModule, prc: PSym) = [toRope(prc.loc.a)]) app(generatedProc, returnStmt) app(generatedProc, '}' & tnl) - app(m.s[cfsProcs], generatedProc) #if prc.kind = skMethod then addMethodToCompile(gNimDat, prc); + app(m.s[cfsProcs], generatedProc) proc genProcPrototype(m: BModule, sym: PSym) = useHeader(m, sym) diff --git a/rod/commands.nim b/rod/commands.nim index 881519756..f6079d6d5 100755 --- a/rod/commands.nim +++ b/rod/commands.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -27,7 +27,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) const HelpMessage = "Nimrod Compiler Version $1 (" & compileDate & ") [$2: $3]" & - "\n" & "Copyright (c) 2004-2009 by Andreas Rumpf" & "\n" + "\n" & "Copyright (c) 2004-2010 by Andreas Rumpf" & "\n" const Usage = """ diff --git a/rod/expandimportc.nim b/rod/expandimportc.nim index e7198237c..8df90aaa6 100755 --- a/rod/expandimportc.nim +++ b/rod/expandimportc.nim @@ -15,30 +15,30 @@ import proc modifyPragmas(n: PNode, name: string) = if n == nil: return - for i in countup(0, sonsLen(n) - 1): - var it = n.sons[i] + for i in 0..len(n)-1: + var it = n[i] if it.kind == nkIdent and whichKeyword(it.ident) == wImportc: var x = newNode(nkExprColonExpr) - addSon(x, it) - addSon(x, newStrNode(nkStrLit, name)) + add(x, it) + add(x, newStrNode(nkStrLit, name)) n.sons[i] = x proc getName(n: PNode): string = case n.kind - of nkPostfix: result = getName(n.sons[1]) - of nkPragmaExpr: result = getName(n.sons[0]) + of nkPostfix: result = getName(n[1]) + of nkPragmaExpr: result = getName(n[0]) of nkSym: result = n.sym.name.s of nkIdent: result = n.ident.s - of nkAccQuoted: result = getName(n.sons[0]) + of nkAccQuoted: result = getName(n[0]) else: internalError(n.info, "getName()") proc processRoutine(n: PNode) = - var name = getName(n.sons[namePos]) - modifyPragmas(n.sons[pragmasPos], name) + var name = getName(n[namePos]) + modifyPragmas(n[pragmasPos], name) proc processIdent(ident, prefix: string, n: PNode): string = var pattern = sequence(capture(?(termIgnoreCase"T" / termIgnoreCase"P")), - termIgnoreCase(prefix), capture(*any)) + termIgnoreCase(prefix), ?term('_'), capture(*any())) if ident =~ pattern: result = matches[0] & matches[1] else: @@ -49,27 +49,25 @@ proc processTree(n: PNode, prefix: string) = case n.kind of nkEmpty..pred(nkIdent), succ(nkIdent)..nkNilLit: nil of nkIdent: - if prefix.len > 0: - n.ident = getIdent(processIdent(n.ident.s, prefix, n)) + if prefix.len > 0: n.ident = getIdent(processIdent(n.ident.s, prefix, n)) of nkProcDef, nkConverterDef: processRoutine(n) - for i in 0..sonsLen(n)-1: processTree(n.sons[i], prefix) + for i in 0..sonsLen(n)-1: processTree(n[i], prefix) else: - for i in 0..sonsLen(n)-1: processTree(n.sons[i], prefix) + for i in 0..sonsLen(n)-1: processTree(n[i], prefix) -proc main(infile, outfile, prefix: string) = +proc main*(infile, outfile, prefix: string) = var module = ParseFile(infile) processTree(module, prefix) renderModule(module, outfile) -if paramcount() >= 1: - var infile = addFileExt(paramStr(1), "nim") - var outfile = changeFileExt(infile, "new.nim") - if paramCount() >= 2: - outfile = addFileExt(paramStr(2), "new.nim") - var prefix = "" - if paramCount() >= 3: - prefix = paramStr(3) - main(infile, outfile, prefix) -else: - echo "usage: expand_importc filename[.nim] outfilename[.nim] [prefix]" +when isMainModule: + if paramcount() >= 1: + var infile = addFileExt(paramStr(1), "nim") + var outfile = changeFileExt(infile, "new.nim") + if paramCount() >= 2: + outfile = addFileExt(paramStr(2), "new.nim") + var prefix = if paramCount() >= 3: paramStr(3) else: "" + main(infile, outfile, prefix) + else: + echo "usage: expand_importc filename[.nim] outfilename[.nim] [prefix]" diff --git a/rod/llvmdata.nim b/rod/llvmdata.nim deleted file mode 100755 index 91206f38c..000000000 --- a/rod/llvmdata.nim +++ /dev/null @@ -1,103 +0,0 @@ -# -# -# The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -# this module implements data structures for emitting LLVM. - -import - ast, astalgo, idents, lists, passes - -type - VTypeKind* = enum - VoidTyID, #/< 0: type with no size - FloatTyID, #/< 1: 32 bit floating point type - DoubleTyID, #/< 2: 64 bit floating point type - X86_FP80TyID, #/< 3: 80 bit floating point type (X87) - FP128TyID, #/< 4: 128 bit floating point type (112-bit mantissa) - PPC_FP128TyID, #/< 5: 128 bit floating point type (two 64-bits) - LabelTyID, #/< 6: Labels - MetadataTyID, #/< 7: Metadata - # Derived types... see DerivedTypes.h file... - # Make sure FirstDerivedTyID stays up to date!!! - IntegerTyID, #/< 8: Arbitrary bit width integers - FunctionTyID, #/< 9: Functions - StructTyID, #/< 10: Structures - ArrayTyID, #/< 11: Arrays - PointerTyID, #/< 12: Pointers - OpaqueTyID, #/< 13: Opaque: type with unknown structure - VectorTyID #/< 14: SIMD 'packed' format, or other vector type - VType* = ref VTypeDesc - VTypeSeq* = seq[VType] - VTypeDesc* = object of TIdObj - k*: VTypeKind - s*: VTypeSeq - arrayLen*: int - name*: string - - VInstrKind* = enum - iNone, iAdd, iSub, iMul, iDiv, iMod - VLocalVar*{.final.} = object - VInstr*{.final.} = object #/ This represents a single basic block in LLVM. A basic block is simply a - #/ container of instructions that execute sequentially. Basic blocks are Values - #/ because they are referenced by instructions such as branches and switch - #/ tables. The type of a BasicBlock is "Type::LabelTy" because the basic block - #/ represents a label to which a branch can jump. - #/ - k*: VInstrKind - - VBlock* = ref VBlockDesc - VBlockDesc*{.final.} = object # LLVM basic block - # list of instructions - VLinkage* = enum - ExternalLinkage, # Externally visible function - LinkOnceLinkage, # Keep one copy of function when linking (inline) - WeakLinkage, # Keep one copy of function when linking (weak) - AppendingLinkage, # Special purpose, only applies to global arrays - InternalLinkage, # Rename collisions when linking (static functions) - DLLImportLinkage, # Function to be imported from DLL - DLLExportLinkage, # Function to be accessible from DLL - ExternalWeakLinkage, # ExternalWeak linkage description - GhostLinkage # Stand-in functions for streaming fns from bitcode - VVisibility* = enum - DefaultVisibility, # The GV is visible - HiddenVisibility, # The GV is hidden - ProtectedVisibility # The GV is protected - TLLVMCallConv* = enum - CCallConv = 0, FastCallConv = 8, ColdCallConv = 9, X86StdcallCallConv = 64, - X86FastcallCallConv = 65 - VProc* = ref VProcDesc - VProcDesc*{.final.} = object - b*: VBlock - name*: string - sym*: PSym # proc that is generated - linkage*: VLinkage - vis*: VVisibility - callConv*: VCallConv - next*: VProc - - VModule* = ref VModuleDesc - VModuleDesc* = object of TPassContext # represents a C source file - sym*: PSym - filename*: string - typeCache*: TIdTable # cache the generated types - forwTypeCache*: TIdTable # cache for forward declarations of types - declaredThings*: TIntSet # things we have declared in this file - declaredProtos*: TIntSet # prototypes we have declared in this file - headerFiles*: TLinkedList # needed headers to include - typeInfoMarker*: TIntSet # needed for generating type information - initProc*: VProc # code for init procedure - typeStack*: TTypeSeq # used for type generation - dataCache*: TNodeTable - forwardedProcs*: TSymSeq # keep forwarded procs here - typeNodes*, nimTypes*: int # used for type info generation - typeNodesName*, nimTypesName*: PRope # used for type info generation - labels*: natural # for generating unique module-scope names - next*: VModule # to stack modules - - -# implementation diff --git a/rod/llvmdyn.nim b/rod/llvmdyn.nim deleted file mode 100755 index 09bc48ce2..000000000 --- a/rod/llvmdyn.nim +++ /dev/null @@ -1,658 +0,0 @@ -# -# -# The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -# this module implements the interface to LLVM. - -const - llvmdll* = "llvm.dll" # Opaque types. - # - # The top-level container for all other LLVM Intermediate Representation (IR) - # objects. See the llvm::Module class. - # - -type - cuint* = int32 - PLLVMBasicBlockRef* = ref TLLVMBasicBlockRef - PLLVMMemoryBufferRef* = ref TLLVMMemoryBufferRef - PLLVMTypeRef* = ref TLLVMTypeRef - PLLVMValueRef* = ref TLLVMValueRef - TLLVMOpaqueModule*{.final.} = object - TLLVMModuleRef* = ref TLLVMOpaqueModule # - # Each value in the LLVM IR has a type, an instance of [lltype]. See the - # llvm: : Type class. - # - TLLVMOpaqueType*{.final.} = object - TLLVMTypeRef* = ref TLLVMOpaqueType # - # When building recursive types using [refine_type], [lltype] values may become - # invalid; use [lltypehandle] to resolve this problem. See the - # llvm: : AbstractTypeHolder] class. - # - TLLVMOpaqueTypeHandle*{.final.} = object - TLLVMTypeHandleRef* = ref TLLVMOpaqueTypeHandle - TLLVMOpaqueValue*{.final.} = object - TLLVMValueRef* = ref TLLVMOpaqueValue - TLLVMOpaqueBasicBlock*{.final.} = object - TLLVMBasicBlockRef* = ref TLLVMOpaqueBasicBlock - TLLVMOpaqueBuilder*{.final.} = object - TLLVMBuilderRef* = ref TLLVMOpaqueBuilder # Used to provide a module to JIT or interpreter. - # See the llvm: : ModuleProvider class. - # - TLLVMOpaqueModuleProvider*{.final.} = object - TLLVMModuleProviderRef* = ref TLLVMOpaqueModuleProvider # Used to provide a module to JIT or interpreter. - # See the llvm: : MemoryBuffer class. - # - TLLVMOpaqueMemoryBuffer*{.final.} = object - TLLVMMemoryBufferRef* = ref TLLVMOpaqueMemoryBuffer - TLLVMTypeKind* = enum - LLVMVoidTypeKind, # type with no size - LLVMFloatTypeKind, # 32 bit floating point type - LLVMDoubleTypeKind, # 64 bit floating point type - LLVMX86_FP80TypeKind, # 80 bit floating point type (X87) - LLVMFP128TypeKind, # 128 bit floating point type (112-bit mantissa) - LLVMPPC_FP128TypeKind, # 128 bit floating point type (two 64-bits) - LLVMLabelTypeKind, # Labels - LLVMIntegerTypeKind, # Arbitrary bit width integers - LLVMFunctionTypeKind, # Functions - LLVMStructTypeKind, # Structures - LLVMArrayTypeKind, # Arrays - LLVMPointerTypeKind, # Pointers - LLVMOpaqueTypeKind, # Opaque: type with unknown structure - LLVMVectorTypeKind # SIMD 'packed' format, or other vector type - TLLVMLinkage* = enum - LLVMExternalLinkage, # Externally visible function - LLVMLinkOnceLinkage, # Keep one copy of function when linking (inline) - LLVMWeakLinkage, # Keep one copy of function when linking (weak) - LLVMAppendingLinkage, # Special purpose, only applies to global arrays - LLVMInternalLinkage, # Rename collisions when linking (static functions) - LLVMDLLImportLinkage, # Function to be imported from DLL - LLVMDLLExportLinkage, # Function to be accessible from DLL - LLVMExternalWeakLinkage, # ExternalWeak linkage description - LLVMGhostLinkage # Stand-in functions for streaming fns from bitcode - TLLVMVisibility* = enum - LLVMDefaultVisibility, # The GV is visible - LLVMHiddenVisibility, # The GV is hidden - LLVMProtectedVisibility # The GV is protected - TLLVMCallConv* = enum - LLVMCCallConv = 0, LLVMFastCallConv = 8, LLVMColdCallConv = 9, - LLVMX86StdcallCallConv = 64, LLVMX86FastcallCallConv = 65 - TLLVMIntPredicate* = enum - LLVMIntEQ = 32, # equal - LLVMIntNE, # not equal - LLVMIntUGT, # unsigned greater than - LLVMIntUGE, # unsigned greater or equal - LLVMIntULT, # unsigned less than - LLVMIntULE, # unsigned less or equal - LLVMIntSGT, # signed greater than - LLVMIntSGE, # signed greater or equal - LLVMIntSLT, # signed less than - LLVMIntSLE # signed less or equal - TLLVMRealPredicate* = enum #===-- Error handling ----------------------------------------------------=== - LLVMRealPredicateFalse, # Always false (always folded) - LLVMRealOEQ, # True if ordered and equal - LLVMRealOGT, # True if ordered and greater than - LLVMRealOGE, # True if ordered and greater than or equal - LLVMRealOLT, # True if ordered and less than - LLVMRealOLE, # True if ordered and less than or equal - LLVMRealONE, # True if ordered and operands are unequal - LLVMRealORD, # True if ordered (no nans) - LLVMRealUNO, # True if unordered: isnan(X) | isnan(Y) - LLVMRealUEQ, # True if unordered or equal - LLVMRealUGT, # True if unordered or greater than - LLVMRealUGE, # True if unordered, greater than, or equal - LLVMRealULT, # True if unordered or less than - LLVMRealULE, # True if unordered, less than, or equal - LLVMRealUNE, # True if unordered or not equal - LLVMRealPredicateTrue # Always true (always folded) - -proc LLVMDisposeMessage*(msg: cstring){.cdecl, dynlib: llvmdll, importc.} - #===-- Modules -----------------------------------------------------------=== - # Create and destroy modules. -proc LLVMModuleCreateWithName*(ModuleID: cstring): TLLVMModuleRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMDisposeModule*(M: TLLVMModuleRef){.cdecl, dynlib: llvmdll, importc.} - # Data layout -proc LLVMGetDataLayout*(M: TLLVMModuleRef): cstring{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMSetDataLayout*(M: TLLVMModuleRef, Triple: cstring){.cdecl, - dynlib: llvmdll, importc.} - # Target triple -proc LLVMGetTarget*(M: TLLVMModuleRef): cstring{.cdecl, dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMSetTarget*(M: TLLVMModuleRef, Triple: cstring){.cdecl, dynlib: llvmdll, - importc.} - # Same as Module: : addTypeName. -proc LLVMAddTypeName*(M: TLLVMModuleRef, Name: cstring, Ty: TLLVMTypeRef): int32{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMDeleteTypeName*(M: TLLVMModuleRef, Name: cstring){.cdecl, - dynlib: llvmdll, importc.} - #===-- Types -------------------------------------------------------------=== - # LLVM types conform to the following hierarchy: - # * - # * types: - # * integer type - # * real type - # * function type - # * sequence types: - # * array type - # * pointer type - # * vector type - # * void type - # * label type - # * opaque type - # -proc LLVMGetTypeKind*(Ty: TLLVMTypeRef): TLLVMTypeKind{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMRefineAbstractType*(AbstractType: TLLVMTypeRef, - ConcreteType: TLLVMTypeRef){.cdecl, - dynlib: llvmdll, importc.} - # Operations on integer types -proc LLVMInt1Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMInt8Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMInt16Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMInt32Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMInt64Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMIntType*(NumBits: cuint): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMGetIntTypeWidth*(IntegerTy: TLLVMTypeRef): cuint{.cdecl, - dynlib: llvmdll, importc.} - # Operations on real types -proc LLVMFloatType*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMDoubleType*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMX86FP80Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMFP128Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMPPCFP128Type*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} - # Operations on function types -proc LLVMFunctionType*(ReturnType: TLLVMTypeRef, ParamTypes: PLLVMTypeRef, - ParamCount: cuint, IsVarArg: int32): TLLVMTypeRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMIsFunctionVarArg*(FunctionTy: TLLVMTypeRef): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetReturnType*(FunctionTy: TLLVMTypeRef): TLLVMTypeRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMCountParamTypes*(FunctionTy: TLLVMTypeRef): cuint{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetParamTypes*(FunctionTy: TLLVMTypeRef, Dest: PLLVMTypeRef){.cdecl, - dynlib: llvmdll, importc.} - # Operations on struct types -proc LLVMStructType*(ElementTypes: PLLVMTypeRef, ElementCount: cuint, - isPacked: int32): TLLVMTypeRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMCountStructElementTypes*(StructTy: TLLVMTypeRef): cuint{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetStructElementTypes*(StructTy: TLLVMTypeRef, Dest: pLLVMTypeRef){. - cdecl, dynlib: llvmdll, importc.} -proc LLVMIsPackedStruct*(StructTy: TLLVMTypeRef): int32{.cdecl, dynlib: llvmdll, - importc.} - # Operations on array, pointer, and vector types (sequence types) -proc LLVMArrayType*(ElementType: TLLVMTypeRef, ElementCount: cuint): TLLVMTypeRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMPointerType*(ElementType: TLLVMTypeRef, AddressSpace: cuint): TLLVMTypeRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMVectorType*(ElementType: TLLVMTypeRef, ElementCount: cuint): TLLVMTypeRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMGetElementType*(Ty: TLLVMTypeRef): TLLVMTypeRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetArrayLength*(ArrayTy: TLLVMTypeRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetPointerAddressSpace*(PointerTy: TLLVMTypeRef): cuint{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetVectorSize*(VectorTy: TLLVMTypeRef): cuint{.cdecl, dynlib: llvmdll, - importc.} - # Operations on other types -proc LLVMVoidType*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMLabelType*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMOpaqueType*(): TLLVMTypeRef{.cdecl, dynlib: llvmdll, importc.} - # Operations on type handles -proc LLVMCreateTypeHandle*(PotentiallyAbstractTy: TLLVMTypeRef): TLLVMTypeHandleRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMRefineType*(AbstractTy: TLLVMTypeRef, ConcreteTy: TLLVMTypeRef){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMResolveTypeHandle*(TypeHandle: TLLVMTypeHandleRef): TLLVMTypeRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMDisposeTypeHandle*(TypeHandle: TLLVMTypeHandleRef){.cdecl, - dynlib: llvmdll, importc.} - #===-- Values ------------------------------------------------------------=== - # The bulk of LLVM's object model consists of values, which comprise a very - # * rich type hierarchy. - # * - # * values: - # * constants: - # * scalar constants - # * composite contants - # * globals: - # * global variable - # * function - # * alias - # * basic blocks - # - # Operations on all values -proc LLVMTypeOf*(Val: TLLVMValueRef): TLLVMTypeRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetValueName*(Val: TLLVMValueRef): cstring{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMSetValueName*(Val: TLLVMValueRef, Name: cstring){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMDumpValue*(Val: TLLVMValueRef){.cdecl, dynlib: llvmdll, importc.} - # Operations on constants of any type -proc LLVMConstNull*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} - # all zeroes -proc LLVMConstAllOnes*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} - # only for int/vector -proc LLVMGetUndef*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMIsConstant*(Val: TLLVMValueRef): int32{.cdecl, dynlib: llvmdll, importc.} -proc LLVMIsNull*(Val: TLLVMValueRef): int32{.cdecl, dynlib: llvmdll, importc.} -proc LLVMIsUndef*(Val: TLLVMValueRef): int32{.cdecl, dynlib: llvmdll, importc.} - # Operations on scalar constants -proc LLVMConstInt*(IntTy: TLLVMTypeRef, N: qword, SignExtend: int32): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstReal*(RealTy: TLLVMTypeRef, N: float64): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} - # Operations on composite constants -proc LLVMConstString*(Str: cstring, len: cuint, DontNullTerminate: int32): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstArray*(ArrayTy: TLLVMTypeRef, ConstantVals: pLLVMValueRef, - len: cuint): TLLVMValueRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMConstStruct*(ConstantVals: pLLVMValueRef, Count: cuint, ispacked: int32): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstVector*(ScalarConstantVals: pLLVMValueRef, Size: cuint): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Constant expressions -proc LLVMSizeOf*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMConstNeg*(ConstantVal: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMConstNot*(ConstantVal: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMConstAdd*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSub*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstMul*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstUDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstURem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSRem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFRem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstAnd*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstOr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstXor*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstICmp*(Predicate: TLLVMIntPredicate, LHSConstant: TLLVMValueRef, - RHSConstant: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMConstFCmp*(Predicate: TLLVMRealPredicate, LHSConstant: TLLVMValueRef, - RHSConstant: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMConstShl*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstLShr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstAShr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstGEP*(ConstantVal: TLLVMValueRef, ConstantIndices: PLLVMValueRef, - NumIndices: cuint): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMConstTrunc*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstZExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFPTrunc*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFPExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstUIToFP*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSIToFP*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFPToUI*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstFPToSI*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstPtrToInt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstIntToPtr*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstBitCast*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstSelect*(ConstantCondition: TLLVMValueRef, - ConstantIfTrue: TLLVMValueRef, - ConstantIfFalse: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMConstExtractElement*(VectorConstant: TLLVMValueRef, - IndexConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstInsertElement*(VectorConstant: TLLVMValueRef, - ElementValueConstant: TLLVMValueRef, - IndexConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMConstShuffleVector*(VectorAConstant: TLLVMValueRef, - VectorBConstant: TLLVMValueRef, - MaskConstant: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} - # Operations on global variables, functions, and aliases (globals) -proc LLVMIsDeclaration*(Global: TLLVMValueRef): int32{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetLinkage*(Global: TLLVMValueRef): TLLVMLinkage{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMSetLinkage*(Global: TLLVMValueRef, Linkage: TLLVMLinkage){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetSection*(Global: TLLVMValueRef): cstring{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMSetSection*(Global: TLLVMValueRef, Section: cstring){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetVisibility*(Global: TLLVMValueRef): TLLVMVisibility{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMSetVisibility*(Global: TLLVMValueRef, Viz: TLLVMVisibility){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetAlignment*(Global: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMSetAlignment*(Global: TLLVMValueRef, Bytes: cuint){.cdecl, - dynlib: llvmdll, importc.} - # Operations on global variables - # Const before type ignored -proc LLVMAddGlobal*(M: TLLVMModuleRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMGetNamedGlobal*(M: TLLVMModuleRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMDeleteGlobal*(GlobalVar: TLLVMValueRef){.cdecl, dynlib: llvmdll, - importc.} -proc LLVMHasInitializer*(GlobalVar: TLLVMValueRef): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetInitializer*(GlobalVar: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMSetInitializer*(GlobalVar: TLLVMValueRef, ConstantVal: TLLVMValueRef){. - cdecl, dynlib: llvmdll, importc.} -proc LLVMIsThreadLocal*(GlobalVar: TLLVMValueRef): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMSetThreadLocal*(GlobalVar: TLLVMValueRef, IsThreadLocal: int32){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMIsGlobalConstant*(GlobalVar: TLLVMValueRef): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMSetGlobalConstant*(GlobalVar: TLLVMValueRef, IsConstant: int32){.cdecl, - dynlib: llvmdll, importc.} - # Operations on functions - # Const before type ignored -proc LLVMAddFunction*(M: TLLVMModuleRef, Name: cstring, FunctionTy: TLLVMTypeRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMGetNamedFunction*(M: TLLVMModuleRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMDeleteFunction*(Fn: TLLVMValueRef){.cdecl, dynlib: llvmdll, importc.} -proc LLVMCountParams*(Fn: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, importc.} -proc LLVMGetParams*(Fn: TLLVMValueRef, Params: PLLVMValueRef){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetParam*(Fn: TLLVMValueRef, Index: cuint): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetIntrinsicID*(Fn: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetFunctionCallConv*(Fn: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMSetFunctionCallConv*(Fn: TLLVMValueRef, CC: cuint){.cdecl, - dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMGetCollector*(Fn: TLLVMValueRef): cstring{.cdecl, dynlib: llvmdll, - importc.} - # Const before type ignored -proc LLVMSetCollector*(Fn: TLLVMValueRef, Coll: cstring){.cdecl, - dynlib: llvmdll, importc.} - # Operations on basic blocks -proc LLVMBasicBlockAsValue*(Bb: TLLVMBasicBlockRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMValueIsBasicBlock*(Val: TLLVMValueRef): int32{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMValueAsBasicBlock*(Val: TLLVMValueRef): TLLVMBasicBlockRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMCountBasicBlocks*(Fn: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetBasicBlocks*(Fn: TLLVMValueRef, BasicBlocks: PLLVMBasicBlockRef){. - cdecl, dynlib: llvmdll, importc.} -proc LLVMGetEntryBasicBlock*(Fn: TLLVMValueRef): TLLVMBasicBlockRef{.cdecl, - dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMAppendBasicBlock*(Fn: TLLVMValueRef, Name: cstring): TLLVMBasicBlockRef{. - cdecl, dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMInsertBasicBlock*(InsertBeforeBB: TLLVMBasicBlockRef, Name: cstring): TLLVMBasicBlockRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMDeleteBasicBlock*(BB: TLLVMBasicBlockRef){.cdecl, dynlib: llvmdll, - importc.} - # Operations on call sites -proc LLVMSetInstructionCallConv*(Instr: TLLVMValueRef, CC: cuint){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMGetInstructionCallConv*(Instr: TLLVMValueRef): cuint{.cdecl, - dynlib: llvmdll, importc.} - # Operations on phi nodes -proc LLVMAddIncoming*(PhiNode: TLLVMValueRef, IncomingValues: PLLVMValueRef, - IncomingBlocks: PLLVMBasicBlockRef, Count: cuint){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMCountIncoming*(PhiNode: TLLVMValueRef): cuint{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMGetIncomingValue*(PhiNode: TLLVMValueRef, Index: cuint): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMGetIncomingBlock*(PhiNode: TLLVMValueRef, Index: cuint): TLLVMBasicBlockRef{. - cdecl, dynlib: llvmdll, importc.} - #===-- Instruction builders ----------------------------------------------=== - # An instruction builder represents a point within a basic block, and is the - # * exclusive means of building instructions using the C interface. - # -proc LLVMCreateBuilder*(): TLLVMBuilderRef{.cdecl, dynlib: llvmdll, importc.} -proc LLVMPositionBuilderBefore*(Builder: TLLVMBuilderRef, Instr: TLLVMValueRef){. - cdecl, dynlib: llvmdll, importc.} -proc LLVMPositionBuilderAtEnd*(Builder: TLLVMBuilderRef, - theBlock: TLLVMBasicBlockRef){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMDisposeBuilder*(Builder: TLLVMBuilderRef){.cdecl, dynlib: llvmdll, - importc.} - # Terminators -proc LLVMBuildRetVoid*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildRet*(para1: TLLVMBuilderRef, V: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildBr*(para1: TLLVMBuilderRef, Dest: TLLVMBasicBlockRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildCondBr*(para1: TLLVMBuilderRef, IfCond: TLLVMValueRef, - ThenBranch: TLLVMBasicBlockRef, - ElseBranch: TLLVMBasicBlockRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildSwitch*(para1: TLLVMBuilderRef, V: TLLVMValueRef, - ElseBranch: TLLVMBasicBlockRef, NumCases: cuint): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Const before type ignored -proc LLVMBuildInvoke*(para1: TLLVMBuilderRef, Fn: TLLVMValueRef, - Args: PLLVMValueRef, NumArgs: cuint, - ThenBranch: TLLVMBasicBlockRef, Catch: TLLVMBasicBlockRef, - Name: cstring): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMBuildUnwind*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildUnreachable*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} - # Add a case to the switch instruction -proc LLVMAddCase*(Switch: TLLVMValueRef, OnVal: TLLVMValueRef, - Dest: TLLVMBasicBlockRef){.cdecl, dynlib: llvmdll, importc.} - # Arithmetic -proc LLVMBuildAdd*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildSub*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildMul*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildUDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildSDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildFDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildURem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildSRem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildFRem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildShl*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildLShr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildAShr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildAnd*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildOr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildXor*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildNeg*(para1: TLLVMBuilderRef, V: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildNot*(para1: TLLVMBuilderRef, V: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Memory -proc LLVMBuildMalloc*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildArrayMalloc*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, - Val: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildAlloca*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildArrayAlloca*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, - Val: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildFree*(para1: TLLVMBuilderRef, PointerVal: TLLVMValueRef): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildLoad*(para1: TLLVMBuilderRef, PointerVal: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMBuildStore*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - thePtr: TLLVMValueRef): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildGEP*(B: TLLVMBuilderRef, Pointer: TLLVMValueRef, - Indices: PLLVMValueRef, NumIndices: cuint, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Casts -proc LLVMBuildTrunc*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildZExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildSExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildFPToUI*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildFPToSI*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildUIToFP*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildSIToFP*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildFPTrunc*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildFPExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildPtrToInt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildIntToPtr*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildBitCast*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Comparisons -proc LLVMBuildICmp*(para1: TLLVMBuilderRef, Op: TLLVMIntPredicate, - LHS: TLLVMValueRef, RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildFCmp*(para1: TLLVMBuilderRef, Op: TLLVMRealPredicate, - LHS: TLLVMValueRef, RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} - # Miscellaneous instructions -proc LLVMBuildPhi*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildCall*(para1: TLLVMBuilderRef, Fn: TLLVMValueRef, - Args: PLLVMValueRef, NumArgs: cuint, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildSelect*(para1: TLLVMBuilderRef, IfCond: TLLVMValueRef, - ThenBranch: TLLVMValueRef, ElseBranch: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl, dynlib: llvmdll, - importc.} -proc LLVMBuildVAArg*(para1: TLLVMBuilderRef, List: TLLVMValueRef, - Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildExtractElement*(para1: TLLVMBuilderRef, VecVal: TLLVMValueRef, - Index: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl, dynlib: llvmdll, importc.} -proc LLVMBuildInsertElement*(para1: TLLVMBuilderRef, VecVal: TLLVMValueRef, - EltVal: TLLVMValueRef, Index: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMBuildShuffleVector*(para1: TLLVMBuilderRef, V1: TLLVMValueRef, - V2: TLLVMValueRef, Mask: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl, - dynlib: llvmdll, importc.} - #===-- Module providers --------------------------------------------------=== - # Encapsulates the module M in a module provider, taking ownership of the - # module. - # See the constructor llvm: : ExistingModuleProvider: : ExistingModuleProvider. - # -proc LLVMCreateModuleProviderForExistingModule*(M: TLLVMModuleRef): TLLVMModuleProviderRef{. - cdecl, dynlib: llvmdll, importc.} - # Destroys the module provider MP as well as the contained module. - # See the destructor llvm: : ModuleProvider: : ~ModuleProvider. - # -proc LLVMDisposeModuleProvider*(MP: TLLVMModuleProviderRef){.cdecl, - dynlib: llvmdll, importc.} - #===-- Memory buffers ----------------------------------------------------=== -proc LLVMCreateMemoryBufferWithContentsOfFile*(Path: cstring, - OutMemBuf: pLLVMMemoryBufferRef, OutMessage: var cstring): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMCreateMemoryBufferWithSTDIN*(OutMemBuf: pLLVMMemoryBufferRef, - OutMessage: var cstring): int32{.cdecl, - dynlib: llvmdll, importc.} -proc LLVMDisposeMemoryBuffer*(MemBuf: TLLVMMemoryBufferRef){.cdecl, - dynlib: llvmdll, importc.} -proc LLVMWriteBitcodeToFile*(M: TLLVMModuleRef, path: cstring): int{.cdecl, - dynlib: llvmdll, importc.} - # Writes a module to the specified path. Returns 0 on success. -# implementation diff --git a/rod/llvmgen.nim b/rod/llvmgen.nim new file mode 100755 index 000000000..f8acb624a --- /dev/null +++ b/rod/llvmgen.nim @@ -0,0 +1,890 @@ +# +# +# The Nimrod Compiler +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## LLVM code generator. + +import + ast, astalgo, strutils, nhashes, trees, platform, magicsys, extccomp, options, + nversion, nimsets, msgs, crc, bitsets, idents, lists, types, ccgutils, os, + times, ropes, math, passes, rodread, wordrecg, rnimsyn, treetab, cgmeth, + llvm + +proc llvmGenPass*(): TPass + + +type + TLabel = PRope # for the C generator a label is just a rope + TCFileSection = enum # the sections a generated C file consists of + cfsHeaders, # section for C include file headers + cfsForwardTypes, # section for C forward typedefs + cfsTypes, # section for C typedefs + cfsSeqTypes, # section for sequence types only + # this is needed for strange type generation + # reasons + cfsFieldInfo, # section for field information + cfsTypeInfo, # section for type information + cfsProcHeaders, # section for C procs prototypes + cfsData, # section for C constant data + cfsVars, # section for C variable declarations + cfsProcs, # section for C procs that are not inline + cfsTypeInit1, # section 1 for declarations of type information + cfsTypeInit2, # section 2 for init of type information + cfsTypeInit3, # section 3 for init of type information + cfsDebugInit, # section for init of debug information + cfsDynLibInit, # section for init of dynamic library binding + cfsDynLibDeinit # section for deinitialization of dynamic libraries + TCTypeKind = enum # describes the type kind of a C type + ctVoid, ctChar, ctBool, ctUInt, ctUInt8, ctUInt16, ctUInt32, ctUInt64, + ctInt, ctInt8, ctInt16, ctInt32, ctInt64, ctFloat, ctFloat32, ctFloat64, + ctFloat128, ctArray, ctStruct, ctPtr, ctNimStr, ctNimSeq, ctProc, ctCString + TCFileSections = array[TCFileSection, PRope] # represents a generated C file + TCProcSection = enum # the sections a generated C proc consists of + cpsLocals, # section of local variables for C proc + cpsInit, # section for init of variables for C proc + cpsStmts # section of local statements for C proc + TCProcSections = array[TCProcSection, PRope] # represents a generated C proc + BModule = ref TCGen + BProc = ref TCProc + TBlock{.final.} = object + id*: int # the ID of the label; positive means that it + # has been used (i.e. the label should be emitted) + nestedTryStmts*: int # how many try statements is it nested into + + TCProc{.final.} = object # represents C proc that is currently generated + s*: TCProcSections # the procs sections; short name for readability + prc*: PSym # the Nimrod proc that this C proc belongs to + BeforeRetNeeded*: bool # true iff 'BeforeRet' label for proc is needed + nestedTryStmts*: Natural # in how many nested try statements we are + # (the vars must be volatile then) + labels*: Natural # for generating unique labels in the C proc + blocks*: seq[TBlock] # nested blocks + options*: TOptions # options that should be used for code + # generation; this is the same as prc.options + # unless prc == nil + frameLen*: int # current length of frame descriptor + sendClosure*: PType # closure record type that we pass + receiveClosure*: PType # closure record type that we get + module*: BModule # used to prevent excessive parameter passing + + TTypeSeq = seq[PType] + TCGen = object of TPassContext # represents a C source file + module*: PSym + filename*: string + s*: TCFileSections # sections of the C file + cfilename*: string # filename of the module (including path, + # without extension) + typeCache*: TIdTable # cache the generated types + forwTypeCache*: TIdTable # cache for forward declarations of types + declaredThings*: TIntSet # things we have declared in this .c file + declaredProtos*: TIntSet # prototypes we have declared in this .c file + headerFiles*: TLinkedList # needed headers to include + typeInfoMarker*: TIntSet # needed for generating type information + initProc*: BProc # code for init procedure + typeStack*: TTypeSeq # used for type generation + dataCache*: TNodeTable + forwardedProcs*: TSymSeq # keep forwarded procs here + typeNodes*, nimTypes*: int # used for type info generation + typeNodesName*, nimTypesName*: PRope # used for type info generation + labels*: natural # for generating unique module-scope names + + +var + mainModProcs, mainModInit: PRope # parts of the main module + gMapping: PRope # the generated mapping file (if requested) + gProcProfile: Natural # proc profile counter + gGeneratedSyms: TIntSet # set of ID's of generated symbols + gPendingModules: seq[BModule] = @[] # list of modules that are not + # finished with code generation + gForwardedProcsCounter: int = 0 + gNimDat: BModule # generated global data + +proc ropeff(cformat, llvmformat: string, args: openarray[PRope]): PRope = + if gCmd == cmdCompileToLLVM: result = ropef(llvmformat, args) + else: result = ropef(cformat, args) + +proc appff(dest: var PRope, cformat, llvmformat: string, + args: openarray[PRope]) = + if gCmd == cmdCompileToLLVM: appf(dest, llvmformat, args) + else: appf(dest, cformat, args) + +proc addForwardedProc(m: BModule, prc: PSym) = + m.forwardedProcs.add(prc) + inc(gForwardedProcsCounter) + +proc addPendingModule(m: BModule) = + for i in countup(0, high(gPendingModules)): + if gPendingModules[i] == m: + InternalError("module already pending: " & m.module.name.s) + gPendingModules.add(m) + +proc findPendingModule(m: BModule, s: PSym): BModule = + var ms = getModule(s) + if ms.id == m.module.id: + return m + for i in countup(0, high(gPendingModules)): + result = gPendingModules[i] + if result.module.id == ms.id: return + InternalError(s.info, "no pending module found for: " & s.name.s) + +proc initLoc(result: var TLoc, k: TLocKind, typ: PType, s: TStorageLoc) = + result.k = k + result.s = s + result.t = GetUniqueType(typ) + result.r = nil + result.a = - 1 + result.flags = {} + +proc fillLoc(a: var TLoc, k: TLocKind, typ: PType, r: PRope, s: TStorageLoc) = + # fills the loc if it is not already initialized + if a.k == locNone: + a.k = k + a.t = getUniqueType(typ) + a.a = - 1 + a.s = s + if a.r == nil: a.r = r + +proc newProc(prc: PSym, module: BModule): BProc = + new(result) + result.prc = prc + result.module = module + if prc != nil: result.options = prc.options + else: result.options = gOptions + result.blocks = @[] + +proc isSimpleConst(typ: PType): bool = + result = not (skipTypes(typ, abstractVar).kind in + {tyTuple, tyObject, tyArray, tyArrayConstr, tySet, tySequence}) + +proc useHeader(m: BModule, sym: PSym) = + if lfHeader in sym.loc.Flags: + assert(sym.annex != nil) + discard lists.IncludeStr(m.headerFiles, getStr(sym.annex.path)) + +proc UseMagic(m: BModule, name: string) + +include "ccgtypes.nim" + +# ------------------------------ Manager of temporaries ------------------ + +proc getTemp(p: BProc, t: PType, result: var TLoc) = + inc(p.labels) + if gCmd == cmdCompileToLLVM: + result.r = con("%LOC", toRope(p.labels)) + else: + result.r = con("LOC", toRope(p.labels)) + appf(p.s[cpsLocals], "$1 $2;$n", [getTypeDesc(p.module, t), result.r]) + result.k = locTemp + result.a = - 1 + result.t = getUniqueType(t) + result.s = OnStack + result.flags = {} + +proc cstringLit(p: BProc, r: var PRope, s: string): PRope = + if gCmd == cmdCompileToLLVM: + inc(p.module.labels) + inc(p.labels) + result = ropef("%LOC$1", [toRope(p.labels)]) + appf(p.module.s[cfsData], "@C$1 = private constant [$2 x i8] $3$n", + [toRope(p.module.labels), toRope(len(s)), makeLLVMString(s)]) + appf(r, "$1 = getelementptr [$2 x i8]* @C$3, %NI 0, %NI 0$n", + [result, toRope(len(s)), toRope(p.module.labels)]) + else: + result = makeCString(s) + +proc cstringLit(m: BModule, r: var PRope, s: string): PRope = + if gCmd == cmdCompileToLLVM: + inc(m.labels, 2) + result = ropef("%MOC$1", [toRope(m.labels - 1)]) + appf(m.s[cfsData], "@MOC$1 = private constant [$2 x i8] $3$n", + [toRope(m.labels), toRope(len(s)), makeLLVMString(s)]) + appf(r, "$1 = getelementptr [$2 x i8]* @MOC$3, %NI 0, %NI 0$n", + [result, toRope(len(s)), toRope(m.labels)]) + else: + result = makeCString(s) + +proc allocParam(p: BProc, s: PSym) = + assert(s.kind == skParam) + if not (lfParamCopy in s.loc.flags): + inc(p.labels) + var tmp = con("%LOC", toRope(p.labels)) + incl(s.loc.flags, lfParamCopy) + incl(s.loc.flags, lfIndirect) + appf(p.s[cpsInit], "$1 = alloca $3$n" & "store $3 $2, $3* $1$n", + [tmp, s.loc.r, getTypeDesc(p.module, s.loc.t)]) + s.loc.r = tmp + +proc localDebugInfo(p: BProc, s: PSym) = + var name, a: PRope + if {optStackTrace, optEndb} * p.options != {optStackTrace, optEndb}: return + if gCmd == cmdCompileToLLVM: + # "address" is the 0th field + # "typ" is the 1rst field + # "name" is the 2nd field + name = cstringLit(p, p.s[cpsInit], normalize(s.name.s)) + if (s.kind == skParam) and not ccgIntroducedPtr(s): allocParam(p, s) + inc(p.labels, 3) + appf(p.s[cpsInit], "%LOC$6 = getelementptr %TF* %F, %NI 0, $1, %NI 0$n" & + "%LOC$7 = getelementptr %TF* %F, %NI 0, $1, %NI 1$n" & + "%LOC$8 = getelementptr %TF* %F, %NI 0, $1, %NI 2$n" & + "store i8* $2, i8** %LOC$6$n" & "store $3* $4, $3** %LOC$7$n" & + "store i8* $5, i8** %LOC$8$n", [toRope(p.frameLen), s.loc.r, + getTypeDesc(p.module, "TNimType"), + genTypeInfo(p.module, s.loc.t), name, + toRope(p.labels), toRope(p.labels - 1), + toRope(p.labels - 2)]) + else: + a = con("&", s.loc.r) + if (s.kind == skParam) and ccgIntroducedPtr(s): a = s.loc.r + appf(p.s[cpsInit], + "F.s[$1].address = (void*)$3; F.s[$1].typ = $4; F.s[$1].name = $2;$n", [ + toRope(p.frameLen), makeCString(normalize(s.name.s)), a, + genTypeInfo(p.module, s.loc.t)]) + inc(p.frameLen) + +proc assignLocalVar(p: BProc, s: PSym) = + #assert(s.loc.k == locNone) // not yet assigned + # this need not be fullfilled for inline procs; they are regenerated + # for each module that uses them! + if s.loc.k == locNone: + fillLoc(s.loc, locLocalVar, s.typ, mangleName(s), OnStack) + if gCmd == cmdCompileToLLVM: + appf(p.s[cpsLocals], "$1 = alloca $2$n", + [s.loc.r, getTypeDesc(p.module, s.loc.t)]) + incl(s.loc.flags, lfIndirect) + else: + app(p.s[cpsLocals], getTypeDesc(p.module, s.loc.t)) + if sfRegister in s.flags: app(p.s[cpsLocals], " register") + if (sfVolatile in s.flags) or (p.nestedTryStmts > 0): + app(p.s[cpsLocals], " volatile") + appf(p.s[cpsLocals], " $1;$n", [s.loc.r]) + localDebugInfo(p, s) + +proc assignGlobalVar(p: BProc, s: PSym) = + if s.loc.k == locNone: + fillLoc(s.loc, locGlobalVar, s.typ, mangleName(s), OnHeap) + if gCmd == cmdCompileToLLVM: + appf(p.module.s[cfsVars], "$1 = linkonce global $2 zeroinitializer$n", + [s.loc.r, getTypeDesc(p.module, s.loc.t)]) + incl(s.loc.flags, lfIndirect) + else: + useHeader(p.module, s) + if lfNoDecl in s.loc.flags: return + if sfImportc in s.flags: app(p.module.s[cfsVars], "extern ") + app(p.module.s[cfsVars], getTypeDesc(p.module, s.loc.t)) + if sfRegister in s.flags: app(p.module.s[cfsVars], " register") + if sfVolatile in s.flags: app(p.module.s[cfsVars], " volatile") + if sfThreadVar in s.flags: app(p.module.s[cfsVars], " NIM_THREADVAR") + appf(p.module.s[cfsVars], " $1;$n", [s.loc.r]) + if {optStackTrace, optEndb} * p.module.module.options == + {optStackTrace, optEndb}: + useMagic(p.module, "dbgRegisterGlobal") + appff(p.module.s[cfsDebugInit], "dbgRegisterGlobal($1, &$2, $3);$n", + "call void @dbgRegisterGlobal(i8* $1, i8* $2, $4* $3)$n", [cstringLit( + p, p.module.s[cfsDebugInit], normalize(s.owner.name.s & '.' & s.name.s)), + s.loc.r, genTypeInfo(p.module, s.typ), getTypeDesc(p.module, "TNimType")]) + +proc iff(cond: bool, the, els: PRope): PRope = + if cond: result = the + else: result = els + +proc assignParam(p: BProc, s: PSym) = + assert(s.loc.r != nil) + if (sfAddrTaken in s.flags) and (gCmd == cmdCompileToLLVM): allocParam(p, s) + localDebugInfo(p, s) + +proc fillProcLoc(sym: PSym) = + if sym.loc.k == locNone: + fillLoc(sym.loc, locProc, sym.typ, mangleName(sym), OnStack) + +proc getLabel(p: BProc): TLabel = + inc(p.labels) + result = con("LA", toRope(p.labels)) + +proc fixLabel(p: BProc, labl: TLabel) = + appf(p.s[cpsStmts], "$1: ;$n", [labl]) + +proc genVarPrototype(m: BModule, sym: PSym) +proc genConstPrototype(m: BModule, sym: PSym) +proc genProc(m: BModule, prc: PSym) +proc genStmts(p: BProc, t: PNode) +proc genProcPrototype(m: BModule, sym: PSym) + +include "ccgexprs.nim", "ccgstmts.nim" + +# ----------------------------- dynamic library handling ----------------- +# We don't finalize dynamic libs as this does the OS for us. + +proc libCandidates(s: string, dest: var TStringSeq) = + var le = strutils.find(s, '(') + var ri = strutils.find(s, ')', le+1) + if le >= 0 and ri > le: + var prefix = copy(s, 0, le - 1) + var suffix = copy(s, ri + 1) + for middle in split(copy(s, le + 1, ri - 1), '|'): + libCandidates(prefix & middle & suffix, dest) + else: + add(dest, s) + +proc loadDynamicLib(m: BModule, lib: PLib) = + assert(lib != nil) + if not lib.generated: + lib.generated = true + var tmp = getGlobalTempName() + assert(lib.name == nil) + lib.name = tmp # BUGFIX: useMagic has awful side-effects + appf(m.s[cfsVars], "static void* $1;$n", [tmp]) + if lib.path.kind in {nkStrLit..nkTripleStrLit}: + var s: TStringSeq = @[] + libCandidates(lib.path.strVal, s) + var loadlib: PRope = nil + for i in countup(0, high(s)): + inc(m.labels) + if i > 0: app(loadlib, "||") + appf(loadlib, "($1 = nimLoadLibrary((NimStringDesc*) &$2))$n", + [tmp, getStrLit(m, s[i])]) + appf(m.s[cfsDynLibInit], + "if (!($1)) nimLoadLibraryError((NimStringDesc*) &$2);$n", + [loadlib, getStrLit(m, lib.path.strVal)]) + else: + var p = newProc(nil, m) + var dest: TLoc + initLocExpr(p, lib.path, dest) + app(m.s[cfsVars], p.s[cpsLocals]) + app(m.s[cfsDynLibInit], p.s[cpsInit]) + app(m.s[cfsDynLibInit], p.s[cpsStmts]) + appf(m.s[cfsDynLibInit], + "if (!($1 = nimLoadLibrary($2))) nimLoadLibraryError($2);$n", + [tmp, rdLoc(dest)]) + + useMagic(m, "nimLoadLibrary") + useMagic(m, "nimUnloadLibrary") + useMagic(m, "NimStringDesc") + useMagic(m, "nimLoadLibraryError") + if lib.name == nil: InternalError("loadDynamicLib") + +proc SymInDynamicLib(m: BModule, sym: PSym) = + var lib = sym.annex + var extname = sym.loc.r + loadDynamicLib(m, lib) + useMagic(m, "nimGetProcAddr") + if gCmd == cmdCompileToLLVM: incl(sym.loc.flags, lfIndirect) + var tmp = ropeff("Dl_$1", "@Dl_$1", [toRope(sym.id)]) + sym.loc.r = tmp # from now on we only need the internal name + sym.typ.sym = nil # generate a new name + inc(m.labels, 2) + appff(m.s[cfsDynLibInit], + "$1 = ($2) nimGetProcAddr($3, $4);$n", "%MOC$5 = load i8* $3$n" & + "%MOC$6 = call $2 @nimGetProcAddr(i8* %MOC$5, i8* $4)$n" & + "store $2 %MOC$6, $2* $1$n", [tmp, getTypeDesc(m, sym.typ), + lib.name, cstringLit(m, m.s[cfsDynLibInit], ropeToStr(extname)), + toRope(m.labels), toRope(m.labels - 1)]) + appff(m.s[cfsVars], "$2 $1;$n", + "$1 = linkonce global $2 zeroinitializer$n", + [sym.loc.r, getTypeDesc(m, sym.loc.t)]) + +proc UseMagic(m: BModule, name: string) = + var sym = magicsys.getCompilerProc(name) + if sym != nil: + case sym.kind + of skProc, skMethod, skConverter: genProc(m, sym) + of skVar: genVarPrototype(m, sym) + of skType: discard getTypeDesc(m, sym.typ) + else: InternalError("useMagic: " & name) + elif not (sfSystemModule in m.module.flags): + rawMessage(errSystemNeeds, name) # don't be too picky here + +proc generateHeaders(m: BModule) = + app(m.s[cfsHeaders], "#include \"nimbase.h\"" & tnl & tnl) + var it = PStrEntry(m.headerFiles.head) + while it != nil: + if not (it.data[0] in {'\"', '<'}): + appf(m.s[cfsHeaders], "#include \"$1\"$n", [toRope(it.data)]) + else: + appf(m.s[cfsHeaders], "#include $1$n", [toRope(it.data)]) + it = PStrEntry(it.Next) + +proc getFrameDecl(p: BProc) = + var slots: PRope + if p.frameLen > 0: + useMagic(p.module, "TVarSlot") + slots = ropeff(" TVarSlot s[$1];$n", ", [$1 x %TVarSlot]", + [toRope(p.frameLen)]) + else: + slots = nil + appff(p.s[cpsLocals], "volatile struct {TFrame* prev;" & + "NCSTRING procname;NI line;NCSTRING filename;" & + "NI len;$n$1} F;$n", + "%TF = type {%TFrame*, i8*, %NI, %NI$1}$n" & + "%F = alloca %TF$n", [slots]) + inc(p.labels) + prepend(p.s[cpsInit], ropeff("F.len = $1;$n", + "%LOC$2 = getelementptr %TF %F, %NI 4$n" & + "store %NI $1, %NI* %LOC$2$n", [toRope(p.frameLen), toRope(p.labels)])) + +proc retIsNotVoid(s: PSym): bool = + result = (s.typ.sons[0] != nil) and not isInvalidReturnType(s.typ.sons[0]) + +proc initFrame(p: BProc, procname, filename: PRope): PRope = + inc(p.labels, 5) + result = ropeff("F.procname = $1;$n" & "F.prev = framePtr;$n" & + "F.filename = $2;$n" & "F.line = 0;$n" & "framePtr = (TFrame*)&F;$n", + "%LOC$3 = getelementptr %TF %F, %NI 1$n" & + "%LOC$4 = getelementptr %TF %F, %NI 0$n" & + "%LOC$5 = getelementptr %TF %F, %NI 3$n" & + "%LOC$6 = getelementptr %TF %F, %NI 2$n" & "store i8* $1, i8** %LOC$3$n" & + "store %TFrame* @framePtr, %TFrame** %LOC$4$n" & + "store i8* $2, i8** %LOC$5$n" & "store %NI 0, %NI* %LOC$6$n" & + "%LOC$7 = bitcast %TF* %F to %TFrame*$n" & + "store %TFrame* %LOC$7, %TFrame** @framePtr$n", [procname, filename, + toRope(p.labels), toRope(p.labels - 1), toRope(p.labels - 2), + toRope(p.labels - 3), toRope(p.labels - 4)]) + +proc deinitFrame(p: BProc): PRope = + inc(p.labels, 3) + result = ropeff("framePtr = framePtr->prev;$n", + "%LOC$1 = load %TFrame* @framePtr$n" & + "%LOC$2 = getelementptr %TFrame* %LOC$1, %NI 0$n" & + "%LOC$3 = load %TFrame** %LOC$2$n" & + "store %TFrame* $LOC$3, %TFrame** @framePtr", [toRope(p.labels), + toRope(p.labels - 1), toRope(p.labels - 2)]) + +proc genProcAux(m: BModule, prc: PSym) = + var + p: BProc + generatedProc, header, returnStmt, procname, filename: PRope + res, param: PSym + p = newProc(prc, m) + header = genProcHeader(m, prc) + if (gCmd != cmdCompileToLLVM) and (lfExportLib in prc.loc.flags): + header = con("N_LIB_EXPORT ", header) + returnStmt = nil + assert(prc.ast != nil) + if not (sfPure in prc.flags) and (prc.typ.sons[0] != nil): + res = prc.ast.sons[resultPos].sym # get result symbol + if not isInvalidReturnType(prc.typ.sons[0]): + # declare the result symbol: + assignLocalVar(p, res) + assert(res.loc.r != nil) + returnStmt = ropeff("return $1;$n", "ret $1$n", [rdLoc(res.loc)]) + else: + fillResult(res) + assignParam(p, res) + if skipTypes(res.typ, abstractInst).kind == tyArray: + incl(res.loc.flags, lfIndirect) + res.loc.s = OnUnknown + initVariable(p, res) + genObjectInit(p, res.typ, res.loc, true) + for i in countup(1, sonsLen(prc.typ.n) - 1): + param = prc.typ.n.sons[i].sym + assignParam(p, param) + genStmts(p, prc.ast.sons[codePos]) # modifies p.locals, p.init, etc. + if sfPure in prc.flags: + generatedProc = ropeff("$1 {$n$2$3$4}$n", "define $1 {$n$2$3$4}$n", [header, + p.s[cpsLocals], p.s[cpsInit], p.s[cpsStmts]]) + else: + generatedProc = ropeff("$1 {$n", "define $1 {$n", [header]) + if optStackTrace in prc.options: + getFrameDecl(p) + app(generatedProc, p.s[cpsLocals]) + procname = CStringLit(p, generatedProc, + prc.owner.name.s & '.' & prc.name.s) + filename = CStringLit(p, generatedProc, toFilename(prc.info)) + app(generatedProc, initFrame(p, procname, filename)) + else: + app(generatedProc, p.s[cpsLocals]) + if (optProfiler in prc.options) and (gCmd != cmdCompileToLLVM): + if gProcProfile >= 64 * 1024: + InternalError(prc.info, "too many procedures for profiling") + useMagic(m, "profileData") + app(p.s[cpsLocals], "ticks NIM_profilingStart;" & tnl) + if prc.loc.a < 0: + appf(m.s[cfsDebugInit], "profileData[$1].procname = $2;$n", [ + toRope(gProcProfile), + makeCString(prc.owner.name.s & '.' & prc.name.s)]) + prc.loc.a = gProcProfile + inc(gProcProfile) + prepend(p.s[cpsInit], toRope("NIM_profilingStart = getticks();" & tnl)) + app(generatedProc, p.s[cpsInit]) + app(generatedProc, p.s[cpsStmts]) + if p.beforeRetNeeded: app(generatedProc, "BeforeRet: ;" & tnl) + if optStackTrace in prc.options: app(generatedProc, deinitFrame(p)) + if (optProfiler in prc.options) and (gCmd != cmdCompileToLLVM): + appf(generatedProc, "profileData[$1].total += elapsed(getticks(), NIM_profilingStart);$n", + [toRope(prc.loc.a)]) + app(generatedProc, returnStmt) + app(generatedProc, '}' & tnl) + app(m.s[cfsProcs], generatedProc) #if prc.kind = skMethod then addMethodToCompile(gNimDat, prc); + +proc genProcPrototype(m: BModule, sym: PSym) = + useHeader(m, sym) + if (lfNoDecl in sym.loc.Flags): return + if lfDynamicLib in sym.loc.Flags: + if (sym.owner.id != m.module.id) and + not intSetContainsOrIncl(m.declaredThings, sym.id): + appff(m.s[cfsVars], "extern $1 Dl_$2;$n", + "@Dl_$2 = linkonce global $1 zeroinitializer$n", + [getTypeDesc(m, sym.loc.t), toRope(sym.id)]) + if gCmd == cmdCompileToLLVM: incl(sym.loc.flags, lfIndirect) + else: + if not IntSetContainsOrIncl(m.declaredProtos, sym.id): + appf(m.s[cfsProcHeaders], "$1;$n", [genProcHeader(m, sym)]) + +proc genProcNoForward(m: BModule, prc: PSym) = + fillProcLoc(prc) + useHeader(m, prc) + genProcPrototype(m, prc) + if (lfNoDecl in prc.loc.Flags): return + if prc.typ.callConv == ccInline: + # We add inline procs to the calling module to enable C based inlining. + # This also means that a check with ``gGeneratedSyms`` is wrong, we need + # a check for ``m.declaredThings``. + if not intSetContainsOrIncl(m.declaredThings, prc.id): genProcAux(m, prc) + elif lfDynamicLib in prc.loc.flags: + if not IntSetContainsOrIncl(gGeneratedSyms, prc.id): + SymInDynamicLib(findPendingModule(m, prc), prc) + elif not (sfImportc in prc.flags): + if not IntSetContainsOrIncl(gGeneratedSyms, prc.id): + genProcAux(findPendingModule(m, prc), prc) + +proc genProc(m: BModule, prc: PSym) = + if sfBorrow in prc.flags: return + fillProcLoc(prc) + if {sfForward, sfFromGeneric} * prc.flags != {}: addForwardedProc(m, prc) + else: genProcNoForward(m, prc) + +proc genVarPrototype(m: BModule, sym: PSym) = + assert(sfGlobal in sym.flags) + useHeader(m, sym) + fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap) + if (lfNoDecl in sym.loc.Flags) or + intSetContainsOrIncl(m.declaredThings, sym.id): + return + if sym.owner.id != m.module.id: + # else we already have the symbol generated! + assert(sym.loc.r != nil) + if gCmd == cmdCompileToLLVM: + incl(sym.loc.flags, lfIndirect) + appf(m.s[cfsVars], "$1 = linkonce global $2 zeroinitializer$n", + [sym.loc.r, getTypeDesc(m, sym.loc.t)]) + else: + app(m.s[cfsVars], "extern ") + app(m.s[cfsVars], getTypeDesc(m, sym.loc.t)) + if sfRegister in sym.flags: app(m.s[cfsVars], " register") + if sfVolatile in sym.flags: app(m.s[cfsVars], " volatile") + if sfThreadVar in sym.flags: app(m.s[cfsVars], " NIM_THREADVAR") + appf(m.s[cfsVars], " $1;$n", [sym.loc.r]) + +proc genConstPrototype(m: BModule, sym: PSym) = + useHeader(m, sym) + if sym.loc.k == locNone: + fillLoc(sym.loc, locData, sym.typ, mangleName(sym), OnUnknown) + if (lfNoDecl in sym.loc.Flags) or + intSetContainsOrIncl(m.declaredThings, sym.id): + return + if sym.owner.id != m.module.id: + # else we already have the symbol generated! + assert(sym.loc.r != nil) + appff(m.s[cfsData], "extern NIM_CONST $1 $2;$n", + "$1 = linkonce constant $2 zeroinitializer", + [getTypeDesc(m, sym.loc.t), sym.loc.r]) + +proc getFileHeader(cfilenoext: string): PRope = + if optCompileOnly in gGlobalOptions: + result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & + "/* (c) 2009 Andreas Rumpf */$n", "; Generated by Nimrod Compiler v$1$n" & + "; (c) 2009 Andreas Rumpf$n", [toRope(versionAsString)]) + else: + result = ropeff("/* Generated by Nimrod Compiler v$1 */$n" & + "/* (c) 2009 Andreas Rumpf */$n" & "/* Compiled for: $2, $3, $4 */$n" & + "/* Command for C compiler:$n $5 */$n", "; Generated by Nimrod Compiler v$1$n" & + "; (c) 2009 Andreas Rumpf$n" & "; Compiled for: $2, $3, $4$n" & + "; Command for LLVM compiler:$n $5$n", [toRope(versionAsString), + toRope(platform.OS[targetOS].name), + toRope(platform.CPU[targetCPU].name), + toRope(extccomp.CC[extccomp.ccompiler].name), + toRope(getCompileCFileCmd(cfilenoext))]) + case platform.CPU[targetCPU].intSize + of 16: + appff(result, + "$ntypedef short int NI;$n" & "typedef unsigned short int NU;$n", + "$n%NI = type i16$n", []) + of 32: + appff(result, + "$ntypedef long int NI;$n" & "typedef unsigned long int NU;$n", + "$n%NI = type i32$n", []) + of 64: + appff(result, "$ntypedef long long int NI;$n" & + "typedef unsigned long long int NU;$n", "$n%NI = type i64$n", []) + else: + nil + +proc genMainProc(m: BModule) = + const + CommonMainBody = " setStackBottom(dummy);$n" & " nim__datInit();$n" & + " systemInit();$n" & "$1" & "$2" + CommonMainBodyLLVM = " %MOC$3 = bitcast [8 x %NI]* %dummy to i8*$n" & + " call void @setStackBottom(i8* %MOC$3)$n" & + " call void @nim__datInit()$n" & " call void systemInit()$n" & "$1" & + "$2" + PosixNimMain = "int cmdCount;$n" & "char** cmdLine;$n" & "char** gEnv;$n" & + "N_CDECL(void, NimMain)(void) {$n" & " int dummy[8];$n" & + CommonMainBody & "}$n" + PosixCMain = "int main(int argc, char** args, char** env) {$n" & + " cmdLine = args;$n" & " cmdCount = argc;$n" & " gEnv = env;$n" & + " NimMain();$n" & " return 0;$n" & "}$n" + PosixNimMainLLVM = "@cmdCount = linkonce i32$n" & + "@cmdLine = linkonce i8**$n" & "@gEnv = linkonce i8**$n" & + "define void @NimMain(void) {$n" & " %dummy = alloca [8 x %NI]$n" & + CommonMainBodyLLVM & "}$n" + PosixCMainLLVM = "define i32 @main(i32 %argc, i8** %args, i8** %env) {$n" & + " store i8** %args, i8*** @cmdLine$n" & + " store i32 %argc, i32* @cmdCount$n" & + " store i8** %env, i8*** @gEnv$n" & " call void @NimMain()$n" & + " ret i32 0$n" & "}$n" + WinNimMain = "N_CDECL(void, NimMain)(void) {$n" & " int dummy[8];$n" & + CommonMainBody & "}$n" + WinCMain = "N_STDCALL(int, WinMain)(HINSTANCE hCurInstance, $n" & + " HINSTANCE hPrevInstance, $n" & + " LPSTR lpCmdLine, int nCmdShow) {$n" & + " NimMain();$n" & " return 0;$n" & "}$n" + WinNimMainLLVM = "define void @NimMain(void) {$n" & + " %dummy = alloca [8 x %NI]$n" & CommonMainBodyLLVM & "}$n" + WinCMainLLVM = "define stdcall i32 @WinMain(i32 %hCurInstance, $n" & + " i32 %hPrevInstance, $n" & + " i8* %lpCmdLine, i32 %nCmdShow) {$n" & + " call void @NimMain()$n" & " ret i32 0$n" & "}$n" + WinNimDllMain = "N_LIB_EXPORT N_CDECL(void, NimMain)(void) {$n" & + " int dummy[8];$n" & CommonMainBody & "}$n" + WinCDllMain = "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $n" & + " LPVOID lpvReserved) {$n" & " NimMain();$n" & + " return 1;$n" & "}$n" + WinNimDllMainLLVM = WinNimMainLLVM + WinCDllMainLLVM = "define stdcall i32 @DllMain(i32 %hinstDLL, i32 %fwdreason, $n" & + " i8* %lpvReserved) {$n" & + " call void @NimMain()$n" & " ret i32 1$n" & "}$n" + var nimMain, otherMain: TFormatStr + useMagic(m, "setStackBottom") + if (platform.targetOS == osWindows) and + (gGlobalOptions * {optGenGuiApp, optGenDynLib} != {}): + if optGenGuiApp in gGlobalOptions: + if gCmd == cmdCompileToLLVM: + nimMain = WinNimMainLLVM + otherMain = WinCMainLLVM + else: + nimMain = WinNimMain + otherMain = WinCMain + else: + if gCmd == cmdCompileToLLVM: + nimMain = WinNimDllMainLLVM + otherMain = WinCDllMainLLVM + else: + nimMain = WinNimDllMain + otherMain = WinCDllMain + discard lists.IncludeStr(m.headerFiles, "<windows.h>") + else: + if gCmd == cmdCompileToLLVM: + nimMain = PosixNimMainLLVM + otherMain = PosixCMainLLVM + else: + nimMain = PosixNimMain + otherMain = PosixCMain + if gBreakpoints != nil: useMagic(m, "dbgRegisterBreakpoint") + inc(m.labels) + appf(m.s[cfsProcs], nimMain, [gBreakpoints, mainModInit, toRope(m.labels)]) + if not (optNoMain in gGlobalOptions): appf(m.s[cfsProcs], otherMain, []) + +proc getInitName(m: PSym): PRope = + result = ropeff("$1Init", "@$1Init", [toRope(m.name.s)]) + +proc registerModuleToMain(m: PSym) = + var initname = getInitName(m) + appff(mainModProcs, "N_NOINLINE(void, $1)(void);$n", + "declare void $1() noinline$n", [initname]) + if not (sfSystemModule in m.flags): + appff(mainModInit, "$1();$n", "call void ()* $1$n", [initname]) + +proc genInitCode(m: BModule) = + var initname, prc, procname, filename: PRope + if optProfiler in m.initProc.options: + # This does not really belong here, but there is no good place for this + # code. I don't want to put this to the proc generation as the + # ``IncludeStr`` call is quite slow. + discard lists.IncludeStr(m.headerFiles, "<cycle.h>") + initname = getInitName(m.module) + prc = ropeff("N_NOINLINE(void, $1)(void) {$n", + "define void $1() noinline {$n", [initname]) + if m.typeNodes > 0: + useMagic(m, "TNimNode") + appff(m.s[cfsTypeInit1], "static TNimNode $1[$2];$n", + "$1 = private alloca [$2 x @TNimNode]$n", + [m.typeNodesName, toRope(m.typeNodes)]) + if m.nimTypes > 0: + useMagic(m, "TNimType") + appff(m.s[cfsTypeInit1], "static TNimType $1[$2];$n", + "$1 = private alloca [$2 x @TNimType]$n", + [m.nimTypesName, toRope(m.nimTypes)]) + if optStackTrace in m.initProc.options: + getFrameDecl(m.initProc) + app(prc, m.initProc.s[cpsLocals]) + app(prc, m.s[cfsTypeInit1]) + procname = CStringLit(m.initProc, prc, "module " & m.module.name.s) + filename = CStringLit(m.initProc, prc, toFilename(m.module.info)) + app(prc, initFrame(m.initProc, procname, filename)) + else: + app(prc, m.initProc.s[cpsLocals]) + app(prc, m.s[cfsTypeInit1]) + app(prc, m.s[cfsTypeInit2]) + app(prc, m.s[cfsTypeInit3]) + app(prc, m.s[cfsDebugInit]) + app(prc, m.s[cfsDynLibInit]) + app(prc, m.initProc.s[cpsInit]) + app(prc, m.initProc.s[cpsStmts]) + if optStackTrace in m.initProc.options: app(prc, deinitFrame(m.initProc)) + app(prc, '}' & tnl & tnl) + app(m.s[cfsProcs], prc) + +proc genModule(m: BModule, cfilenoext: string): PRope = + result = getFileHeader(cfilenoext) + generateHeaders(m) + for i in countup(low(TCFileSection), cfsProcs): app(result, m.s[i]) + +proc rawNewModule(module: PSym, filename: string): BModule = + new(result) + InitLinkedList(result.headerFiles) + intSetInit(result.declaredThings) + intSetInit(result.declaredProtos) + result.cfilename = filename + result.filename = filename + initIdTable(result.typeCache) + initIdTable(result.forwTypeCache) + result.module = module + intSetInit(result.typeInfoMarker) + result.initProc = newProc(nil, result) + result.initProc.options = gOptions + initNodeTable(result.dataCache) + result.typeStack = @[] + result.forwardedProcs = @[] + result.typeNodesName = getTempName() + result.nimTypesName = getTempName() + +proc newModule(module: PSym, filename: string): BModule = + result = rawNewModule(module, filename) + if (optDeadCodeElim in gGlobalOptions): + if (sfDeadCodeElim in module.flags): + InternalError("added pending module twice: " & filename) + addPendingModule(result) + +proc registerTypeInfoModule() = + const moduleName = "nim__dat" + var s = NewSym(skModule, getIdent(moduleName), nil) + gNimDat = rawNewModule(s, joinPath(options.projectPath, moduleName) & ".nim") + addPendingModule(gNimDat) + appff(mainModProcs, "N_NOINLINE(void, $1)(void);$n", + "declare void $1() noinline$n", [getInitName(s)]) + +proc myOpen(module: PSym, filename: string): PPassContext = + if gNimDat == nil: registerTypeInfoModule() + result = newModule(module, filename) + +proc myOpenCached(module: PSym, filename: string, rd: PRodReader): PPassContext = + var cfile, cfilenoext, objFile: string + if gNimDat == nil: + registerTypeInfoModule() + #MessageOut('cgen.myOpenCached has been called ' + filename); + cfile = changeFileExt(completeCFilePath(filename), cExt) + cfilenoext = changeFileExt(cfile, "") + addFileToLink(cfilenoext) + registerModuleToMain(module) + # XXX: this cannot be right here, initalization has to be appended during + # the ``myClose`` call + result = nil + +proc shouldRecompile(code: PRope, cfile, cfilenoext: string): bool = + result = true + if not (optForceFullMake in gGlobalOptions): + var objFile = toObjFile(cfilenoext) + if writeRopeIfNotEqual(code, cfile): return + if ExistsFile(objFile) and os.FileNewer(objFile, cfile): result = false + else: + writeRope(code, cfile) + +proc myProcess(b: PPassContext, n: PNode): PNode = + result = n + if b == nil: return + var m = BModule(b) + m.initProc.options = gOptions + genStmts(m.initProc, n) + +proc finishModule(m: BModule) = + var i = 0 + while i <= high(m.forwardedProcs): + # Note: ``genProc`` may add to ``m.forwardedProcs``, so we cannot use + # a ``for`` loop here + var prc = m.forwardedProcs[i] + if sfForward in prc.flags: InternalError(prc.info, "still forwarded") + genProcNoForward(m, prc) + inc(i) + assert(gForwardedProcsCounter >= i) + dec(gForwardedProcsCounter, i) + setlen(m.forwardedProcs, 0) + +proc writeModule(m: BModule) = + var + cfile, cfilenoext: string + code: PRope + # generate code for the init statements of the module: + genInitCode(m) + finishTypeDescriptions(m) + cfile = completeCFilePath(m.cfilename) + cfilenoext = changeFileExt(cfile, "") + if sfMainModule in m.module.flags: + # generate main file: + app(m.s[cfsProcHeaders], mainModProcs) + code = genModule(m, cfilenoext) + if shouldRecompile(code, changeFileExt(cfile, cExt), cfilenoext): + addFileToCompile(cfilenoext) + addFileToLink(cfilenoext) + +proc myClose(b: PPassContext, n: PNode): PNode = + result = n + if b == nil: return + var m = BModule(b) + if n != nil: + m.initProc.options = gOptions + genStmts(m.initProc, n) + registerModuleToMain(m.module) + if not (optDeadCodeElim in gGlobalOptions) and + not (sfDeadCodeElim in m.module.flags): + finishModule(m) + if sfMainModule in m.module.flags: + var disp = generateMethodDispatchers() + for i in countup(0, sonsLen(disp) - 1): genProcAux(gNimDat, disp.sons[i].sym) + genMainProc(m) + # we need to process the transitive closure because recursive module + # deps are allowed (and the system module is processed in the wrong + # order anyway) + while gForwardedProcsCounter > 0: + for i in countup(0, high(gPendingModules)): + finishModule(gPendingModules[i]) + for i in countup(0, high(gPendingModules)): writeModule(gPendingModules[i]) + setlen(gPendingModules, 0) + if not (optDeadCodeElim in gGlobalOptions) and + not (sfDeadCodeElim in m.module.flags): + writeModule(m) + if sfMainModule in m.module.flags: writeMapping(gMapping) + +proc llvmgenPass(): TPass = + initPass(result) + result.open = myOpen + result.openCached = myOpenCached + result.process = myProcess + result.close = myClose + +InitIiTable(gToTypeInfoId) +IntSetInit(gGeneratedSyms) diff --git a/rod/llvmstat.nim b/rod/llvmstat.nim deleted file mode 100755 index 48e35d827..000000000 --- a/rod/llvmstat.nim +++ /dev/null @@ -1,547 +0,0 @@ -# -# -# The Nimrod Compiler -# (c) Copyright 2008 Andreas Rumpf -# -# See the file "copying.txt", included in this -# distribution, for details about the copyright. -# - -# this module implements the interface to LLVM. - -import # Opaque types. - # - # The top-level container for all other LLVM Intermediate Representation (IR) - # objects. See the llvm::Module class. - # - ropes - -type - cuint* = int32 - TLLVMTypeKind* = enum - LLVMVoidTypeKind, # type with no size - LLVMFloatTypeKind, # 32 bit floating point type - LLVMDoubleTypeKind, # 64 bit floating point type - LLVMX86_FP80TypeKind, # 80 bit floating point type (X87) - LLVMFP128TypeKind, # 128 bit floating point type (112-bit mantissa) - LLVMPPC_FP128TypeKind, # 128 bit floating point type (two 64-bits) - LLVMLabelTypeKind, # Labels - LLVMIntegerTypeKind, # Arbitrary bit width integers - LLVMFunctionTypeKind, # Functions - LLVMStructTypeKind, # Structures - LLVMArrayTypeKind, # Arrays - LLVMPointerTypeKind, # Pointers - LLVMOpaqueTypeKind, # Opaque: type with unknown structure - LLVMVectorTypeKind # SIMD 'packed' format, or other vector type - TLLVMLinkage* = enum - LLVMExternalLinkage, # Externally visible function - LLVMLinkOnceLinkage, # Keep one copy of function when linking (inline) - LLVMWeakLinkage, # Keep one copy of function when linking (weak) - LLVMAppendingLinkage, # Special purpose, only applies to global arrays - LLVMInternalLinkage, # Rename collisions when linking (static functions) - LLVMDLLImportLinkage, # Function to be imported from DLL - LLVMDLLExportLinkage, # Function to be accessible from DLL - LLVMExternalWeakLinkage, # ExternalWeak linkage description - LLVMGhostLinkage # Stand-in functions for streaming fns from bitcode - TLLVMVisibility* = enum - LLVMDefaultVisibility, # The GV is visible - LLVMHiddenVisibility, # The GV is hidden - LLVMProtectedVisibility # The GV is protected - TLLVMCallConv* = enum - LLVMCCallConv = 0, LLVMFastCallConv = 8, LLVMColdCallConv = 9, - LLVMX86StdcallCallConv = 64, LLVMX86FastcallCallConv = 65 - TLLVMIntPredicate* = enum - LLVMIntEQ = 32, # equal - LLVMIntNE, # not equal - LLVMIntUGT, # unsigned greater than - LLVMIntUGE, # unsigned greater or equal - LLVMIntULT, # unsigned less than - LLVMIntULE, # unsigned less or equal - LLVMIntSGT, # signed greater than - LLVMIntSGE, # signed greater or equal - LLVMIntSLT, # signed less than - LLVMIntSLE # signed less or equal - TLLVMRealPredicate* = enum - LLVMRealPredicateFalse, # Always false (always folded) - LLVMRealOEQ, # True if ordered and equal - LLVMRealOGT, # True if ordered and greater than - LLVMRealOGE, # True if ordered and greater than or equal - LLVMRealOLT, # True if ordered and less than - LLVMRealOLE, # True if ordered and less than or equal - LLVMRealONE, # True if ordered and operands are unequal - LLVMRealORD, # True if ordered (no nans) - LLVMRealUNO, # True if unordered: isnan(X) | isnan(Y) - LLVMRealUEQ, # True if unordered or equal - LLVMRealUGT, # True if unordered or greater than - LLVMRealUGE, # True if unordered, greater than, or equal - LLVMRealULT, # True if unordered or less than - LLVMRealULE, # True if unordered, less than, or equal - LLVMRealUNE, # True if unordered or not equal - LLVMRealPredicateTrue # Always true (always folded) - PLLVMBasicBlockRef* = ref TLLVMBasicBlockRef - PLLVMMemoryBufferRef* = ref TLLVMMemoryBufferRef - PLLVMTypeRef* = ref TLLVMTypeRef - PLLVMValueRef* = ref TLLVMValueRef - TLLVMOpaqueModule*{.final.} = object - code*: PRope - - TLLVMModuleRef* = ref TLLVMOpaqueModule # - # Each value in the LLVM IR has a type, an instance of [lltype]. See the - # llvm::Type class. - # - TLLVMOpaqueType*{.final.} = object - kind*: TLLVMTypeKind - - TLLVMTypeRef* = ref TLLVMOpaqueType # - # When building recursive types using [refine_type], [lltype] values may become - # invalid; use [lltypehandle] to resolve this problem. See the - # llvm::AbstractTypeHolder] class. - # - TLLVMOpaqueTypeHandle*{.final.} = object - TLLVMTypeHandleRef* = ref TLLVMOpaqueTypeHandle - TLLVMOpaqueValue*{.final.} = object - TLLVMValueRef* = ref TLLVMOpaqueValue - TLLVMOpaqueBasicBlock*{.final.} = object - TLLVMBasicBlockRef* = ref TLLVMOpaqueBasicBlock - TLLVMOpaqueBuilder*{.final.} = object - TLLVMBuilderRef* = ref TLLVMOpaqueBuilder # Used to provide a module to JIT or interpreter. - # See the llvm::ModuleProvider class. - # - TLLVMOpaqueModuleProvider*{.final.} = object - TLLVMModuleProviderRef* = ref TLLVMOpaqueModuleProvider # Used to provide a module to JIT or interpreter. - # See the llvm: : MemoryBuffer class. - # - TLLVMOpaqueMemoryBuffer*{.final.} = object - TLLVMMemoryBufferRef* = ref TLLVMOpaqueMemoryBuffer #===-- Error handling ----------------------------------------------------=== - -proc LLVMDisposeMessage*(msg: cstring){.cdecl.} - #===-- Modules -----------------------------------------------------------=== - # Create and destroy modules. -proc LLVMModuleCreateWithName*(ModuleID: cstring): TLLVMModuleRef{.cdecl.} -proc LLVMDisposeModule*(M: TLLVMModuleRef){.cdecl.} - # Data layout -proc LLVMGetDataLayout*(M: TLLVMModuleRef): cstring{.cdecl.} -proc LLVMSetDataLayout*(M: TLLVMModuleRef, Triple: cstring){.cdecl.} - # Target triple -proc LLVMGetTarget*(M: TLLVMModuleRef): cstring{.cdecl.} -proc LLVMSetTarget*(M: TLLVMModuleRef, Triple: cstring){.cdecl.} - # Same as Module: : addTypeName. -proc LLVMAddTypeName*(M: TLLVMModuleRef, Name: cstring, Ty: TLLVMTypeRef): int32{. - cdecl.} -proc LLVMDeleteTypeName*(M: TLLVMModuleRef, Name: cstring){.cdecl.} - #===-- Types -------------------------------------------------------------=== - # LLVM types conform to the following hierarchy: - # * - # * types: - # * integer type - # * real type - # * function type - # * sequence types: - # * array type - # * pointer type - # * vector type - # * void type - # * label type - # * opaque type - # -proc LLVMGetTypeKind*(Ty: TLLVMTypeRef): TLLVMTypeKind{.cdecl.} -proc LLVMRefineAbstractType*(AbstractType: TLLVMTypeRef, - ConcreteType: TLLVMTypeRef){.cdecl.} - # Operations on integer types -proc LLVMInt1Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMInt8Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMInt16Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMInt32Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMInt64Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMIntType*(NumBits: cuint): TLLVMTypeRef{.cdecl.} -proc LLVMGetIntTypeWidth*(IntegerTy: TLLVMTypeRef): cuint{.cdecl.} - # Operations on real types -proc LLVMFloatType*(): TLLVMTypeRef{.cdecl.} -proc LLVMDoubleType*(): TLLVMTypeRef{.cdecl.} -proc LLVMX86FP80Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMFP128Type*(): TLLVMTypeRef{.cdecl.} -proc LLVMPPCFP128Type*(): TLLVMTypeRef{.cdecl.} - # Operations on function types -proc LLVMFunctionType*(ReturnType: TLLVMTypeRef, ParamTypes: PLLVMTypeRef, - ParamCount: cuint, IsVarArg: int32): TLLVMTypeRef{.cdecl.} -proc LLVMIsFunctionVarArg*(FunctionTy: TLLVMTypeRef): int32{.cdecl.} -proc LLVMGetReturnType*(FunctionTy: TLLVMTypeRef): TLLVMTypeRef{.cdecl.} -proc LLVMCountParamTypes*(FunctionTy: TLLVMTypeRef): cuint{.cdecl.} -proc LLVMGetParamTypes*(FunctionTy: TLLVMTypeRef, Dest: PLLVMTypeRef){.cdecl.} - # Operations on struct types -proc LLVMStructType*(ElementTypes: PLLVMTypeRef, ElementCount: cuint, - isPacked: int32): TLLVMTypeRef{.cdecl.} -proc LLVMCountStructElementTypes*(StructTy: TLLVMTypeRef): cuint{.cdecl.} -proc LLVMGetStructElementTypes*(StructTy: TLLVMTypeRef, Dest: pLLVMTypeRef){. - cdecl.} -proc LLVMIsPackedStruct*(StructTy: TLLVMTypeRef): int32{.cdecl.} - # Operations on array, pointer, and vector types (sequence types) -proc LLVMArrayType*(ElementType: TLLVMTypeRef, ElementCount: cuint): TLLVMTypeRef{. - cdecl.} -proc LLVMPointerType*(ElementType: TLLVMTypeRef, AddressSpace: cuint): TLLVMTypeRef{. - cdecl.} -proc LLVMVectorType*(ElementType: TLLVMTypeRef, ElementCount: cuint): TLLVMTypeRef{. - cdecl.} -proc LLVMGetElementType*(Ty: TLLVMTypeRef): TLLVMTypeRef{.cdecl.} -proc LLVMGetArrayLength*(ArrayTy: TLLVMTypeRef): cuint{.cdecl.} -proc LLVMGetPointerAddressSpace*(PointerTy: TLLVMTypeRef): cuint{.cdecl.} -proc LLVMGetVectorSize*(VectorTy: TLLVMTypeRef): cuint{.cdecl.} - # Operations on other types -proc LLVMVoidType*(): TLLVMTypeRef{.cdecl.} -proc LLVMLabelType*(): TLLVMTypeRef{.cdecl.} -proc LLVMOpaqueType*(): TLLVMTypeRef{.cdecl.} - # Operations on type handles -proc LLVMCreateTypeHandle*(PotentiallyAbstractTy: TLLVMTypeRef): TLLVMTypeHandleRef{. - cdecl.} -proc LLVMRefineType*(AbstractTy: TLLVMTypeRef, ConcreteTy: TLLVMTypeRef){.cdecl.} -proc LLVMResolveTypeHandle*(TypeHandle: TLLVMTypeHandleRef): TLLVMTypeRef{.cdecl.} -proc LLVMDisposeTypeHandle*(TypeHandle: TLLVMTypeHandleRef){.cdecl.} - #===-- Values ------------------------------------------------------------=== - # The bulk of LLVM's object model consists of values, which comprise a very - # * rich type hierarchy. - # * - # * values: - # * constants: - # * scalar constants - # * composite contants - # * globals: - # * global variable - # * function - # * alias - # * basic blocks - # - # Operations on all values -proc LLVMTypeOf*(Val: TLLVMValueRef): TLLVMTypeRef{.cdecl.} -proc LLVMGetValueName*(Val: TLLVMValueRef): cstring{.cdecl.} -proc LLVMSetValueName*(Val: TLLVMValueRef, Name: cstring){.cdecl.} -proc LLVMDumpValue*(Val: TLLVMValueRef){.cdecl.} - # Operations on constants of any type -proc LLVMConstNull*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl.} - # all zeroes -proc LLVMConstAllOnes*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl.} - # only for int/vector -proc LLVMGetUndef*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl.} -proc LLVMIsConstant*(Val: TLLVMValueRef): int32{.cdecl.} -proc LLVMIsNull*(Val: TLLVMValueRef): int32{.cdecl.} -proc LLVMIsUndef*(Val: TLLVMValueRef): int32{.cdecl.} - # Operations on scalar constants -proc LLVMConstInt*(IntTy: TLLVMTypeRef, N: qword, SignExtend: int32): TLLVMValueRef{. - cdecl.} -proc LLVMConstReal*(RealTy: TLLVMTypeRef, N: float64): TLLVMValueRef{.cdecl.} - # Operations on composite constants -proc LLVMConstString*(Str: cstring, len: cuint, DontNullTerminate: int32): TLLVMValueRef{. - cdecl.} -proc LLVMConstArray*(ArrayTy: TLLVMTypeRef, ConstantVals: pLLVMValueRef, - len: cuint): TLLVMValueRef{.cdecl.} -proc LLVMConstStruct*(ConstantVals: pLLVMValueRef, Count: cuint, ispacked: int32): TLLVMValueRef{. - cdecl.} -proc LLVMConstVector*(ScalarConstantVals: pLLVMValueRef, Size: cuint): TLLVMValueRef{. - cdecl.} - # Constant expressions -proc LLVMSizeOf*(Ty: TLLVMTypeRef): TLLVMValueRef{.cdecl.} -proc LLVMConstNeg*(ConstantVal: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstNot*(ConstantVal: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstAdd*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSub*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstMul*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstUDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFDiv*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstURem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSRem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFRem*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstAnd*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstOr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstXor*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstICmp*(Predicate: TLLVMIntPredicate, LHSConstant: TLLVMValueRef, - RHSConstant: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstFCmp*(Predicate: TLLVMRealPredicate, LHSConstant: TLLVMValueRef, - RHSConstant: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstShl*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstLShr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstAShr*(LHSConstant: TLLVMValueRef, RHSConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstGEP*(ConstantVal: TLLVMValueRef, ConstantIndices: PLLVMValueRef, - NumIndices: cuint): TLLVMValueRef{.cdecl.} -proc LLVMConstTrunc*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstZExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFPTrunc*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFPExt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstUIToFP*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSIToFP*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFPToUI*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstFPToSI*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstPtrToInt*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstIntToPtr*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstBitCast*(ConstantVal: TLLVMValueRef, ToType: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstSelect*(ConstantCondition: TLLVMValueRef, - ConstantIfTrue: TLLVMValueRef, - ConstantIfFalse: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstExtractElement*(VectorConstant: TLLVMValueRef, - IndexConstant: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMConstInsertElement*(VectorConstant: TLLVMValueRef, - ElementValueConstant: TLLVMValueRef, - IndexConstant: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMConstShuffleVector*(VectorAConstant: TLLVMValueRef, - VectorBConstant: TLLVMValueRef, - MaskConstant: TLLVMValueRef): TLLVMValueRef{.cdecl.} - # Operations on global variables, functions, and aliases (globals) -proc LLVMIsDeclaration*(Global: TLLVMValueRef): int32{.cdecl.} -proc LLVMGetLinkage*(Global: TLLVMValueRef): TLLVMLinkage{.cdecl.} -proc LLVMSetLinkage*(Global: TLLVMValueRef, Linkage: TLLVMLinkage){.cdecl.} -proc LLVMGetSection*(Global: TLLVMValueRef): cstring{.cdecl.} -proc LLVMSetSection*(Global: TLLVMValueRef, Section: cstring){.cdecl.} -proc LLVMGetVisibility*(Global: TLLVMValueRef): TLLVMVisibility{.cdecl.} -proc LLVMSetVisibility*(Global: TLLVMValueRef, Viz: TLLVMVisibility){.cdecl.} -proc LLVMGetAlignment*(Global: TLLVMValueRef): cuint{.cdecl.} -proc LLVMSetAlignment*(Global: TLLVMValueRef, Bytes: cuint){.cdecl.} - # Operations on global variables - # Const before type ignored -proc LLVMAddGlobal*(M: TLLVMModuleRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} - # Const before type ignored -proc LLVMGetNamedGlobal*(M: TLLVMModuleRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMDeleteGlobal*(GlobalVar: TLLVMValueRef){.cdecl.} -proc LLVMHasInitializer*(GlobalVar: TLLVMValueRef): int32{.cdecl.} -proc LLVMGetInitializer*(GlobalVar: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMSetInitializer*(GlobalVar: TLLVMValueRef, ConstantVal: TLLVMValueRef){. - cdecl.} -proc LLVMIsThreadLocal*(GlobalVar: TLLVMValueRef): int32{.cdecl.} -proc LLVMSetThreadLocal*(GlobalVar: TLLVMValueRef, IsThreadLocal: int32){.cdecl.} -proc LLVMIsGlobalConstant*(GlobalVar: TLLVMValueRef): int32{.cdecl.} -proc LLVMSetGlobalConstant*(GlobalVar: TLLVMValueRef, IsConstant: int32){.cdecl.} - # Operations on functions - # Const before type ignored -proc LLVMAddFunction*(M: TLLVMModuleRef, Name: cstring, FunctionTy: TLLVMTypeRef): TLLVMValueRef{. - cdecl.} - # Const before type ignored -proc LLVMGetNamedFunction*(M: TLLVMModuleRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMDeleteFunction*(Fn: TLLVMValueRef){.cdecl.} -proc LLVMCountParams*(Fn: TLLVMValueRef): cuint{.cdecl.} -proc LLVMGetParams*(Fn: TLLVMValueRef, Params: PLLVMValueRef){.cdecl.} -proc LLVMGetParam*(Fn: TLLVMValueRef, Index: cuint): TLLVMValueRef{.cdecl.} -proc LLVMGetIntrinsicID*(Fn: TLLVMValueRef): cuint{.cdecl.} -proc LLVMGetFunctionCallConv*(Fn: TLLVMValueRef): cuint{.cdecl.} -proc LLVMSetFunctionCallConv*(Fn: TLLVMValueRef, CC: cuint){.cdecl.} - # Const before type ignored -proc LLVMGetCollector*(Fn: TLLVMValueRef): cstring{.cdecl.} - # Const before type ignored -proc LLVMSetCollector*(Fn: TLLVMValueRef, Coll: cstring){.cdecl.} - # Operations on basic blocks -proc LLVMBasicBlockAsValue*(Bb: TLLVMBasicBlockRef): TLLVMValueRef{.cdecl.} -proc LLVMValueIsBasicBlock*(Val: TLLVMValueRef): int32{.cdecl.} -proc LLVMValueAsBasicBlock*(Val: TLLVMValueRef): TLLVMBasicBlockRef{.cdecl.} -proc LLVMCountBasicBlocks*(Fn: TLLVMValueRef): cuint{.cdecl.} -proc LLVMGetBasicBlocks*(Fn: TLLVMValueRef, BasicBlocks: PLLVMBasicBlockRef){. - cdecl.} -proc LLVMGetEntryBasicBlock*(Fn: TLLVMValueRef): TLLVMBasicBlockRef{.cdecl.} - # Const before type ignored -proc LLVMAppendBasicBlock*(Fn: TLLVMValueRef, Name: cstring): TLLVMBasicBlockRef{. - cdecl.} - # Const before type ignored -proc LLVMInsertBasicBlock*(InsertBeforeBB: TLLVMBasicBlockRef, Name: cstring): TLLVMBasicBlockRef{. - cdecl.} -proc LLVMDeleteBasicBlock*(BB: TLLVMBasicBlockRef){.cdecl.} - # Operations on call sites -proc LLVMSetInstructionCallConv*(Instr: TLLVMValueRef, CC: cuint){.cdecl.} -proc LLVMGetInstructionCallConv*(Instr: TLLVMValueRef): cuint{.cdecl.} - # Operations on phi nodes -proc LLVMAddIncoming*(PhiNode: TLLVMValueRef, IncomingValues: PLLVMValueRef, - IncomingBlocks: PLLVMBasicBlockRef, Count: cuint){.cdecl.} -proc LLVMCountIncoming*(PhiNode: TLLVMValueRef): cuint{.cdecl.} -proc LLVMGetIncomingValue*(PhiNode: TLLVMValueRef, Index: cuint): TLLVMValueRef{. - cdecl.} -proc LLVMGetIncomingBlock*(PhiNode: TLLVMValueRef, Index: cuint): TLLVMBasicBlockRef{. - cdecl.} - #===-- Instruction builders ----------------------------------------------=== - # An instruction builder represents a point within a basic block, and is the - # * exclusive means of building instructions using the C interface. - # -proc LLVMCreateBuilder*(): TLLVMBuilderRef{.cdecl.} -proc LLVMPositionBuilderBefore*(Builder: TLLVMBuilderRef, Instr: TLLVMValueRef){. - cdecl.} -proc LLVMPositionBuilderAtEnd*(Builder: TLLVMBuilderRef, - theBlock: TLLVMBasicBlockRef){.cdecl.} -proc LLVMDisposeBuilder*(Builder: TLLVMBuilderRef){.cdecl.} - # Terminators -proc LLVMBuildRetVoid*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl.} -proc LLVMBuildRet*(para1: TLLVMBuilderRef, V: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMBuildBr*(para1: TLLVMBuilderRef, Dest: TLLVMBasicBlockRef): TLLVMValueRef{. - cdecl.} -proc LLVMBuildCondBr*(para1: TLLVMBuilderRef, IfCond: TLLVMValueRef, - ThenBranch: TLLVMBasicBlockRef, - ElseBranch: TLLVMBasicBlockRef): TLLVMValueRef{.cdecl.} -proc LLVMBuildSwitch*(para1: TLLVMBuilderRef, V: TLLVMValueRef, - ElseBranch: TLLVMBasicBlockRef, NumCases: cuint): TLLVMValueRef{. - cdecl.} - # Const before type ignored -proc LLVMBuildInvoke*(para1: TLLVMBuilderRef, Fn: TLLVMValueRef, - Args: PLLVMValueRef, NumArgs: cuint, - ThenBranch: TLLVMBasicBlockRef, Catch: TLLVMBasicBlockRef, - Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildUnwind*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl.} -proc LLVMBuildUnreachable*(para1: TLLVMBuilderRef): TLLVMValueRef{.cdecl.} - # Add a case to the switch instruction -proc LLVMAddCase*(Switch: TLLVMValueRef, OnVal: TLLVMValueRef, - Dest: TLLVMBasicBlockRef){.cdecl.} - # Arithmetic -proc LLVMBuildAdd*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildSub*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildMul*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildUDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildSDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildFDiv*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildURem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildSRem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildFRem*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildShl*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildLShr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildAShr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildAnd*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildOr*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildXor*(para1: TLLVMBuilderRef, LHS: TLLVMValueRef, - RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildNeg*(para1: TLLVMBuilderRef, V: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildNot*(para1: TLLVMBuilderRef, V: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} - # Memory -proc LLVMBuildMalloc*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildArrayMalloc*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, - Val: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildAlloca*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildArrayAlloca*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, - Val: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildFree*(para1: TLLVMBuilderRef, PointerVal: TLLVMValueRef): TLLVMValueRef{. - cdecl.} -proc LLVMBuildLoad*(para1: TLLVMBuilderRef, PointerVal: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildStore*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - thePtr: TLLVMValueRef): TLLVMValueRef{.cdecl.} -proc LLVMBuildGEP*(B: TLLVMBuilderRef, Pointer: TLLVMValueRef, - Indices: PLLVMValueRef, NumIndices: cuint, Name: cstring): TLLVMValueRef{. - cdecl.} - # Casts -proc LLVMBuildTrunc*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildZExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildSExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildFPToUI*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildFPToSI*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildUIToFP*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildSIToFP*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildFPTrunc*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildFPExt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildPtrToInt*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildIntToPtr*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildBitCast*(para1: TLLVMBuilderRef, Val: TLLVMValueRef, - DestTy: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} - # Comparisons -proc LLVMBuildICmp*(para1: TLLVMBuilderRef, Op: TLLVMIntPredicate, - LHS: TLLVMValueRef, RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildFCmp*(para1: TLLVMBuilderRef, Op: TLLVMRealPredicate, - LHS: TLLVMValueRef, RHS: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} - # Miscellaneous instructions -proc LLVMBuildPhi*(para1: TLLVMBuilderRef, Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildCall*(para1: TLLVMBuilderRef, Fn: TLLVMValueRef, - Args: PLLVMValueRef, NumArgs: cuint, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildSelect*(para1: TLLVMBuilderRef, IfCond: TLLVMValueRef, - ThenBranch: TLLVMValueRef, ElseBranch: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildVAArg*(para1: TLLVMBuilderRef, List: TLLVMValueRef, - Ty: TLLVMTypeRef, Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildExtractElement*(para1: TLLVMBuilderRef, VecVal: TLLVMValueRef, - Index: TLLVMValueRef, Name: cstring): TLLVMValueRef{. - cdecl.} -proc LLVMBuildInsertElement*(para1: TLLVMBuilderRef, VecVal: TLLVMValueRef, - EltVal: TLLVMValueRef, Index: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl.} -proc LLVMBuildShuffleVector*(para1: TLLVMBuilderRef, V1: TLLVMValueRef, - V2: TLLVMValueRef, Mask: TLLVMValueRef, - Name: cstring): TLLVMValueRef{.cdecl.} - #===-- Module providers --------------------------------------------------=== - # Encapsulates the module M in a module provider, taking ownership of the - # module. - # See the constructor llvm: : ExistingModuleProvider: : ExistingModuleProvider. - # -proc LLVMCreateModuleProviderForExistingModule*(M: TLLVMModuleRef): TLLVMModuleProviderRef{. - cdecl.} - # Destroys the module provider MP as well as the contained module. - # See the destructor llvm: : ModuleProvider: : ~ModuleProvider. - # -proc LLVMDisposeModuleProvider*(MP: TLLVMModuleProviderRef){.cdecl.} - #===-- Memory buffers ----------------------------------------------------=== -proc LLVMCreateMemoryBufferWithContentsOfFile*(Path: cstring, - OutMemBuf: pLLVMMemoryBufferRef, OutMessage: var cstring): int32{.cdecl.} -proc LLVMCreateMemoryBufferWithSTDIN*(OutMemBuf: pLLVMMemoryBufferRef, - OutMessage: var cstring): int32{.cdecl.} -proc LLVMDisposeMemoryBuffer*(MemBuf: TLLVMMemoryBufferRef){.cdecl.} -proc LLVMWriteBitcodeToFile*(M: TLLVMModuleRef, path: cstring): int{.cdecl.} - # Writes a module to the specified path. Returns 0 on success. -# implementation diff --git a/rod/llvmtype.nim b/rod/llvmtype.nim new file mode 100644 index 000000000..7790855ac --- /dev/null +++ b/rod/llvmtype.nim @@ -0,0 +1,125 @@ +# +# +# The Nimrod Compiler +# (c) Copyright 2009 Andreas Rumpf +# +# See the file "copying.txt", included in this +# distribution, for details about the copyright. +# + +## Converts Nimrod types to LLVM types. + +import llvm + +proc intFromSize(size: int): TypeRef = + case size + of 8: result = llvm.Int64Type() + of 4: result = llvm.Int32Type() + of 2: result = llvm.Int16Type() + of 1: result = llvm.Int8Type() + else: InternalError("unknown type size") + +type + TPending = TTypeHandleMap + +proc convertProcType(m: BModule, t: PType, pending: var TPending): TypeRef = + + +proc simpleType(m: BModule, t: PType): TypeRef = + case t.kind + of tyBool, tyChar, tyInt8: result = llvm.Int8Type() + of tyEnum: + if firstOrd(t) < 0: + result = llvm.Int32Type() + else: + case int(getSize(t)) + of 1: result = llvm.Int8Type() + of 2: result = llvm.Int16Type() + of 4: result = llvm.Int32Type() + of 8: result = llvm.Int64Type() + else: internalError(t.sym.info, "convertTypeAux") + of tyInt: result = intFromSize(getSize(t)) + of tyInt16: result = llvm.Int16Type() + of tyInt32: result = llvm.Int32Type() + of tyInt64: result = llvm.Int64Type() + of tyFloat, tyFloat64: result = llvm.DoubleType() + of tyFloat32: result = llvm.FloatType() + of tyCString, tyPointer, tyNil: result = llvm.PointerType(llvm.Int8Type()) + else: result = nil + +proc convertTypeAux(m: BModule, t: PType, pending: var TPending): TypeRef = + case t.kind + of tyDistinct, tyRange: + result = convertTypeAux(m, t.sons[0], pending) + of tyArray: + result = m.typeCache[t] + if result == nil: + var handle = pending[t] + if handle == nil: + handle = llvm.CreateTypeHandle(llvm.OpaqueType()) + pending[t] = handle + result = llvm.ArrayType(ResolveTypeHandle(handle), int32(lengthOrd(t))) + var elemConcrete = convertTypeAux(m, elemType(t), pending) + # this may destroy the types! + refineType(ResolveTypeHandle(handle), elemConcrete) + + # elemConcrete is potentially invalidated, but handle + # (a PATypeHolder) is kept up-to-date + elemConcrete = ResolveTypeHandle(handle) + + + else: + # we are pending! + result = ResolveTypeHandle(handle) + # now we have the correct type: + m.typeCache[t] = result + of tyOpenArray: + + of tySeq: + + of tyObject: + of tyTuple: + + of tyProc: + else: result = simpleType(m, t) + +proc CreateTypeHandle*(PotentiallyAbstractTy: TypeRef): TypeHandleRef{.cdecl, + dynlib: libname, importc: "LLVMCreateTypeHandle".} +proc RefineType*(AbstractTy: TypeRef, ConcreteTy: TypeRef){.cdecl, + dynlib: libname, importc: "LLVMRefineType".} +proc ResolveTypeHandle*(TypeHandle: TypeHandleRef): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMResolveTypeHandle".} +proc DisposeTypeHandle*(TypeHandle: TypeHandleRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeTypeHandle".} + + +proc `!`*(m: BModule, t: PType): TypeRef = + ## converts a Nimrod type to an LLVM type. Since this is so common, we use + ## an infix operator for this. + result = simpleType(m, t) + if result == nil: + var cl: TTypeMap + init(cl) + result = convertTypeAux(m, t, cl) + +proc FunctionType*(ReturnType: TypeRef, ParamTypes: ptr TypeRef, + ParamCount: int32, IsVarArg: int32): TypeRef {. + cdecl, dynlib: libname, importc: "LLVMFunctionType".} + + +proc VoidType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMVoidType".} +proc LabelType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMLabelType".} +proc OpaqueType*(): TypeRef{.cdecl, dynlib: libname, importc: "LLVMOpaqueType".} + # Operations on type handles +proc CreateTypeHandle*(PotentiallyAbstractTy: TypeRef): TypeHandleRef{.cdecl, + dynlib: libname, importc: "LLVMCreateTypeHandle".} +proc RefineType*(AbstractTy: TypeRef, ConcreteTy: TypeRef){.cdecl, + dynlib: libname, importc: "LLVMRefineType".} +proc ResolveTypeHandle*(TypeHandle: TypeHandleRef): TypeRef{.cdecl, + dynlib: libname, importc: "LLVMResolveTypeHandle".} +proc DisposeTypeHandle*(TypeHandle: TypeHandleRef){.cdecl, dynlib: libname, + importc: "LLVMDisposeTypeHandle".} + + +# m!typ, m!a[i] + diff --git a/rod/main.nim b/rod/main.nim index 056c1dc40..d386a10aa 100755 --- a/rod/main.nim +++ b/rod/main.nim @@ -13,9 +13,16 @@ import llstream, strutils, ast, astalgo, scanner, syntaxes, rnimsyn, options, msgs, os, lists, condsyms, paslex, pasparse, rodread, rodwrite, ropes, trees, - wordrecg, sem, semdata, idents, passes, docgen, extccomp, cgen, ecmasgen, + wordrecg, sem, semdata, idents, passes, docgen, extccomp, + cgen, ecmasgen, platform, interact, nimconf, importer, passaux, depends, transf, evals, types +const + has_LLVM_Backend = false + +when has_LLVM_Backend: + import llvmgen + proc MainCommand*(cmd, filename: string) # implementation # ------------------ module handling ----------------------------------------- @@ -114,6 +121,14 @@ proc CommandCompileToC(filename: string) = compileProject(filename) extccomp.CallCCompiler(changeFileExt(filename, "")) +when has_LLVM_Backend: + proc CommandCompileToLLVM(filename: string) = + semanticPasses() + registerPass(llvmgen.llvmgenPass()) + registerPass(rodwrite.rodwritePass()) + #registerPass(cleanupPass()) + compileProject(filename) + proc CommandCompileToEcmaScript(filename: string) = incl(gGlobalOptions, optSafeCode) setTarget(osEcmaScript, cpuEcmaScript) @@ -139,10 +154,8 @@ proc CommandInteractive() = proc exSymbols(n: PNode) = case n.kind - of nkEmpty..nkNilLit: - nil - of nkProcDef..nkIteratorDef: - exSymbol(n.sons[namePos]) + of nkEmpty..nkNilLit: nil + of nkProcDef..nkIteratorDef: exSymbol(n.sons[namePos]) of nkWhenStmt, nkStmtList: for i in countup(0, sonsLen(n) - 1): exSymbols(n.sons[i]) of nkVarSection, nkConstSection: @@ -153,8 +166,7 @@ proc exSymbols(n: PNode) = if (n.sons[i].sons[2] != nil) and (n.sons[i].sons[2].kind == nkObjectTy): fixRecordDef(n.sons[i].sons[2]) - else: - nil + else: nil proc CommandExportSymbols(filename: string) = # now unused! @@ -171,49 +183,40 @@ proc CommandPretty(filename: string) = renderModule(module, getOutFile(filename, "pretty." & NimExt)) proc CommandLexPas(filename: string) = - var - L: TPasLex - tok: TPasTok - f: string - stream: PLLStream - f = addFileExt(filename, "pas") - stream = LLStreamOpen(f, fmRead) + var f = addFileExt(filename, "pas") + var stream = LLStreamOpen(f, fmRead) if stream != nil: + var + L: TPasLex + tok: TPasTok OpenLexer(L, f, stream) getPasTok(L, tok) while tok.xkind != pxEof: printPasTok(tok) getPasTok(L, tok) - else: - rawMessage(errCannotOpenFile, f) - closeLexer(L) + closeLexer(L) + else: rawMessage(errCannotOpenFile, f) proc CommandPas(filename: string) = - var - p: TPasParser - module: PNode - f: string - stream: PLLStream - f = addFileExt(filename, "pas") - stream = LLStreamOpen(f, fmRead) + var f = addFileExt(filename, "pas") + var stream = LLStreamOpen(f, fmRead) if stream != nil: + var p: TPasParser OpenPasParser(p, f, stream) - module = parseUnit(p) + var module = parseUnit(p) closePasParser(p) renderModule(module, getOutFile(filename, NimExt)) else: rawMessage(errCannotOpenFile, f) proc CommandScan(filename: string) = - var - L: TLexer - tok: PToken - f: string - stream: PLLStream - new(tok) - f = addFileExt(filename, nimExt) - stream = LLStreamOpen(f, fmRead) + var f = addFileExt(filename, nimExt) + var stream = LLStreamOpen(f, fmRead) if stream != nil: + var + L: TLexer + tok: PToken + new(tok) openLexer(L, f, stream) while true: rawGetTok(L, tok^) @@ -252,7 +255,8 @@ proc MainCommand(cmd, filename: string) = of wCompileToLLVM: gCmd = cmdCompileToLLVM wantFile(filename) - CommandCompileToC(filename) + when has_LLVM_Backend: + CommandCompileToLLVM(filename) of wPretty: gCmd = cmdPretty wantFile(filename) #CommandExportSymbols(filename); diff --git a/rod/nimrod.cfg b/rod/nimrod.cfg index 51b675525..5168a3bb9 100755 --- a/rod/nimrod.cfg +++ b/rod/nimrod.cfg @@ -1,6 +1,7 @@ # Special configuration file for the Nimrod project --hint[XDeclaredButNotUsed]=off +path="llvm" @if llvm_gcc or gcc: # GCC, LLVM and Visual C++ have a problem to optimize some modules. diff --git a/rod/nversion.nim b/rod/nversion.nim index 8fbe87b07..2aa7babf7 100755 --- a/rod/nversion.nim +++ b/rod/nversion.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2008 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -15,6 +15,6 @@ const defaultAsmMarkerSymbol* = '!' VersionMajor* = 0 VersionMinor* = 8 - VersionPatch* = 6 + VersionPatch* = 7 VersionAsString* = $VersionMajor & "." & $VersionMinor & "." & $VersionPatch diff --git a/rod/options.nim b/rod/options.nim index 15bca38b6..c6db17509 100755 --- a/rod/options.nim +++ b/rod/options.nim @@ -92,7 +92,7 @@ var libpath*: string = "" projectPath*: string = "" gKeepComments*: bool = true # whether the parser needs to keep comments - gImplicitMods*: TStringSeq = @ [] # modules that are to be implicitly imported + gImplicitMods*: TStringSeq = @[] # modules that are to be implicitly imported proc existsConfigVar*(key: string): bool proc getConfigVar*(key: string): string @@ -128,19 +128,19 @@ proc shortenDir(dir: string): string = # returns the interesting part of a dir var prefix = getPrefixDir() & dirSep if startsWith(dir, prefix): - return copy(dir, len(prefix) + 0) + return copy(dir, len(prefix)) prefix = getCurrentDir() & dirSep if startsWith(dir, prefix): - return copy(dir, len(prefix) + 0) + return copy(dir, len(prefix)) prefix = projectPath & dirSep #writeln(output, prefix); #writeln(output, dir); if startsWith(dir, prefix): - return copy(dir, len(prefix) + 0) + return copy(dir, len(prefix)) result = dir proc removeTrailingDirSep(path: string): string = - if (len(path) > 0) and (path[len(path) + 0 - 1] == dirSep): - result = copy(path, 0, len(path) + 0 - 2) + if (len(path) > 0) and (path[len(path) - 1] == dirSep): + result = copy(path, 0, len(path) - 2) else: result = path @@ -162,11 +162,10 @@ proc completeGeneratedFilePath(f: string, createSubDir: bool = true): string = result = joinPath(subdir, tail) proc rawFindFile(f: string): string = - var it: PStrEntry if ExistsFile(f): result = f else: - it = PStrEntry(SearchPaths.head) + var it = PStrEntry(SearchPaths.head) while it != nil: result = JoinPath(it.data, f) if ExistsFile(result): return diff --git a/rod/pnimsyn.nim b/rod/pnimsyn.nim index 21980ccc4..d8846dff1 100755 --- a/rod/pnimsyn.nim +++ b/rod/pnimsyn.nim @@ -177,19 +177,24 @@ proc parseSymbol(p: var TParser): PNode = of tkBracketLe: var s = "[" getTok(p) - if (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): - s = s & "$.." - getTok(p) - eat(p, tkDotDot) - if (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): - add(s, '$') + while true: + if p.tok.tokType == tkComma: + add(s, ",") getTok(p) - elif p.tok.tokType == tkDotDot: - s = s & ".." - getTok(p) - if (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): - add(s, '$') + elif (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): + add(s, "$..") + getTok(p) + eat(p, tkDotDot) + if (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): + add(s, '$') + getTok(p) + elif p.tok.tokType == tkDotDot: + add(s, "..") getTok(p) + if (p.tok.tokType == tkOpr) and (p.tok.ident.s == "$"): + add(s, '$') + getTok(p) + else: break eat(p, tkBracketRi) add(s, ']') if p.tok.tokType == tkEquals: diff --git a/rod/ropes.nim b/rod/ropes.nim index 2069c8075..1fe5ed55e 100755 --- a/rod/ropes.nim +++ b/rod/ropes.nim @@ -221,75 +221,59 @@ proc RopeSeqInsert(rs: var TRopeSeq, r: PRope, at: Natural) = rs[i] = rs[i - 1] # this is correct, I used pen and paper to validate it rs[at] = r -proc con(a, b: PRope): PRope = - assert(RopeInvariant(a)) - assert(RopeInvariant(b)) - if a == nil: - result = b - elif b == nil: - result = a +proc recRopeToStr(result: var string, resultLen: var int, p: PRope) = + if p == nil: + return # do not add to result + if (p.data == nil): + recRopeToStr(result, resultLen, p.left) + recRopeToStr(result, resultLen, p.right) else: + CopyMem(addr(result[resultLen + 0]), addr(p.data[0]), p.length) + Inc(resultLen, p.length) + assert(resultLen <= len(result)) + +proc newRecRopeToStr(result: var string, resultLen: var int, r: PRope) = + var stack = @[r] + while len(stack) > 0: + var it = pop(stack) + while it.data == nil: + add(stack, it.right) + it = it.left + assert(it.data != nil) + CopyMem(addr(result[resultLen]), addr(it.data[0]), it.length) + Inc(resultLen, it.length) + assert(resultLen <= len(result)) + +proc ropeToStr(p: PRope): string = + if p == nil: + result = "" + else: + result = newString(p.length) + var resultLen = 0 + newRecRopeToStr(result, resultLen, p) + +proc con(a, b: PRope): PRope = + if a == nil: result = b + elif b == nil: result = a + else: result = newRope() result.length = a.length + b.length result.left = a result.right = b - assert(RopeInvariant(result)) -proc con(a: PRope, b: string): PRope = - assert(RopeInvariant(a)) - if b == "": - result = a - else: - var r = toRope(b) - if a == nil: - result = r - else: - result = newRope() - result.length = a.length + r.length - result.left = a - result.right = r - assert(RopeInvariant(result)) - -proc con(a: string, b: PRope): PRope = - assert(RopeInvariant(b)) - if a == "": - result = b - else: - var r = toRope(a) - if b == nil: - result = r - else: - result = newRope() - result.length = b.length + r.length - result.left = r - result.right = b - assert(RopeInvariant(result)) +proc con(a: PRope, b: string): PRope = result = con(a, toRope(b)) +proc con(a: string, b: PRope): PRope = result = con(toRope(a), b) proc con(a: openarray[PRope]): PRope = - result = nil for i in countup(0, high(a)): result = con(result, a[i]) - assert(RopeInvariant(result)) - -proc toRope(i: BiggestInt): PRope = - result = toRope($(i)) - -proc toRopeF(r: BiggestFloat): PRope = - result = toRope($(r)) -proc app(a: var PRope, b: PRope) = - a = con(a, b) - assert(RopeInvariant(a)) - -proc app(a: var PRope, b: string) = - a = con(a, b) - assert(RopeInvariant(a)) - -proc prepend(a: var PRope, b: PRope) = - a = con(b, a) - assert(RopeInvariant(a)) +proc toRope(i: BiggestInt): PRope = result = toRope($i) +proc toRopeF(r: BiggestFloat): PRope = result = toRope($r) +proc app(a: var PRope, b: PRope) = a = con(a, b) +proc app(a: var PRope, b: string) = a = con(a, b) +proc prepend(a: var PRope, b: PRope) = a = con(b, a) proc WriteRopeRec(f: var tfile, c: PRope) = - assert(RopeInvariant(c)) if c == nil: return if (c.data != nil): write(f, c.data) @@ -298,7 +282,7 @@ proc WriteRopeRec(f: var tfile, c: PRope) = writeRopeRec(f, c.right) proc newWriteRopeRec(f: var tfile, c: PRope) = - var stack: TRopeSeq = @[c] + var stack = @[c] while len(stack) > 0: var it = pop(stack) while it.data == nil: @@ -315,37 +299,6 @@ proc WriteRope(head: PRope, filename: string) = close(f) else: rawMessage(errCannotOpenFile, filename) - -proc recRopeToStr(result: var string, resultLen: var int, p: PRope) = - if p == nil: - return # do not add to result - if (p.data == nil): - recRopeToStr(result, resultLen, p.left) - recRopeToStr(result, resultLen, p.right) - else: - CopyMem(addr(result[resultLen + 0]), addr(p.data[0]), p.length) - Inc(resultLen, p.length) - assert(resultLen <= len(result)) - -proc newRecRopeToStr(result: var string, resultLen: var int, r: PRope) = - var stack: TRopeSeq = @[r] - while len(stack) > 0: - var it = pop(stack) - while it.data == nil: - add(stack, it.right) - it = it.left - assert(it.data != nil) - CopyMem(addr(result[resultLen + 0]), addr(it.data[0]), it.length) - Inc(resultLen, it.length) - assert(resultLen <= len(result)) - -proc ropeToStr(p: PRope): string = - if p == nil: - result = "" - else: - result = newString(p.length) - var resultLen = 0 - newRecRopeToStr(result, resultLen, p) proc ropef(frmt: TFormatStr, args: openarray[PRope]): PRope = var i, j, length, start, num: int @@ -353,7 +306,7 @@ proc ropef(frmt: TFormatStr, args: openarray[PRope]): PRope = length = len(frmt) result = nil num = 0 - while i <= length + 0 - 1: + while i <= length - 1: if frmt[i] == '$': inc(i) # skip '$' case frmt[i] @@ -379,7 +332,7 @@ proc ropef(frmt: TFormatStr, args: openarray[PRope]): PRope = inc(i) else: InternalError("ropes: invalid format string $" & frmt[i]) start = i - while (i <= length + 0 - 1): + while (i <= length - 1): if (frmt[i] != '$'): inc(i) else: break if i - 1 >= start: @@ -418,7 +371,7 @@ proc RopeEqualsFile(r: PRope, f: string): bool = proc crcFromRopeAux(r: PRope, startVal: TCrc32): TCrc32 = if r.data != nil: result = startVal - for i in countup(0, len(r.data) + 0 - 1): + for i in countup(0, len(r.data) - 1): result = updateCrc32(r.data[i], result) else: result = crcFromRopeAux(r.left, startVal) diff --git a/rod/sem.nim b/rod/sem.nim index 2f9f90335..90dfd96ff 100755 --- a/rod/sem.nim +++ b/rod/sem.nim @@ -44,6 +44,7 @@ proc semIdentVis(c: PContext, kind: TSymKind, n: PNode, allowed: TSymFlags): PSy proc semIdentWithPragma(c: PContext, kind: TSymKind, n: PNode, allowed: TSymFlags): PSym proc semStmtScope(c: PContext, n: PNode): PNode + type TExprFlag = enum efAllowType, efLValue, efWantIterator diff --git a/rod/semexprs.nim b/rod/semexprs.nim index 34db72138..ac11654a6 100755 --- a/rod/semexprs.nim +++ b/rod/semexprs.nim @@ -1,21 +1,26 @@ # # # The Nimrod Compiler -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # + # this module does the semantic checking for expressions +const + ConstAbstractTypes = {tyNil, tyChar, tyInt..tyInt64, tyFloat..tyFloat128, + tyArrayConstr, tyTuple, tySet} -proc semTemplateExpr(c: PContext, n: PNode, s: PSym, semCheck: bool = true): PNode = +proc semTemplateExpr(c: PContext, n: PNode, s: PSym, + semCheck: bool = true): PNode = markUsed(n, s) pushInfoContext(n.info) result = evalTemplate(c, n, s) if semCheck: result = semAfterMacroCall(c, result, s) popInfoContext() -proc semDotExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode +proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags = {}): PNode proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = var d: PNode result = semExpr(c, n, flags) @@ -27,9 +32,59 @@ proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = addSon(d, result) result = d +proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = + if s.kind == skType and efAllowType notin flags: + liMessage(n.info, errATypeHasNoValue) + case s.kind + of skProc, skMethod, skIterator, skConverter: + if not (sfProcVar in s.flags) and (s.typ.callConv == ccDefault) and + (getModule(s).id != c.module.id): + liMessage(n.info, warnXisPassedToProcVar, s.name.s) + # XXX change this to + # errXCannotBePassedToProcVar after version 0.8.2 + # TODO VERSION 0.8.4 + #if (s.magic <> mNone) then + # liMessage(n.info, + # errInvalidContextForBuiltinX, s.name.s); + result = symChoice(c, n, s) + of skConst: + # + # Consider:: + # const x = [] + # proc p(a: openarray[int]) + # proc q(a: openarray[char]) + # p(x) + # q(x) + # + # It is clear that ``[]`` means two totally different things. Thus, we + # copy `x`'s AST into each context, so that the type fixup phase can + # deal with two different ``[]``. + # + markUsed(n, s) + if s.typ.kind in ConstAbstractTypes: + result = copyTree(s.ast) + result.typ = s.typ + else: + result = newSymNode(s) + result.info = n.info + of skMacro: result = semMacroExpr(c, n, s) + of skTemplate: result = semTemplateExpr(c, n, s) + of skVar: + markUsed(n, s) + # if a proc accesses a global variable, it is not side effect free: + if sfGlobal in s.flags: incl(c.p.owner.flags, sfSideEffect) + result = newSymNode(s) + result.info = n.info + of skGenericParam: + if s.ast == nil: InternalError(n.info, "no default for") + result = semExpr(c, s.ast) + else: + markUsed(n, s) + result = newSymNode(s) + result.info = n.info + proc checkConversionBetweenObjects(info: TLineInfo, castDest, src: PType) = - var diff: int - diff = inheritanceDiff(castDest, src) + var diff = inheritanceDiff(castDest, src) if diff == high(int): liMessage(info, errGenerated, `%`(MsgKindToString(errIllegalConvFromXtoY), [ typeToString(src), typeToString(castDest)])) @@ -37,14 +92,13 @@ proc checkConversionBetweenObjects(info: TLineInfo, castDest, src: PType) = proc checkConvertible(info: TLineInfo, castDest, src: PType) = const IntegralTypes = {tyBool, tyEnum, tyChar, tyInt..tyFloat128} - var d, s: PType if sameType(castDest, src): # don't annoy conversions that may be needed on another processor: if not (castDest.kind in {tyInt..tyFloat128, tyNil}): liMessage(info, hintConvFromXtoItselfNotNeeded, typeToString(castDest)) return - d = skipTypes(castDest, abstractVar) - s = skipTypes(src, abstractVar) + var d = skipTypes(castDest, abstractVar) + var s = skipTypes(src, abstractVar) while (d != nil) and (d.Kind in {tyPtr, tyRef}) and (d.Kind == s.Kind): d = base(d) s = base(s) @@ -87,13 +141,12 @@ proc isCastable(dst, src: PType): bool = (skipTypes(src, abstractInst).kind in {tyInt..tyFloat128}) proc semConv(c: PContext, n: PNode, s: PSym): PNode = - var op: PNode if sonsLen(n) != 2: liMessage(n.info, errConvNeedsOneArg) result = newNodeI(nkConv, n.info) result.typ = semTypeNode(c, n.sons[0], nil) addSon(result, copyTree(n.sons[0])) addSon(result, semExprWithType(c, n.sons[1])) - op = result.sons[1] + var op = result.sons[1] if op.kind != nkSymChoice: checkConvertible(result.info, result.typ, op.typ) else: @@ -117,12 +170,11 @@ proc semCast(c: PContext, n: PNode): PNode = proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode = const opToStr: array[mLow..mHigh, string] = ["low", "high"] - var typ: PType if sonsLen(n) != 2: liMessage(n.info, errXExpectsTypeOrValue, opToStr[m]) else: n.sons[1] = semExprWithType(c, n.sons[1], {efAllowType}) - typ = skipTypes(n.sons[1].typ, abstractVarRange) + var typ = skipTypes(n.sons[1].typ, abstractVarRange) case typ.Kind of tySequence, tyString, tyOpenArray: n.typ = getSysType(tyInt) @@ -140,12 +192,11 @@ proc semSizeof(c: PContext, n: PNode): PNode = result = n proc semIs(c: PContext, n: PNode): PNode = - var a, b: PType if sonsLen(n) == 3: n.sons[1] = semExprWithType(c, n.sons[1], {efAllowType}) n.sons[2] = semExprWithType(c, n.sons[2], {efAllowType}) - a = n.sons[1].typ - b = n.sons[2].typ + var a = n.sons[1].typ + var b = n.sons[2].typ if (b.kind != tyObject) or (a.kind != tyObject): liMessage(n.info, errIsExpectsObjectTypes) while (b != nil) and (b.id != a.id): b = b.sons[0] @@ -156,14 +207,11 @@ proc semIs(c: PContext, n: PNode): PNode = result = n proc semOpAux(c: PContext, n: PNode) = - var - a: PNode - info: TLineInfo for i in countup(1, sonsLen(n) - 1): - a = n.sons[i] + var a = n.sons[i] if a.kind == nkExprEqExpr: checkSonsLen(a, 2) - info = a.sons[0].info + var info = a.sons[0].info a.sons[0] = newIdentNode(considerAcc(a.sons[0]), info) a.sons[1] = semExprWithType(c, a.sons[1]) a.typ = a.sons[1].typ @@ -171,9 +219,8 @@ proc semOpAux(c: PContext, n: PNode) = n.sons[i] = semExprWithType(c, a) proc overloadedCallOpr(c: PContext, n: PNode): PNode = - var par: PIdent # quick check if there is *any* () operator overloaded: - par = getIdent("()") + var par = getIdent("()") if SymtabGet(c.Tab, par) == nil: result = nil else: @@ -214,7 +261,6 @@ proc changeType(n: PNode, newType: PType) = n.typ = newType proc semArrayConstr(c: PContext, n: PNode): PNode = - var typ: PType result = newNodeI(nkBracket, n.info) result.typ = newTypeS(tyArrayConstr, c) addSon(result.typ, nil) # index type @@ -222,29 +268,22 @@ proc semArrayConstr(c: PContext, n: PNode): PNode = addSon(result.typ, newTypeS(tyEmpty, c)) # needs an empty basetype! else: addSon(result, semExprWithType(c, n.sons[0])) - typ = skipTypes(result.sons[0].typ, {tyGenericInst, tyVar, tyOrdinal}) + var typ = skipTypes(result.sons[0].typ, {tyGenericInst, tyVar, tyOrdinal}) for i in countup(1, sonsLen(n) - 1): n.sons[i] = semExprWithType(c, n.sons[i]) addSon(result, fitNode(c, typ, n.sons[i])) addSon(result.typ, typ) result.typ.sons[0] = makeRangeType(c, 0, sonsLen(result) - 1, n.info) -const - ConstAbstractTypes = {tyNil, tyChar, tyInt..tyInt64, tyFloat..tyFloat128, - tyArrayConstr, tyTuple, tySet} - proc fixAbstractType(c: PContext, n: PNode) = - var - s: PType - it: PNode for i in countup(1, sonsLen(n) - 1): - it = n.sons[i] + var it = n.sons[i] case it.kind of nkHiddenStdConv, nkHiddenSubConv: if it.sons[1].kind == nkBracket: it.sons[1] = semArrayConstr(c, it.sons[1]) if skipTypes(it.typ, abstractVar).kind == tyOpenArray: - s = skipTypes(it.sons[1].typ, abstractVar) + var s = skipTypes(it.sons[1].typ, abstractVar) if (s.kind == tyArrayConstr) and (s.sons[1].kind == tyEmpty): s = copyType(s, getCurrOwner(), false) skipTypes(s, abstractVar).sons[1] = elemType( @@ -252,7 +291,7 @@ proc fixAbstractType(c: PContext, n: PNode) = it.sons[1].typ = s elif skipTypes(it.sons[1].typ, abstractVar).kind in {tyNil, tyArrayConstr, tyTuple, tySet}: - s = skipTypes(it.typ, abstractVar) + var s = skipTypes(it.typ, abstractVar) changeType(it.sons[1], s) n.sons[i] = it.sons[1] of nkBracket: @@ -269,8 +308,7 @@ proc skipObjConv(n: PNode): PNode = result = n.sons[1] else: result = n - of nkObjUpConv, nkObjDownConv: - result = n.sons[0] + of nkObjUpConv, nkObjDownConv: result = n.sons[0] else: result = n type @@ -347,9 +385,8 @@ proc analyseIfAddressTakenInCall(c: PContext, n: PNode) = FakeVarParams = {mNew, mNewFinalize, mInc, ast.mDec, mIncl, mExcl, mSetLengthStr, mSetLengthSeq, mAppendStrCh, mAppendStrStr, mSwap, mAppendSeqElem, mNewSeq} - var t: PType checkMinSonsLen(n, 1) - t = n.sons[0].typ + var t = n.sons[0].typ if (n.sons[0].kind == nkSym) and (n.sons[0].sym.magic in FakeVarParams): return for i in countup(1, sonsLen(n) - 1): @@ -357,8 +394,8 @@ proc analyseIfAddressTakenInCall(c: PContext, n: PNode) = (skipTypes(t.sons[i], abstractInst).kind == tyVar): n.sons[i] = analyseIfAddressTaken(c, n.sons[i]) -proc semDirectCallAnalyseEffects(c: PContext, n: PNode, flags: TExprFlags): PNode = - var callee: PSym +proc semDirectCallAnalyseEffects(c: PContext, n: PNode, + flags: TExprFlags): PNode = if not (efWantIterator in flags): result = semDirectCall(c, n, {skProc, skMethod, skConverter}) else: @@ -366,7 +403,7 @@ proc semDirectCallAnalyseEffects(c: PContext, n: PNode, flags: TExprFlags): PNod if result != nil: if result.sons[0].kind != nkSym: InternalError("semDirectCallAnalyseEffects") - callee = result.sons[0].sym + var callee = result.sons[0].sym if (callee.kind == skIterator) and (callee.id == c.p.owner.id): liMessage(n.info, errRecursiveDependencyX, callee.name.s) if not (sfNoSideEffect in callee.flags): @@ -375,17 +412,12 @@ proc semDirectCallAnalyseEffects(c: PContext, n: PNode, flags: TExprFlags): PNod incl(c.p.owner.flags, sfSideEffect) proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = - var - m: TCandidate - msg: string - prc: PNode - t: PType result = nil - prc = n.sons[0] + var prc = n.sons[0] checkMinSonsLen(n, 1) if n.sons[0].kind == nkDotExpr: checkSonsLen(n.sons[0], 2) - n.sons[0] = semDotExpr(c, n.sons[0]) + n.sons[0] = semFieldAccess(c, n.sons[0]) if n.sons[0].kind == nkDotCall: # it is a static call! result = n.sons[0] @@ -395,27 +427,30 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = else: n.sons[0] = semExpr(c, n.sons[0]) semOpAux(c, n) + var t: PType = nil if (n.sons[0].typ != nil): t = skipTypes(n.sons[0].typ, abstractInst) - else: t = nil if (t != nil) and (t.kind == tyProc): + var m: TCandidate initCandidate(m, t) matches(c, n, m) if m.state != csMatch: - msg = msgKindToString(errTypeMismatch) + var msg = msgKindToString(errTypeMismatch) for i in countup(1, sonsLen(n) - 1): if i > 1: add(msg, ", ") add(msg, typeToString(n.sons[i].typ)) - add(msg, ')' & "\n" & msgKindToString(errButExpected) & "\n" & + add(msg, ")\n" & msgKindToString(errButExpected) & "\n" & typeToString(n.sons[0].typ)) liMessage(n.Info, errGenerated, msg) result = nil else: - result = m.call # we assume that a procedure that calls something indirectly - # has side-effects: + result = m.call + # we assume that a procedure that calls something indirectly + # has side-effects: if not (tfNoSideEffect in t.flags): incl(c.p.owner.flags, sfSideEffect) else: - result = overloadedCallOpr(c, n) # Now that nkSym does not imply an iteration over the proc/iterator space, - # the old ``prc`` (which is likely an nkIdent) has to be restored: + result = overloadedCallOpr(c, n) + # Now that nkSym does not imply an iteration over the proc/iterator space, + # the old ``prc`` (which is likely an nkIdent) has to be restored: if result == nil: n.sons[0] = prc result = semDirectCallAnalyseEffects(c, n, flags) @@ -436,21 +471,17 @@ proc semDirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode = analyseIfAddressTakenInCall(c, result) proc semEcho(c: PContext, n: PNode): PNode = - var call, arg: PNode # this really is a macro checkMinSonsLen(n, 1) for i in countup(1, sonsLen(n) - 1): - arg = semExprWithType(c, n.sons[i]) - call = newNodeI(nkCall, arg.info) + var arg = semExprWithType(c, n.sons[i]) + var call = newNodeI(nkCall, arg.info) addSon(call, newIdentNode(getIdent("$"), n.info)) addSon(call, arg) n.sons[i] = semExpr(c, call) result = n proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = - var - m: PSym - ident: PIdent case n.kind of nkIdent: if onlyCurrentScope: @@ -461,10 +492,10 @@ proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = result = nil if onlyCurrentScope: return checkSonsLen(n, 2) - m = LookupForDefined(c, n.sons[0], onlyCurrentScope) + var m = LookupForDefined(c, n.sons[0], onlyCurrentScope) if (m != nil) and (m.kind == skModule): if (n.sons[1].kind == nkIdent): - ident = n.sons[1].ident + var ident = n.sons[1].ident if m == c.module: result = StrTableGet(c.tab.stack[ModuleTablePos], ident) else: @@ -480,7 +511,8 @@ proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = proc semDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PNode = checkSonsLen(n, 2) - result = newIntNode(nkIntLit, 0) # we replace this node by a 'true' or 'false' node + # we replace this node by a 'true' or 'false' node: + result = newIntNode(nkIntLit, 0) if LookUpForDefined(c, n.sons[1], onlyCurrentScope) != nil: result.intVal = 1 elif not onlyCurrentScope and (n.sons[1].kind == nkIdent) and @@ -497,21 +529,14 @@ proc setMs(n: PNode, s: PSym): PNode = proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = # this is a hotspot in the compiler! result = n - case s.magic # magics that need special treatment - of mDefined: - result = semDefined(c, setMs(n, s), false) - of mDefinedInScope: - result = semDefined(c, setMs(n, s), true) - of mLow: - result = semLowHigh(c, setMs(n, s), mLow) - of mHigh: - result = semLowHigh(c, setMs(n, s), mHigh) - of mSizeOf: - result = semSizeof(c, setMs(n, s)) - of mIs: - result = semIs(c, setMs(n, s)) - of mEcho: - result = semEcho(c, setMs(n, s)) + case s.magic # magics that need special treatment + of mDefined: result = semDefined(c, setMs(n, s), false) + of mDefinedInScope: result = semDefined(c, setMs(n, s), true) + of mLow: result = semLowHigh(c, setMs(n, s), mLow) + of mHigh: result = semLowHigh(c, setMs(n, s), mHigh) + of mSizeOf: result = semSizeof(c, setMs(n, s)) + of mIs: result = semIs(c, setMs(n, s)) + of mEcho: result = semEcho(c, setMs(n, s)) else: result = semDirectOp(c, n, flags) proc isTypeExpr(n: PNode): bool = @@ -543,7 +568,7 @@ proc lookupInRecordAndBuildCheck(c: PContext, n, r: PNode, field: PIdent, of nkOfBranch: result = lookupInRecordAndBuildCheck(c, n, lastSon(it), field, check) if result == nil: - for j in countup(0, sonsLen(it) - 2): addSon(s, copyTree(it.sons[j])) + for j in 0..sonsLen(it)-2: addSon(s, copyTree(it.sons[j])) else: if check == nil: check = newNodeI(nkCheckedFieldExpr, n.info) @@ -577,37 +602,32 @@ proc lookupInRecordAndBuildCheck(c: PContext, n, r: PNode, field: PIdent, else: illFormedAst(n) proc makeDeref(n: PNode): PNode = - var - t: PType - a: PNode - t = skipTypes(n.typ, {tyGenericInst}) + var t = skipTypes(n.typ, {tyGenericInst}) result = n if t.kind == tyVar: result = newNodeIT(nkHiddenDeref, n.info, t.sons[0]) addSon(result, n) t = skipTypes(t.sons[0], {tyGenericInst}) if t.kind in {tyPtr, tyRef}: - a = result + var a = result result = newNodeIT(nkDerefExpr, n.info, t.sons[0]) addSon(result, a) -proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = - var - f: PSym - ty: PType - i: PIdent - check: PNode - # this is difficult, because the '.' is used in many different contexts - # in Nimrod. We first allow types in the semantic checking. +proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = + ## returns nil if it's not a built-in field access + var s = qualifiedLookup(c, n, true) # check for ambiguity + if s != nil: + return semSym(c, n, s, flags) + checkSonsLen(n, 2) n.sons[0] = semExprWithType(c, n.sons[0], {efAllowType} + flags) - i = considerAcc(n.sons[1]) - ty = n.sons[0].Typ - f = nil + var i = considerAcc(n.sons[1]) + var ty = n.sons[0].Typ + var f: PSym = nil result = nil if ty.kind == tyEnum: # look up if the identifier belongs to the enum: - while (ty != nil): + while ty != nil: f = getSymFromList(ty.n, i) if f != nil: break ty = ty.sons[0] # enum inheritance @@ -623,16 +643,16 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = liMessage(n.sons[0].info, errATypeHasNoValue) return ty = skipTypes(ty, {tyGenericInst, tyVar, tyPtr, tyRef}) + var check: PNode = nil if ty.kind == tyObject: while true: check = nil - f = lookupInRecordAndBuildCheck(c, n, ty.n, i, check) #f := lookupInRecord(ty.n, i); + f = lookupInRecordAndBuildCheck(c, n, ty.n, i, check) if f != nil: break if ty.sons[0] == nil: break ty = skipTypes(ty.sons[0], {tyGenericInst}) if f != nil: - if ({sfStar, sfMinus} * f.flags != {}) or - (getModule(f).id == c.module.id): + if {sfStar, sfMinus} * f.flags != {} or getModule(f).id == c.module.id: # is the access to a public field or in the same module? n.sons[0] = makeDeref(n.sons[0]) n.sons[1] = newSymNode(f) # we now have the correct field @@ -644,7 +664,6 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = check.sons[0] = n check.typ = n.typ result = check - return elif ty.kind == tyTuple: f = getSymFromList(ty.n, i) if f != nil: @@ -653,16 +672,24 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = n.typ = f.typ result = n markUsed(n, f) - return - f = SymTabGet(c.tab, i) #if (f <> nil) and (f.kind = skStub) then loadStub(f); - # ``loadStub`` is not correct here as we don't care for ``f`` really - if (f != nil): - # BUGFIX: do not check for (f.kind in [skProc, skMethod, skIterator]) here - result = newNodeI(nkDotCall, n.info) # This special node kind is to merge with the call handler in `semExpr`. - addSon(result, newIdentNode(i, n.info)) - addSon(result, copyTree(n.sons[0])) - else: - liMessage(n.Info, errUndeclaredFieldX, i.s) + +proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = + # this is difficult, because the '.' is used in many different contexts + # in Nimrod. We first allow types in the semantic checking. + result = builtinFieldAccess(c, n, flags) + if result == nil: + var i = considerAcc(n.sons[1]) + var f = SymTabGet(c.tab, i) + # if f != nil and f.kind == skStub: loadStub(f) + # ``loadStub`` is not correct here as we don't care for ``f`` really + if f != nil: + # BUGFIX: do not check for (f.kind in [skProc, skMethod, skIterator]) here + # This special node kind is to merge with the call handler in `semExpr`. + result = newNodeI(nkDotCall, n.info) + addSon(result, newIdentNode(i, n.info)) + addSon(result, copyTree(n[0])) + else: + liMessage(n.Info, errUndeclaredFieldX, i.s) proc whichSliceOpr(n: PNode): string = if (n.sons[0] == nil): @@ -672,63 +699,92 @@ proc whichSliceOpr(n: PNode): string = result = "[$..]" else: result = "[$..$]" + +proc addSliceOpr(result: var string, n: PNode) = + if n[0] == nil: + if n[1] == nil: result.add("..") + else: result.add("..$") + elif n[1] == nil: result.add("$..") + else: result.add("$..$") + +proc buildOverloadedSubscripts(n: PNode, inAsgn: bool): PNode = + result = newNodeI(nkCall, n.info) + add(result, nil) # fill with the correct node later + add(result, n[0]) + var opr = "[" + for i in 1..n.len-1: + if i > 1: add(opr, ",") + if n[i].kind == nkRange: + # we have a slice argument + checkSonsLen(n[i], 2) + addSliceOpr(opr, n[i]) + addSonIfNotNil(result, n[i][0]) + addSonIfNotNil(result, n[i][1]) + else: + add(result, n[i]) + if inAsgn: add(opr, "]=") + else: add(opr, "]") + # now we know the operator + result.sons[0] = newIdentNode(getIdent(opr), n.info) -proc semArrayAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = - var - arr, indexType: PType - arg: PNode - idx: biggestInt - # check if array type: +proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode = + ## returns nil if not a built-in subscript operator; checkMinSonsLen(n, 2) n.sons[0] = semExprWithType(c, n.sons[0], flags - {efAllowType}) - arr = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyPtr, tyRef}) + var arr = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyPtr, tyRef}) case arr.kind of tyArray, tyOpenArray, tyArrayConstr, tySequence, tyString, tyCString: + checkSonsLen(n, 2) n.sons[0] = makeDeref(n.sons[0]) for i in countup(1, sonsLen(n) - 1): n.sons[i] = semExprWithType(c, n.sons[i], flags - {efAllowType}) - if arr.kind == tyArray: indexType = arr.sons[0] - else: indexType = getSysType(tyInt) - arg = IndexTypesMatch(c, indexType, n.sons[1].typ, n.sons[1]) + var indexType = if arr.kind == tyArray: arr.sons[0] else: getSysType(tyInt) + var arg = IndexTypesMatch(c, indexType, n.sons[1].typ, n.sons[1]) if arg != nil: n.sons[1] = arg else: liMessage(n.info, errIndexTypesDoNotMatch) result = n result.typ = elemType(arr) of tyTuple: - n.sons[0] = makeDeref(n.sons[0]) # [] operator for tuples requires constant expression + checkSonsLen(n, 2) + n.sons[0] = makeDeref(n.sons[0]) + # [] operator for tuples requires constant expression: n.sons[1] = semConstExpr(c, n.sons[1]) if skipTypes(n.sons[1].typ, {tyGenericInst, tyRange, tyOrdinal}).kind in {tyInt..tyInt64}: - idx = getOrdValue(n.sons[1]) + var idx = getOrdValue(n.sons[1]) if (idx >= 0) and (idx < sonsLen(arr)): n.typ = arr.sons[int(idx)] else: liMessage(n.info, errInvalidIndexValueForTuple) else: liMessage(n.info, errIndexTypesDoNotMatch) result = n - else: + else: nil + +proc semArrayAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = + result = semSubscript(c, n, flags) + if result == nil: # overloaded [] operator: - result = newNodeI(nkCall, n.info) - if n.sons[1].kind == nkRange: - checkSonsLen(n.sons[1], 2) - addSon(result, newIdentNode(getIdent(whichSliceOpr(n.sons[1])), n.info)) - addSon(result, n.sons[0]) - addSonIfNotNil(result, n.sons[1].sons[0]) - addSonIfNotNil(result, n.sons[1].sons[1]) - else: - addSon(result, newIdentNode(getIdent("[]"), n.info)) - addSon(result, n.sons[0]) - addSon(result, n.sons[1]) - result = semExpr(c, result) + when false: + result = newNodeI(nkCall, n.info) + if n.sons[1].kind == nkRange: + checkSonsLen(n.sons[1], 2) + addSon(result, newIdentNode(getIdent(whichSliceOpr(n.sons[1])), n.info)) + addSon(result, n.sons[0]) + addSonIfNotNil(result, n.sons[1].sons[0]) + addSonIfNotNil(result, n.sons[1].sons[1]) + else: + addSon(result, newIdentNode(getIdent("[]"), n.info)) + addSon(result, n.sons[0]) + addSon(result, n.sons[1]) + result = semExpr(c, result) + else: + result = semExpr(c, buildOverloadedSubscripts(n, inAsgn=false)) proc semIfExpr(c: PContext, n: PNode): PNode = - var - typ: PType - it: PNode result = n checkSonsLen(n, 2) - typ = nil + var typ: PType = nil for i in countup(0, sonsLen(n) - 1): - it = n.sons[i] + var it = n.sons[i] case it.kind of nkElifExpr: checkSonsLen(it, 2) @@ -740,22 +796,19 @@ proc semIfExpr(c: PContext, n: PNode): PNode = of nkElseExpr: checkSonsLen(it, 1) it.sons[0] = semExprWithType(c, it.sons[0]) - if (typ == nil): InternalError(it.info, "semIfExpr") + if typ == nil: InternalError(it.info, "semIfExpr") it.sons[0] = fitNode(c, typ, it.sons[0]) else: illFormedAst(n) result.typ = typ proc semSetConstr(c: PContext, n: PNode): PNode = - var - typ: PType - m: PNode result = newNodeI(nkCurly, n.info) result.typ = newTypeS(tySet, c) if sonsLen(n) == 0: addSon(result.typ, newTypeS(tyEmpty, c)) else: # only semantic checking for all elements, later type checking: - typ = nil + var typ: PType = nil for i in countup(0, sonsLen(n) - 1): if n.sons[i].kind == nkRange: checkSonsLen(n.sons[i], 2) @@ -776,6 +829,7 @@ proc semSetConstr(c: PContext, n: PNode): PNode = typ = makeRangeType(c, 0, MaxSetElements - 1, n.info) addSon(result.typ, typ) for i in countup(0, sonsLen(n) - 1): + var m: PNode if n.sons[i].kind == nkRange: m = newNodeI(nkRange, n.sons[i].info) addSon(m, fitNode(c, typ, n.sons[i].sons[0])) @@ -789,8 +843,7 @@ type paNone, paSingle, paTupleFields, paTuplePositions proc checkPar(n: PNode): TParKind = - var length: int - length = sonsLen(n) + var length = sonsLen(n) if length == 0: result = paTuplePositions # () elif length == 1: @@ -810,25 +863,22 @@ proc checkPar(n: PNode): TParKind = return paNone proc semTupleFieldsConstr(c: PContext, n: PNode): PNode = - var - typ: PType - ids: TIntSet - id: PIdent - f: PSym + var ids: TIntSet result = newNodeI(nkPar, n.info) - typ = newTypeS(tyTuple, c) + var typ = newTypeS(tyTuple, c) typ.n = newNodeI(nkRecList, n.info) # nkIdentDefs IntSetInit(ids) for i in countup(0, sonsLen(n) - 1): if (n.sons[i].kind != nkExprColonExpr) or not (n.sons[i].sons[0].kind in {nkSym, nkIdent}): illFormedAst(n.sons[i]) + var id: PIdent if n.sons[i].sons[0].kind == nkIdent: id = n.sons[i].sons[0].ident else: id = n.sons[i].sons[0].sym.name if IntSetContainsOrIncl(ids, id.id): liMessage(n.sons[i].info, errFieldInitTwice, id.s) n.sons[i].sons[1] = semExprWithType(c, n.sons[i].sons[1]) - f = newSymS(skField, n.sons[i].sons[0], c) + var f = newSymS(skField, n.sons[i].sons[0], c) f.typ = n.sons[i].sons[1].typ addSon(typ, f.typ) addSon(typ.n, newSymNode(f)) @@ -837,19 +887,17 @@ proc semTupleFieldsConstr(c: PContext, n: PNode): PNode = result.typ = typ proc semTuplePositionsConstr(c: PContext, n: PNode): PNode = - var typ: PType result = n # we don't modify n, but compute the type: - typ = newTypeS(tyTuple, c) # leave typ.n nil! + var typ = newTypeS(tyTuple, c) # leave typ.n nil! for i in countup(0, sonsLen(n) - 1): n.sons[i] = semExprWithType(c, n.sons[i]) addSon(typ, n.sons[i].typ) result.typ = typ proc semStmtListExpr(c: PContext, n: PNode): PNode = - var length: int result = n checkMinSonsLen(n, 1) - length = sonsLen(n) + var length = sonsLen(n) for i in countup(0, length - 2): n.sons[i] = semStmt(c, n.sons[i]) if length > 0: @@ -873,14 +921,12 @@ proc isCallExpr(n: PNode): bool = {nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit} proc semMacroStmt(c: PContext, n: PNode, semCheck: bool = true): PNode = - var - s: PSym - a: PNode checkMinSonsLen(n, 2) + var a: PNode if isCallExpr(n.sons[0]): a = n.sons[0].sons[0] else: a = n.sons[0] - s = qualifiedLookup(c, a, false) - if (s != nil): + var s = qualifiedLookup(c, a, false) + if s != nil: case s.kind of skMacro: result = semMacroExpr(c, n, s, semCheck) @@ -900,76 +946,13 @@ proc semMacroStmt(c: PContext, n: PNode, semCheck: bool = true): PNode = else: liMessage(n.info, errInvalidExpressionX, renderTree(a, {renderNoComments})) -proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = - if (s.kind == skType) and not (efAllowType in flags): - liMessage(n.info, errATypeHasNoValue) - case s.kind - of skProc, skMethod, skIterator, skConverter: - if not (sfProcVar in s.flags) and (s.typ.callConv == ccDefault) and - (getModule(s).id != c.module.id): - liMessage(n.info, warnXisPassedToProcVar, s.name.s) # XXX change this to - # errXCannotBePassedToProcVar after version 0.8.2 - # TODO VERSION 0.8.4 - #if (s.magic <> mNone) then - # liMessage(n.info, - # errInvalidContextForBuiltinX, s.name.s); - result = symChoice(c, n, s) - of skConst: - # - # Consider:: - # const x = [] - # proc p(a: openarray[int]) - # proc q(a: openarray[char]) - # p(x) - # q(x) - # - # It is clear that ``[]`` means two totally different things. Thus, we - # copy `x`'s AST into each context, so that the type fixup phase can - # deal with two different ``[]``. - # - markUsed(n, s) - if s.typ.kind in ConstAbstractTypes: - result = copyTree(s.ast) - result.info = n.info - result.typ = s.typ - else: - result = newSymNode(s) - result.info = n.info - of skMacro: - result = semMacroExpr(c, n, s) - of skTemplate: - result = semTemplateExpr(c, n, s) - of skVar: - markUsed(n, s) # if a proc accesses a global variable, it is not side effect free - if sfGlobal in s.flags: incl(c.p.owner.flags, sfSideEffect) - result = newSymNode(s) - result.info = n.info - of skGenericParam: - if s.ast == nil: InternalError(n.info, "no default for") - result = semExpr(c, s.ast) - else: - markUsed(n, s) - result = newSymNode(s) - result.info = n.info - -proc semDotExpr(c: PContext, n: PNode, flags: TExprFlags): PNode = - var s: PSym - s = qualifiedLookup(c, n, true) # check for ambiguity - if s != nil: # this is a test comment; please don't touch it - result = semSym(c, n, s, flags) - else: - result = semFieldAccess(c, n, flags) - proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = - var - s: PSym - t: PType result = n if n == nil: return if nfSem in n.flags: return case n.kind # atoms: of nkIdent: - s = lookUp(c, n) + var s = lookUp(c, n) result = semSym(c, n, s, flags) of nkSym: #s := n.sym; @@ -1007,7 +990,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkCharLit: if result.typ == nil: result.typ = getSysType(tyChar) of nkDotExpr: - result = semDotExpr(c, n, flags) + result = semFieldAccess(c, n, flags) if result.kind == nkDotCall: result.kind = nkCall result = semExpr(c, result, flags) @@ -1016,8 +999,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit: # check if it is an expression macro: checkMinSonsLen(n, 1) - s = qualifiedLookup(c, n.sons[0], false) - if (s != nil): + var s = qualifiedLookup(c, n.sons[0], false) + if s != nil: case s.kind of skMacro: result = semMacroExpr(c, n, s) @@ -1041,8 +1024,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = semMacroStmt(c, n) of nkBracketExpr: checkMinSonsLen(n, 1) - s = qualifiedLookup(c, n.sons[0], false) - if (s != nil) and (s.kind in {skProc, skMethod, skConverter, skIterator}): + var s = qualifiedLookup(c, n.sons[0], false) + if s != nil and s.kind in {skProc, skMethod, skConverter, skIterator}: # type parameters: partial generic specialization # XXX: too implement! internalError(n.info, "explicit generic instantation not implemented") @@ -1058,17 +1041,14 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of paTuplePositions: result = semTuplePositionsConstr(c, n) of paTupleFields: result = semTupleFieldsConstr(c, n) of paSingle: result = semExpr(c, n.sons[0]) - of nkCurly: - result = semSetConstr(c, n) - of nkBracket: - result = semArrayConstr(c, n) - of nkLambda: - result = semLambda(c, n) + of nkCurly: result = semSetConstr(c, n) + of nkBracket: result = semArrayConstr(c, n) + of nkLambda: result = semLambda(c, n) of nkDerefExpr: checkSonsLen(n, 1) n.sons[0] = semExprWithType(c, n.sons[0]) result = n - t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar}) + var t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar}) case t.kind of tyRef, tyPtr: n.typ = t.sons[0] else: liMessage(n.sons[0].info, errCircumNeedsPointer) @@ -1083,17 +1063,13 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = of nkHiddenAddr, nkHiddenDeref: checkSonsLen(n, 1) n.sons[0] = semExpr(c, n.sons[0], flags) - of nkCast: - result = semCast(c, n) + of nkCast: result = semCast(c, n) of nkAccQuoted: checkSonsLen(n, 1) result = semExpr(c, n.sons[0]) - of nkIfExpr: - result = semIfExpr(c, n) - of nkStmtListExpr: - result = semStmtListExpr(c, n) - of nkBlockExpr: - result = semBlockExpr(c, n) + of nkIfExpr: result = semIfExpr(c, n) + of nkStmtListExpr: result = semStmtListExpr(c, n) + of nkBlockExpr: result = semBlockExpr(c, n) of nkHiddenStdConv, nkHiddenSubConv, nkConv, nkHiddenCallConv: checkSonsLen(n, 2) of nkStringToCString, nkCStringToString, nkPassAsOpenArray, nkObjDownConv, @@ -1105,9 +1081,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = checkMinSonsLen(n, 2) of nkSymChoice: liMessage(n.info, errExprXAmbiguous, renderTree(n, {renderNoComments})) - result = nil else: #InternalError(n.info, nodeKindToStr[n.kind]); liMessage(n.info, errInvalidExpressionX, renderTree(n, {renderNoComments})) - result = nil incl(result.flags, nfSem) diff --git a/rod/semfold.nim b/rod/semfold.nim index 455ddf2b8..a7515f3bb 100755 --- a/rod/semfold.nim +++ b/rod/semfold.nim @@ -44,18 +44,13 @@ proc newStrNodeT(strVal: string, n: PNode): PNode = result.info = n.info proc enumValToString(a: PNode): string = - var - n: PNode - field: PSym - x: biggestInt - x = getInt(a) - n = skipTypes(a.typ, abstractInst).n + var x = getInt(a) + var n = skipTypes(a.typ, abstractInst).n for i in countup(0, sonsLen(n) - 1): if n.sons[i].kind != nkSym: InternalError(a.info, "enumValToString") - field = n.sons[i].sym - if field.position == x: - return field.name.s - InternalError(a.info, "no symbol for ordinal value: " & $(x)) + var field = n.sons[i].sym + if field.position == x: return field.name.s + InternalError(a.info, "no symbol for ordinal value: " & $x) proc evalOp(m: TMagic, n, a, b, c: PNode): PNode = # b and c may be nil diff --git a/rod/semstmts.nim b/rod/semstmts.nim index 415bb1a32..d2df06f3d 100755 --- a/rod/semstmts.nim +++ b/rod/semstmts.nim @@ -8,16 +8,20 @@ # # this module does the semantic checking of statements +proc semExprNoType(c: PContext, n: PNode): PNode = + result = semExpr(c, n) + if result.typ != nil and result.typ.kind != tyStmt: + liMessage(n.info, errDiscardValue) + proc semWhen(c: PContext, n: PNode): PNode = - var it, e: PNode result = nil for i in countup(0, sonsLen(n) - 1): - it = n.sons[i] + var it = n.sons[i] if it == nil: illFormedAst(n) case it.kind of nkElifBranch: checkSonsLen(it, 2) - e = semConstExpr(c, it.sons[0]) + var e = semConstExpr(c, it.sons[0]) checkBool(e) if (e.kind != nkIntLit): InternalError(n.info, "semWhen") if (e.intVal != 0) and (result == nil): @@ -91,35 +95,27 @@ proc semBlock(c: PContext, n: PNode): PNode = Dec(c.p.nestedBlockCounter) proc semAsm(con: PContext, n: PNode): PNode = - var - str, sub: string - a, b, c: int - e: PSym - marker: char result = n checkSonsLen(n, 2) - marker = pragmaAsm(con, n.sons[0]) - if marker == '\0': - marker = '`' # default marker + var marker = pragmaAsm(con, n.sons[0]) + if marker == '\0': marker = '`' # default marker case n.sons[1].kind of nkStrLit, nkRStrLit, nkTripleStrLit: result = copyNode(n) - str = n.sons[1].strVal - if str == "": - liMessage(n.info, errEmptyAsm) + var str = n.sons[1].strVal + if str == "": liMessage(n.info, errEmptyAsm) # now parse the string literal and substitute symbols: - a = 0 + var a = 0 while true: - b = strutils.find(str, marker, a) - if b < 0: sub = copy(str, a) - else: sub = copy(str, a, b - 1) + var b = strutils.find(str, marker, a) + var sub = if b < 0: copy(str, a) else: copy(str, a, b - 1) if sub != "": addSon(result, newStrNode(nkStrLit, sub)) if b < 0: break - c = strutils.find(str, marker, b + 1) + var c = strutils.find(str, marker, b + 1) if c < 0: sub = copy(str, b + 1) else: sub = copy(str, b + 1, c - 1) if sub != "": - e = SymtabGet(con.tab, getIdent(sub)) + var e = SymtabGet(con.tab, getIdent(sub)) if e != nil: if e.kind == skStub: loadStub(e) addSon(result, newSymNode(e)) @@ -177,66 +173,61 @@ proc semCase(c: PContext, n: PNode): PNode = liMessage(n.info, errNotAllCasesCovered) closeScope(c.tab) +proc propertyWriteAccess(c: PContext, n, a: PNode): PNode = + var id = considerAcc(a[1]) + result = newNodeI(nkCall, n.info) + addSon(result, newIdentNode(getIdent(id.s & '='), n.info)) + # a[0] is already checked for semantics, that does ``builtinFieldAccess`` + # this is ugly. XXX Semantic checking should use the ``nfSem`` flag for + # nodes! + addSon(result, a[0]) + addSon(result, semExpr(c, n[1])) + result = semDirectCallAnalyseEffects(c, result, {}) + if result != nil: + fixAbstractType(c, result) + analyseIfAddressTakenInCall(c, result) + else: + liMessage(n.Info, errUndeclaredFieldX, id.s) + proc semAsgn(c: PContext, n: PNode): PNode = - var - le: PType - a: PNode - id: PIdent checkSonsLen(n, 2) - a = n.sons[0] + var a = n.sons[0] case a.kind of nkDotExpr: # r.f = x # --> `f=` (r, x) - checkSonsLen(a, 2) - id = considerAcc(a.sons[1]) - result = newNodeI(nkCall, n.info) - addSon(result, newIdentNode(getIdent(id.s & '='), n.info)) - addSon(result, semExpr(c, a.sons[0])) - addSon(result, semExpr(c, n.sons[1])) - result = semDirectCallAnalyseEffects(c, result, {}) - if result != nil: - fixAbstractType(c, result) - analyseIfAddressTakenInCall(c, result) - return - of nkBracketExpr: - # a[i..j] = x - # --> `[..]=`(a, i, j, x) - result = newNodeI(nkCall, n.info) - checkSonsLen(a, 2) - if a.sons[1].kind == nkRange: - checkSonsLen(a.sons[1], 2) - addSon(result, - newIdentNode(getIdent(whichSliceOpr(a.sons[1]) & '='), n.info)) + a = builtinFieldAccess(c, a, {efLValue}) + if a == nil: + return propertyWriteAccess(c, n, n[0]) + when false: + checkSonsLen(a, 2) + var id = considerAcc(a.sons[1]) + result = newNodeI(nkCall, n.info) + addSon(result, newIdentNode(getIdent(id.s & '='), n.info)) addSon(result, semExpr(c, a.sons[0])) - addSonIfNotNil(result, semExpr(c, a.sons[1].sons[0])) - addSonIfNotNil(result, semExpr(c, a.sons[1].sons[1])) - addSon(result, semExpr(c, n.sons[1])) - result = semDirectCallAnalyseEffects(c, result, {}) - if result != nil: - fixAbstractType(c, result) - analyseIfAddressTakenInCall(c, result) - return - else: - addSon(result, newIdentNode(getIdent("[]="), n.info)) - addSon(result, semExpr(c, a.sons[0])) - addSon(result, semExpr(c, a.sons[1])) addSon(result, semExpr(c, n.sons[1])) result = semDirectCallAnalyseEffects(c, result, {}) if result != nil: fixAbstractType(c, result) analyseIfAddressTakenInCall(c, result) return + of nkBracketExpr: + # a[i..j] = x + # --> `[..]=`(a, i, j, x) + a = semSubscript(c, a, {efLValue}) + if a == nil: + result = buildOverloadedSubscripts(n.sons[0], inAsgn=true) + add(result, n[1]) + return semExprNoType(c, result) else: - nil - n.sons[0] = semExprWithType(c, n.sons[0], {efLValue}) + a = semExprWithType(c, a, {efLValue}) + #n.sons[0] = semExprWithType(c, n.sons[0], {efLValue}) + n.sons[0] = a n.sons[1] = semExprWithType(c, n.sons[1]) - le = n.sons[0].typ - if (skipTypes(le, {tyGenericInst}).kind != tyVar) and - (IsAssignable(n.sons[0]) == arNone): + var le = a.typ + if skipTypes(le, {tyGenericInst}).kind != tyVar and IsAssignable(a) == arNone: # Direct assignment to a discriminant is allowed! - liMessage(n.sons[0].info, errXCannotBeAssignedTo, - renderTree(n.sons[0], {renderNoComments})) + liMessage(a.info, errXCannotBeAssignedTo, renderTree(a, {renderNoComments})) else: n.sons[1] = fitNode(c, le, n.sons[1]) fixAbstractType(c, n) @@ -255,8 +246,9 @@ proc SemReturn(c: PContext, n: PNode): PNode = restype = c.p.owner.typ.sons[0] if (restype != nil): a = newNodeI(nkAsgn, n.sons[0].info) - n.sons[0] = fitNode(c, restype, n.sons[0]) # optimize away ``return result``, because it would be transformed - # to ``result = result; return``: + n.sons[0] = fitNode(c, restype, n.sons[0]) + # optimize away ``return result``, because it would be transformed + # to ``result = result; return``: if (n.sons[0].kind == nkSym) and (sfResult in n.sons[0].sym.flags): n.sons[0] = nil else: @@ -499,12 +491,11 @@ proc SemTypeSection(c: PContext, n: PNode): PNode = var s: PSym t, body: PType - a: PNode result = n # process the symbols on the left side for the whole type section, before # we even look at the type definitions on the right for i in countup(0, sonsLen(n) - 1): - a = n.sons[i] + var a = n.sons[i] if a.kind == nkCommentStmt: continue if (a.kind != nkTypeDef): IllFormedAst(a) checkSonsLen(a, 3) @@ -522,7 +513,7 @@ proc SemTypeSection(c: PContext, n: PNode): PNode = addInterfaceDecl(c, s) a.sons[0] = newSymNode(s) for i in countup(0, sonsLen(n) - 1): - a = n.sons[i] + var a = n.sons[i] if a.kind == nkCommentStmt: continue if (a.kind != nkTypeDef): IllFormedAst(a) checkSonsLen(a, 3) @@ -558,7 +549,7 @@ proc SemTypeSection(c: PContext, n: PNode): PNode = s.ast = a popOwner() for i in countup(0, sonsLen(n) - 1): - a = n.sons[i] + var a = n.sons[i] if a.kind == nkCommentStmt: continue if (a.sons[0].kind != nkSym): IllFormedAst(a) s = a.sons[0].sym @@ -778,10 +769,8 @@ proc evalInclude(c: PContext, n: PNode): PNode = addSon(result, semStmt(c, gIncludeFile(f))) IntSetExcl(c.includedFiles, fileIndex) -proc semCommand(c: PContext, n: PNode): PNode = - result = semExpr(c, n) - if result.typ != nil and result.typ.kind != tyStmt: - liMessage(n.info, errDiscardValue) +proc semCommand(c: PContext, n: PNode): PNode = + result = semExprNoType(c, n) proc SemStmt(c: PContext, n: PNode): PNode = const # must be last statements in a block: diff --git a/tests/tmatrix.nim b/tests/tmatrix.nim new file mode 100644 index 000000000..a64ac0395 --- /dev/null +++ b/tests/tmatrix.nim @@ -0,0 +1,60 @@ +# Test overloading of [] with multiple indices + +type + TMatrix* = object + data: seq[float] + fWidth, fHeight: int + +template `|`(x, y: int): expr = y * m.fWidth + x + +proc createMatrix*(width, height: int): TMatrix = + result.fWidth = width + result.fHeight = height + newSeq(result.data, width*height) + +proc width*(m: TMatrix): int {.inline.} = return m.fWidth +proc height*(m: TMatrix): int {.inline.} = return m.fHeight + +proc `[,]`*(m: TMatrix, x, y: int): float {.inline.} = + result = m.data[x|y] + +proc `[,]=`*(m: var TMatrix, x, y: int, val: float) {.inline.} = + m.data[x|y] = val + +proc `[$..$, $..$]`*(m: TMatrix, a, b, c, d: int): TMatrix = + result = createMatrix(b-a+1, d-c+1) + for x in a..b: + for y in c..d: + result[x-a, y-c] = m[x, y] + +proc `[$..$, $..$]=`*(m: var TMatrix, a, b, c, d: int, val: float) = + for x in a..b: + for y in c..d: + m[x, y] = val + +proc `[$..$, $..$]=`*(m: var TMatrix, a, b, c, d: int, val: TMatrix) = + assert val.width == b-a+1 + assert val.height == d-c+1 + for x in a..b: + for y in c..d: + m[x, y] = val[x-a, y-c] + +proc `-|`*(m: TMatrix): TMatrix = + ## transposes a matrix + result = createMatrix(m.height, m.width) + for x in 0..m.width-1: + for y in 0..m.height-1: result[y,x] = m[x,y] + +#m.row(0, 2) # select row +#m.col(0, 89) # select column + +const + w = 3 + h = 20 + +var m = createMatrix(w, h) +for i in 0..w-1: + m[i, i] = 1.0 + +for i in 0..w-1: + stdout.write(m[i,i]) #OUT 1.01.01.0 diff --git a/web/news.txt b/web/news.txt index 36457803c..e89a9da51 100755 --- a/web/news.txt +++ b/web/news.txt @@ -2,6 +2,34 @@ News ==== +2010-XX-XX Version 0.8.8 released +================================= + +Bugfixes +-------- +- The Posix version of ``os.copyFile`` has better error handling. + + +Additions +--------- +- Added ``ropes`` module. +- Added ``sockets`` module. +- Added ``httpserver`` module. +- Many wrappers now do not contain redundant name prefixes (like ``GTK_``, + ``lua``). The new wrappers are available in ``lib/newwrap``. Change + your configuration file to use these. +- More extensive subscript operator overloading. See ``_ for further + information. + + +Changes affecting backwards compatibility +----------------------------------------- + +- Overloading of the subscript operator only works if the type does not provide + a built-in one. + + + 2009-12-21 Version 0.8.6 released ================================= |