Re: New methods for abiwidget

From: Robert Staudinger <robert.staudinger_at_gmail.com>
Date: Tue Jan 02 2007 - 12:49:32 CET

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

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 Tue Jan 2 12:50:54 2007

This archive was generated by hypermail 2.1.8 : Tue Jan 02 2007 - 12:50:54 CET