Subject: Re: HOWTO use the perl bindings
From: Joaquín Cuenca Abela (cuenca@pacaterie.u-psud.fr)
Date: Wed Jun 20 2001 - 05:36:57 CDT
On 19 Jun 2001 13:07:14 -0400, Randy Kramer wrote:
> Joaquín,
>
> Joaquín Cuenca Abela wrote:
> > Randy, all your comment are very much appreciated!
>
> You're welcome!
>
> I've taken the liberty of revising your document (attached) to deal with
> some typos and such, and conversion of some phrases to more common
> american idiomatic expressions. (There will be many opinions about such
> things, feel free to ignore the changes if you wish.)
>
> Your revised document answers all my original questions (and more) -- I
> would have to read it with a clear mind in a few days to see if there is
> anything else.
>
> There is one thing though: the explanation of ieft is helpful, and so is
> the explanation of cpy, except it is confusing:
>
> I can imagine we might wish to do any of the following things.
>
> 1. Export a document in a different format, but continue working with
> the document in the existing format.
>
> In this case, I think we would:
> -Leave the document marked dirty
> -Create a new copy on disk with the new format
>
> 2. Create a document in a different format and start working on it. In
> doing this it would seem necessary to close the current document and
> appropriate to save it (first) (so no changes are lost).
>
> In this case, I think we would:
> -Create a new copy on disk with the new format
> -Save the copy with the current format (erase the dirty flag)
> -Open the copy with the new format (not marked dirty) in the same
> instance of AbiWord
>
> 3. Create a new document in a different format and open it in a new
> instance of AbiWord
>
> In this case, I think we would:
> -Create a new copy on disk with the new format
> -Leave the document marked dirty in the current instance of AbiWord
> -Open the copy with the new format (marked ??) in a new instance of
> AbiWord
>
> 4. Other?
>
> Maybe your intent for cpy = true is closer to the third? Anyway, you
> can tell I got confused. Maybe a parameter name other than cpy is a
> better choice (I've assumed cpy means copy). Or a three valued
> parameter:
> export, copy, clone ?? (Although I'm not sure all three of the
> scenarios I described are really useful.)
I should say that I don't know what cpy is supposed to mean (I just know
what the code does when cpy is true and what it does when cpy is false).
I just picked the name from the C++ code. I think that it was Sam who
introduced it when he added autosave in segfault, but I'm not sure... so
anybody knows what's the mean of cpy?
Anyway, I will try to explain what it does in another way. Say you want
to simulate the user clicking in the save icon, then you should call:
(supposing my $true = 1; and my $false = 0;)
$view->saveAs("blah.abw", 1, $true);
Say you want to save the file without telling it to the user (for
instance, autosaves works this way):
$view->saveAs("blah.abw~", 1, $false);
your scenario number 1 would be something as (supposing that you're
editing the file "blah.abw"):
$view->saveAs("blah.rtf", 5, $false);
your scenario number 2 would be:
$view->saveAs("blah.rtf", 5, $true);
your scenario number 3 would be:
$view->saveAs("blah.rtf", 5, $false);
$newframe = abi::openFile("blah.rtf");
> (I don't really know -- I'm just brainstorming here -- maybe it requires
> a few days of "sleeping on it")
>
> Reading a little more carefully, maybe your cpy = true is the second or
> third scenario (not sure which), and cpy = false is the first scenario?
>
> PS: I just realized that you must have the AbiWord source (or at least
> the Perl bindings part), even if you've installed from an AbiWord
> binary. Or maybe the perl bindings haven't been in any of the official
> distributions so far and your instructions are intended only for
> "developers" working from CVS? Depending on the answer, some more
> revisions may be appropriate.
nope, the perl bindings are not in any distribution (official or not).
I (and Paolo) added them after 0.7.14, and they are not yet of
"production quality" (read the post from Vlad for some very good remarks
of bindings that we don't yet have).
Anyway they are already useful in its current form, but by now only to
"hackers" (= those that build from cvs sources) :-)
> > can you please take a look at the new HOWTO (is attached with this
> > email), and see if it explains all these things? (I don't want to
> > explain how to install perl... I don't think that somebody should be
> > able to write a perl script it he doesn't know how to install perl in
> > his system)
>
> For now I agree. If the Perl bindings become the "embedded language", I
> might change my opinion.
of course, a chapter explaining how to get/install perl will become a
must, specially when we will get the perl bindings working in windows
(pretty much everybody has perl installed in unix boxes, but we can not
say the same thing of our windows peers :)
Cheers,
-- Joaquín Cuenca Abela cuenca@celium.net
This archive was generated by hypermail 2b25 : Wed Jun 20 2001 - 10:58:32 CDT