chiark / gitweb /
Changed to use of settable FOREIGN-LOCATION
[clg] / gtk / gtktree.lisp
index ba275c127e7528bf7b23e85a84a21a94ac0d42e6..9b408f5f1c4abf6b17f7f91bca413f2e9d166a03 100644 (file)
@@ -1,21 +1,26 @@
-;; Common Lisp bindings for GTK+ v2.0
-;; Copyright (C) 1999-2005 Espen S. Johnsen <espen@users.sf.net>
+;; Common Lisp bindings for GTK+ v2.x
+;; Copyright 2004-2005 Espen S. Johnsen <espen@users.sf.net>
 ;;
-;; This library is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU Lesser General Public
-;; License as published by the Free Software Foundation; either
-;; version 2 of the License, or (at your option) any later version.
+;; Permission is hereby granted, free of charge, to any person obtaining
+;; a copy of this software and associated documentation files (the
+;; "Software"), to deal in the Software without restriction, including
+;; without limitation the rights to use, copy, modify, merge, publish,
+;; distribute, sublicense, and/or sell copies of the Software, and to
+;; permit persons to whom the Software is furnished to do so, subject to
+;; the following conditions:
 ;;
-;; This library is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; Lesser General Public License for more details.
+;; The above copyright notice and this permission notice shall be
+;; included in all copies or substantial portions of the Software.
 ;;
-;; You should have received a copy of the GNU Lesser General Public
-;; License along with this library; if not, write to the Free Software
-;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+;; 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.9 2005-03-13 18:12:24 espen Exp $
+;; $Id: gtktree.lisp,v 1.13 2006-02-08 22:21:07 espen Exp $
 
 
 (in-package "GTK")
@@ -271,7 +276,8 @@ (defmethod writer-function ((type (eql 'tree-path)) &rest args)
 (defmethod reader-function ((type (eql 'tree-path)) &rest args)
   (declare (ignore type args))
   (let ((reader (reader-function 'pointer)))
-    #'(lambda (location &optional (offset 0))
+    #'(lambda (location &optional (offset 0) weak-p)
+       (declare (ignore weak-p))
        (%tree-path-to-vector (funcall reader location offset)))))
 
 (defmethod destroy-function ((type (eql 'tree-path)) &rest args)
@@ -287,7 +293,7 @@ (defbinding %tree-row-reference-new () pointer
 
 (defmethod initialize-instance ((reference tree-row-reference) &key model path)
   (setf
-   (slot-value reference 'location)
+   (foreign-location reference)
    (%tree-row-reference-new model path))
   (call-next-method))
 
@@ -952,3 +958,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)))