more gdk d'n'd functions
authorAndrey Kutejko <andy128k@gmail.com>
Thu, 12 Nov 2009 19:06:46 +0000 (21:06 +0200)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Thu, 26 Nov 2009 18:01:15 +0000 (21:01 +0300)
gdk/gdk.dnd.lisp
gdk/gdk.objects.lisp

index 20d5344..257059f 100644 (file)
@@ -1,5 +1,91 @@
 (in-package :gdk)
 
+(gobject:define-g-enum "GdkDragProtocol" drag-protocol
+  (:export t :type-initializer "gdk_drag_protocol_get_type")
+  (:motif 0)
+  (:xdnd 1)
+  (:rootwin 2)
+  (:none 3)
+  (:win32-dropfiles 4)
+  (:ole2 5)
+  (:local 6))
+
+(define-g-flags "GdkDragAction" drag-action
+    (:export t :type-initializer "gdk_drag_action_get_type")
+  (:default 1)
+  (:copy 2)
+  (:move 4)
+  (:link 8)
+  (:private 16)
+  (:ask 32))
+
+(defcfun gdk-drag-get-selection gdk-atom
+  (context g-object))
+
+(defun drag-get-selection (context)
+  (gdk-drag-get-selection context))
+
+(export 'drag-get-selection)
+
+(defcfun gdk-drag-abort :void
+  (context g-object)
+  (time :uint32))
+
+(defun drag-abort (context time)
+  (gdk-drag-abort context time))
+
+(export 'drag-abort)
+
+(defcfun gdk-drop-reply :void
+  (context g-object)
+  (ok :boolean)
+  (time :uint32))
+
+(defun drop-reply (context ok time)
+  (gdk-drop-reply context ok time))
+
+(export 'drop-reply)
+
+;; TODO : GdkDragContext * gdk_drag_context_new(void);
+
+(defcfun gdk-drag-drop :void
+  (context g-object)
+  (time :uint32))
+
+(defun drag-drop (context time)
+  (gdk-drag-drop context time))
+
+(export 'drag-drop)
+
+#|
+void                gdk_drag_find_window                (GdkDragContext *context,
+                                                         GdkWindow *drag_window,
+                                                         gint x_root,
+                                                         gint y_root,
+                                                         GdkWindow **dest_window,
+                                                         GdkDragProtocol *protocol);
+
+void                gdk_drag_find_window_for_screen     (GdkDragContext *context,
+                                                         GdkWindow *drag_window,
+                                                         GdkScreen *screen,
+                                                         gint x_root,
+                                                         gint y_root,
+                                                         GdkWindow **dest_window,
+                                                         GdkDragProtocol *protocol);
+
+GdkDragContext *    gdk_drag_begin                      (GdkWindow *window,
+                                                         GList *targets);
+
+gboolean            gdk_drag_motion                     (GdkDragContext *context,
+                                                         GdkWindow *dest_window,
+                                                         GdkDragProtocol protocol,
+                                                         gint x_root,
+                                                         gint y_root,
+                                                         GdkDragAction suggested_action,
+                                                         GdkDragAction possible_actions,
+                                                         guint32 time_);
+|#
+
 (defcfun gdk-drop-finish :void
   (context g-object)
   (success :boolean)
 
 (export 'drop-finish)
 
+(defcfun gdk-drag-get-protocol native-window
+  (xid native-window)
+  (protocol :pointer))
+
+(defun drag-get-protocol (xid)
+  (with-foreign-objects ((protocol 'drag-protocol))
+    (let ((result (gdk-drag-get-protocol xid protocol)))
+      (values result
+              (mem-ref protocol 'drag-protocol)))))
+
+(export 'drag-get-protocol)
+
+(defcfun gdk-drag-get-protocol-for-display native-window
+  (display g-object)
+  (xid native-window)
+  (protocol :pointer))
+  
+(defun drag-get-protocol-for-display (display xid)
+  (with-foreign-objects ((protocol 'drag-protocol))
+    (let ((result (gdk-drag-get-protocol-for-display display xid protocol)))
+      (values result
+              (mem-ref protocol 'drag-protocol)))))
+
+(export 'drag-get-protocol-for-display)
+
 (defcfun gdk-drag-status :void
   (context g-object)
   (action drag-action)
 
 (export 'drag-status)
 
+(defcfun gdk-drag-drop-succeeded :boolean
+  (context g-object))
+
+(defun drag-drop-succeeded (context)
+  (gdk-drag-drop-succeeded context))
+
+(export 'drag-drop-succeeded)
+
index 9326171..78774d5 100644 (file)
   (:bilevel 0)
   (:full 1))
 
-(define-g-flags "GdkDragAction" drag-action
-    (:export t :type-initializer "gdk_drag_action_get_type")
-  (:default 1)
-  (:copy 2)
-  (:move 4)
-  (:link 8)
-  (:private 16)
-  (:ask 32))
-
 (define-g-enum "GdkColorspace" colorspace ()
   :rgb)