В FPC 2.2.0 в файле /fpcsrc/packages/extra/gtk/gdk/gdkpixbuf.pp описаны следующие функции
- Код: Выделить всё
{$IfNDef XLIB_SUPPORT}
{ Rendering to a TGDKDrawable }
procedure gdk_pixbuf_render_threshold_alpha(pixbuf:PGdkPixbuf; bitmap:PGdkBitmap; src_x:longint; src_y:longint; dest_x:longint;
dest_y:longint; width:longint; height:longint; alpha_threshold:longint);cdecl; external libgdkpixbuf name 'gdk_pixbuf_render_threshold_alpha';
procedure gdk_pixbuf_render_to_drawable(pixbuf:PGdkPixbuf; Drawable:PGDKDrawable; GC:PGDKGC; src_x:longint; src_y:longint;
dest_x:longint; dest_y:longint; width:longint; height:longint; dither:TGDKRGBDither;
x_dither:longint; y_dither:longint);cdecl; external libgdkpixbuf name 'gdk_pixbuf_render_to_drawable';
procedure gdk_pixbuf_render_to_drawable_alpha(pixbuf:PGdkPixbuf; Drawable:PGDKDrawable; src_x:longint; src_y:longint; dest_x:longint;
dest_y:longint; width:longint; height:longint; alpha_mode:TGdkPixbufAlphaMode; alpha_threshold:longint;
dither:TGDKRGBDither; x_dither:longint; y_dither:longint);cdecl; external libgdkpixbuf name 'gdk_pixbuf_render_to_drawable_alpha';
procedure gdk_pixbuf_render_pixmap_and_mask(pixbuf:PGdkPixbuf; Pixmap_return:PPGDKPixmap; mask_return:PPGdkBitmap; alpha_threshold:longint);cdecl; external libgdkpixbuf name 'gdk_pixbuf_render_pixmap_and_mask';
{ Fetching a region from a TDrawable }
function gdk_pixbuf_get_from_drawable(dest:PGdkPixbuf; src:PGDKDrawable; cmap:PGDKColormap; src_x:longint; src_y:longint;
dest_x:longint; dest_y:longint; width:longint; height:longint):PGdkPixbuf;cdecl; external libgdkpixbuf name 'gdk_pixbuf_get_from_drawable';
{$EndIf}
Они ссылаются на библиотеку libgdk_pixbuf.so из поставки GTK1.
Проблема в том, что в Gentoo такой библиотеки нету - вообще нету в стандартной поставке - gdk_pixbuf/GTK1 больше Gentoo не поддерживается.
Функции, перечисленные выше есть в стандартной библиотеке libgdk-x11-2.0.so (т.е. стандартная библиотека GDK/GTK2). Для того, чтобы файл /fpcsrc/packages/extra/gtk/gdk/gdkpixbuf.pp скомпилился и можно было работать с функциями gdk_pixbuf, указанный выше фрагмент нужно переделать вот к такому виду:
- Код: Выделить всё
{$IfNDef XLIB_SUPPORT}
{ Rendering to a TGDKDrawable }
procedure gdk_pixbuf_render_threshold_alpha(pixbuf:PGdkPixbuf; bitmap:PGdkBitmap; src_x:longint; src_y:longint; dest_x:longint;
dest_y:longint; width:longint; height:longint; alpha_threshold:longint);cdecl; external 'libgdk-x11-2.0.so' name 'gdk_pixbuf_render_threshold_alpha';
procedure gdk_pixbuf_render_to_drawable(pixbuf:PGdkPixbuf; Drawable:PGDKDrawable; GC:PGDKGC; src_x:longint; src_y:longint;
dest_x:longint; dest_y:longint; width:longint; height:longint; dither:TGDKRGBDither;
x_dither:longint; y_dither:longint);cdecl; external 'libgdk-x11-2.0.so' name 'gdk_pixbuf_render_to_drawable';
procedure gdk_pixbuf_render_to_drawable_alpha(pixbuf:PGdkPixbuf; Drawable:PGDKDrawable; src_x:longint; src_y:longint; dest_x:longint;
dest_y:longint; width:longint; height:longint; alpha_mode:TGdkPixbufAlphaMode; alpha_threshold:longint;
dither:TGDKRGBDither; x_dither:longint; y_dither:longint);cdecl; external 'libgdk-x11-2.0.so' name 'gdk_pixbuf_render_to_drawable_alpha';
procedure gdk_pixbuf_render_pixmap_and_mask(pixbuf:PGdkPixbuf; Pixmap_return:PPGDKPixmap; mask_return:PPGdkBitmap; alpha_threshold:longint);cdecl; external 'libgdk-x11-2.0.so' name 'gdk_pixbuf_render_pixmap_and_mask';
{ Fetching a region from a TDrawable }
function gdk_pixbuf_get_from_drawable(dest:PGdkPixbuf; src:PGDKDrawable; cmap:PGDKColormap; src_x:longint; src_y:longint;
dest_x:longint; dest_y:longint; width:longint; height:longint):PGdkPixbuf;cdecl; external 'libgdk-x11-2.0.so' name 'gdk_pixbuf_get_from_drawable';
{$EndIf}
Собственно - все... Хотя решение парадоксальное - получается, что скомпилированная под GTK1 программа требует наличия GTK2.