Re: New methods for abiwidget

From: Martin Sevior <msevior_at_physics.unimelb.edu.au>
Date: Wed Jan 03 2007 - 02:30:47 CET

On Tue, 2007-01-02 at 12:49 +0100, Robert Staudinger wrote:
> Hi Martin,
>
> a few questions / suggestions about your recent abiwidget work (thanks
> for doing all that stuff, i'm just a naming n**i ;-).
>
> What about simplifying the property names?
> + "content" / abi_widget_get_content()
> + "selection" / abi_widget_get_selection()
> seems very intuitive to me.
>
> I'd also propose two more properties "content-length" and
> "selection-length" to go go with the above two. Preserving the length
> of the last content/selection access in a "data-length" property
> doesn't seem very intuitive to me.
>
> Could we make the mimetype of the current document a property of its
> own? Then the content and selection accessors wouldn't need to take an
> extra argument and could be made "real" properties in python and
> javascript. The mimetype is probably not changed very often during the
> lifetime of a widget, so that would lead to cleaner code.
> Also it would be possible to test for supported mimetypes with something like
>
> canvas.mimetype = "application/x-crossmark"
> mimetype = canvas.mimetype
> if mimetype != "application/x-crossmark":
> # use fallback mimetype
> ...
>
> Can we just drop the support for specifying mimetypes by passing their
> most common suffix (e.g. ".rtf") to the mimetype property? Suffixes
> are just too ambiguous and developers working with the AbiWidget
> should have an idea of mimetypes anyways.
> What we could do in exchange is an AbiWidget method that maps a
> mimetype to a certain suffix, in case the AbiWidget consumer wants to
> persist the data himself.
>
> What do you think?
> Rob
>

HI Rob,
        Almost all done and committed.

My only point of disagreement is to keep the option of setting the
filetype via suffix. I see no point in making developers lives harder
than needed and it is certainly easier for me to remember that ".rtf"
means rich text format. To be clear this is still supported.

Cheers

martin

CVS:
----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/pyabiword.defs src/pyabiword.override
CVS:
----------------------------------------------------------------------
Rename "get_content_all" to "content", "get_content_selection" to
"selection"

CVS:
----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/wp/ap/unix/abiwidget.cpp
CVS:
----------------------------------------------------------------------
Implement "content_length" and "selection_length" properties. Drop
"data_length" property. Mimetype defaults to mimetype of current
document unless changed from via "mimetype" property.

> On 12/29/06, msevior@physics.unimelb.edu.au
> <msevior@physics.unimelb.edu.au> wrote:
> >
> > CVS: ----------------------------------------------------------------------
> > CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
> > CVS:
> > CVS: Committing in .
> > CVS:
> > CVS: Modified Files:
> > CVS: src/text/fmt/xp/fp_Run.cpp src/text/fmt/xp/fp_TextRun.cpp
> > CVS: src/text/fmt/xp/fv_View_protected.cpp
> > CVS: src/text/ptbl/xp/pd_Document.cpp src/wp/ap/unix/abiwidget.cpp
> > CVS: src/wp/ap/unix/abiwidget.h
> > CVS: ----------------------------------------------------------------------
> > Implement two new methods for AbiWidget, which can be used to extract
> > content from the widget in any form that abi can export to.
> > gchar * abi_widget_get_content_all(AbiWidget * w, gchar * mimetype);
> > gchar * abi_widget_get_content_selection(AbiWidget * w, gchar * mimetype);
> >
> > The mimetype can also be the standard filetype extension, eg ".abw",
> > ".rtf", ".html"
> >
> > The python bindings have been updated to include these two new methods.
> >
> > More features requested by OLPC
> >
> > Cheers
> >
> > Martin
> >
> >
> >
> >
Received on Wed Jan 3 02:36:21 2007

This archive was generated by hypermail 2.1.8 : Wed Jan 03 2007 - 02:36:21 CET