From rklochkov at common-lisp.net Thu Feb 9 15:31:33 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Thu, 09 Feb 2012 07:31:33 -0800 Subject: [gtk-cffi-cvs] CVS cl-table Message-ID: Update of /project/gtk-cffi/cvsroot/cl-table In directory tiger.common-lisp.net:/tmp/cvs-serv14494 Log Message: Initial release of CL-Table Status: Vendor Tag: cl-table Release Tags: start N cl-table/cl-table.lisp N cl-table/cl-table.fasl N cl-table/package.lisp N cl-table/package.fasl N cl-table/table.lisp N cl-table/test.lisp N cl-table/cl-table.asd N cl-table/table.fasl N cl-table/iterator.lisp No conflicts created by this import From rklochkov at common-lisp.net Sun Feb 12 17:29:41 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:41 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/ext Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/ext In directory tiger.common-lisp.net:/tmp/cvs-serv24265/ext Modified Files: lisp-model.lisp package.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/ext/lisp-model.lisp 2012/01/25 19:15:08 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/ext/lisp-model.lisp 2012/02/12 17:29:41 1.3 @@ -83,8 +83,8 @@ (:method ((lisp-model-array lisp-model-array)) (length (larray lisp-model-array)))) -(defgeneric get-iter (lisp-model) - (:method get-iter ((lisp-model-impl lisp-model-impl) iter path) +(defgeneric get-iter (lisp-model iter path) + (:method ((lisp-model-impl lisp-model-impl) iter path) (warn "Undefined implementation of GET-ITER for ~a" lisp-model-impl))) (defun set-iter (iter index) --- /project/gtk-cffi/cvsroot/gtk-cffi/ext/package.lisp 2012/01/21 18:37:52 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/ext/package.lisp 2012/02/12 17:29:41 1.2 @@ -2,7 +2,7 @@ (defpackage gtk-cffi-ext (:use #:common-lisp #:cffi #:alexandria #:iterate - #:cffi-object #:g-object-cffi #:g-lib-cffi #:gdk-cffi + #:cffi-objects #:g-object-cffi #:g-lib-cffi #:gdk-cffi #:gtk-cffi-utils #:gtk-cffi) (:shadowing-import-from #:gtk-cffi #:image #:window) (:import-from #:gtk-cffi From rklochkov at common-lisp.net Sun Feb 12 17:29:41 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:41 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/g-lib Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-lib In directory tiger.common-lisp.net:/tmp/cvs-serv24265/g-lib Modified Files: error.lisp g-lib-cffi.asd package.lisp quark.lisp variant.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp 2011/10/23 08:39:53 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp 2012/02/12 17:29:41 1.3 @@ -26,7 +26,7 @@ "GError struct" (domain g-quark) (errno :int) - (message gtk-string)) + (message :string)) (defun get-error (g-error) (let ((p (mem-ref (pointer g-error) :pointer))) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/g-lib-cffi.asd 2011/08/26 17:16:13 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/g-lib-cffi.asd 2012/02/12 17:29:41 1.3 @@ -14,7 +14,7 @@ :author "Roman Klochkov " :version "0.1" :license "BSD" - :depends-on (cffi-object) + :depends-on (cffi-objects iterate gtk-cffi-utils) :components ((:file package) (:file loadlib :depends-on (package)) @@ -22,5 +22,6 @@ (:file quark :depends-on (loadlib)) (:file array :depends-on (loadlib)) (:file error :depends-on (quark)) + (:file variant :depends-on (error)) (:file file :depends-on (loadlib)) (:file mainloop :depends-on (loadlib)))) \ No newline at end of file --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/package.lisp 2012/01/25 19:15:08 1.6 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/package.lisp 2012/02/12 17:29:41 1.7 @@ -9,7 +9,7 @@ (defpackage #:g-lib-cffi (:nicknames #:g-lib #:glib) - (:use #:common-lisp #:cffi #:cffi-object #:iterate #:alexandria) + (:use #:common-lisp #:cffi-objects #:iterate #:alexandria) (:export ;; gerror macro #:with-g-error @@ -20,6 +20,7 @@ #:g-quark #:string-list #:variant-type + #:variant #:g-error #:get-error --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/quark.lisp 2011/08/26 17:16:13 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/quark.lisp 2012/02/12 17:29:41 1.3 @@ -12,9 +12,9 @@ (defctype g-quark :uint32) -(defcfun g-quark-to-string gtk-string (quark g-quark)) +(defcfun g-quark-to-string :string (quark g-quark)) -(defcfun g-intern-string :pointer (string gtk-string)) +(defcfun g-intern-string :pointer (string :string)) -(defcfun g-intern-static-string :pointer (string gtk-dyn-string)) +(defcfun g-intern-static-string :pointer (string (pstring :free :none))) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/variant.lisp 2012/01/28 13:44:45 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/variant.lisp 2012/02/12 17:29:41 1.2 @@ -8,7 +8,7 @@ (in-package #:g-lib-cffi) (define-foreign-type variant-type (freeable) - ((free :initform t)) + () (:actual-type :pointer) (:simple-parser variant-type)) @@ -22,10 +22,41 @@ (defmethod translate-from-foreign (ptr (type variant-type)) (declare (type foreign-pointer ptr)) - (when ptr + (when (not (null-pointer-p ptr)) (foreign-string-to-lisp (g-variant-type-peek-string ptr) :count (g-variant-type-get-string-length ptr)))) -(defmethod translate-to-foreign (str (type variant-type)) +(defmethod translate-to-foreign ((str string) (type variant-type)) (g-variant-type-new str)) + +(define-foreign-type variant (freeable) + ((free :initform t)) + (:actual-type :pointer) + (:simple-parser variant)) + +(defcfun g-variant-parse :pointer + (type variant-type) (text :pointer) (limit :pointer) (end :pointer) + (g-error g-error)) + +(defcfun g-variant-print (:string :free-from-foreign t) + (variant :pointer) (annotate :boolean)) + +(defcfun g-variant-unref :void (variant :pointer)) + +(defmethod free-ptr ((type variant) ptr) + (g-variant-unref ptr)) + +(defmethod translate-from-foreign (ptr (type variant-type)) + (g-variant-print ptr t)) + +(defmethod translate-to-foreign ((str string) (type variant-type)) + (destructuring-bind (fstr len) (foreign-string-alloc str) + (let (ptr) + (with-g-error g-error + (setf ptr + (g-variant-parse (null-pointer) fstr (inc-pointer fstr len) + (null-pointer) g-error)) + (when (null-pointer-p ptr) (error "GError: ~a" g-error))) + (foreign-string-free str) + ptr))) From rklochkov at common-lisp.net Sun Feb 12 17:29:41 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:41 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/g-object Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-object In directory tiger.common-lisp.net:/tmp/cvs-serv24265/g-object Modified Files: defslots.lisp g-object-cffi.asd g-object-class.lisp g-value.lisp loadlib.lisp package.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/defslots.lisp 2012/01/25 19:15:08 1.8 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/defslots.lisp 2012/02/12 17:29:41 1.9 @@ -16,8 +16,8 @@ (defun get-prefix () (cdr (assoc *package* *gtk-prefixes*))) -(defun pair (maybe-pair) - (if (consp maybe-pair) maybe-pair (cons maybe-pair maybe-pair))) +;(defun pair (maybe-pair) +; (if (consp maybe-pair) maybe-pair (cons maybe-pair maybe-pair))) (defun expand-defslot (prefix current-class slot-name slot-type) (destructuring-bind (name-lisp . name-gtk) (pair slot-name) @@ -54,7 +54,7 @@ (defgdkslots 'gdk) (defslots (get-prefix))) (destructuring-bind (name prefix) param - `(defmacro ,name (current-class &rest slots) + `(defmacro ,name (current-class &body slots) (expand-defslots ,prefix current-class slots)))) (defun expand-deffun (prefix name res-type class params &key get) @@ -127,7 +127,7 @@ (defgdkfuns 'gdk) (deffuns (get-prefix))) (destructuring-bind (name prefix) param - `(defmacro ,name (class &rest funs) + `(defmacro ,name (class &body funs) (expand-deffuns ,prefix class funs)))) (defmacro with-object ((name &optional for-free) init &rest body) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-cffi.asd 2011/08/26 17:16:13 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-cffi.asd 2012/02/12 17:29:41 1.4 @@ -13,7 +13,7 @@ :description "GObject,GType and GValue staff for gtk-cffi" :author "Roman Klochkov " :version "0.3" - :license "LGPL" + :license "BSD" :depends-on (cffi-object g-lib-cffi gtk-cffi-utils) :components ((:file package) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-class.lisp 2011/09/10 16:26:10 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-class.lisp 2012/02/12 17:29:41 1.5 @@ -48,12 +48,12 @@ (defmethod name ((g-param-spec g-param-spec)) (g-param-spec-get-name g-param-spec)) -(defcfun "g_param_spec_get_nick" gtk-string (param pobject)) +(defcfun "g_param_spec_get_nick" :string (param pobject)) (defmethod nick ((g-param-spec g-param-spec)) (g-param-spec-get-nick g-param-spec)) -(defcfun "g_param_spec_get_blurb" gtk-string (param pobject)) +(defcfun "g_param_spec_get_blurb" :string (param pobject)) (defmethod blurb ((g-param-spec g-param-spec)) (g-param-spec-get-blurb g-param-spec)) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-value.lisp 2011/08/26 17:16:13 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-value.lisp 2012/02/12 17:29:41 1.3 @@ -40,7 +40,7 @@ (defcfun "g_value_set_double" :void (g-value pobject) (val :double)) (defcfun "g_value_set_enum" :void (g-value pobject) (val :int)) (defcfun "g_value_set_flags" :void (g-value pobject) (val :uint)) -(defcfun "g_value_set_string" :void (g-value pobject) (val gtk-string)) +(defcfun "g_value_set_string" :void (g-value pobject) (val :string)) (defcfun "g_value_set_param" :void (g-value pobject) (val :pointer)) (defcfun "g_value_set_boxed" :void (g-value pobject) (val :pointer)) (defcfun "g_value_set_pointer" :void (g-value pobject) (val :pointer)) @@ -115,7 +115,7 @@ (defcfun "g_value_get_double" :double (g-value :pointer)) (defcfun "g_value_get_enum" :int (g-value :pointer)) (defcfun "g_value_get_flags" :uint (g-value :pointer)) -(defcfun "g_value_get_string" gtk-string (g-value :pointer)) +(defcfun "g_value_get_string" :string (g-value :pointer)) (defcfun "g_value_get_param" :pointer (g-value :pointer)) (defcfun "g_value_get_boxed" :pointer (g-value :pointer)) (defcfun "g_value_get_pointer" pobject (g-value :pointer)) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/loadlib.lisp 2012/01/25 19:15:08 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/loadlib.lisp 2012/02/12 17:29:41 1.3 @@ -8,9 +8,8 @@ (in-package #:g-object-cffi) -(eval-when (:compile-toplevel :load-toplevel :execute) - (define-foreign-library :g-object - (:unix "libgobject-2.0.so") - (:windows "libgobject-2.0-0.dll")) +(define-foreign-library :g-object + (:unix "libgobject-2.0.so") + (:windows "libgobject-2.0-0.dll")) - (load-foreign-library :g-object)) \ No newline at end of file +(use-foreign-library :g-object) \ No newline at end of file --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/package.lisp 2012/01/25 19:15:08 1.8 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/package.lisp 2012/02/12 17:29:41 1.9 @@ -8,9 +8,8 @@ (in-package #:cl-user) (defpackage #:g-object-cffi - (:use #:common-lisp #:cffi #:alexandria #:iterate - #:cffi-object #:g-lib-cffi #:gtk-cffi-utils) - (:import-from #:cffi-object *objects*) + (:use #:common-lisp #:alexandria #:iterate + #:cffi-objects #:g-lib-cffi #:gtk-cffi-utils) (:export #:g-object From rklochkov at common-lisp.net Sun Feb 12 17:29:41 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:41 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gdk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gdk In directory tiger.common-lisp.net:/tmp/cvs-serv24265/gdk Modified Files: atom.lisp color.lisp package.lisp pixbuf.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/atom.lisp 2011/08/28 10:32:37 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/atom.lisp 2012/02/12 17:29:41 1.2 @@ -8,7 +8,7 @@ (in-package :gdk-cffi) (defcfun gdk-atom-name :string (atom :pointer)) -(defcfun gdk-atom-intern-static-string :pointer (val gtk-dyn-string)) +(defcfun gdk-atom-intern-static-string :pointer (val (pstring :free :none))) (defcfun gdk-atom-intern :pointer (val :string) (only-if-exists :boolean)) (define-foreign-type gatom () --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/color.lisp 2012/01/25 19:15:08 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/color.lisp 2012/02/12 17:29:41 1.5 @@ -7,8 +7,8 @@ (green :int16) (blue :int16)) -(defcfun "gdk_color_parse" :boolean (str gtk-string) (color color-struct)) -(defcfun "gdk_color_to_string" gtk-string (color color-struct)) +(defcfun "gdk_color_parse" :boolean (str :string) (color color-struct)) +(defcfun "gdk_color_to_string" :string (color color-struct)) (defcfun gdk-color-free :void (color :pointer)) (define-foreign-type color-cffi (freeable) --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp 2012/01/25 19:15:08 1.7 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp 2012/02/12 17:29:41 1.8 @@ -9,7 +9,7 @@ (defpackage #:gdk-cffi (:use #:common-lisp #:alexandria - #:cffi #:cffi-object #:g-lib-cffi #:g-object-cffi) + #:cffi-objects #:g-lib-cffi #:g-object-cffi) (:import-from #:cl-cairo2 #:x #:y #:width #:height #:cairo_rectangle_t) (:export ; types --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pixbuf.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pixbuf.lisp 2012/02/12 17:29:41 1.3 @@ -7,10 +7,10 @@ (bits-per-sample :int) (width :int) (height :int)) (defcfun "gdk_pixbuf_new_from_file" :pointer - (filename gtk-string) (gerror pobject)) + (filename :string) (gerror pobject)) (defcfun "gdk_pixbuf_new_from_file_at_scale" :pointer - (filename gtk-string) (width :int) (height :int) + (filename :string) (width :int) (height :int) (preserve-aspect :boolean) (gerror pobject)) (defcfun "gdk_pixbuf_new_subpixbuf" :pointer From rklochkov at common-lisp.net Sun Feb 12 17:29:41 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:41 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gio Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gio In directory tiger.common-lisp.net:/tmp/cvs-serv24265/gio Modified Files: action-group.lisp application.lisp loadlib.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/action-group.lisp 2012/01/25 19:15:08 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/action-group.lisp 2012/02/12 17:29:41 1.2 @@ -10,10 +10,16 @@ (defclass action-group (object) ()) (deffuns action-group - (has-action :boolean (action-name gtk-string)) + (has-action :boolean (action-name :string)) (list-actions (string-list :free t)) - (:get action-enabled :boolean (action-name gtk-string))) -; (:get action-parameter-type variant-type (action-name gtk-string)) -; (:get action-state-type variant-type (action-name gtk-string))) + (:get action-enabled :boolean (action-name :string)) + (:get action-parameter-type variant-type (action-name :string)) + (:get action-state-type variant-type (action-name :string)) + (:get action-state-hint variant (action-name :string)) + (:get action-state variant (action-name :string)) + (change-action-state :void (action-name :string) (value variant)) + (activate-action :void (action-name :string) (parameter variant))) + + \ No newline at end of file --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/application.lisp 2012/01/21 18:37:52 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/application.lisp 2012/02/12 17:29:41 1.2 @@ -7,5 +7,40 @@ (in-package :gio-cffi) -(defclass application (g-object simple-action-group) ()) +(defclass application (g-object action-group) ()) +(defbitfield application-flags + :none :is-service :is-launcher :handles-open :handles-command-line + :send-environment :non-unique) + +(defcfun g-application-new :pointer + (application-id :string) (flags application-flags)) + +(defslots application + application-id :string + inactivity-timeout :uint + flags application-flags) + +(deffuns application + (:set action-group pobject) + (:get is-registered :boolean) + (:get is-remote :boolean) + (hold :void) + (release :void) + (activate :void)) + +(defcfun g-application-run :void (application pobject) + (argc :int) (argv :pointer)) + +(defgeneric run (application &key params &allow-other-keys) + (:method ((application application) &key args) + (if args + (with-foreign-object (ptr :string (length args)) + (iter + (for i from 0) + (for arg in args) + (setf (mem-aref ptr :string i) arg)) + (g-application-run application (length args) ptr)) + (g-application-run application 0 (null-pointer))))) + +; (register :boolean --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/loadlib.lisp 2012/01/25 19:15:08 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/loadlib.lisp 2012/02/12 17:29:41 1.2 @@ -1,8 +1,7 @@ (in-package #:gio-cffi) -(eval-when (:compile-toplevel :load-toplevel :execute) - (define-foreign-library :gio - (:unix "libgio-2.0.so") - (:windows "libgio-2.0-0.dll")) +(define-foreign-library :gio + (:unix "libgio-2.0.so") + (:windows "libgio-2.0-0.dll")) - (load-foreign-library :gio)) \ No newline at end of file +(use-foreign-library :gio) \ No newline at end of file From rklochkov at common-lisp.net Sun Feb 12 17:29:42 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 09:29:42 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gtk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gtk In directory tiger.common-lisp.net:/tmp/cvs-serv24265/gtk Modified Files: button.lisp dialog.lisp entry.lisp expander.lisp file-chooser-button.lisp file-chooser-dialog.lisp file-chooser.lisp frame.lisp icon.lisp image.lisp label.lisp menu-item.lisp message-dialog.lisp package.lisp statusbar.lisp text-buffer.lisp text-mark.lisp tree-model.lisp tree-view-column.lisp widget.lisp window.lisp Log Message: Changed from cffi to cffi-objects Dropped GTK-STRING --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/button.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/button.lisp 2012/02/12 17:29:42 1.2 @@ -5,11 +5,11 @@ (defcfun "gtk_button_new" :pointer) -(defcfun "gtk_button_new_with_label" :pointer (label gtk-string)) +(defcfun "gtk_button_new_with_label" :pointer (label :string)) -(defcfun "gtk_button_new_with_mnemonic" :pointer (label gtk-string)) +(defcfun "gtk_button_new_with_mnemonic" :pointer (label :string)) -(defcfun "gtk_button_new_from_stock" :pointer (label gtk-string)) +(defcfun "gtk_button_new_from_stock" :pointer (label :string)) (defmethod gconstructor ((button button) &key label type &allow-other-keys) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/dialog.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/dialog.lisp 2012/02/12 17:29:42 1.3 @@ -13,7 +13,7 @@ :apply :no :yes :close :cancel :ok :delete :accept :reject :none) (defcfun "gtk_dialog_new_with_buttons" - :pointer (title gtk-string) + :pointer (title :string) (parent pobject) (flags dialog-flags) (null :pointer)) (defcfun "gtk_dialog_new" :pointer) @@ -43,7 +43,7 @@ resp)) (defcfun "gtk_dialog_add_button" pobject (dialog pobject) - (str gtk-string) (resp dialog-response)) + (str :string) (resp dialog-response)) (defmethod add-button ((dialog dialog) str response) (gtk-dialog-add-button dialog (if (keywordp str) (string-downcase str) str) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/entry.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/entry.lisp 2012/02/12 17:29:42 1.3 @@ -18,8 +18,8 @@ &key &allow-other-keys) (gtk-entry-new)) -(defcfun gtk-entry-get-text gtk-string (entry pobject)) -(defcfun gtk-entry-set-text :void (entry pobject) (text gtk-string)) +(defcfun gtk-entry-get-text :string (entry pobject)) +(defcfun gtk-entry-set-text :void (entry pobject) (text :string)) (defmethod text ((entry entry) &rest rest) (declare (ignore rest)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/expander.lisp 2011/08/26 17:16:14 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/expander.lisp 2012/02/12 17:29:42 1.2 @@ -3,8 +3,8 @@ (defclass expander (bin) ()) -(defcfun gtk-expander-new-with-mnemonic :pointer (label gtk-string)) -(defcfun gtk-expander-new :pointer (label gtk-string)) +(defcfun gtk-expander-new-with-mnemonic :pointer (label :string)) +(defcfun gtk-expander-new :pointer (label :string)) (defmethod gconstructor ((expander expander) &key label mnemonic &allow-other-keys) @@ -13,7 +13,7 @@ (gtk-expander-new label))) (defgtkslots expander - label gtk-string + label :string spacing :int expanded :boolean use-underline :boolean --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser-button.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser-button.lisp 2012/02/12 17:29:42 1.3 @@ -4,10 +4,10 @@ ()) (defcfun "gtk_file_chooser_button_new" :pointer - (title gtk-string) (action file-chooser-action)) + (title :string) (action file-chooser-action)) ;(defcfun "gtk_file_chooser_button_new_with_backend" :pointer -; (title gtk-string) (action file-chooser-action) (backend gtk-string)) +; (title :string) (action file-chooser-action) (backend :string)) (defmethod gconstructor ((file-chooser-button file-chooser-button) &key title action &allow-other-keys) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser-dialog.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser-dialog.lisp 2012/02/12 17:29:42 1.3 @@ -4,16 +4,16 @@ ()) (defcfun "gtk_file_chooser_dialog_new" :pointer - (title gtk-string) (parent pobject) (action file-chooser-action) - (but1-text gtk-string) (but1-response dialog-response) - (but2-text gtk-string) (but2-response dialog-response) + (title :string) (parent pobject) (action file-chooser-action) + (but1-text :string) (but1-response dialog-response) + (but2-text :string) (but2-response dialog-response) (null :pointer)) ;; (defcfun "gtk_file_chooser_dialog_new_with_backend" :pointer -;; (title gtk-string) (parent pobject) (action file-chooser-action) -;; (backend gtk-string) -;; (but1-text gtk-string) (but1-response dialog-response) -;; (but2-text gtk-string) (but2-response dialog-response) +;; (title :string) (parent pobject) (action file-chooser-action) +;; (backend :string) +;; (but1-text :string) (but1-response dialog-response) +;; (but2-text :string) (but2-response dialog-response) ;; (null :pointer)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/file-chooser.lisp 2012/02/12 17:29:42 1.2 @@ -7,12 +7,12 @@ :open :save :select-folder :create-folder) (defcfun "gtk_file_chooser_set_filename" :boolean - (chooser pobject) (filename gtk-string)) + (chooser pobject) (filename :string)) (defmethod (setf filename) (filename (file-chooser file-chooser)) (gtk-file-chooser-set-filename file-chooser filename)) -(defcfun "gtk_file_chooser_get_filename" gtk-string (chooser pobject)) +(defcfun "gtk_file_chooser_get_filename" :string (chooser pobject)) (defmethod filename ((file-chooser file-chooser)) (gtk-file-chooser-get-filename file-chooser)) \ No newline at end of file --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/frame.lisp 2011/09/15 10:28:21 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/frame.lisp 2012/02/12 17:29:42 1.3 @@ -3,7 +3,7 @@ (defclass frame (bin) ()) -(defcfun "gtk_frame_new" :pointer (label gtk-string)) +(defcfun "gtk_frame_new" :pointer (label :string)) (defmethod gconstructor ((frame frame) &key label &allow-other-keys) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/icon.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/icon.lisp 2012/02/12 17:29:42 1.3 @@ -23,9 +23,9 @@ (defgtkslots icon-source direction text-direction direction-wildcarded :boolean - filename gtk-string + filename :string pixbuf pobject - icon-name gtk-string + icon-name :string size icon-size size-wildcarded :boolean state state --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/image.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/image.lisp 2012/02/12 17:29:42 1.2 @@ -3,12 +3,12 @@ (defclass image (misc) ()) -(defcfun "gtk_image_new_from_file" :pointer (filename gtk-string)) +(defcfun "gtk_image_new_from_file" :pointer (filename :string)) ;(defcenum "gtk_image_new_from_icon_set" :pointer ; (icon-set pobject) (icon-size icon-size)) (defcfun "gtk_image_new_from_pixbuf" :pointer (pixbuf pobject)) (defcfun "gtk_image_new_from_stock" :pointer - (stock-id gtk-string) (size icon-size)) + (stock-id :string) (size icon-size)) (defmethod gconstructor ((image image) &key file pixbuf stock-id icon-size) (cond --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/label.lisp 2012/01/27 18:41:31 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/label.lisp 2012/02/12 17:29:42 1.3 @@ -6,22 +6,22 @@ (defcenum justification :left :right :center :fill) -(defcfun "gtk_label_new" :pointer (text gtk-string)) +(defcfun "gtk_label_new" :pointer (text :string)) (defmethod gconstructor ((label label) &key text &allow-other-keys) (gtk-label-new text)) -(defcfun "gtk_label_set_markup" :void (label pobject) (text gtk-string)) +(defcfun "gtk_label_set_markup" :void (label pobject) (text :string)) (defcfun "gtk_label_set_markup_with_mnemonic" - :void (label pobject) (text gtk-string)) + :void (label pobject) (text :string)) (defcfun "gtk_label_set_text_with_mnemonic" - :void (label pobject) (text gtk-string)) + :void (label pobject) (text :string)) (defcfun "gtk_label_set_text" - :void (label pobject) (text gtk-string)) + :void (label pobject) (text :string)) (defmethod (setf text) (text (label label) &key mnemonic markup) (apply @@ -33,9 +33,9 @@ #'gtk-label-set-text)) (list label text))) -(defcfun "gtk_label_get_text" gtk-string (label pobject)) +(defcfun "gtk_label_get_text" :string (label pobject)) -(defcfun "gtk_label_get_label" gtk-string (label pobject)) +(defcfun "gtk_label_get_label" :string (label pobject)) (defmethod text ((label label) &key markup) (apply --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/menu-item.lisp 2011/08/28 10:30:13 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/menu-item.lisp 2012/02/12 17:29:42 1.2 @@ -11,8 +11,8 @@ ()) (defcfun gtk-menu-item-new :pointer) -(defcfun gtk-menu-item-new-with-label :pointer (label gtk-string)) -(defcfun gtk-menu-item-new-with-mnemonic :pointer (label gtk-string)) +(defcfun gtk-menu-item-new-with-label :pointer (label :string)) +(defcfun gtk-menu-item-new-with-mnemonic :pointer (label :string)) (defmethod gconstructor ((menu-item menu-item) &key label mnemonic &allow-other-keys) @@ -24,10 +24,10 @@ (defgtkslots menu-item right-justified :boolean - label gtk-string + label :string use-underline :boolean submenu pobject - accel-path gtk-string + accel-path :string reserve-indicator :boolean) (defgtkfun select :void menu-item) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2012/02/12 17:29:42 1.2 @@ -11,11 +11,11 @@ (defcfun "gtk_message_dialog_new" :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) - (message gtk-string) (null :pointer)) + (message :string) (null :pointer)) (defcfun "gtk_message_dialog_new_with_markup" :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) - (message gtk-string) (null :pointer)) + (message :string) (null :pointer)) (defmethod gconstructor ((message-dialog message-dialog) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/01/25 19:15:08 1.12 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/02/12 17:29:42 1.13 @@ -8,8 +8,8 @@ (in-package #:cl-user) (defpackage gtk-cffi - (:use #:common-lisp #:cffi #:alexandria #:iterate - #:cffi-object #:g-object-cffi #:g-lib-cffi #:gdk-cffi + (:use #:common-lisp #:alexandria #:iterate + #:cffi-objects #:g-object-cffi #:g-lib-cffi #:gdk-cffi #:gtk-cffi-utils) (:shadow #:image #:window) (:export --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/statusbar.lisp 2011/09/15 10:28:21 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/statusbar.lisp 2012/02/12 17:29:42 1.4 @@ -9,9 +9,9 @@ (gtk-statusbar-new)) (defgtkfuns statusbar - ((statusbar-push . push) :uint (context-id :uint) (text gtk-string)) + ((statusbar-push . push) :uint (context-id :uint) (text :string)) ((statusbar-pop . pop) :void (context-id :uint)) - (:get context-id :uint (context gtk-string)) + (:get context-id :uint (context :string)) (:get message-area pobject)) (defcfun gtk-statusbar-remove :void --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-buffer.lisp 2012/01/25 19:15:08 1.5 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-buffer.lisp 2012/02/12 17:29:42 1.6 @@ -12,7 +12,7 @@ (defgtkfuns text-tag-table (add :void (tag pobject)) ((text-tag-table-remove . remove) :void (tag pobject)) - (lookup pobject (name gtk-string)) + (lookup pobject (name :string)) (:get size :int)) (make-foreach text-tag-table (tag (object text-tag)) (data pdata)) @@ -54,10 +54,10 @@ (defgtkfuns text-iter ((text-iter-char . get-char) unichar) - (:get slice gtk-string (end pobject)) - ((text-iter-text . get-text) gtk-string (end pobject)) - (:get visible-slice gtk-string (end pobject)) - (:get visible-text gtk-string (end pobject)) + (:get slice :string (end pobject)) + ((text-iter-text . get-text) :string (end pobject)) + (:get visible-slice :string (end pobject)) + (:get visible-text :string (end pobject)) (:get pixbuf pobject) (:get marks (g-slist :elt pobject)) (:get toggled-tags (g-slist :elt pobject) (toggle-on :boolean)) @@ -120,11 +120,11 @@ (forward-to-tag-toggle :boolean (tag pobject)) (backward-to-tag-toggle :boolean (tag pobject)) (forward-search :boolean - (str gtk-string) (flags text-search-flags) + (str :string) (flags text-search-flags) (match-start (struct text-iter :out t)) (match-end (struct text-iter :out t)) (limit pobject)) (backward-search :boolean - (str gtk-string) (flags text-search-flags) + (str :string) (flags text-search-flags) (match-start (struct text-iter :out t)) (match-end (struct text-iter :out t)) (limit pobject)) ((text-iter-equal . equal) :boolean (rhs (struct text-iter))) @@ -185,10 +185,10 @@ (insert-pixbuf :void (text-iter pobject) (pixbuf pobject)) (insert-child-anchor :void (text-iter pobject) (child-anchor pobject)) (create-child-anchor pobject (text-iter pobject)) - (create-mark pobject (mark-name gtk-string) (where (struct text-iter)) + (create-mark pobject (mark-name :string) (where (struct text-iter)) (left-gravity :boolean)) (add-mark :void (mark pobject) (where (struct text-iter))) - (:get mark pobject (name gtk-string)) + (:get mark pobject (name :string)) (get-insert pobject) (:get selection-bound pobject) (:get has-selection :boolean) @@ -209,8 +209,8 @@ :boolean (format gatom)) (:get copy-target-list (object target-list)) (:get paste-target-list (object target-list)) - (register-deserialize-tagset gatom (tagset-name gtk-string)) - (register-serialize-tagset gatom (tagset-name gtk-string)) + (register-deserialize-tagset gatom (tagset-name :string)) + (register-serialize-tagset gatom (tagset-name :string)) (unregister-deserialize-format :void (format gatom)) (unregister-serialize-format :void (format gatom))) @@ -239,7 +239,7 @@ (gtk-text-buffer-get-end-iter text-buffer text-iter) text-iter)) -(defcfun gtk-text-buffer-get-text gtk-string (buffer pobject) +(defcfun gtk-text-buffer-get-text :string (buffer pobject) (start pobject) (end pobject) (include-hidden :boolean)) (defmethod text ((text-buffer text-buffer) &key @@ -248,7 +248,7 @@ (gtk-text-buffer-get-text text-buffer start end include-hidden)) (defcfun gtk-text-buffer-set-text :void (buffer pobject) - (str gtk-string) (length :int)) + (str :string) (length :int)) (defmethod (setf text) (text (text-buffer text-buffer) &key (length -1)) (gtk-text-buffer-set-text text-buffer text length)) @@ -256,14 +256,14 @@ (save-setter text-buffer text) (defcfun gtk-text-buffer-insert :void (buffer pobject) (iter pobject) - (text gtk-string) (len :int)) + (text :string) (len :int)) (defcfun gtk-text-buffer-insert-at-cursor :void (buffer pobject) - (text gtk-string) (len :int)) + (text :string) (len :int)) (defcfun gtk-text-buffer-insert-interactive :boolean (buffer pobject) - (iter pobject) (text gtk-string) (len :int) + (iter pobject) (text :string) (len :int) (default-editable :boolean)) (defcfun gtk-text-buffer-insert-interactive-at-cursor :boolean (buffer pobject) - (text gtk-string) (len :int) (default-editable :boolean)) + (text :string) (len :int) (default-editable :boolean)) (defgeneric insert (text-buffer place text &key length interactive default-editable)) @@ -326,7 +326,7 @@ (gtk-text-buffer-backspace text-buffer text-iter interactive default-editable))) -(defcfun gtk-text-buffer-get-slice gtk-string (buffer pobject) +(defcfun gtk-text-buffer-get-slice :string (buffer pobject) (start pobject) (end pobject) (include-hidden :boolean)) (defgeneric text-buffer-slice (text-buffer &key start end) @@ -343,7 +343,7 @@ (defcfun ,by-obj :void (buffer pobject) (,tag-name pobject) , at params) (defcfun ,by-name :void - (buffer pobject) (,tag-name gtk-string) , at params) + (buffer pobject) (,tag-name :string) , at params) (defgeneric ,name (text-buffer ,tag-name , at cars-params) (:method ((text-buffer text-buffer) (,tag-name string) , at cars-params) @@ -361,7 +361,7 @@ (start (struct text-iter)) (end (struct text-iter)))) (defcfun gtk-text-buffer-create-tag :pointer (buffer pobject) - (name gtk-string) (null :pointer)) + (name :string) (null :pointer)) (defgeneric create-tag (text-buffer name &rest properties) (:method ((text-buffer text-buffer) name &rest properties) @@ -470,11 +470,11 @@ (gtk-text-buffer-get-serialize-formats text-buffer *array-length*))) (defcfun gtk-text-buffer-register-deserialize-format gatom - (buffer pobject) (mime-type gtk-string) (func pfunction) + (buffer pobject) (mime-type :string) (func pfunction) (user-data pdata) (user-data-destroy pfunction)) (defcfun gtk-text-buffer-register-serialize-format gatom - (buffer pobject) (mime-type gtk-string) (func pfunction) + (buffer pobject) (mime-type :string) (func pfunction) (user-data pdata) (user-data-destroy pfunction)) (defcallback cb-serialize (garray :uint8) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-mark.lisp 2011/09/17 20:04:56 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-mark.lisp 2012/02/12 17:29:42 1.2 @@ -3,7 +3,7 @@ (defclass text-mark (g-object) ()) -(defcfun gtk-text-mark-new :pointer (name gtk-string) (left-gravity :boolean)) +(defcfun gtk-text-mark-new :pointer (name :string) (left-gravity :boolean)) (defmethod gconstructor ((text-mark text-mark) &key name left-gravity &allow-other-keys) @@ -13,7 +13,7 @@ (defgtkfuns text-mark (:get deleted :boolean) - (:get name gtk-string) + (:get name :string) (:get buffer pobject) (:get left-gravity :boolean)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-model.lisp 2011/12/31 17:20:56 1.6 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-model.lisp 2012/02/12 17:29:42 1.7 @@ -7,7 +7,7 @@ (defcfun "gtk_tree_path_free" :void (path pobject)) -(defcfun "gtk_tree_path_new_from_string" :pointer (str gtk-string)) +(defcfun "gtk_tree_path_new_from_string" :pointer (str :string)) (defcfun "gtk_tree_path_new_from_indices" :pointer &rest) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-view-column.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-view-column.lisp 2012/02/12 17:29:42 1.2 @@ -27,9 +27,9 @@ (process initargs)))) (defcfun "gtk_tree_view_column_set_title" :void - (column pobject) (title gtk-string)) + (column pobject) (title :string)) -(defcfun "gtk_tree_view_column_get_title" gtk-string (column pobject)) +(defcfun "gtk_tree_view_column_get_title" :string (column pobject)) (defmethod (setf title) (value (tree-view-column tree-view-column)) (gtk-tree-view-column-set-title tree-view-column value)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/01/27 18:41:31 1.8 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/02/12 17:29:42 1.9 @@ -123,14 +123,14 @@ :recieves-default :double-buffered :no-show-all) (defgtkslots widget - name gtk-string + name :string direction text-direction default-direction text-direction parent-window pobject parent pobject child-visible :boolean - tooltip-markup gtk-string - tooltip-text gtk-string + tooltip-markup :string + tooltip-text :string tooltip-window pobject has-tooltip :boolean can-default :boolean @@ -145,7 +145,7 @@ sensitive :boolean events event-mask visual pobject - composite-name gtk-string + composite-name :string halign align valign align margin-left :int --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp 2012/02/12 17:29:42 1.3 @@ -11,7 +11,7 @@ (gtk-window-new type)) (defgtkslots window - title gtk-string + title :string screen pobject transient-for pobject) From rklochkov at common-lisp.net Mon Feb 13 02:15:39 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 18:15:39 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gio Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gio In directory tiger.common-lisp.net:/tmp/cvs-serv14376/gio Added Files: gio-cffi.asd Log Message: Added missed file --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/gio-cffi.asd 2012/02/13 02:15:39 NONE +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/gio-cffi.asd 2012/02/13 02:15:39 1.1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; gio-cffi.asd --- ASDF system definition for gio-cffi ;;; ;;; Copyright (C) 2012, Roman Klochkov ;;; (defpackage #:gio-cffi-system (:use #:cl #:asdf)) (in-package #:gio-cffi-system) (defsystem gio-cffi :description "Interface to GIO via CFFI" :author "Roman Klochkov " :version "0.5" :license "GPL" :depends-on (g-object-cffi g-lib-cffi gtk-cffi-utils) :components ((:file package) (:file loadlib :depends-on (package)) (:file action-group :depends-on (loadlib)) (:file application :depends-on (action-group)))) From rklochkov at common-lisp.net Mon Feb 13 02:56:32 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 18:56:32 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gio Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gio In directory tiger.common-lisp.net:/tmp/cvs-serv27348/gio Modified Files: gio-cffi.asd Log Message: Fixed licenses --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/gio-cffi.asd 2012/02/13 02:15:39 1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/gio-cffi.asd 2012/02/13 02:56:31 1.2 @@ -13,10 +13,10 @@ :description "Interface to GIO via CFFI" :author "Roman Klochkov " :version "0.5" - :license "GPL" + :license "BSD" :depends-on (g-object-cffi g-lib-cffi gtk-cffi-utils) :components ((:file package) (:file loadlib :depends-on (package)) (:file action-group :depends-on (loadlib)) - (:file application :depends-on (action-group)))) \ No newline at end of file + (:file application :depends-on (action-group)))) From rklochkov at common-lisp.net Mon Feb 13 02:56:32 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Sun, 12 Feb 2012 18:56:32 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gtk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gtk In directory tiger.common-lisp.net:/tmp/cvs-serv27348/gtk Modified Files: gtk-cffi.asd Log Message: Fixed licenses --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/01/25 19:15:08 1.12 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/02/13 02:56:32 1.13 @@ -13,7 +13,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.5" - :license "GPL" + :license "LLGPL" :depends-on (gdk-cffi g-object-cffi g-lib-cffi gtk-cffi-utils gio-cffi) :components ((:file package) @@ -31,7 +31,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.99" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core) :components ((:file widget))) @@ -40,7 +40,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-widget) :components ((:file misc))) @@ -49,7 +49,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-misc) :components ((:file label))) @@ -58,7 +58,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-widget) :components ((:file container))) @@ -67,7 +67,7 @@ :description "Interface to GTK/Glib via CFFI: GtkBin" :author "Roman Klochkov " :version "0.99" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file bin) @@ -78,7 +78,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-bin) :components ((:file :window))) @@ -87,7 +87,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.99" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-window gtk-cffi-vbox gtk-cffi-hbuttonbox) :components ((:file :dialog))) @@ -96,7 +96,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-widget) :components ((:file :entry))) @@ -105,7 +105,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-widget) :components ((:file :button))) @@ -114,7 +114,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file :box))) @@ -123,7 +123,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-box) :components ((:file :hbox))) @@ -132,7 +132,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-box) :components ((:file :vbox))) @@ -141,7 +141,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-box) :components ((:file :buttonbox))) @@ -150,7 +150,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-buttonbox) :components ((:file :hbuttonbox))) @@ -159,7 +159,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-box) :components ((:file :eventbox))) @@ -168,7 +168,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core) :components ((:file :cell-renderer))) @@ -177,7 +177,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-cell-renderer) :components ((:file :cell-renderer-text))) @@ -186,7 +186,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-cell-renderer) :components ((:file :cell-renderer-pixbuf))) @@ -195,7 +195,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-cell-renderer) :components ((:file :cell-renderer-toggle))) @@ -205,7 +205,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "1.0" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core gtk-cffi-cell-renderer) :components ((:file :cell-layout))) @@ -214,7 +214,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file :paned))) @@ -223,7 +223,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-bin) :components ((:file :frame))) @@ -232,7 +232,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core) :components ((:file :tree-model))) @@ -241,7 +241,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-tree-model) :components ((:file :list-store))) @@ -250,7 +250,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-tree-model) :components ((:file :tree-model-filter))) @@ -259,7 +259,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-tree-model) :components ((:file :tree-selection))) @@ -268,7 +268,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-cell-layout gtk-cffi-cell-renderer gtk-cffi-widget) :components ((:file :tree-view-column))) @@ -277,7 +277,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-tree-selection gtk-cffi-tree-view-column) :components ((:file :tree-view))) @@ -286,7 +286,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "1.0" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-bin) :components ((:file :scrolled-window))) @@ -295,7 +295,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core) :components ((:file text-tag) @@ -305,7 +305,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-text-buffer) :components ((:file text-mark) @@ -315,7 +315,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-bin) :components ((:file :combo-box))) @@ -324,7 +324,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-dialog) :components ((:file :message-dialog))) @@ -333,7 +333,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-core) :components ((:file :file-chooser))) @@ -342,7 +342,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-file-chooser gtk-cffi-dialog) :components ((:file :file-chooser-dialog))) @@ -351,7 +351,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-file-chooser gtk-cffi-hbox) :components ((:file :file-chooser-button))) @@ -360,7 +360,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-widget) :components ((:file :progress-bar))) @@ -369,7 +369,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file :table))) @@ -378,7 +378,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file :menu-shell))) @@ -387,7 +387,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-menu-shell) :components ((:file :menu))) @@ -396,7 +396,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-menu-shell) :components ((:file :menu-bar))) @@ -405,7 +405,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-container) :components ((:file :tool-shell))) @@ -414,7 +414,7 @@ :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " :version "0.1" - :license "GPL" + :license "LLGPL" :depends-on (gtk-cffi-tool-shell) :components ((:file :toolbar))) @@ -423,7 +423,7 @@ :description "Interface to GTK/Glib via CFFI" [34 lines skipped] From rklochkov at common-lisp.net Mon Feb 20 16:51:37 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:37 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/g-lib Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-lib In directory tiger.common-lisp.net:/tmp/cvs-serv21507/g-lib Modified Files: list.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/list.lisp 2012/01/25 19:15:08 1.6 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/list.lisp 2012/02/20 16:51:37 1.7 @@ -35,8 +35,9 @@ (t (mem-ref data *list-type*))) *list*)) (define-foreign-type g-list (freeable) - ((list-type :initarg :elt :accessor list-type - :documentation "If null, then list is of pointers or GObjects")) + ((list-type :initarg :elt :accessor list-type :initform nil + :documentation "If null, then list is of pointers or GObjects") + (free :initform :container)) (:simple-parser g-list) (:actual-type :pointer)) From rklochkov at common-lisp.net Mon Feb 20 16:51:37 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:37 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/g-object Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-object In directory tiger.common-lisp.net:/tmp/cvs-serv21507/g-object Modified Files: defslots.lisp g-object-cffi.asd g-object.lisp g-value.lisp pobject.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/defslots.lisp 2012/02/12 17:29:41 1.9 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/defslots.lisp 2012/02/20 16:51:37 1.10 @@ -35,12 +35,11 @@ (defmethod (setf ,name-lisp) (value (object ,current-class)) (,setter object value) value))))) -(template ((defgtkslot 'gtk) - (defgdkslot 'gdk) - (defslot (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (current-class slot-name slot-type) - (expand-defslot ,prefix current-class slot-name slot-type)))) +(template (name prefix) ((defgtkslot 'gtk) + (defgdkslot 'gdk) + (defslot (get-prefix))) + `(defmacro ,name (current-class slot-name slot-type) + (expand-defslot ,prefix current-class slot-name slot-type))) (defun expand-defslots (prefix current-class slots) `(progn @@ -50,62 +49,65 @@ (collect (expand-defslot prefix current-class (first x) (second x)))))) -(template ((defgtkslots 'gtk) - (defgdkslots 'gdk) - (defslots (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (current-class &body slots) - (expand-defslots ,prefix current-class slots)))) +(template (name prefix) ((defgtkslots 'gtk) + (defgdkslots 'gdk) + (defslots (get-prefix))) + `(defmacro ,name (current-class &body slots) + (expand-defslots ,prefix current-class slots))) + +(defun param-list (l) + (nconc (mapcar #'ensure-car l) + (if (find '&key l) '(&allow-other-keys) nil))) (defun expand-deffun (prefix name res-type class params &key get) (destructuring-bind (name-lisp . name-gtk) (pair name) - (let ((fun-name (symbolicate prefix '- class (if get '-get- '-) name-gtk)) - (param-list (mapcar #'car params))) + (let* ((fun-name (symbolicate prefix '- class (if get '-get- '-) name-gtk)) + (param-list (param-list params)) + (cparams (remove '&key params))) `(progn - (defcfun ,fun-name ,res-type (,class pobject) , at params) + (defcfun ,fun-name ,res-type (,class pobject) , at cparams) (unless (fboundp ',name-lisp) (defgeneric ,name-lisp (,class , at param-list))) (defmethod ,name-lisp ((,class ,class) , at param-list) - (,fun-name ,class , at param-list)))))) + (,fun-name ,class ,@(mapcar #'car cparams))))))) -(template ((defgtkfun 'gtk) - (defgdkfun 'gdk) - (deffun (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (name res-type class &rest params) - (expand-deffun ,prefix name res-type class params)))) - -(template ((defgtkgetter 'gtk) - (defgdkgetter 'gdk) - (defgetter (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (name res-type class &rest params) - (expand-deffun ,prefix name res-type class params :get t)))) +(template (name prefix) ((defgtkfun 'gtk) + (defgdkfun 'gdk) + (deffun (get-prefix))) + `(defmacro ,name (name res-type class &rest params) + (expand-deffun ,prefix name res-type class params))) + +(template (name prefix) ((defgtkgetter 'gtk) + (defgdkgetter 'gdk) + (defgetter (get-prefix))) + `(defmacro ,name (name res-type class &rest params) + (expand-deffun ,prefix name res-type class params :get t))) + (defun expand-defsetter (prefix name slot-type class params last) (destructuring-bind (name-lisp . name-gtk) (pair name) (let ((setter (symbolicate prefix '- class '-set- name-gtk)) - (param-list (mapcar #'car params))) + (param-list (param-list params)) + (cparams (remove '&key params))) `(progn ,(unless params `(save-setter ,class ,name-lisp)) ,(if last `(defcfun ,setter :void (widget pobject) - , at params (value ,slot-type)) + , at cparams (value ,slot-type)) `(defcfun ,setter :void (widget pobject) - (value ,slot-type) , at params)) + (value ,slot-type) , at cparams)) (unless (fboundp '(setf ,name-lisp)) (defgeneric (setf ,name-lisp) (value ,class , at param-list))) (defmethod (setf ,name-lisp) (value (object ,class) , at param-list) - (,setter object value , at param-list) value))))) + (,setter object value ,@(mapcar #'car cparams)) value))))) -(template ((defgtksetter 'gtk) - (defgdksetter 'gdk) - (defsetter (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (name slot-type class last &rest params) - (expand-defsetter ,prefix name slot-type class params last)))) +(template (name prefix) ((defgtksetter 'gtk) + (defgdksetter 'gdk) + (defsetter (get-prefix))) + `(defmacro ,name (name slot-type class last &rest params) + (expand-defsetter ,prefix name slot-type class params last))) (defun expand-deffuns (prefix class funs) (cons 'progn @@ -123,12 +125,11 @@ (t (expand-deffun prefix name slot-type class params))))) funs))) -(template ((defgtkfuns 'gtk) - (defgdkfuns 'gdk) - (deffuns (get-prefix))) - (destructuring-bind (name prefix) param - `(defmacro ,name (class &body funs) - (expand-deffuns ,prefix class funs)))) +(template (name prefix) ((defgtkfuns 'gtk) + (defgdkfuns 'gdk) + (deffuns (get-prefix))) + `(defmacro ,name (class &body funs) + (expand-deffuns ,prefix class funs))) (defmacro with-object ((name &optional for-free) init &rest body) `(let ((,name ,init)) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-cffi.asd 2012/02/12 17:29:41 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object-cffi.asd 2012/02/20 16:51:37 1.5 @@ -14,7 +14,7 @@ :author "Roman Klochkov " :version "0.3" :license "BSD" - :depends-on (cffi-object g-lib-cffi gtk-cffi-utils) + :depends-on (g-lib-cffi gtk-cffi-utils) :components ((:file package) (:file loadlib :depends-on (package)) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object.lisp 2012/01/21 18:35:00 1.8 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-object.lisp 2012/02/20 16:51:37 1.9 @@ -10,8 +10,8 @@ (defclass g-object (object) ((signals :accessor gsignals :initform nil) ;; redefining VOLATILE for saving in hash - (cffi-object::volatile :initform nil) - (cffi-object::free-after :initform nil) + (cffi-objects::volatile :initform nil) + (cffi-objects::free-after :initform nil) (%properties :accessor %properties :initform nil :allocation :class)) (:documentation "Lisp wrapper for GObject")) @@ -140,7 +140,7 @@ (hint :pointer) (data :pointer)) (declare (ignore hint data)) - (let ((lisp-func (object closure)) + (let ((lisp-func (find-object closure)) (lisp-params (iter (for i from 0 below n-values) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-value.lisp 2012/02/12 17:29:41 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/g-value.lisp 2012/02/20 16:51:37 1.4 @@ -159,8 +159,8 @@ (fundamental-type (g-type-fundamental g-type))) (case fundamental-type (#.(keyword->g-type :boxed) - (object (g-value-get-boxed value) - :class (g-type->lisp g-type))) + (find-object (g-value-get-boxed value) + (g-type->lisp g-type))) (#.(keyword->g-type :enum) (convert-from-foreign (g-value-get-enum value) (g-type->lisp g-type))) --- /project/gtk-cffi/cvsroot/gtk-cffi/g-object/pobject.lisp 2012/01/25 19:15:08 1.5 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-object/pobject.lisp 2012/02/20 16:51:37 1.6 @@ -19,9 +19,9 @@ make up lisp object" (declare (type foreign-pointer ptr)) (unless (null-pointer-p ptr) - (let ((class (or (cffi-object::obj-class cffi-pobject) + (let ((class (or (object-class cffi-pobject) (g-type->lisp (g-type-from-instance ptr))))) - (object ptr :class class)))) + (find-object ptr class)))) ;; register as object type for g-list (defmethod g-lib-cffi::object-type ((type-name (eql 'pobject))) t) @@ -30,7 +30,7 @@ (defclass storage (object) ((data :accessor data :initarg :data) - (cffi-object::volatile :initform nil :accessor volatile)) + (volatile :initform nil :accessor volatile)) (:documentation "A storage for any data for callbacks. On make-instance it allocates one byte on heap and associates itself with the address of that byte.")) @@ -44,7 +44,7 @@ (defcallback free-storage :void ((data :pointer) (closure :pointer)) (declare (ignore closure)) (unless (null-pointer-p data) - (setf (pointer (object data)) (null-pointer)) + (setf (pointer (find-object data)) (null-pointer)) (remhash (pointer-address data) *objects*) (foreign-free data))) @@ -63,7 +63,7 @@ (defmethod translate-from-foreign (ptr (type cffi-pdata)) "Returns saved data." - (let ((obj (object ptr))) + (let ((obj (find-object ptr))) (if obj (typecase obj (storage (prog1 (data obj) (free-returned-if-needed type obj))) @@ -86,20 +86,6 @@ (when param (free-sent-if-needed type param))) -;; (defmethod translate-to-foreign :around ((any-data storage) (name cffi-pdata)) -;; (call-next-method any-data name)) - -;; (define-foreign-type g-list-object (g-list) -;; () -;; (:actual-type :pointer) -;; (:simple-parser g-list-object) -;; (:documentation "GList with pointers to GObjects")) - -;; (defmethod translate-from-foreign :around (ptr (name g-list-object)) -;; (declare (ignorable ptr name)) -;; (mapcar (lambda (x) (convert-from-foreign x 'pobject)) -;; (call-next-method))) - (defctype g-list-object (g-list :elt pobject)) From rklochkov at common-lisp.net Mon Feb 20 16:51:37 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:37 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gdk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gdk In directory tiger.common-lisp.net:/tmp/cvs-serv21507/gdk Modified Files: package.lisp pango.lisp window.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp 2012/02/12 17:29:41 1.8 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/package.lisp 2012/02/20 16:51:37 1.9 @@ -36,6 +36,11 @@ #:window #:modifier-type + #:window-hints + #:gravity + #:geometry + #:window-edge + #:window-type-hint #:pixmap --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pango.lisp 2012/01/27 18:41:31 1.6 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/pango.lisp 2012/02/20 16:51:37 1.7 @@ -1,5 +1,5 @@ (defpackage #:pango-cffi - (:use #:common-lisp #:cffi-object #:cffi #:iterate #:g-object-cffi + (:use #:common-lisp #:cffi-objects #:iterate #:g-object-cffi #:alexandria #:gtk-cffi-utils) (:export #:font @@ -22,10 +22,10 @@ (defcfun ("pango_font_description_from_string" string->pango-font) - :pointer (str gtk-string)) + :pointer (str :string)) (defcfun ("pango_font_description_to_string" pango-font->string) - gtk-string (font :pointer)) + :string (font :pointer)) (defcfun pango-font-description-free :void (font :pointer)) @@ -159,8 +159,8 @@ ;; for language we don't need foreign type, because we don't need ;; to free these pointers for languages (defcfun (string->language "pango_language_from_string") language - (str gtk-string)) -(defcfun (language->string "pango_language_to_string") gtk-string + (str :string)) +(defcfun (language->string "pango_language_to_string") :string (language language)) (eval-when (:compile-toplevel :load-toplevel) @@ -275,10 +275,10 @@ -(template (:language :family :style :variant :stretch :weight :size - :font-desc :strikethrough :underline :scale - :rise :letter-spacing :fallback :gravity - :gravity-hint) +(template attr (:language :family :style :variant :stretch :weight :size + :font-desc :strikethrough :underline :scale + :rise :letter-spacing :fallback :gravity + :gravity-hint) (flet ((in-type (type) (case type (:family :string) @@ -287,11 +287,11 @@ ((:strikethrough :fallback) :boolean) (:scale :double) (t (intern (symbol-name type) #.*package*))))) - `(defcfun ,(symbolicate 'pango-attr- param '-new) ,(attr->type param) - (value ,(in-type param))))) + `(defcfun ,(symbolicate 'pango-attr- attr '-new) ,(attr->type attr) + (value ,(in-type attr))))) -(template (:foreground :background :strikethrough-color :underline-color) - `(defcfun ,(symbolicate 'pango-attr- param '-new) attr-color +(template attr (:foreground :background :strikethrough-color :underline-color) + `(defcfun ,(symbolicate 'pango-attr- attr '-new) attr-color (red :uint16) (green :uint16) (blue :uint16))) (defcfun ("pango_attr_size_new_absolute" pango-attr-absolute-size-new) @@ -347,21 +347,20 @@ (defcfun pango-attr-list-new :pointer) (defcfun pango-attr-list-insert :void (list :pointer) (attr :pointer)) -(template (t) - (declare (ignore param)) - `(defun list->attr (l) - (destructuring-bind (type start-index end-index &rest params) l - (let ((ptr - (apply - (case type - ,@(mapcar (lambda (x) `(,x - (function ,(symbolicate - 'pango-attr- x '-new)))) - (cdr (foreign-enum-keyword-list 'attr-type)))) - params))) - (setf (foreign-slot-value ptr 'attribute 'start-index) start-index - (foreign-slot-value ptr 'attribute 'end-index) end-index) - ptr)))) +(defun list->attr (l) + (destructuring-bind (type start-index end-index &rest params) l + (let ((ptr + (apply + (template () () + `(case type + ,@(mapcar + (lambda (x) `(,x (function ,(symbolicate + 'pango-attr- x '-new)))) + (cdr (foreign-enum-keyword-list 'attr-type))))) + params))) + (setf (foreign-slot-value ptr 'attribute 'start-index) start-index + (foreign-slot-value ptr 'attribute 'end-index) end-index) + ptr))) (defmethod translate-to-foreign (value (type attr-list)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/window.lisp 2011/08/26 17:16:14 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/window.lisp 2012/02/20 16:51:37 1.3 @@ -10,3 +10,32 @@ :shift :lock :control :mod1 :mod2 :mod3 :mod4 :mod5 :button1 :button2 :button3 :button4 :button5 (:super #.(ash 1 26)) :hyper :meta (:release #.(ash 1 30))) + +(defbitfield window-hints + :pos :min-size :max-size :base-size :aspect :resize-inc :win-gravity + :user-pos :user-size) + +(defcenum gravity + (:north-west 1) :north :north-east :west :center :east + :south-west :south :south-east :static) + +(defcenum window-edge + :north-west :north :north-east :west :east + :south-west :south :south-east) + +(defcenum window-type-hint + :normal :dialog :menu :toolbar :splashscreen :utility + :dock :desktop :dropdown-menu :popup-menu :tooltip :notification :combo :dnd) + +(defcstruct* geometry + (min-width :int) + (min-height :int) + (max-widht :int) + (max-height :int) + (base-width :int) + (base-height :int) + (width-inc :int) + (height-inc :int) + (min-aspect :double) + (max-aspect :double) + (win-gravity gravity)) From rklochkov at common-lisp.net Mon Feb 20 16:51:37 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:37 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gio Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gio In directory tiger.common-lisp.net:/tmp/cvs-serv21507/gio Modified Files: package.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/gio/package.lisp 2012/01/25 19:15:08 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gio/package.lisp 2012/02/20 16:51:37 1.3 @@ -9,7 +9,7 @@ (defpackage #:gio-cffi (:nicknames #:gio) - (:use #:common-lisp #:cffi #:cffi-object #:g-object-cffi #:g-lib-cffi)) + (:use #:common-lisp #:cffi-objects #:g-object-cffi #:g-lib-cffi #:iterate)) (in-package #:gio-cffi) (register-package "G" *package*) From rklochkov at common-lisp.net Mon Feb 20 16:51:37 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:37 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gtk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gtk In directory tiger.common-lisp.net:/tmp/cvs-serv21507/gtk Modified Files: dialog.lisp gtk-cffi.asd loadlib.lisp message-dialog.lisp package.lisp text-view.lisp tree-selection.lisp widget.lisp window.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/dialog.lisp 2012/02/12 17:29:42 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/dialog.lisp 2012/02/20 16:51:37 1.4 @@ -1,3 +1,9 @@ +;;; +;;; dialog.lisp -- GtkDialog +;;; +;;; Copyright (C) 2007, Roman Klochkov +;;; + (in-package :gtk-cffi) (defclass dialog (window) @@ -105,9 +111,9 @@ (defmethod (setf alternative-button-order) (order (dialog dialog)) (let ((n-params (length order))) (with-foreign-object (arr :int n-params) - (loop - :for i :from 0 :to n-params - :for l :in order - :do (setf (mem-aref arr :int i) l)) + (iter + (for i to n-params) + (for l in order) + (setf (mem-aref arr :int i) l)) (gtk-dialog-set-alternative-button-order-from-array dialog n-params arr)))) \ No newline at end of file --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/02/13 02:56:32 1.13 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/02/20 16:51:37 1.14 @@ -34,7 +34,8 @@ :license "LLGPL" :depends-on (gtk-cffi-core) :components - ((:file widget))) + ((:file widget) + (:file invisible :depends-on (widget)))) (defsystem gtk-cffi-misc :description "Interface to GTK/Glib via CFFI" @@ -77,7 +78,7 @@ (defsystem gtk-cffi-window :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " - :version "0.1" + :version "0.99" :license "LLGPL" :depends-on (gtk-cffi-bin) :components @@ -323,7 +324,7 @@ (defsystem gtk-cffi-message-dialog :description "Interface to GTK/Glib via CFFI" :author "Roman Klochkov " - :version "0.1" + :version "0.99" :license "LLGPL" :depends-on (gtk-cffi-dialog) :components --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/loadlib.lisp 2012/01/27 18:41:31 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/loadlib.lisp 2012/02/20 16:51:37 1.5 @@ -17,12 +17,26 @@ ;; (t value))) -;(eval-when (:compile-toplevel :load-toplevel :execute) -(define-foreign-library :gtk - (:unix "libgtk-3.so.0") ;libgtk-x11-2.0.so") - (:windows "libgtk-win32-3-0.dll")) - -(use-foreign-library :gtk) +(eval-when (:compile-toplevel :load-toplevel) + (unless (find :gtk *features*) + (push :gtk *features*) + (define-foreign-library :gtk + (:unix "libgtk-3.so.0") ;libgtk-x11-2.0.so") + (:windows "libgtk-win32-3-0.dll")) + + (use-foreign-library :gtk))) +(eval-when (:compile-toplevel) + (defcfun ("gtk_init" %gtk-init) :void (argc :pointer) (argv :pointer)) + #+sbcl (sb-ext::set-floating-point-modes :traps nil) + (with-foreign-objects ((argc :int) (argv :pointer)) + (setf (mem-ref argc :int) 0 + (mem-ref argv :pointer) (foreign-alloc :string + :initial-element "program")) + (%gtk-init argc argv)) + (defcfun gtk-get-major-version :uint) + (defcfun gtk-get-minor-version :uint) + (when (and (>= (gtk-get-major-version) 3) (>= (gtk-get-minor-version) 2)) + (push :gtk3.2 *features*))) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2012/02/12 17:29:42 1.2 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2012/02/20 16:51:37 1.3 @@ -9,11 +9,11 @@ (defcenum message-type :info :warning :question :error :other) -(defcfun "gtk_message_dialog_new" :pointer (parent pobject) +(defcfun gtk-message-dialog-new :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) (message :string) (null :pointer)) -(defcfun "gtk_message_dialog_new_with_markup" :pointer (parent pobject) +(defcfun gtk-message-dialog-new-with-markup :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) (message :string) (null :pointer)) @@ -32,3 +32,10 @@ :message message :type type :buttons buttons :markup markup) :keep-alive nil)) + +(defslot message-dialog image pobject) +(deffuns message-dialog + (:set markup :string) + (:get message-area pobject) + (format-secondary-text :void (message :string)) + (format-secondary-markup :void (message :string))) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/02/12 17:29:42 1.13 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/02/20 16:51:37 1.14 @@ -170,6 +170,8 @@ #:find-style-property #:style-property + #:invisible + #:bin ;; methods #:child @@ -187,7 +189,70 @@ #:screen #:transient-for #:window-position + #:title + #:role + #:resizable + #:modal + #:gravity + #:destroy-with-parent + #:focus + #:decorated + #:deletable + #:mnemonic-modifier + #:type-hint + #:skip-taskbar-hint + #:skip-pager-hint + #:urgency-hint + #:accept-focus + #:focus-on-map + #:startup-id + #:default-icon-list + #:default-icon-name + #:icon + #:icon-list + #:icon-name + #:group + #:opacity + #:mnemonics-visible + #:focus-visible + #:has-resize-grip + #:application + #:window-size ;; methods + #:position-type + #:add-accel-group + #:remove-accel-group + #:activate-focus + #:activate-default + #:set-geometry-hints + #:is-active + #:has-toplevel-focus + #:list-toplevels + #:add-mnemonic + #:remove-mnemonic + #:mnemonic-activate + #:activate-key + #:propagate-key-event + #:default-widget + #:present + #:present-with-time + #:iconify + #:deiconify + #:stick + #:unstick + #:maximize + #:unmaximize + #:fullscreen + #:unfullscreen + #:keep-above + #:keep-below + #:begin-resize-drag + #:begin-move-drag + #:window-type + #:parse-geometry + #:reshow-with-initial-size + #:auto-startup-notification + #:resize-grip-is-visible #:dialog ;;methods @@ -553,6 +618,11 @@ #:active-text #:message-dialog + #:markup + #:image + #:message-area + #:format-secondary-text + #:format-secondary-markup ;; handy defun #:show-message --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-view.lisp 2011/09/18 18:10:48 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/text-view.lisp 2012/02/20 16:51:37 1.5 @@ -46,7 +46,7 @@ (move-mark-onscreen :boolean (text-mark pobject)) (place-cursor-onscreen :boolean) ((text-view-window . get-window) pobject (win text-window-type)) - (:get window-type text-window-type (window pobject)) + (:get window-type text-window-type &key (window pobject)) (:get border-window-size :int (type text-window-type)) (:set-last border-window-size :int (type text-window-type)) (forward-display-line :boolean (text-iter pobject)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-selection.lisp 2011/04/25 19:16:08 1.1.1.1 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/tree-selection.lisp 2012/02/20 16:51:37 1.2 @@ -24,10 +24,10 @@ ((model :pointer) (path :pointer) (iter :pointer) (data :pointer)) (when *tree-selection-foreach* (funcall *tree-selection-foreach* - (object model) + (find-object model) (make-instance 'tree-path :pointer path) (make-instance 'tree-iter :pointer iter) - (object data)))) + (find-object data)))) (defmethod tree-selection-foreach ((tree-selection tree-selection) func &optional (data (null-pointer))) @@ -57,7 +57,7 @@ (when (gtk-tree-selection-get-selected (pointer tree-selection) model-ptr (pointer iter)) - (list (object (mem-ref model-ptr :pointer)) + (list (find-object (mem-ref model-ptr :pointer)) iter)))))) (defmacro with-selection (selection tree-selection &body body) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/02/12 17:29:42 1.9 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/02/20 16:51:37 1.10 @@ -1,6 +1,6 @@ ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; -;;; widget.asd --- Wrapper for GtkWidget +;;; widget.lisp --- Wrapper for GtkWidget ;;; ;;; Copyright (C) 2007, Roman Klochkov ;;; @@ -204,7 +204,7 @@ (:get pango-context pobject) (create-pango-layout pobject) (:set redraw-on-allocate :boolean) - (mnemonic-activate :boolean (group-cycling :boolean)) + (mnemonic-activate :boolean &key (group-cycling :boolean)) (unparent :void) ((widget-map . map) :void) (unmap :void) @@ -246,20 +246,6 @@ (setf (documentation 'clipboard 'function) "SELECTION should be :PRIMARY or :CLIPOARD") -;; (defcfun gtk-widget-set-device-events :void -;; (widget pobject) (device pobject) (events event-mask)) - -;; (defgeneric (setf device-events) (events widget device)) -;; (defmethod (setf device-events) (events (widget widget) device) -;; (gtk-widget-set-device-events widget device events)) - -;; (defcfun gtk-widget-set-device-enabled :void -;; (widget pobject) (device pobject) (enabled :boolean)) - -;; (defgeneric (setf device-enabled) (enable widget device)) -;; (defmethod (setf device-enabled) (enabled (widget widget) device) -;; (gtk-widget-set-device-enabled widget device enabled)) - (defcfun ("gtk_widget_pop_composite_child" pop-composite-child) :void) (defcfun ("gtk_widget_push_composite_child" push-composite-child) :void) @@ -394,24 +380,22 @@ (gtk-distribute-natural-allocation extra-space length sizes-struct)))) -(init-slots widget nil) +(init-slots widget) -(template - ((color t) - (font nil) - (bg-pixmap nil)) - (destructuring-bind (name with-type) param - `(progn - (defmethod ,name ((widget widget) - &key ,@(when with-type '(type)) (state :normal)) - (,name (style-context widget) ,@(when with-type '(:type type)) - :state state)) +(template (name with-type) ((color t) + (font nil) + (bg-pixmap nil)) + `(progn + (defmethod ,name ((widget widget) + &key ,@(when with-type '(type)) (state :normal)) + (,name (style-context widget) ,@(when with-type '(:type type)) + :state state)) - (defmethod (setf ,name) (value (widget widget) - &key ,@(when with-type '(type)) (state :normal)) - (setf (,name (style-context widget) ,@(when with-type '(:type type)) - :state state) - value))))) + (defmethod (setf ,name) (value (widget widget) + &key ,@(when with-type '(type)) (state :normal)) + (setf (,name (style-context widget) ,@(when with-type '(:type type)) + :state state) + value)))) (defclass widget-class (g-object-class) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp 2012/02/12 17:29:42 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window.lisp 2012/02/20 16:51:37 1.4 @@ -1,3 +1,13 @@ +;;; +;;; window.lisp --- GtkWindow +;;; +;;; Copyright (C) 2007, Roman Klochkov +;;; +;;; Some conventions +;;; gtk_window_set_position -> (setf (position-type ...)) +;;; gtk_window_get_position/gtk_window_move -> window-position (setf'able) +;;; gtk_window_get_default_widget/gtk_window_set_default -> default-widget + (in-package :gtk-cffi) (defcenum window-type @@ -6,33 +16,63 @@ (defclass window (bin) ()) +(defcfun gtk-window-new :pointer (type window-type)) + (defmethod gconstructor ((window window) &key (type :top-level) &allow-other-keys) (gtk-window-new type)) -(defgtkslots window - title :string - screen pobject - transient-for pobject) +(defslots window + title :string + role :string + resizable :boolean + modal :boolean + gravity gravity + transient-for pobject + destroy-with-parent :boolean + focus pobject + decorated :boolean + deletable :boolean + mnemonic-modifier modifier-type + type-hint window-type-hint + skip-taskbar-hint :boolean + skip-pager-hint :boolean + urgency-hint :boolean + accept-focus :boolean + focus-on-map :boolean + default-icon-list g-list-object + default-icon-name :string + icon pobject + icon-list g-list-object + icon-name :string + opacity :double + mnemonics-visible :boolean + #+gtk3.2 focus-visible #+gtk3.2 :boolean + has-resize-grip :boolean + application pobject + screen pobject) -(defcfun "gtk_window_new" :pointer (type window-type)) - -(defcfun "gtk_window_set_default_size" +(defcfun gtk-window-set-default-size :void (window pobject) (w :int) (h :int)) -(defcfun "gtk_window_get_default_size" +(defcfun gtk-window-get-default-size :void (window pobject) (w :pointer) (h :pointer)) -(defmethod (setf default-size) (coords (window window)) - (let ((width (first coords)) - (height (second coords))) - (gtk-window-set-default-size window (round width) (round height)))) - -(defmethod default-size ((window window)) - (with-foreign-objects - ((width :int) (height :int)) - (gtk-window-get-default-size window width height) - (list (mem-ref width :int) (mem-ref height :int)))) +(defcfun gtk-window-set-default-geometry + :void (window pobject) (w :int) (h :int)) + +(defgeneric (setf default-size) (coords window &key geometry &allow-other-keys) + (:method (coords (window window) &key geometry &allow-other-keys) + (destructuring-bind (width height) coords + (if geometry + (gtk-window-set-default-geometry window (round width) (round height)) + (gtk-window-set-default-size window (round width) (round height)))))) + +(defgeneric default-size (window) + (:method ((window window)) + (with-foreign-outs-list ((width :int) (height :int)) :ignore + (gtk-window-get-default-size window width height)))) + (defcenum position :none @@ -41,13 +81,98 @@ :center-always :center-on-parent) -(defcfun "gtk_window_set_position" :void (window pobject) (pos position)) - -(defmethod (setf window-position) (pos (window window)) - (gtk-window-set-position window pos)) +(deffuns window + (:set (position-type . position) position) + (add-accel-group :void (accel-group pobject)) + (remove-accel-group :void (accel-group pobject)) + (activate-focus :boolean) + (activate-default :boolean) + (set-geometry-hints :void (widget pobject) (geometry (struct geometry)) + (mask window-hints)) + (is-active :boolean) + (has-toplevel-focus :boolean) + (list-toplevels (g-list :free :none)) + (add-mnemonic :void (keyval key) (target pobject)) + (remove-mnemonic :void (keyval key) (target pobject)) + (mnemonic-activate :boolean &key (keyval key) (modifier modifier-type)) + (activate-key :boolean (event event)) + (propagate-key-event :boolean (event event)) + (:get default-widget pobject) + (:set (default-widget . default) pobject) + (present :void) + (present-with-time :void (timestamp :uint32)) + (iconify :void) + (deiconify :void) + (stick :void) + (unstick :void) + (maximize :void) + (unmaximize :void) + (fullscreen :void) + (unfullscreen :void) + (:set keep-above :boolean) + (:set keep-below :boolean) + (begin-resize-drag :void (edge window-edge) (button :int) (root-x :int) + (root-y :int) (timestamp :uint32)) + (begin-move-drag :void (button :int) (root-x :int) + (root-y :int) (timestamp :uint32)) + (:get window-type window-type &key) + (parse-geometry :boolean (geometry :string)) + (reshow-with-initial-size :void) + (:set auto-startup-notification :boolean) + (resize-grip-is-visible :boolean) + (:get group pobject) + (has-group :boolean) + (:set startup-id :string)) + +(defcfun gtk-window-get-resize-grip-area :boolean + (window pobject) (rect (struct rectangle :out t))) + +(defgeneric resize-grip-area (window) + (:method ((window window)) + (let ((dest (make-instance 'rectangle))) + (when (gtk-window-get-resize-grip-area window dest) + dest)))) + +(defcfun gtk-window-get-position :void (window pobject) + (x :pointer) (y :pointer)) + +(defgeneric window-position (window) + (:method ((window window)) + (with-foreign-outs-list ((x :int) (y :int)) :ignore + (gtk-window-get-position window x y)))) + +(defcfun gtk-window-move :void (window pobject) (x :int) (y :int)) + +(defgeneric (setf window-position) (coords window) + (:method (coords (window window)) + (destructuring-bind (x y) coords + (gtk-window-move window x y)))) + +(defcfun gtk-window-get-size :void (window pobject) + (width :pointer) (height :pointer)) + +(defcfun gtk-window-resize :void (window pobject) + (width :int) (height :int)) + +(defcfun gtk-window-resize-to-geometry :void (window pobject) + (width :int) (height :int)) + +(defgeneric (setf window-size) (coords window &key geometry &allow-other-keys) + (:method (coords (window window) &key geometry &allow-other-keys) + (destructuring-bind (width height) coords + (if geometry + (gtk-window-resize-to-geometry window (round width) (round height)) + (gtk-window-resize window (round width) (round height)))))) + +(defgeneric window-size (window) + (:method ((window window)) + (with-foreign-outs-list ((width :int) (height :int)) :ignore + (gtk-window-get-size window width height)))) -(init-slots window ((width -1) (height -1) position) +(init-slots window ((width -1) (height -1) geometry resize) (when (or (/= width -1) (/= height -1)) - (gtk-window-set-default-size window width height)) - (when position (setf (window-position window) position))) + (let ((sizes (list width height))) + (if resize + (setf (window-size window :geometry geometry) sizes) + (setf (default-size window :geometry geometry) sizes))))) From rklochkov at common-lisp.net Mon Feb 20 16:51:38 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 08:51:38 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/utils Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/utils In directory tiger.common-lisp.net:/tmp/cvs-serv21507/utils Modified Files: package.lisp utils.lisp Log Message: Finished GtkWindow Made global clean-up. Now it compiles all from scratch with asdf:compile-op Add version-dependent functions (for ex. "since gtk 3.2") --- /project/gtk-cffi/cvsroot/gtk-cffi/utils/package.lisp 2012/01/21 18:35:00 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/utils/package.lisp 2012/02/20 16:51:38 1.4 @@ -8,5 +8,4 @@ #:debug-out #:bitmask - #:template - #:param)) + #:template)) --- /project/gtk-cffi/cvsroot/gtk-cffi/utils/utils.lisp 2012/01/21 18:35:00 1.4 +++ /project/gtk-cffi/cvsroot/gtk-cffi/utils/utils.lisp 2012/02/20 16:51:38 1.5 @@ -38,11 +38,18 @@ (collect `(when ,flag ,(make-keyword flag))))))) -(defmacro template (args &body body) - (with-gensyms (%template %do) - `(macrolet ((,%do () - (flet ((,%template (param) , at body)) - `(progn - ,@(mapcar #',%template ',args))))) - (,%do)))) +(defmacro template (vars args &body body) + (with-gensyms (%do %vars) + (cond + ((null vars) + `(macrolet ((,%do () , at body)) + (,%do))) + ((consp vars) + `(template ,%vars ,args + (destructuring-bind ,vars ,%vars + , at body))) + (t `(macrolet ((,%do () + `(progn + ,@(mapcar (lambda (,vars) , at body) ',args)))) + (,%do)))))) From rklochkov at common-lisp.net Mon Feb 20 18:50:27 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 10:50:27 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/g-lib Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-lib In directory tiger.common-lisp.net:/tmp/cvs-serv18060/g-lib Modified Files: array.lisp Log Message: Added GtkAboutDialog --- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/array.lisp 2012/01/25 19:15:08 1.6 +++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/array.lisp 2012/02/20 18:50:27 1.7 @@ -7,42 +7,15 @@ (in-package :g-lib-cffi) -(defvar *array-length* (foreign-alloc :uint)) - -;; TODO: add with-pointer-to-vector-data optimization -(define-foreign-type cffi-array (freeable) - ((element-type :initarg :type :accessor element-type)) +(define-foreign-type g-lib-array (cffi-array) + () (:actual-type :pointer)) (define-parse-method garray (type &key free) - (make-instance 'cffi-array :type type :free free)) + (make-instance 'g-lib-array :type type :free free)) (defcfun g-free :void (var :pointer)) -(defmethod free-ptr ((type cffi-array) ptr) +(defmethod free-ptr ((type g-lib-array) ptr) (g-free ptr)) -(defmethod translate-to-foreign (value (cffi-array cffi-array)) - (if (pointerp value) - value - (let* ((length (length value)) - (type (element-type cffi-array)) - (res (foreign-alloc type :count length))) - (dotimes (i length (values res t)) - (setf (mem-aref res type i) (elt value i))) - res))) - -;(defmethod free-translated-object (ptr (cffi-array cffi-array) param) -; (declare (ignore param)) -; (free-if-needed cffi-array ptr :free-func #'foreign-free)) - - -(defmethod translate-from-foreign (ptr (cffi-array cffi-array)) - (let ((array-length (mem-ref *array-length* :uint))) - (let* ((res (make-array array-length)) - (el-type (element-type cffi-array))) - (iter - (for i from 0 below array-length) - (setf (aref res i) - (mem-aref ptr el-type i))) - res))) From rklochkov at common-lisp.net Mon Feb 20 18:50:28 2012 From: rklochkov at common-lisp.net (CVS User rklochkov) Date: Mon, 20 Feb 2012 10:50:28 -0800 Subject: [gtk-cffi-cvs] CVS gtk-cffi/gtk Message-ID: Update of /project/gtk-cffi/cvsroot/gtk-cffi/gtk In directory tiger.common-lisp.net:/tmp/cvs-serv18060/gtk Modified Files: gtk-cffi.asd message-dialog.lisp package.lisp widget.lisp Added Files: about-dialog.lisp invisible.lisp window-group.lisp Log Message: Added GtkAboutDialog --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/02/20 16:51:37 1.14 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/gtk-cffi.asd 2012/02/20 18:50:28 1.15 @@ -14,7 +14,7 @@ :author "Roman Klochkov " :version "0.5" :license "LLGPL" - :depends-on (gdk-cffi g-object-cffi g-lib-cffi gtk-cffi-utils gio-cffi) + :depends-on (gdk-cffi gtk-cffi-utils gio-cffi) :components ((:file package) (:file enums :depends-on (package)) @@ -25,7 +25,8 @@ (:file style-context :depends-on (loadlib enums icon css-provider)) (:file style-provider :depends-on (loadlib)) (:file css-provider :depends-on (style-provider)) - (:file icon :depends-on (loadlib enums)))) + (:file icon :depends-on (loadlib enums)) + (:file window-group :depends-on (loadlib)))) (defsystem gtk-cffi-widget :description "Interface to GTK/Glib via CFFI" @@ -82,7 +83,7 @@ :license "LLGPL" :depends-on (gtk-cffi-bin) :components - ((:file :window))) + ((:file window))) (defsystem gtk-cffi-dialog :description "Interface to GTK/Glib via CFFI" @@ -91,7 +92,8 @@ :license "LLGPL" :depends-on (gtk-cffi-window gtk-cffi-vbox gtk-cffi-hbuttonbox) :components - ((:file :dialog))) + ((:file dialog) + (:file about-dialog :depends-on (dialog)))) (defsystem gtk-cffi-entry :description "Interface to GTK/Glib via CFFI" @@ -100,7 +102,7 @@ :license "LLGPL" :depends-on (gtk-cffi-widget) :components - ((:file :entry))) + ((:file entry))) (defsystem gtk-cffi-button :description "Interface to GTK/Glib via CFFI" @@ -118,7 +120,7 @@ :license "LLGPL" :depends-on (gtk-cffi-container) :components - ((:file :box))) + ((:file box))) (defsystem gtk-cffi-hbox :description "Interface to GTK/Glib via CFFI" --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2012/02/20 16:51:37 1.3 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/message-dialog.lisp 2012/02/20 18:50:28 1.4 @@ -11,11 +11,11 @@ (defcfun gtk-message-dialog-new :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) - (message :string) (null :pointer)) + (message :string)) (defcfun gtk-message-dialog-new-with-markup :pointer (parent pobject) (flags dialog-flags) (type message-type) (buttons buttons-type) - (message :string) (null :pointer)) + (message :string)) (defmethod gconstructor ((message-dialog message-dialog) @@ -25,7 +25,7 @@ (funcall (if markup #'gtk-message-dialog-new-with-markup #'gtk-message-dialog-new) - parent flags type buttons message (null-pointer))) + parent flags type buttons message)) (defun show-message (parent message &key (type :info) (buttons :ok) markup) (run (make-instance 'message-dialog :parent parent --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/02/20 16:51:37 1.14 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/package.lisp 2012/02/20 18:50:28 1.15 @@ -254,6 +254,14 @@ #:auto-startup-notification #:resize-grip-is-visible + #:window-group + ;; methods + #:add-window + #:remove-window + #:list-windows + #:current-grab + #:current-device-grab + #:dialog ;;methods #:run @@ -268,6 +276,23 @@ #:alternative-button-order #:alternative-dialog-button-order + #:about-dialog + ;;slots + #:program-name + #:version + #:copyright + #:comments + #:license + #:license-type + #:website + #:website-label + #:authors + #:artists + #:documenters + #:translator-credits + #:logo + #:logo-icon-name + #:entry ;; entry slots #:text --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/02/20 16:51:37 1.10 +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/widget.lisp 2012/02/20 18:50:28 1.11 @@ -11,6 +11,12 @@ ((%style-properties :accessor %style-properties :initform nil :allocation :class))) +(defcfun gtk-widget-new :pointer (g-type g-type) (null :pointer)) + +(defmethod gconstructor ((wideget widget) + &key type &allow-other-keys) + (gtk-widget-new type (null-pointer))) + (defclass requisition (struct) ()) @@ -502,5 +508,4 @@ style-property-type widget-class find-style-property %style-properties) -(defgeneric text (widget &key)) --- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/about-dialog.lisp 2012/02/20 18:50:28 NONE +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/about-dialog.lisp 2012/02/20 18:50:28 1.1 ;;; ;;; about-dialog.lisp --- GtkAboutDialog ;;; ;;; Copyright (C) 2012, Roman Klochkov ;;; (in-package :gtk-cffi) (defclass about-dialog (dialog) ()) (defcfun gtk-about-dialog-new :pointer) (defmethod gconstructor ((about-dialog about-dialog) &key &allow-other-keys) (gtk-window-group-new)) (defcenum license :unknown :custom :gpl-2-0 :gpl-3-0 :lgpl-2-0 :lgpl-3-0 :bsd :mit-x11 :artistic) (defslots about-dialog program-name :string version :string copyright :string comments :string license :string license-type license website :string website-label :string authors string-array artists string-array documenters string-array translator-credits :string logo pobject logo-icon-name :string) (init-slots about-dialog)--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/invisible.lisp 2012/02/20 18:50:28 NONE +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/invisible.lisp 2012/02/20 18:50:28 1.1 (in-package :gtk-cffi) (defclass invisible (widget) ()) (defcfun gtk-invisible-new :pointer) (defcfun gtk-invisible-new-for-screen :pointer (screen pobject)) (defmethod gconstructor ((invisible invisible) &key screen &allow-other-keys) (if screen (gtk-invisible-new-for-screen screen) (gtk-invisible-new))) (defslot invisible screen pobject)--- /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window-group.lisp 2012/02/20 18:50:28 NONE +++ /project/gtk-cffi/cvsroot/gtk-cffi/gtk/window-group.lisp 2012/02/20 18:50:28 1.1 ;;; ;;; window-group.lisp --- GtkWindowGroup ;;; ;;; Copyright (C) 2012, Roman Klochkov ;;; (in-package :gtk-cffi) (defclass window-group (g-object) ()) (defcfun gtk-window-group-new :pointer) (defmethod gconstructor ((window-group window-group) &key &allow-other-keys) (gtk-window-group-new)) (deffuns window-group (add-window :void (window pobject)) (remove-window :void (window pobject)) (list-windows g-list-object) (:get current-grab pobject) (:get current-device-grab pobject (device pobject))) (init-slots window-group)