From: espen Date: Thu, 9 Feb 2006 22:32:47 +0000 (+0000) Subject: Added ALLOCATE-FOREIGN method X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/commitdiff_plain/9176d3016a7e5a30d32cbbb68ba4cfbac6ef4394?hp=8bc1cf79b862f73f475199118fd1b75e7cc3f083 Added ALLOCATE-FOREIGN method --- diff --git a/gtk/gtk.lisp b/gtk/gtk.lisp index 63d4f54..05f6c8a 100644 --- a/gtk/gtk.lisp +++ b/gtk/gtk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtk.lisp,v 1.51 2006-02-08 22:21:07 espen Exp $ +;; $Id: gtk.lisp,v 1.52 2006-02-09 22:32:47 espen Exp $ (in-package "GTK") @@ -1091,13 +1091,14 @@ (defbinding menu-tool-button-set-arrow-tooltip () nil ;;; Message dialog -(defmethod initialize-instance ((dialog message-dialog) - &key (message-type :info) (buttons :close) - flags text #+gtk 2.6 secondary-text - transient-parent) - (setf - (foreign-location dialog) - (%message-dialog-new transient-parent flags message-type buttons)) +(defmethod allocate-foreign ((dialog message-dialog) &key (message-type :info) + (buttons :close) flags transient-parent) + (%message-dialog-new transient-parent flags message-type buttons)) + + +(defmethod shared-initialize ((dialog message-dialog) names + &key text #+gtk 2.6 secondary-text) + (declare (ignore names)) (when text (message-dialog-set-markup dialog text)) #+gtk2.6 diff --git a/gtk/gtkselection.lisp b/gtk/gtkselection.lisp index 9fa169e..3c0eee2 100644 --- a/gtk/gtkselection.lisp +++ b/gtk/gtkselection.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtkselection.lisp,v 1.4 2006-02-08 22:21:07 espen Exp $ +;; $Id: gtkselection.lisp,v 1.5 2006-02-09 22:32:47 espen Exp $ (in-package "GTK") @@ -46,9 +46,8 @@ (defbinding %target-list-new () pointer (targets (vector (inlined target-entry))) ((length targets) int)) -(defmethod initialize-instance ((target-list target-list) &key targets) - (setf (foreign-location target-list) (%target-list-new targets)) - (call-next-method)) +(defmethod allocate-foreign ((target-list target-list) &key targets) + (%target-list-new targets)) (defbinding target-list-add (target-list target &optional flags info) nil (target-list target-list) diff --git a/gtk/gtktree.lisp b/gtk/gtktree.lisp index 9b408f5..81c6896 100644 --- a/gtk/gtktree.lisp +++ b/gtk/gtktree.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktree.lisp,v 1.13 2006-02-08 22:21:07 espen Exp $ +;; $Id: gtktree.lisp,v 1.14 2006-02-09 22:32:47 espen Exp $ (in-package "GTK") @@ -291,11 +291,8 @@ (defbinding %tree-row-reference-new () pointer (model tree-model) (path tree-path)) -(defmethod initialize-instance ((reference tree-row-reference) &key model path) - (setf - (foreign-location reference) - (%tree-row-reference-new model path)) - (call-next-method)) +(defmethod allocate-foreign ((reference tree-row-reference) &key model path) + (%tree-row-reference-new model path)) (defbinding tree-row-reference-get-path () tree-path (reference tree-row-reference)) diff --git a/rsvg/rsvg.lisp b/rsvg/rsvg.lisp index 489ef4c..c2d5872 100644 --- a/rsvg/rsvg.lisp +++ b/rsvg/rsvg.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: rsvg.lisp,v 1.2 2006-02-08 22:21:26 espen Exp $ +;; $Id: rsvg.lisp,v 1.3 2006-02-09 22:33:13 espen Exp $ (in-package "RSVG") @@ -111,15 +111,14 @@ (defbinding %handle-new-from-file () pointer (filename pathname) (nil gerror :out)) -(defmethod initialize-instance ((handle handle) &key filename) +(defmethod allocate-foreign ((handle handle) &key filename) (multiple-value-bind (location gerror) (cond (filename (%handle-new-from-file filename)) (t (%handle-new))) (if gerror (signal-gerror gerror) - (setf (foreign-location handle) location))) - (call-next-method)) + location))) (defbinding %handle-free () nil