openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ariel Constenla-Haile <>
Subject Re: [EXT] Availability of standard OO documents icons to extensions
Date Wed, 23 Jul 2014 18:39:24 GMT
Hi Amenel,

On Mon, Jul 21, 2014 at 05:36:25PM +0100, Amenel VOGLOZIN wrote:
> Hi all,
> I'd like to know whether MIME type icons (for ODT, ODS, ODP, etc.)
> that can be seen in the File > Newmenu entry are available to
> extensions, for instance when creating an XGraphic object.

All those images are stored in a zip file inside the office
installation, on Linux /opt/openoffice4/share/config/ You can
access those images using the
"private:graphicrepository/<>" URL.

The main problem is that the location/name of the images is an
implementation detail, and there is no guarantee that it will be the
same between different releases. For example, you could get that the
icon for Writer documents is res/sx03251.png by reading some source code
(svtools/source/misc/imagemgr.*) or asking in this mailing list, but
there is no guarantee that res/sx03251.png won't change in the next
release, breaking your extension.

So it is better if you take the images you need, and pack them inside
your extension (the images, like the rest of AOO source, is released
under the Apache License v.2). Unzip, and search then inside
the /res folder; document images follow this scheme:

sx<image_id>.png - small images
sxh<image_id>.png - small images, high-contrast

lx<image_id>.png - big images
lxh<image_id>.png - big images, high-contrast

The image_id is not very simple to get, you need to read source code:

- this array will give you the image id for the extension:
  For example, "odt" has image ID IMG_OO_WRITER_DOC

  IMAGELIST_START is defined as 3076

This gives 3251, from there the sx03251.png.

Ariel Constenla-Haile
La Plata, Argentina

View raw message