- ((progn
- (assert (and (>= col 0) (< col (table-columns table))))
- col) unsigned-int))
-
-
-(defun %set-table-child-option (object slot flag value)
- (let ((options (container-child-slot-value object slot)))
- (cond
- ((and value (not (member flag options)))
- (setf (container-child-slot-value object slot) (cons flag options)))
- ((and (not value) (member flag options))
- (setf
- (container-child-slot-value object slot) (delete flag options))))))
-
-(macrolet ((define-option-accessor (name slot flag)
- `(progn
- (defun ,name (object)
- (member ,flag (container-child-slot-value object ,slot)))
- (defun (setf ,name) (value object)
- (%set-table-child-option object ,slot ,flag value)))))
- (define-option-accessor table-child-x-expand-p :x-options :expand)
- (define-option-accessor table-child-y-expand-p :y-options :expand)
- (define-option-accessor table-child-x-shrink-p :x-options :shrink)
- (define-option-accessor table-child-y-shrink-p :y-options :shrink)
- (define-option-accessor table-child-x-fill-p :x-options :fill)
- (define-option-accessor table-child-y-fill-p :y-options :fill))
-
-
-
-;;; Toolbar
-
-(define-foreign toolbar-new () toolbar
- (orientation orientation)
- (style toolbar-style))
-
-;; gtkglue.c
-(define-foreign toolbar-num-children () int
- (toolbar toolbar))
-
-(defun %toolbar-position-num (toolbar position)
- (case position
- (:prepend 0)
- (:append (toolbar-num-children toolbar))
- (t
- (assert (and (>= position 0) (< position (toolbar-num-children toolbar))))
- position)))
-
-(define-foreign %toolbar-insert-element () widget
- (toolbar toolbar)
- (type toolbar-child-type)
- (widget (or null widget))
- (text string)
- (tooltip-text string)
- (tooltip-private-text string)
- (icon (or null widget))
- (nil null)
- (nil null)
- (position int))
-
-(defun toolbar-insert-element (toolbar position
- &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (let* ((icon-widget (typecase icon
- ((or null widget) icon)
- (t (pixmap-new icon))))
- (toolbar-child
- (%toolbar-insert-element
- toolbar (or type (and widget :widget) :button)
- widget text tooltip-text tooltip-private-text icon-widget
- (%toolbar-position-num toolbar position))))
- (when callback
- (signal-connect toolbar-child 'clicked callback))
- toolbar-child))
-
-(defun toolbar-append-element (toolbar &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (toolbar-insert-element
- toolbar :append :type type :widget widget :icon icon :text text
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
- :callback callback))
-
-(defun toolbar-prepend-element (toolbar &key tooltip-text tooltip-private-text
- type widget icon text callback)
- (toolbar-insert-element
- toolbar :prepend :type type :widget widget :icon icon :text text
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text
- :callback callback))
-
-(defun toolbar-insert-space (toolbar position)
- (toolbar-insert-element toolbar position :type :space))
-
-(defun toolbar-append-space (toolbar)
- (toolbar-insert-space toolbar :append))
-
-(defun toolbar-prepend-space (toolbar)
- (toolbar-insert-space toolbar :prepend))
-
-(defun toolbar-insert-widget (toolbar widget position &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-element
- toolbar position :widget widget :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-append-widget (toolbar widget &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-widget
- toolbar widget :append :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-prepend-widget (toolbar widget &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-widget
- toolbar widget :prepend :tooltip-text tooltip-text
- :tooltip-private-text tooltip-private-text :callback callback))
-
-(defun toolbar-insert-item (toolbar text icon position &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-element
- toolbar position :text text :icon icon :callback callback
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text))
-
-(defun toolbar-append-item (toolbar text icon &key tooltip-text
- tooltip-private-text callback)
- (toolbar-insert-item
- toolbar text icon :append :callback callback
- :tooltip-text tooltip-text :tooltip-private-text tooltip-private-text))