Re: [clutter] ClutterScript item list

2008-08-13 Thread Noah Gibbs
  I've uploaded a proposed patch to bug #1099 that would add this function.  I 
took your suggestion and made it a list of GObject pointers, not a list of IDs. 
 I've done very basic testing on this patch, but nothing extensive.

  I'd have liked to do a diff versus the latest SVN version and just uploaded 
an SVN diff, but I'm having trouble building the latest SVN.  I think I'm 
missing some kind of autoconf-related tools, but the error message is 
unhelpful.  Anyway, it means I couldn't easily test if I did that.  So this 
patch is against the very similar-looking 0.8.0 versions of clutter-script.[ch].

  I apologize for my patch-fu being weak on this one :-)

--- On Tue, 8/12/08, Noah Gibbs [EMAIL PROTECTED] wrote:

 From: Noah Gibbs [EMAIL PROTECTED]
 Subject: Re: [clutter] ClutterScript item list
 To: Emmanuele Bassi [EMAIL PROTECTED]
 Cc: clutter@o-hand.com
 Date: Tuesday, August 12, 2008, 12:25 PM
 --- On Mon, 8/11/08, Emmanuele Bassi
 [EMAIL PROTECTED] wrote:
  On Mon, 2008-08-11 at 14:48 -0700, Noah Gibbs wrote:
   We're looking at a situation where we might
 get
  data that is more free-form.
  
  I hope you do realize the potential security issues
 that
  this would
  entail.
 
   I responded to you in private email about this, and
 mentioned that I knew some of these issues -- we'll need
 to be careful about what GObjects we allow to be
 instantiated, primarily.  We're in a situation where we
 both write the ClutterScript files at my company, and have
 the ability to vet what type fields are allowed,
 so I believe that we're reasonably safe on this one. 
 I'm hoping that if you disagree you'll let me know.
 
  I can add a method like:
  
gchar **clutter_script_get_ids (ClutterScript
 *script,
gsize
 *n_ids);
  
  which returns a newly allocated, NULL-terminated array
 of
  strings.
  
  but the ids alone will not give you any detail
 whatsoever
  on the object
  they are assigned to; you'll have to fetch the
 object
  and then check
  what it is.
 
   This is true.  So it might be more useful to get an array
 of GObject pointers instead of an array of IDs.  I'd be
 quite happy either way since either would allow me to do
 what I'm trying to.
 
 
 
   
 -- 
 To unsubscribe send a mail to
 [EMAIL PROTECTED]


  
-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] ClutterScript item list

2008-08-11 Thread Emmanuele Bassi
On Mon, 2008-08-11 at 14:34 -0700, Noah Gibbs wrote:
 Looking at clutter-script.c, it looks like there's a nice little internal 
 hash table (priv-objects) with a list of the objects that were parsed from 
 the file, but you have to know the name of all the objects to get at them.

it's expected, since you must have written the UI definition or have
control on what you're defining. you're surely not loading random data.

or maybe I haven't understood your question.

   It would be easy enough to write one or more functions to grab these items 
 from a ClutterScript object.  Anybody know a reason why the interface 
 shouldn't have such functions?  Would a patch be accepted into clutter main 
 if I wrote some simple functions along these lines?

you mean you want all the ids? or all the objects?

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, OpenedHand Ltd.
Unit R, Homesdale Business Centre
216-218 Homesdale Rd., Bromley - BR12QZ
http://www.o-hand.com

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] ClutterScript item list

2008-08-11 Thread Emmanuele Bassi
[keeping the list cc-ed]

On Mon, 2008-08-11 at 14:48 -0700, Noah Gibbs wrote:
 We're looking at a situation where we might get data that is more free-form.

I hope you do realize the potential security issues that this would
entail.

 We could require that the person writing the ClutterScript file add all of
 their objects to a named top-level container and ignore everything that isn't
 in the container, but we'd prefer not to.

I still have doubts on the usefulness of this.

the UI definition is integral part of an application; ClutterScript
doesn't also provide any sort of logic inside the UI definition itself -
it's just a definition.

 If we could get a list of IDs, that would let us get all the objects when/if
 we wanted them, so that would work.  So yes, I mean get a list of all the 
 object
 IDs currently loaded into a given ClutterScript.  Basically, all the object
 IDs currently in priv-objects.

I can add a method like:

  gchar **clutter_script_get_ids (ClutterScript *script,
  gsize *n_ids);

which returns a newly allocated, NULL-terminated array of strings.

but the ids alone will not give you any detail whatsoever on the object
they are assigned to; you'll have to fetch the object and then check
what it is. and even in that case you'll not know for sure unless you
have some sort of introspection - or any way you can trust what you get
out of a UI definition string or file.

I'd suggest you open a bug on bugzilla.openedhand.com with the API
request and a link to this email, so that we can get some discussion and
keep track of this.

ciao,
 Emmanuele.

 --- On Mon, 8/11/08, Emmanuele Bassi [EMAIL PROTECTED] wrote:
 
  From: Emmanuele Bassi [EMAIL PROTECTED]
  Subject: Re: [clutter] ClutterScript item list
  To: clutter@o-hand.com
  Date: Monday, August 11, 2008, 2:42 PM
  On Mon, 2008-08-11 at 14:34 -0700, Noah Gibbs wrote:
   Looking at clutter-script.c, it looks like there's
  a nice little internal hash table (priv-objects) with a
  list of the objects that were parsed from the file, but you
  have to know the name of all the objects to get at them.
  
  it's expected, since you must have written the UI
  definition or have
  control on what you're defining. you're surely not
  loading random data.
  
  or maybe I haven't understood your question.
  
 It would be easy enough to write one or more
  functions to grab these items from a ClutterScript object. 
  Anybody know a reason why the interface shouldn't have
  such functions?  Would a patch be accepted into clutter main
  if I wrote some simple functions along these lines?
  
  you mean you want all the ids? or all the objects?
  
  ciao,
   Emmanuele.
  
  -- 
  Emmanuele Bassi, OpenedHand Ltd.
  Unit R, Homesdale Business Centre
  216-218 Homesdale Rd., Bromley - BR12QZ
  http://www.o-hand.com
  
  -- 
  To unsubscribe send a mail to
  [EMAIL PROTECTED]
 
 
   
 
-- 
Emmanuele Bassi, OpenedHand Ltd.
Unit R, Homesdale Business Centre
216-218 Homesdale Rd., Bromley - BR12QZ
http://www.o-hand.com

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]



Re: [clutter] ClutterScript item list

2008-08-11 Thread Noah Gibbs
--- On Mon, 8/11/08, Emmanuele Bassi [EMAIL PROTECTED] wrote:
 I'd suggest you open a bug on bugzilla.openedhand.com
 with the API
 request and a link to this email, so that we can get some
 discussion and
 keep track of this.

  Sounds good.  Bug number 1099 has been opened for this.



  
-- 
To unsubscribe send a mail to [EMAIL PROTECTED]