X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/10ec8e36764bc9a579a73f288196ac527f18dd5b..0b311c61d6f1470ccfffc4d68420a4b3478af316:/gdk/gdk.lisp diff --git a/gdk/gdk.lisp b/gdk/gdk.lisp index 30c48b9..3425d11 100644 --- a/gdk/gdk.lisp +++ b/gdk/gdk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gdk.lisp,v 1.19 2006/02/07 13:22:14 espen Exp $ +;; $Id: gdk.lisp,v 1.22 2006/02/26 15:09:44 espen Exp $ (in-package "GDK") @@ -422,14 +422,12 @@ ;;; Cursor -(defmethod initialize-instance ((cursor cursor) &key type mask fg bg - (x 0) (y 0) (display (display-get-default))) - (setf - (slot-value cursor 'location) - (etypecase type - (keyword (%cursor-new-for-display display type)) - (pixbuf (%cursor-new-from-pixbuf display type x y)) - (pixmap (%cursor-new-from-pixmap type mask fg bg x y))))) +(defmethod allocate-foreign ((cursor cursor) &key type mask fg bg + (x 0) (y 0) (display (display-get-default))) + (etypecase type + (keyword (%cursor-new-for-display display type)) + (pixbuf (%cursor-new-from-pixbuf display type x y)) + (pixmap (%cursor-new-from-pixmap type mask fg bg x y)))) (defbinding %cursor-new-for-display () pointer @@ -690,9 +688,15 @@ (defbinding keyval-name () string (keyval unsigned-int)) -(defbinding keyval-from-name () unsigned-int +(defbinding %keyval-from-name () unsigned-int (name string)) +(defun keyval-from-name (name) + "Returns the keysym value for the given key name or NIL if it is not a valid name." + (let ((keyval (%keyval-from-name name))) + (unless (zerop keyval) + keyval))) + (defbinding keyval-to-upper () unsigned-int (keyval unsigned-int))