win64: racket/draw and racket/gui

This commit is contained in:
Matthew Flatt 2010-12-04 08:28:53 -07:00
parent c9e1bb2c46
commit a56e547db6
12 changed files with 75 additions and 19 deletions

View File

@ -150,7 +150,7 @@
(set! items (append items (list i)))
(if submenu
(AppendMenuW hmenu (bitwise-ior MF_POPUP MF_STRING) (send submenu get-hmenu) label)
(AppendMenuW hmenu (bitwise-ior MF_STRING) (cast id _long _pointer) label)))))))
(AppendMenuW hmenu (bitwise-ior MF_STRING) (cast id _intptr _pointer) label)))))))
(define/public (append-separator)
(atomically

View File

@ -65,7 +65,7 @@
(define (message-dequeue es hwnd)
;; Called in the eventspace for hwnd:
(let ([t (eventspace-extra-table es)]
[id (cast hwnd _HWND _long)])
[id (cast hwnd _HWND _intptr)])
(atomically (hash-remove! t id))
(let ([msg (malloc-msg)])
(let loop ()
@ -90,7 +90,7 @@
(define (queue-message-dequeue es hwnd)
;; in atomic mode
(let ([t (eventspace-extra-table es)]
[id (cast hwnd _HWND _long)])
[id (cast hwnd _HWND _intptr)])
(unless (hash-ref t id #f)
(hash-set! t id #t)
(queue-event es (lambda () (message-dequeue es hwnd))))))

View File

@ -50,21 +50,25 @@
MAKELONG
MAKELPARAM))
(define win64? (equal? "win32\\x86_64" (path->string (system-library-subpath #f))))
(define win_abi (if win64? #f 'stdcall))
(define-syntax-rule (_wfun . a)
(_fun #:abi 'stdcall . a))
(_fun #:abi win_abi . a))
(define _WORD _int16)
(define _DWORD _int32)
(define _UDWORD _uint32)
(define _ATOM _int)
(define _WPARAM _long)
(define _LPARAM _long)
(define _LRESULT _long)
(define _UINT_PTR _uintptr)
(define _WPARAM _intptr) ; supposed to be _UINT_PTR, but we have some sign mismatch
(define _LONG_PTR _intptr)
(define _LPARAM _LONG_PTR)
(define _LRESULT _LONG_PTR)
(define _BOOL (make-ctype _int (lambda (v) (if v 1 0)) (lambda (v) (not (zero? v)))))
(define _UINT _uint)
(define _UINT_PTR _ulong)
(define _BYTE _uint8)
(define _HRESULT _int32)
(define _HRESULT _long)
(define _WCHAR _int16)
(define _SIZE_T _long)
(define _INT_PTR _intptr)

View File

@ -35,7 +35,7 @@
;; call in atomic mode:
(define (register-hwnd! hwnd)
(hash-set! all-hwnds (cast hwnd _pointer _long) #t)
(hash-set! all-hwnds (cast hwnd _pointer _intptr) #t)
(let ([c (malloc-immobile-cell (vector #f #f #f))])
(void (SetWindowLongW hwnd GWLP_USERDATA c))))
@ -60,7 +60,7 @@
(define (any-hwnd->wx hwnd)
(and
(atomically (hash-ref all-hwnds (cast hwnd _pointer _long) #f))
(atomically (hash-ref all-hwnds (cast hwnd _pointer _intptr) #f))
(let ([wx (hwnd->wx hwnd)])
(and wx
(send wx is-hwnd? hwnd)
@ -78,7 +78,7 @@
;; call in atomic mode:
(define (can-unregister-hwnd? hwnd)
(hash-ref all-hwnds (cast hwnd _pointer _long) #f))
(hash-ref all-hwnds (cast hwnd _pointer _intptr) #f))
;; call in atomic mode:
(define (unregister-hwnd! hwnd)
@ -86,7 +86,7 @@
(when c
(free-immobile-cell c)
(SetWindowLongW hwnd GWLP_USERDATA #f))
(hash-remove! all-hwnds (cast hwnd _pointer _long))))
(hash-remove! all-hwnds (cast hwnd _pointer _intptr))))
;; ----------------------------------------

View File

@ -3,7 +3,18 @@
racket/runtime-path
(for-syntax racket/base))
(provide define-runtime-lib)
(provide define-runtime-lib
win64?
(for-syntax win64?))
(define win64?
(and (eq? 'windows (system-type))
(equal? "win32\\x86_64"
(path->string (system-library-subpath #f)))))
(define-for-syntax win64?
(and (eq? 'windows (system-type))
(equal? "win32\\x86_64"
(path->string (system-library-subpath #f)))))
(define-syntax define-runtime-lib
(syntax-rules (macosx unix windows ffi-lib)

View File

@ -14,9 +14,14 @@
(ffi-lib "libcairo.2.dylib")]
[(windows)
(ffi-lib "zlib1.dll")
(ffi-lib ,(if win64?
"libintl-8.dll"
"zlib1.dll"))
(ffi-lib "libpng14-14.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "freetype6.dll")
(ffi-lib ,(if win64?
"libfreetype-6.dll"
"freetype6.dll"))
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libcairo-2.dll")])

View File

@ -18,6 +18,9 @@
[(macosx)
(ffi-lib "libgmodule-2.0.0.dylib")]
[(windows)
(ffi-lib ,(if win64?
"libgthread-2.0-0.dll"
"libgmodule-2.0-0.dll"))
(ffi-lib "libgmodule-2.0-0.dll")])
(define-runtime-lib gobj-lib

View File

@ -342,7 +342,7 @@
[jpeg_color_space _J_COLOR_SPACE]
[comp_info _pointer]
[quant_tbl _quant_tbl_t]
[dc_huff_tbl_ptrs_1 _pointer]

View File

@ -28,9 +28,14 @@
[(macosx)
(ffi-lib "libpangocairo-1.0.0.dylib")]
[(windows)
(ffi-lib ,(if win64?
"libintl-8.dll"
"libpangowin32-1.0-0.dll"))
(ffi-lib "libpangowin32-1.0-0.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "freetype6.dll")
(ffi-lib ,(if win64?
"libfreetype-6.dll"
"freetype6.dll"))
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libpangoft2-1.0-0.dll")
(ffi-lib "libpangocairo-1.0-0.dll")])

View File

@ -20,7 +20,11 @@
[win32/i386
["iconv.dll" 892928]
["libeay32.dll" 1089536]
["ssleay32.dll" 237568]]]
["ssleay32.dll" 237568]]
[win32/x86_64
["libiconv-2.dll" 1378028]
["libeay32.dll" 1293824]
["ssleay32.dll" 260608]]]
;; GUI Libraries
[gui
[i386-macosx
@ -90,7 +94,25 @@
["libgio-2.0-0.dll" 669318]
["libwimp.dll" 69632]
["gtkrc" 1181])
'())]]))
'())]
[win32/x86_64
["libjpeg-7.dll" 224768]
["libcairo-2.dll" 1266147]
["libpango-1.0-0.dll" 423199]
["libexpat-1.dll" 263006]
["libpng14-14.dll" 272473]
["zlib1.dll" 191825]
["libfreetype-6.dll" 633649]
["libintl-8.dll" 240862]
["libfontconfig-1.dll" 339943]
["libglib-2.0-0.dll" 1267577]
["libgobject-2.0-0.dll" 425888]
["libgmodule-2.0-0.dll" 119538]
["libpangocairo-1.0-0.dll" 185168]
["libpangowin32-1.0-0.dll" 192656]
["libpangoft2-1.0-0.dll" 1188615]
["libplplot.dll" 248832]
["libfit.dll" 69120]]]))
(define-values [package dest-dir]
(command-line #:args [package [dest-dir (current-directory)]]

2
src/plot/build.bat Normal file
View File

@ -0,0 +1,2 @@
..\..\racket build.rkt libplplot plplot/dc_drv.c plplot/plcont.c plplot/plfill.c plplot/plmap.c plplot/plshade.c plplot/plwind.c plplot/pdfutils.c plplot/plcore.c plplot/plgridd.c plplot/plmeta.c plplot/plstripc.c plplot/plargs.c plplot/plctrl.c plplot/plhist.c plplot/plot3d.c plplot/plsym.c plplot/plbox.c plplot/plcvt.c plplot/plimage.c plplot/plpage.c plplot/pltick.c plplot/plbuf.c plplot/pldtik.c plplot/plline.c plplot/plsdef.c plplot/plvpor.c
..\..\racket build.rkt libfit fit/fit.c fit/matrix.c

View File

@ -89,10 +89,14 @@ static void init_iconv()
m = LoadLibraryW(scheme_get_dll_path(L"iconv.dll"));
if (!m)
m = LoadLibraryW(scheme_get_dll_path(L"libiconv.dll"));
if (!m)
m = LoadLibraryW(scheme_get_dll_path(L"libiconv-2.dll"));
if (!m)
m = LoadLibrary("iconv.dll");
if (!m)
m = LoadLibrary("libiconv.dll");
if (!m)
m = LoadLibrary("libiconv-2.dll");
if (m) {
iconv = (iconv_proc_t)GetProcAddress(m, "libiconv");
iconv_open = (iconv_open_proc_t)GetProcAddress(m, "libiconv_open");