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
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
2008-04-08 04:09:16 +04:00
|
|
|
*
|
2009-03-14 02:42:32 +03:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _Xutf8_h
|
|
|
|
#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 (
|
|
|
|
Display *dpy,
|
|
|
|
const char *base_font_name_list);
|
|
|
|
|
|
|
|
void
|
|
|
|
XUtf8DrawString(
|
|
|
|
Display *display,
|
|
|
|
Drawable d,
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
GC gc,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const char *string,
|
|
|
|
int num_bytes);
|
|
|
|
|
|
|
|
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);
|
|
|
|
int
|
|
|
|
XUtf8UcsWidth(
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
int
|
|
|
|
XGetUtf8FontAndGlyph(
|
|
|
|
XUtf8FontStruct *font_set,
|
|
|
|
unsigned int ucs,
|
|
|
|
XFontStruct **fnt,
|
|
|
|
unsigned short *id);
|
|
|
|
|
|
|
|
void
|
|
|
|
XFreeUtf8FontStruct(
|
|
|
|
Display *dpy,
|
|
|
|
XUtf8FontStruct *font_set);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
XConvertUtf8ToUcs(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len,
|
|
|
|
unsigned int *ucs);
|
|
|
|
|
|
|
|
int
|
|
|
|
XConvertUcsToUtf8(
|
|
|
|
unsigned int ucs,
|
|
|
|
char *buf);
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8CharByteLen(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len);
|
|
|
|
|
|
|
|
int
|
|
|
|
XCountUtf8Char(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len);
|
|
|
|
|
|
|
|
int
|
|
|
|
XFastConvertUtf8ToUcs(
|
|
|
|
const unsigned char *buf,
|
|
|
|
int len,
|
|
|
|
unsigned int *ucs);
|
|
|
|
|
|
|
|
long
|
|
|
|
XKeysymToUcs(
|
|
|
|
KeySym keysym);
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8LookupString(
|
|
|
|
XIC ic,
|
|
|
|
XKeyPressedEvent* event,
|
|
|
|
char* buffer_return,
|
|
|
|
int bytes_buffer,
|
|
|
|
KeySym* keysym,
|
|
|
|
Status* status_return);
|
|
|
|
|
|
|
|
unsigned short
|
|
|
|
XUtf8IsNonSpacing(
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
unsigned short
|
|
|
|
XUtf8IsRightToLeft(
|
|
|
|
unsigned int ucs);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8Tolower(
|
|
|
|
int ucs);
|
|
|
|
|
|
|
|
int
|
|
|
|
XUtf8Toupper(
|
|
|
|
int ucs);
|
|
|
|
|
|
|
|
|
|
|
|
# ifdef __cplusplus
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
2009-11-18 15:22:51 +03:00
|
|
|
* End of "$Id$".
|
2008-04-08 04:09:16 +04:00
|
|
|
*/
|