Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | CHICKEN bindings for IUP configuration file support |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
46189b0ff51511091a99ee780e798fc5 |
User & Date: | murphy 2015-05-03 17:32:04.077 |
Context
2015-05-03
| ||
17:45 | Streamlined sections check-in: c2869d0d6d user: murphy tags: trunk | |
17:32 | CHICKEN bindings for IUP configuration file support check-in: 46189b0ff5 user: murphy tags: trunk | |
02:57 | Updated CHICKEN release information file check-in: d164df82c1 user: murphy tags: trunk | |
Changes
Added chicken/iup-config.scm.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | ;; -*- mode: Scheme; tab-width: 2; -*- ;; ;; {{{ Data types (foreign-declare "#include <iup.h>\n" "#include <iup_config.h>\n") (include "iup-types.scm") ;; }}} ;; {{{ Configuration component (define config (make-constructor-procedure (foreign-lambda nonnull-ihandle "IupConfig"))) ;; }}} ;; {{{ Configuration I/O (define (config-error location handle status) (let ([message (case status [(-1) "Error opening configuration file"] [(-2) "Error accessing configuration file"] [(-3) "Error locating configuration file"] [else "Error concerning configuration file"])]) (raise (make-composite-condition (make-property-condition 'exn 'message message 'arguments (list handle) 'location location) (make-property-condition 'i/o) (make-property-condition 'config 'status status))))) (define (config-load! handle) (let ([status ((foreign-lambda int "IupConfigLoad" nonnull-ihandle) handle)]) (unless (zero? status) (config-error 'config-load! handle status)))) (define (config-save! handle) (let ([status ((foreign-lambda int "IupConfigSave" nonnull-ihandle) handle)]) (unless (zero? status) (config-error 'config-save! handle status)))) ;; }}} ;; {{{ Configured Dialog Positions (define config-dialog-show (foreign-safe-lambda void "IupConfigDialogShow" nonnull-ihandle nonnull-ihandle nonnull-c-string)) (define config-dialog-update! (foreign-safe-lambda void "IupConfigDialogClosed" nonnull-ihandle nonnull-ihandle nonnull-c-string)) ;; }}} ;; {{{ Configured Recent Files (define-external (recent_callback_entry [ihandle handle]) istatus (let ([callback (cond [(and handle (parent handle)) => (cut callback <> 'action)])]) (if callback (callback handle) 'continue))) (define config-recent-menu (make-constructor-procedure (lambda (handle max-recent) (let ([menu (foreign-value "IupMenu(NULL)" nonnull-ihandle)]) ((foreign-lambda* void ([nonnull-ihandle handle] [nonnull-ihandle menu] [int max_recent]) "IupConfigRecentInit(handle, menu, recent_callback_entry, max_recent);") handle menu max-recent) menu)))) (define config-recent-update! (foreign-safe-lambda void "IupConfigRecentUpdate" nonnull-ihandle nonnull-c-string)) ;; }}} |
Changes to chicken/iup.meta.
1 2 3 4 5 6 7 | ;; -*- mode: Scheme; -*- ((category ui) (license "BSD") (author "Thomas Chust") (synopsis "Bindings to the IUP GUI library") (doc-from-wiki) (needs srfi-42) | | | 1 2 3 4 5 6 7 8 | ;; -*- mode: Scheme; -*- ((category ui) (license "BSD") (author "Thomas Chust") (synopsis "Bindings to the IUP GUI library") (doc-from-wiki) (needs srfi-42) (files "iup.scm" "iup-types.scm" "iup-base.scm" "iup-controls.scm" "iup-dialogs.scm" "iup-glcanvas.scm" "iup-glcontrols.scm" "iup-plot.scm" "iup-mglplot.scm" "iup-pplot.scm" "iup-scintilla.scm" "iup-web.scm" "iup-ole.scm" "iup-config.scm" "iup-dynamic.scm" "iup.setup" "iup.meta" "iup.release-info")) |
Changes to chicken/iup.scm.
︙ | ︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 | (ole-control) (import scheme chicken foreign iup-base) (include "iup-ole.scm"))] [else]) (module iup () (import scheme chicken) (reexport (except iup-base ihandle->pointer pointer->ihandle ihandle-list->pointer-vector istatus->integer integer->istatus | > > > > > > > > > > > > > | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | (ole-control) (import scheme chicken foreign iup-base) (include "iup-ole.scm"))] [else]) (cond-expand [disable-iup-config] [else (module iup-config (config config-load! config-save! config-recent-menu config-recent-update! config-dialog-show config-dialog-update!) (import scheme chicken foreign iup-base (only srfi-18 raise)) (include "iup-config.scm"))]) (module iup () (import scheme chicken) (reexport (except iup-base ihandle->pointer pointer->ihandle ihandle-list->pointer-vector istatus->integer integer->istatus |
︙ | ︙ |
Changes to chicken/iup.setup.
︙ | ︙ | |||
38 39 40 41 42 43 44 | '()] [else '(-j iup-web)]) ,@(cond-expand [enable-iup-ole '(-j iup-ole)] [else | | > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | '()] [else '(-j iup-web)]) ,@(cond-expand [enable-iup-ole '(-j iup-ole)] [else '()]) ,@(cond-expand [disable-iup-config '()] [else '(-j iup-config)]))) (define import-libraries `("iup.import.so" "iup-base.import.so" "iup-controls.import.so" "iup-dialogs.import.so" ,@(cond-expand [disable-iup-glcanvas '()] |
︙ | ︙ | |||
82 83 84 85 86 87 88 | '()] [else '("iup-web.import.so")]) ,@(cond-expand [enable-iup-ole '("iup-ole.import.so")] [else | | > > > > > | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | '()] [else '("iup-web.import.so")]) ,@(cond-expand [enable-iup-ole '("iup-ole.import.so")] [else '()]) ,@(cond-expand [disable-iup-config '()] [else '("iup-config.import.so")]))) (define native-libraries `("-lcallback" "-liup" "-liupim" "-liupimglib" "-liupcontrols" ,@(cond-expand [disable-iup-matrixex '()] |
︙ | ︙ | |||
172 173 174 175 176 177 178 179 180 181 182 | [disable-iup-web] [else (compile -s -O2 -d0 "iup-web.import.scm")]) (cond-expand [enable-iup-ole (compile -s -O2 -d0 "iup-ole.import.scm")] [else]) (install-extension 'iup `("iup.so" "iup.o" "iup-types.scm" ,@import-libraries) | > > > > | | | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | [disable-iup-web] [else (compile -s -O2 -d0 "iup-web.import.scm")]) (cond-expand [enable-iup-ole (compile -s -O2 -d0 "iup-ole.import.scm")] [else]) (cond-expand [disable-iup-config] [else (compile -s -O2 -d0 "iup-config.import.scm")]) (install-extension 'iup `("iup.so" "iup.o" "iup-types.scm" ,@import-libraries) `((version 1.6.0) (static "iup-base.o") (static-options ,(string-intersperse native-libraries)))) (compile -s -O2 -d1 "iup-dynamic.scm" -j iup-dynamic) (compile -c -O2 -d1 "iup-dynamic.scm" -j iup-dynamic -unit iup-dynamic) (compile -s -O2 -d0 "iup-dynamic.import.scm") (install-extension 'iup-dynamic '("iup-dynamic.so" "iup-dynamic.o" "iup-dynamic.import.so") '((version 1.6.0) (static "iup-dynamic.o"))) |