2009-11-18 15:22:51 +03:00
|
|
|
/* "$Id$"
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* Author: Jean-Marc Lienher ( http://oksid.ch )
|
2010-11-29 00:12:59 +03:00
|
|
|
* Copyright 2000-2010 by O'ksi'D.
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2011-07-19 08:49:30 +04:00
|
|
|
* This library is free software. Distribution and use rights are outlined in
|
|
|
|
* the file "COPYING" which should have been included with this file. If this
|
|
|
|
* file is missing or damaged, see the license at:
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2011-07-19 08:49:30 +04:00
|
|
|
* http://www.fltk.org/COPYING.php
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* Please report all bugs and problems on the following page:
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* http://www.fltk.org/str.php
|
2008-04-08 04:09:16 +04:00
|
|
|
*/
|
|
|
|
|
2013-09-02 19:05:58 +04:00
|
|
|
#if ! ( defined(_Xutf8_h) || defined(FL_DOXYGEN) )
|
2008-04-08 04:09:16 +04:00
|
|
|
#define _Xutf8_h
|
|
|
|
|
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xlocale.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int nb_font;
|
|
|
|
char **font_name_list;
|
|
|
|
int *encodings;
|
|
|
|
XFontStruct **fonts;
|
|
|
|
Font fid;
|
|
|
|
int ascent;
|
|
|
|
int descent;
|
|
|
|
int *ranges;
|
|
|
|
} XUtf8FontStruct;
|
|
|
|
|
|
|
|
XUtf8FontStruct *
|
|
|
|
XCreateUtf8FontStruct (
|
2011-02-08 01:22:16 +03:00
|
|
|
Display *dpy,
|
|
|
|
const char *base_font_name_list);
|
2008-04-08 04:09:16 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
XUtf8DrawString(
|
|
|
|
Display *display,
|
|
|
|
Drawable d,
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
GC gc,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
void
|
|
|
|
XUtf8_measure_extents(
|
|
|
|
Display *display,
|
|
|
|
Drawable d,
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
GC gc,
|
|
|
|
int *xx,
|
|
|
|
int *yy,
|
|
|
|
int *ww,
|
|
|
|
int *hh,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
|
|
|
|
2008-04-08 04:09:16 +04:00
|
|
|
void
|
|
|
|
XUtf8DrawRtlString(
|
|
|
|
Display *display,
|
|
|
|
Drawable d,
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
GC gc,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
|
|
|
|
|
|
|
void
|
|
|
|
XUtf8DrawImageString(
|
|
|
|
Display *display,
|
|
|
|
Drawable d,
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
GC gc,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8TextWidth(
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XUtf8UcsWidth(
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
int
|
|
|
|
XGetUtf8FontAndGlyph(
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
unsigned int ucs,
|
|
|
|
XFontStruct **fnt,
|
|
|
|
unsigned short *id);
|
2011-02-08 01:22:16 +03:00
|
|
|
|
2008-04-08 04:09:16 +04:00
|
|
|
void
|
|
|
|
XFreeUtf8FontStruct(
|
|
|
|
Display *dpy,
|
|
|
|
XUtf8FontStruct *font_set);
|
|
|
|
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
|
|
|
XConvertUtf8ToUcs(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len,
|
2008-04-08 04:09:16 +04:00
|
|
|
unsigned int *ucs);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XConvertUcsToUtf8(
|
2011-02-08 01:22:16 +03:00
|
|
|
unsigned int ucs,
|
2008-04-08 04:09:16 +04:00
|
|
|
char *buf);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XUtf8CharByteLen(
|
2011-02-08 01:22:16 +03:00
|
|
|
const unsigned char *buf,
|
2008-04-08 04:09:16 +04:00
|
|
|
int len);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XCountUtf8Char(
|
2011-02-08 01:22:16 +03:00
|
|
|
const unsigned char *buf,
|
2008-04-08 04:09:16 +04:00
|
|
|
int len);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
|
|
|
XFastConvertUtf8ToUcs(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len,
|
2008-04-08 04:09:16 +04:00
|
|
|
unsigned int *ucs);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
long
|
2008-04-08 04:09:16 +04:00
|
|
|
XKeysymToUcs(
|
|
|
|
KeySym keysym);
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8LookupString(
|
|
|
|
XIC ic,
|
|
|
|
XKeyPressedEvent* event,
|
|
|
|
char* buffer_return,
|
|
|
|
int bytes_buffer,
|
|
|
|
KeySym* keysym,
|
|
|
|
Status* status_return);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
unsigned short
|
2008-04-08 04:09:16 +04:00
|
|
|
XUtf8IsNonSpacing(
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
unsigned short
|
|
|
|
XUtf8IsRightToLeft(
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XUtf8Tolower(
|
|
|
|
int ucs);
|
|
|
|
|
2011-02-08 01:22:16 +03:00
|
|
|
int
|
2008-04-08 04:09:16 +04:00
|
|
|
XUtf8Toupper(
|
|
|
|
int ucs);
|
|
|
|
|
|
|
|
|
|
|
|
# ifdef __cplusplus
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
2009-11-18 15:22:51 +03:00
|
|
|
* End of "$Id$".
|
2011-02-08 01:22:16 +03:00
|
|
|
*/
|