Add platform-independent internal UTF-8 header file.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11568 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2016-04-09 17:55:12 +00:00
parent 6dff22f7ff
commit 13d2f30a85
6 changed files with 68 additions and 38 deletions

View File

@ -156,24 +156,6 @@ XUtf8LookupString(
Status* status_return);
#endif
unsigned short
XUtf8IsNonSpacing(
unsigned int ucs);
unsigned short
XUtf8IsRightToLeft(
unsigned int ucs);
int
XUtf8Tolower(
int ucs);
int
XUtf8Toupper(
int ucs);
# ifdef __cplusplus
}
# endif

View File

@ -23,15 +23,12 @@
#include <FL/filename.H>
#include <stdarg.h>
#include <FL/fl_utf8.h>
#include "utf8_internal.h"
#include <string.h>
#include <stdlib.h>
#undef fl_open
extern "C" {
int XUtf8Tolower(int ucs); // in src/xutf8/case.c
unsigned short XUtf8IsNonSpacing(unsigned int ucs); // in src/xutf8/is_spacing.c
}
/** \addtogroup fl_unicode
@{

62
src/utf8_internal.h Normal file
View File

@ -0,0 +1,62 @@
/*
* "$Id$"
*
* Internal UTF-8 header file for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2016 by Bill Spitzak and others.
*
* 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:
*
* http://www.fltk.org/COPYING.php
*
* Please report all bugs and problems on the following page:
*
* http://www.fltk.org/str.php
*/
/*
----------------
Note to editors:
----------------
This file may only contain common, platform-independent function
declarations used internally in FLTK. It may be #included everywhere
in source files in the library, but not in public header files.
*/
#ifndef _SRC__FL_UTF8_H
#define _SRC__FL_UTF8_H
# ifdef __cplusplus
extern "C" {
# endif
unsigned short
XUtf8IsNonSpacing(
unsigned int ucs);
unsigned short
XUtf8IsRightToLeft(
unsigned int ucs);
int
XUtf8Tolower(
int ucs);
int
XUtf8Toupper(
int ucs);
# ifdef __cplusplus
}
# endif
#endif /* _SRC__FL_UTF8_H */
/*
* End of "$Id$".
*/

View File

@ -19,7 +19,7 @@
* This file is required on all platforms for UTF-8 support
*/
#include "../Xutf8.h"
#include "../utf8_internal.h"
#include <stdlib.h>
/* include UCS tables */

View File

@ -14,22 +14,11 @@
* http://www.fltk.org/str.php
*/
#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: utf8 functionality"
#else
#endif
/*
* This file is required on all platforms for utf8 support
* This file is required on all platforms for UTF-8 support
*/
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: do you want to include Xutf8.h? It's written for X11."
#else
# include "../Xutf8.h"
#endif /* !defined(WIN32) && !defined(__APPLE__) */
#include "../utf8_internal.h"
unsigned short
XUtf8IsRightToLeft(unsigned int ucs) {

View File

@ -18,7 +18,7 @@
* This file is required on all platforms for UTF-8 support
*/
#include "../Xutf8.h"
#include "../utf8_internal.h"
/* include UCS tables */
#include "headers/spacing.h"