Scheme gtk-server wrapper

A gtk-server wrapper for mzscheme.

Repository URL: http://sc-gtk-server.sourceforge.net/darcs/sc-gtk-server

Darcs command: $ darcs get http://sc-gtk-server.sourceforge.net/darcs/sc-gtk-server

Show:


File: /constants.ss

 
;; stolen from edw in #scheme
(define-syntax define-enum
  (syntax-rules ()
    ((define-enum E1 E2 ...)
     (define-enum-helper 0 E1 E2 ...))
    ((define-enum)
     (begin))))
 
(define-syntax define-enum-helper
  (syntax-rules ()
    ((define-enum-helper VALUE E)
     (define E VALUE))
    ((define-enum-helper VALUE E1 E2 ...)
     (begin (define E1 VALUE)
            (define-enum-helper (+ VALUE 1) E2 ...)))))
 
;; GtkMessageDialog constants
(define-enum
  +GTK-MESSAGE-INFO+
  +GTK-MESSAGE-WARNING+
  +GTK-MESSAGE-QUESTION+
  +GTK-MESSAGE-ERROR+)
 
(define-enum
  +GTK-BUTTONS-NONE+
  +GTK-BUTTONS-OK+
  +GTK-BUTTONS-CLOSE+
  +GTK-BUTTONS-CANCEL+
  +GTK-BUTTONS-YES-NO+
  +GTK-BUTTONS-OK-CANCEL+)
 
;; GtkTreeSelection constants
(define-enum
  +GTK-SELECTION-NONE+                           
  +GTK-SELECTION-SINGLE+
  +GTK-SELECTION-BROWSE+
  +GTK-SELECTION-MULTIPLE+)
 
;; GtkTreeView constants
(define-enum
  +GTK-TREE-VIEW-COLUMN-GROW-ONLY+
  +GTK-TREE-VIEW-COLUMN-AUTOSIZE+
  +GTK-TREE-VIEW-COLUMN-FIXED+)
 
 
 
(define +GTK-SELECTION-EXTENDED+ +GTK-SELECTION-MULTIPLE+)
 
;; Some G-types
(define +G-TYPE-STRING+ 64)
 
;; Gtk Response constants
(define +GTK-RESPONSE-NONE+ -1)
(define +GTK-RESPONSE-REJECT+ -2)
(define +GTK-RESPONSE-ACCEPT+ -3)
(define +GTK-RESPONSE-DELETE-EVENT+ -4)
(define +GTK-RESPONSE-OK+ -5)
(define +GTK-RESPONSE-CANCEL+ -6)  
(define +GTK-RESPONSE-CLOSE+ -7)
(define +GTK-RESPONSE-YES+ -8)
(define +GTK-RESPONSE-NO+ -9)
(define +GTK-RESPONSE-APPLY+ -10)
(define +GTK-RESPONSE-HELP+ -11)
 
;; GtkDialog constants
(define +GTK-DIALOG-MODAL+ 1)
(define +GTK-DIALOG-DESTROY-WITH-PARENT+ 2)
(define +GTK-DIALOG-NO-SEPARATOR+ 4)
 
;; GtkFileChooser constants
(define-enum
  +GTK-FILE-CHOOSER-ACTION-OPEN+
  +GTK-FILE-CHOOSER-ACTION-SAVE+
  +GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER+
  +GTK-FILE-CHOOSER-ACTION-CREATE-FOLDER+)