xft.pas 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. { Original C header:
  2. * include/X11/Xft/Xft.h. Generated from Xft.h.in by configure. */
  3. /*
  4. * Copyright © 2000 Keith Packard
  5. *
  6. * Permission to use, copy, modify, distribute, and sell this software and its
  7. * documentation for any purpose is hereby granted without fee, provided that
  8. * the above copyright notice appear in all copies and that both that
  9. * copyright notice and this permission notice appear in supporting
  10. * documentation, and that the name of Keith Packard not be used in
  11. * advertising or publicity pertaining to distribution of the software without
  12. * specific, written prior permission. Keith Packard makes no
  13. * representations about the suitability of this software for any purpose. It
  14. * is provided "as is" without express or implied warranty.
  15. *
  16. * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  17. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  18. * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  19. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  20. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  21. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  22. * PERFORMANCE OF THIS SOFTWARE.
  23. *}
  24. {
  25. Initial Pascal headers obtained from:
  26. fpGUI - Free Pascal GUI Toolkit
  27. Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
  28. distribution, for details of the copyright.
  29. See the file COPYING.modifiedLGPL, included in this distribution,
  30. for details about redistributing fpGUI.
  31. This program is distributed in the hope that it will be useful,
  32. but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  34. Headers extended and modified by Felipe Monteiro de Carvalho in 2011
  35. Description:
  36. Xft interface functions
  37. }
  38. unit xft;
  39. {$mode objfpc}{$H+}
  40. {$packrecords c}
  41. interface
  42. uses
  43. Classes, SysUtils, X, XLib, Xutil, ctypes, fontconfig, xrender;
  44. //#include FT_FREETYPE_H
  45. //#include <fontconfig/fontconfig.h>
  46. //#include <X11/extensions/Xrender.h>
  47. const
  48. {$IF Defined(DARWIN)}
  49. libXft = 'libXft.dylib';
  50. {$linklib Xft}
  51. {$ELSE}
  52. libXft = 'libXft.so';
  53. {$IFEND}
  54. {* Current Xft version number, set from version in the Xft configure.ac file. *}
  55. XFT_MAJOR = 2;
  56. XFT_MINOR = 2;
  57. XFT_REVISION = 0;
  58. XFT_VERSION = ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION));
  59. XftVersion = XFT_VERSION;
  60. XFT_CORE = 'core';
  61. XFT_RENDER = 'render';
  62. XFT_XLFD = 'xlfd';
  63. XFT_MAX_GLYPH_MEMORY ='maxglyphmemory';
  64. XFT_MAX_UNREF_FONTS = 'maxunreffonts';
  65. type
  66. // extern FT_Library _XftFTlibrary;
  67. TXftFontInfo = record end;
  68. TPicture = longword;
  69. TXftDraw = record end;
  70. PXftDraw = ^TXftDraw;
  71. TXftFont = record
  72. ascent : cint;
  73. descent : cint;
  74. height : cint;
  75. max_advance_width : cint;
  76. ptr1 : PFcCharSet;
  77. ptr2 : PFcPattern;
  78. end;
  79. PXftFont = ^TXftFont;
  80. TXftColor = record
  81. pixel : culong;
  82. color : TXRenderColor;
  83. end;
  84. function XftDrawCreate(display : PXDisplay; win : TXID; vis : PVisual; colorm : longint) : PXftDraw; cdecl; external libXft;
  85. procedure XftDrawChange(xftd : PXftDraw; win : TXID); cdecl; external libXft;
  86. procedure XftDrawDestroy(draw : PXftDraw); cdecl; external libXft;
  87. function XftDrawPicture(draw : PXftDraw) : TPicture; cdecl; external libXft;
  88. function XftFontOpenName(display : PXDisplay; scr : integer; par3 : PChar) : PXftFont; cdecl; external libXft;
  89. procedure XftFontClose(display : PXDisplay; fnt : PXftFont); cdecl; external libXft;
  90. procedure XftDrawStringUtf8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft;
  91. procedure XftDrawString8(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft;
  92. procedure XftDrawString16(draw : PXftDraw; var col : TXftColor; fnt : PXftFont; x,y : integer; txt : PChar; len : integer); cdecl; external libXft;
  93. procedure XftTextExtentsUtf8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft;
  94. procedure XftTextExtents8(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft;
  95. procedure XftTextExtents16(display : PXDisplay; fnt : PXftFont; txt : PChar; len : integer; var extents : TXGlyphInfo); cdecl; external libXft;
  96. //function XftGlyphExists(display : PXDisplay; fnt : PXftFont; ch : integer) : longbool; cdecl; external libXft;
  97. //procedure XftDrawSetClipRectangles(draw : PXftDraw; xorigin, yorigin : integer; rect : PXRectangle; rnum : integer); cdecl; external libXft;
  98. procedure XftDrawSetClip(draw : PXftDraw; rg : TRegion); cdecl; external libXft;
  99. function XftListFonts(display : PXDisplay; screen : integer; params : array of const) : PFcFontSet; cdecl; external libXft;
  100. function XftNameUnparse(pat : PFcPattern; dest : PChar; destlen : integer) : boolean; cdecl; external libXft;
  101. procedure FcFontSetDestroy(fsp : PFcFontSet); cdecl; external libXft;
  102. implementation
  103. end.