From bdc0e300667f589ecdbee0ae6bf6dc51c06c73ae Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 26 Sep 2005 21:34:53 +0000 Subject: [PATCH] Added bindings for Gtk 2.8 Organization: Straylight/Edgeware From: espen --- gtk/gtk.lisp | 38 +++++++++++++++++++++++++--- gtk/gtktree.lisp | 64 ++++++++++++++++++++++++++++++++++++++++++++++- gtk/gtktypes.lisp | 33 +++++++++++++++++++++--- 3 files changed, 127 insertions(+), 8 deletions(-) diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 2ee84f0..cba75e9 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.44 2005-04-25 18:20:00 espen Exp $ +;; $Id: gtk.lisp,v 1.45 2005-09-26 21:34:53 espen Exp $ (in-package "GTK") @@ -701,6 +701,16 @@ (defbinding (dialog-set-alternative-button-order new-order) (vector int))) +#+gtk2.8 +(progn + (defbinding %dialog-get-response-for-widget () int + (dialog dialog) + (widget widget)) + + (defun dialog-get-response-for-widget (dialog widget) + (dialog-find-response dialog (dialog-get-response-for-widget dialog widget)))) + + (defmethod container-add ((dialog dialog) (child widget) &rest args) (apply #'container-add (dialog-vbox dialog) child args)) @@ -925,6 +935,11 @@ (defun create-image-widget (source &optional mask) ((or list vector) (make-instance 'image :pixmap source)) (gdk:pixmap (make-instance 'image :pixmap source :mask mask)))) +#+gtk2.8 +(defbinding image-clear () nil + (image image)) + + ;;; Image menu item @@ -1270,9 +1285,24 @@ (defbinding window-propagate-key-event () boolean (window window) (event gdk:key-event)) +#-gtk2.8 (defbinding window-present () nil (window window)) +#+gtk2.8 +(progn + (defbinding %window-present () nil + (window window)) + + (defbinding %window-present-with-timestamp () nil + (window window) + (timespamp unsigned-int)) + + (defun window-present (window &optional timestamp) + (if timestamp + (%window-present-with-timestamp window timestamp) + (%window-present window)))) + (defbinding window-iconify () nil (window window)) @@ -1556,7 +1586,7 @@ (defbinding notebook-prev-page () nil (defbinding notebook-reorder-child (notebook child position) nil (notebook notebook) (child widget) - ((%notebook-position notebook position) int)) + ((%ensure-notebook-position notebook position) int)) (defbinding notebook-popup-enable () nil (notebook notebook)) @@ -1623,7 +1653,7 @@ (defun (setf notebook-menu-label) (menu-label notebook page) (defbinding notebook-query-tab-label-packing (notebook page) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean :out) (fill boolean :out) (pack-type pack-type :out)) @@ -1631,7 +1661,7 @@ (defbinding notebook-query-tab-label-packing (notebook page) nil (defbinding notebook-set-tab-label-packing (notebook page expand fill pack-type) nil (notebook notebook) - ((%notebook-child notebook page) widget) + ((%ensure-notebook-child notebook page) widget) (expand boolean) (fill boolean) (pack-type pack-type)) diff --git a/gtk/gtktree.lisp b/gtk/gtktree.lisp index 0ff7341..1ba05f5 100644 --- a/gtk/gtktree.lisp +++ b/gtk/gtktree.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktree.lisp,v 1.10 2005-04-23 16:48:52 espen Exp $ +;; $Id: gtktree.lisp,v 1.11 2005-09-26 21:34:53 espen Exp $ (in-package "GTK") @@ -957,3 +957,65 @@ (defbinding %icon-view-set-pixbuf-column (column icon-view) nil ((if (integerp column) column (column-index (icon-view-model icon-view) column)) int))) + +#+gtk2.8 +(progn + (defbinding icon-view-get-item-at-pos () boolean + (icon-view icon-view) + (x int) + (y int) + (tree-path tree-path :out) + (cell cell-renderer :out)) + + (defbinding icon-view-set-cursor (icon-view path &key cell start-editing) nil + (icon-view icon-view) + (path tree-path) + (cell (or null cell-renderer)) + (start-editing boolean)) + + (defbinding icon-view-get-cursor () boolean + (icon-view icon-view) + (path tree-path :out) + (cell cell-renderer :out)) + + (defbinding icon-view-get-dest-item-at-pos () boolean + (icon-view icon-view) + (drag-x int) + (drag-y int) + (tree-path tree-path :out) + (pos drop-position :out)) + + (defbinding icon-view-create-drag-icon () gdk:pixmap + (icon-view icon-view) + (tree-path tree-path)) + + (defbinding icon-view-scroll-to-path (icon-view tree-path &key row-align column-align) nil + (icon-view icon-view) + (tree-path tree-path) + ((or row-align column-align) boolean) + (row-align single-float) + (column-align single-float)) + + (defbinding icon-view-get-visible-range () boolean + (icon-view icon-view) + (start-path tree-path :out) + (end-path tree-path :out)) + +;; (defbinding icon-view-enable-model-drag-source () nil +;; (icon-view icon-view) +;; (start-button-mask gdk:modifier-type) +;; (targets (vector target-entry)) +;; ((length targets) unsigned-int) +;; (actions gdk:drag-action)) + +;; (defbinding icon-view-enable-model-drag-dest () nil +;; (icon-view icon-view) +;; (targets (vector target-entry)) +;; ((length targets) unsigned-int) +;; (actions gdk:drag-action)) + + (defbinding icon-view-unset-model-drag-source () nil + (icon-view icon-view)) + + (defbinding icon-view-unset-model-drag-dest () nil + (icon-view icon-view))) diff --git a/gtk/gtktypes.lisp b/gtk/gtktypes.lisp index e93e912..a53956b 100644 --- a/gtk/gtktypes.lisp +++ b/gtk/gtktypes.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktypes.lisp,v 1.38 2005-04-24 13:30:40 espen Exp $ +;; $Id: gtktypes.lisp,v 1.39 2005-09-26 21:34:53 espen Exp $ (in-package "GTK") @@ -375,6 +375,15 @@ (default-height :merge t :unbound -1))) :initarg :submenu :type widget))) + ("GtkMenuShell" + :slots + ((take-focus-p + :allocation :virtual + :getter "gtk_menu_shell_get_take_focus" + :setter "gtk_menu_shell_set_take_focus" + :accessor menu-shell-take-focus-p + :type boolean))) + ("GtkColorSelectionDialog" :slots ((colorsel @@ -396,13 +405,27 @@ (default-height :merge t :unbound -1))) ("GtkScrolledWindow" :slots - ((hscrollbar - :allocation :alien + (#-gtk2.8 + (hscrollbar + :allocation :alien :reader scrolled-window-hscrollbar :type widget) + #-gtk2.8 (vscrollbar :allocation :alien :reader scrolled-window-vscrollbar + :type widget) + #+gtk2.8 + (hscrollbar + :allocation :virtual + :getter "gtk_scrolled_window_get_hscrollbar" + :reader scrolled-window-hscrollbar + :type widget) + #+gtk2.8 + (vscrollbar + :allocation :virtual + :getter "gtk_scrolled_window_get_hscrollbar" + :reader scrolled-window-vscrollbar :type widget))) ("GtkPaned" @@ -1154,3 +1177,7 @@ (defclass accel-group-entry (struct) :allocation :alien :type quark)) (:metaclass struct-class)) + +#+gtk2.8 +(define-enum-type drop-position + :no-drop :drop-into :drop-left :drop-right :drop-above :drop-below) -- [mdw]