Dave Peticolas <[EMAIL PROTECTED]> writes:

> > Also, I'd I noticed you went to gncGetCurrentSession.  If we're going
> > to be changing names, I'd much rather continue, for non-engine things,
> > migrating to the gnc_* names, like gnc_get_current_session.  Also, any
> > functions named gnucash_* should eventually be gnc_*.  They were named
> > before we(I) came up with gnc_*...
> 
> Ok, I'll start doing that.

Well, throw one more guideline in there.  You mentioned that you named
one of the functions so thatt it matched the rest of the file it was
in.  I didn't realize that, and I'd say that's worth doing.  So if all
the public functions in a file are still of the xaccFoo or gncFoo
variety, just leave them alone unless you're going to convert the
whole file, and even if then, if it's a file of the xaccFoo variety,
and in the engine, Linas has said that he'd like to leave that alone.

> Yes, I agree, I'm just using it right now the way it was originally
> being used (it's written with no return value). BTW, I don't get a
> 'cancel' button when I exit, just 'yes/no'.

Oh, well it used to say "yes" (or maybe OK), and "cancel".  Perhaps I
fixed that and forgot about it.  Yes or no is much better.  We still
might want do consider whether or not you ought to be able to cancel a
quit from there...

> And same here. gncFileQuit is written with a void return value.
> Looking at it, it doesn't appear to really need a return value.

OK.

> Ok, I didn't realize that g-wrap could handle the conversion.  I'll
> make the change.

Well, as far as g-wrap is concerned it handles the conversion to bool
with gh_bool2scm(int X), etc., so anything you can put in the argument
to that that'll give the right answer is fine.

> I think that should happen in the ui-shutdown hooks, and gnc_ui_shutdown
> should just be pure cleanup. Maybe we can say that the ui-shutdown hooks
> return a particular value to halt a ui-shutdown.

That might be worth considering, though we can always add that later
after we get used to the new approach.

I've also been thinking that sooner or later we're going to need to
address the difference between hooks for the user and hooks for the
system.  I suppose we can just have a naming convention or something,
and/or put notes in the docs.

> Instead of destroying resources, the ui_shutdown code just makes them
> invisible and causes the event loop to terminate.  Then, when the
> application as a whole shuts down, a ui_destroy function is called
> which is responsible for destroying them.  This makes stopping and
> application as a whole shuts down, a ui_destroy function is called
> which is responsible for destroying them.  This makes stopping and
> restarting the ui more efficient and enables me to solve the problem
> I was having in this area on the Motif side.

That sounds good.

> > > +  gnome_is_running = FALSE;
> > > +  gnome_is_terminating = FALSE;
> > 
> > How about putting these two FALSE assignments in the top of
> > gnucash_ui_init?  That seems a little more logical to me.
> 
> They are initially set to false by their static initializers.
> They need to be set to false when gtk_main falls out so that
> guile knows the ui is no longer running.

Nevermind about this.  I was really only thinking about
gnome_is_terminating, and that one could go either way depending on
how you think about it.

> Ok, I'll start doing that. I believe FALSE and TRUE are actually
> defined by glib, which also defines the gboolean type. X defines False
> and True, which are used in the Motif code. So many choices :)

Well, I'm not sure what the "right" answer is, but we should probably
pick one and stick to it.  I do like the idea of using an acutal
boolean type, though.  I's clearer and it makes interfacing with other
languages cleaner.

Oh and on a slightly related tangent.  Anyone reading this and writing
C level guile code, DO NOT presume that SCM_F and SCM_T are 0 and
non-zero respectively.  This is not guaranteed.  So don't write

  if(!gh_call0(foo)) { ...

you must write

  if(gh_call0(foo) == SCM_F) { ...

this is a common mistake (which I was making).

> > This was originally a place for non-gui, non-guile level cleanup that
> > *always* needs to happen (of course that might argue in favor of
> > atexit() or something.  Basically I intended it as a place to put
> > really low-level stuff.  For example, if you had a call to shutdown a
> > memory debugger or something, that would have gone here. Where would
> > that stuff go now?
> 
> I could put it back in and have it be one of the shutdown hooks.
> Or, we could just write a C routine for adding shutdown hooks
> from the C side.

Well, for the purposes I had intended it, using the hooks mechanism
wouldn't be appropriate since it was for C level things that might
have to be cleaned up even if guile never got started.  Though I think
perhaps we should just worry about this when/if we need it.

> thanks for your feedback,

No problem.  Thanks for the code.

-- 
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]

Reply via email to