1 ;; Common Lisp bindings for GTK+ v2.0.x
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <esj@stud.cs.uit.no>
4 ;; This library is free software; you can redistribute it and/or
5 ;; modify it under the terms of the GNU Lesser General Public
6 ;; License as published by the Free Software Foundation; either
7 ;; version 2 of the License, or (at your option) any later version.
9 ;; This library is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;; Lesser General Public License for more details.
14 ;; You should have received a copy of the GNU Lesser General Public
15 ;; License along with this library; if not, write to the Free Software
16 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ;; $Id: gtktypes.lisp,v 1.7 2001-05-29 15:56:58 espen Exp $
23 (defclass requisition (boxed)
26 :accessor requisition-width
31 :accessor requisition-height
34 (:metaclass boxed-class)
35 (:alien-name "GtkRequisition"))
37 (defclass border (boxed)
45 :accessor border-right
55 :accessor border-bottom
58 (:metaclass boxed-class)
59 (:alien-name "GtkBorder"))
61 (defclass adjustment (%object)
64 :accessor adjustment-lower
69 :accessor adjustment-upper
74 :accessor adjustment-value
79 :accessor adjustment-step-increment
80 :initarg :step-increment
84 :accessor adjustment-page-increment
85 :initarg :page-increment
89 :accessor adjustment-page-size
92 (:metaclass gobject-class)
93 (:alien-name "GtkAdjustment"))
96 (define-types-by-introspection "Gtk"
98 ("GtkObject" :ignore t)
99 ("GtkRequisition" :ignore t)
100 ("GtkBorder" :ignore t)
101 ("GtkAdjustment" :ignore t)
103 ;; Temporary disabled
104 ("GtkCellRenderer" :ignore-prefix t)
109 ("GtkFundamentalType" :ignore t)
110 ("GtkArgFlags" :ignore t)
113 ("GtkCList" :ignore-prefix t)
114 ("GtkCTree" :ignore-prefix t)
115 ("GtkList" :ignore t)
116 ("GtkTree" :ignore t)
117 ("GtkTreeItem" :ignore t)
118 ("GtkText" :ignore-prefix t)
119 ("GtkPacker" :ignore-prefix t)
120 ("GtkPixmap" :ignore t)
121 ("GtkPreview" :ignore-prefix t)
122 ("GtkTipsQuery" :ignore t)
123 ("GtkOldEditable" :ignore t))
128 (deftype color-type ()
141 (defclass style (gobject)
144 :location style-white
149 :location style-black
154 :location ("gtk_style_get_font" "gtk_style_set_font")
158 (:metaclass gobject-class)
159 (:alien-name "GtkStyle"))
162 ;(deftype accel-entry () 'pointer) ; internal?
166 (defclass tooltips (%object)
169 :location ("gtk_tooltips_get_delay" "gtk_tooltips_set_delay")
170 :accessor tooltips-delay
174 :location ("gtk_tooltips_get_enabled" (setf tooltips-enabled-p))
175 :reader tooltips-enabled-p
178 (:metaclass object-class)
179 (:alien-name "GtkTooltips"))
182 (defclass widget (object)
184 :allocation :instance
185 :accessor widget-child-slots
186 :type container-child)
189 :location ("gtk_widget_get_state" "gtk_widget_set_state")
190 :accessor widget-state
195 :location "gtk_widget_get_window"
196 :reader widget-window
200 :location "gtk_widget_get_colormap"
201 :reader widget-colormap
205 :location "gtk_widget_get_visual"
206 :reader widget-visual
208 (:metaclass object-class)
209 (:alien-name "GtkWidget"))
213 (defclass accel-label (label)
216 :location "gtk_accel_label_get_accel_width"
219 (:metaclass widget-class)
220 (:alien-name "GtkAccelLabel"))
223 (defclass container (widget)
226 :location container-children)
229 :location ("gtk_container_get_focus_child" "gtk_container_set_focus_child")
230 :accessor container-focus-child
231 :initarg :focus-child
235 :location (nil "gtk_container_set_focus_hadjustment")
236 :writer (setf container-focus-hadjustment)
237 :initarg :focus-hadjustment
241 :location (nil "gtk_container_set_focus_vadjustment")
242 :writer (setf container-focus-vadjustment)
243 :initarg :focus-vadjustment
245 (:metaclass widget-class)
246 (:alien-name "GtkContainer"))
250 (defclass bin (container)
255 (:metaclass container-class)
256 (:alien-name "GtkBin"))
260 (defclass radio-button (check-button)
263 :location ("gtk_radio_button_group")
264 :reader radio-button-group
265 :type (static (gslist widget))))
266 (:metaclass container-class)
267 (:alien-name "GtkRadioButton"))
269 (defclass option-menu (button)
272 :location ("gtk_option_menu_get_menu" (setf option-menu-menu))
273 :reader option-menu-menu
278 :location (nil "gtk_option_menu_set_history")
279 :writer (setf option-menu-history)
282 (:metaclass container-class)
283 (:alien-name "GtkOptionMenu"))
285 (defclass menu-item (item)
288 :location menu-item-label
293 :location ("gtk_menu_item_get_submenu" (setf menu-item-submenu))
294 :reader menu-item-submenu
299 :location ("gtk_menu_item_get_placement" "gtk_menu_item_set_placement")
300 :accessor menu-item-placement
302 :type submenu-placement)
305 :location ("gtk_menu_item_get_show_toggle"
306 (setf menu-item-toggle-indicator-p))
307 :reader menu-item-toggle-indicator-p
308 :initarg :toggle-indicator
312 :location ("gtk_menu_item_get_show_submenu"
313 (setf menu-item-submenu-indicator-p))
314 :reader menu-item-submenu-indicator-p
315 :initarg :submenu-indicator
317 (:metaclass container-class)
318 (:alien-name "GtkMenuItem"))
321 (defclass radio-menu-item (check-menu-item)
324 :location ("gtk_radio_menu_item_group")
325 :reader radio-menu-item-group
326 :type (static (gslist widget))))
327 (:metaclass container-class)
328 (:alien-name "GtkRadioMenuItem"))
332 (defclass dialog (window)
335 :reader dialog-main-box
339 :reader dialog-action-area
341 (:metaclass container-class)
342 (:alien-name "GtkDialog"))
345 (defclass color-selection-dialog (dialog)
348 :reader color-selection-dialog-colorsel
352 :reader color-selection-dialog-ok-button
356 :reader color-selection-dialog-cancel-button
360 :reader color-selection-dialog-help-button
362 (:metaclass container-class)
363 (:alien-name "GtkColorSelectionDialog"))
366 (defclass file-selection (window)
369 :location ("gtk_file_selection_get_filename"
370 "gtk_file_selection_set_filename")
371 :accessor file-selection-filename
376 :location "gtk_file_selection_get_action_area"
377 :reader file-selection-action-area
381 :location "gtk_file_selection_get_ok_button"
382 :reader file-selection-ok-button
386 :location "gtk_file_selection_get_cancel_button"
387 :reader file-selection-cancel-button
389 (:metaclass container-class)
390 (:alien-name "GtkFileSelection"))
393 (defclass scrolled-window (bin)
396 :location "gtk_scrolled_window_get_hscrollbar"
397 :accessor scrolled-window-hscrollbar
401 :location "gtk_scrolled_window_get_vscrollbar"
402 :accessor scrolled-window-vscrollbar
404 (:metaclass container-class)
405 (:alien-name "GtkScrolledWindow"))
408 (defclass button-box (box)
411 :location ("gtk_button_box_get_spacing" "gtk_button_box_set_spacing")
412 :accessor button-box-spacing
417 :offset #.(size-of 'int)
418 :accessor button-box-child-min-width
419 :initarg :child-min-width
423 :accessor button-box-child-min-height
424 :initarg :child-min-height
428 :accessor button-box-child-ipad-x
429 :initarg :child-ipad-x
433 :accessor button-box-child-ipad-y
434 :initarg :child-ipad-y
438 :location ("gtk_button_box_get_layout" "gtk_button_box_set_layout")
439 :accessor button-box-layout
441 :type button-box-style))
442 (:metaclass container-class)
443 (:alien-name "GtkButtonBox"))
447 (defclass color-selection (vbox)
450 :location ("gtk_color_selection_get_use_opacity"
451 "gtk_color_selection_set_use_opacity")
452 :accessor color-selection-use-opacity-p
453 :initarg :use-opacity
457 :location ("gtk_color_selection_get_use_palette"
458 "gtk_color_selection_set_use_palette")
459 :accessor color-selection-use-palette-p
460 :initarg :use-palette
464 :location color-selection-color
468 :location color-selection-old-color
470 :type (vector double-float 4)))
471 (:metaclass container-class)
472 (:alien-name "GtkColorSelection"))
477 (defclass paned (container)
480 :location ("gtk_paned_get_position" "gtk_paned_set_position")
481 :accessor paned-position
486 :location paned-child1
491 :location paned-child2
494 (:metaclass container-class)
495 (:alien-name "GtkPaned"))
498 (defclass layout (container)
501 :location ("gtk_layout_get_hadjustment" "gtk_layout_set_hadjustment")
502 :accessor layout-hadjustment
503 :initarg :hadjustment
507 :location ("gtk_layout_get_vadjustment" "gtk_layout_set_vadjustment")
508 :accessor layout-vadjustment
509 :initarg :vadjustment
513 :location layout-x-size
517 :location layout-y-size
521 :offset #.(+ (size-of 'pointer) (* (size-of 'int) 2))
522 :accessor layout-x-offset
527 :accessor layout-y-offset
530 (:metaclass container-class)
531 (:alien-name "GtkLayout"))
535 (defclass menu (menu-shell)
538 :location ("gtk_menu_get_accel_group" "gtk_menu_set_accel_group")
539 :accessor menu-accel-group
540 :initarg :accel-group
544 :location ("gtk_menu_get_tearoff_state" "gtk_menu_set_tearoff_state")
545 :accessor menu-tornoff-p
550 :location ("gtk_menu_get_title" "gtk_menu_set_title")
554 (:metaclass container-class)
555 (:alien-name "GtkMenu"))
558 (defclass table-child (container-child)
561 :location table-child-x-expand-p
566 :location table-child-y-expand-p
571 :location table-child-x-shrink-p
576 :location table-child-y-shrink-p
581 :location table-child-x-fill-p
586 :location table-child-y-fill-p
589 (:metaclass child-class))
592 (defclass toolbar (container)
595 :location ("gtk_toolbar_get_tooltips" "gtk_toolbar_set_tooltips")
596 :accessor toolbar-tooltips-p
599 (:metaclass container-class)
600 (:alien-name "GtkToolbar"))
604 (defclass combo (hbox)
607 :location "gtk_combo_get_entry"
610 (:metaclass widget-class)
611 (:alien-name "GtkCombo"))
614 (defclass ruler (widget)
617 :location (nil "gtk_ruler_set_metric")
618 :accessor ruler-metric
621 (:metaclass widget-class)
622 (:alien-name "GtkRuler"))
624 (defclass scale (range)
627 :location "gtk_scale_get_value_width"
628 :reader ruler-value-width
630 (:metaclass widget-class)
631 (:alien-name "GtkScale"))
635 (defclass progress (widget)
638 :location ("gtk_progress_get_format_string"
639 "gtk_progress_set_format_string")
640 :accessor progress-format-string
641 :initarg :format-string
645 :location ("gtk_progress_get_adjustment"
646 "gtk_progress_set_adjustment")
647 :accessor progress-adjustment
652 :location ("gtk_progress_get_current_percentage"
653 "gtk_progress_set_percentage")
654 :accessor progress-percentage
659 :location ("gtk_progress_get_value" "gtk_progress_set_value")
660 :accessor progress-value
663 (:metaclass widget-class)
664 (:alien-name "GtkProgress"))
667 (defclass progress-bar (progress)
668 (activity-blocks ;; deprecated
670 :accessor progress-bar-activity-blocks
671 :initarg :activity-blocks
673 (:metaclass widget-class)
674 (:alien-name "GtkProgressBar"))