Refactoring of GtkEntry
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 13 Sep 2009 12:40:02 +0000 (16:40 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 13 Sep 2009 12:40:02 +0000 (16:40 +0400)
generating.lisp
gtk/gtk.entry.lisp
gtk/gtk.generated-classes.lisp

index 13d36d7..50aca1b 100644 (file)
         (:cffi gtk::line-wrap-mode gtk::label-line-wrap-mode gtk::pango-wrap-mode "gtk_label_line_wrap_mode" "gtk_label_set_line_wrap_mode")
         (:cffi gtk::layout gtk::label-layout g-object "gtk_label_get_layout" nil)
         (:cffi gtk::selection-bounds gtk::label-selection-bounds nil gtk::gtk-label-get-selection-bounds nil)
-        (:cffi gtk::layout-offsets gtk::label-layout-offsets nil gtk::gtk-label-get-layout-offsets nil))))))
+        (:cffi gtk::layout-offsets gtk::label-layout-offsets nil gtk::gtk-label-get-layout-offsets nil))
+       ("GtkEntry"
+        (:cffi gtk::completion gtk::entry-completion (g-object gtk::entry-completion) "gtk_entry_get_completion" "gtk_entry_set_completion")
+        (:cffi gtk::cursor-hadjustment gtk::entry-cursor-hadjustment (g-object gtk::adjustment) "gtk_entry_get_cursor_hadjustment" "gtk_entry_set_cursor_hadjustment")
+        (:cffi gtk::layout-offset gtk::entry-layout-offset nil gtk::gtk-entry-layout-offset nil))))))
 
 (defun gtk-generate-child-properties (filename)
   (with-open-file (stream filename :direction :output :if-exists :supersede)
index dcd7e8d..0b80e87 100644 (file)
   (x (:pointer :int))
   (y (:pointer :int)))
 
-(defun entry-layout-offset (entry)
+(defun gtk-entry-layout-offset (entry)
   (with-foreign-objects ((x :int) (y :int))
     (gtk-entry-get-layout-offsets entry x y)
-    (values (mem-ref x :int) (mem-ref y :int))))
-
-(export 'entry-layout-offset)
+    (list (mem-ref x :int) (mem-ref y :int))))
 
 (defcfun (entry-layout-index-to-text-index "gtk_entry_layout_index_to_text_index") :int
   (entry (g-object entry))
   (layout-index :int))
 
+(export 'entry-layout-index-to-text-index)
+
 (defcfun (entry-text-index-to-layout-index "gtk_entry_text_index_to_layout_index") :int
   (entry (g-object entry))
   (text-index :int))
 
-(defcfun gtk-entry-set-completion :void
-  (entry (g-object entry))
-  (completion (g-object entry-completion)))
-
-(defcfun gtk-entry-get-completion (g-object entry-completion)
-  (entry (g-object entry)))
-
-(defun entry-completion (entry)
-  (gtk-entry-get-completion entry))
+(export 'entry-text-index-to-layout-info)
 
-(defun (setf entry-completion) (completion entry)
-  (gtk-entry-set-completion entry completion))
-
-(export 'entry-completion)
-
-(defcfun gtk-entry-set-cursor-hadjustment :void
+(defcfun (entry-icon-at-pos "gtk_entry_get_icon_at_pos") :int
   (entry (g-object entry))
-  (adjustment (g-object adjustment)))
-
-(defcfun (entry-cursor-hadjustment "gtk_entry_get_cursor_hadjustment") (g-object adjustment)
-  (entry (g-object entry)))
-
-(defun (setf entry-cursor-hadjustment) (adjustment entry)
-  (gtk-entry-set-cursor-hadjustment entry adjustment))
+  (x :int)
+  (y :int))
 
-(export 'entry-cursor-hadjustment)
+(export 'entry-icon-at-pos)
 
 ;; GtkEditable
 
index d51d3f4..768a6c7 100644 (file)
                          t)
                         (width-chars entry-width-chars "width-chars" "gint" t
                          t)
-                        (xalign entry-xalign "xalign" "gfloat" t t)))
+                        (xalign entry-xalign "xalign" "gfloat" t t)
+                        (:cffi completion entry-completion
+                         (g-object entry-completion) "gtk_entry_get_completion"
+                         "gtk_entry_set_completion")
+                        (:cffi cursor-hadjustment entry-cursor-hadjustment
+                         (g-object adjustment)
+                         "gtk_entry_get_cursor_hadjustment"
+                         "gtk_entry_set_cursor_hadjustment")
+                        (:cffi layout-offset entry-layout-offset nil
+                         gtk-entry-layout-offset nil)))
 
 (define-g-object-class "GtkSpinButton" spin-button
                        (:superclass entry :export t :interfaces