[gtk-cffi-cvs] CVS gtk-cffi/gdk

CVS User rklochkov rklochkov at common-lisp.net
Sun Sep 11 15:48:21 UTC 2011


Update of /project/gtk-cffi/cvsroot/gtk-cffi/gdk
In directory tiger.common-lisp.net:/tmp/cvs-serv23132/gdk

Modified Files:
	event.lisp gdk-cffi.asd keys.lisp package.lisp 
Added Files:
	pango.lisp 
Log Message:
Added GdkKeymap


--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/event.lisp	2011/09/10 16:26:10	1.2
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/event.lisp	2011/09/11 15:48:21	1.3
@@ -354,4 +354,4 @@
 (defun parse-event (ev-pointer field)
   (get-slot (if (pointerp ev-pointer)
                 (make-instance 'event :pointer ev-pointer)
-              ev-pointer) field))
\ No newline at end of file
+                ev-pointer) field))
\ No newline at end of file
--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/gdk-cffi.asd	2011/09/10 16:26:10	1.4
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/gdk-cffi.asd	2011/09/11 15:48:21	1.5
@@ -22,7 +22,8 @@
    (:file rectangle :depends-on (loadlib generics))
    (:file screen :depends-on (loadlib generics))
    (:file window :depends-on (loadlib generics))
-   (:file keys :depends-on (package window))
+   (:file pango :depends-on (loadlib generics
+   (:file keys :depends-on (package window pango))
    (:file threads :depends-on (package))
    (:file event :depends-on (loadlib generics window))
    (:file color :depends-on (loadlib generics))
--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/keys.lisp	2011/09/10 16:26:10	1.3
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/keys.lisp	2011/09/11 15:48:21	1.4
@@ -4,6 +4,8 @@
 (defcfun (keyval-name "gdk_keyval_name") :string (val :uint))
 (defcfun (keyval-to-unicode "gdk_keyval_to_unicode") :uint32 (val :uint))
 (defcfun (unicode-to-keyval "gdk_unicode_to_keyval") :uint (val :uint32))
+(defcfun (keyval-to-upper "gdk_keyval_to_upper") :uint (val :uint))
+(defcfun (keyval-to-lower "gdk_keyval_to_lower") :uint (val :uint))
 
 (defun key (value)
   (keyval-from-name (string value)))
@@ -36,7 +38,11 @@
   (level :int))
 
 (defgdkfuns keymap
-  (lookup-key :uint (key keymap-key)))
+  (lookup-key :uint (key keymap-key))
+  (:get direction pango:direction)
+  (have-bidi-layouts :boolean)
+  (:get caps-lock-state :boolean)
+  (:get num-lock-state :boolean))
 
 (defcfun gdk-keymap-translate-keyboard-state :boolean
   (keymap pobject) (hardware-keycode :uint) (state modifier-type) (group :int) 
@@ -57,16 +63,18 @@
 
 (defgeneric entries-for-keyval (keymap keyval))
 (defmethod entries-for-keyval ((keymap keymap) keyval)
-;  (with-array 
     (with-foreign-out (keys '(garray (struct keymap-key))) :if-success
-;'(struct keymap-key) 
-;                            (mem-ref *array-length* :int)) :if-success
       (gdk-keymap-get-entries-for-keyval 
        keymap keyval keys *array-length*)))
 
-;; (defmethod entries-for-keyval ((keymap keymap) keyval)
-;;   (with-array 
-;;     (with-foreign-out (keys '(struct keymap-key) 
-;;                             (mem-ref *array-length* :int)) :if-success
-;;       (gdk-keymap-get-entries-for-keyval 
-;;        keymap keyval keys *array-length*))))
\ No newline at end of file
+(defcfun gdk-keymap-get-entries-for-keycode :boolean
+  (keymap pobject) (hardware-keycode :uint) 
+  (keys :pointer) (keyvals :pointer) (n-keys :pointer))
+
+
+(defgeneric entries-for-keycode (keymap keycode))
+(defmethod entries-for-keycode ((keymap keymap) keycode)
+    (with-foreign-outs ((keys (garray (struct keymap-key)))
+                        (keyvals (garray :uint))) :if-success
+      (gdk-keymap-get-entries-for-keycode
+       keymap keycode keys keyvals *array-length*)))
--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp	2011/08/28 10:31:30	1.3
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp	2011/09/11 15:48:21	1.4
@@ -48,6 +48,12 @@
    #:with-threads
 
    #:key
+   
+   #:keymap
+   #:keycode
+   #:group
+   #:level
+   #:entries-for-keyval
 
    #:gatom
    ))

--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pango.lisp	2011/09/11 15:48:21	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pango.lisp	2011/09/11 15:48:21	1.1
(defpackage #:pango-cffi
  (:use #:common-lisp #:cffi-object #:cffi)
  (:export
   #:font
   #:alignment
   #:ellipsize-mode
   #:stretch
   #:style
   #:underline
   #:variant
   #:wrap-mode
   #:direction))

(in-package #:pango-cffi)

(g-object-cffi:register-package "Pango" *package*)


(defcfun ("pango_font_description_from_string" pango-font)
  :pointer (str gtk-string))

(defcfun ("pango_font_description_to_string" str-pango-font)
  gtk-string (font :pointer))

(define-foreign-type font ()
  ()
  (:actual-type :pointer)
  (:simple-parser font))

(defmethod translate-to-foreign (value (type font))
  (pango-font value))

(defmethod translate-from-foreign (ptr (name font))
  (str-pango-font ptr))

(defcenum alignment
  :left :center :right)

(defcenum ellipsize-mode
  :none :start :middle :end)

(defcenum stretch
  :ultra-condensed
  :extra-condensed
  :dcondensed
  :semi-condensed
  :normal
  :semi-expanded
  :expanded
  :extra-expanded
  :ultra-expanded)

(defcenum style
  :normal :oblique :italic)

(defcenum underline
  :none :single :double :low :error)

(defcenum variant
  :normal :small-caps)

(defcenum wrap-mode
  :word :char :word-char)

(defcenum direction
  :ltr :rtl :ttb-ltr :ttb-ltr :weak-ltr :weak-rtl :neutral)




More information about the gtk-cffi-cvs mailing list