X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/56460319be51dd9ffc1005dca03a7b145ff4734b..f4175703fcb0b913a124d9391161fd735cd6a230:/gtk/gtktypes.lisp diff --git a/gtk/gtktypes.lisp b/gtk/gtktypes.lisp index a230ad1..2151790 100644 --- a/gtk/gtktypes.lisp +++ b/gtk/gtktypes.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gtktypes.lisp,v 1.9 2001-11-12 22:32:17 espen Exp $ +;; $Id: gtktypes.lisp,v 1.20 2004-11-21 17:57:56 espen Exp $ (in-package "GTK") @@ -31,8 +31,31 @@ (defclass requisition (boxed) :accessor requisition-height :initarg :height :type int)) - (:metaclass boxed-class) - (:alien-name "GtkRequisition")) + (:metaclass boxed-class)) + + +(defclass allocation (struct) + ((x + :allocation :alien + :accessor allocation-width + :initarg :x + :type int) + (y + :allocation :alien + :accessor allocation-width + :initarg :width + :type int) + (width + :allocation :alien + :accessor allocation-width + :initarg :width + :type int) + (height + :allocation :alien + :accessor allocation-height + :initarg :height + :type int)) + (:metaclass struct-class)) (defclass border (boxed) ((left @@ -55,47 +78,53 @@ (defclass border (boxed) :accessor border-bottom :initarg :bottom :type int)) - (:metaclass boxed-class) - (:alien-name "GtkBorder")) + (:metaclass boxed-class)) -(defclass adjustment (%object) - ((lower +(defclass stock-item (struct) + ((id :allocation :alien - :accessor adjustment-lower - :initarg :lower - :type single-float) - (upper - :allocation :alien - :accessor adjustment-upper - :initarg :upper - :type single-float) - (%value ; to get the offset right + :accessor stock-item-id + :initarg :id + :type string) + (label :allocation :alien - :type single-float) - (step-increment + :accessor stock-item-label + :initarg :label + :type string) + (modifier :allocation :alien - :accessor adjustment-step-increment - :initarg :step-increment - :type single-float) - (page-increment + :accessor stock-item-modifier + :initarg :modifier + :type gdk:modifier-type) + (keyval :allocation :alien - :accessor adjustment-page-increment - :initarg :page-increment - :type single-float) - (page-size + :accessor stock-item-keyval + :initarg :keyval + :type int) + (translation-domain :allocation :alien - :accessor adjustment-page-size - :initarg :page-size - :type single-float) - (value - :allocation :virtual - :getter "gtk_adjustment_get_value" - :setter "gtk_adjustment_set_value" - :accessor adjustment-value - :initarg :value - :type single-float)) - (:metaclass gobject-class) - (:alien-name "GtkAdjustment")) + :accessor stock-item-translation-domain + :initarg :translation-domain + :type string)) + (:metaclass static-struct-class)) + +;; We don't really need to access any of these slots, but we need to +;; specify the size of the struct somehow +(defclass tree-iter (boxed) + ((stamp :allocation :alien :type int) + (user-data :allocation :alien :type pointer) + (user-data2 :allocation :alien :type pointer) + (user-data3 :allocation :alien :type pointer)) + (:metaclass boxed-class)) + + +;; (defclass tree-path (boxed) +;; ((depth :allocation :alien :type int) +;; (indices :allocation :alien :type pointer)) +;; (:metaclass boxed-class)) + +(deftype tree-path () '(vector integer)) +(register-type 'tree-path "GtkTreePath") @@ -104,23 +133,22 @@ (define-types-by-introspection "Gtk" ("GtkObject" :ignore t) ("GtkRequisition" :ignore t) ("GtkBorder" :ignore t) - ("GtkAdjustment" :ignore t) + ("GtkTreeIter" :ignore t) + ("GtkTreePath" :ignore t) - ;; Manual override ("GtkWidget" :slots ((child-slots - :allocation :instance - :accessor widget-child-slots - :type container-child) - (parent - :allocation :virtual - :getter "gtk_widget_get_parent" - :setter "gtk_widget_set_parent" - :accessor widget-parent - :type container - :documentation "The parent widget of this widget. Must be a container widget.") + :allocation :instance + :accessor widget-child-slots + :type container-child) + (parent-window + :allocation :virtual + :getter "gtk_widget_get_parent_window" + :setter "gtk_widget_set_parent_window" + :accessor widget-parent-window + :type gdk:window) (window :allocation :virtual :getter "gtk_widget_get_window" @@ -136,14 +164,42 @@ (define-types-by-introspection "Gtk" (colormap :allocation :virtual :getter "gtk_widget_get_colormap" - :reader widget-colormap + :setter "gtk_widget_set_colormap" + :initarg :colormap + :accessor widget-colormap :type gdk:colormap) (visual :allocation :virtual :getter "gtk_widget_get_visual" :reader widget-visual - :type gdk:visual))) - + :type gdk:visual) + (direction + :allocation :virtual + :getter "gtk_widget_get_direction" + :setter "gtk_widget_set_direction" + :accessor widget-direction + :initarg :direction + :type text-direction) + (composite-name + :allocation :virtual + :getter "gtk_widget_get_composite_name" + :setter "gtk_widget_set_composite_name" + :accessor widget-composite-name + :initarg :composite-name + :type string) + (settings + :allocation :virtual + :getter "gtk_widget_get_settings" + :accessor widget-settings + :type settings) + (child-visible + :allocation :virtual + :getter "gtk_widget_get_child_visible" + :setter "gtk_widget_set_child_visible" + :accessor widget-child-visible-p + :initarg :child-visible + :type boolean))) + ("GtkContainer" :slots ((child @@ -159,6 +215,10 @@ (define-types-by-introspection "Gtk" :accessor container-focus-child :initarg :focus-child :type widget) + (focus-chain + :allocation :virtual + :getter container-focus-chain + :setter (setf container-focus-chain)) (focus-hadjustment :allocation :virtual :getter "gtk_container_get_focus_hadjustment" @@ -182,6 +242,77 @@ (define-types-by-introspection "Gtk" :setter (setf bin-child) :reader bin-child :type widget))) + + ("GtkWindow" + :slots + ((gravity + :allocation :virtual + :getter "gtk_window_get_gravity" + :setter "gtk_window_set_gravity" + :accessor window-gravity + :initarg :gravity + :type gdk:gravity) + (focus-widget + :allocation :virtual + :getter "gtk_window_get_focus" + :setter "gtk_window_set_focus" + :accessor window-focus-widget + :initarg :focus-widget + :type widget) + (default-widget + :allocation :virtual + :getter "gtk_window_get_default" + :setter "gtk_window_set_default" + :accessor window-default-widget + :initarg :default-widget + :type widget) + (decorated + :allocation :virtual + :getter "gtk_window_get_decorated" + :setter "gtk_window_set_decorated" + :accessor window-decorated-p + :initarg :decorated + :type boolean) + (has-frame + :allocation :virtual + :getter "gtk_window_get_has_frame" + :setter "gtk_window_set_has_frame" + :accessor window-has-frame-p + :initarg :has-frame + :type boolean) + (role + :allocation :virtual + :getter "gtk_window_get_role" + :setter "gtk_window_set_role" + :accessor window-role + :initarg :role + :type string) + (type-hint + :allocation :virtual + :getter "gtk_window_get_type_hint" + :setter "gtk_window_set_type_hint" + :accessor window-type-hint + :initarg :type-hint + :type gdk:window-type-hint) + (icon + :allocation :virtual + :getter window-icon + :setter (setf window-icon) + :initarg :icon) + (mnemonic-modifier + :allocation :virtual + :getter "gtk_window_get_mnemonic_modifier" + :setter "gtk_window_set_mnemonic_modifier" + :accessor window-mnemonic-modifier + :initarg :mnemonic-modifier + :type gdk:modifier-type) + (transient-for + :allocation :virtual + :getter "gtk_window_get_transient_for" + :setter "gtk_window_set_transient_for" + :accessor window-transient-for + :initarg :transient-for + :type window))) ("GtkTooltips" :slots @@ -201,7 +332,7 @@ (define-types-by-introspection "Gtk" :setter (setf option-menu-menu) :reader option-menu-menu :initarg :menu - :type widget) + :type menu) (history :allocation :virtual :getter "gtk_option_menu_get_history" @@ -214,30 +345,24 @@ (define-types-by-introspection "Gtk" :slots ((label :allocation :virtual - :setter menu-item-label + :getter menu-item-label + :setter (setf menu-item-label) :initarg :label :type string) + (right-justified + :allocation :virtual + :getter "gtk_menu_item_get_right_justified" + :setter "gtk_menu_item_set_right_justified" + :accessor menu-item-right-justified-p + :initarg :right-justified + :type boolean) (submenu :allocation :virtual :getter "gtk_menu_item_get_submenu" :setter (setf menu-item-submenu) :reader menu-item-submenu :initarg :submenu - :type menu-item) - (placement - :allocation :virtual - :getter "gtk_menu_item_get_placement" - :setter "_gtk_menu_item_set_placement" ; why underscore? - :accessor menu-item-placement - :initarg :placement - :type submenu-placement) - (submenu-indicator - :allocation :virtual - :getter "gtk_menu_item_get_show_submenu" - :setter "gtk_menu_item_set_show_submenu" - :accessor menu-item-submenu-indicator-p - :initarg :submenu-indicator - :type boolean))) + :type menu-item))) ("GtkColorSelectionDialog" :slots @@ -270,7 +395,7 @@ (define-types-by-introspection "Gtk" :type widget))) ("GtkPaned" - :slot + :slots ((child1 :allocation :virtual :getter paned-child1 @@ -293,6 +418,13 @@ (define-types-by-introspection "Gtk" :accessor menu-accel-group :initarg :accel-group :type accel-group) + (title + :allocation :virtual + :getter "gtk_menu_get_title" + :setter "gtk_menu_set_title" + :accessor menu-title + :initarg :title + :type string) (active :allocation :virtual :getter "gtk_menu_get_active" @@ -323,8 +455,23 @@ (define-types-by-introspection "Gtk" :setter "gtk_toolbar_set_icon_size" :accessor toolbar-icon-size :initarg :icon-size - :type icon-size))) + :type icon-size) + (toolbar-style + :allocation :property + :pname "toolbar-style" + :initarg :toolbar-style + :accessor toolbar-style + :type toolbar-style))) + ("GtkNotebook" + :slots + ((current-page + :allocation :virtual + :getter notebook-current-page + :setter (setf notebook-current-page) + :initarg :current-page) + (page :ignore t))) + ("GtkRuler" :slots ((metric @@ -379,7 +526,7 @@ (define-types-by-introspection "Gtk" :getter "gtk_combo_get_entry" :reader combo-entry :type entry))) - + ("GtkRadioButton" :slots ((group @@ -417,21 +564,160 @@ (define-types-by-introspection "Gtk" ("GtkLayout" :slots ((bin-window + :allocation :virtual :getter "gtk_layout_get_bin_window" :reader layout-bin-window - :type gdk:window) - (x-offset - :getter "gtk_layout_get_xoffset" - :setter "gtk_layout_set_xoffset" - :accessor layout-x-offset - :initarg :x-offset - :type unsigned-int) - (y-offset - :getter "gtk_layout_get_yoffset" - :setter "gtk_layout_set_yoffset" - :accessor layout-y-offset - :initarg :x-offset - :type unsigned-int))) + :type gdk:window))) + + ("GtkFixed" + :slots + ((has-window + :allocation :virtual + :getter "gtk_fixed_get_has_window" + :setter "gtk_fixed_set_has_window" + :reader fixed-has-window-p + :initarg :has-window + :type boolean))) + + ("GtkRange" + :slots + ((value + :allocation :virtual + :getter "gtk_range_get_value" + :setter "gtk_range_set_value" + :initarg :value + :accessor range-value + :type double-float) + (upper + :allocation :virtual + :getter range-upper + :setter (setf range-upper) + :initarg :upper) + (lower + :allocation :virtual + :getter range-lower + :setter (setf range-lower) + :initarg :lower) + (step-increment + :allocation :virtual + :getter range-step-increment + :setter (setf range-step-increment) + :initarg :step-increment) + (page-increment + :allocation :virtual + :getter range-page-increment + :setter (setf range-page-increment) + :initarg :page-increment))) + + ("GtkImage" + :slots + ((file :ignore t))) + + ;; Interfaces + ("GtkEditable" + :slots + ((editable + :allocation :virtual + :getter "gtk_editable_get_editable" + :setter "gtk_editable_set_editable" + :reader editable-editable-p + :initarg :editable + :type boolean) + (position + :allocation :virtual + :getter "gtk_editable_get_position" + :setter "gtk_editable_set_position" + :reader editable-position + :initarg :position + :type int) + (text + :allocation :virtual + :getter editable-text + :setter (setf editable-text) + :initarg text))) + + ("GtkFileChooser" + :slots + ((filename + :allocation :virtual + :getter "gtk_file_chooser_get_filename" + :setter "gtk_file_chooser_set_filename" + :accessor file-chooser-filename + :initarg :filename + :type string) + (current-name + :allocation :virtual + :setter "gtk_file_chooser_set_current_name" + :accessor file-choser-current-name + :initarg :current-name + :type string) + (current-folder + :allocation :virtual + :setter "gtk_file_chooser_set_current_folder" + :setter "gtk_file_chooser_get_current_folder" + :accessor file-choser-current-folder + :initarg :current-folder + :type string) + (uri + :allocation :virtual + :getter "gtk_file_chooser_get_uri" + :setter "gtk_file_chooser_set_uri" + :accessor file-choser-uri + :initarg :uri + :type string) + (current-folder-uri + :allocation :virtual + :setter "gtk_file_chooser_set_current_folder_uri" + :setter "gtk_file_chooser_get_current_folder_uri" + :accessor file-choser-current-folder-uri + :initarg :current-folder-uri + :type string))) + + ("GtkTreeView" + :slots + ((columns + :allocation :virtual + :getter "gtk_tree_view_get_columns" + :reader tree-view-columns + :type (glist tree-view-column)) + (selection + :allocation :virtual + :getter "gtk_tree_view_get_selection" + :reader tree-view-selection + :type tree-selection))) + + ("GtkTreeModel" + :slots + ((n-columns + :allocation :virtual + :getter "gtk_tree_model_get_n_columns" + :reader tree-model-n-columns + :type int))) + + ("GtkTreeSelection" + :slots + ((mode + :allocation :virtual + :getter "gtk_tree_selection_get_mode" + :setter "gtk_tree_selection_set_mode" + :accessor tree-selection-mode + :initarg :mode + :type selection-mode) + (tree-view + :allocation :virtual + :getter "gtk_tree_selection_get_mode" + :reader tree-selection-mode + :type tree-view))) + + ("GtkComboBox" + :slots + ((active-iter + :allocation :virtual + :getter "gtk_combo_box_get_active_iter" + :setter "gtk_combo_box_set_active_iter" + :accessor combo-box-active-iter + :type tree-iter))) + ;; Not needed @@ -442,12 +728,24 @@ (define-types-by-introspection "Gtk" ;; Deprecated widgets ("GtkCList" :ignore-prefix t) ("GtkCTree" :ignore-prefix t) - ("GtkList" :ignore-prefix t) + ("GtkList" :ignore t) + ("GtkListItem" :ignore t) ("GtkTree" :ignore t) ("GtkTreeItem" :ignore t) - ("GtkText" :ignore-prefix t) + ("GtkItemFactory" :ignore t) + ("GtkText" :ignore-prefix t :except ("GtkTextDirection")) ("GtkPacker" :ignore-prefix t) ("GtkPixmap" :ignore t) ("GtkPreview" :ignore-prefix t) + ("GtkProgres" :ignore t) ("GtkTipsQuery" :ignore t) - ("GtkOldEditable" :ignore t)) + ("GtkOldEditable" :ignore t) + ("GtkCombo" :ignore t) + ("GtkOptionMenu" :ignore t) + + ;; What are these? + ("GtkFileSystemModule" :ignore t) + ("GtkIMModule" :ignore t) + ("GtkThemeEngine" :ignore t) + + )