X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1CS9GG56T30SL6v4wcyUOZi1lcSQiSScizv3eojDQN8=; b=NJ7zYQg8mq+dViCmqHX+rGR6vd4txVjhTShGWpIYl45kQWIW1PDGxiumVxDSUsvNhc vmSKC3HKgfQQ7GEO27wHzRP25LRuI3x6rGUFI8lJoZfSln1D6vCaZfy+j/bth3eQRD/C 1969IrbFAwMdHbgxwoCG1SD8FNDYl6bSdI55hALcVPRDKDp8U9whW2pgs7inORPx2S6u 8VYimAXe1HeN2dWSYXmLC40g33rvZVMl3QIYF3TnMSM1zv0GeGJWkcdufXI//aXU8vyE m0zsHih9dkXluGhnaTXqB0gSSL9NXQSZhua6P6UK0DwPox2u+TtR1PPny2+ktsya5Vok PDLw== MIME-Version: 1.0 X-Received: by 10.50.20.232 with SMTP id q8mr635777ige.0.1374692520634; Wed, 24 Jul 2013 12:02:00 -0700 (PDT) In-Reply-To: References: <2174C2C2-6FAF-4544-A4C0-5FDBD564A6FB AT sbcglobal DOT net> <1374513797 DOT 3124 DOT 12 DOT camel AT AMD64X2 DOT fritz DOT box> Date: Wed, 24 Jul 2013 20:02:00 +0100 Message-ID: Subject: Re: [geda-user] Non-modal Dialogs From: Luis de Arquer To: geda-user AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, Jul 23, 2013 at 1:29 AM, Edward Hennessy wrote: > > On Jul 22, 2013, at 11:01 AM, Luis de Arquer wrote: >> >> So my suggestion is, why not use the weak refs to implement Stefan's >> idea? Right now, it only notifies destruction of the object -correct >> me if I am wrong-, but it could well notify a change in the object. >> So, in the case of the properties dialog, on creation it would create >> a weak ref to the object, with a notification callback. And everytime >> an object is modified, the list of weak refs is checked, calling any >> existing callback. > > Thanks. I will look at the weak references. > > Cheers, > Ed Having a quick look at libgeda/src/s_weakref.c, there are a few functions managing the notification, and helping to add weak references to an object (weak references are stored in a GList at st_object). It is the only notifying mechanism I have found in libgeda so far. The weak ref struct looks like this: struct WeakRef { void (*notify_func)(void *, void *); void *user_data; }; so it is a simple notification mechanism, apparently only used for object destruction, although it could potentially be used for other events. IMHO, gobjects may be a better long term choice. It has most of the job done already, and includes reference counting. It is also attribute friendly, but I don't know how much of a grief it could be to embed gobjects in libgeda. Regards, Luis