1 ;; Common Lisp bindings for GTK+ v2.0.x
2 ;; Copyright (C) 1999-2001 Espen S. Johnsen <espen@users.sourceforge.org>
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.21 2004-12-04 18:18:21 espen Exp $
23 (defclass requisition (boxed)
26 :accessor requisition-width
31 :accessor requisition-height
34 (:metaclass boxed-class))
37 (defclass allocation (struct)
40 :accessor allocation-width
45 :accessor allocation-width
50 :accessor allocation-width
55 :accessor allocation-height
58 (:metaclass struct-class))
60 (defclass border (boxed)
68 :accessor border-right
78 :accessor border-bottom
81 (:metaclass boxed-class))
83 (defclass stock-item (struct)
86 :accessor stock-item-id
91 :accessor stock-item-label
96 :accessor stock-item-modifier
98 :type gdk:modifier-type)
101 :accessor stock-item-keyval
106 :accessor stock-item-translation-domain
107 :initarg :translation-domain
109 (:metaclass struct-class))
111 ;; We don't really need to access any of these slots, but we need to
112 ;; specify the size of the struct somehow
113 (defclass tree-iter (boxed)
114 ((stamp :allocation :alien :type int)
115 (user-data :allocation :alien :type pointer)
116 (user-data2 :allocation :alien :type pointer)
117 (user-data3 :allocation :alien :type pointer))
118 (:metaclass boxed-class))
121 ;; (defclass tree-path (boxed)
122 ;; ((depth :allocation :alien :type int)
123 ;; (indices :allocation :alien :type pointer))
124 ;; (:metaclass boxed-class))
126 (deftype tree-path () '(vector integer))
127 (register-type 'tree-path "GtkTreePath")
130 (defclass text-iter (boxed)
132 :allocation :alien :offset #.(* 13 (size-of 'pointer))
134 (:metaclass boxed-class))
138 (define-types-by-introspection "Gtk"
140 ("GtkObject" :ignore t)
141 ("GtkRequisition" :ignore t)
142 ("GtkBorder" :ignore t)
143 ("GtkTreeIter" :ignore t)
144 ("GtkTreePath" :ignore t)
150 :allocation :instance
151 :accessor widget-child-slots
152 :type container-child)
155 :getter "gtk_widget_get_parent_window"
156 :setter "gtk_widget_set_parent_window"
157 :accessor widget-parent-window
161 :getter "gtk_widget_get_window"
162 :reader widget-window
166 :getter "gtk_widget_get_state"
167 :setter "gtk_widget_set_state"
168 :accessor widget-state
173 :getter "gtk_widget_get_colormap"
174 :setter "gtk_widget_set_colormap"
176 :accessor widget-colormap
180 :getter "gtk_widget_get_visual"
181 :reader widget-visual
185 :getter "gtk_widget_get_direction"
186 :setter "gtk_widget_set_direction"
187 :accessor widget-direction
189 :type text-direction)
192 :getter "gtk_widget_get_composite_name"
193 :setter "gtk_widget_set_composite_name"
194 :accessor widget-composite-name
195 :initarg :composite-name
199 :getter "gtk_widget_get_settings"
200 :accessor widget-settings
204 :getter "gtk_widget_get_child_visible"
205 :setter "gtk_widget_set_child_visible"
206 :accessor widget-child-visible-p
207 :initarg :child-visible
216 :getter container-children
217 :setter (setf container-children))
220 :getter "gtk_container_get_focus_child"
221 :setter "gtk_container_set_focus_child"
222 :accessor container-focus-child
223 :initarg :focus-child
227 :getter container-focus-chain
228 :setter (setf container-focus-chain))
231 :getter "gtk_container_get_focus_hadjustment"
232 :setter "gtk_container_set_focus_hadjustment"
233 :accessor container-focus-hadjustment
234 :initarg :focus-hadjustment
238 :getter "gtk_container_get_focus_vadjustment"
239 :setter "gtk_container_set_focus_vadjustment"
240 :accessor container-focus-vadjustment
241 :initarg :focus-vadjustment
248 :getter "gtk_bin_get_child"
249 :setter (setf bin-child)
257 :getter "gtk_window_get_gravity"
258 :setter "gtk_window_set_gravity"
259 :accessor window-gravity
264 :getter "gtk_window_get_focus"
265 :setter "gtk_window_set_focus"
266 :accessor window-focus-widget
267 :initarg :focus-widget
271 :getter "gtk_window_get_default"
272 :setter "gtk_window_set_default"
273 :accessor window-default-widget
274 :initarg :default-widget
278 :getter "gtk_window_get_decorated"
279 :setter "gtk_window_set_decorated"
280 :accessor window-decorated-p
285 :getter "gtk_window_get_has_frame"
286 :setter "gtk_window_set_has_frame"
287 :accessor window-has-frame-p
292 :getter "gtk_window_get_role"
293 :setter "gtk_window_set_role"
294 :accessor window-role
299 :getter "gtk_window_get_type_hint"
300 :setter "gtk_window_set_type_hint"
301 :accessor window-type-hint
303 :type gdk:window-type-hint)
307 :setter (setf window-icon)
311 :getter "gtk_window_get_mnemonic_modifier"
312 :setter "gtk_window_set_mnemonic_modifier"
313 :accessor window-mnemonic-modifier
314 :initarg :mnemonic-modifier
315 :type gdk:modifier-type)
318 :getter "gtk_window_get_transient_for"
319 :setter "gtk_window_set_transient_for"
320 :accessor window-transient-for
321 :initarg :transient-for
328 :getter "gtk_tooltips_get_enabled"
329 :setter (setf tooltips-enabled-p)
330 :reader tooltips-enabled-p
338 :getter "gtk_option_menu_get_menu"
339 :setter (setf option-menu-menu)
340 :reader option-menu-menu
345 :getter "gtk_option_menu_get_history"
346 :setter "gtk_option_menu_set_history"
347 :accessor option-menu-history
349 :type unsigned-int)))
355 :getter menu-item-label
356 :setter (setf menu-item-label)
361 :getter "gtk_menu_item_get_right_justified"
362 :setter "gtk_menu_item_set_right_justified"
363 :accessor menu-item-right-justified-p
364 :initarg :right-justified
368 :getter "gtk_menu_item_get_submenu"
369 :setter (setf menu-item-submenu)
370 :reader menu-item-submenu
374 ("GtkColorSelectionDialog"
378 :reader color-selection-dialog-colorsel
382 :reader color-selection-dialog-ok-button
386 :reader color-selection-dialog-cancel-button
390 :reader color-selection-dialog-help-button
397 :reader scrolled-window-hscrollbar
401 :reader scrolled-window-vscrollbar
409 :setter (setf paned-child1)
415 :setter (setf paned-child2)
423 :getter "gtk_menu_get_accel_group"
424 :setter "gtk_menu_set_accel_group"
425 :accessor menu-accel-group
426 :initarg :accel-group
430 :getter "gtk_menu_get_title"
431 :setter "gtk_menu_set_title"
437 :getter "gtk_menu_get_active"
438 :setter (setf menu-active)
444 :getter "gtk_menu_get_tearoff_state"
445 :setter "gtk_menu_set_tearoff_state"
446 :accessor menu-tornoff-p
454 :getter "gtk_toolbar_get_tooltips"
455 :setter "gtk_toolbar_set_tooltips"
456 :accessor toolbar-tooltips-p
461 :getter "gtk_toolbar_get_icon_size"
462 :setter "gtk_toolbar_set_icon_size"
463 :accessor toolbar-icon-size
467 :allocation :property
468 :pname "toolbar-style"
469 :initarg :toolbar-style
470 :accessor toolbar-style
471 :type toolbar-style)))
477 :getter notebook-current-page
478 :setter (setf notebook-current-page)
479 :initarg :current-page)
486 :getter "gtk_ruler_get_metric"
487 :setter "gtk_ruler_set_metric"
488 :accessor ruler-metric
494 ; deprecated properties
495 ((bar-style :ignore t)
496 (adjustment :ignore t)
497 (activity-step :ignore t)
498 (activity-blocks :ignore t)
499 (discrete-blocks :ignore t)))
505 :getter "gtk_table_get_default_col_spacing"
506 :setter "gtk_table_set_col_spacings"
507 :initarg :column-spacing
511 :getter "gtk_table_get_default_row_spacing"
512 :setter "gtk_table_set_row_spacings"
513 :initarg :row-spacing
514 :type unsigned-int)))
520 :getter "gtk_dialog_get_vbox"
525 :getter "gtk_dialog_get_action_area"
526 :reader dialog-action-area
533 :getter "gtk_combo_get_entry"
541 :getter "gtk_radio_button_get_group"
542 :reader radio-button-group
543 :type (copy-of (gslist widget)))))
549 :getter "gtk_radio_menu_item_get_group"
550 :reader radio-menu-item-group
551 :type (static (gslist widget)))))
557 :getter "gtk_file_selection_get_action_area"
558 :reader file-selection-action-area
562 :getter "gtk_file_selection_get_ok_button"
563 :reader file-selection-ok-button
567 :getter "gtk_file_selection_get_cancel_button"
568 :reader file-selection-cancel-button
575 :getter "gtk_layout_get_bin_window"
576 :reader layout-bin-window
583 :getter "gtk_fixed_get_has_window"
584 :setter "gtk_fixed_set_has_window"
585 :reader fixed-has-window-p
593 :getter "gtk_range_get_value"
594 :setter "gtk_range_set_value"
596 :accessor range-value
601 :setter (setf range-upper)
606 :setter (setf range-lower)
610 :getter range-step-increment
611 :setter (setf range-step-increment)
612 :initarg :step-increment)
615 :getter range-page-increment
616 :setter (setf range-page-increment)
617 :initarg :page-increment)))
627 :getter "gtk_editable_get_editable"
628 :setter "gtk_editable_set_editable"
629 :reader editable-editable-p
634 :getter "gtk_editable_get_position"
635 :setter "gtk_editable_set_position"
636 :reader editable-position
641 :getter editable-text
642 :setter (setf editable-text)
649 :getter "gtk_file_chooser_get_filename"
650 :setter "gtk_file_chooser_set_filename"
651 :accessor file-chooser-filename
656 :setter "gtk_file_chooser_set_current_name"
657 :accessor file-choser-current-name
658 :initarg :current-name
662 :setter "gtk_file_chooser_set_current_folder"
663 :setter "gtk_file_chooser_get_current_folder"
664 :accessor file-choser-current-folder
665 :initarg :current-folder
669 :getter "gtk_file_chooser_get_uri"
670 :setter "gtk_file_chooser_set_uri"
671 :accessor file-choser-uri
676 :setter "gtk_file_chooser_set_current_folder_uri"
677 :setter "gtk_file_chooser_get_current_folder_uri"
678 :accessor file-choser-current-folder-uri
679 :initarg :current-folder-uri
686 :getter "gtk_tree_view_get_columns"
687 :reader tree-view-columns
688 :type (glist tree-view-column))
691 :getter "gtk_tree_view_get_selection"
692 :reader tree-view-selection
693 :type tree-selection)))
699 :getter "gtk_tree_model_get_n_columns"
700 :reader tree-model-n-columns
707 :getter "gtk_tree_selection_get_mode"
708 :setter "gtk_tree_selection_set_mode"
709 :accessor tree-selection-mode
711 :type selection-mode)
714 :getter "gtk_tree_selection_get_mode"
715 :reader tree-selection-mode
722 :getter "gtk_combo_box_get_active_iter"
723 :setter "gtk_combo_box_set_active_iter"
724 :accessor combo-box-active-iter
731 :getter "gtk_text_view_get_default_attributes"
732 :reader text-view-default-attributes
733 :type text-attributes)))
740 :getter "gtk_ui_manager_get_action_groups"
741 :reader ui-manager-action-groups
742 :type (copy-of (glist action-group)))
745 :getter "gtk_ui_manager_get_accel_group"
746 :reader ui-manager-accel-group
749 ("GtkUIManagerItemType"
750 :type ui-manager-item-type)
756 :getter action-accelerator)))
762 :getter "gtk_toggle_action_get_active"
763 :setter "gtk_toggle_action_set_active"
765 :accessor toggle-action-active-p
772 :getter "gtk_radio_button_get_group"
773 :reader radio-button-group
774 :type (copy-of (gslist widget)))
776 :allocation :property :pname "value"
777 :readable nil :type int)
780 :getter radio-action-value)))
784 ("GtkFundamentalType" :ignore t)
785 ("GtkArgFlags" :ignore t)
788 ;; Deprecated widgets
789 ("GtkCList" :ignore-prefix t)
790 ("GtkCTree" :ignore-prefix t)
791 ("GtkList" :ignore t)
792 ("GtkListItem" :ignore t)
793 ("GtkTree" :ignore t)
794 ("GtkTreeItem" :ignore t)
795 ("GtkItemFactory" :ignore t)
796 ("GtkText" :ignore t)
797 ("GtkPacker" :ignore-prefix t)
798 ("GtkPixmap" :ignore t)
799 ("GtkPreview" :ignore-prefix t)
800 ("GtkProgres" :ignore t)
801 ("GtkTipsQuery" :ignore t)
802 ("GtkOldEditable" :ignore t)
803 ("GtkCombo" :ignore t)
804 ("GtkOptionMenu" :ignore t)
807 ("GtkFileSystemModule" :ignore t)
808 ("GtkIMModule" :ignore t)
809 ("GtkThemeEngine" :ignore t)