Additions to GtkIconView bindings
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 11 Oct 2009 18:41:42 +0000 (22:41 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 11 Oct 2009 18:42:03 +0000 (22:42 +0400)
api.ods
bugs/issue-2f4e005e8d303828a7607922edd996b9faf0c5d9.yaml
bugs/issue-cd59e8bd909376222bd16cf13c8558a3a024a309.yaml
gtk/gtk.icon-view.lisp

diff --git a/api.ods b/api.ods
index 0d7d8bf..605d63b 100644 (file)
Binary files a/api.ods and b/api.ods differ
index de0af40..a3cf79a 100644 (file)
@@ -1,5 +1,5 @@
 --- !ditz.rubyforge.org,2008-03-06/issue 
-title: add GtkTreeView drag-and-drop binding
+title: add GtkTreeView, GtkIconView drag-and-drop binding
 desc: ""
 type: :task
 component: cl-gtk2
@@ -16,3 +16,7 @@ log_events:
   - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
   - created
   - ""
+- - 2009-10-11 18:41:10.845450 Z
+  - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
+  - edited title
+  - ""
index ed109e4..4242b49 100644 (file)
@@ -5,8 +5,8 @@ type: :task
 component: cl-gtk2
 release: "0.1"
 reporter: Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
-status: :unstarted
-disposition: 
+status: :closed
+disposition: :fixed
 creation_time: 2009-10-02 20:54:04.688339 Z
 references: []
 
@@ -16,3 +16,7 @@ log_events:
   - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
   - created
   - ""
+- - 2009-10-11 18:41:53.751689 Z
+  - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
+  - closed with disposition fixed
+  - ""
index 4984848..fe74def 100644 (file)
 
 (export 'icon-view-get-visible-range)
 
-; TODO: gtk_icon_view_set_tooltip_item
+(defcfun (icon-view-set-tooltip-item "gtk_icon_view_set_tooltip_item") :void
+  (icon-view (g-object icon-view))
+  (tooltip (g-object tooltip))
+  (path (g-boxed-foreign tree-path)))
 
-; TODO: gtk_icon_view_set_tooltip_cell
+(export 'icon-view-set-tooltip-item)
 
-; TODO: gtk_icon_view_get_tooltip_context
+(defcfun (icon-view-set-tooltip-cell "gtk_icon_view_set_tooltip_cell") :void
+  (icon-view (g-object icon-view))
+  (tooltip (g-object tooltip))
+  (path (g-boxed-foreign tree-path))
+  (cell-renderer (g-object cell-renderer)))
+
+(export 'icon-view-set-tooltip-cell)
+
+(defcfun gtk-icon-view-get-tooltip-context :boolean
+  (icon-view (g-object icon-view))
+  (x (:pointer :int))
+  (y (:pointer :int))
+  (keyboard-tip :boolean)
+  (model (:pointer (g-object tree-model)))
+  (path (:pointer (g-boxed-foreign tree-path)))
+  (iter (g-boxed-foreign tree-iter)))
+
+(defun icon-view-get-tooltip-context (icon-view x y keyboard-tip)
+  (with-foreign-objects ((xx :int) (yy :int) (model-ptr :pointer) (path-ptr :pointer))
+    (setf (mem-ref xx :int) x
+          (mem-ref yy :int) y)
+    (let ((iter (make-tree-iter)))
+      (when (gtk-icon-view-get-tooltip-context icon-view xx yy keyboard-tip model-ptr path-ptr iter)
+        (values (mem-ref xx :int) (mem-ref yy :int)
+                (convert-from-foreign (mem-ref model-ptr :pointer) '(g-object tree-model))
+                (convert-from-foreign (mem-ref path-ptr :pointer) '(g-boxed-foreign tree-path :return))
+                iter)))))
 
 ; TODO: gtk_icon_view_enable_model_drag_source