[Gpephone-devel] Pixmap location

YU Yijun RD-ILAB-PEK yijun.yu at orange-ftgroup.com
Tue Aug 7 04:52:56 CEST 2007


Hi,

I think the reason to use <resource prefix> instead of PREFIX is that we can't guarantee applications will be installed to the location specified by PREFIX. Application compiling and application installed to the device are two independent processes. In current code, in order to locate a resource file, application will first check if an environment variable exists and then check in PREFIX specified path. <resource preifx> is similar as the environment variable, however, it is a global setting parameter. Once applications are installed to a specific directory of a device, say /opt/gpephone (if /usr/local readonly), then we should initialize <resource prefix> to /opt/gpephone, and later when application is running, it will read the global parameter <resource prefix> to detect the application installation path.

In summary, it is similar as environment variable, but easier to management. Of course, applications should still use PREFIX as fallback.

Comments?

Regards
YU Yijun

>-----Original Message-----
>From: gpephone-devel-bounces at linuxtogo.org
>[mailto:gpephone-devel-bounces at linuxtogo.org] On Behalf Of Florian Boor
>Sent: 2007年8月6日 19:58
>To: WANG Gang RD-ILAB-PEK
>Cc: gpephone-devel at linuxtogo.org
>Subject: Re: [Gpephone-devel] Pixmap location
>
>Hi,
>
>WANG Gang RD-ILAB-PEK schrieb:
>>         applications: provide pixmap files, define the directory
>> structure of to-be-install files.
>>
>>         gpe-applauncher: find the pixmap files in resource directories.
>> Rules of pixmap locations: for themable pixmap files (eg. icons,
>> background images), they should be stored in <resource
>> prefix>/share/themes/<current theme>/ or <resource
>> prefix>/share/themes/default/. For non-themable pixmap files, they
>> should be placed in <resource prefix>/share/pixmaps.
>
>could you explain the concept of this resource prefix? Usually you have three
>locations for these files:
>$PREFIX/share/pixmaps: For thing of general interest such a default application
>icon.
>$PREFIX/share/themes/default/<application name>/ For the defaults of all
>themeable pixmaps and other theme components which come with the application.
>$PREFIX/share/themes/<theme name>/<application name>/ For alternate resources
>provided by themes.
>
>This should cover all of our requirements:
>- Its easy to understand because its a simple concept and quite common among
>UNIX applications.
>- It makes sure that the application always finds its defaults if they are
>installed correctly.
>- It reduces the amount of slow filesystem operations to search for files.
>
>In addition to this gpe-applauncher and gpe-phonepanel are able accept custom
>files for every themeable pixmap using libsettings. That's way more complex that
>it should be - we need to make these things fast and easy to understand.
>
>>     For gpe-applauncher, the search for a pixmap file goes through the
>> following process:
>>
>>     1. find it in <resource prefix>/share/themes/<current theme>/
>>
>>     2. find it in <resource prefix>/share/themes/default/
>>
>>     3. find it in <resource prefix>/share/pixmaps/
>>
>>     4. find it in PREFIX/share/pixmaps/
>
>And in addition we have the individual settings... that means five locations
>to
>search for a single pixmap and a much more complex process replacing an
>established one working pretty well for many applications.
>On most devices most people will use the default theme anyway - so that means
>three to four searches before using the default. Your position 2. could be the
>default one and if you replace that resource prefix with the datadir build time
>setting (which defaults to $prefix/share) you have full control over the
>location where to search for your defaults and you save bloat and slowdown at
>runtime.
>
>Greetings
>
>Florian
>
>--
>The dream of yesterday                  Florian Boor
>is the hope of today                    Tel: +49 271-771091-15
>and the reality of tomorrow.            Fax: +49 271-771091-19
>[Robert Hutchings Goddard, 1904]        florian.boor at kernelconcepts.de
>
>1D78 2D4D 6C53 1CA4 5588  D07B A8E7 940C 25B7 9A76
>
>_______________________________________________
>Gpephone-devel mailing list
>Gpephone-devel at linuxtogo.org
>http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/gpephone-devel



More information about the Gpephone-devel mailing list