more fixes for dy(n)lib typo; fixes #15
This commit is contained in:
parent
fa332b7298
commit
62b4cc6c02
17 changed files with 140 additions and 101 deletions
|
|
@ -412,7 +412,7 @@ proc ipart(x: float): float = return x.trunc()
|
|||
proc fpart(x: float): float = return x - ipart(x)
|
||||
proc rfpart(x: float): float = return 1.0 - fpart(x)
|
||||
|
||||
proc drawLineAA(sur: PSurface, p1, p2: TPoint, color: TColor) =
|
||||
proc drawLineAA*(sur: PSurface, p1, p2: TPoint, color: TColor) =
|
||||
## Draws a anti-aliased line from ``p1`` to ``p2``, using Xiaolin Wu's
|
||||
## line algorithm
|
||||
var (x1, x2, y1, y2) = (p1.x.toFloat(), p2.x.toFloat(),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ const
|
|||
DocumentFragmentNode* = 11
|
||||
|
||||
# Nodes which are childless - Not sure about AttributeNode
|
||||
childlessObjects = {DocumentNode, AttributeNode, TextNode, CDataSectionNode, ProcessingInstructionNode, CommentNode}
|
||||
childlessObjects = {DocumentNode, AttributeNode, TextNode,
|
||||
CDataSectionNode, ProcessingInstructionNode, CommentNode}
|
||||
# Illegal characters
|
||||
illegalChars = {'>', '<', '&', '"'}
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ type
|
|||
Element = object of Node
|
||||
FTagName: string # Read-only
|
||||
|
||||
PCharacterData = ref CharacterData
|
||||
PCharacterData* = ref CharacterData
|
||||
CharacterData = object of Node
|
||||
data*: string
|
||||
|
||||
|
|
@ -109,10 +110,10 @@ type
|
|||
# DOMImplementation
|
||||
proc getDOM*(): PDOMImplementation =
|
||||
## Returns a DOMImplementation
|
||||
var DOMImpl: PDOMImplementation
|
||||
new(DOMImpl)
|
||||
DOMImpl.Features = @[(name: "core", version: "2.0"), (name: "core", version: "1.0"), (name: "XML", version: "2.0")]
|
||||
return DOMImpl
|
||||
new(result)
|
||||
result.Features = @[(name: "core", version: "2.0"),
|
||||
(name: "core", version: "1.0"),
|
||||
(name: "XML", version: "2.0")]
|
||||
|
||||
proc createDocument*(dom: PDOMImplementation, namespaceURI: string, qualifiedName: string): PDocument =
|
||||
## Creates an XML Document object of the specified type with its document element.
|
||||
|
|
|
|||
|
|
@ -22741,144 +22741,144 @@ proc AnsiLowerBuff*(lpsz: LPSTR, cchLength: DWORD): DWORD{.stdcall,
|
|||
|
||||
# WinBase.h
|
||||
|
||||
proc FreeModule(h: HINST): WINBOOL =
|
||||
proc FreeModule*(h: HINST): WINBOOL =
|
||||
result = FreeLibrary(h)
|
||||
|
||||
proc MakeProcInstance(p, i: pointer): pointer =
|
||||
proc MakeProcInstance*(p, i: pointer): pointer =
|
||||
result = p
|
||||
|
||||
proc FreeProcInstance(p: pointer): pointer =
|
||||
proc FreeProcInstance*(p: pointer): pointer =
|
||||
result = p
|
||||
|
||||
proc GlobalDiscard(hglbMem: HGLOBAL): HGLOBAL =
|
||||
proc GlobalDiscard*(hglbMem: HGLOBAL): HGLOBAL =
|
||||
result = GlobalReAlloc(hglbMem, 0, GMEM_MOVEABLE)
|
||||
|
||||
proc LocalDiscard(hlocMem: HLOCAL): HLOCAL =
|
||||
proc LocalDiscard*(hlocMem: HLOCAL): HLOCAL =
|
||||
result = LocalReAlloc(hlocMem, 0, LMEM_MOVEABLE)
|
||||
|
||||
# WinGDI.h
|
||||
|
||||
proc GetGValue(rgb: int32): int8 =
|
||||
proc GetGValue*(rgb: int32): int8 =
|
||||
result = toU8(rgb shr 8'i32)
|
||||
proc RGB(r, g, b: int): COLORREF =
|
||||
proc RGB*(r, g, b: int): COLORREF =
|
||||
result = toU32(r) or (toU32(g) shl 8) or (toU32(b) shl 16)
|
||||
proc RGB(r, g, b: range[0 .. 255]): COLORREF =
|
||||
proc RGB*(r, g, b: range[0 .. 255]): COLORREF =
|
||||
result = r or g shl 8 or b shl 16
|
||||
|
||||
proc PALETTERGB(r, g, b: range[0..255]): COLORREF =
|
||||
proc PALETTERGB*(r, g, b: range[0..255]): COLORREF =
|
||||
result = 0x02000000 or RGB(r, g, b)
|
||||
|
||||
proc PALETTEINDEX(i: DWORD): COLORREF =
|
||||
proc PALETTEINDEX*(i: DWORD): COLORREF =
|
||||
result = COLORREF(0x01000000'i32 or i and 0xffff'i32)
|
||||
|
||||
|
||||
proc GetRValue(rgb: COLORREF): int8 =
|
||||
proc GetRValue*(rgb: COLORREF): int8 =
|
||||
result = toU8(rgb)
|
||||
|
||||
proc GetGValue(rgb: COLORREF): int8 =
|
||||
proc GetGValue*(rgb: COLORREF): int8 =
|
||||
result = toU8(rgb shr 8)
|
||||
|
||||
proc GetBValue(rgb: COLORREF): int8 =
|
||||
proc GetBValue*(rgb: COLORREF): int8 =
|
||||
result = toU8(rgb shr 16)
|
||||
|
||||
#
|
||||
|
||||
proc HIBYTE(w: int32): int8 =
|
||||
proc HIBYTE*(w: int32): int8 =
|
||||
result = toU8(w shr 8'i32 and 0x000000FF'i32)
|
||||
|
||||
proc HIWORD(L: int32): int16 =
|
||||
proc HIWORD*(L: int32): int16 =
|
||||
result = toU16(L shr 16'i32 and 0x0000FFFF'i32)
|
||||
|
||||
proc LOBYTE(w: int32): int8 =
|
||||
proc LOBYTE*(w: int32): int8 =
|
||||
result = toU8(w)
|
||||
|
||||
proc LOWORD(L: int32): int16 =
|
||||
proc LOWORD*(L: int32): int16 =
|
||||
result = toU16(L)
|
||||
|
||||
proc MAKELONG(a, b: int32): LONG =
|
||||
proc MAKELONG*(a, b: int32): LONG =
|
||||
result = a and 0x0000ffff'i32 or b shl 16'i32
|
||||
|
||||
proc MAKEWORD(a, b: int32): int16 =
|
||||
proc MAKEWORD*(a, b: int32): int16 =
|
||||
result = toU16(a and 0xff'i32) or toU16(b shl 8'i32)
|
||||
|
||||
proc SEXT_HIWORD(L: int32): int32 =
|
||||
proc SEXT_HIWORD*(L: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = HIWORD(L)
|
||||
|
||||
proc ZEXT_HIWORD(L: int32): int32 =
|
||||
proc ZEXT_HIWORD*(L: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = ze(HIWORD(L))
|
||||
|
||||
proc SEXT_LOWORD(L: int32): int32 =
|
||||
proc SEXT_LOWORD*(L: int32): int32 =
|
||||
result = LOWORD(L)
|
||||
|
||||
proc INDEXTOOVERLAYMASK(i: int32): int32 =
|
||||
proc INDEXTOOVERLAYMASK*(i: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = i shl 8'i32
|
||||
|
||||
proc INDEXTOSTATEIMAGEMASK(i: int32): int32 =
|
||||
proc INDEXTOSTATEIMAGEMASK*(i: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = i shl 12'i32
|
||||
|
||||
proc MAKEINTATOM(i: int32): LPTSTR =
|
||||
proc MAKEINTATOM*(i: int32): LPTSTR =
|
||||
result = cast[LPTSTR](cast[ULONG_PTR](ToU16(i)))
|
||||
|
||||
proc MAKELANGID(p, s: int32): int32 =
|
||||
proc MAKELANGID*(p, s: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = toU16(s) shl 10'i16 or toU16(p)
|
||||
|
||||
proc PRIMARYLANGID(lgid: int32): int16 =
|
||||
proc PRIMARYLANGID*(lgid: int32): int16 =
|
||||
result = toU16(lgid) and 0x000003FF'i16
|
||||
|
||||
proc SUBLANGID(lgid: int32): int32 =
|
||||
proc SUBLANGID*(lgid: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = toU16(lgid) shr 10'i16
|
||||
|
||||
proc LANGIDFROMLCID(lcid: int32): int16 =
|
||||
proc LANGIDFROMLCID*(lcid: int32): int16 =
|
||||
result = toU16(lcid)
|
||||
|
||||
proc SORTIDFROMLCID(lcid: int32): int16 =
|
||||
proc SORTIDFROMLCID*(lcid: int32): int16 =
|
||||
result = toU16((lcid and 0x000FFFFF'i32) shr 16'i32)
|
||||
|
||||
proc MAKELCID(lgid, srtid: int32): DWORD =
|
||||
proc MAKELCID*(lgid, srtid: int32): DWORD =
|
||||
result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32)
|
||||
|
||||
proc MAKELPARAM(L, h: int32): LPARAM =
|
||||
proc MAKELPARAM*(L, h: int32): LPARAM =
|
||||
result = LPARAM(MAKELONG(L, h))
|
||||
|
||||
proc MAKELRESULT(L, h: int32): LRESULT =
|
||||
proc MAKELRESULT*(L, h: int32): LRESULT =
|
||||
result = LRESULT(MAKELONG(L, h))
|
||||
|
||||
proc MAKEROP4(fore, back: int32): DWORD =
|
||||
proc MAKEROP4*(fore, back: int32): DWORD =
|
||||
result = back shl 8'i32 and 0xFF000000'i32 or fore
|
||||
|
||||
proc MAKEWPARAM(L, h: int32): WPARAM =
|
||||
proc MAKEWPARAM*(L, h: int32): WPARAM =
|
||||
result = WPARAM(MAKELONG(L, h))
|
||||
|
||||
proc GET_X_LPARAM(lp: Windows.LParam): int32 =
|
||||
proc GET_X_LPARAM*(lp: Windows.LParam): int32 =
|
||||
result = int16(LOWORD(lp))
|
||||
|
||||
proc GET_Y_LPARAM(lp: Windows.LParam): int32 =
|
||||
proc GET_Y_LPARAM*(lp: Windows.LParam): int32 =
|
||||
result = int16(HIWORD(lp))
|
||||
|
||||
proc UNICODE_NULL(): WCHAR =
|
||||
proc UNICODE_NULL*(): WCHAR =
|
||||
result = 0'i16
|
||||
|
||||
|
||||
|
||||
proc GetFirstChild(h: HWND): HWND =
|
||||
proc GetFirstChild*(h: HWND): HWND =
|
||||
result = GetTopWindow(h)
|
||||
|
||||
proc GetNextSibling(h: HWND): HWND =
|
||||
proc GetNextSibling*(h: HWND): HWND =
|
||||
result = GetWindow(h, GW_HWNDNEXT)
|
||||
|
||||
proc GetWindowID(h: HWND): int32 =
|
||||
proc GetWindowID*(h: HWND): int32 =
|
||||
result = GetDlgCtrlID(h)
|
||||
|
||||
proc SubclassWindow(h: HWND, p: LONG): LONG =
|
||||
proc SubclassWindow*(h: HWND, p: LONG): LONG =
|
||||
result = SetWindowLong(h, GWL_WNDPROC, p)
|
||||
|
||||
proc GET_WM_COMMAND_CMD(w, L: int32): int32 =
|
||||
proc GET_WM_COMMAND_CMD*(w, L: int32): int32 =
|
||||
# return type might be wrong
|
||||
result = HIWORD(w)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,12 @@
|
|||
#
|
||||
|
||||
when defined(windows):
|
||||
const
|
||||
LIB_CAIRO* = "libcairo-2.dll"
|
||||
const LIB_CAIRO* = "libcairo-2.dll"
|
||||
elif defined(macosx):
|
||||
const LIB_CAIRO* = "libcairo.dylib"
|
||||
else:
|
||||
const
|
||||
LIB_CAIRO* = "libcairo.so"
|
||||
const LIB_CAIRO* = "libcairo.so"
|
||||
|
||||
type
|
||||
PByte = cstring
|
||||
TStatus* = enum
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import
|
|||
when defined(windows):
|
||||
const
|
||||
lib = "libatk-1.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
lib = "libatk-1.0.dylib"
|
||||
else:
|
||||
const
|
||||
lib = "libatk-1.0.so"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import
|
|||
when defined(win32):
|
||||
const
|
||||
lib = "libgdk-win32-2.0-0.dll"
|
||||
elif defined(darwin):
|
||||
elif defined(macosx):
|
||||
# linklib gtk-x11-2.0
|
||||
# linklib gdk-x11-2.0
|
||||
# linklib pango-1.0.0
|
||||
|
|
@ -14,7 +14,7 @@ elif defined(darwin):
|
|||
# linklib gdk_pixbuf-2.0.0
|
||||
# linklib atk-1.0.0
|
||||
const
|
||||
lib = "gdk-x11-2.0"
|
||||
lib = "libgdk-x11-2.0.dylib"
|
||||
else:
|
||||
const
|
||||
lib = "libgdk-x11-2.0.so(|.0)"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import
|
|||
when defined(win32):
|
||||
const
|
||||
pixbuflib = "libgdk_pixbuf-2.0-0.dll"
|
||||
elif defined(darwin):
|
||||
elif defined(macosx):
|
||||
const
|
||||
pixbuflib = "gdk_pixbuf-2.0.0"
|
||||
pixbuflib = "libgdk_pixbuf-2.0.0.dylib"
|
||||
# linklib gtk-x11-2.0
|
||||
# linklib gdk-x11-2.0
|
||||
# linklib pango-1.0.0
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import
|
|||
when defined(WIN32):
|
||||
const
|
||||
GLExtLib = "libgdkglext-win32-1.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
GLExtLib = "libgdkglext-x11-1.0.dylib"
|
||||
else:
|
||||
const
|
||||
GLExtLib = "libgdkglext-x11-1.0.so"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ when defined(windows):
|
|||
gliblib = "libglib-2.0-0.dll"
|
||||
gmodulelib = "libgmodule-2.0-0.dll"
|
||||
gobjectlib = "libgobject-2.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
gliblib = "libglib-2.0.dylib"
|
||||
gmodulelib = "libgmodule-2.0.dylib"
|
||||
gobjectlib = "libgobject-2.0.dylib"
|
||||
else:
|
||||
const
|
||||
gliblib = "libglib-2.0.so(|.0)"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import
|
|||
when defined(win32):
|
||||
const
|
||||
lib = "libgtk-win32-2.0-0.dll"
|
||||
elif defined(darwin):
|
||||
elif defined(macosx):
|
||||
const
|
||||
lib = "gtk-x11-2.0"
|
||||
lib = "libgtk-x11-2.0.dylib"
|
||||
# linklib gtk-x11-2.0
|
||||
# linklib gdk-x11-2.0
|
||||
# linklib pango-1.0.0
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@
|
|||
import
|
||||
Glib2, Gdk2, gtk2, GdkGLExt
|
||||
|
||||
const
|
||||
GLExtLib* = if defined(WIN32): "libgtkglext-win32-1.0-0.dll" else: "libgtkglext-x11-1.0.so"
|
||||
when defined(windows):
|
||||
const
|
||||
GLExtLib* = "libgtkglext-win32-1.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
GLExtLib* = "libgtkglext-x11-1.0.dylib"
|
||||
else:
|
||||
const
|
||||
GLExtLib* = "libgtkglext-x11-1.0.so"
|
||||
|
||||
const
|
||||
HEADER_GTKGLEXT_MAJOR_VERSION* = 1
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ import
|
|||
gtk2, glib2, atk, pango, gdk2pixbuf, gdk2
|
||||
|
||||
when defined(windows):
|
||||
{.define: WINDOWING_WIN32.}
|
||||
const
|
||||
htmllib = "libgtkhtml-win32-2.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
htmllib = "libgtkhtml-2.dylib"
|
||||
else:
|
||||
const
|
||||
htmllib = "libgtkhtml-2.so"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import
|
|||
when defined(win32):
|
||||
const
|
||||
LibGladeLib = "libglade-2.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
LibGladeLib = "libglade-2.0.dylib"
|
||||
else:
|
||||
const
|
||||
LibGladeLib = "libglade-2.0.so"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import
|
|||
when defined(win32):
|
||||
const
|
||||
lib* = "libpango-1.0-0.dll"
|
||||
elif defined(macosx):
|
||||
const
|
||||
lib* = "libpango-1.0.dylib"
|
||||
else:
|
||||
const
|
||||
lib* = "libpango-1.0.so.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue