Move the module cache files below libdir

These files contain architecture-dependent paths, and thus placing
them into sysconfdir causes unnecessary hassle. Now the immodule cache
file is looked for in libdir/gtk-3.0/3.0.0/immodules.cache, and the
pixbuf loader cache is looked for in libdir/gtk-3.0/3.0.0/loaders.cache.
This commit is contained in:
Matthias Clasen
2010-05-17 21:30:46 -04:00
parent 8a487aca2c
commit 0b0f176ac4
9 changed files with 1480 additions and 1469 deletions

View File

@ -35,6 +35,12 @@ If called without arguments, it looks for modules in the
If called with arguments, it looks for the specified modules. The arguments
may be absolute or relative paths.
</para>
<para>
Normally, the output of <command>gdk-pixbuf-queryloaders-3.0</command> is written
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/loaders.cache</filename>, where <application>gdk-pixbuf</application> looks for it by default. If it is written to some other
location, the environment variable <link linkend="GDK_PIXBUF_MODULE_FILE"><envar>GDK_PIXBUF_MODULE_FILE</envar></link>
can be set to point <application>gdk-pixbuf</application> at the file.
</para>
</refsect1>
<refsect1><title>Environment</title>

View File

@ -16,12 +16,12 @@ a #GdkPixbufModuleFillVtableFunc function named
<para>
In order to make format-checking work before actually loading the modules
(which may require dlopening image libraries), modules export their
(which may require dlopening image libraries), modules export their
signatures (and other information) via the <function>fill_info</function>
function. An external utility, <command>gdk-pixbuf-query-loaders</command>,
uses this to create a text file containing a list of all available loaders and
function. An external utility, <command>gdk-pixbuf-query-loaders-3.0</command>,
uses this to create a text file containing a list of all available loaders and
their signatures. This file is then read at runtime by &gdk-pixbuf; to obtain
the list of available loaders and their signatures.
the list of available loaders and their signatures.
</para>
<para>
@ -30,21 +30,21 @@ Modules may only implement a subset of the functionality available via
<function>fill_vtable</function> function will simply not set the corresponding
function pointers of the #GdkPixbufModule structure. If a module supports
incremental loading (i.e. provides #begin_load, #stop_load and
#load_increment), it doesn't have to implement #load, since &gdk-pixbuf; can
supply a generic #load implementation wrapping the incremental loading.
#load_increment), it doesn't have to implement #load, since &gdk-pixbuf; can
supply a generic #load implementation wrapping the incremental loading.
</para>
<para>
Installing a module is a two-step process:
<itemizedlist>
<listitem><para>copy the module file(s) to the loader directory (normally
<filename><replaceable>libdir</replaceable>/gtk-2.0/<replaceable>version</replaceable>/loaders</filename>,
<filename><replaceable>libdir</replaceable>/gtk-3.0/<replaceable>version</replaceable>/loaders</filename>,
unless overridden by the environment variable
<envar>GDK_PIXBUF_MODULEDIR</envar>)
<envar>GDK_PIXBUF_MODULEDIR</envar>)
</para></listitem>
<listitem><para>call <command>gdk-pixbuf-query-loaders</command> to update the
<listitem><para>call <command>gdk-pixbuf-query-loaders-3.0</command> to update the
module file (normally
<filename><replaceable>sysconfdir</replaceable>/gtk-2.0/gdk-pixbuf.loaders</filename>,
<filename><replaceable>libdir</replaceable>/gtk-3.0/<replaceable>version</replaceable>/loaders.cache</filename>,
unless overridden by the environment variable
<envar>GDK_PIXBUF_MODULE_FILE</envar>)
</para></listitem>
@ -52,11 +52,11 @@ unless overridden by the environment variable
</para>
<para>
The &gdk-pixbuf; interfaces needed for implementing modules are contained in
The &gdk-pixbuf; interfaces needed for implementing modules are contained in
<filename>gdk-pixbuf-io.h</filename> (and
<filename>gdk-pixbuf-animation.h</filename> if the module supports animations).
They are not covered by the same stability guarantees as the regular
&gdk-pixbuf; API. To underline this fact, they are protected by
They are not covered by the same stability guarantees as the regular
&gdk-pixbuf; API. To underline this fact, they are protected by
<literal>#ifdef GDK_PIXBUF_ENABLE_BACKEND</literal>.
</para>
@ -188,7 +188,7 @@ use the <function>gdk_pixbuf_format_*</function> functions.
image format.
@flags: a combination of #GdkPixbufFormatFlags.
@disabled: a boolean determining whether the loader is disabled.
@license: a string containing license information, typically set to
@license: a string containing license information, typically set to
shorthands like "GPL", "LGPL", etc.
@Since: 2.2
@ -208,21 +208,21 @@ operations.
<!-- ##### STRUCT GdkPixbufModulePattern ##### -->
<para>
The signature of a module is a set of prefixes. Prefixes are encoded as
pairs of ordinary strings, where the second string, called the mask, if
not %NULL, must be of the same length as the first one and may contain
' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched,
not matched, "don't-care"-bytes, zeros and non-zeros.
Each prefix has an associated integer that describes the relevance of
pairs of ordinary strings, where the second string, called the mask, if
not %NULL, must be of the same length as the first one and may contain
' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched,
not matched, "don't-care"-bytes, zeros and non-zeros.
Each prefix has an associated integer that describes the relevance of
the prefix, with 0 meaning a mismatch and 100 a "perfect match".
</para>
<para>
Starting with &gdk-pixbuf; 2.8, the first byte of the mask may be '*',
indicating an unanchored pattern that matches not only at the beginning,
Starting with &gdk-pixbuf; 2.8, the first byte of the mask may be '*',
indicating an unanchored pattern that matches not only at the beginning,
but also in the middle. Versions prior to 2.8 will interpret the '*'
like an 'x'.
like an 'x'.
</para>
<para>
The signature of a module is stored as an array of
The signature of a module is stored as an array of
#GdkPixbufModulePattern<!-- -->s. The array is terminated by a pattern
where the @prefix is %NULL.
</para>
@ -234,7 +234,7 @@ GdkPixbufModulePattern *signature[] = {
{ NULL, NULL, 0 }
};
</programlisting>
The example matches e.g. "auud\0" with relevance 100, and "blau" with
The example matches e.g. "auud\0" with relevance 100, and "blau" with
relevance 90.</informalexample>
@prefix: the prefix for this pattern
@ -245,8 +245,8 @@ relevance 90.</informalexample>
<!-- ##### USER_FUNCTION GdkPixbufModuleFillVtableFunc ##### -->
<para>
Defines the type of the function used to set the vtable of a
#GdkPixbufModule when it is loaded.
Defines the type of the function used to set the vtable of a
#GdkPixbufModule when it is loaded.
</para>
@module: a #GdkPixbufModule.
@ -255,7 +255,7 @@ Defines the type of the function used to set the vtable of a
<!-- ##### USER_FUNCTION GdkPixbufModuleFillInfoFunc ##### -->
<para>
Defines the type of the function used to fill a
Defines the type of the function used to fill a
#GdkPixbufFormat structure with information about a module.
</para>
@ -265,19 +265,19 @@ Defines the type of the function used to fill a
<!-- ##### USER_FUNCTION GdkPixbufModuleSizeFunc ##### -->
<para>
Defines the type of the function that gets called once the size
Defines the type of the function that gets called once the size
of the loaded image is known.
</para>
<para>
The function is expected to set @width and @height to the desired
size to which the image should be scaled. If a module has no efficient
size to which the image should be scaled. If a module has no efficient
way to achieve the desired scaling during the loading of the image, it may
either ignore the size request, or only approximate it -- &gdk-pixbuf; will
then perform the required scaling on the completely loaded image.
then perform the required scaling on the completely loaded image.
</para>
<para>
If the function sets @width or @height to zero, the module should interpret
this as a hint that it will be closed soon and shouldn't allocate further
this as a hint that it will be closed soon and shouldn't allocate further
resources. This convention is used to implement gdk_pixbuf_get_file_info()
efficiently.
</para>
@ -290,11 +290,11 @@ efficiently.
<!-- ##### USER_FUNCTION GdkPixbufModulePreparedFunc ##### -->
<para>
Defines the type of the function that gets called once the initial
Defines the type of the function that gets called once the initial
setup of @pixbuf is done.
</para>
<para>
#GdkPixbufLoader uses a function of this type to emit the
#GdkPixbufLoader uses a function of this type to emit the
"<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>"
signal.
</para>
@ -311,7 +311,7 @@ Defines the type of the function that gets called every time a region
of @pixbuf is updated.
</para>
<para>
#GdkPixbufLoader uses a function of this type to emit the
#GdkPixbufLoader uses a function of this type to emit the
"<link linkend="GdkPixbufLoader-area-updated">area_updated</link>"
signal.
</para>
@ -327,14 +327,14 @@ signal.
<!-- ##### STRUCT GdkPixbufModule ##### -->
<para>
A #GdkPixbufModule contains the necessary functions to load and save
images in a certain file format.
A #GdkPixbufModule contains the necessary functions to load and save
images in a certain file format.
</para>
<para>
A #GdkPixbufModule can be loaded dynamically from a #GModule.
Each loadable module must contain a #GdkPixbufModuleFillVtableFunc function
Each loadable module must contain a #GdkPixbufModuleFillVtableFunc function
named <function>fill_vtable</function>, which will get called when the module
is loaded and must set the function pointers of the #GdkPixbufModule.
is loaded and must set the function pointers of the #GdkPixbufModule.
</para>
@module_name: the name of the module, usually the same as the
@ -353,8 +353,8 @@ is loaded and must set the function pointers of the #GdkPixbufModule.
<!-- ##### STRUCT GdkPixbufAnimationClass ##### -->
<para>
Modules supporting animations must derive a type from
#GdkPixbufAnimation, providing suitable implementations of the
Modules supporting animations must derive a type from
#GdkPixbufAnimation, providing suitable implementations of the
virtual functions.
</para>
@ -366,17 +366,17 @@ virtual functions.
<!-- ##### STRUCT GdkPixbufAnimationIterClass ##### -->
<para>
Modules supporting animations must derive a type from
#GdkPixbufAnimationIter, providing suitable implementations of the
Modules supporting animations must derive a type from
#GdkPixbufAnimationIter, providing suitable implementations of the
virtual functions.
</para>
@parent_class: the parent class
@get_delay_time: returns the time in milliseconds that the current frame
@get_delay_time: returns the time in milliseconds that the current frame
should be shown.
@get_pixbuf: returns the current frame.
@on_currently_loading_frame: returns whether the current frame of @iter is
@on_currently_loading_frame: returns whether the current frame of @iter is
being loaded.
@advance: advances the iterator to @current_time, possibly changing the
@advance: advances the iterator to @current_time, possibly changing the
current frame.

View File

@ -34,6 +34,12 @@ module path.
If called with arguments, it looks for the specified modules. The arguments
may be absolute or relative paths.
</para>
<para>
Normally, the output of <command>gtk-query-immodules-3.0</command> is written
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
location, the environment variable <link linkend="GTK_IM_MODULE_FILE"><envar>GTK_IM_MODULE_FILE</envar></link>
can be set to point GTK+ at the file.
</para>
</refsect1>
<refsect1><title>Environment</title>

View File

@ -262,9 +262,8 @@ additional environment variables.
Specifies the file listing the IM modules to load. This environment
variable overrides the <literal>im_module_file</literal> specified in
the RC files, which in turn overrides the default value
<filename><replaceable>sysconfdir</replaceable>/gtk-3.0/gtk.immodules</filename>
(<replaceable>sysconfdir</replaceable> is the sysconfdir specified when GTK+ was configured,
usually <filename>/usr/local/etc</filename>.)
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>
(<replaceable>libdir</replaceable> has the same meaning here as explained for <envar>GTK_PATH</envar>).
</para>
</formalpara>